Commit 484ddaa6 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1334_fix' into 'main'

Fix for 3GPP issue 1334: possible Overflow in stereo leading to a click/pop [allow regression]

See merge request !1216
parents 2df66d0b 9070166f
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2922,7 +2922,7 @@ void stereo_dft_enc_write_BS_fx(

void stereo_dft_enc_res_fx(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft, /* i/o: encoder stereo handle       */
    const Word32 *input_8k,                /* i  : input buffer sampled at 8kHz Q16 */
    const Word32 *input_8k,                /* i  : input buffer sampled at 8kHz Q15 */
    BSTR_ENC_HANDLE hBstr,                 /* i/o: bitstream handle            */
    Word16 *nb_bits,                       /* o  : number of bits written      */
    const Word16 max_bits );
+1 −1
Original line number Diff line number Diff line
@@ -1207,7 +1207,7 @@ ivas_error ivas_cpe_enc_fx(

            FOR( Word16 i = 0; i < CPE_CHANNELS; i++ )
            {
                Copy_Scale_sig_16_32_no_sat( old_inp_12k8_16fx[i], old_inp_12k8_fx[i], L_INP_12k8, Q16 + Q1 );
                Copy_Scale_sig_16_32_no_sat( old_inp_12k8_16fx[i], old_inp_12k8_fx[i], L_INP_12k8, Q16 ); // Q(-1) -> Q15
            }
            stereo_dft_enc_res_fx( hCPE->hStereoDft, old_inp_12k8_fx[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits );
        }
+2 −2
Original line number Diff line number Diff line
@@ -2700,7 +2700,7 @@ static void stereo_dft_enc_get_res_cod_mode_flag_fx(

void stereo_dft_enc_res_fx(
    STEREO_DFT_ENC_DATA_HANDLE hStereoDft, /* i/o: encoder stereo handle       */
    const Word32 *input_8k,                /* i  : input buffer sampled at 8kHz Q16 */
    const Word32 *input_8k,                /* i  : input buffer sampled at 8kHz Q15 */
    BSTR_ENC_HANDLE hBstr,                 /* i/o: bitstream handle            */
    Word16 *nb_bits,                       /* o  : number of bits written      */
    const Word16 max_bits )
@@ -2745,7 +2745,7 @@ void stereo_dft_enc_res_fx(

        /* MDCT analysis */
        // TCX_MDCT_flt( win, MDCT_RES, STEREO_DFT_OVL_8k, L_FRAME8k - STEREO_DFT_OVL_8k, STEREO_DFT_OVL_8k, IVAS_CPE_DFT );
        MDCT_RES_e = 16;
        MDCT_RES_e = 17;
        move16();
        TCX_MDCT( win, MDCT_RES, &MDCT_RES_e, STEREO_DFT_OVL_8k, L_FRAME8k - STEREO_DFT_OVL_8k, STEREO_DFT_OVL_8k, IVAS_CPE_DFT );