Commit 4c564ac5 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ivas-float-update' into...

Merge branch 'ivas-float-update' into 2122_ref_delay_alignment_split_rendering_and_external_rend_crashes_omasa
parents f00a2f91 d182b52a
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 −0
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@ typedef enum
/* format signaling in SID frames */
#define SID_FORMAT_NBITS                        3                           /* Bit 0 | Bit 1 | Bit 2 */
                                                                            /*-------|-------|------ */
#ifdef FIX_1384_MSAN_ivas_spar_dec_open
#define SID_FORMAT_NONE                         (-0x1)                      /*    n/a|    n/a|    n/a*/
#endif
#define SID_DFT_STEREO                          0x0                         /*      0|      0|     0 */
#define SID_MDCT_STEREO                         0x1                         /*      1|      0|     0 */
#define SID_ISM                                 0x2                         /*      0|      1|     0 */
+6 −21
Original line number Diff line number Diff line
@@ -149,31 +149,19 @@

/* #################### End DEBUGGING switches ############################ */

/* ################### Start FIXES switches ########################### */
#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */


/* ################### Start FIXES switches ########################### */

#define TEMP_FIX_2088_MSAN_INIT_ERROR                   /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */

/* #################### End FIXES switches ############################ */

#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
#define FIX_1995_REVERB_INIT                            /* issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */

/* #################### Start BASOP porting switches ############################ */

#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */

#define CHECK_BE_USING_OLD_ROM_TABLES_ONLY
#ifdef CHECK_BE_USING_OLD_ROM_TABLES_ONLY
#define USE_NEW_CREND_ROM_TABLE
#ifdef USE_NEW_CREND_ROM_TABLE
#define USE_NEW_REVERB_ROM_TABLES
#endif
#define USE_NEW_FASTCONV_PARAMBIN_ROM_TABLES
#define USE_NEW_TDREND_ROM_TABLES
#endif

#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0  */
#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */
@@ -185,7 +173,6 @@
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */
#define FIX_1377_HANDLE_ERROR_CODE                      /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */
#define FIX_ISSUE_2008_MISSING_CODE_FROM_PORTING        /* FhG: Issue 2008: Code deleted while porting float-main MR !1504 (BASOP issue 1565)*/
#define FIX_1053_REVERB_RECONFIGURATION
#define FIX_1179_USAN_PHASEECU                          /* Eri: issue 1179:  better handling of 16 bit wrap around for very long(>200ms) FER-bursts   */
#define NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX      /* Ericsson: Issue 1246: High level input which triggers DTX can lead to numerical overflow in coherence calculation */
@@ -193,22 +180,20 @@
#define FIX_1113_EXTREND_ISAR                           /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */
#define FIX_1166_TDREND_DIV0                            /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */
#define NONBE_1203_MDCT2DFT_SWITCHING                   /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */
#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX         /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */
#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_938_COMPILER_WARNING                        /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */
#define FIX_1376_MISSING_ISM_METADATA                   /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */
#define FIX_1385_INIT_IGF_STOP_FREQ                     /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */
#define FIX_1387_INIT_PRM_SQQ                           /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */ 
#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */
#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH               /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */
#define NONBE_1293_CRASH_FIRST_FRAME_LOST               /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */
#define FIX_1384_MSAN_stereo_tcx_core_enc               /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */
#define NONBE_FIX_1297_SPAR_JBM_MEM_SAN                 /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ 
#define NONBE_1303_GRANULARITY_OSBA_REND                /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */
#define FIX_1384_MSAN_ivas_spar_dec_open                /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/

// object-editing feature porting
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
+6 −9
Original line number Diff line number Diff line
@@ -2247,12 +2247,9 @@ 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                             */
    const ISM_MODE ism_mode,     /* i  : ISM mode                               */
    const int32_t element_brate  /* i  : element bitrate                        */
);

void LPDmem_enc_init(
+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] ) ) );
Loading