From 639c974c664050dc7263023f8400c8e902b173ba Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Sat, 10 Aug 2024 17:16:57 +0530 Subject: [PATCH] Remove dependency of UNUSED_PARAM macro when WMOPS macro is enabled [x] Fix for 3gpp issue 836 --- Workspace_msvc/lib_com.vcxproj | 1 + Workspace_msvc/lib_com.vcxproj.filters | 1 + lib_com/bits_alloc_fx.c | 2 -- lib_com/count.c | 21 +++++++++------- lib_com/fd_cng_com.c | 1 - lib_com/ivas_prot.h | 3 ++- lib_com/ivas_prot_fx.h | 1 - lib_com/options.h | 4 +--- lib_com/options_warnings.h | 3 +++ lib_com/prot_fx.h | 10 ++++---- lib_com/swb_tbe_com_fx.c | 1 + lib_dec/ivas_dirac_output_synthesis_cov.c | 9 +------ lib_dec/ivas_jbm_dec.c | 16 ++++++------- lib_dec/ivas_objectRenderer_internal.c | 2 -- lib_dec/ivas_omasa_dec.c | 3 +-- lib_dec/ivas_osba_dec.c | 3 +-- lib_dec/ivas_sba_dec.c | 6 ++--- lib_dec/ivas_spar_decoder.c | 2 +- lib_enc/igf_enc.c | 9 ++----- lib_enc/ivas_mct_core_enc.c | 9 +++++-- lib_enc/ivas_mct_enc_mct.c | 29 +++++++++++++++-------- lib_enc/ivas_stereo_mdct_core_enc.c | 19 ++++++++------- lib_enc/tcx_utils_enc.c | 7 ++---- lib_rend/ivas_dirac_decorr_dec.c | 2 +- lib_rend/ivas_dirac_onsets_dec.c | 2 -- lib_rend/ivas_prot_rend.h | 6 +---- lib_rend/ivas_reverb.c | 13 ++++++---- lib_rend/ivas_reverb_filter_design.c | 24 ++++++------------- lib_rend/ivas_reverb_utils.c | 7 ++++-- lib_rend/ivas_td_decorr.c | 5 ++-- 30 files changed, 105 insertions(+), 116 deletions(-) create mode 100644 lib_com/options_warnings.h diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 9119a2c38..c6111a49f 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -409,6 +409,7 @@ + diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index c8ed6bc10..3f865d3ce 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -603,6 +603,7 @@ common_h + diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 7e18b92a5..be8fa2db1 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -637,8 +637,6 @@ ivas_error config_acelp1( const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ) { - UNUSED_PARAM( active_cnt ); - Word16 i, bits, nb_subfr; Word16 flag_hardcoded, coder_type_sw, fix_first; Word32 core_brate; diff --git a/lib_com/count.c b/lib_com/count.c index e2c2ba8ee..b93414d8a 100644 --- a/lib_com/count.c +++ b/lib_com/count.c @@ -51,6 +51,10 @@ #include "options.h" #include "wmc_auto.h" +#ifndef WMOPS +#include "options_warnings.h" +#endif + #define WMC_TOOL_SKIP #ifdef WMOPS @@ -945,9 +949,9 @@ void printStack( char *text, char *Id ) #endif } +#ifdef WMOPS void BASOP_push_wmops( const char *label ) { -#ifdef WMOPS int new_flag, prev_counter; int i, j; @@ -1016,11 +1020,8 @@ void BASOP_push_wmops( const char *label ) #ifdef DEBUG_COUNTER printf( "Entering: %s\n", readCounterIdName() ); #endif - -#endif /* if WMOPS */ - UNUSED_PARAM( label ); } - +#endif Word32 BASOP_pop_wmops( void ) { @@ -1242,9 +1243,9 @@ void WMOPS_output_all( Word16 dtx_mode ) } #endif WMOPS_destroy(); - -#endif /* if WMOPS */ +#else UNUSED_PARAM( dtx_mode ); +#endif /* if WMOPS */ } void WMOPS_output_all_std( Word16 dtx_mode ) { @@ -1342,8 +1343,9 @@ void WMOPS_output_all_std( Word16 dtx_mode ) WMOPS_destroy(); -#endif /* if WMOPS */ +#else UNUSED_PARAM( dtx_mode ); +#endif /* if WMOPS */ } @@ -1383,10 +1385,11 @@ void BASOP_get_total_wmops( double *min, double *max, double *avg ) ops_cnt += total_wmops[i]; *avg = ( nbframe[0] == 0 ) ? 0 : ops_cnt / nbframe[0]; } -#endif /* if WMOPS */ +#else UNUSED_PARAM( min ); UNUSED_PARAM( max ); UNUSED_PARAM( avg ); +#endif /* if WMOPS */ } /* end of file */ #undef WMC_TOOL_SKIP diff --git a/lib_com/fd_cng_com.c b/lib_com/fd_cng_com.c index 1243cf668..21ea07dcc 100644 --- a/lib_com/fd_cng_com.c +++ b/lib_com/fd_cng_com.c @@ -100,7 +100,6 @@ void initFdCngCom_flt( /* Initialize the comfort noise generation */ set_f( hFdCngCom->fftBuffer_flt, 0.0f, FFTLEN ); - UNUSED_PARAM( scale ); set_f( hFdCngCom->cngNoiseLevel_flt, 0.0f, FFTCLDFBLEN ); set_f( hFdCngCom->olapBufferSynth2_flt, 0.0f, FFTLEN ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 043e4ef67..209eb7056 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4056,7 +4056,9 @@ void getChannelEnergies( void mctStereoIGF_enc_fx( MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ Encoder_State **sts, /* i/o: encoder state structure */ +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ +#endif Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ @@ -7679,7 +7681,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal */ - const Word16 q_factor, /* i : q_factor of rendered time signal */ Word16 out_len/*Store the length of values in each channel*/ ); #endif // IVAS_FLOAT_FIXED diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 43a0375fe..cd33b21bc 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -157,7 +157,6 @@ ivas_error ivas_omasa_dec_config_fx( ivas_error ivas_td_binaural_renderer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_fx[], /* i/o: SCE channels / Binaural synthesis */ - const Word16 q_factor, /* i : Q-factor of input/output */ const Word16 n_samples_granularity /* i : granularity of the renderer/buffer */ ); #endif diff --git a/lib_com/options.h b/lib_com/options.h index 6d94a23e7..4abd6c6cc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -52,7 +52,7 @@ #define SUPPORT_JBM_TRACEFILE /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ -/*#define WMOPS*/ /* Activate complexity and memory counters */ +//#define WMOPS /* Activate complexity and memory counters */ #ifdef WMOPS /*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ /*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ @@ -166,6 +166,4 @@ /* clang-format on */ #define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO -#define UNUSED_PARAM( ... ) (void) ( __VA_ARGS__ ) - #endif diff --git a/lib_com/options_warnings.h b/lib_com/options_warnings.h new file mode 100644 index 000000000..eaa66e36e --- /dev/null +++ b/lib_com/options_warnings.h @@ -0,0 +1,3 @@ +/*Temporary file*/ + +#define UNUSED_PARAM( ... ) (void) ( __VA_ARGS__ ) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 18a949cfd..644c53db8 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10141,7 +10141,9 @@ void ProcessStereoIGF_fx( Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */ int16_t ms_mask[2][MAX_SFB], /* i : bandwise MS mask */ #if 1 - Word32 *pITFMDCTSpectrum_fx[CPE_CHANNELS][NB_DIV], /* i : MDCT spectrum fir ITF */ +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + Word32 *pITFMDCTSpectrum_fx[CPE_CHANNELS][NB_DIV], /* i : MDCT spectrum fir ITF */ +#endif Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i : inverse power spectrum */ Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ @@ -10152,8 +10154,7 @@ void ProcessStereoIGF_fx( float *inv_spectrum[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t frameno, /* i : flag indicating index of current subfr. */ const int16_t sp_aud_decision0, /* i : sp_aud_decision0 */ - const int32_t element_brate, /* i : element bitrate */ - const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ + const int32_t element_brate /* i : element bitrate */ ); void IGFEncApplyStereo_fx( STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT stereo encoder structure */ @@ -10166,8 +10167,7 @@ void IGFEncApplyStereo_fx( Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ const Word16 frameno, /* i : flag indicating index of current subfr. */ const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */ - const Word32 element_brate, /* i : element bitrate */ - const Word16 mct_on /* i : flag mct block (1) or stereo (0) */ + const Word32 element_brate /* i : element bitrate */ ); #endif // IVAS_FLOAT_FIXED diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 588340b8d..c1da0b8ac 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -13,6 +13,7 @@ #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #endif +#include "options_warnings.h" #define POW_EXC16k_WHTND 1.14e11f /* power of random excitation, length 320 samples, uniform distribution */ #define POW_EXC16k_WHTND_FX_INV_SQRT 6360 // Q31 diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 41a206cdc..994954f09 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -761,9 +761,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot_fx( Word32 L_tmp; Word16 band, num_bands; - - // set16_fx(cx_tmp_e, 0, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS); - /* estimate input covariance */ FOR( param_band = 0; param_band < hParamMC->num_param_bands_synth; param_band++ ) { @@ -1446,12 +1443,8 @@ Word16 computeMixingMatrices_fx( Word32 Cy_fx[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; Word32 svd_u_buffer_fx[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; // Q31 out Word32 svd_v_buffer_fx[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; // Q31 out - - // Word16 mat_mult_buffer1_fx_e; Word16 Cx_fx_e; Word16 Cy_fx_e; - // Word16 svd_u_buffer_fx_e[MAX_OUTPUT_CHANNELS]; - // Word16 svd_v_buffer_fx_e[MAX_OUTPUT_CHANNELS]; Word32 svd_s_buffer_fx[MAX_OUTPUT_CHANNELS]; Word16 svd_s_buffer_e[MAX_OUTPUT_CHANNELS]; @@ -2343,7 +2336,7 @@ Word16 computeMixingMatricesResidual_fx( FOR( i = 0; i < lengthCx; i++ ) { - Kx_fx[i] = L_shr( Kx_fx[i], exp - Kx_fx_e[i] ); + Kx_fx[i] = L_shr( Kx_fx[i], sub( exp, Kx_fx_e[i] ) ); move32(); Kx_fx_e[i] = exp; move16(); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 741ddee3b..0772e46f8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2878,7 +2878,7 @@ ivas_error ivas_jbm_dec_render_fx( /* Binaural rendering */ IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { - IF( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, output_q_factor, *nSamplesRendered ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ) ) != IVAS_ERR_OK ) { return error; } @@ -2995,7 +2995,7 @@ ivas_error ivas_jbm_dec_render_fx( hSpar = st_ivas->hSpar; hSpar->hMdDec->Q_mixer_mat = 30; - IF( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, output_q_factor, 960 ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ) != IVAS_ERR_OK ) { return error; } @@ -3173,7 +3173,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, output_q_factor, *nSamplesRendered ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; } @@ -3922,8 +3922,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( Word32 output_fx[MAX_CICP_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; Word32 *p_output_fx[MAX_CICP_CHANNELS]; Word16 nchan_in, nchan_out; - const Word16 output_q_factor = Q11; - move16(); IF( !st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_OK; @@ -3994,7 +3992,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( /* Binaural rendering */ IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_OBJECTS_TD ) ) { - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, output_q_factor, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) { return error; } @@ -4053,7 +4051,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ELSE IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, output_q_factor, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) { return error; } @@ -4080,7 +4078,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( IF( st_ivas->nchan_ism > 0 ) { - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, output_q_factor, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) { return error; } @@ -4143,7 +4141,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( set16_fx( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available ); /* render the last subframe */ - IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, (UWord16) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output_fx, output_q_factor, L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, (UWord16) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output_fx, L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index d6f965c8f..c7c668281 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -171,11 +171,9 @@ ivas_error ivas_td_binaural_renderer( ivas_error ivas_td_binaural_renderer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_fx[], /* i/o: SCE channels / Binaural synthesis */ - const Word16 q_factor, /* i : Q-factor of input/output */ const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */ ) { - UNUSED_PARAM( q_factor ); Word16 first_sf, last_sf, subframe_idx; Word32 *output_fx_local[BINAURAL_CHANNELS]; Word32 reverb_signal_fx[BINAURAL_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 562225d1f..bb0e65b26 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -1377,7 +1377,6 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( Word32 *tc_local_fx[MAX_TRANSPORT_CHANNELS]; Word32 *p_sepobj_fx[MAX_NUM_OBJECTS]; Word32 data_separated_objects_fx[MAX_NUM_OBJECTS][L_FRAME48k]; - Word16 q_factor = Q11; move16(); FOR( n = 0; n < MAX_NUM_OBJECTS; n++ ) @@ -1406,7 +1405,7 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( /* reset combined orientation access index before calling the td renderer */ ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, q_factor, *nSamplesRendered ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 1eba206fb..b45bd339c 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -200,7 +200,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[], /* o : rendered time signal */ - const Word16 q_factor, /* i : q_factor of rendered time signal */ Word16 out_len /*Store the length of values in each channel*/ ) { @@ -223,7 +222,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( return error; } - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, q_factor, *nSamplesRendered ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_sepobj_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index e2da831bf..a8b1bacad 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -1585,7 +1585,7 @@ void ivas_sba_dec_digest_tc( p_tc_fx[0][j] = (Word32) ( p_tc[0][j] * ( 1 << q_format ) ); } - ivas_td_decorr_process_fx( st_ivas->hDiracDecBin->hTdDecorr, p_tc_fx, decorr_signal_fx, nSamplesToDecorr, &q_format ); + ivas_td_decorr_process_fx( st_ivas->hDiracDecBin->hTdDecorr, p_tc_fx, decorr_signal_fx, nSamplesToDecorr ); FOR( i = 0; i < st_ivas->hDiracDecBin->hTdDecorr->num_apd_outputs; i++ ) { @@ -1683,8 +1683,6 @@ void ivas_sba_dec_digest_tc_fx( Word16 nSamplesLeftForTD, default_frame; Word32 *decorr_signal[BINAURAL_CHANNELS]; Word32 *p_tc[2 * BINAURAL_CHANNELS]; - Word16 q_format = 14; - move16(); /* default_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); */ default_frame = extract_l( Mpy_32_32( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ); @@ -1705,7 +1703,7 @@ void ivas_sba_dec_digest_tc_fx( IF( st_ivas->hDiracDecBin->hTdDecorr ) { - ivas_td_decorr_process_fx( st_ivas->hDiracDecBin->hTdDecorr, p_tc, decorr_signal, nSamplesToDecorr, &q_format ); + ivas_td_decorr_process_fx( st_ivas->hDiracDecBin->hTdDecorr, p_tc, decorr_signal, nSamplesToDecorr ); } FOR( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 3efb36ada..755c9b52d 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -2871,7 +2871,7 @@ void ivas_spar_dec_digest_tc_fx( IF( hSpar->hTdDecorr ) { - ivas_td_decorr_process_fx( hSpar->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr, &q_format ); + ivas_td_decorr_process_fx( hSpar->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); st_ivas->hTcBuffer->q_tc_fx = s_min( st_ivas->hTcBuffer->q_tc_fx, q_format ); move16(); IF( GE_16( hSpar->hTdDecorr->num_apd_outputs, sub( nchan_internal, nchan_transport ) ) ) diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index dcc61747d..c6b29a9d0 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -1071,7 +1071,6 @@ static void IGF_CalculateStereoEnvelope_fx( IF( !isTransient ) { Word16 diffSFM_fx; - Word16 diffSFM_e; Word16 shiftedSFM_fx; Word16 shiftedSFM_e; /*stores the resultant exponent for shiftedSFM_fx*/ shiftedSFM_fx = 0; @@ -1162,9 +1161,7 @@ static void IGF_CalculateStereoEnvelope_fx( move16(); move16(); - diffSFM_e = BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sfb], tmp_sb_e, negate( hPrivateData->SFM_tb_fx[sfb] ), tmp_tb_e, &diffSFM_fx ); /*stores the resultant exponent for diffSFM_fx*/ - - UNUSED_PARAM( diffSFM_e ); + BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sfb], tmp_sb_e, negate( hPrivateData->SFM_tb_fx[sfb] ), tmp_tb_e, &diffSFM_fx ); /*stores the resultant exponent for diffSFM_fx*/ IF( diffSFM_fx > 0 && LT_32( hPrivateData->SFM_tb_fx[sfb], L_shr( 3277 /*0.1 Q15*/, tmp_tb_e ) ) ) /* check whether target SFB is more tonal than source SFB */ { @@ -3150,11 +3147,9 @@ void IGFEncApplyStereo_fx( Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ const Word16 frameno, /* i : flag indicating index of current subfr. */ const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */ - const Word32 element_brate, /* i : element bitrate */ - const Word16 mct_on /* i : flag mct block (1) or stereo (0) */ + const Word32 element_brate /* i : element bitrate */ ) { - UNUSED_PARAM( mct_on ); Word16 highPassEner_exp; Word32 *pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */ Word32 *pPowerSpectrumParameterMsInv_fx[NB_DIV]; diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index eaa2195a9..51fbabf1e 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -397,11 +397,12 @@ void ivas_mct_core_enc( for ( ch = 0; ch < nChannels; ch++ ) { #ifdef IVAS_FLOAT_FIXED +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING inv_mdst_spectrum_fx[ch][0] = powerSpecMsInv_fx[ch][0] = powerSpecMsInv_long_fx[ch]; inv_mdst_spectrum_fx[ch][1] = powerSpecMsInv_fx[ch][1] = powerSpecMsInv_long_fx[ch] + N_TCX10_MAX; +#endif inv_spectrum_fx[ch][0] = inv_spectrum_long_fx[ch]; inv_spectrum_fx[ch][1] = inv_spectrum_long_fx[ch] + N_TCX10_MAX; - UNUSED_PARAM( inv_mdst_spectrum_fx ); #endif inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch]; inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch] + N_TCX10_MAX; @@ -586,7 +587,11 @@ void ivas_mct_core_enc( if ( hMCT->currBlockDataCnt > 0 ) { #ifdef IVAS_FLOAT_FIXED - mctStereoIGF_enc_fx( hMCT, sts, orig_spectrum_fx, powerSpec_fx, powerSpecMsInv_fx, inv_spectrum_fx, orig_spectrum, powerSpec, powerSpecMsInv, inv_spectrum, sp_aud_decision0 ); + mctStereoIGF_enc_fx( hMCT, sts, +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + orig_spectrum_fx, +#endif + powerSpec_fx, powerSpecMsInv_fx, inv_spectrum_fx, orig_spectrum, powerSpec, powerSpecMsInv, inv_spectrum, sp_aud_decision0 ); #else mctStereoIGF_enc( hMCT, sts, orig_spectrum, powerSpec, powerSpecMsInv, inv_spectrum, sp_aud_decision0 ); #endif // IVAS_FLOAT_FIXED diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index 8f7030dfb..26d36aff4 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -1600,27 +1600,30 @@ void write_mct_bitstream_fx( void mctStereoIGF_enc_fx( MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ Encoder_State **sts, /* i/o: encoder state structure */ -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + Word32 *orig_spectrum_fx[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ +#endif Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ -#endif // IVAS_FLOAT_FIXED - float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ - float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ - float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ - const Word16 sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ +#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED + float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ + float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ + float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ + float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ +#endif // IVAS_FLOAT_FIXED + const Word16 sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ ) { #ifdef IVAS_FLOAT_FIXED Word32 *p_powerSpecMsInv_fx[CPE_CHANNELS][NB_DIV]; Word32 *p_inv_spectrum_fx[CPE_CHANNELS][NB_DIV]; +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING Word32 *p_orig_spectrum_fx[CPE_CHANNELS][NB_DIV]; +#endif Word32 *p_powerSpec_fx[NB_DIV]; #endif // IVAS_FLOAT_FIXED - UNUSED_PARAM( powerSpec_fx ); int16_t b, nSubframes, L_subframeTCX; int16_t p_ch[2], n, ch, ch1, ch2; Encoder_State *p_st[NB_DIV]; @@ -1678,8 +1681,10 @@ void mctStereoIGF_enc_fx( p_inv_spectrum[0][n] = inv_spectrum[ch1][n]; p_inv_spectrum[1][n] = inv_spectrum[ch2][n]; #endif +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING p_orig_spectrum_fx[0][n] = orig_spectrum_fx[ch1][n]; p_orig_spectrum_fx[1][n] = orig_spectrum_fx[ch2][n]; +#endif p_powerSpecMsInv_fx[0][n] = powerSpecMsInv_fx[ch1][n]; p_powerSpecMsInv_fx[1][n] = powerSpecMsInv_fx[ch2][n]; p_inv_spectrum_fx[0][n] = inv_spectrum_fx[ch1][n]; @@ -1687,7 +1692,11 @@ void mctStereoIGF_enc_fx( if ( hMCT->hBlockData[b]->hStereoMdct->mdct_stereo_mode[n] != hMCT->hBlockData[b]->hStereoMdct->IGFStereoMode[n] || hMCT->hBlockData[b]->hStereoMdct->mdct_stereo_mode[n] == SMDCT_BW_MS ) { - ProcessStereoIGF_fx( hMCT->hBlockData[b]->hStereoMdct, p_st, hMCT->hBlockData[b]->mask, p_orig_spectrum_fx, p_powerSpec_fx, p_powerSpecMsInv_fx, p_inv_spectrum_fx, p_orig_spectrum, p_powerSpec, p_powerSpecMsInv, p_inv_spectrum, n, sp_aud_decision0[ch1], p_st[0]->total_brate, 1 ); + ProcessStereoIGF_fx( hMCT->hBlockData[b]->hStereoMdct, p_st, hMCT->hBlockData[b]->mask, +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + p_orig_spectrum_fx, +#endif + p_powerSpec_fx, p_powerSpecMsInv_fx, p_inv_spectrum_fx, p_orig_spectrum, p_powerSpec, p_powerSpecMsInv, p_inv_spectrum, n, sp_aud_decision0[ch1], p_st[0]->total_brate ); } else { diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index dd5f2d59f..255cdf1e5 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -123,8 +123,10 @@ void stereo_mdct_core_enc( ) { #ifdef IVAS_FLOAT_FIXED +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING Word32 *p_orig_spectrum_long_fx[CPE_CHANNELS], orig_spectrum_long_fx[CPE_CHANNELS][N_MAX]; /* MDCT output (L/R). */ Word32 *orig_spectrum_fx[CPE_CHANNELS][NB_DIV]; /* Pointers to MDCT output for a short block (L/R) */ +#endif Word32 powerSpec_fx[CPE_CHANNELS][N_MAX]; Word32 *p_powerSpec_fx[CPE_CHANNELS]; #ifdef MSAN_FIX /*To be removed later*/ @@ -172,10 +174,10 @@ void stereo_mdct_core_enc( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { -#ifdef IVAS_FLOAT_FIXED - p_orig_spectrum_long_fx[ch] = orig_spectrum_long_fx[ch]; - UNUSED_PARAM( p_orig_spectrum_long_fx ); -#endif // IVAS_FLOAT_FIXED +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + orig_spectrum_fx[ch][0] = orig_spectrum_long_fx[ch]; + orig_spectrum_fx[ch][1] = orig_spectrum_long_fx[ch] + N_TCX10_MAX; +#endif p_mdst_spectrum_long[ch] = mdst_spectrum_long[ch]; p_orig_spectrum_long[ch] = orig_spectrum_long[ch]; } @@ -235,15 +237,12 @@ void stereo_mdct_core_enc( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { #ifdef IVAS_FLOAT_FIXED - orig_spectrum_fx[ch][0] = orig_spectrum_long_fx[ch]; - orig_spectrum_fx[ch][1] = orig_spectrum_long_fx[ch] + N_TCX10_MAX; inv_mdst_spectrum_fx[ch][0] = powerSpecMsInv_fx[ch][0] = powerSpecMsInv_long_fx[ch]; inv_mdst_spectrum_fx[ch][1] = powerSpecMsInv_fx[ch][1] = powerSpecMsInv_long_fx[ch] + N_TCX10_MAX; quantized_spectrum_fx[ch][0] = quantized_spectrum_long_fx[ch]; quantized_spectrum_fx[ch][1] = quantized_spectrum_long_fx[ch] + N_TCX10_MAX; inv_spectrum_fx[ch][0] = quantized_spectrum_fx[ch][0]; inv_spectrum_fx[ch][1] = quantized_spectrum_fx[ch][1]; - UNUSED_PARAM( inv_mdst_spectrum_fx ); #endif // IVAS_FLOAT_FIXED orig_spectrum[ch][0] = orig_spectrum_long[ch]; orig_spectrum[ch][1] = orig_spectrum_long[ch] + N_TCX10_MAX; @@ -445,7 +444,11 @@ void stereo_mdct_core_enc( #ifdef IVAS_FLOAT_FIXED p_powerSpec_fx[0] = powerSpec_fx[0]; p_powerSpec_fx[1] = powerSpec_fx[1]; - ProcessStereoIGF_fx( hStereoMdct, sts, ms_mask, orig_spectrum_fx, p_powerSpec_fx, powerSpecMsInv_fx, inv_spectrum_fx, orig_spectrum, p_powerSpec, powerSpecMsInv, inv_spectrum, n, hCPE->hCoreCoder[0]->sp_aud_decision0, hCPE->hCoreCoder[0]->element_brate, 0 ); + ProcessStereoIGF_fx( hStereoMdct, sts, ms_mask, +#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING + orig_spectrum_fx, +#endif + p_powerSpec_fx, powerSpecMsInv_fx, inv_spectrum_fx, orig_spectrum, p_powerSpec, powerSpecMsInv, inv_spectrum, n, hCPE->hCoreCoder[0]->sp_aud_decision0, hCPE->hCoreCoder[0]->element_brate ); #else ProcessStereoIGF( hStereoMdct, sts, ms_mask, orig_spectrum, p_powerSpec, powerSpecMsInv, inv_spectrum, n, hCPE->hCoreCoder[0]->sp_aud_decision0, hCPE->hCoreCoder[0]->element_brate, 0 ); #endif // IVAS_FLOAT_FIXED diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index 50690669b..2be9596a5 100644 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -1589,7 +1589,6 @@ void ProcessStereoIGF_fx( Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */ int16_t ms_mask[2][MAX_SFB], /* i : bandwise MS mask */ #if 1 - Word32 *pITFMDCTSpectrum_fx[CPE_CHANNELS][NB_DIV], /* i : MDCT spectrum fir ITF */ Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i : inverse power spectrum */ Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ @@ -1600,11 +1599,9 @@ void ProcessStereoIGF_fx( float *inv_spectrum[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t frameno, /* i : flag indicating index of current subfr. */ const int16_t sp_aud_decision0, /* i : sp_aud_decision0 */ - const int32_t element_brate, /* i : element bitrate */ - const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ + const int32_t element_brate /* i : element bitrate */ ) { - UNUSED_PARAM( pITFMDCTSpectrum_fx ); int16_t ch, igfGridIdx, isIndepFlag, bsBits, pBsStart, curr_order; float predictionGain; float A[ITF_MAX_FILTER_ORDER + 1]; @@ -1689,7 +1686,7 @@ void ProcessStereoIGF_fx( floatToFixed_arr16( &hGrid->whiteningThreshold_flt[0][0], &hGrid->whiteningThreshold[0][0], Q13, 2 * IGF_MAX_TILES ); } #endif /**********************************flt to fix ends here*******************************************************/ - IGFEncApplyStereo_fx( hStereoMdct, ms_mask, hIGFEnc, igfGridIdx, sts, pPowerSpectrum_fx, pPowerSpectrumMsInv_fx, inv_spectrum_fx, frameno, sp_aud_decision0, element_brate, mct_on ); + IGFEncApplyStereo_fx( hStereoMdct, ms_mask, hIGFEnc, igfGridIdx, sts, pPowerSpectrum_fx, pPowerSpectrumMsInv_fx, inv_spectrum_fx, frameno, sp_aud_decision0, element_brate ); #if 1 /*************************************fix to flt conversion****************************************************/ FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { diff --git a/lib_rend/ivas_dirac_decorr_dec.c b/lib_rend/ivas_dirac_decorr_dec.c index 9fff1878e..cbcc63812 100644 --- a/lib_rend/ivas_dirac_decorr_dec.c +++ b/lib_rend/ivas_dirac_decorr_dec.c @@ -1057,7 +1057,7 @@ void ivas_dirac_dec_decorr_process_fx( h_freq_domain_decorr_ap_state->h_onset_detection_power_state.q_onset_detector = q_temp; move16(); - ivas_dirac_dec_onset_detection_process_fx( aux_buffer_fx, q_aux_buffer, onset_filter_fx, num_protos_diff, h_freq_domain_decorr_ap_params->h_onset_detection_power_params, h_freq_domain_decorr_ap_state->h_onset_detection_power_state ); + ivas_dirac_dec_onset_detection_process_fx( aux_buffer_fx, onset_filter_fx, num_protos_diff, h_freq_domain_decorr_ap_params->h_onset_detection_power_params, h_freq_domain_decorr_ap_state->h_onset_detection_power_state ); /* Apply decorrelator if num_channels is greater than 0 */ IF( num_channels > 0 ) diff --git a/lib_rend/ivas_dirac_onsets_dec.c b/lib_rend/ivas_dirac_onsets_dec.c index 5241666a7..3c884dd7d 100644 --- a/lib_rend/ivas_dirac_onsets_dec.c +++ b/lib_rend/ivas_dirac_onsets_dec.c @@ -282,7 +282,6 @@ void ivas_dirac_dec_onset_detection_process( #else void ivas_dirac_dec_onset_detection_process_fx( const Word32 *input_power_f, - Word16 q_input_power, Word32 *onset_filter, const Word16 num_protos_diff, DIRAC_ONSET_DETECTION_PARAMS h_dirac_onset_detection_params, @@ -305,7 +304,6 @@ void ivas_dirac_dec_onset_detection_process_fx( /*detector 1: envelope max*/ *p_onset_detector_1_fx = Mpy_32_16_1( *p_onset_detector_1_fx, DIRAC_ONSET_ALPHA_FX ); /* Q(q_onset_detector) */ move32(); - UNUSED_PARAM( q_input_power ); IF( GT_32( *p_onset_detector_1_fx, *input_power_f ) ) { *p_onset_detector_1_fx = *p_onset_detector_1_fx; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 9951ca32a..3d783bbaa 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -172,8 +172,7 @@ void ivas_td_decorr_process_fx( ivas_td_decorr_state_t *hTdDecorr, /* i/o: TD decoderrelator handle */ Word32 *pcm_in[], /* i : input audio channels */ Word32 **ppOut_pcm, /* o : output audio channels */ - const Word16 output_frame, /* i : output frame length */ -Word16 *q_format + const Word16 output_frame /* i : output frame length */ ); #else void ivas_td_decorr_process( @@ -743,7 +742,6 @@ void ivas_dirac_dec_onset_detection_process( #ifdef IVAS_FLOAT_FIXED void ivas_dirac_dec_onset_detection_process_fx( const Word32 *input_power_f, - Word16 q_input_power, Word32 *onset_filter, const Word16 num_protos_diff, DIRAC_ONSET_DETECTION_PARAMS h_dirac_onset_detection_params, @@ -2083,7 +2081,6 @@ Word16 ivas_reverb_calc_color_filters_fx( const Word32 *pTargetR, const Word32 *pWindow, const Word16 fft_size, - const Word16 delay, rv_fftwf_type_complex_fx *pBeqL, rv_fftwf_type_complex_fx *pBeqR, Word16 *q_pBeqL, @@ -2105,7 +2102,6 @@ Word16 ivas_reverb_calc_correl_filters_fx( Word32 *pTargetICC, //input in Q30 const Word32 *pWindow, //input in Q30 const Word16 fft_size, - const Word16 delay, rv_fftwf_type_complex_fx *pU, //input in Q31 rv_fftwf_type_complex_fx *pV, //input in Q31 Word16 *q_pU, //Output q diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 347374d87..ca46f0590 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -2641,7 +2641,7 @@ ivas_error ivas_reverb_open_fx( pHrtf_inter_aural_coherence_const[i] = L_shl( params.pHrtf_inter_aural_coherence_const_fx[i], 3 ); /*Scaling up to Q30*/ move32(); } - ivas_reverb_calc_correl_filters_fx( pHrtf_inter_aural_coherence_const, pTime_window_fx, pState->fft_size, 0, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); + ivas_reverb_calc_correl_filters_fx( pHrtf_inter_aural_coherence_const, pTime_window_fx, pState->fft_size, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); free( pHrtf_inter_aural_coherence_const ); @@ -2673,8 +2673,8 @@ ivas_error ivas_reverb_open_fx( /* Computing coloration filters on the basis of target responses */ - ivas_reverb_calc_color_filters_fx( pColor_target_l_fx, pColor_target_r_fx, pTime_window_fx, pState->fft_size, 0, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); - FOR( Word16 i = 0; i < nr_fc_fft_filter; i++ ) + ivas_reverb_calc_color_filters_fx( pColor_target_l_fx, pColor_target_r_fx, pTime_window_fx, pState->fft_size, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); + FOR( int i = 0; i < nr_fc_fft_filter; i++ ) { pFft_wf_filter_ch0_fx[i][0] = L_shl( pFft_wf_filter_ch0_fx[i][0], sub( 31, q_pFft_wf_filter_ch0_fx ) ); move32(); @@ -4295,7 +4295,12 @@ ivas_error ivas_binaural_reverb_open_fastconv_fx( float ene_flt[CLDFB_NO_CHANNELS_MAX]; revTimes = t60; revEne = ene; - if ( NE_32( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60_flt, ene_flt ) ), IVAS_ERR_OK ) ) + if ( NE_32( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, + hHrtfFastConv, + internal_config, + false, + sampling_rate, t60_flt, ene_flt ) ), + IVAS_ERR_OK ) ) { return error; } diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 6d2e87098..f34cbfde7 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -411,16 +411,12 @@ static void calc_min_phase_filter( #ifdef IVAS_FLOAT_FIXED static void calc_min_phase_filter_fx( rv_fftwf_type_complex_fx *pH_flt, - const Word16 fft_size, - Word16 delay ) + const Word16 fft_size ) { const Word16 spectrum_size = add( shr( fft_size, 1 ), 1 ); Word16 idx; - // Word16 phase_increment; Word32 pMin_phase[RV_FILTER_MAX_FFT_SIZE]; - // phase_increment = 0; - UNUSED_PARAM( delay ); // delay is 0.0, -PI2 * delay / (float)fft_size; move16(); Word16 q_pMin_phase; calc_min_phase_fx( pH_flt, fft_size, pMin_phase, &q_pMin_phase ); @@ -660,16 +656,12 @@ static void response_step_limit( static void response_step_limit_fx( Word32 *X, const Word16 dim_x, - const Word32 step_limit_lf_dB, - const Word32 step_limit_hf_dB, const Word16 pivot_bin_idx ) { Word16 i; const Word32 positive_step_limit_lf = 1701766107; - UNUSED_PARAM( step_limit_lf_dB ); // powf(10.0f, 0.05f * step_limit_lf_dB) = 1.5848931924611134852; //q = 30 const Word32 negative_step_limit_lf = 677485289; // 1.0f / positive_step_limit_lf = 0.63095734448019324;//q = 30 const Word32 positive_step_limit_hf = 1276144549; - UNUSED_PARAM( step_limit_hf_dB ); // powf(10.0f, 0.05f * step_limit_hf_dB) = 1.188502227437018437; //q = 30 const Word32 negative_step_limit_hf = 903441154; // 1.0f / positive_step_limit_hf = 1.26209271246779263; //q = 30 /* Go up from pivot frequency and limit the slope to the maximum given by T. */ @@ -900,7 +892,6 @@ Word16 ivas_reverb_calc_color_filters_fx( const Word32 *pTargetR, const Word32 *pWindow, const Word16 fft_size, - const Word16 delay, rv_fftwf_type_complex_fx *pBeqL, rv_fftwf_type_complex_fx *pBeqR, Word16 *q_pBeqL, @@ -923,8 +914,8 @@ Word16 ivas_reverb_calc_color_filters_fx( /* Make the response minimum phase. Does make the spectrum complex, but will avoid aliasing when applied in the FFT domain. */ - calc_min_phase_filter_fx( pBeqL, fft_size, delay ); - calc_min_phase_filter_fx( pBeqR, fft_size, delay ); + calc_min_phase_filter_fx( pBeqL, fft_size ); + calc_min_phase_filter_fx( pBeqR, fft_size ); apply_window_fft_fx( pBeqL, pWindow, fft_size, q_pBeqL ); apply_window_fft_fx( pBeqR, pWindow, fft_size, q_pBeqR ); @@ -990,7 +981,6 @@ Word16 ivas_reverb_calc_correl_filters_fx( Word32 *pTargetICC, // input in Q30 const Word32 *pWindow, // input in Q30 const Word16 fft_size, - const Word16 delay, rv_fftwf_type_complex_fx *pU, // input in Q31 rv_fftwf_type_complex_fx *pV, // input in Q31 Word16 *q_pU, // Output q @@ -1037,8 +1027,8 @@ Word16 ivas_reverb_calc_correl_filters_fx( /* Make the response minimum phase. Does make the spectrum complex, but will avoid aliasing when applied in the FFT domain. */ - calc_min_phase_filter_fx( pU, fft_size, delay ); - calc_min_phase_filter_fx( pV, fft_size, delay ); + calc_min_phase_filter_fx( pU, fft_size ); + calc_min_phase_filter_fx( pV, fft_size ); apply_window_fft_fx( pU, pWindow, fft_size, q_pU ); apply_window_fft_fx( pV, pWindow, fft_size, q_pV ); @@ -1309,8 +1299,8 @@ void ivas_reverb_calc_color_levels_fx( idx_pivot = extract_l( L_shr( div1, sub( 31, temp ) ) ); /* Perform step limiting */ - response_step_limit_fx( pTarget_color_L, freq_count, RESPONSE_STEP_LIMIT_LF_FX, RESPONSE_STEP_LIMIT_HF_FX, idx_pivot ); - response_step_limit_fx( pTarget_color_R, freq_count, RESPONSE_STEP_LIMIT_LF_FX, RESPONSE_STEP_LIMIT_HF_FX, idx_pivot ); + response_step_limit_fx( pTarget_color_L, freq_count, idx_pivot ); + response_step_limit_fx( pTarget_color_R, freq_count, idx_pivot ); free( pTarget_color_L_e ); free( pTarget_color_R_e ); diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index c382c034a..6e6d5c023 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -38,6 +38,9 @@ #include #include "wmc_auto.h" #include "prot_fx.h" +#ifdef IVAS_FLOAT_FIXED +#include "options_warnings.h" +#endif /*-----------------------------------------------------------------------------------------* * Local constants @@ -425,13 +428,13 @@ static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( float current_HRTF_data_R[L_FRAME48k]; int16_t freq_idx, hrtf_idx, hrtf_count; float hrtf_count_inverted; - int16_t fft_size, IR_length, log2_fft_size, half_fft_size, freq_count; + int16_t fft_size, log2_fft_size, half_fft_size, freq_count; ivas_error error; #ifdef IVAS_FLOAT_FIXED /*Resolving the extra warnings added*/ UNUSED_PARAM( error ); #endif // !IVAS_FLOAT_FIXED - fft_size = RV_FILTER_MAX_FFT_SIZE; + Word16 IR_length; IR_length = CLDFB_NO_CHANNELS_MAX * ( ( fft_size + CLDFB_NO_CHANNELS_MAX - 1 ) / CLDFB_NO_CHANNELS_MAX ); log2_fft_size = int_log2( fft_size ); half_fft_size = fft_size >> 1; diff --git a/lib_rend/ivas_td_decorr.c b/lib_rend/ivas_td_decorr.c index 880844a9f..1e6632af4 100644 --- a/lib_rend/ivas_td_decorr.c +++ b/lib_rend/ivas_td_decorr.c @@ -900,10 +900,9 @@ void ivas_td_decorr_process_fx( ivas_td_decorr_state_t *hTdDecorr, /* i/o: SPAR Covar. decoder handle */ Word32 *pcm_in[], /* i : input audio channels */ Word32 **ppOut_pcm, /* o : output audio channels */ - const Word16 output_frame, /* i : output frame length */ - Word16 *q_format ) + const Word16 output_frame /* i : output frame length */ +) { - UNUSED_PARAM( *q_format ); Word16 i, j; Word32 in_duck_gain[L_FRAME48k], out_duck_gain[L_FRAME48k]; -- GitLab