Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ #define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ /* #################### End BE switches ################################## */ Loading lib_dec/ivas_dirac_dec.c +23 −1 Original line number Diff line number Diff line Loading @@ -1554,7 +1554,12 @@ void ivas_dirac_dec_render( uint16_t slot_size, n_samples_sf, ch, nchan_intern; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; #ifdef FIX_NCHAN_BUFFERS float *p_output_f[MAX_OUTPUT_CHANNELS]; float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; #else float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; #endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; Loading @@ -1565,7 +1570,11 @@ void ivas_dirac_dec_render( for ( ch = 0; ch < nchan_intern; ch++ ) { output_f_local[ch] = output_f_local_buff[ch]; #ifdef FIX_NCHAN_BUFFERS p_output_f[ch] = output_f[ch]; #else set_zero( output_f_local_buff[ch], nSamplesAsked ); #endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); Loading @@ -1587,16 +1596,29 @@ void ivas_dirac_dec_render( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { ivas_dirac_dec_render_sf( st_ivas, output_f_local, nchan_transport, NULL, NULL ); n_samples_sf = hSpatParamRendCom->subframe_nbslots[subframe_idx] * hSpatParamRendCom->slot_size; for ( ch = 0; ch < nchan_intern; ch++ ) { #ifdef FIX_NCHAN_BUFFERS /* move to output */ if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) { mvr2r( output_f_local_buff[ch], p_output_f[ch], n_samples_sf ); } p_output_f[ch] += n_samples_sf; #else output_f_local[ch] += n_samples_sf; #endif } /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } #ifndef FIX_NCHAN_BUFFERS for ( ch = 0; ch < nchan_intern; ch++ ) { if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) Loading @@ -1604,7 +1626,7 @@ void ivas_dirac_dec_render( mvr2r( output_f_local_buff[ch], output_f[ch], *nSamplesRendered ); } } #endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) Loading lib_dec/ivas_init_dec.c +6 −1 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ ivas_error ivas_dec_setup( } /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) * Read other signaling (ISM/MC mode, number of channels, etc.) *-------------------------------------------------------------------*/ if ( is_DTXrate( ivas_total_brate ) == 0 ) Loading Loading @@ -2378,7 +2378,12 @@ ivas_error ivas_init_decoder( * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ #ifdef FIX_NCHAN_BUFFERS k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); for ( n = 0; n < k; n++ ) #else for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) #endif { /* note: these are intra-frame heap memories */ if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) Loading lib_dec/ivas_jbm_dec.c +18 −0 Original line number Diff line number Diff line Loading @@ -849,7 +849,12 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &st_ivas->p_output_f[n][0]; } #ifdef FIX_NCHAN_BUFFERS ch = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); for ( n = 0; n < ch; n++ ) #else for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) #endif { hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ } Loading Loading @@ -2379,11 +2384,20 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; int16_t ch_idx; #ifdef FIX_NCHAN_BUFFERS float tc_buffer_mem[CPE_CHANNELS * MAX_JBM_L_FRAME48k]; int16_t num_tc_buffer_mem; #endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; #ifdef FIX_NCHAN_BUFFERS /* 2 channels of the TC buffer for smooth transition in bitrate swithing within 1 CPE and TD decorr. on and off */ num_tc_buffer_mem = min( hTcBuffer->nchan_buffer_full, CPE_CHANNELS ); mvr2r( hTcBuffer->tc_buffer, tc_buffer_mem, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); #endif /* if granularity changes, adapt subframe_nb_slots */ if ( n_samples_granularity != hTcBuffer->n_samples_granularity ) { Loading Loading @@ -2488,6 +2502,10 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } } #ifdef FIX_NCHAN_BUFFERS mvr2r( tc_buffer_mem, hTcBuffer->tc_buffer, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); #endif return IVAS_ERR_OK; } Loading lib_dec/ivas_masa_dec.c +30 −0 Original line number Diff line number Diff line Loading @@ -1320,6 +1320,9 @@ ivas_error ivas_masa_dec_reconfigure( Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; #ifdef FIX_NCHAN_BUFFERS int16_t nchan_out_buff_old, nchan_out_buff; #endif ivas_error error; int16_t pos_idx; int32_t ism_total_brate; Loading @@ -1327,6 +1330,10 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #ifdef FIX_NCHAN_BUFFERS nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); #endif /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading Loading @@ -1490,8 +1497,16 @@ ivas_error ivas_masa_dec_reconfigure( } else { #ifdef FIX_NCHAN_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS; if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; } #else tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; #endif } } else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) { Loading Loading @@ -1530,6 +1545,21 @@ ivas_error ivas_masa_dec_reconfigure( } } #ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */ { nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } } #endif return IVAS_ERR_OK; } Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ #define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ /* #################### End BE switches ################################## */ Loading
lib_dec/ivas_dirac_dec.c +23 −1 Original line number Diff line number Diff line Loading @@ -1554,7 +1554,12 @@ void ivas_dirac_dec_render( uint16_t slot_size, n_samples_sf, ch, nchan_intern; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; #ifdef FIX_NCHAN_BUFFERS float *p_output_f[MAX_OUTPUT_CHANNELS]; float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; #else float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; #endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; Loading @@ -1565,7 +1570,11 @@ void ivas_dirac_dec_render( for ( ch = 0; ch < nchan_intern; ch++ ) { output_f_local[ch] = output_f_local_buff[ch]; #ifdef FIX_NCHAN_BUFFERS p_output_f[ch] = output_f[ch]; #else set_zero( output_f_local_buff[ch], nSamplesAsked ); #endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); Loading @@ -1587,16 +1596,29 @@ void ivas_dirac_dec_render( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { ivas_dirac_dec_render_sf( st_ivas, output_f_local, nchan_transport, NULL, NULL ); n_samples_sf = hSpatParamRendCom->subframe_nbslots[subframe_idx] * hSpatParamRendCom->slot_size; for ( ch = 0; ch < nchan_intern; ch++ ) { #ifdef FIX_NCHAN_BUFFERS /* move to output */ if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) { mvr2r( output_f_local_buff[ch], p_output_f[ch], n_samples_sf ); } p_output_f[ch] += n_samples_sf; #else output_f_local[ch] += n_samples_sf; #endif } /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } #ifndef FIX_NCHAN_BUFFERS for ( ch = 0; ch < nchan_intern; ch++ ) { if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) Loading @@ -1604,7 +1626,7 @@ void ivas_dirac_dec_render( mvr2r( output_f_local_buff[ch], output_f[ch], *nSamplesRendered ); } } #endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) Loading
lib_dec/ivas_init_dec.c +6 −1 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ ivas_error ivas_dec_setup( } /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) * Read other signaling (ISM/MC mode, number of channels, etc.) *-------------------------------------------------------------------*/ if ( is_DTXrate( ivas_total_brate ) == 0 ) Loading Loading @@ -2378,7 +2378,12 @@ ivas_error ivas_init_decoder( * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ #ifdef FIX_NCHAN_BUFFERS k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); for ( n = 0; n < k; n++ ) #else for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) #endif { /* note: these are intra-frame heap memories */ if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) Loading
lib_dec/ivas_jbm_dec.c +18 −0 Original line number Diff line number Diff line Loading @@ -849,7 +849,12 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &st_ivas->p_output_f[n][0]; } #ifdef FIX_NCHAN_BUFFERS ch = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); for ( n = 0; n < ch; n++ ) #else for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) #endif { hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ } Loading Loading @@ -2379,11 +2384,20 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; int16_t ch_idx; #ifdef FIX_NCHAN_BUFFERS float tc_buffer_mem[CPE_CHANNELS * MAX_JBM_L_FRAME48k]; int16_t num_tc_buffer_mem; #endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; #ifdef FIX_NCHAN_BUFFERS /* 2 channels of the TC buffer for smooth transition in bitrate swithing within 1 CPE and TD decorr. on and off */ num_tc_buffer_mem = min( hTcBuffer->nchan_buffer_full, CPE_CHANNELS ); mvr2r( hTcBuffer->tc_buffer, tc_buffer_mem, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); #endif /* if granularity changes, adapt subframe_nb_slots */ if ( n_samples_granularity != hTcBuffer->n_samples_granularity ) { Loading Loading @@ -2488,6 +2502,10 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } } #ifdef FIX_NCHAN_BUFFERS mvr2r( tc_buffer_mem, hTcBuffer->tc_buffer, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); #endif return IVAS_ERR_OK; } Loading
lib_dec/ivas_masa_dec.c +30 −0 Original line number Diff line number Diff line Loading @@ -1320,6 +1320,9 @@ ivas_error ivas_masa_dec_reconfigure( Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; #ifdef FIX_NCHAN_BUFFERS int16_t nchan_out_buff_old, nchan_out_buff; #endif ivas_error error; int16_t pos_idx; int32_t ism_total_brate; Loading @@ -1327,6 +1330,10 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #ifdef FIX_NCHAN_BUFFERS nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); #endif /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading Loading @@ -1490,8 +1497,16 @@ ivas_error ivas_masa_dec_reconfigure( } else { #ifdef FIX_NCHAN_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS; if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; } #else tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; #endif } } else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) { Loading Loading @@ -1530,6 +1545,21 @@ ivas_error ivas_masa_dec_reconfigure( } } #ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */ { nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } } #endif return IVAS_ERR_OK; } Loading