Commit ff8003d2 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into orange/fixpoint_crend_hrtf_file_format

parents 14007ad4 e56f28c5
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@
/* 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 */

/* ##################### End NON-BE switches ########################### */

+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 );