Skip to content
...@@ -2274,7 +2274,7 @@ ivas_error init_encoder( ...@@ -2274,7 +2274,7 @@ ivas_error init_encoder(
const ISM_MODE ism_mode /* i : ISM mode */ const ISM_MODE ism_mode /* i : ISM mode */
#ifdef IGF_MEMORY_ALLOC_OPT #ifdef IGF_MEMORY_ALLOC_OPT
, ,
const int32_t element_brate const int32_t element_brate /* element bitrate */
#endif #endif
); );
...@@ -4089,7 +4089,7 @@ void AVQ_encmux( ...@@ -4089,7 +4089,7 @@ void AVQ_encmux(
void ordr_esti( void ordr_esti(
const int16_t k, /* i : sub-vector index */ const int16_t k, /* i : sub-vector index */
int16_t *Mpos, /* i/o: dominant sub-vector position from ACV */ int16_t *Mpos, /* i/o: dominant sub-vector position from ACV */
int16_t svOrder[], /* i/o: AVQ sub-vecotr order */ int16_t svOrder[], /* i/o: AVQ sub-vector order */
const int16_t Nsv /* i : total sub-vectors in a sub-frames */ const int16_t Nsv /* i : total sub-vectors in a sub-frames */
); );
......
...@@ -220,7 +220,6 @@ ivas_error evs_dec( ...@@ -220,7 +220,6 @@ ivas_error evs_dec(
} }
} }
if ( st->codec_mode == MODE1 ) if ( st->codec_mode == MODE1 )
{ {
/*------------------------------------------------------------------* /*------------------------------------------------------------------*
...@@ -252,7 +251,6 @@ ivas_error evs_dec( ...@@ -252,7 +251,6 @@ ivas_error evs_dec(
return error; return error;
} }
/*---------------------------------------------------------------------* /*---------------------------------------------------------------------*
* ACELP core decoding * ACELP core decoding
* HQ core decoding * HQ core decoding
......
...@@ -186,7 +186,6 @@ ivas_error init_decoder( ...@@ -186,7 +186,6 @@ ivas_error init_decoder(
st->old_bfi_cnt = 0; st->old_bfi_cnt = 0;
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* parameters for AC mode (GSC) * parameters for AC mode (GSC)
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -247,7 +246,6 @@ ivas_error init_decoder( ...@@ -247,7 +246,6 @@ ivas_error init_decoder(
st->hPFstat = NULL; st->hPFstat = NULL;
} }
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* HF (6-7kHz) (zero) BWE parameters * HF (6-7kHz) (zero) BWE parameters
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -356,7 +354,6 @@ ivas_error init_decoder( ...@@ -356,7 +354,6 @@ ivas_error init_decoder(
st->hHQ_nbfec = NULL; st->hHQ_nbfec = NULL;
} }
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* TBE parameters * TBE parameters
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -719,9 +716,7 @@ ivas_error init_decoder( ...@@ -719,9 +716,7 @@ ivas_error init_decoder(
} }
st->cngTDLevel = 0.f; st->cngTDLevel = 0.f;
st->lp_noise = -20.0f; st->lp_noise = -20.0f;
st->force_lpd_reset = 0; st->force_lpd_reset = 0;
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
......
...@@ -394,7 +394,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( ...@@ -394,7 +394,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
#endif #endif
if ( isLoudspeaker ) if ( isLoudspeaker )
{ {
hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp]; hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp];
...@@ -417,7 +416,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( ...@@ -417,7 +416,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps ); set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps );
set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps ); set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps );
#endif #endif
if ( isLoudspeaker ) if ( isLoudspeaker )
{ {
hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp]; hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp];
...@@ -480,6 +478,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( ...@@ -480,6 +478,7 @@ static ivas_error ivas_binRenderer_convModuleOpen(
return IVAS_ERR_OK; return IVAS_ERR_OK;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_init_binaural_hrtf() * ivas_init_binaural_hrtf()
* *
...@@ -763,7 +762,6 @@ static ivas_error ivas_binaural_hrtf_open( ...@@ -763,7 +762,6 @@ static ivas_error ivas_binaural_hrtf_open(
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for FastConv HRTF tables" ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for FastConv HRTF tables" );
} }
ivas_init_binaural_hrtf( HrtfFastConv ); ivas_init_binaural_hrtf( HrtfFastConv );
if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV )
...@@ -855,6 +853,7 @@ static ivas_error ivas_binaural_hrtf_open( ...@@ -855,6 +853,7 @@ static ivas_error ivas_binaural_hrtf_open(
return IVAS_ERR_OK; return IVAS_ERR_OK;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_binaural_obtain_DMX() * ivas_binaural_obtain_DMX()
* *
...@@ -1028,7 +1027,10 @@ ivas_error ivas_rend_openCldfbRend( ...@@ -1028,7 +1027,10 @@ ivas_error ivas_rend_openCldfbRend(
hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; hBinRenderer->hInputSetup->is_loudspeaker_setup = 0;
hBinRenderer->hInputSetup->output_config = inConfig; hBinRenderer->hInputSetup->output_config = inConfig;
getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); if ( ( error = getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ) ) != IVAS_ERR_OK )
{
return error;
}
if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
...@@ -1158,12 +1160,11 @@ ivas_error ivas_binRenderer_open( ...@@ -1158,12 +1160,11 @@ ivas_error ivas_binRenderer_open(
IVAS_OUTPUT_SETUP out_setup; IVAS_OUTPUT_SETUP out_setup;
/* Allocate memories and buffers needed for convolutional module in CICP19 */ /* Allocate memories and buffers needed for convolutional module in CICP19 */
if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv, hBinRenderer->numPoses ) ) != IVAS_ERR_OK )
hBinRenderer->numPoses #else
if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
#endif #endif
) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1184,12 +1185,11 @@ ivas_error ivas_binRenderer_open( ...@@ -1184,12 +1185,11 @@ ivas_error ivas_binRenderer_open(
else else
{ {
/* Allocate memories and buffers needed for convolutional module */ /* Allocate memories and buffers needed for convolutional module */
if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv, hBinRenderer->numPoses ) ) != IVAS_ERR_OK )
hBinRenderer->numPoses #else
if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
#endif #endif
) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1230,9 +1230,7 @@ ivas_error ivas_binRenderer_open( ...@@ -1230,9 +1230,7 @@ ivas_error ivas_binRenderer_open(
/* Allocate memories needed for reverb module */ /* Allocate memories needed for reverb module */
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{ {
if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, RENDERER_BINAURAL_FASTCONV, st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
RENDERER_BINAURAL_FASTCONV,
st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1335,7 +1333,6 @@ static void ivas_binRenderer_convModuleClose( ...@@ -1335,7 +1333,6 @@ static void ivas_binRenderer_convModuleClose(
free( hBinRenConvModule->filterTapsRightImag ); free( hBinRenConvModule->filterTapsRightImag );
hBinRenConvModule->filterTapsRightImag = NULL; hBinRenConvModule->filterTapsRightImag = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
for ( posIdx = 0; posIdx < num_poses; posIdx++ ) for ( posIdx = 0; posIdx < num_poses; posIdx++ )
{ {
...@@ -1418,12 +1415,11 @@ void ivas_binRenderer_close( ...@@ -1418,12 +1415,11 @@ void ivas_binRenderer_close(
if ( ( *hBinRenderer )->hBinRenConvModule != NULL ) if ( ( *hBinRenderer )->hBinRenConvModule != NULL )
{ {
ivas_binRenderer_convModuleClose( hBinRenderer
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, ivas_binRenderer_convModuleClose( hBinRenderer, ( *hBinRenderer )->numPoses );
( *hBinRenderer )->numPoses #else
ivas_binRenderer_convModuleClose( hBinRenderer );
#endif #endif
);
} }
if ( ( *hBinRenderer )->hReverb != NULL ) if ( ( *hBinRenderer )->hReverb != NULL )
...@@ -1437,6 +1433,7 @@ void ivas_binRenderer_close( ...@@ -1437,6 +1433,7 @@ void ivas_binRenderer_close(
return; return;
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* ivas_free_pppHrtfMem() * ivas_free_pppHrtfMem()
* *
...@@ -1617,10 +1614,7 @@ void ivas_binaural_cldfb( ...@@ -1617,10 +1614,7 @@ void ivas_binaural_cldfb(
} }
else else
{ {
cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), Cldfb_RealBuffer[idx_in][slot_idx], Cldfb_ImagBuffer[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] );
Cldfb_RealBuffer[idx_in][slot_idx],
Cldfb_ImagBuffer[idx_in][slot_idx],
maxBand, st_ivas->cldfbAnaDec[idx_in] );
idx_in++; idx_in++;
} }
} }
...@@ -1649,19 +1643,15 @@ void ivas_binaural_cldfb( ...@@ -1649,19 +1643,15 @@ void ivas_binaural_cldfb(
} }
/* Implement binaural rendering */ /* Implement binaural rendering */
ivas_binRenderer(
st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData,
#endif
st_ivas->hCombinedOrientationData,
subframeIdx,
JBM_CLDFB_SLOTS_IN_SUBFRAME,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL, ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, NULL, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif
#else
ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif #endif
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
Cldfb_RealBuffer, Cldfb_ImagBuffer );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -1826,18 +1816,11 @@ void ivas_binaural_cldfb_sf( ...@@ -1826,18 +1816,11 @@ void ivas_binaural_cldfb_sf(
} }
/* Implement binaural rendering */ /* Implement binaural rendering */
ivas_binRenderer(
st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif #endif
st_ivas->hCombinedOrientationData,
subframeIdx,
st_ivas->hTcBuffer->subframe_nbslots[subframeIdx],
Cldfb_RealBuffer_Binaural,
Cldfb_ImagBuffer_Binaural,
Cldfb_RealBuffer,
Cldfb_ImagBuffer );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -2055,6 +2038,7 @@ void ivas_binRenderer( ...@@ -2055,6 +2038,7 @@ void ivas_binRenderer(
float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
float inRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float inRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
float inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm ); ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm );
for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
...@@ -2090,7 +2074,6 @@ void ivas_binRenderer( ...@@ -2090,7 +2074,6 @@ void ivas_binRenderer(
} }
pop_wmops(); pop_wmops();
return; return;
} }
...@@ -2111,7 +2094,7 @@ void ivas_rend_CldfbMultiBinRendProcess( ...@@ -2111,7 +2094,7 @@ void ivas_rend_CldfbMultiBinRendProcess(
float Cldfb_Out_Real[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_Out_Real[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */
float Cldfb_Out_Imag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Imag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
const int16_t low_res_pre_rend_rot, const int16_t low_res_pre_rend_rot,
int16_t num_subframes ) const int16_t num_subframes )
{ {
int16_t slot_idx, ch_idx, idx, pose_idx, i, j; int16_t slot_idx, ch_idx, idx, pose_idx, i, j;
int16_t sf_idx; int16_t sf_idx;
...@@ -2160,15 +2143,11 @@ void ivas_rend_CldfbMultiBinRendProcess( ...@@ -2160,15 +2143,11 @@ void ivas_rend_CldfbMultiBinRendProcess(
head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx );
#endif #endif
ivas_binRenderer( hCldfbRend,
pMultiBinPoseData,
*pCombinedOrientationData,
sf_idx,
MAX_PARAM_SPATIAL_SUBFRAMES,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
&head_track_post, ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, sf_idx, MAX_PARAM_SPATIAL_SUBFRAMES, &head_track_post, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn );
#else
ivas_binRenderer( hCldfbRend, pMultiBinPoseData, *pCombinedOrientationData, sf_idx, MAX_PARAM_SPATIAL_SUBFRAMES, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn );
#endif #endif
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn );
for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ )
{ {
......
...@@ -97,7 +97,6 @@ ivas_error ivas_core_dec( ...@@ -97,7 +97,6 @@ ivas_error ivas_core_dec(
ivas_error error; ivas_error error;
error = IVAS_ERR_OK; error = IVAS_ERR_OK;
push_wmops( "ivas_core_dec" ); push_wmops( "ivas_core_dec" );
/*------------------------------------------------------------------* /*------------------------------------------------------------------*
...@@ -334,7 +333,6 @@ ivas_error ivas_core_dec( ...@@ -334,7 +333,6 @@ ivas_error ivas_core_dec(
return error; return error;
} }
flag_sec_CNA = -1; flag_sec_CNA = -1;
if ( hCPE != NULL ) if ( hCPE != NULL )
{ {
...@@ -469,7 +467,6 @@ ivas_error ivas_core_dec( ...@@ -469,7 +467,6 @@ ivas_error ivas_core_dec(
return error; return error;
} }
/* for FD-CNG we need the delay compensation in the synth, so do this afterwards */ /* for FD-CNG we need the delay compensation in the synth, so do this afterwards */
if ( sba_dirac_stereo_flag && hSCE && st->core_brate == SID_2k40 && st->cng_type == FD_CNG ) if ( sba_dirac_stereo_flag && hSCE && st->core_brate == SID_2k40 && st->cng_type == FD_CNG )
{ {
...@@ -652,8 +649,7 @@ ivas_error ivas_core_dec( ...@@ -652,8 +649,7 @@ ivas_error ivas_core_dec(
mvr2r( tmp_buffer, st->hb_prev_synth_buffer, tmps ); mvr2r( tmp_buffer, st->hb_prev_synth_buffer, tmps );
} }
if ( ( st->element_mode != IVAS_CPE_TD && !use_cldfb_for_dft ) /* IVAS-19: the logic seems to be not consistent between TD and DFT stereo and SCE -> verification needed also whether 1) it is correct here and 2) the DFT->(LR)TD transition is correct */ if ( ( st->element_mode != IVAS_CPE_TD && !use_cldfb_for_dft ) || ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
|| ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
{ {
/* Delay hb_synth */ /* Delay hb_synth */
delay_signal( hb_synth[n], output_frame, st->hb_prev_synth_buffer, tmps ); delay_signal( hb_synth[n], output_frame, st->hb_prev_synth_buffer, tmps );
......
...@@ -237,6 +237,7 @@ ivas_error ivas_corecoder_dec_reconfig( ...@@ -237,6 +237,7 @@ ivas_error ivas_corecoder_dec_reconfig(
{ {
st_ivas->element_mode_init = IVAS_CPE_MDCT; st_ivas->element_mode_init = IVAS_CPE_MDCT;
} }
if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_CPE ) ) != IVAS_ERR_OK ) if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_CPE ) ) != IVAS_ERR_OK )
{ {
return error; return error;
......
...@@ -389,10 +389,7 @@ ivas_error ivas_cpe_dec( ...@@ -389,10 +389,7 @@ ivas_error ivas_cpe_dec(
{ {
if ( !st_ivas->bfi ) if ( !st_ivas->bfi )
{ {
tdm_configure_dec( tdm_configure_dec( st_ivas->ivas_format, st_ivas->ism_mode, hCPE, &tdm_ratio_idx, nb_bits_metadata );
st_ivas->ivas_format,
st_ivas->ism_mode,
hCPE, &tdm_ratio_idx, nb_bits_metadata );
sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC ); sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC );
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
ivas_error ivas_dec( ivas_error ivas_dec(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -74,7 +74,7 @@ ivas_error ivas_dec( ...@@ -74,7 +74,7 @@ ivas_error ivas_dec(
ivas_error error; ivas_error error;
int16_t num_md_sub_frames; int16_t num_md_sub_frames;
int32_t ism_total_brate; int32_t ism_total_brate;
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t nchan_out_syn_output; int16_t nchan_out_syn_output;
#endif #endif
...@@ -105,7 +105,7 @@ ivas_error ivas_dec( ...@@ -105,7 +105,7 @@ ivas_error ivas_dec(
return error; return error;
} }
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------* /*----------------------------------------------------------------*
* Binaural split rendering setup * Binaural split rendering setup
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
...@@ -313,12 +313,11 @@ ivas_error ivas_dec( ...@@ -313,12 +313,11 @@ ivas_error ivas_dec(
} }
else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
{ {
if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES, 0 ) ) != IVAS_ERR_OK )
0 #else
if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
#endif #endif
) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -754,7 +753,11 @@ ivas_error ivas_dec( ...@@ -754,7 +753,11 @@ ivas_error ivas_dec(
{ {
for ( n = 0; n < nchan_ism; n++ ) for ( n = 0; n < nchan_ism; n++ )
{ {
delay_signal( p_output[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); #ifdef FIX_782_OSBA_FUNCTION_NAMES
delay_signal( p_output[n], output_frame, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size );
#else
delay_signal( output[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size );
#endif
} }
} }
...@@ -819,15 +822,12 @@ ivas_error ivas_dec( ...@@ -819,15 +822,12 @@ ivas_error ivas_dec(
} }
else else
{ {
#endif
if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig,
st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES, 0 ) ) != IVAS_ERR_OK )
#ifdef SPLIT_REND_WITH_HEAD_ROT #else
, if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig,
0 st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
#endif #endif
) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1091,7 +1091,7 @@ ivas_error ivas_dec( ...@@ -1091,7 +1091,7 @@ ivas_error ivas_dec(
* - float to integer conversion * - float to integer conversion
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{ {
nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses;
...@@ -1105,17 +1105,15 @@ ivas_error ivas_dec( ...@@ -1105,17 +1105,15 @@ ivas_error ivas_dec(
#endif #endif
{ {
#ifndef DISABLE_LIMITER #ifndef DISABLE_LIMITER
ivas_limiter_dec( st_ivas->hLimiter, p_output, #ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out_syn_output, output_frame, st_ivas->BER_detect );
nchan_out_syn_output,
#else #else
nchan_out, ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, output_frame, st_ivas->BER_detect );
#endif #endif
output_frame, st_ivas->BER_detect );
#endif #endif
} }
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
switch ( pcm_resolution ) switch ( pcm_resolution )
{ {
case PCM_INT16: case PCM_INT16:
...@@ -1123,18 +1121,13 @@ ivas_error ivas_dec( ...@@ -1123,18 +1121,13 @@ ivas_error ivas_dec(
#ifdef DEBUGGING #ifdef DEBUGGING
st_ivas->noClipping += st_ivas->noClipping +=
#endif #endif
ivas_syn_output( p_output, output_frame, #ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT ivas_syn_output( p_output, output_frame, nchan_out_syn_output, (int16_t *) data );
nchan_out_syn_output,
#else #else
nchan_out, ivas_syn_output( p_output, output_frame, nchan_out, data );
#endif
#if defined SPLIT_REND_WITH_HEAD_ROT
(int16_t *)
#endif #endif
data );
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
break; break;
case PCM_FLOAT32: case PCM_FLOAT32:
ivas_syn_output_f( p_output, output_frame, nchan_out_syn_output, (float *) data ); ivas_syn_output_f( p_output, output_frame, nchan_out_syn_output, (float *) data );
...@@ -1144,6 +1137,7 @@ ivas_error ivas_dec( ...@@ -1144,6 +1137,7 @@ ivas_error ivas_dec(
break; break;
} }
#endif #endif
/*----------------------------------------------------------------* /*----------------------------------------------------------------*
* Common updates * Common updates
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
......
...@@ -174,7 +174,6 @@ void ivas_decision_matrix_dec( ...@@ -174,7 +174,6 @@ void ivas_decision_matrix_dec(
} }
else if ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD ) else if ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD )
{ {
*sharpFlag = 0; *sharpFlag = 0;
if ( st->coder_type == GENERIC || st->coder_type == VOICED ) if ( st->coder_type == GENERIC || st->coder_type == VOICED )
{ {
...@@ -256,8 +255,7 @@ void ivas_decision_matrix_dec( ...@@ -256,8 +255,7 @@ void ivas_decision_matrix_dec(
} }
else if ( st->bwidth == SWB || st->bwidth == FB ) else if ( st->bwidth == SWB || st->bwidth == FB )
{ {
if ( st->total_brate >= MIN_BRATE_SWB_BWE /*&& (*coder_type != AUDIO || st->total_brate >= (MIN_BWE_PRI_BRATE+600))*/ if ( st->total_brate >= MIN_BRATE_SWB_BWE || ( st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB && st->tdm_LRTD_flag ) || ( element_brate < IVAS_16k4 && st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB ) )
|| ( st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB && st->tdm_LRTD_flag ) || ( element_brate < IVAS_16k4 && st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB ) )
{ {
/* read the SWB TBE/BWE selection bit */ /* read the SWB TBE/BWE selection bit */
tmp = get_next_indice( st, 1 ); tmp = get_next_indice( st, 1 );
......
...@@ -92,7 +92,6 @@ static ivas_error ivas_dirac_dec_config_internal( ...@@ -92,7 +92,6 @@ static ivas_error ivas_dirac_dec_config_internal(
st_ivas->hDirAC = hDirAC; st_ivas->hDirAC = hDirAC;
} }
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* DirAC main configuration * DirAC main configuration
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -112,6 +111,7 @@ static ivas_error ivas_dirac_dec_config_internal( ...@@ -112,6 +111,7 @@ static ivas_error ivas_dirac_dec_config_internal(
return error; return error;
} }
static ivas_error ivas_dirac_rend_config( static ivas_error ivas_dirac_rend_config(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
const DIRAC_CONFIG_FLAG flag_config_inp, /* i/ : Flag determining if we open or reconfigure the DirAC decoder */ const DIRAC_CONFIG_FLAG flag_config_inp, /* i/ : Flag determining if we open or reconfigure the DirAC decoder */
...@@ -598,15 +598,8 @@ static ivas_error ivas_dirac_rend_config( ...@@ -598,15 +598,8 @@ static ivas_error ivas_dirac_rend_config(
if ( ( flag_config == DIRAC_OPEN && hDirACRend->proto_signal_decorr_on ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirACRend->proto_signal_decorr_on && !proto_signal_decorr_on_old ) ) ) if ( ( flag_config == DIRAC_OPEN && hDirACRend->proto_signal_decorr_on ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirACRend->proto_signal_decorr_on && !proto_signal_decorr_on_old ) ) )
{ {
if ( ( error = ivas_dirac_dec_decorr_open( &( hDirACRend->h_freq_domain_decorr_ap_params ), if ( ( error = ivas_dirac_dec_decorr_open( &( hDirACRend->h_freq_domain_decorr_ap_params ), &( hDirACRend->h_freq_domain_decorr_ap_state ), hSpatParamRendCom->num_freq_bands, hDirACRend->num_outputs_diff,
&( hDirACRend->h_freq_domain_decorr_ap_state ), hDirACRend->num_protos_diff, hDirACRend->synthesisConf, hDirACRend->frequency_axis, nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
hSpatParamRendCom->num_freq_bands,
hDirACRend->num_outputs_diff,
hDirACRend->num_protos_diff,
hDirACRend->synthesisConf,
hDirACRend->frequency_axis,
nchan_transport > 2 ? 4 : nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -687,11 +680,11 @@ static ivas_error ivas_dirac_rend_config( ...@@ -687,11 +680,11 @@ static ivas_error ivas_dirac_rend_config(
} }
} }
if ( flag_config == DIRAC_OPEN ) if ( flag_config == DIRAC_OPEN )
{ {
hDirACRend->buffer_energy = NULL; hDirACRend->buffer_energy = NULL;
} }
if ( ( flag_config == DIRAC_OPEN && hDirAC->hConfig->dec_param_estim == TRUE ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->hConfig->dec_param_estim == TRUE && dec_param_estim_old == FALSE ) ) ) if ( ( flag_config == DIRAC_OPEN && hDirAC->hConfig->dec_param_estim == TRUE ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->hConfig->dec_param_estim == TRUE && dec_param_estim_old == FALSE ) ) )
{ {
hDirACRend->index_buffer_intensity = 0; hDirACRend->index_buffer_intensity = 0;
...@@ -790,7 +783,6 @@ ivas_error ivas_dirac_dec_config( ...@@ -790,7 +783,6 @@ ivas_error ivas_dirac_dec_config(
hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order );
dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE; dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE;
sparfoa_flag = 0; sparfoa_flag = 0;
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag )
{ {
...@@ -942,19 +934,11 @@ ivas_error ivas_dirac_dec_config( ...@@ -942,19 +934,11 @@ ivas_error ivas_dirac_dec_config(
ivas_dirac_dec_get_frequency_axis( frequency_axis, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSpatParamRendCom->num_freq_bands ); ivas_dirac_dec_get_frequency_axis( frequency_axis, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSpatParamRendCom->num_freq_bands );
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params ), if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS,
&( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state ),
#else #else
if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params ), if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS,
&( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state ),
#endif #endif
st_ivas->hSpatParamRendCom->num_freq_bands, DIRAC_SYNTHESIS_PSD_LS, frequency_axis, BINAURAL_CHANNELS, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
BINAURAL_CHANNELS,
BINAURAL_CHANNELS,
DIRAC_SYNTHESIS_PSD_LS,
frequency_axis,
BINAURAL_CHANNELS,
st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1632,8 +1616,7 @@ void ivas_dirac_dec_set_md_map( ...@@ -1632,8 +1616,7 @@ void ivas_dirac_dec_set_md_map(
void ivas_dirac_dec( void ivas_dirac_dec(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */
const int16_t nchan_transport /* i : number of transport channels */ const int16_t nchan_transport, /* i : number of transport channels */
,
const int16_t num_subframes /* i : number of subframes to render */ const int16_t num_subframes /* i : number of subframes to render */
) )
{ {
...@@ -2440,11 +2423,11 @@ void ivas_dirac_dec_render_sf( ...@@ -2440,11 +2423,11 @@ void ivas_dirac_dec_render_sf(
#endif #endif
/* Perform binaural rendering */ /* Perform binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframe_idx, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframe_idx, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif #endif
st_ivas->hCombinedOrientationData, subframe_idx, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -51,7 +51,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
const int16_t nchan_transport_old, /* i : last number of transport channels */ const int16_t nchan_transport_old, /* i : last number of transport channels */
const ISM_MODE last_ism_mode, /* i : last ISM mode */ const ISM_MODE last_ism_mode, /* i : last ISM mode */
uint16_t *nSamplesRendered, /* o : number of samples rendered */ uint16_t *nSamplesRendered, /* o : number of samples rendered */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -83,8 +83,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -83,8 +83,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
st_ivas->ism_mode = ism_mode; st_ivas->ism_mode = ism_mode;
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas ); nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas );
if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
0 ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -121,7 +120,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -121,7 +120,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
/* select the renderer */ /* select the renderer */
ivas_renderer_select( st_ivas ); ivas_renderer_select( st_ivas );
ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config );
if ( ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) && ( st_ivas->ism_mode == ISM_MODE_DISC ) ) if ( ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) && ( st_ivas->ism_mode == ISM_MODE_DISC ) )
{ {
ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config );
...@@ -142,10 +143,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -142,10 +143,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
/* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv
render what still fits in the new granularity */ render what still fits in the new granularity */
tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs );
if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
{ {
if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution, pcm_resolution,
#endif #endif
data ) ) != IVAS_ERR_OK ) data ) ) != IVAS_ERR_OK )
...@@ -242,12 +244,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -242,12 +244,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
#endif #endif
/* Open Crend Binaural renderer */ /* Open Crend Binaural renderer */
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses #else
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif #endif
) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -330,12 +331,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -330,12 +331,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
} }
/* close the crend binaural renderer */ /* close the crend binaural renderer */
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper )
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses );
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses #else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif #endif
);
} }
} }
...@@ -439,7 +439,7 @@ ivas_error ivas_ism_dec_config( ...@@ -439,7 +439,7 @@ ivas_error ivas_ism_dec_config(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
const ISM_MODE last_ism_mode, /* i/o: last ISM mode */ const ISM_MODE last_ism_mode, /* i/o: last ISM mode */
uint16_t *nSamplesRendered, /* o : number of samples flushed when the renderer granularity changes */ uint16_t *nSamplesRendered, /* o : number of samples flushed when the renderer granularity changes */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -484,7 +484,7 @@ ivas_error ivas_ism_dec_config( ...@@ -484,7 +484,7 @@ ivas_error ivas_ism_dec_config(
if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) ) if ( ( st_ivas->ism_mode != last_ism_mode ) || ( st_ivas->hDecoderConfig->ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) )
{ {
if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution, pcm_resolution,
#endif #endif
data ) ) != IVAS_ERR_OK ) data ) ) != IVAS_ERR_OK )
...@@ -511,7 +511,7 @@ ivas_error ivas_ism_dec_config( ...@@ -511,7 +511,7 @@ ivas_error ivas_ism_dec_config(
if ( st_ivas->ism_mode != last_ism_mode ) if ( st_ivas->ism_mode != last_ism_mode )
{ {
if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution, pcm_resolution,
#endif #endif
data ) ) != IVAS_ERR_OK ) data ) ) != IVAS_ERR_OK )
......
...@@ -96,11 +96,11 @@ ivas_error ivas_ism_dtx_dec( ...@@ -96,11 +96,11 @@ ivas_error ivas_ism_dtx_dec(
st_ivas->ism_mode = ism_mode_bstr; st_ivas->ism_mode = ism_mode_bstr;
} }
if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, #ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, PCM_NOT_KNOW, NULL ) ) != IVAS_ERR_OK )
PCM_NOT_KNOW, #else
if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, NULL ) ) != IVAS_ERR_OK )
#endif #endif
NULL ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
......
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
static void decode_angle_indices( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, const int16_t non_diegetic_flag, int16_t *flag_abs_azimuth ); static void decode_angle_indices( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, const int16_t non_diegetic_flag, int16_t *flag_abs_azimuth );
static int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int16_t *flag_abs_radius ); static int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int16_t *flag_abs_radius );
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* Local constants * Local constants
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
...@@ -580,8 +580,7 @@ ivas_error ivas_ism_metadata_dec( ...@@ -580,8 +580,7 @@ ivas_error ivas_ism_metadata_dec(
} }
} }
if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, ism_extmeta_bitstream, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata, if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, ism_extmeta_bitstream, null_metadata_flag, ism_imp, element_brate, total_brate, nb_bits_metadata, masa_ism_flag ) ) != IVAS_ERR_OK )
masa_ism_flag ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -698,8 +697,7 @@ ivas_error ivas_ism_metadata_dec_create( ...@@ -698,8 +697,7 @@ ivas_error ivas_ism_metadata_dec_create(
if ( element_brate_tmp != NULL ) if ( element_brate_tmp != NULL )
{ {
if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
0 ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
......
...@@ -95,6 +95,7 @@ static void ivas_param_ism_dec_dequant_powrat( ...@@ -95,6 +95,7 @@ static void ivas_param_ism_dec_dequant_powrat(
return; return;
} }
static void ivas_ism_get_interpolator( static void ivas_ism_get_interpolator(
const int16_t subframe_nbslots, const int16_t subframe_nbslots,
float *interpolator ) float *interpolator )
...@@ -276,6 +277,7 @@ static void ivas_param_ism_compute_mixing_matrix( ...@@ -276,6 +277,7 @@ static void ivas_param_ism_compute_mixing_matrix(
} }
direct_power[w] = sqrtf( direct_power[w] ); direct_power[w] = sqrtf( direct_power[w] );
} }
/* Compute mixing matrix */ /* Compute mixing matrix */
computeMixingMatricesISM( nchan_transport, num_wave, nchan_out_woLFE, response_matrix, direct_power, cx_diag[bin_idx], cy_diag, proto_matrix, 1, computeMixingMatricesISM( nchan_transport, num_wave, nchan_out_woLFE, response_matrix, direct_power, cx_diag[bin_idx], cy_diag, proto_matrix, 1,
PARAM_MC_REG_SX, PARAM_MC_REG_GHAT, mixing_matrix[bin_idx] ); PARAM_MC_REG_SX, PARAM_MC_REG_GHAT, mixing_matrix[bin_idx] );
...@@ -872,12 +874,12 @@ void ivas_param_ism_dec( ...@@ -872,12 +874,12 @@ void ivas_param_ism_dec(
} }
} }
} }
ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, p_tc ); ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, p_tc );
for ( ch = 0; ch < nchan_transport; ch++ ) for ( ch = 0; ch < nchan_transport; ch++ )
{ {
/*-----------------------------------------------------------------* /* CLDFB Analysis */
* CLDFB Analysis
*-----------------------------------------------------------------*/
for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ )
{ {
cldfbAnalysis_ts( &( output_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); cldfbAnalysis_ts( &( output_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] );
...@@ -894,6 +896,7 @@ void ivas_param_ism_dec( ...@@ -894,6 +896,7 @@ void ivas_param_ism_dec(
/* Compute mixing matrix */ /* Compute mixing matrix */
ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hDirAC, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, mixing_matrix ); ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hDirAC, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, mixing_matrix );
/* subframe loop for synthesis*/ /* subframe loop for synthesis*/
for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ ) for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ )
{ {
...@@ -990,7 +993,6 @@ void ivas_ism_dec_digest_tc( ...@@ -990,7 +993,6 @@ void ivas_ism_dec_digest_tc(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
) )
{ {
ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
if ( st_ivas->renderer_type == RENDERER_TD_PANNING || if ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
...@@ -1027,6 +1029,7 @@ void ivas_ism_dec_digest_tc( ...@@ -1027,6 +1029,7 @@ void ivas_ism_dec_digest_tc(
{ {
ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator );
} }
/* also get the gains here */ /* also get the gains here */
num_objects = st_ivas->nchan_transport; num_objects = st_ivas->nchan_transport;
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
...@@ -1035,10 +1038,7 @@ void ivas_ism_dec_digest_tc( ...@@ -1035,10 +1038,7 @@ void ivas_ism_dec_digest_tc(
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{ {
ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &st_ivas->hIsmRendererData->gains[i][0], &st_ivas->hIsmRendererData->gains[i][1] );
st_ivas->hIsmMetaData[i]->elevation,
&st_ivas->hIsmRendererData->gains[i][0],
&st_ivas->hIsmRendererData->gains[i][1] );
} }
else else
{ {
...@@ -1219,6 +1219,7 @@ void ivas_param_ism_dec_digest_tc( ...@@ -1219,6 +1219,7 @@ void ivas_param_ism_dec_digest_tc(
mvr2r( RealBuffer, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( RealBuffer, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
mvr2r( ImagBuffer, &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( ImagBuffer, &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
} }
ivas_param_ism_collect_slot( hDirAC, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag ); ivas_param_ism_collect_slot( hDirAC, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag );
} }
} }
...@@ -1260,7 +1261,6 @@ void ivas_ism_param_dec_tc_gain_ajust( ...@@ -1260,7 +1261,6 @@ void ivas_ism_param_dec_tc_gain_ajust(
ene_sum = 0.0f; ene_sum = 0.0f;
last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain; last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain;
for ( i = 0; i < nSamples; i++ ) for ( i = 0; i < nSamples; i++ )
{ {
ene_tc += transport_channels_f[0][i] * transport_channels_f[0][i] + transport_channels_f[1][i] * transport_channels_f[1][i]; // L*L + R*R ene_tc += transport_channels_f[0][i] * transport_channels_f[0][i] + transport_channels_f[1][i] * transport_channels_f[1][i]; // L*L + R*R
...@@ -1292,11 +1292,13 @@ void ivas_ism_param_dec_tc_gain_ajust( ...@@ -1292,11 +1292,13 @@ void ivas_ism_param_dec_tc_gain_ajust(
transport_channels_f[1][i] *= gain; transport_channels_f[1][i] *= gain;
} }
} }
st_ivas->hDirAC->hParamIsm->last_dmx_gain = gain; st_ivas->hDirAC->hParamIsm->last_dmx_gain = gain;
return; return;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_ism_param_dec_render_sf() * ivas_ism_param_dec_render_sf()
* *
...@@ -1320,7 +1322,6 @@ static void ivas_ism_param_dec_render_sf( ...@@ -1320,7 +1322,6 @@ static void ivas_ism_param_dec_render_sf(
float *Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX]; float *Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX];
DIRAC_DEC_HANDLE hDirAC; DIRAC_DEC_HANDLE hDirAC;
SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
int16_t slot_idx_start; int16_t slot_idx_start;
int16_t idx_in; int16_t idx_in;
int16_t idx_lfe; int16_t idx_lfe;
...@@ -1353,8 +1354,7 @@ static void ivas_ism_param_dec_render_sf( ...@@ -1353,8 +1354,7 @@ static void ivas_ism_param_dec_render_sf(
/* Compute bandwise rendering to target LS using covariance rendering */ /* Compute bandwise rendering to target LS using covariance rendering */
ivas_param_ism_render_slot( hDirAC, hSpatParamRendCom, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, ivas_param_ism_render_slot( hDirAC, hSpatParamRendCom, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in,
Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirAC->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirAC->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, nchan_out_woLFE, nchan_transport );
nchan_out_woLFE, nchan_transport );
} }
/* CLDFB Synthesis */ /* CLDFB Synthesis */
...@@ -1382,8 +1382,8 @@ static void ivas_ism_param_dec_render_sf( ...@@ -1382,8 +1382,8 @@ static void ivas_ism_param_dec_render_sf(
RealBuffer[i] = Cldfb_RealBuffer[idx_in][i]; RealBuffer[i] = Cldfb_RealBuffer[idx_in][i];
ImagBuffer[i] = Cldfb_ImagBuffer[idx_in][i]; ImagBuffer[i] = Cldfb_ImagBuffer[idx_in][i];
} }
cldfbSynthesis( RealBuffer, ImagBuffer, output_f[ch],
hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] ); cldfbSynthesis( RealBuffer, ImagBuffer, output_f[ch], hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] );
idx_in++; idx_in++;
} }
} }
...@@ -1672,6 +1672,7 @@ static void ivas_param_ism_dec_dequant_powrat( ...@@ -1672,6 +1672,7 @@ static void ivas_param_ism_dec_dequant_powrat(
return; return;
} }
static void ivas_ism_get_interpolator( static void ivas_ism_get_interpolator(
const int16_t subframe_nbslots, const int16_t subframe_nbslots,
float *interpolator ) float *interpolator )
...@@ -1853,6 +1854,7 @@ static void ivas_param_ism_compute_mixing_matrix( ...@@ -1853,6 +1854,7 @@ static void ivas_param_ism_compute_mixing_matrix(
} }
direct_power[w] = sqrtf( direct_power[w] ); direct_power[w] = sqrtf( direct_power[w] );
} }
/* Compute mixing matrix */ /* Compute mixing matrix */
computeMixingMatricesISM( nchan_transport, num_wave, nchan_out_woLFE, response_matrix, direct_power, cx_diag[bin_idx], cy_diag, proto_matrix, 1, computeMixingMatricesISM( nchan_transport, num_wave, nchan_out_woLFE, response_matrix, direct_power, cx_diag[bin_idx], cy_diag, proto_matrix, 1,
PARAM_MC_REG_SX, PARAM_MC_REG_GHAT, mixing_matrix[bin_idx] ); PARAM_MC_REG_SX, PARAM_MC_REG_GHAT, mixing_matrix[bin_idx] );
...@@ -2447,12 +2449,12 @@ void ivas_param_ism_dec( ...@@ -2447,12 +2449,12 @@ void ivas_param_ism_dec(
} }
} }
} }
ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, p_tc ); ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, p_tc );
for ( ch = 0; ch < nchan_transport; ch++ ) for ( ch = 0; ch < nchan_transport; ch++ )
{ {
/*-----------------------------------------------------------------* /* CLDFB Analysis */
* CLDFB Analysis
*-----------------------------------------------------------------*/
for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ )
{ {
cldfbAnalysis_ts( &( output_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); cldfbAnalysis_ts( &( output_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] );
...@@ -2469,6 +2471,7 @@ void ivas_param_ism_dec( ...@@ -2469,6 +2471,7 @@ void ivas_param_ism_dec(
/* Compute mixing matrix */ /* Compute mixing matrix */
ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, mixing_matrix ); ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, mixing_matrix );
/* subframe loop for synthesis*/ /* subframe loop for synthesis*/
for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ ) for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ )
{ {
...@@ -2565,7 +2568,6 @@ void ivas_ism_dec_digest_tc( ...@@ -2565,7 +2568,6 @@ void ivas_ism_dec_digest_tc(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
) )
{ {
ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
if ( st_ivas->renderer_type == RENDERER_TD_PANNING || if ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
...@@ -2602,6 +2604,7 @@ void ivas_ism_dec_digest_tc( ...@@ -2602,6 +2604,7 @@ void ivas_ism_dec_digest_tc(
{ {
ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator );
} }
/* also get the gains here */ /* also get the gains here */
num_objects = st_ivas->nchan_transport; num_objects = st_ivas->nchan_transport;
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
...@@ -2610,10 +2613,7 @@ void ivas_ism_dec_digest_tc( ...@@ -2610,10 +2613,7 @@ void ivas_ism_dec_digest_tc(
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{ {
ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &st_ivas->hIsmRendererData->gains[i][0], &st_ivas->hIsmRendererData->gains[i][1] );
st_ivas->hIsmMetaData[i]->elevation,
&st_ivas->hIsmRendererData->gains[i][0],
&st_ivas->hIsmRendererData->gains[i][1] );
} }
else else
{ {
...@@ -2794,6 +2794,7 @@ void ivas_param_ism_dec_digest_tc( ...@@ -2794,6 +2794,7 @@ void ivas_param_ism_dec_digest_tc(
mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands );
} }
ivas_param_ism_collect_slot( hParamIsmDec, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag ); ivas_param_ism_collect_slot( hParamIsmDec, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag );
} }
} }
...@@ -2835,7 +2836,6 @@ void ivas_ism_param_dec_tc_gain_ajust( ...@@ -2835,7 +2836,6 @@ void ivas_ism_param_dec_tc_gain_ajust(
ene_sum = 0.0f; ene_sum = 0.0f;
last_gain = st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain; last_gain = st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain;
for ( i = 0; i < nSamples; i++ ) for ( i = 0; i < nSamples; i++ )
{ {
ene_tc += transport_channels_f[0][i] * transport_channels_f[0][i] + transport_channels_f[1][i] * transport_channels_f[1][i]; // L*L + R*R ene_tc += transport_channels_f[0][i] * transport_channels_f[0][i] + transport_channels_f[1][i] * transport_channels_f[1][i]; // L*L + R*R
...@@ -2867,11 +2867,13 @@ void ivas_ism_param_dec_tc_gain_ajust( ...@@ -2867,11 +2867,13 @@ void ivas_ism_param_dec_tc_gain_ajust(
transport_channels_f[1][i] *= gain; transport_channels_f[1][i] *= gain;
} }
} }
st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain = gain; st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain = gain;
return; return;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_ism_param_dec_render_sf() * ivas_ism_param_dec_render_sf()
* *
...@@ -2895,7 +2897,6 @@ static void ivas_ism_param_dec_render_sf( ...@@ -2895,7 +2897,6 @@ static void ivas_ism_param_dec_render_sf(
float *Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX]; float *Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX];
PARAM_ISM_DEC_HANDLE hParamIsmDec; PARAM_ISM_DEC_HANDLE hParamIsmDec;
SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
int16_t slot_idx_start; int16_t slot_idx_start;
int16_t idx_in; int16_t idx_in;
int16_t idx_lfe; int16_t idx_lfe;
...@@ -2928,8 +2929,7 @@ static void ivas_ism_param_dec_render_sf( ...@@ -2928,8 +2929,7 @@ static void ivas_ism_param_dec_render_sf(
/* Compute bandwise rendering to target LS using covariance rendering */ /* Compute bandwise rendering to target LS using covariance rendering */
ivas_param_ism_render_slot( hParamIsmDec, hSpatParamRendCom, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, ivas_param_ism_render_slot( hParamIsmDec, hSpatParamRendCom, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in,
Cldfb_RealBuffer, Cldfb_ImagBuffer, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, Cldfb_RealBuffer, Cldfb_ImagBuffer, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, nchan_out_woLFE, nchan_transport );
nchan_out_woLFE, nchan_transport );
} }
/* CLDFB Synthesis */ /* CLDFB Synthesis */
...@@ -2957,8 +2957,8 @@ static void ivas_ism_param_dec_render_sf( ...@@ -2957,8 +2957,8 @@ static void ivas_ism_param_dec_render_sf(
RealBuffer[i] = Cldfb_RealBuffer[idx_in][i]; RealBuffer[i] = Cldfb_RealBuffer[idx_in][i];
ImagBuffer[i] = Cldfb_ImagBuffer[idx_in][i]; ImagBuffer[i] = Cldfb_ImagBuffer[idx_in][i];
} }
cldfbSynthesis( RealBuffer, ImagBuffer, output_f[ch],
hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] ); cldfbSynthesis( RealBuffer, ImagBuffer, output_f[ch], hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] );
idx_in++; idx_in++;
} }
} }
......
...@@ -183,10 +183,7 @@ void ivas_ism_render( ...@@ -183,10 +183,7 @@ void ivas_ism_render(
{ {
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{ {
ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &gains[i][0], &gains[i][1] );
st_ivas->hIsmMetaData[i]->elevation,
&gains[i][0],
&gains[i][1] );
} }
else else
{ {
...@@ -243,6 +240,7 @@ void ivas_ism_render( ...@@ -243,6 +240,7 @@ void ivas_ism_render(
return; return;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_ism_render_sf() * ivas_ism_render_sf()
* *
...@@ -274,12 +272,9 @@ void ivas_ism_render_sf( ...@@ -274,12 +272,9 @@ void ivas_ism_render_sf(
set_f( output_f[i], 0.0f, n_samples_to_render ); set_f( output_f[i], 0.0f, n_samples_to_render );
} }
if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] )
{ {
ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
n_samples_to_render,
st_ivas->hIsmRendererData->interpolator );
interp_offset = 0; interp_offset = 0;
} }
...@@ -601,6 +596,7 @@ void ivas_omasa_separate_object_render( ...@@ -601,6 +596,7 @@ void ivas_omasa_separate_object_render(
return; return;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* ivas_omasa_separate_object_render_jbm() * ivas_omasa_separate_object_render_jbm()
* *
......
...@@ -777,7 +777,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -777,7 +777,7 @@ ivas_error ivas_jbm_dec_render(
const uint16_t nSamplesAsked, /* i : number of samples wanted */ const uint16_t nSamplesAsked, /* i : number of samples wanted */
uint16_t *nSamplesRendered, /* o : number of samples rendered */ uint16_t *nSamplesRendered, /* o : number of samples rendered */
uint16_t *nSamplesAvailableNext, /* o : number of samples still available in the rendering pipeline */ uint16_t *nSamplesAvailableNext, /* o : number of samples still available in the rendering pipeline */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -972,7 +972,10 @@ ivas_error ivas_jbm_dec_render( ...@@ -972,7 +972,10 @@ ivas_error ivas_jbm_dec_render(
} }
else /* SBA_MODE_SPAR */ else /* SBA_MODE_SPAR */
{ {
ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK )
{
return error;
}
} }
} }
else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) else if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
...@@ -983,7 +986,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -983,7 +986,7 @@ ivas_error ivas_jbm_dec_render(
{ {
if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
{ {
if ( ( ivas_omasa_dirac_td_binaural_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ) ) != IVAS_ERR_OK ) if ( ( error = ivas_omasa_dirac_td_binaural_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -1169,11 +1172,11 @@ ivas_error ivas_jbm_dec_render( ...@@ -1169,11 +1172,11 @@ ivas_error ivas_jbm_dec_render(
st_ivas->hTcBuffer->n_samples_discard = 0; st_ivas->hTcBuffer->n_samples_discard = 0;
} }
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->Opt_Limiter ) if ( st_ivas->hDecoderConfig->Opt_Limiter )
#endif #endif
{ {
if ( !( st_ivas->ivas_format == MONO_FORMAT ) ) if ( st_ivas->ivas_format != MONO_FORMAT )
{ {
#ifndef DISABLE_LIMITER #ifndef DISABLE_LIMITER
ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect );
...@@ -1181,7 +1184,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -1181,7 +1184,7 @@ ivas_error ivas_jbm_dec_render(
} }
} }
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
switch ( pcm_resolution ) switch ( pcm_resolution )
{ {
case PCM_INT16: case PCM_INT16:
...@@ -1189,13 +1192,13 @@ ivas_error ivas_jbm_dec_render( ...@@ -1189,13 +1192,13 @@ ivas_error ivas_jbm_dec_render(
#ifdef DEBUGGING #ifdef DEBUGGING
st_ivas->noClipping += st_ivas->noClipping +=
#endif #endif
ivas_syn_output( p_output, *nSamplesRendered, nchan_out, #ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT ivas_syn_output( p_output, *nSamplesRendered, nchan_out, (int16_t *) data );
(int16_t *) #else
ivas_syn_output( p_output, *nSamplesRendered, nchan_out, data );
#endif #endif
data );
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
break; break;
case PCM_FLOAT32: case PCM_FLOAT32:
ivas_syn_output_f( p_output, *nSamplesRendered, nchan_out, (float *) data ); ivas_syn_output_f( p_output, *nSamplesRendered, nchan_out, (float *) data );
...@@ -1205,6 +1208,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -1205,6 +1208,7 @@ ivas_error ivas_jbm_dec_render(
break; break;
} }
#endif #endif
*nSamplesAvailableNext = st_ivas->hTcBuffer->n_samples_available; *nSamplesAvailableNext = st_ivas->hTcBuffer->n_samples_available;
pop_wmops(); pop_wmops();
...@@ -1227,7 +1231,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ...@@ -1227,7 +1231,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
const MC_MODE mc_mode_old, /* i : old MC mode */ const MC_MODE mc_mode_old, /* i : old MC mode */
const ISM_MODE ism_mode_old, /* i : old ISM mode */ const ISM_MODE ism_mode_old, /* i : old ISM mode */
uint16_t *nSamplesRendered, /* o : number of samples flushed */ uint16_t *nSamplesRendered, /* o : number of samples flushed */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -1382,7 +1386,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ...@@ -1382,7 +1386,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
} }
/* Only write out the valid data*/ /* Only write out the valid data*/
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->Opt_Limiter ) if ( st_ivas->hDecoderConfig->Opt_Limiter )
#endif #endif
{ {
...@@ -1394,7 +1398,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ...@@ -1394,7 +1398,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
} }
} }
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
switch ( pcm_resolution ) switch ( pcm_resolution )
{ {
case PCM_INT16: case PCM_INT16:
...@@ -1403,12 +1407,12 @@ ivas_error ivas_jbm_dec_flush_renderer( ...@@ -1403,12 +1407,12 @@ ivas_error ivas_jbm_dec_flush_renderer(
st_ivas->noClipping += st_ivas->noClipping +=
#endif #endif
ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out,
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
(int16_t *) (int16_t *)
#endif #endif
data ); data );
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
break; break;
case PCM_FLOAT32: case PCM_FLOAT32:
ivas_syn_output_f( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (float *) data ); ivas_syn_output_f( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (float *) data );
...@@ -1706,16 +1710,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( ...@@ -1706,16 +1710,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
} }
if ( st_ivas->ivas_format == SBA_FORMAT ) if ( st_ivas->ivas_format == SBA_FORMAT )
{ {
if (
#ifndef NONBE_FIX_770_PLANAR_SBA_JBM #ifdef NONBE_FIX_770_PLANAR_SBA_JBM
( st_ivas->sba_planar && num_tc >= 3 ) || if ( num_tc == 3 )
( #else
#endif if ( ( st_ivas->sba_planar && num_tc >= 3 ) || num_tc == 3 )
num_tc == 3
#ifndef NONBE_FIX_770_PLANAR_SBA_JBM
)
#endif #endif
)
{ {
num_tc++; num_tc++;
} }
......
...@@ -76,7 +76,9 @@ static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); ...@@ -76,7 +76,9 @@ static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas );
static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length ); static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length );
static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K );
static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object ); static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object );
static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, const int16_t idx_sep_obj, int16_t *num_zeros ); static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, const int16_t idx_sep_obj, int16_t *num_zeros );
...@@ -404,8 +406,7 @@ ivas_error ivas_masa_decode( ...@@ -404,8 +406,7 @@ ivas_error ivas_masa_decode(
return error; return error;
} }
ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, 0 );
st_ivas->ivas_format, st_ivas->ism_mode, 0 );
hQMetaData->metadata_max_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; hQMetaData->metadata_max_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC;
...@@ -582,8 +583,7 @@ ivas_error ivas_masa_dec_open( ...@@ -582,8 +583,7 @@ ivas_error ivas_masa_dec_open(
} }
} }
ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 );
mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 );
...@@ -836,8 +836,7 @@ static ivas_error ivas_masa_dec_config( ...@@ -836,8 +836,7 @@ static ivas_error ivas_masa_dec_config(
void ivas_masa_prerender( void ivas_masa_prerender(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
float *output[], /* i/o: synthesized core-coder transport channels */ float *output[], /* i/o: synthesized core-coder transport channels */
const int16_t output_frame /* i : output frame length per channel */ const int16_t output_frame, /* i : output frame length per channel */
,
const int16_t nchan_remapped /* i : number of transports used in core */ const int16_t nchan_remapped /* i : number of transports used in core */
) )
{ {
...@@ -887,7 +886,7 @@ static void index_16bits( ...@@ -887,7 +886,7 @@ static void index_16bits(
} }
/* Used to replicate subframe data when there is only one subframe sent */ /* Replicate subframe data when there is only one subframe sent */
static void replicate_subframes( static void replicate_subframes(
IVAS_QMETADATA_HANDLE hQMetaData ) IVAS_QMETADATA_HANDLE hQMetaData )
{ {
...@@ -953,7 +952,7 @@ static void restore_lowbitrate_masa( ...@@ -953,7 +952,7 @@ static void restore_lowbitrate_masa(
} }
} }
} }
hQMetaData->q_direction->cfg.nblocks = 4; /* Set just to be sure */ hQMetaData->q_direction->cfg.nblocks = 4;
} }
else else
{ {
...@@ -977,7 +976,7 @@ static void restore_lowbitrate_masa( ...@@ -977,7 +976,7 @@ static void restore_lowbitrate_masa(
} }
} }
} }
hQMetaData->q_direction->cfg.nbands = numCodingBands; /* Set just to be sure */ hQMetaData->q_direction->cfg.nbands = numCodingBands;
} }
return; return;
...@@ -1007,6 +1006,7 @@ static ivas_error init_lfe_synth_data( ...@@ -1007,6 +1006,7 @@ static ivas_error init_lfe_synth_data(
set_zero( hMasa->hMasaLfeSynth->lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES ); set_zero( hMasa->hMasaLfeSynth->lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES );
hMasa->hMasaLfeSynth->lfeGainPrevIndex = 0; hMasa->hMasaLfeSynth->lfeGainPrevIndex = 0;
if ( st_ivas->hOutSetup.separateChannelEnabled && if ( st_ivas->hOutSetup.separateChannelEnabled &&
( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 ||
output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_2 ||
...@@ -1227,7 +1227,7 @@ static int16_t decode_lfe_to_total_energy_ratio( ...@@ -1227,7 +1227,7 @@ static int16_t decode_lfe_to_total_energy_ratio(
ivas_error ivas_masa_dec_reconfigure( ivas_error ivas_masa_dec_reconfigure(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */
void *data /* o : output synthesis signal */ void *data /* o : output synthesis signal */
#else #else
...@@ -1421,11 +1421,11 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1421,11 +1421,11 @@ ivas_error ivas_masa_dec_reconfigure(
{ {
return error; return error;
} }
}
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* Set-up MASA coding elements and bitrates * Set-up MASA coding elements and bitrates
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
}
ism_total_brate = 0; ism_total_brate = 0;
if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) )
...@@ -1436,8 +1436,7 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1436,8 +1436,7 @@ ivas_error ivas_masa_dec_reconfigure(
} }
} }
ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
if ( st_ivas->ivas_format == MASA_FORMAT ) if ( st_ivas->ivas_format == MASA_FORMAT )
{ {
...@@ -1485,7 +1484,7 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1485,7 +1484,7 @@ ivas_error ivas_masa_dec_reconfigure(
if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity ) if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity )
{ {
if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, n_samples_granularity, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, MC_MODE_NONE, ISM_MASA_MODE_DISC, nSamplesRendered, if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, n_samples_granularity, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, MC_MODE_NONE, ISM_MASA_MODE_DISC, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution, pcm_resolution,
#endif #endif
data ) ) != IVAS_ERR_OK ) data ) ) != IVAS_ERR_OK )
...@@ -1604,7 +1603,6 @@ void ivas_spar_param_to_masa_param_mapping( ...@@ -1604,7 +1603,6 @@ void ivas_spar_param_to_masa_param_mapping(
} }
else else
{ {
mixer_mat_index = ( ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) == 1 ) ? 0 : ( sf - SPAR_META_DELAY_SUBFRAMES ); mixer_mat_index = ( ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) == 1 ) ? 0 : ( sf - SPAR_META_DELAY_SUBFRAMES );
for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ )
{ {
...@@ -1680,6 +1678,7 @@ void ivas_spar_param_to_masa_param_mapping( ...@@ -1680,6 +1678,7 @@ void ivas_spar_param_to_masa_param_mapping(
{ {
inCovarianceMtx[0][0] = transportSignalEnergies[0][bin]; /* In case of 2TC, use actual energies */ inCovarianceMtx[0][0] = transportSignalEnergies[0][bin]; /* In case of 2TC, use actual energies */
} }
/* Decorrelated channels assumed to have the same energy as the source channel */ /* Decorrelated channels assumed to have the same energy as the source channel */
inCovarianceMtx[1][1] = inCovarianceMtx[0][0]; inCovarianceMtx[1][1] = inCovarianceMtx[0][0];
inCovarianceMtx[2][2] = inCovarianceMtx[0][0]; inCovarianceMtx[2][2] = inCovarianceMtx[0][0];
...@@ -1932,7 +1931,8 @@ static void decode_index_slice( ...@@ -1932,7 +1931,8 @@ static void decode_index_slice(
int16_t index, /* i : index to decode */ int16_t index, /* i : index to decode */
int16_t *ratio_idx_ism, /* o : decodec array of integers */ int16_t *ratio_idx_ism, /* o : decodec array of integers */
const int16_t nchan_ism, /* i : number of elements in array (objects) */ const int16_t nchan_ism, /* i : number of elements in array (objects) */
const int16_t K ) /* i : sum of array elements */ const int16_t K /* i : sum of array elements */
)
{ {
int16_t i, j, sum, elem; int16_t i, j, sum, elem;
int16_t base[MAX_NUM_OBJECTS]; int16_t base[MAX_NUM_OBJECTS];
...@@ -2374,6 +2374,7 @@ static int16_t ivas_decode_masaism_metadata( ...@@ -2374,6 +2374,7 @@ static int16_t ivas_decode_masaism_metadata(
/* read ISM metadata */ /* read ISM metadata */
calculate_nbits_meta( nchan_ism, energy_ratio_ism, hMasaIsmData->masa_to_total_energy_ratio, nblocks, nbands, bits_ism, idx_separated_object, ism_imp ); calculate_nbits_meta( nchan_ism, energy_ratio_ism, hMasaIsmData->masa_to_total_energy_ratio, nblocks, nbands, bits_ism, idx_separated_object, ism_imp );
for ( obj = 0; obj < nchan_ism; obj++ ) for ( obj = 0; obj < nchan_ism; obj++ )
{ {
index = 0; index = 0;
......
...@@ -100,6 +100,7 @@ static ivas_error param_mc_get_diff_proto_info( const float *proto_mtx, const ui ...@@ -100,6 +100,7 @@ static ivas_error param_mc_get_diff_proto_info( const float *proto_mtx, const ui
#ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION #ifndef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
static void ivas_param_mc_mc2sba_cldfb( IVAS_OUTPUT_SETUP hTransSetup, float *hoa_encoder, const int16_t slot_idx, float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], const int16_t nBands, const float gain_lfe ); static void ivas_param_mc_mc2sba_cldfb( IVAS_OUTPUT_SETUP hTransSetup, float *hoa_encoder, const int16_t slot_idx, float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], const int16_t nBands, const float gain_lfe );
#endif #endif
static void ivas_param_mc_get_param_band_mapping( const int16_t n_target_bands, const int16_t *target_band_grouping, const int16_t n_source_bands, const int16_t *source_band_grouping, PARAM_MC_PARAMETER_BAND_MAPPING *parameter_band_mapping ); static void ivas_param_mc_get_param_band_mapping( const int16_t n_target_bands, const int16_t *target_band_grouping, const int16_t n_source_bands, const int16_t *source_band_grouping, PARAM_MC_PARAMETER_BAND_MAPPING *parameter_band_mapping );
static void ivas_param_mc_bs_decode_parameter_values( uint16_t bit_buffer[], int16_t *bit_pos, const int16_t max_bits, int16_t *BER_detect, HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC, HANDLE_PARAM_MC_PARAMETER_CODING_INFO hParamCodingInfo, const int16_t map_size_wo_lfe, const int16_t map_size, const int16_t num_lfe_bands, const int16_t band_step, const int16_t num_param_bands, float *value_buffer ); static void ivas_param_mc_bs_decode_parameter_values( uint16_t bit_buffer[], int16_t *bit_pos, const int16_t max_bits, int16_t *BER_detect, HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC, HANDLE_PARAM_MC_PARAMETER_CODING_INFO hParamCodingInfo, const int16_t map_size_wo_lfe, const int16_t map_size, const int16_t num_lfe_bands, const int16_t band_step, const int16_t num_param_bands, float *value_buffer );
...@@ -246,7 +247,6 @@ ivas_error ivas_param_mc_dec_open( ...@@ -246,7 +247,6 @@ ivas_error ivas_param_mc_dec_open(
param_mc_set_num_synth_bands( output_Fs, hParamMC ); param_mc_set_num_synth_bands( output_Fs, hParamMC );
/* Band Grouping */ /* Band Grouping */
if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 ) if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 )
{ {
...@@ -323,9 +323,7 @@ ivas_error ivas_param_mc_dec_open( ...@@ -323,9 +323,7 @@ ivas_error ivas_param_mc_dec_open(
if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO )
{ {
matrix_product( hParamMC->ls_conv_dmx_matrix, nchan_out_cov, nchan_out_transport, 0, matrix_product( hParamMC->ls_conv_dmx_matrix, nchan_out_cov, nchan_out_transport, 0, ivas_param_mc_conf[config_index].dmx_fac, nchan_out_transport, nchan_transport, 0, proto_matrix );
ivas_param_mc_conf[config_index].dmx_fac, nchan_out_transport, nchan_transport, 0,
proto_matrix );
if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO )
{ {
...@@ -379,15 +377,8 @@ ivas_error ivas_param_mc_dec_open( ...@@ -379,15 +377,8 @@ ivas_error ivas_param_mc_dec_open(
ivas_dirac_dec_get_frequency_axis( frequency_axis, output_Fs, hParamMC->num_freq_bands ); ivas_dirac_dec_get_frequency_axis( frequency_axis, output_Fs, hParamMC->num_freq_bands );
if ( ( error = ivas_dirac_dec_decorr_open( &( hParamMC->h_freq_domain_decorr_ap_params ), if ( ( error = ivas_dirac_dec_decorr_open( &( hParamMC->h_freq_domain_decorr_ap_params ), &( hParamMC->h_freq_domain_decorr_ap_state ), hParamMC->num_freq_bands, hParamMC->num_outputs_diff, hParamMC->diff_proto_info->num_protos_diff,
&( hParamMC->h_freq_domain_decorr_ap_state ), DIRAC_SYNTHESIS_COV_MC_LS, frequency_axis, nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
hParamMC->num_freq_bands,
hParamMC->num_outputs_diff,
hParamMC->diff_proto_info->num_protos_diff,
DIRAC_SYNTHESIS_COV_MC_LS,
frequency_axis,
nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -409,22 +400,14 @@ ivas_error ivas_param_mc_dec_open( ...@@ -409,22 +400,14 @@ ivas_error ivas_param_mc_dec_open(
} }
/* output synthesis */ /* output synthesis */
if ( ( error = ivas_dirac_dec_output_synthesis_cov_open( &( hParamMC->h_output_synthesis_params ), if ( ( error = ivas_dirac_dec_output_synthesis_cov_open( &( hParamMC->h_output_synthesis_params ), &( hParamMC->h_output_synthesis_cov_state ), hParamMC->max_band_decorr, PARAM_MC_MAX_NSLOTS,
&( hParamMC->h_output_synthesis_cov_state ), hParamMC->hMetadataPMC->num_parameter_bands, max_param_band_residual, nchan_transport, nchan_out_cov, proto_matrix ) ) != IVAS_ERR_OK )
hParamMC->max_band_decorr,
PARAM_MC_MAX_NSLOTS,
hParamMC->hMetadataPMC->num_parameter_bands,
max_param_band_residual,
nchan_transport,
nchan_out_cov,
proto_matrix ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
ivas_param_mc_dec_compute_interpolator( 0, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hParamMC->h_output_synthesis_params.interpolator ); ivas_param_mc_dec_compute_interpolator( 0, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hParamMC->h_output_synthesis_params.interpolator );
/* Head or external rotation */ /* Head or external rotation */
if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) )
{ {
...@@ -459,9 +442,7 @@ ivas_error ivas_param_mc_dec_open( ...@@ -459,9 +442,7 @@ ivas_error ivas_param_mc_dec_open(
ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov ); ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov );
if ( if ( st_ivas->hDecoderConfig->Opt_5ms && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO )
st_ivas->hDecoderConfig->Opt_5ms &&
hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO )
{ {
int16_t n_cldfb_slots; int16_t n_cldfb_slots;
...@@ -481,6 +462,7 @@ ivas_error ivas_param_mc_dec_open( ...@@ -481,6 +462,7 @@ ivas_error ivas_param_mc_dec_open(
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) ); return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
} }
set_zero( hParamMC->Cldfb_ImagBuffer_tc, n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands ); set_zero( hParamMC->Cldfb_ImagBuffer_tc, n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands );
if ( st_ivas->hTcBuffer == NULL ) if ( st_ivas->hTcBuffer == NULL )
{ {
if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, 0, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, 0, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
...@@ -748,7 +730,6 @@ ivas_error ivas_param_mc_dec_reconfig( ...@@ -748,7 +730,6 @@ ivas_error ivas_param_mc_dec_reconfig(
param_mc_set_num_synth_bands( output_Fs, hParamMC ); param_mc_set_num_synth_bands( output_Fs, hParamMC );
/* set max parameter band for abs cov */ /* set max parameter band for abs cov */
k = 0; k = 0;
while ( hParamMC->band_grouping[k] <= PARAM_MC_MAX_BAND_ABS_COV_DEC ) while ( hParamMC->band_grouping[k] <= PARAM_MC_MAX_BAND_ABS_COV_DEC )
...@@ -893,15 +874,8 @@ ivas_error ivas_param_mc_dec_reconfig( ...@@ -893,15 +874,8 @@ ivas_error ivas_param_mc_dec_reconfig(
ivas_dirac_dec_get_frequency_axis( frequency_axis, output_Fs, hParamMC->num_freq_bands ); ivas_dirac_dec_get_frequency_axis( frequency_axis, output_Fs, hParamMC->num_freq_bands );
if ( ( error = ivas_dirac_dec_decorr_open( &( hParamMC->h_freq_domain_decorr_ap_params ), if ( ( error = ivas_dirac_dec_decorr_open( &( hParamMC->h_freq_domain_decorr_ap_params ), &( hParamMC->h_freq_domain_decorr_ap_state ), hParamMC->num_freq_bands, hParamMC->num_outputs_diff,
&( hParamMC->h_freq_domain_decorr_ap_state ), hParamMC->diff_proto_info->num_protos_diff, DIRAC_SYNTHESIS_COV_MC_LS, frequency_axis, nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
hParamMC->num_freq_bands,
hParamMC->num_outputs_diff,
hParamMC->diff_proto_info->num_protos_diff,
DIRAC_SYNTHESIS_COV_MC_LS,
frequency_axis,
nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -941,15 +915,8 @@ ivas_error ivas_param_mc_dec_reconfig( ...@@ -941,15 +915,8 @@ ivas_error ivas_param_mc_dec_reconfig(
set_zero( tmp_buf, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); set_zero( tmp_buf, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS );
/* output synthesis */ /* output synthesis */
if ( ( error = ivas_dirac_dec_output_synthesis_cov_open( &( hParamMC->h_output_synthesis_params ), if ( ( error = ivas_dirac_dec_output_synthesis_cov_open( &( hParamMC->h_output_synthesis_params ), &( hParamMC->h_output_synthesis_cov_state ), hParamMC->max_band_decorr, PARAM_MC_MAX_NSLOTS,
&( hParamMC->h_output_synthesis_cov_state ), hParamMC->hMetadataPMC->num_parameter_bands, max_param_band_residual, nchan_transport, nchan_out_cov, proto_matrix ) ) != IVAS_ERR_OK )
hParamMC->max_band_decorr,
PARAM_MC_MAX_NSLOTS,
hParamMC->hMetadataPMC->num_parameter_bands,
max_param_band_residual,
nchan_transport,
nchan_out_cov,
proto_matrix ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
...@@ -958,7 +925,6 @@ ivas_error ivas_param_mc_dec_reconfig( ...@@ -958,7 +925,6 @@ ivas_error ivas_param_mc_dec_reconfig(
ivas_dirac_dec_output_synthesis_cov_init( &( hParamMC->h_output_synthesis_cov_state ), nchan_transport, nchan_out_cov, hParamMC->hMetadataPMC->num_parameter_bands, max_param_band_residual ); ivas_dirac_dec_output_synthesis_cov_init( &( hParamMC->h_output_synthesis_cov_state ), nchan_transport, nchan_out_cov, hParamMC->hMetadataPMC->num_parameter_bands, max_param_band_residual );
/* map old to new parameter banding, only for same number of TCs, needs some more thought for changing number of TCs */ /* map old to new parameter banding, only for same number of TCs, needs some more thought for changing number of TCs */
if ( num_param_bands_old != hParamMC->hMetadataPMC->num_parameter_bands && nchan_transport_old == nchan_transport ) if ( num_param_bands_old != hParamMC->hMetadataPMC->num_parameter_bands && nchan_transport_old == nchan_transport )
{ {
...@@ -1133,7 +1099,6 @@ void ivas_param_mc_dec_close( ...@@ -1133,7 +1099,6 @@ void ivas_param_mc_dec_close(
hParamMC->diff_proto_info = NULL; hParamMC->diff_proto_info = NULL;
} }
/* States */ /* States */
/* free prototype signal buffers */ /* free prototype signal buffers */
if ( hParamMC->proto_frame_f != NULL ) if ( hParamMC->proto_frame_f != NULL )
...@@ -1783,17 +1748,23 @@ void ivas_param_mc_dec_render( ...@@ -1783,17 +1748,23 @@ void ivas_param_mc_dec_render(
} }
} }
#endif #endif
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, NULL, st_ivas->hCombinedOrientationData, subframe_idx, hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#else
ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframe_idx, hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif #endif
#else
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL, NULL,
#endif #endif
st_ivas->hCombinedOrientationData, st_ivas->hCombinedOrientationData, subframe_idx, hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
subframe_idx, #endif
hParamMC->subframe_nbslots[subframe_idx],
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -2189,6 +2160,7 @@ static int16_t ivas_param_mc_range_decoder_LC( ...@@ -2189,6 +2160,7 @@ static int16_t ivas_param_mc_range_decoder_LC(
* *
* compute the interpolator used in the final synthesis * compute the interpolator used in the final synthesis
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
static void ivas_param_mc_dec_compute_interpolator( static void ivas_param_mc_dec_compute_interpolator(
const uint16_t bAttackPresent, /* i : flag indicating if we have a transient in the current frame */ const uint16_t bAttackPresent, /* i : flag indicating if we have a transient in the current frame */
const uint16_t attackPos, /* i : position of the transient */ const uint16_t attackPos, /* i : position of the transient */
......
...@@ -59,7 +59,7 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_m ...@@ -59,7 +59,7 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_m
static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], int16_t slot_index_start ); static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], const int16_t slot_index_start );
#else #else
static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] );
#endif #endif
...@@ -153,7 +153,6 @@ void ivas_mc_paramupmix_dec_read_BS( ...@@ -153,7 +153,6 @@ void ivas_mc_paramupmix_dec_read_BS(
} }
pop_wmops(); pop_wmops();
return; return;
} }
...@@ -211,7 +210,6 @@ void ivas_mc_paramupmix_dec( ...@@ -211,7 +210,6 @@ void ivas_mc_paramupmix_dec(
hMCParamUpmix = st_ivas->hMCParamUpmix; hMCParamUpmix = st_ivas->hMCParamUpmix;
assert( hMCParamUpmix ); assert( hMCParamUpmix );
push_wmops( "mc_paramupmix_dec" ); push_wmops( "mc_paramupmix_dec" );
set_s( channel_active, 0, MAX_CICP_CHANNELS ); set_s( channel_active, 0, MAX_CICP_CHANNELS );
...@@ -319,6 +317,7 @@ void ivas_mc_paramupmix_dec( ...@@ -319,6 +317,7 @@ void ivas_mc_paramupmix_dec(
} }
idx_in += 2; idx_in += 2;
} }
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION #ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
if ( st_ivas->hCombinedOrientationData && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) if ( st_ivas->hCombinedOrientationData && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
{ {
...@@ -328,6 +327,7 @@ void ivas_mc_paramupmix_dec( ...@@ -328,6 +327,7 @@ void ivas_mc_paramupmix_dec(
} }
} }
#endif #endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
/*LFE handling for split rendering cases*/ /*LFE handling for split rendering cases*/
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -367,20 +367,19 @@ void ivas_mc_paramupmix_dec( ...@@ -367,20 +367,19 @@ void ivas_mc_paramupmix_dec(
#endif #endif
/* Implement binaural rendering */ /* Implement binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */ JBM_CLDFB_SLOTS_IN_SUBFRAME, NULL, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
#else
ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */ JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
#endif #endif
st_ivas->hCombinedOrientationData, #else
subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */ JBM_CLDFB_SLOTS_IN_SUBFRAME,
JBM_CLDFB_SLOTS_IN_SUBFRAME,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL, NULL,
#endif #endif
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
Cldfb_RealBuffer_subfr, #endif
Cldfb_ImagBuffer_subfr );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -396,6 +395,7 @@ void ivas_mc_paramupmix_dec( ...@@ -396,6 +395,7 @@ void ivas_mc_paramupmix_dec(
} }
} }
#endif #endif
for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ )
{ {
for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ )
...@@ -489,7 +489,6 @@ void ivas_mc_paramupmix_dec( ...@@ -489,7 +489,6 @@ void ivas_mc_paramupmix_dec(
} }
pop_wmops(); pop_wmops();
return; return;
} }
...@@ -509,7 +508,6 @@ void ivas_mc_paramupmix_dec_digest_tc( ...@@ -509,7 +508,6 @@ void ivas_mc_paramupmix_dec_digest_tc(
MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix;
hMCParamUpmix = st_ivas->hMCParamUpmix; hMCParamUpmix = st_ivas->hMCParamUpmix;
assert( hMCParamUpmix ); assert( hMCParamUpmix );
push_wmops( "ivas_mc_paramupmix_dec_digest_tc" ); push_wmops( "ivas_mc_paramupmix_dec_digest_tc" );
ivas_param_upmix_dec_decorr_subframes( st_ivas, nSamplesForRendering ); ivas_param_upmix_dec_decorr_subframes( st_ivas, nSamplesForRendering );
...@@ -520,6 +518,7 @@ void ivas_mc_paramupmix_dec_digest_tc( ...@@ -520,6 +518,7 @@ void ivas_mc_paramupmix_dec_digest_tc(
ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator );
pop_wmops(); pop_wmops();
return;
} }
...@@ -615,6 +614,7 @@ void ivas_mc_paramupmix_dec_render( ...@@ -615,6 +614,7 @@ void ivas_mc_paramupmix_dec_render(
*nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size;
pop_wmops(); pop_wmops();
return;
} }
...@@ -661,9 +661,11 @@ ivas_error ivas_mc_paramupmix_dec_open( ...@@ -661,9 +661,11 @@ ivas_error ivas_mc_paramupmix_dec_open(
assert( 0 && "Number of TC not supported for MC ParamUpmix!" ); assert( 0 && "Number of TC not supported for MC ParamUpmix!" );
#endif #endif
} }
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION #ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
hMCParamUpmix->hoa_encoder = NULL; hMCParamUpmix->hoa_encoder = NULL;
#endif #endif
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* set input parameters * set input parameters
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -699,9 +701,7 @@ ivas_error ivas_mc_paramupmix_dec_open( ...@@ -699,9 +701,7 @@ ivas_error ivas_mc_paramupmix_dec_open(
/* allocate transport channels*/ /* allocate transport channels*/
hMCParamUpmix->free_param_interpolator = 0; hMCParamUpmix->free_param_interpolator = 0;
hMCParamUpmix->param_interpolator = NULL; hMCParamUpmix->param_interpolator = NULL;
if ( if ( st_ivas->hDecoderConfig->Opt_5ms == 1 && st_ivas->hTcBuffer == NULL )
st_ivas->hDecoderConfig->Opt_5ms == 1 &&
st_ivas->hTcBuffer == NULL )
{ {
int16_t nchan_to_allocate; int16_t nchan_to_allocate;
int16_t nchan_tc; int16_t nchan_tc;
...@@ -787,11 +787,14 @@ void ivas_mc_paramupmix_dec_close( ...@@ -787,11 +787,14 @@ void ivas_mc_paramupmix_dec_close(
return; return;
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* ivas_param_upmix_dec_decorr_subframes() * ivas_param_upmix_dec_decorr_subframes()
* *
* *
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
static void paramupmix_td_decorr_process_jbm( static void paramupmix_td_decorr_process_jbm(
ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */
float *pcm_in[], /* i : input audio channels */ float *pcm_in[], /* i : input audio channels */
...@@ -838,6 +841,7 @@ static void paramupmix_td_decorr_process_jbm( ...@@ -838,6 +841,7 @@ static void paramupmix_td_decorr_process_jbm(
return; return;
} }
static void ivas_param_upmix_dec_decorr_subframes( static void ivas_param_upmix_dec_decorr_subframes(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
const int16_t nSamplesForRendering ) const int16_t nSamplesForRendering )
...@@ -879,10 +883,10 @@ static void ivas_param_upmix_dec_decorr_subframes( ...@@ -879,10 +883,10 @@ static void ivas_param_upmix_dec_decorr_subframes(
} }
pop_wmops(); pop_wmops();
return; return;
} }
/*****************************************************************************************/ /*****************************************************************************************/
/* local functions */ /* local functions */
/*****************************************************************************************/ /*****************************************************************************************/
...@@ -1035,7 +1039,7 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -1035,7 +1039,7 @@ static void ivas_mc_paramupmix_dec_sf(
float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
, ,
int16_t slot_index_start const int16_t slot_index_start
#endif #endif
) )
{ {
...@@ -1111,6 +1115,7 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -1111,6 +1115,7 @@ static void ivas_mc_paramupmix_dec_sf(
} }
} }
} }
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
{ {
maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 );
...@@ -1184,16 +1189,11 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -1184,16 +1189,11 @@ static void ivas_mc_paramupmix_dec_sf(
#endif #endif
/* Implement binaural rendering */ /* Implement binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
&st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ivas_binRenderer( st_ivas->hBinRenderer, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
#else
ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
#endif #endif
st_ivas->hCombinedOrientationData,
subframeIdx,
st_ivas->hTcBuffer->subframe_nbslots[subframeIdx],
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
Cldfb_RealBuffer_subfr,
Cldfb_ImagBuffer_subfr );
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
...@@ -1213,7 +1213,6 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -1213,7 +1213,6 @@ static void ivas_mc_paramupmix_dec_sf(
} }
#endif #endif
/* Implement CLDFB synthesis */ /* Implement CLDFB synthesis */
for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
{ {
...@@ -1290,6 +1289,7 @@ static void ivas_mc_paramupmix_dec_sf( ...@@ -1290,6 +1289,7 @@ static void ivas_mc_paramupmix_dec_sf(
st_ivas->hTcBuffer->subframes_rendered++; st_ivas->hTcBuffer->subframes_rendered++;
pop_wmops(); pop_wmops();
return;
} }
......