diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 64a4c8be2d23ba1d0ceb7aeebd581bcf0e542314..2ab8a945136b2ae0bc14c3cc57210339ced04761 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -7299,3 +7299,14 @@ Flag is_zero_arr( Word32 *arr, Word16 size ) return 1; } + +Flag is_zero_arr16( Word16 *arr, Word16 size ) +{ + FOR( Word16 i = 0; i < size; i++ ) + IF( arr[i] != 0 ) + { + return 0; + } + + return 1; +} diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 40086183d77af30f3b65cee59d3787d003c40497..e743c6ff0749c790d721a15211333c712c8aef14 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4557,6 +4557,7 @@ Word16 L_norm_arr( Word32 *arr, Word16 size ); Word16 get_min_scalefactor( Word32 x, Word32 y ); Flag is_zero_arr( Word32 *arr, Word16 size ); +Flag is_zero_arr16( Word16 *arr, Word16 size ); void edct2_fx_ivas( const Word16 n, diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 96f15b91d5b7fbaeec4e2106fff0554f2a9fcead..b80bff932e923b09a077d4bad722d61314b63c07 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -1168,7 +1168,12 @@ void ivas_mdct_core_reconstruct_fx( } synth_fx = synth_buf_fx + st->hTcxDec->old_synth_len; synthFB_fx = synth_bufFB_fx + st->hTcxDec->old_synth_lenFB; - + test(); + if ( is_zero_arr16( st->hTcxDec->old_synth, st->hTcxDec->old_synth_len ) && is_zero_arr16( st->hTcxDec->old_synthFB_fx, st->hTcxDec->old_synth_lenFB ) ) + { + st->hTcxDec->q_old_synth = 0; + move16(); + } Copy( st->hTcxDec->old_synth, synth_buf_fx, st->hTcxDec->old_synth_len ); // Q = st->hTcxDec->q_old_synth Copy_Scale_sig( st->hTcxDec->old_synthFB_fx, synth_bufFB_fx, st->hTcxDec->old_synth_lenFB, sub( st->hTcxDec->q_old_synth, st->Q_syn ) ); // Q = st->hTcxDec->q_old_synth q_syn = st->hTcxDec->q_old_synth;