diff --git a/lib_com/options.h b/lib_com/options.h index 0f464530e07c877e3d207bfb6a183a8827c79fcf..533151ab1974050b0f325dd362f99bef0d707334 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -127,4 +127,7 @@ #define NONBE_FIX_1748_SPAR_DIV_OPT /*Dlb: issue 1748: SPAR common div optimizations*/ #define FIX_ISSUE_1801_NOISE_FLOOR_REDUCTION /* FhG: Fixed getScalefactor usage */ + +#define FIX_1818_WRONG_PIT_INIT /* VA: Fix wrong pitch initialization */ + #endif diff --git a/lib_enc/core_switching_enc_fx.c b/lib_enc/core_switching_enc_fx.c index 5290509cd32d8a7909d6c9af75ee51fabda55fdd..4c0b843e93560a38221a6e839b4c7998270495b4 100644 --- a/lib_enc/core_switching_enc_fx.c +++ b/lib_enc/core_switching_enc_fx.c @@ -282,8 +282,11 @@ void core_switching_pre_enc_fx( tmp16 = shr( st_fx->L_frame, 6 ); Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 ); /*Q6*/ +#ifdef FIX_1818_WRONG_PIT_INIT + set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 ); +#else set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 ); - +#endif /* Reset old TD BWE buffers */ IF( hBWE_TD != NULL ) { @@ -851,8 +854,11 @@ void core_switching_pre_enc_ivas_fx( } Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 ); +#ifdef FIX_1818_WRONG_PIT_INIT + set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 ); +#else set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 ); - +#endif /* Reset old ACELP buffers */ test(); IF( ( st_fx->element_mode == EVS_MONO ) && hLPDmem != NULL ) @@ -902,8 +908,11 @@ void core_switching_pre_enc_ivas_fx( tmp16 = shr( st_fx->L_frame, 6 ); Copy( st_fx->old_pitch_buf_fx + tmp16, st_fx->old_pitch_buf_fx, tmp16 ); +#ifdef FIX_1818_WRONG_PIT_INIT + set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR << 6, tmp16 ); +#else set16_fx( st_fx->old_pitch_buf_fx + tmp16, L_SUBFR, tmp16 ); - +#endif /* Reset old TD BWE buffers */ IF( hBWE_TD != NULL ) { diff --git a/lib_enc/rst_enc_fx.c b/lib_enc/rst_enc_fx.c index d519bc12f9db4e464b977c66e13b329713fb216e..9880084e13ce683d02d5516372bd6deeef7684b0 100644 --- a/lib_enc/rst_enc_fx.c +++ b/lib_enc/rst_enc_fx.c @@ -53,11 +53,19 @@ void CNG_reset_enc_fx( /* reset the pitch buffer in case of FRAME_NO_DATA or SID frames */ IF( EQ_16( st_fx->L_frame, L_FRAME ) ) { +#ifdef FIX_1818_WRONG_PIT_INIT + set16_fx( pitch_buf, L_SUBFR << 6, NB_SUBFR ); +#else set16_fx( pitch_buf, L_SUBFR, NB_SUBFR ); +#endif } ELSE /* st->L_frame == L_FRAME16k */ { +#ifdef FIX_1818_WRONG_PIT_INIT + set16_fx( pitch_buf, L_SUBFR16k << 6, NB_SUBFR16k ); +#else set16_fx( pitch_buf, L_SUBFR16k, NB_SUBFR16k ); +#endif } set16_fx( voice_factors, 1, NB_SUBFR16k );