Commit 7d3d1595 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3GPP issue 1739: Crash in Stereo BASOP Enc -> Stereo BASOP Dec at 32...

Fix for 3GPP issue 1739: Crash in Stereo BASOP Enc -> Stereo BASOP Dec at 32 kbps with DTX, bandwidth switching and 5% FER

Link #1739

The issue is caused due to deviations observed with msNoiseEst. Only for
this test case, over-flow occurs. The root cause is as described in
issue #859. Currently, to address the crash issue, saturation is being
added.
parent 07f95b5e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2608,7 +2608,7 @@ void stereo_dft_dec_fx(
                    q_cna_level = hFdCngDec->smoothed_psd_exp;
                    move16();
                    l_tmp = Sqrt32( cna_level, &q_cna_level );
                    scale_fact = Mpy_32_32( l_tmp, scale_fact0 ); /* q_cna_level */
                    scale_fact = Mpy_32_32( l_tmp, scale_fact0 ); /* Q = (31-q_cna_level) + Q15 - 31 */
                    /*
                       scale_fact0 will be in Q15 by the time the above operation is performed
                       so the q of scale_fact represented now by q_cna_level has to be updated
@@ -2628,12 +2628,12 @@ void stereo_dft_dec_fx(
                    l_tmp = L_add( Madd_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */
                    l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) );      /* q_dft */
#endif                                                                        /* OPT_STEREO_32KBPS_V1 */
                    DFT_L[2 * i] = L_add( DFT_L[2 * i], l_tmp );              /* q_dft */
                    DFT_L[2 * i] = L_add_sat( DFT_L[2 * i], l_tmp );          /* q_dft */
                    move32();
#ifdef OPT_STEREO_32KBPS_V1
                    l_tmp = Msub_32_16( Msub_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */
                    l_tmp = L_shr( l_tmp, shift );                            /* q_dft */
                    DFT_R[2 * i] = L_add( DFT_R[2 * i], l_tmp );              /* q_dft */
                    DFT_R[2 * i] = L_add_sat( DFT_R[2 * i], l_tmp );          /* q_dft */
#else                                                                         /* OPT_STEREO_32KBPS_V1 */
                    l_tmp = L_sub( Msub_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */
                    l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) );      /* q_dft */