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

Fix for 3GPP issue 1345: Decoder crash for Stereo at 32kbps in stereo_dft_dec_res_fx()

Link #1345
parent 22959633
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1406,7 +1406,11 @@ void stereo_dft_dec_res_fx(
                move32();
            }
        }
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */
#else
        Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */
#endif
        IF( res_bpf_flag )
        {
            v_sub_32( output, bpf_error_signal_8k, output, L_FRAME8k );
@@ -1417,12 +1421,20 @@ void stereo_dft_dec_res_fx(
        set16_fx( hCPE->hStereoDft->hBpf->pst_old_syn_fx, 0, STEREO_DFT_NBPSF_PIT_MAX_8k );
        hCPE->hStereoDft->hBpf->pst_mem_deemp_err_fx = 0;
        move16();
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */
#else
        Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */
#endif
    }
    ELSE
    {
        /* This step is needed to ensure output is properly populated with scaled values in all cases*/
#ifdef FIX_ISSUE_1237
        Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */
#else
        Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */
#endif
    }

    return;