Commit 9399fe2c authored by Jiaquan Huo's avatar Jiaquan Huo
Browse files

Merge branch 'public/main' into lfe-plc-precision

parents 800f9ba9 23bfe4db
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1519,6 +1519,7 @@ static bool parseCmdlIVAS_enc(
                {
                    fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
                    usage_enc();
                    return false;
                }
                else
                {
@@ -1530,6 +1531,7 @@ static bool parseCmdlIVAS_enc(
                    {
                        fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
                        usage_enc();
                        return false;
                    }
                }
            }
@@ -1537,6 +1539,7 @@ static bool parseCmdlIVAS_enc(
            {
                fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
                usage_enc();
                return false;
            }
            if ( i < argc - 4 )
            {
@@ -1556,7 +1559,7 @@ static bool parseCmdlIVAS_enc(
                    default:
                        fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" );
                        usage_enc();
                        break;
                        return false;
                }
            }

@@ -1581,6 +1584,7 @@ static bool parseCmdlIVAS_enc(
                {
                    fprintf( stderr, "Error: not enough arguments\n\n" );
                    usage_enc();
                    return false;
                }
            }

@@ -1593,6 +1597,7 @@ static bool parseCmdlIVAS_enc(
            {
                fprintf( stderr, "Error: not enough MASA arguments\n\n" );
                usage_enc();
                return false;
            }
        }
        else if ( strcmp( to_upper( argv[i] ), "-ISM_SBA" ) == 0 )
@@ -1611,6 +1616,7 @@ static bool parseCmdlIVAS_enc(
                {
                    fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" );
                    usage_enc();
                    return false;
                }
                else
                {
@@ -1622,6 +1628,7 @@ static bool parseCmdlIVAS_enc(
                    {
                        fprintf( stderr, "Error: Too high number of ISM channels!\n\n" );
                        usage_enc();
                        return false;
                    }
                }
            }
@@ -1629,6 +1636,7 @@ static bool parseCmdlIVAS_enc(
            {
                fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" );
                usage_enc();
                return false;
            }

            if ( i < argc - 4 )
@@ -1680,6 +1688,7 @@ static bool parseCmdlIVAS_enc(
                {
                    fprintf( stderr, "Error: not enough arguments\n\n" );
                    usage_enc();
                    return false;
                }
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -172,6 +172,8 @@
/* all switches in this category should start with "NONBE_" */

#define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING               /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */
#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE               /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */


#define NONE_BE_FIX_816_LFE_PLC_FLOAT                   /* DLB: issue 816: reduce required precision to float for LFE-PLC*/
                         
+20 −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 = max( 0.00001f, prev_pow );
            curr_pow = max( 0.00001f, curr_pow );
        }
#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;
@@ -1059,9 +1069,19 @@ void swb_tbe_dec(
        }

        mvr2r( shaped_shb_excitationTemp, &shaped_shb_excitation[L_SHB_LAHEAD], L_FRAME16k );

        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 = max( 0.00001f, prev_pow );
            curr_pow = max( 0.00001f, curr_pow );
        }
#endif

        if ( voice_factors[0] > 0.75f )
        {
            curr_pow *= 0.25;
+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 = max( 0.00001f, prev_pow );
        curr_pow = max( 0.00001f, curr_pow );
    }
#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 = max( 0.00001f, prev_pow );
            curr_pow = max( 0.00001f, curr_pow );
        }
#endif

        if ( voice_factors[0] > 0.75f )
        {
            curr_pow = (float) ( curr_pow * 0.25 );