Commit 592eb2cc authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ltv_crash_stereo_at_16_4_kbps_32kHz_in_16kHz_out_DTX_on' into 'main'

Fix for crash for stereo ltv stream occuring in stereo_dft_generate_comfort_noise_fx

See merge request !410
parents b3792048 c4c98351
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1174,7 +1174,7 @@ static void stereo_dft_generate_comfort_noise_fx(
            ptr_tmp--;
            *ptr_level = *( ptr_level + 1 );
            move32();
            lp_noise = L_add( lp_noise, L_shl( *ptr_level--, add( 1, sub( Q6, sub( Q31, hFdCngCom->cngNoiseLevelExp ) ) ) ) );
            lp_noise = L_add( lp_noise, L_shl( *ptr_level--, 1 ) );
        }
    }
    ELSE
@@ -1266,8 +1266,8 @@ static void stereo_dft_generate_comfort_noise_fx(
        // log10(x) is computed as log2(x) * log10(2)
        // log_lp_noise at this stage is in Q25. where as the structure value is in Q23
        // Hence the 16-bit constant log10(2) will be stored in Q13
        log_lp_noise = Mpy_32_16_1( log_lp_noise, (Word16) 0x09A2 );
        st1->lp_noise = L_add( Mpy_32_16_1( st1->lp_noise, (Word16) ( 0x7333 ) ), log_lp_noise );
        log_lp_noise = Mpy_32_16_1( log_lp_noise, 2466 /* log10(2) in Q13 */ );
        st1->lp_noise = L_add( Mpy_32_16_1( st1->lp_noise, 29491 /* 0.9f in Q15 */ ), log_lp_noise );
        move32();
    }
    ELSE IF( EQ_16( chan, 0 ) )
@@ -1278,8 +1278,8 @@ static void stereo_dft_generate_comfort_noise_fx(
        // log10(x) is computed as log2(x) * log10(2)
        // log_lp_noise at this stage is in Q25. where as the structure value is in Q23
        // Hence the 16-bit constant log10(2) will be stored in Q13
        log_lp_noise = Mpy_32_16_1( log_lp_noise, (Word16) 0x09A2 );
        st->hFdCngDec->lp_noise = L_add( Mpy_32_16_1( st->hFdCngDec->lp_noise, (Word16) ( 0x7333 ) ), log_lp_noise );
        log_lp_noise = Mpy_32_16_1( log_lp_noise, 2466 /* log10(2) in Q13 */ );
        st->hFdCngDec->lp_noise = L_add( Mpy_32_16_1( st->hFdCngDec->lp_noise, 29491 /* 0.9f in Q15 */ ), log_lp_noise );
        move32();
        st->lp_noise = st->hFdCngDec->lp_noise;
        move32();