Commit 590fbeff authored by malenov's avatar malenov
Browse files

apply the same threshold in WB TBE

parent 9dd1a2a5
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -328,6 +328,15 @@ void wb_tbe_dec(
        prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 );
        curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 );

#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE
        if ( st->element_mode > EVS_MONO )
        {
            /* prevent too low values of energy */
            prev_pow += 0.00001f;
            curr_pow += 0.00001f;
        }
#endif

        if ( voice_factors[0] > 0.75f )
        {
            curr_pow *= 0.25;
@@ -341,6 +350,7 @@ void wb_tbe_dec(
        {
            scale = (float) sqrt( curr_pow / prev_pow );
        }

        for ( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ )
        {
            shaped_wb_excitation[i] *= scale;