Commit 8695ba45 authored by Ripinder Singh's avatar Ripinder Singh
Browse files
Merge branch 'main' of ssh://forge.3gpp.org:29419/ivas-codec-pc/ivas-codec into 1154-add-rtpdump-tests
parents 3927ad65 9ddacaa8
Loading
Loading
Loading
Loading
Loading
+3 −38
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "prot.h"
#include "wmc_auto.h"
#include <math.h> /* for cosf, sinf */
#include <assert.h>

static ivas_error get_edct_table(
    const float **edct_table,
@@ -226,7 +227,6 @@ void edst(
    return;
}

#define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */

/*-------------------------------------------------------------------------*
 * edxt()
@@ -243,9 +243,8 @@ void edxt(
)
{
    const float pi_len = EVS_PI / length;
    int16_t k, m;
    int16_t k;

#ifdef FAST_EDXT
    if ( kernelType == MDST_II || kernelType == MDCT_II )
    {
        const int16_t Nm1 = length - 1;
@@ -351,42 +350,8 @@ void edxt(
        }
    }
    else
#endif
        if ( kernelType & 1 ) /* DST */
    {
        const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) );
        const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f );

        for ( k = 0; k < length; k++ )
    {
            y[k] = 0.f;
            for ( m = 0; m < length; m++ )
            {
                y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) );
            }
        }
        if ( offK == 1.f )
        {
            y[length - 1] *= 0.5f; /* scale Nyquist sample */
        }
    }
    else /* kernelType 0, 2: DCT */
    {
        const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) );
        const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f );

        for ( k = 0; k < length; k++ )
        {
            y[k] = 0.f;
            for ( m = 0; m < length; m++ )
            {
                y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) );
            }
        }
        if ( offK == 0.f )
        {
            y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */
        }
        assert( !"Unsupported Kernel type in edxt()" );
    }

    v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length );
+3 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define FIX_1119_SPLIT_RENDERING_VOIP                   /* FhG: Add split rendering support to decoder in VoIP mode */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */

#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */

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

@@ -181,6 +181,8 @@
#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 NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES             /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */

#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV              /* FhG:  Avoid rounding when passing azimuth and elevation to efap_determine_gains() */

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

/* ################## End DEVELOPMENT switches ######################### */
+6 −8
Original line number Diff line number Diff line
@@ -2250,8 +2250,6 @@ ivas_error init_encoder(
    Encoder_State *st,           /* i/o: state structure                        */
    Encoder_Struct *st_ivas,     /* i/o: encoder state structure                */
    const int16_t idchan,        /* i  : channel ID                             */
    const int16_t var_SID_rate_flag, /* i  : flag for variable SID update rate      */
    const int16_t interval_SID,      /* i  : interval for SID update                */
    const int16_t vad_only_flag, /* i  : flag to indicate front-VAD structure   */
    const ISM_MODE ism_mode,     /* i  : ISM mode                               */
    const int32_t element_brate  /* element bitrate                             */
+2 −5
Original line number Diff line number Diff line
@@ -568,14 +568,11 @@ void lpc2mdct(

    if ( noInverse )
    {
        for ( i = 0; i < length; i++ )
        {
            mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) );
        }
        assert( !"not supported option in lpc2mdct()" );
    }
    else
    /* Get amplitude */
    {
        /* Get amplitude */
        for ( i = 0; i < length; i++ )
        {
            mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) );
+10 −10
Original line number Diff line number Diff line
@@ -1520,7 +1520,7 @@ ivas_error ivas_init_decoder(
            return error;
        }

        if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) )
        if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) )
        {
            if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK )
            {
@@ -1542,7 +1542,7 @@ ivas_error ivas_init_decoder(
                st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands;
            }

            ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
            ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
                                     st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 );
        }
        st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas );
@@ -1667,7 +1667,7 @@ ivas_error ivas_init_decoder(
            return error;
        }

        if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO )
        if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO )
        {
            if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK )
            {
@@ -1689,7 +1689,7 @@ ivas_error ivas_init_decoder(
                st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands;
            }

            ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
            ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
                                     st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0, 1 );
        }

@@ -2126,7 +2126,7 @@ ivas_error ivas_init_decoder(

        if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK )
            {
                return error;
            }
@@ -2156,8 +2156,8 @@ ivas_error ivas_init_decoder(
            }
        }

        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
                                            st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, output_config,
                                            st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -2259,7 +2259,7 @@ ivas_error ivas_init_decoder(

            if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
            {
                if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, output_Fs ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
@@ -2322,7 +2322,7 @@ ivas_error ivas_init_decoder(
        {
            if ( st_ivas->hBinRenderer->render_lfe )
            {
                if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                {
                    /* Account for filterbank delay */
                    delay_ns += IVAS_FB_DEC_DELAY_NS;
@@ -2377,7 +2377,7 @@ ivas_error ivas_init_decoder(

    if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && hDecoderConfig->Opt_tsm )
    {
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( ( error = ivas_jbm_dec_metadata_open( st_ivas ) ) != IVAS_ERR_OK )
            {
Loading