Commit b256bc0a authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Manuel Jander
Browse files

Fix for 3GPP issue 1347: Saturation of energies memory for dtx path

Link #1347
parent b93d1532
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -1016,14 +1016,14 @@ ivas_error pre_proc_front_ivas_fx(
                Word16 msNoiseEst_Q = Q31;
                move16();
                move16();
                zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_fx, NPART );
                zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_old_fx, NPART );
                IF( zero_flag )
                {
                    msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_fx, NPART );
                }
                Scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */
                st->hFdCngEnc->msNoiseEst_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q );
                    msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_old_fx, NPART );
                    scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */
                    st->hFdCngEnc->msNoiseEst_old_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q );
                    move16();
                }
                perform_noise_estimation_enc_ivas_fx( band_energies_LR_fx, sub( Q31, band_energies_LR_fx_q ), enerBuffer_fx, *enerBuffer_fx_exp, st->hFdCngEnc, input_Fs, hCPE );
            }
            ELSE
@@ -1049,14 +1049,14 @@ ivas_error pre_proc_front_ivas_fx(
                move16();
                Word16 msNoiseEst_Q = Q31;
                move16();
                zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_fx, NPART ); /* Q0 */
                zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_old_fx, NPART ); /* Q0 */
                IF( zero_flag )
                {
                    msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_fx, NPART );
                }
                Scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */
                st->hFdCngEnc->msNoiseEst_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q );
                    msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_old_fx, NPART );
                    scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */
                    st->hFdCngEnc->msNoiseEst_old_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q );
                    move16();
                }
                zero_flag = get_zero_flag( st->hFdCngEnc->hFdCngCom->periodog, PERIODOGLEN ); /* Q0 */
                Word16 normmsperiodog = 31;
                move16();