diff --git a/lib_com/ivas_limiter_fx.c b/lib_com/ivas_limiter_fx.c index 37790166e4e407900fa81a5d07a7a5d748837a54..a293b629c189f7cedfff46ed6caf5e6b4213873d 100644 --- a/lib_com/ivas_limiter_fx.c +++ b/lib_com/ivas_limiter_fx.c @@ -41,18 +41,16 @@ #include #include "ivas_prot_fx.h" -#ifdef FIX_2089_NONBE_LIMITER_CONSTS -#define RELEASE_CNST_20MS ( 85899345 ) // Q30 -#define RELEASE_CNST_2_20MS ( 21474836 ) // Q30 -#define RELEASE_CNST_10MS ( 42949672 ) // Q30 -#define RELEASE_CNST_2_10MS ( 10737418 ) // Q30 -#define RELEASE_CNST_5MS ( 21474836 ) // Q30 -#define RELEASE_CNST_2_5MS ( 5368709 ) // Q30 -#endif -#define ATTACK_CNST_48k ( 2106670080 ) // Q31 -#define ATTACK_CNST_32k ( 2086555136 ) // Q31 -#define ATTACK_CNST_16k ( 2027355264 ) // Q31 -#define ATTACK_CNST_8k ( 1913946752 ) // Q31 +#define RELEASE_CNST_20MS ( 85899345 ) // Q30 +#define RELEASE_CNST_2_20MS ( 21474836 ) // Q30 +#define RELEASE_CNST_10MS ( 42949672 ) // Q30 +#define RELEASE_CNST_2_10MS ( 10737418 ) // Q30 +#define RELEASE_CNST_5MS ( 21474836 ) // Q30 +#define RELEASE_CNST_2_5MS ( 5368709 ) // Q30 +#define ATTACK_CNST_48k ( 2106670080 ) // Q31 +#define ATTACK_CNST_32k ( 2086555136 ) // Q31 +#define ATTACK_CNST_16k ( 2027355264 ) // Q31 +#define ATTACK_CNST_8k ( 1913946752 ) // Q31 /*-------------------------------------------------------------------* * detect_strong_saturations() @@ -355,7 +353,6 @@ void limiter_process_fx( * keep the gain curve smoother if the threshold is exceeded in many frames * in a short span of time. */ -#ifdef FIX_2089_NONBE_LIMITER_CONSTS IF( EQ_32( L_mult0( output_frame, 50 ), hLimiter->sampling_rate ) ) { releaseHeuristic_cnst = RELEASE_CNST_20MS; @@ -379,7 +376,6 @@ void limiter_process_fx( } ELSE { -#ifdef FIX_2089_NONBE_LIMITER_CONSTS_WITH_DIV // computing output_frame/hLimiter->sampling_rate in Q30 i = norm_s( output_frame ); c = norm_l( hLimiter->sampling_rate ); @@ -394,35 +390,8 @@ void limiter_process_fx( i = sub( sub( c, i ), 1 ); // Q30 releaseHeuristic_cnst_2 = L_shl( scale, i ); releaseHeuristic_cnst = L_shl( releaseHeuristic_cnst_2, 2 ); -#else - /* or same default values as previous code version */ - releaseHeuristic_cnst = RELEASE_CNST_5MS; - move32(); - releaseHeuristic_cnst_2 = RELEASE_CNST_2_5MS; - move32(); -#endif } -#else - SWITCH( output_frame ) - { - case 960: - case 640: - case 320: - case 160: - releaseHeuristic_cnst = 85899345; /*Q30*/ - move32(); - releaseHeuristic_cnst_2 = 21474836; /*Q30*/ - move32(); - BREAK; - default: - releaseHeuristic_cnst = 21474836; /*Q30*/ - move32(); - releaseHeuristic_cnst_2 = 5368709; /*Q30*/ - move32(); - BREAK; - } -#endif releaseHeuristic = hLimiter->release_heuristic_fx; /* Q30 */ move32(); diff --git a/lib_com/options.h b/lib_com/options.h index e1674c8c48cf38d92408d578a7bf9d774928179a..c9c900f6db999f87b2d9d28e487b692106bd25c7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -75,13 +75,6 @@ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */ #define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/ -#define OPT_IGF_GET_WHITE_SPEC_DATA /* FhG: optimized version of IGF_getWhiteSpectralData_ivas() */ -#define FIX_2089_NONBE_LIMITER_CONSTS /* Orange : fix issue 2089 : Limiter attack and release constants differ from float version */ -#ifdef FIX_2089_NONBE_LIMITER_CONSTS -#define FIX_2089_NONBE_LIMITER_CONSTS_WITH_DIV /* Orange : compute release const for other output frame generate by jbm */ -#endif -#define FIX_1785_ASSERT_IN_IVAS_JBM_DEC_RENDER_FX /* Orange: 10ms Rendering: Assert in ivas_jbm_dec_render_fx() -> scale_sig32 */ -#define FIX_2081_REVISE_H1_SCALING /* VA: accommodate for H1 overshoot that was causing assert in set_impule. Not BE with MASA on LTV with bitrate switching for only 2 instances */ #define TEMP_FIX_2088_MSAN_INIT_ERROR /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */ #define FIX_2092_ASSERT_IN_OMASA_RENDER /* FhG, Nokia: Fix LTV crash due to overflow in OMASA EXT output */ diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index 90fc5669c8c699bc0978b14fcca2c6f09e8ae250..686882fd3ed748598f9fb81d41058d6e384a3739 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -2857,9 +2857,7 @@ static void IGF_getWhiteSpectralData_ivas( Word16 tmp_e; Word16 out_e_arr[IGF_START_MX + MAX_IGF_SFB_LEN]; Word16 max_out_e; -#ifdef OPT_IGF_GET_WHITE_SPEC_DATA Word64 window_sum; -#endif assert( LT_16( stop, IGF_START_MX + MAX_IGF_SFB_LEN ) ); /* inits */ @@ -2885,30 +2883,18 @@ static void IGF_getWhiteSpectralData_ivas( ak_e = add( tmp_e, sub( shl( sub( in_e, s_l ), 1 ), 15 ) ); // tmp_e + 2 * (in_e - s_l) - 15 ak_e = sub( ak_e, 1 ); -#ifdef OPT_IGF_GET_WHITE_SPEC_DATA window_sum = 0; move64(); FOR( j = start - level; j < start + level; j++ ) { window_sum = W_mac_32_32( window_sum, in[j], in[j] ); } -#endif FOR( i = start; i < stop - level; i++ ) { -#ifdef OPT_IGF_GET_WHITE_SPEC_DATA window_sum = W_mac_32_32( window_sum, in[i + level], in[i + level] ); /* add the right one */ ak = Mult_32_16( W_shl_sat_l( window_sum, shift ), quo ); // add( shl( level, 1 ), 1 ), &tmp_e ) ); window_sum = W_sub( window_sum, W_mult_32_32( in[i - level], in[i - level] ) ); /* subtract the left one */ -#else - Word64 temp = 0; - move64(); - FOR( j = i - level; j < i + level + 1; j++ ) - { - temp = W_mac_32_32( temp, in[j], in[j] ); - } - ak = Mult_32_16( W_shl_sat_l( temp, shift ), quo ); // add( shl( level, 1 ), 1 ), &tmp_e ) ); -#endif n = sub( ak_e, norm_l( ak ) ); n = shr( n, 1 ); @@ -2920,22 +2906,9 @@ static void IGF_getWhiteSpectralData_ivas( FOR( ; i < stop; i++ ) { -#ifdef OPT_IGF_GET_WHITE_SPEC_DATA ak = L_deposit_h( BASOP_Util_Divide3216_Scale( W_shl_sat_l( window_sum, shift ), sub( stop, sub( i, level ) ), &tmp_e ) ); window_sum = W_sub( window_sum, W_mult_32_32( in[i - level], in[i - level] ) ); /* subtract the left one */ ak_e = add( tmp_e, eff_e ); // tmp_e + 2 * (in_e - s_l) - 15 -#else - Word64 temp = 0; - move64(); - - FOR( j = i - level; j < stop; j++ ) - { - temp = W_mac_32_32( temp, in[j], in[j] ); - } - - ak = L_deposit_h( BASOP_Util_Divide3216_Scale( W_shl_sat_l( temp, shift ), sub( stop, sub( i, level ) ), &tmp_e ) ); - ak_e = add( tmp_e, eff_e ); // tmp_e + 2 * (in_e - s_l) - 15 -#endif n = sub( ak_e, add( norm_l( ak ), 1 ) ); n = shr( n, 1 ); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 13880a2047937c082375e190204330a368251bb7..0f639e14a7fbd1efdf4a797d6dc51bfb8cf95ed3 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2230,7 +2230,6 @@ ivas_error ivas_jbm_dec_render_fx( *st_ivas->hCrendWrapper->p_io_qfactor = exp; move16(); -#ifdef FIX_1785_ASSERT_IN_IVAS_JBM_DEC_RENDER_FX IF( crendInPlaceRotation ) { FOR( i = 0; i < nchan_in; i++ ) @@ -2249,16 +2248,6 @@ ivas_error ivas_jbm_dec_render_fx( scale_sig32( p_tc_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor } } -#else - FOR( i = 0; i < nchan_in; i++ ) - { - scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor - } - } -#endif IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -2292,7 +2281,6 @@ ivas_error ivas_jbm_dec_render_fx( ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx ); } -#ifdef FIX_1785_ASSERT_IN_IVAS_JBM_DEC_RENDER_FX IF( crendInPlaceRotation ) { n = nchan_in; @@ -2318,16 +2306,6 @@ ivas_error ivas_jbm_dec_render_fx( { scale_sig32( p_tc_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 } -#else - FOR( i = 0; i < nchan_in; i++ ) - { - scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 - } - } -#endif } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) ) { diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 6e31679bf019aea75183664699fc723b291a9bdf..fd97c8bf44a0642823a3aa3a5cde82a5c6e16f83 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -435,12 +435,8 @@ Word16 encod_tran_ivas_fx( Word16 tc_subfr, /* i/o: TC subframe classification Q0*/ Word16 position, /* i : maximum of residual signal index Q0*/ Word16 *unbits, /* i/o: number of unused bits Q0*/ -#ifdef FIX_2081_REVISE_H1_SCALING - const Word16 shift_r, /* i : Scaling to get 12 bits */ -#else - const Word16 shift, /* i : Scaling to get 12 bits */ -#endif - const Word16 Q_new /* i : Input scaling */ + const Word16 shift_r, /* i : Scaling to get 12 bits */ + const Word16 Q_new /* i : Input scaling */ ) { Word16 xn[L_SUBFR]; /* Target vector for pitch search */ @@ -473,18 +469,14 @@ Word16 encod_tran_ivas_fx( Word16 shift_wsp; Word32 L_tmp; Word16 q_h1; -#ifdef FIX_2081_REVISE_H1_SCALING Word16 shift, tmp; -#endif BSTR_ENC_HANDLE hBstr = st_fx->hBstr; SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR; LPD_state_HANDLE hLPDmem = st_fx->hLPDmem; -#ifdef FIX_2081_REVISE_H1_SCALING shift = shift_r; /* for IVAS, shift_r is always 0 */ /* will be reusing the EVS shift strategy later on to allow of H1 overshoot */ move16(); -#endif L_frame_fx = st_fx->L_frame; move16(); @@ -555,7 +547,6 @@ Word16 encod_tran_ivas_fx( res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 ); q_h1 = sub( 14, norm_s( h1[0] ) ); -#ifdef FIX_2081_REVISE_H1_SCALING tmp = sub( 14, norm_arr( h1, L_SUBFR ) ); shift = sub( q_h1, tmp ); /* shift is initialized to shift_r ( to 0) at the beginning of the scope, re-compute shift_wsp in case it has changed */ shift_wsp = add( Q_new, shift ); @@ -563,13 +554,8 @@ Word16 encod_tran_ivas_fx( { shift_wsp = sub( shift_wsp, 1 ); } -#endif Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/ -#ifdef FIX_2081_REVISE_H1_SCALING Scale_sig( h1, L_SUBFR, add( sub( 14, q_h1 ), shift ) ); -#else - Scale_sig( h1, L_SUBFR, sub( 14, q_h1 ) ); -#endif /* scaling of xn[] to limit dynamic at 12 bits */ Scale_sig( xn, L_SUBFR, shift );