diff --git a/lib_com/options.h b/lib_com/options.h index cabe32178030e50c1dd94055f320036967949335..fb3bf1bf56ffb18c2395d10e2f89f8da5d5b33a7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -98,6 +98,7 @@ #define FIX_1461_CNG_BW_SWITCHING /* Eri: float issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ #define FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES /* FhG: Using rounding in multiplication to improve precision in cngNoiseLevel[] */ #define FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC /* VA: Fix issue 2264 by adding a proper safeguard in log2 and by adding a missing normalization in swb_pre_proc_ivas_fx()*/ +#define FIX_2282_WRONG_SCALING_LOWRATE_PITCH /* Dolby: Fix incorrect Q value for 0.1 in low-rate pitch gain parameter */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index bfe50a588edf8c5f1fe5f0313c815d22fc7b6f77..9812603bfbfce64204da94af79283d2d3ffe0056 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -274,8 +274,14 @@ void encod_gen_voic_fx( push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } + +#ifdef FIX_2282_WRONG_SCALING_LOWRATE_PITCH + /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ + hSpMusClas->lowrate_pitchGain = round_fx_sat( L_mac_sat( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 3277, gain_pit_fx ) ); /*Q15*Q14 + Q15*Q14 -> Q14*/ +#else /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ hSpMusClas->lowrate_pitchGain = round_fx_sat( L_mac_sat( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit_fx ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ +#endif /*-----------------------------------------------------------------* * Transform domain contribution encoding - active frames diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 200c22a1a1f61c5469a8bdaa6b8d6e580ccd925a..262a06e55bbc9b73f70c7d88ce21a64b36874562 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -291,8 +291,13 @@ void enc_pit_exc_fx( push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); } +#ifdef FIX_2282_WRONG_SCALING_LOWRATE_PITCH + /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ + hSpMusClas->lowrate_pitchGain = round_fx_sat( L_mac_sat( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 3277, gain_pit ) ); /*Q15*Q14 + Q15*Q14 -> Q14*/ +#else /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit;*/ hSpMusClas->lowrate_pitchGain = round_fx_sat( L_mac_sat( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ +#endif gpit_tmp = gain_pit; move16(); /*Q14*/