Commit f5c8b410 authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch '1131-usan-division-by-zero-in-acelp-gain-decoding-in-ism4-bitrate-switching' into 'main'

[non-BE] Resolve "USAN: division-by-zero in acelp gain decoding in ISM4 bitrate switching"

See merge request !1640
parents 27548c81 1668a03a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@
#define REVERT_ZERO_FLUSH_TRESH                               /* FhG: issue 1069: revert threshold value introduced with !1518 due to significant complexity increase*/ 
#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC            /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/
#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING             /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define NONBE_1131_ACELP_OOB                                  /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */

/* ##################### End NON-BE switches ########################### */

+4 −0
Original line number Diff line number Diff line
@@ -703,7 +703,11 @@ ivas_error acelp_core_dec(
                old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame;
                tmpF = *old_exc_s;
                st->mem_deemph = old_exc_s[st->L_frame - 1];
#ifdef NONBE_1131_ACELP_OOB
                preemph( old_exc_s, st->preemph_fac, st->L_frame, &tmpF );
#else
                preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF );
#endif
                mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M );
                residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame );
            }