From 89ed086dbe3b52150a9f134378174ec465295ca3 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 5 Aug 2025 10:30:36 +0300 Subject: [PATCH 1/4] Fix duplication of ivas_get_nchan_buffers_dec by removing ivas_fx variant. Also fix minor BASOP issues in the function. --- lib_dec/ivas_ism_dec_fx.c | 2 +- lib_dec/ivas_mct_dec_fx.c | 2 +- lib_dec/ivas_omasa_dec_fx.c | 2 +- lib_dec/lib_dec_fx.c | 2 +- lib_rend/ivas_output_init_fx.c | 160 +-------------------------------- 5 files changed, 7 insertions(+), 161 deletions(-) diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index 95ee97b2d..6d60d16a1 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -81,7 +81,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; move16(); - nchan_out_buff_old = ivas_get_nchan_buffers_dec_ivas_fx( st_ivas, -1, -1 ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_ism_config_fx( 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 ) ) { diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 1fcdbff84..0c11c6729 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1609,7 +1609,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( * floating-point output audio buffers *-----------------------------------------------------------------*/ - nchan_out_buff = ivas_get_nchan_buffers_dec_ivas_fx( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index e0401b941..da004be2d 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -463,7 +463,7 @@ ivas_error ivas_omasa_dec_config_fx( st_ivas->ivas_format = st_ivas->last_ivas_format; move16(); ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); - nchan_out_buff_old = ivas_get_nchan_buffers_dec_ivas_fx( st_ivas, -1, -1 ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); move16(); st_ivas->ivas_format = ivas_format_orig; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 98bbfd3d5..f2796dce6 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1793,7 +1793,7 @@ static ivas_error IVAS_DEC_GetTcSamples( IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) { - FOR( n = 0; n < ivas_get_nchan_buffers_dec_ivas_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + FOR( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { set32_fx( st_ivas->p_output_fx[n], 0, L_FRAME48k ); st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; // Q11 diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 5c19acb5f..56f168857 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -367,6 +367,8 @@ Word16 ivas_get_nchan_buffers_dec( nchan_out_buff = CPE_CHANNELS; move16(); + test(); + test(); test(); test(); test(); @@ -374,7 +376,7 @@ Word16 ivas_get_nchan_buffers_dec( { nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } - ELSE if ( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { nchan_out_buff = shl( CPE_CHANNELS, 1 ); @@ -464,162 +466,6 @@ Word16 ivas_get_nchan_buffers_dec( return nchan_out_buff; } -Word16 ivas_get_nchan_buffers_dec_ivas_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const Word16 sba_analysis_order, /* i : SBA order evaluated in SBA decoder */ - const Word32 ivas_total_brate /* i : total IVAS bitrate */ -) -{ - Word16 nchan_out_buff; - AUDIO_CONFIG output_config; - - output_config = st_ivas->hDecoderConfig->output_config; - move16(); - - nchan_out_buff = MAX_OUTPUT_CHANNELS; - move16(); - - IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) ) - { - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - move16(); - } - ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, CPE_CHANNELS ); - } - ELSE IF( EQ_16( st_ivas->ivas_format, ISM_FORMAT ) ) - { - nchan_out_buff = st_ivas->nchan_ism; - move16(); - - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - } - ELSE IF( EQ_16( st_ivas->ivas_format, SBA_FORMAT ) ) - { - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - move16(); - - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - nchan_out_buff = s_max( nchan_out_buff, nchan_internal ); - } - ELSE IF( EQ_16( st_ivas->ivas_format, MASA_FORMAT ) ) - { - nchan_out_buff = CPE_CHANNELS; - move16(); - - test(); - test(); - test(); - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { - nchan_out_buff = shl( CPE_CHANNELS, 1 ); - move16(); - } - ELSE IF( NE_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - } - ELSE IF( EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) - { - nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); - - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - } - ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) - { - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = add( st_ivas->nchan_ism, st_ivas->nchan_transport ); - - IF( st_ivas->hMCT != NULL ) - { - nchan_out_buff = shl( shr( add( nchan_out_buff, 1 ), 1 ), 1 ); /* ensure odd number of channels in MCT */ - } - - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - - move16(); - IF( EQ_16( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_16( st_ivas->renderer_type, RENDERER_OSBA_LS ) ) - { - nchan_out_buff = s_max( add( nchan_out_buff, st_ivas->nchan_ism ), audioCfg2channels( output_config ) ); /* needed for ivas_sba_upmixer_renderer() */ - } - ELSE - { - nchan_out_buff = s_max( add( nchan_out_buff, st_ivas->nchan_ism ), audioCfg2channels( output_config ) ); /* needed for ivas_spar_dec_upmixer_sf() which is based on 'nchan_out' */ - } - } - ELSE IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = add( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); /*take into account sba_ch_idx' in ivas_dec() */ - } - - test(); - IF( !( EQ_16( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_16( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( nchan_internal, st_ivas->nchan_ism ) ); - } - nchan_out_buff = s_min( nchan_out_buff, MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ); - } - ELSE IF( EQ_16( st_ivas->ivas_format, MC_FORMAT ) ) - { - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - move16(); - - IF( EQ_16( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - } - - - return nchan_out_buff; -} - /*-------------------------------------------------------------------* * ivas_output_buff_dec() -- GitLab From 2576de99ffe19bc718f3ceed14bc75b2cc147226 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 5 Aug 2025 11:13:32 +0300 Subject: [PATCH 2/4] Clang format --- lib_rend/ivas_output_init_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 56f168857..06a82d970 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -377,7 +377,7 @@ Word16 ivas_get_nchan_buffers_dec( nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); } ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { nchan_out_buff = shl( CPE_CHANNELS, 1 ); } -- GitLab From bb1d6971d36947993e87aaa205522c30ea8de3de Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 6 Aug 2025 09:01:13 +0300 Subject: [PATCH 3/4] Remove also prototype of the duplicate --- lib_rend/ivas_prot_rend_fx.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 77960f73e..395f32951 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -75,12 +75,6 @@ Word16 ivas_get_nchan_buffers_dec( const Word32 ivas_total_brate /* i : total IVAS bitrate */ ); -Word16 ivas_get_nchan_buffers_dec_ivas_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const Word16 sba_analysis_order, /* i : SBA order evaluated in SBA decoder */ - const Word32 ivas_total_brate /* i : total IVAS bitrate */ -); - ivas_error get_channel_config( const AUDIO_CONFIG config, /* i : audio configuration */ Word8 *str /* o : string with the configuration name */ -- GitLab From e0487e6fd2bc5f0c57c489c24251675a93e2435c Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 6 Aug 2025 09:02:34 +0300 Subject: [PATCH 4/4] Rename function ivas_get_nchan_buffers_dec to ivas_get_nchan_buffers_dec_fx. --- lib_dec/ivas_init_dec_fx.c | 4 ++-- lib_dec/ivas_ism_dec_fx.c | 4 ++-- lib_dec/ivas_jbm_dec_fx.c | 6 +++--- lib_dec/ivas_mc_paramupmix_dec_fx.c | 2 +- lib_dec/ivas_mct_dec_fx.c | 4 ++-- lib_dec/ivas_omasa_dec_fx.c | 4 ++-- lib_dec/ivas_sba_dec_fx.c | 4 ++-- lib_dec/lib_dec_fx.c | 2 +- lib_rend/ivas_output_init_fx.c | 2 +- lib_rend/ivas_prot_rend_fx.h | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 4a8673aeb..2aeb83089 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2758,9 +2758,9 @@ ivas_error ivas_init_decoder_fx( /*-----------------------------------------------------------------* * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ - st_ivas->p_out_len = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + st_ivas->p_out_len = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); - FOR( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { /* note: these are intra-frame heap memories */ IF( ( st_ivas->p_output_fx[n] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index 6d60d16a1..453dc0c69 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -81,7 +81,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; move16(); - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_ism_config_fx( 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 ) ) { @@ -320,7 +320,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( *-----------------------------------------------------------------*/ { - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 032946c48..47db837a9 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -124,12 +124,12 @@ ivas_error ivas_jbm_dec_tc_fx( IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) { - FOR( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { set_zero_fx( st_ivas->p_output_fx[n], L_FRAME48k ); st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; } - st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); } @@ -2627,7 +2627,7 @@ ivas_error ivas_jbm_dec_render_fx( IF( st_ivas->hTcBuffer->n_samples_discard > 0 ) { - FOR( n = 0; n < s_min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); n++ ) + FOR( n = 0; n < s_min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); n++ ) { p_output_fx[n] += st_ivas->hTcBuffer->n_samples_discard; } diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index af2506b95..7c3581c93 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -287,7 +287,7 @@ void ivas_mc_paramupmix_dec_render( ivas_mc_paramupmix_dec_sf( st_ivas, output_local_fx ); - Word16 num_ch = s_min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ) ); + Word16 num_ch = s_min( MAX_OUTPUT_CHANNELS, ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ) ); FOR( ch = 0; ch < num_ch; ch++ ) { output_local_fx[ch] += n_samples_sf; diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 837ac6cce..1b95820a9 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -919,7 +919,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( move32(); nchan_transport_old = st_ivas->nchan_transport; move16(); - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); last_mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */ /* temporally set the current mc_mode back to the previous one to make sure the following call to @@ -1620,7 +1620,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( * floating-point output audio buffers *-----------------------------------------------------------------*/ - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index da004be2d..a2edc37e4 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -463,7 +463,7 @@ ivas_error ivas_omasa_dec_config_fx( st_ivas->ivas_format = st_ivas->last_ivas_format; move16(); ivas_init_dec_get_num_cldfb_instances_ivas_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); move16(); st_ivas->ivas_format = ivas_format_orig; @@ -821,7 +821,7 @@ ivas_error ivas_omasa_dec_config_fx( * floating-point output audio buffers *-----------------------------------------------------------------*/ - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { return error; diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 0afec8a42..1e7a9312b 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -149,7 +149,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( * Save old SBA high-level parameters *-----------------------------------------------------------------*/ - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); + nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); @@ -786,7 +786,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( * floating-point output audio buffers *-----------------------------------------------------------------*/ - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); /*Q0*/ + nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); /*Q0*/ if ( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index a2022dd0c..cc985f288 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1793,7 +1793,7 @@ static ivas_error IVAS_DEC_GetTcSamples( IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) { - FOR( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) { set32_fx( st_ivas->p_output_fx[n], 0, L_FRAME48k ); st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; // Q11 diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index e05cf1a43..9e35a435e 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -305,7 +305,7 @@ void ivas_output_init( *-----------------------------------------------------------------*/ /*! r: number of decoder buffers */ -Word16 ivas_get_nchan_buffers_dec( +Word16 ivas_get_nchan_buffers_dec_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 sba_analysis_order, /* i : SBA order evaluated in SBA decoder */ const Word32 ivas_total_brate /* i : total IVAS bitrate */ diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index c59bd7594..69034e43c 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -69,7 +69,7 @@ void ivas_output_init( ); /*! r: number of decoder buffers */ -Word16 ivas_get_nchan_buffers_dec( +Word16 ivas_get_nchan_buffers_dec_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 sba_analysis_order, /* i : SBA order evaluated in SBA decoder */ const Word32 ivas_total_brate /* i : total IVAS bitrate */ -- GitLab