diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index be936f2c37b36ba6aa342dbe1c9220ebf0646731..d919dcb3e308581edcd86cdb39841250d1b0c8f2 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3567,8 +3567,11 @@ int16_t ivas_sba_remapTCs( void ivas_sba_dirac_stereo_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[CPE_CHANNELS], /* o : output synthesis signal */ - const int16_t output_frame, /* i : output frame length per channel */ + const int16_t output_frame /* i : output frame length per channel */ +#ifndef REMOVE_UNUSED_CODE_IVAS_DEC + , const int16_t mcmasa /* i : McMASA flag */ +#endif ); void ivas_sba_dirac_stereo_config( diff --git a/lib_com/options.h b/lib_com/options.h index de58cbabd78771d230e958b9b2ed6e026086fb9d..e6b214a41409ae91a9db669cb008e93d2bf3dec7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ #define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ +#define REMOVE_UNUSED_CODE_IVAS_DEC /* VA: remove unused code in ivas_jbm_dec_tc_fx() */() /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 4f0acd6364146159ca3e5610cdc56ffe963bf89d..df177a72e5c25acb4ce150c07eee2faeeb55b5d2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -105,6 +105,7 @@ ivas_error ivas_jbm_dec_tc( * Decoding + pre-rendering *----------------------------------------------------------------*/ +#ifndef REMOVE_UNUSED_CODE_IVAS_DEC if ( st_ivas->bfi && st_ivas->ini_frame == 0 ) { /* zero output when first frame(s) is lost */ @@ -120,7 +121,9 @@ ivas_error ivas_jbm_dec_tc( st_ivas->hSCE[0] = NULL; #endif } - else if ( st_ivas->ivas_format == STEREO_FORMAT ) + else +#endif + if ( st_ivas->ivas_format == STEREO_FORMAT ) { st_ivas->hCPE[0]->element_brate = ivas_total_brate; if ( ( error = ivas_cpe_dec( st_ivas, 0, p_output, output_frame, 0 ) ) != IVAS_ERR_OK ) @@ -197,7 +200,6 @@ ivas_error ivas_jbm_dec_tc( { set_s( nb_bits_metadata, 0, MAX_SCE ); - /* read parameters from the bitstream */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hQMetaData != NULL ) { @@ -267,7 +269,11 @@ ivas_error ivas_jbm_dec_tc( ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); } +#ifdef REMOVE_UNUSED_CODE_IVAS_DEC + ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame ); +#else ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, st_ivas->ivas_format == MC_FORMAT ); +#endif } else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( ivas_total_brate > IVAS_SID_5k2 || ( ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 && st_ivas->hCPE[0]->nchan_out == 1 ) ) ) { @@ -469,7 +475,11 @@ ivas_error ivas_jbm_dec_tc( ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); +#ifdef REMOVE_UNUSED_CODE_IVAS_DEC + ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame ); +#else ivas_sba_dirac_stereo_dec( st_ivas, &p_output[sba_ch_idx], output_frame, 0 ); +#endif } /* HP filtering */ @@ -695,7 +705,11 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->sba_dirac_stereo_flag ) /* use the flag to trigger the DFT upmix */ { +#ifdef REMOVE_UNUSED_CODE_IVAS_DEC + ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame ); +#else ivas_sba_dirac_stereo_dec( st_ivas, p_output, output_frame, 1 ); +#endif } /* HP filtering */ diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 44e8d81d936d2ae05ecca0e7c8f05513c6858cb9..126d29b1e12d68396369ea3ac7c4abf3c5f906db 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -827,13 +827,17 @@ void ivas_sba_dirac_stereo_smooth_parameters( void ivas_sba_dirac_stereo_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[CPE_CHANNELS], /* i/o: output synthesis signal */ - const int16_t output_frame, /* i : output frame length per channel */ - const int16_t mcmasa /* i : McMASA flag */ + const int16_t output_frame /* i : output frame length per channel */ +#ifndef REMOVE_UNUSED_CODE_IVAS_DEC + , + const int16_t mcmasa /* i : McMASA flag */ +#endif ) { int16_t dtx_flag, fd_cng_flag; int16_t sba_mono_flag; int16_t memOffset; + int32_t output_Fs; float tmp_buf[NS2SA( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS )]; float tmp_synth[L_FRAME16k]; float hb_gain[NB_DIV]; @@ -842,6 +846,11 @@ void ivas_sba_dirac_stereo_dec( SCE_DEC_HANDLE hSCE; CPE_DEC_HANDLE hCPE; STEREO_DFT_DEC_DATA_HANDLE hStereoDft; +#ifdef REMOVE_UNUSED_CODE_IVAS_DEC + int16_t mcmasa = st_ivas->ivas_format == MC_FORMAT; +#endif + + output_Fs = st_ivas->hDecoderConfig->output_Fs; hSCE = st_ivas->hSCE[0]; hCPE = st_ivas->hCPE[0]; @@ -862,7 +871,7 @@ void ivas_sba_dirac_stereo_dec( memOffset = NS2SA( output_frame * FRAMES_PER_SEC, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ); ivas_sba_dirac_stereo_config( hStereoDft->hConfig ); - hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, st_ivas->hDecoderConfig->output_Fs, hStereoDft->NFFT, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) ); + hStereoDft->nbands = ivas_sba_dirac_stereo_band_config( hStereoDft->band_limits, output_Fs, hStereoDft->NFFT, ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && !mcmasa ) ); stereo_dft_dec_update( hStereoDft, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ ); if ( st_ivas->nchan_transport > 1 ) { @@ -895,7 +904,7 @@ void ivas_sba_dirac_stereo_dec( /* DFT Stereo upmix */ stereo_dft_dec( hStereoDft, hCPE->hCoreCoder[0], DFT, NULL, NULL, 1 /*st_ivas->sba_dirac_stereo_flag*/, sba_mono_flag, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hMdDec : NULL, ( st_ivas->hSpar != NULL && !mcmasa ) ? st_ivas->hSpar->hFbMixer->cross_fade_start_offset : 0, - st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_transport, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); + output_Fs, st_ivas->nchan_transport, ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ) ); /* DFT synthesis */ stereo_dft_dec_synthesize( hCPE, DFT, 0, output[0], output_frame );