Skip to content
......@@ -2274,7 +2274,7 @@ ivas_error init_encoder(
const ISM_MODE ism_mode /* i : ISM mode */
#ifdef IGF_MEMORY_ALLOC_OPT
,
const int32_t element_brate
const int32_t element_brate /* element bitrate */
#endif
);
......@@ -4089,7 +4089,7 @@ void AVQ_encmux(
void ordr_esti(
const int16_t k, /* i : sub-vector index */
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 */
);
......
......@@ -220,7 +220,6 @@ ivas_error evs_dec(
}
}
if ( st->codec_mode == MODE1 )
{
/*------------------------------------------------------------------*
......@@ -252,7 +251,6 @@ ivas_error evs_dec(
return error;
}
/*---------------------------------------------------------------------*
* ACELP core decoding
* HQ core decoding
......
......@@ -186,7 +186,6 @@ ivas_error init_decoder(
st->old_bfi_cnt = 0;
/*-----------------------------------------------------------------*
* parameters for AC mode (GSC)
*-----------------------------------------------------------------*/
......@@ -247,7 +246,6 @@ ivas_error init_decoder(
st->hPFstat = NULL;
}
/*-----------------------------------------------------------------*
* HF (6-7kHz) (zero) BWE parameters
*-----------------------------------------------------------------*/
......@@ -356,7 +354,6 @@ ivas_error init_decoder(
st->hHQ_nbfec = NULL;
}
/*-----------------------------------------------------------------*
* TBE parameters
*-----------------------------------------------------------------*/
......@@ -719,9 +716,7 @@ ivas_error init_decoder(
}
st->cngTDLevel = 0.f;
st->lp_noise = -20.0f;
st->force_lpd_reset = 0;
/*-----------------------------------------------------------------*
......
......@@ -394,7 +394,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
#endif
if ( isLoudspeaker )
{
hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp];
......@@ -417,7 +416,6 @@ static ivas_error ivas_binRenderer_convModuleOpen(
set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps );
set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps );
#endif
if ( isLoudspeaker )
{
hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp];
......@@ -480,6 +478,7 @@ static ivas_error ivas_binRenderer_convModuleOpen(
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------*
* ivas_init_binaural_hrtf()
*
......@@ -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" );
}
ivas_init_binaural_hrtf( HrtfFastConv );
if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV )
......@@ -855,6 +853,7 @@ static ivas_error ivas_binaural_hrtf_open(
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------*
* ivas_binaural_obtain_DMX()
*
......@@ -1028,7 +1027,10 @@ ivas_error ivas_rend_openCldfbRend(
hBinRenderer->hInputSetup->is_loudspeaker_setup = 0;
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 )
{
......@@ -1158,12 +1160,11 @@ ivas_error ivas_binRenderer_open(
IVAS_OUTPUT_SETUP out_setup;
/* 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
,
hBinRenderer->numPoses
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 )
#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
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1184,12 +1185,11 @@ ivas_error ivas_binRenderer_open(
else
{
/* 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
,
hBinRenderer->numPoses
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 )
#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
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1230,9 +1230,7 @@ ivas_error ivas_binRenderer_open(
/* 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 ( ( 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 )
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 )
{
return error;
}
......@@ -1335,7 +1333,6 @@ static void ivas_binRenderer_convModuleClose(
free( hBinRenConvModule->filterTapsRightImag );
hBinRenConvModule->filterTapsRightImag = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( posIdx = 0; posIdx < num_poses; posIdx++ )
{
......@@ -1418,12 +1415,11 @@ void ivas_binRenderer_close(
if ( ( *hBinRenderer )->hBinRenConvModule != NULL )
{
ivas_binRenderer_convModuleClose( hBinRenderer
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
( *hBinRenderer )->numPoses
ivas_binRenderer_convModuleClose( hBinRenderer, ( *hBinRenderer )->numPoses );
#else
ivas_binRenderer_convModuleClose( hBinRenderer );
#endif
);
}
if ( ( *hBinRenderer )->hReverb != NULL )
......@@ -1437,6 +1433,7 @@ void ivas_binRenderer_close(
return;
}
/*-------------------------------------------------------------------------
* ivas_free_pppHrtfMem()
*
......@@ -1617,10 +1614,7 @@ void ivas_binaural_cldfb(
}
else
{
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] );
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] );
idx_in++;
}
}
......@@ -1649,19 +1643,15 @@ void ivas_binaural_cldfb(
}
/* Implement binaural rendering */
ivas_binRenderer(
st_ivas->hBinRenderer,
#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
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
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
Cldfb_RealBuffer, Cldfb_ImagBuffer );
#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 )
......@@ -1826,18 +1816,11 @@ void ivas_binaural_cldfb_sf(
}
/* Implement binaural rendering */
ivas_binRenderer(
st_ivas->hBinRenderer,
#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
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
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(
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 inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm );
for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
......@@ -2090,7 +2074,6 @@ void ivas_binRenderer(
}
pop_wmops();
return;
}
......@@ -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_Imag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
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 sf_idx;
......@@ -2160,15 +2143,11 @@ void ivas_rend_CldfbMultiBinRendProcess(
head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx );
#endif
ivas_binRenderer( hCldfbRend,
pMultiBinPoseData,
*pCombinedOrientationData,
sf_idx,
MAX_PARAM_SPATIAL_SUBFRAMES,
#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
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn );
for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ )
{
......
......@@ -97,7 +97,6 @@ ivas_error ivas_core_dec(
ivas_error error;
error = IVAS_ERR_OK;
push_wmops( "ivas_core_dec" );
/*------------------------------------------------------------------*
......@@ -334,7 +333,6 @@ ivas_error ivas_core_dec(
return error;
}
flag_sec_CNA = -1;
if ( hCPE != NULL )
{
......@@ -469,7 +467,6 @@ ivas_error ivas_core_dec(
return error;
}
/* 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 )
{
......@@ -652,8 +649,7 @@ ivas_error ivas_core_dec(
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 */
|| ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
if ( ( st->element_mode != IVAS_CPE_TD && !use_cldfb_for_dft ) || ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
{
/* Delay hb_synth */
delay_signal( hb_synth[n], output_frame, st->hb_prev_synth_buffer, tmps );
......
......@@ -237,6 +237,7 @@ ivas_error ivas_corecoder_dec_reconfig(
{
st_ivas->element_mode_init = IVAS_CPE_MDCT;
}
if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_CPE ) ) != IVAS_ERR_OK )
{
return error;
......
......@@ -389,10 +389,7 @@ ivas_error ivas_cpe_dec(
{
if ( !st_ivas->bfi )
{
tdm_configure_dec(
st_ivas->ivas_format,
st_ivas->ism_mode,
hCPE, &tdm_ratio_idx, nb_bits_metadata );
tdm_configure_dec( 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 );
}
......
......@@ -53,7 +53,7 @@
ivas_error ivas_dec(
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 */
void *data /* o : output synthesis signal */
#else
......@@ -74,7 +74,7 @@ ivas_error ivas_dec(
ivas_error error;
int16_t num_md_sub_frames;
int32_t ism_total_brate;
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
int16_t nchan_out_syn_output;
#endif
......@@ -105,7 +105,7 @@ ivas_error ivas_dec(
return error;
}
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------*
* Binaural split rendering setup
*----------------------------------------------------------------*/
......@@ -313,12 +313,11 @@ ivas_error ivas_dec(
}
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
,
0
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 )
#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
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -754,7 +753,11 @@ ivas_error ivas_dec(
{
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(
}
else
{
#endif
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
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
0
st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs, MAX_PARAM_SPATIAL_SUBFRAMES, 0 ) ) != IVAS_ERR_OK )
#else
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 ) ) != IVAS_ERR_OK )
#endif
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1091,7 +1091,7 @@ ivas_error ivas_dec(
* - 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 )
{
nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses;
......@@ -1105,17 +1105,15 @@ ivas_error ivas_dec(
#endif
{
#ifndef DISABLE_LIMITER
ivas_limiter_dec( st_ivas->hLimiter, p_output,
#if defined SPLIT_REND_WITH_HEAD_ROT
nchan_out_syn_output,
#ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out_syn_output, output_frame, st_ivas->BER_detect );
#else
nchan_out,
ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, output_frame, st_ivas->BER_detect );
#endif
output_frame, st_ivas->BER_detect );
#endif
}
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
switch ( pcm_resolution )
{
case PCM_INT16:
......@@ -1123,18 +1121,13 @@ ivas_error ivas_dec(
#ifdef DEBUGGING
st_ivas->noClipping +=
#endif
ivas_syn_output( p_output, output_frame,
#if defined SPLIT_REND_WITH_HEAD_ROT
nchan_out_syn_output,
#ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_syn_output( p_output, output_frame, nchan_out_syn_output, (int16_t *) data );
#else
nchan_out,
#endif
#if defined SPLIT_REND_WITH_HEAD_ROT
(int16_t *)
ivas_syn_output( p_output, output_frame, nchan_out, data );
#endif
data );
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
break;
case PCM_FLOAT32:
ivas_syn_output_f( p_output, output_frame, nchan_out_syn_output, (float *) data );
......@@ -1144,6 +1137,7 @@ ivas_error ivas_dec(
break;
}
#endif
/*----------------------------------------------------------------*
* Common updates
*----------------------------------------------------------------*/
......
......@@ -174,7 +174,6 @@ void ivas_decision_matrix_dec(
}
else if ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD )
{
*sharpFlag = 0;
if ( st->coder_type == GENERIC || st->coder_type == VOICED )
{
......@@ -256,8 +255,7 @@ void ivas_decision_matrix_dec(
}
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))*/
|| ( 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 ) )
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 ) )
{
/* read the SWB TBE/BWE selection bit */
tmp = get_next_indice( st, 1 );
......
......@@ -92,7 +92,6 @@ static ivas_error ivas_dirac_dec_config_internal(
st_ivas->hDirAC = hDirAC;
}
/*-----------------------------------------------------------------*
* DirAC main configuration
*-----------------------------------------------------------------*/
......@@ -112,6 +111,7 @@ static ivas_error ivas_dirac_dec_config_internal(
return error;
}
static ivas_error ivas_dirac_rend_config(
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 */
......@@ -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 ( ( 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->num_protos_diff,
hDirACRend->synthesisConf,
hDirACRend->frequency_axis,
nchan_transport > 2 ? 4 : nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
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->num_protos_diff, hDirACRend->synthesisConf, hDirACRend->frequency_axis, nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -687,11 +680,11 @@ static ivas_error ivas_dirac_rend_config(
}
}
if ( flag_config == DIRAC_OPEN )
{
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 ) ) )
{
hDirACRend->index_buffer_intensity = 0;
......@@ -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 );
dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE;
sparfoa_flag = 0;
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(
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
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 ),
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,
#else
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 ),
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,
#endif
st_ivas->hSpatParamRendCom->num_freq_bands,
BINAURAL_CHANNELS,
BINAURAL_CHANNELS,
DIRAC_SYNTHESIS_PSD_LS,
frequency_axis,
BINAURAL_CHANNELS,
st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
DIRAC_SYNTHESIS_PSD_LS, frequency_axis, BINAURAL_CHANNELS, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1632,8 +1616,7 @@ void ivas_dirac_dec_set_md_map(
void ivas_dirac_dec(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
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 */
)
{
......@@ -2440,11 +2423,11 @@ void ivas_dirac_dec_render_sf(
#endif
/* Perform binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#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
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
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
......
......@@ -72,22 +72,22 @@ static ivas_error ivas_dec_reconfig_split_rend(
)
{
ivas_error error;
int16_t cldfb_in, num_ch, ch, isCldfbNeeded, i, pcm_out;
int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag;
SPLIT_REND_WRAPPER *hSplitRendWrapper;
#ifndef OSBA_SPLIT_RENDERING
CLDFB_TYPE cldfbMode;
#endif
hSplitRendWrapper = &st_ivas->hSplitBinRend.splitrend;
pcm_out = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
cldfb_in = 0;
pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
cldfb_in_flag = 0;
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
{
cldfb_in = 1;
cldfb_in_flag = 1;
}
ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis );
......@@ -98,26 +98,27 @@ static ivas_error ivas_dec_reconfig_split_rend(
#else
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
{
cldfb_in = 0;
cldfb_in_flag = 0;
}
#endif
if ( st_ivas->renderer_type != RENDERER_DISABLE )
{
if ( cldfb_in == 0 )
if ( cldfb_in_flag == 0 )
{
isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
cldfbMode = CLDFB_ANALYSIS;
#endif
}
else if ( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && cldfb_in )
else if ( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag )
{
isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
cldfbMode = CLDFB_SYNTHESIS;
#endif
}
else if ( pcm_out && cldfb_in )
else if ( pcm_out_flag && cldfb_in_flag )
{
isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
......@@ -143,13 +144,12 @@ static ivas_error ivas_dec_reconfig_split_rend(
for ( ch = 0; ch < num_ch; ch++ )
{
if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ),
#ifndef OSBA_SPLIT_RENDERING
cldfbMode,
if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), cldfbMode, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
#else
CLDFB_ANALYSIS,
if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
#endif
st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
{
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not open CLDFB handles\n" ) );
}
......@@ -158,9 +158,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
#ifdef OSBA_SPLIT_RENDERING
for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
{
if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ),
CLDFB_SYNTHESIS,
st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -178,6 +176,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL;
}
}
#ifdef OSBA_SPLIT_RENDERING
for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
{
......@@ -188,6 +187,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
}
}
#endif
free( hSplitRendWrapper->hCldfbHandles );
hSplitRendWrapper->hCldfbHandles = NULL;
}
......@@ -224,22 +224,22 @@ static ivas_error ivas_dec_init_split_rend(
)
{
ivas_error error;
int16_t cldfb_in, pcm_out;
int16_t cldfb_in_flag, pcm_out_flag;
pcm_out = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
cldfb_in = 0;
pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
cldfb_in_flag = 0;
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
{
cldfb_in = 1;
cldfb_in_flag = 1;
}
ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis );
if ( cldfb_in == 1 && ( st_ivas->hSplitBinRend.splitrend.multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) )
if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend.splitrend.multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) )
{
if ( ( st_ivas->hSplitBinRend.hCldfbDataOut = (IVAS_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( IVAS_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL )
{
......@@ -247,25 +247,20 @@ static ivas_error ivas_dec_init_split_rend(
}
}
if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec,
&st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms,
( cldfb_in == 0 ),
pcm_out ) ) != IVAS_ERR_OK )
if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag ) ) != IVAS_ERR_OK )
{
return error;
}
#ifdef OSBA_SPLIT_RENDERING
if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
{
cldfb_in = 0;
cldfb_in_flag = 0;
}
#endif
error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend,
&st_ivas->hRenderConfig->split_rend_config,
st_ivas->hDecoderConfig->output_Fs,
cldfb_in, pcm_out,
st_ivas->hDecoderConfig->Opt_5ms );
error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->Opt_5ms );
return error;
}
#endif
......@@ -280,7 +275,7 @@ static ivas_error ivas_dec_init_split_rend(
ivas_error ivas_dec_setup(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -307,6 +302,9 @@ ivas_error ivas_dec_setup(
ivas_read_format( st_ivas, &num_bits_read );
/*-------------------------------------------------------------------*
* Read other signling (ISM/MC mode, number of channels, etc.)
*-------------------------------------------------------------------*/
if ( is_DTXrate( ivas_total_brate ) == 0 )
{
......@@ -336,11 +334,11 @@ ivas_error ivas_dec_setup(
st_ivas->nchan_ism = nchan_ism;
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
#endif
data ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -397,11 +395,12 @@ ivas_error ivas_dec_setup(
}
else
{
if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered, data ) ) != IVAS_ERR_OK )
#endif
data ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -409,11 +408,12 @@ ivas_error ivas_dec_setup(
}
else
{
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, data ) ) != IVAS_ERR_OK )
#endif
data ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -434,11 +434,11 @@ ivas_error ivas_dec_setup(
/* reconfigure in case a change of operation mode is detected */
if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) )
{
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, data ) ) != IVAS_ERR_OK )
#endif
data ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -480,6 +480,7 @@ ivas_error ivas_dec_setup(
else
{
ivas_sba_config( ivas_total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &st_ivas->nSCE, &st_ivas->nCPE, &st_ivas->element_mode_init );
/*correct number of CPEs for discrete ISM coding*/
if ( st_ivas->ini_frame > 0 && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
......@@ -510,12 +511,17 @@ ivas_error ivas_dec_setup(
num_bits_read += MC_LS_SETUP_BITS;
/* select MC format mode; reconfigure the MC format decoder */
ivas_mc_dec_config( st_ivas, idx, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_mc_dec_config( st_ivas, idx, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
{
return error;
}
#else
if ( ( error = ivas_mc_dec_config( st_ivas, idx, nSamplesRendered, data ) ) != IVAS_ERR_OK )
{
return error;
}
#endif
data );
}
/*-------------------------------------------------------------------*
......@@ -536,7 +542,6 @@ ivas_error ivas_dec_setup(
{
st_ivas->element_mode_init = 0 + IVAS_CPE_DFT;
}
/* (*num_bits_read)++; */
}
else
{
......@@ -633,11 +638,11 @@ ivas_error ivas_dec_setup(
st_ivas->ism_mode = (ISM_MODE) ( idx + 1 );
}
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered,
#if defined SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK )
#endif
data ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -896,6 +901,7 @@ int16_t getNumChanSynthesis(
n = st_ivas->nchan_transport;
}
}
return n;
}
......@@ -961,7 +967,6 @@ ivas_error ivas_init_decoder_front(
st_ivas->hDecoderConfig->force_rend = -1;
#endif
/*-------------------------------------------------------------------*
* Allocate and initialize Custom loudspeaker layout handle
*--------------------------------------------------------------------*/
......@@ -996,8 +1001,7 @@ ivas_error ivas_init_decoder_front(
if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation )
{
if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ),
( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
if ( ( error = ivas_external_orientation_open( &( st_ivas->hExtOrientationData ), ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1009,8 +1013,7 @@ ivas_error ivas_init_decoder_front(
if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation )
{
if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ),
( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
if ( ( error = ivas_combined_orientation_open( &( st_ivas->hCombinedOrientationData ), ( st_ivas->hDecoderConfig->Opt_5ms ) ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -1098,6 +1101,10 @@ ivas_error ivas_init_decoder(
hDecoderConfig->last_ivas_total_brate = ivas_total_brate;
st_ivas->last_active_ivas_total_brate = ivas_total_brate;
/*-----------------------------------------------------------------*
* Set number of output channels for EXTERNAL output config.
*-----------------------------------------------------------------*/
if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{
if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
......@@ -1540,6 +1547,7 @@ ivas_error ivas_init_decoder(
st_ivas->nchan_transport += st_ivas->nchan_ism;
}
#endif
if ( st_ivas->nCPE > 1 )
{
if ( ( error = create_mct_dec( st_ivas ) ) != IVAS_ERR_OK )
......@@ -1553,6 +1561,7 @@ ivas_error ivas_init_decoder(
st_ivas->nchan_transport -= st_ivas->nchan_ism;
}
#endif
if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, temp_brate ) ) != IVAS_ERR_OK )
......@@ -1560,13 +1569,16 @@ ivas_error ivas_init_decoder(
return error;
}
#ifdef FIX_782_OSBA_FUNCTION_NAMES
if ( ( error = ivas_osba_data_open( st_ivas ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_masa_ism_data_open( st_ivas ) ) != IVAS_ERR_OK )
#endif
{
return error;
}
}
/* set CNA/CNG flags */
ivas_sba_set_cna_cng_flag( st_ivas );
}
......@@ -1672,7 +1684,7 @@ ivas_error ivas_init_decoder(
st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ) );
st_ivas->nSCE = 0;
st_ivas->nCPE = st_ivas->nchan_transport / 2;
st_ivas->nCPE = st_ivas->nchan_transport / CPE_CHANNELS;
st_ivas->element_mode_init = IVAS_CPE_MDCT;
......@@ -1706,7 +1718,7 @@ ivas_error ivas_init_decoder(
}
st_ivas->nSCE = 0;
st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / 2;
st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / CPE_CHANNELS;
st_ivas->nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS;
if ( ( error = ivas_mc_paramupmix_dec_open( st_ivas ) ) != IVAS_ERR_OK )
......@@ -1895,7 +1907,6 @@ ivas_error ivas_init_decoder(
set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
}
/*-------------------------------------------------------------------*
* Allocate and initialize rendering handles
*--------------------------------------------------------------------*/
......@@ -1977,13 +1988,13 @@ ivas_error ivas_init_decoder(
}
}
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -2072,6 +2083,7 @@ ivas_error ivas_init_decoder(
return error;
}
}
#ifndef FIX_782_OSBA_FUNCTION_NAMES
if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
/* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
......@@ -2080,6 +2092,7 @@ ivas_error ivas_init_decoder(
return error;
}
}
#endif
}
/*-----------------------------------------------------------------*
......@@ -2164,10 +2177,8 @@ ivas_error ivas_init_decoder(
/*-----------------------------------------------------------------*
* Allocate and initialize JBM struct + buffer
*-----------------------------------------------------------------*/
if (
st_ivas->hDecoderConfig->Opt_5ms &&
st_ivas->hTcBuffer == NULL )
if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL )
{
/* no module has yet open the TC buffer, open a default one */
n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );
......@@ -2451,6 +2462,9 @@ void ivas_initialize_handles_dec(
st_ivas->hHrtfParambin = NULL;
st_ivas->hoa_dec_mtx = NULL;
st_ivas->hMasaIsmData = NULL;
#ifdef FIX_782_OSBA_FUNCTION_NAMES
st_ivas->hSbaIsmData = NULL;
#endif
st_ivas->hHeadTrackData = NULL;
st_ivas->hHrtfTD = NULL;
......@@ -2641,12 +2655,12 @@ void ivas_destroy_dec(
#endif
/* Crend handle */
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper )
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses );
#else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif
);
/* Reverb handle */
ivas_reverb_close( &st_ivas->hReverb );
......@@ -2667,8 +2681,14 @@ void ivas_destroy_dec(
free( st_ivas->hMonoDmxRenderer );
st_ivas->hMonoDmxRenderer = NULL;
}
#ifdef FIX_782_OSBA_FUNCTION_NAMES
/* OSBA structure */
ivas_osba_data_close( &st_ivas->hSbaIsmData );
#else
/* MASA ISM structure */
ivas_masa_ism_data_close( &st_ivas->hMasaIsmData );
#endif
/* OMASA structure */
ivas_omasa_data_close( &st_ivas->hMasaIsmData );
......@@ -2696,6 +2716,7 @@ void ivas_destroy_dec(
/* CRend binaural renderer handle */
ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF );
/* Fastconv HRTF memories */
ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv );
......
......@@ -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 ISM_MODE last_ism_mode, /* i : last ISM mode */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -83,8 +83,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
st_ivas->ism_mode = ism_mode;
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,
0 ) ) != IVAS_ERR_OK )
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 )
{
return error;
}
......@@ -121,7 +120,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
/* select the renderer */
ivas_renderer_select( st_ivas );
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 ) )
{
ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config );
......@@ -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
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 );
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 defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#endif
data ) ) != IVAS_ERR_OK )
......@@ -242,12 +244,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
#endif
/* 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
,
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses
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 )
#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
) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -330,12 +331,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
}
/* close the crend binaural renderer */
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper )
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses );
#else
ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif
);
}
}
......@@ -439,7 +439,7 @@ ivas_error ivas_ism_dec_config(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
const ISM_MODE last_ism_mode, /* i/o: last ISM mode */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -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 ( ( 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,
#endif
data ) ) != IVAS_ERR_OK )
......@@ -511,7 +511,7 @@ ivas_error ivas_ism_dec_config(
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 defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#endif
data ) ) != IVAS_ERR_OK )
......
......@@ -96,11 +96,11 @@ ivas_error ivas_ism_dtx_dec(
st_ivas->ism_mode = ism_mode_bstr;
}
if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL,
#if defined SPLIT_REND_WITH_HEAD_ROT
PCM_NOT_KNOW,
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, PCM_NOT_KNOW, NULL ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, NULL, NULL ) ) != IVAS_ERR_OK )
#endif
NULL ) ) != IVAS_ERR_OK )
{
return error;
}
......
......@@ -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 int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int16_t *flag_abs_radius );
/*-------------------------------------------------------------------------*
* Local constants
*-------------------------------------------------------------------------*/
......@@ -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,
masa_ism_flag ) ) != IVAS_ERR_OK )
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 )
{
return error;
}
......@@ -698,8 +697,7 @@ ivas_error ivas_ism_metadata_dec_create(
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,
0 ) ) != IVAS_ERR_OK )
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 )
{
return error;
}
......
......@@ -95,6 +95,7 @@ static void ivas_param_ism_dec_dequant_powrat(
return;
}
static void ivas_ism_get_interpolator(
const int16_t subframe_nbslots,
float *interpolator )
......@@ -276,6 +277,7 @@ static void ivas_param_ism_compute_mixing_matrix(
}
direct_power[w] = sqrtf( direct_power[w] );
}
/* Compute mixing matrix */
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] );
......@@ -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 );
for ( ch = 0; ch < nchan_transport; ch++ )
{
/*-----------------------------------------------------------------*
* CLDFB Analysis
*-----------------------------------------------------------------*/
/* CLDFB Analysis */
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] );
......@@ -894,6 +896,7 @@ void ivas_param_ism_dec(
/* 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 );
/* subframe loop for synthesis*/
for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ )
{
......@@ -990,7 +993,6 @@ void ivas_ism_dec_digest_tc(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
)
{
ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
if ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
......@@ -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 );
}
/* also get the gains here */
num_objects = st_ivas->nchan_transport;
for ( i = 0; i < num_objects; i++ )
......@@ -1035,10 +1038,7 @@ void ivas_ism_dec_digest_tc(
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{
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] );
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] );
}
else
{
......@@ -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( 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 );
}
}
......@@ -1260,7 +1261,6 @@ void ivas_ism_param_dec_tc_gain_ajust(
ene_sum = 0.0f;
last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain;
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
......@@ -1292,11 +1292,13 @@ void ivas_ism_param_dec_tc_gain_ajust(
transport_channels_f[1][i] *= gain;
}
}
st_ivas->hDirAC->hParamIsm->last_dmx_gain = gain;
return;
}
/*-------------------------------------------------------------------------*
* 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];
DIRAC_DEC_HANDLE hDirAC;
SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
int16_t slot_idx_start;
int16_t idx_in;
int16_t idx_lfe;
......@@ -1353,8 +1354,7 @@ static void ivas_ism_param_dec_render_sf(
/* Compute bandwise rendering to target LS using covariance rendering */
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,
nchan_out_woLFE, nchan_transport );
Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirAC->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, nchan_out_woLFE, nchan_transport );
}
/* CLDFB Synthesis */
......@@ -1382,8 +1382,8 @@ static void ivas_ism_param_dec_render_sf(
RealBuffer[i] = Cldfb_RealBuffer[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++;
}
}
......@@ -1672,6 +1672,7 @@ static void ivas_param_ism_dec_dequant_powrat(
return;
}
static void ivas_ism_get_interpolator(
const int16_t subframe_nbslots,
float *interpolator )
......@@ -1853,6 +1854,7 @@ static void ivas_param_ism_compute_mixing_matrix(
}
direct_power[w] = sqrtf( direct_power[w] );
}
/* Compute mixing matrix */
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] );
......@@ -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 );
for ( ch = 0; ch < nchan_transport; ch++ )
{
/*-----------------------------------------------------------------*
* CLDFB Analysis
*-----------------------------------------------------------------*/
/* CLDFB Analysis */
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] );
......@@ -2469,6 +2471,7 @@ void ivas_param_ism_dec(
/* 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 );
/* subframe loop for synthesis*/
for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ )
{
......@@ -2565,7 +2568,6 @@ void ivas_ism_dec_digest_tc(
Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */
)
{
ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
if ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
......@@ -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 );
}
/* also get the gains here */
num_objects = st_ivas->nchan_transport;
for ( i = 0; i < num_objects; i++ )
......@@ -2610,10 +2613,7 @@ void ivas_ism_dec_digest_tc(
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{
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] );
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] );
}
else
{
......@@ -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( 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 );
}
}
......@@ -2835,7 +2836,6 @@ void ivas_ism_param_dec_tc_gain_ajust(
ene_sum = 0.0f;
last_gain = st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain;
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
......@@ -2867,11 +2867,13 @@ void ivas_ism_param_dec_tc_gain_ajust(
transport_channels_f[1][i] *= gain;
}
}
st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain = gain;
return;
}
/*-------------------------------------------------------------------------*
* 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];
PARAM_ISM_DEC_HANDLE hParamIsmDec;
SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
int16_t slot_idx_start;
int16_t idx_in;
int16_t idx_lfe;
......@@ -2928,8 +2929,7 @@ static void ivas_ism_param_dec_render_sf(
/* Compute bandwise rendering to target LS using covariance rendering */
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,
nchan_out_woLFE, nchan_transport );
Cldfb_RealBuffer, Cldfb_ImagBuffer, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin, index_slot, slot_idx, nchan_out_woLFE, nchan_transport );
}
/* CLDFB Synthesis */
......@@ -2957,8 +2957,8 @@ static void ivas_ism_param_dec_render_sf(
RealBuffer[i] = Cldfb_RealBuffer[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++;
}
}
......
......@@ -183,10 +183,7 @@ void ivas_ism_render(
{
if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO )
{
ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth,
st_ivas->hIsmMetaData[i]->elevation,
&gains[i][0],
&gains[i][1] );
ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &gains[i][0], &gains[i][1] );
}
else
{
......@@ -243,6 +240,7 @@ void ivas_ism_render(
return;
}
/*-------------------------------------------------------------------------*
* ivas_ism_render_sf()
*
......@@ -274,12 +272,9 @@ void ivas_ism_render_sf(
set_f( output_f[i], 0.0f, n_samples_to_render );
}
if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] )
{
ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render,
n_samples_to_render,
st_ivas->hIsmRendererData->interpolator );
ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
interp_offset = 0;
}
......@@ -601,6 +596,7 @@ void ivas_omasa_separate_object_render(
return;
}
/*-------------------------------------------------------------------------*
* ivas_omasa_separate_object_render_jbm()
*
......
......@@ -777,7 +777,7 @@ ivas_error ivas_jbm_dec_render(
const uint16_t nSamplesAsked, /* i : number of samples wanted */
uint16_t *nSamplesRendered, /* o : number of samples rendered */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -972,7 +972,10 @@ ivas_error ivas_jbm_dec_render(
}
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 )
......@@ -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 ( ( 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;
}
......@@ -1169,11 +1172,11 @@ ivas_error ivas_jbm_dec_render(
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 )
#endif
{
if ( !( st_ivas->ivas_format == MONO_FORMAT ) )
if ( st_ivas->ivas_format != MONO_FORMAT )
{
#ifndef DISABLE_LIMITER
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(
}
}
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
switch ( pcm_resolution )
{
case PCM_INT16:
......@@ -1189,13 +1192,13 @@ ivas_error ivas_jbm_dec_render(
#ifdef DEBUGGING
st_ivas->noClipping +=
#endif
ivas_syn_output( p_output, *nSamplesRendered, nchan_out,
#if defined SPLIT_REND_WITH_HEAD_ROT
(int16_t *)
#ifdef SPLIT_REND_WITH_HEAD_ROT
ivas_syn_output( p_output, *nSamplesRendered, nchan_out, (int16_t *) data );
#else
ivas_syn_output( p_output, *nSamplesRendered, nchan_out, data );
#endif
data );
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
break;
case PCM_FLOAT32:
ivas_syn_output_f( p_output, *nSamplesRendered, nchan_out, (float *) data );
......@@ -1205,6 +1208,7 @@ ivas_error ivas_jbm_dec_render(
break;
}
#endif
*nSamplesAvailableNext = st_ivas->hTcBuffer->n_samples_available;
pop_wmops();
......@@ -1227,7 +1231,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
const MC_MODE mc_mode_old, /* i : old MC mode */
const ISM_MODE ism_mode_old, /* i : old ISM mode */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -1382,7 +1386,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
}
/* 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 )
#endif
{
......@@ -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 )
{
case PCM_INT16:
......@@ -1403,12 +1407,12 @@ ivas_error ivas_jbm_dec_flush_renderer(
st_ivas->noClipping +=
#endif
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 *)
#endif
data );
#if defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
break;
case PCM_FLOAT32:
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(
}
if ( st_ivas->ivas_format == SBA_FORMAT )
{
if (
#ifndef NONBE_FIX_770_PLANAR_SBA_JBM
( st_ivas->sba_planar && num_tc >= 3 ) ||
(
#endif
num_tc == 3
#ifndef NONBE_FIX_770_PLANAR_SBA_JBM
)
#ifdef NONBE_FIX_770_PLANAR_SBA_JBM
if ( num_tc == 3 )
#else
if ( ( st_ivas->sba_planar && num_tc >= 3 ) || num_tc == 3 )
#endif
)
{
num_tc++;
}
......
......@@ -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 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 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(
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,
st_ivas->ivas_format, st_ivas->ism_mode, 0 );
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 );
hQMetaData->metadata_max_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC;
......@@ -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,
st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
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 );
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 );
......@@ -836,8 +836,7 @@ static ivas_error ivas_masa_dec_config(
void ivas_masa_prerender(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
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 */
)
{
......@@ -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(
IVAS_QMETADATA_HANDLE hQMetaData )
{
......@@ -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
{
......@@ -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;
......@@ -1007,6 +1006,7 @@ static ivas_error init_lfe_synth_data(
set_zero( hMasa->hMasaLfeSynth->lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES );
hMasa->hMasaLfeSynth->lfeGainPrevIndex = 0;
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_2 ||
......@@ -1227,7 +1227,7 @@ static int16_t decode_lfe_to_total_energy_ratio(
ivas_error ivas_masa_dec_reconfigure(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
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 */
void *data /* o : output synthesis signal */
#else
......@@ -1421,11 +1421,11 @@ ivas_error ivas_masa_dec_reconfigure(
{
return error;
}
}
/*-----------------------------------------------------------------*
* Set-up MASA coding elements and bitrates
*-----------------------------------------------------------------*/
}
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 ) )
......@@ -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,
st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
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 );
if ( st_ivas->ivas_format == MASA_FORMAT )
{
......@@ -1485,7 +1484,7 @@ ivas_error ivas_masa_dec_reconfigure(
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 defined SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
pcm_resolution,
#endif
data ) ) != IVAS_ERR_OK )
......@@ -1604,7 +1603,6 @@ void ivas_spar_param_to_masa_param_mapping(
}
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 );
for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ )
{
......@@ -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 */
}
/* Decorrelated channels assumed to have the same energy as the source channel */
inCovarianceMtx[1][1] = inCovarianceMtx[0][0];
inCovarianceMtx[2][2] = inCovarianceMtx[0][0];
......@@ -1932,7 +1931,8 @@ static void decode_index_slice(
int16_t index, /* i : index to decode */
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 K ) /* i : sum of array elements */
const int16_t K /* i : sum of array elements */
)
{
int16_t i, j, sum, elem;
int16_t base[MAX_NUM_OBJECTS];
......@@ -2374,6 +2374,7 @@ static int16_t ivas_decode_masaism_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 );
for ( obj = 0; obj < nchan_ism; obj++ )
{
index = 0;
......
......@@ -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
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
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 );
......@@ -246,7 +247,6 @@ ivas_error ivas_param_mc_dec_open(
param_mc_set_num_synth_bands( output_Fs, hParamMC );
/* Band Grouping */
if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 )
{
......@@ -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 )
{
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 );
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 );
if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO )
{
......@@ -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 );
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,
DIRAC_SYNTHESIS_COV_MC_LS,
frequency_axis,
nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
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,
DIRAC_SYNTHESIS_COV_MC_LS, frequency_axis, nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -409,22 +400,14 @@ ivas_error ivas_param_mc_dec_open(
}
/* output synthesis */
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->hMetadataPMC->num_parameter_bands,
max_param_band_residual,
nchan_transport,
nchan_out_cov,
proto_matrix ) ) != IVAS_ERR_OK )
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->hMetadataPMC->num_parameter_bands, max_param_band_residual, nchan_transport, nchan_out_cov, proto_matrix ) ) != IVAS_ERR_OK )
{
return error;
}
ivas_param_mc_dec_compute_interpolator( 0, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hParamMC->h_output_synthesis_params.interpolator );
/* 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 ) )
{
......@@ -459,9 +442,7 @@ ivas_error ivas_param_mc_dec_open(
ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov );
if (
st_ivas->hDecoderConfig->Opt_5ms &&
hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO )
if ( st_ivas->hDecoderConfig->Opt_5ms && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO )
{
int16_t n_cldfb_slots;
......@@ -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" ) );
}
set_zero( hParamMC->Cldfb_ImagBuffer_tc, n_cldfb_slots * nchan_transport * hParamMC->num_freq_bands );
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 )
......@@ -748,7 +730,6 @@ ivas_error ivas_param_mc_dec_reconfig(
param_mc_set_num_synth_bands( output_Fs, hParamMC );
/* set max parameter band for abs cov */
k = 0;
while ( hParamMC->band_grouping[k] <= PARAM_MC_MAX_BAND_ABS_COV_DEC )
......@@ -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 );
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,
DIRAC_SYNTHESIS_COV_MC_LS,
frequency_axis,
nchan_transport,
output_Fs ) ) != IVAS_ERR_OK )
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, DIRAC_SYNTHESIS_COV_MC_LS, frequency_axis, nchan_transport, output_Fs ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -941,15 +915,8 @@ ivas_error ivas_param_mc_dec_reconfig(
set_zero( tmp_buf, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS );
/* output synthesis */
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->hMetadataPMC->num_parameter_bands,
max_param_band_residual,
nchan_transport,
nchan_out_cov,
proto_matrix ) ) != IVAS_ERR_OK )
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->hMetadataPMC->num_parameter_bands, max_param_band_residual, nchan_transport, nchan_out_cov, proto_matrix ) ) != IVAS_ERR_OK )
{
return error;
}
......@@ -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 );
/* 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 )
{
......@@ -1133,7 +1099,6 @@ void ivas_param_mc_dec_close(
hParamMC->diff_proto_info = NULL;
}
/* States */
/* free prototype signal buffers */
if ( hParamMC->proto_frame_f != NULL )
......@@ -1783,17 +1748,23 @@ void ivas_param_mc_dec_render(
}
}
#endif
ivas_binRenderer( st_ivas->hBinRenderer,
#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
#else
ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL,
#endif
st_ivas->hCombinedOrientationData,
subframe_idx,
hParamMC->subframe_nbslots[subframe_idx],
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
st_ivas->hCombinedOrientationData, subframe_idx, hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
#endif
#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 )
......@@ -2189,6 +2160,7 @@ static int16_t ivas_param_mc_range_decoder_LC(
*
* compute the interpolator used in the final synthesis
*------------------------------------------------------------------------*/
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 attackPos, /* i : position of the transient */
......
......@@ -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 );
#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
static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] );
#endif
......@@ -153,7 +153,6 @@ void ivas_mc_paramupmix_dec_read_BS(
}
pop_wmops();
return;
}
......@@ -211,7 +210,6 @@ void ivas_mc_paramupmix_dec(
hMCParamUpmix = st_ivas->hMCParamUpmix;
assert( hMCParamUpmix );
push_wmops( "mc_paramupmix_dec" );
set_s( channel_active, 0, MAX_CICP_CHANNELS );
......@@ -319,6 +317,7 @@ void ivas_mc_paramupmix_dec(
}
idx_in += 2;
}
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
if ( st_ivas->hCombinedOrientationData && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
{
......@@ -328,6 +327,7 @@ void ivas_mc_paramupmix_dec(
}
}
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*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 )
......@@ -367,20 +367,19 @@ void ivas_mc_paramupmix_dec(
#endif
/* Implement binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#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
st_ivas->hCombinedOrientationData,
subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */
JBM_CLDFB_SLOTS_IN_SUBFRAME,
#else
ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, /* TODO (5ms) : tmu2Dlb please verify */ JBM_CLDFB_SLOTS_IN_SUBFRAME,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
NULL,
#endif
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
Cldfb_RealBuffer_subfr,
Cldfb_ImagBuffer_subfr );
Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_subfr, Cldfb_ImagBuffer_subfr );
#endif
#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 )
......@@ -396,6 +395,7 @@ void ivas_mc_paramupmix_dec(
}
}
#endif
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++ )
......@@ -489,7 +489,6 @@ void ivas_mc_paramupmix_dec(
}
pop_wmops();
return;
}
......@@ -509,7 +508,6 @@ void ivas_mc_paramupmix_dec_digest_tc(
MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix;
hMCParamUpmix = st_ivas->hMCParamUpmix;
assert( hMCParamUpmix );
push_wmops( "ivas_mc_paramupmix_dec_digest_tc" );
ivas_param_upmix_dec_decorr_subframes( st_ivas, nSamplesForRendering );
......@@ -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 );
pop_wmops();
return;
}
......@@ -615,6 +614,7 @@ void ivas_mc_paramupmix_dec_render(
*nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size;
pop_wmops();
return;
}
......@@ -661,9 +661,11 @@ ivas_error ivas_mc_paramupmix_dec_open(
assert( 0 && "Number of TC not supported for MC ParamUpmix!" );
#endif
}
#ifdef NONBE_FIX_727_MC_PARAMUPMIX_HEADROTATION
hMCParamUpmix->hoa_encoder = NULL;
#endif
/*-----------------------------------------------------------------*
* set input parameters
*-----------------------------------------------------------------*/
......@@ -699,9 +701,7 @@ ivas_error ivas_mc_paramupmix_dec_open(
/* allocate transport channels*/
hMCParamUpmix->free_param_interpolator = 0;
hMCParamUpmix->param_interpolator = NULL;
if (
st_ivas->hDecoderConfig->Opt_5ms == 1 &&
st_ivas->hTcBuffer == NULL )
if ( st_ivas->hDecoderConfig->Opt_5ms == 1 && st_ivas->hTcBuffer == NULL )
{
int16_t nchan_to_allocate;
int16_t nchan_tc;
......@@ -787,11 +787,14 @@ void ivas_mc_paramupmix_dec_close(
return;
}
/*-------------------------------------------------------------------------
* ivas_param_upmix_dec_decorr_subframes()
*
*
*------------------------------------------------------------------------*/
static void paramupmix_td_decorr_process_jbm(
ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */
float *pcm_in[], /* i : input audio channels */
......@@ -838,6 +841,7 @@ static void paramupmix_td_decorr_process_jbm(
return;
}
static void ivas_param_upmix_dec_decorr_subframes(
Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */
const int16_t nSamplesForRendering )
......@@ -879,10 +883,10 @@ static void ivas_param_upmix_dec_decorr_subframes(
}
pop_wmops();
return;
}
/*****************************************************************************************/
/* local functions */
/*****************************************************************************************/
......@@ -1035,7 +1039,7 @@ static void ivas_mc_paramupmix_dec_sf(
float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */
#ifdef SPLIT_REND_WITH_HEAD_ROT
,
int16_t slot_index_start
const int16_t slot_index_start
#endif
)
{
......@@ -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 )
{
maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 );
......@@ -1184,16 +1189,11 @@ static void ivas_mc_paramupmix_dec_sf(
#endif
/* Implement binaural rendering */
ivas_binRenderer( st_ivas->hBinRenderer,
#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
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
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(
}
#endif
/* Implement CLDFB synthesis */
for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
{
......@@ -1290,6 +1289,7 @@ static void ivas_mc_paramupmix_dec_sf(
st_ivas->hTcBuffer->subframes_rendered++;
pop_wmops();
return;
}
......