Commit fe3d8a37 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files
Merge branch 'main' of ssh://forge.3gpp.org:29419/ivas-codec-pc/ivas-codec into ci/loudness-dirac-hrtf
parents 8a841bdd a53d7b54
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -164,13 +164,17 @@
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_2344_ALIGN_PREPROC                          /* VA: basop issue 2344: Align pre_proc_ivas() between FLP and BASOP */
#define FIX_FLOAT_1501_UNIT_VALUE_IN_OMASA              /* Nokia: Fix float issue 1501, uninitialized value in ivas_masa_combine_directions for OMASA */
#define FIX_2331_CLANG18_MSAN_UNINIT_VARIABLE           /* FhG: Fix issue 2331: Uninitialized variable */

/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.258 V3.0 */
#define FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION         /* Dolby: issue 1465: Fix constant in create_random_vector() to allow more reliable fixed point port */


#define FIX_1500_ISM_MD_DTX                             /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */

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

/* ################## End MAINTENANCE switches ######################### */
+7 −4
Original line number Diff line number Diff line
@@ -2685,6 +2685,9 @@ void GenShapedWBExcitation(
    float *mem_genSHBexc_filt_down3, /* i/o: memory                                 */
    float *state_lpc_syn,            /* i/o: memory                                 */
    const int16_t coder_type,        /* i  : coding type                            */
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
    const int16_t element_mode, /* i  : element mode                           */
#endif
    const float *bwe_exc_extended, /* i  : bandwidth extended exciatation         */
    int16_t bwe_seed[],            /* i/o: random number generator seed           */
    const float voice_factors[],   /* i  : voicing factor                         */
+61 −4
Original line number Diff line number Diff line
@@ -54,7 +54,11 @@
 * Local function prototypes
 *-----------------------------------------------------------------*/

#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
static void create_random_vector( float output[], const int16_t length, int16_t seed[], const int16_t element_mode );
#else
static void create_random_vector( float output[], const int16_t length, int16_t seed[] );
#endif
static void flip_spectrum( const float input[], float output[], const int16_t length );
static void Hilbert_transform( float tmp_R[], float tmp_I[], float *tmpi_R, float *tmpi_I, const int16_t length, const int16_t HB_stage_id );
static void Estimate_mix_factors( const float *shb_res, const float *exc16kWhtnd, const float *White_exc16k, const float pow1, const float pow22, float *vf_modified, int16_t *vf_ind );
@@ -366,6 +370,9 @@ void GenShapedWBExcitation(
    float *mem_genSHBexc_filt_down3, /* i/o: memory                                */
    float *state_lpc_syn,            /* i/o: memory                                */
    const int16_t coder_type,        /* i  : coding type                           */
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
    const int16_t element_mode, /* i  : element mode                          */
#endif
    const float *bwe_exc_extended, /* i  : bandwidth extended exciatation        */
    int16_t bwe_seed[],            /* i/o: random number generator seed          */
    const float voice_factors[],   /* i  : voicing factor                        */
@@ -407,7 +414,11 @@ void GenShapedWBExcitation(
    if ( uv_flag )
    {
        /* unvoiced signal */
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
        create_random_vector( exc4kWhtnd, L_FRAME16k / 4, bwe_seed, element_mode );
#else
        create_random_vector( exc4kWhtnd, L_FRAME16k / 4, bwe_seed );
#endif
    }
    else
    {
@@ -436,7 +447,11 @@ void GenShapedWBExcitation(
            *mem_csfilt = -csfilt_den2[1] * excNoisyEnv[i];
        }

#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
        create_random_vector( exc4k, L_FRAME16k / 4, bwe_seed, element_mode );
#else
        create_random_vector( exc4k, L_FRAME16k / 4, bwe_seed );
#endif

        /* Ensure pow22 is greater than zero when computing normalization */
        for ( i = 0, pow22 = 0.00001f; i < L_FRAME16k / 4; i++ )
@@ -890,8 +905,13 @@ void GenShapedSHBExcitation(
    }
    else
    {
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
        create_random_vector( White_exc16k, L_FRAME, bwe_seed, element_mode );
        create_random_vector( White_exc16k + L_FRAME, L_FRAME16k - L_FRAME, bwe_seed, element_mode );
#else
        create_random_vector( White_exc16k, L_FRAME, bwe_seed );
        create_random_vector( White_exc16k + L_FRAME, L_FRAME16k - L_FRAME, bwe_seed );
#endif

        for ( k = 0, pow22 = 0.00001f; k < L_FRAME16k; k++ )
        {
@@ -1535,23 +1555,60 @@ void non_linearity(
 * -------------------------------------------------------------------*/

void create_random_vector(
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
    float output[],            /* o  : output random vector      */
    const int16_t length,      /* i  : length of random vector   */
    int16_t seed[],            /* i/o: start seed                */
    const int16_t element_mode /* i  : element mode              */
#else
    float output[],       /* o  : output random vector      */
    const int16_t length, /* i  : length of random vector   */
    int16_t seed[]        /* i/o: start seed                */
#endif
)
{
    int16_t i, j, k;
    float scale1, scale2;

#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
    if ( element_mode != EVS_MONO )
    {
        j = (int16_t) ( own_random( &seed[0] ) * 0.0078125f );
        j = (int16_t) min( abs( j ), 255 );
        k = (int16_t) ( own_random( &seed[1] ) * 0.0078125f );
        k = (int16_t) min( abs( k ), 255 );
    }
    else
    {
        j = (int16_t) ( own_random( &seed[0] ) * 0.0078f );
        j = abs( j ) & 0xff;
        k = (int16_t) ( own_random( &seed[1] ) * 0.0078f );
        k = abs( k ) & 0xff;
    }
#else
    j = (int16_t) ( own_random( &seed[0] ) * 0.0078f );
    j = abs( j ) & 0xff;
    k = (int16_t) ( own_random( &seed[1] ) * 0.0078f );
    k = abs( k ) & 0xff;
#endif

    while ( k == j )
    {
#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
        if ( element_mode != EVS_MONO )
        {
            k = (int16_t) ( own_random( &seed[1] ) * 0.0078125f );
            k = (int16_t) min( abs( k ), 255 );
        }
        else
        {
            k = (int16_t) ( own_random( &seed[1] ) * 0.0078f );
            k = abs( k ) & 0xff;
        }
#else
        k = (int16_t) ( own_random( &seed[1] ) * 0.0078f );
        k = abs( k ) & 0xff;
#endif
    }

    if ( own_random( &seed[0] ) < 0 )
+4 −0
Original line number Diff line number Diff line
@@ -119,7 +119,11 @@ static void ism_metadata_smooth(
        /* smooth elevation */
        diff = hIsmMetaData->last_true_elevation - hIsmMetaData->last_elevation;

#ifdef FIX_1500_ISM_MD_DTX
        if ( ism_total_brate > IVAS_SID_5k2 && fabsf( diff ) > IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION )
#else
        if ( ism_total_brate > IVAS_SID_5k2 && diff > IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION )
#endif
        {
            /* skip the smoothing */
        }
+4 −0
Original line number Diff line number Diff line
@@ -323,7 +323,11 @@ void wb_tbe_dec(
        /* From low band excitation, generate highband excitation */
        mvr2r( hBWE_TD->state_syn_shbexc, shaped_wb_excitation, L_SHB_LAHEAD / 4 );

#ifdef FIX_1465_SWB_TBE_RANDOM_VECTOR_CREATION
        GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, st->element_mode, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf );
#else
        GenShapedWBExcitation( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt, hBWE_TD->mem_genSHBexc_filt_down_shb, hBWE_TD->mem_genSHBexc_filt_down_wb2, hBWE_TD->mem_genSHBexc_filt_down_wb3, hBWE_TD->state_lpc_syn, st->coder_type, bwe_exc_extended, hBWE_TD->bwe_seed, vf_modified, uv_flag, st->igf );
#endif

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