Commit 29cdc9dd authored by malenov's avatar malenov
Browse files

apply the fix also in the encoder

parent 5068a7e2
Loading
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -383,6 +383,15 @@ void wb_tbe_enc(
    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 = (float) ( curr_pow * 0.25 );
@@ -1060,6 +1069,15 @@ void swb_tbe_enc(
        prev_pow = sum2_f( shaped_shb_excitation, L_SHB_LAHEAD + 10 );
        curr_pow = sum2_f( shaped_shb_excitation + L_SHB_LAHEAD + 10, L_SHB_LAHEAD + 10 );

#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 = (float) ( curr_pow * 0.25 );