Commit 0c836123 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into float-1588-fixes-to-the-conformance-script-e-g-filter-behavior

parents be38c8dc f19926bf
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ void initFdCngCom(
    hFdCngCom->stopBand = 0;
    hFdCngCom->startBand = 0;
    hFdCngCom->stopFFTbin = 0;
#ifdef FIX_1559
    hFdCngCom->nFFTpart = 0;
#endif
    hFdCngCom->frameSize = 0;
    hFdCngCom->fftlen = 0;
    hFdCngCom->seed = 0;
+4 −0
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@
#define FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN            /* FhG: float issue 1560: Avoid optimizing the division on the result of maxWithSign() with -funsafe-math-optimizations */
#define FIX_2095_REMOVE_UNUSED_ISAR_TABLES              /* Dolby: remove unused ISAR */
#define FIX_FLOAT_1582_STEREO_DFT_QUANTIZE_ITD          /* FhG: float issue 1582: Remove unncessary statement from stereo_dft_quantize_itd() */
#define FIX_1585_ASAN_FORMAT_SW_ALT                     /* VA: float issue 1585: alternative fix memory leaks with format switching */


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

@@ -172,6 +174,7 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_1521_SBA_LOUDNESS_STEREO                    /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_2500_RENDCONF_REFACTOR                      /* Eri: Basop issue #2500: Renderer configuration range check before conversion to fixed point. Harmonize between BASOP/float */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, synch with BASOP updates and adding clamping of distance att input and listener position  */
@@ -181,6 +184,7 @@
#define FIX_FLOAT_1573_POSITION_UPDATE                  /* Eri: Float issue 1573: For static orientation and listener movement, the PoseUpdated flag is cleared and prevents 5 ms update rate. */
#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_1452_DEFAULT_REVERB                         /* Nokia/Philips/FhG: Fix default room presets and their usage in renderer */
#define FIX_1559                                        /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */
#define FIX_FMSW_DEC                                    /* float issue 1542: fix JBM issue in format switching */
#define FIX_FMSW_DEC_2                                  /* float issue 1575: fix crash for format switching when bitsream starts with EVS */
#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
+21 −0
Original line number Diff line number Diff line
@@ -191,6 +191,9 @@ void configureFdCngDec(
{
    int16_t j, stopBandFR;
    HANDLE_FD_CNG_COM hsCom = hFdCngDec->hFdCngCom;
#ifdef FIX_1559
    int16_t nFFTpart_prev;
#endif

    hsCom->CngBandwidth = bwidth;
    if ( hsCom->CngBandwidth == FB )
@@ -296,6 +299,10 @@ void configureFdCngDec(
    hsCom->startBand = 2;
    hsCom->stopBand = hsCom->FdCngSetup.sidPartitions[hsCom->FdCngSetup.numPartitions - 1] + 1;
    initPartitions( hsCom->FdCngSetup.sidPartitions, hsCom->FdCngSetup.numPartitions, hsCom->startBand, hsCom->stopBand, hsCom->part, &hsCom->npart, hsCom->midband, hsCom->psize, hsCom->psize_inv, 0 );
#ifdef FIX_1559

    nFFTpart_prev = hsCom->nFFTpart;
#endif
    if ( hsCom->stopFFTbin == 160 )
    {
        hsCom->nFFTpart = 17;
@@ -315,6 +322,20 @@ void configureFdCngDec(
        hsCom->CLDFBpsize_inv[j] = hsCom->psize_inv[j + hsCom->nFFTpart];
    }

#ifdef FIX_1559
    /* In case of going from a lower number of partitions to a higher number, initialize
    the higher ines which might be zero and/or outdated with the highest partitions value
    this avoids almost-zero values to linger around and causing signal bursts after switching to higher bitrate.
    Don't do this on initialization of the codec (nFFTpart_prev == 0)*/
    if ( nFFTpart_prev != 0 )
    {
        for ( j = nFFTpart_prev; j < hsCom->nFFTpart; ++j )
        {
            hFdCngDec->partNoiseShape[j] = hFdCngDec->partNoiseShape[nFFTpart_prev - 1];
        }
    }
#endif

    stopBandFR = (int16_t) floor( 1000.f /*Hz*/ / 25.f /*Hz/Bin*/ );
    if ( stopBandFR > hsCom->stopFFTbin )
    {
+24 −0
Original line number Diff line number Diff line
@@ -381,7 +381,9 @@ ivas_error ivas_hp20_dec_reconfig(
)
{
    int16_t i, nchan_hp20;
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    float **old_mem_hp20_out;
#endif
    ivas_error error;

    error = IVAS_ERR_OK;
@@ -394,6 +396,18 @@ ivas_error ivas_hp20_dec_reconfig(

    if ( nchan_hp20 > nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* create additional hp20 memories */
        for ( i = nchan_hp20_old; i < nchan_hp20; i++ )
        {
            if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
            }

            set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;
@@ -421,9 +435,18 @@ ivas_error ivas_hp20_dec_reconfig(

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }
    else if ( nchan_hp20 < nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* remove superfluous hp20 memories */
        for ( i = nchan_hp20; i < nchan_hp20_old; i++ )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;
@@ -447,6 +470,7 @@ ivas_error ivas_hp20_dec_reconfig(

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }

    return error;
+22 −1
Original line number Diff line number Diff line
@@ -2304,6 +2304,7 @@ ivas_error ivas_init_decoder(
    /* set number of output channels used for synthesis/decoding */
    n = getNumChanSynthesis( st_ivas );

#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    if ( n > 0 )
    {
        if ( ( st_ivas->mem_hp20_out = (float **) malloc( n * sizeof( float * ) ) ) == NULL )
@@ -2315,7 +2316,7 @@ ivas_error ivas_init_decoder(
    {
        st_ivas->mem_hp20_out = NULL;
    }

#endif
    for ( i = 0; i < n; i++ )
    {
        if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
@@ -2326,6 +2327,13 @@ ivas_error ivas_init_decoder(
        set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
    }

#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    for ( ; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        st_ivas->mem_hp20_out[i] = NULL;
    }
#endif

    /*-------------------------------------------------------------------*
     * Allocate and initialize rendering handles
     *--------------------------------------------------------------------*/
@@ -2822,7 +2830,9 @@ void ivas_initialize_handles_dec(
#ifdef FIX_FMSW_DEC
    }
#endif
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    st_ivas->mem_hp20_out = NULL;
#endif
    st_ivas->hLimiter = NULL;

    /* ISM metadata handles */
@@ -2964,6 +2974,16 @@ void ivas_destroy_dec(
    }

    /* HP20 filter handles */
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        if ( st_ivas->mem_hp20_out[i] != NULL )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
    }
#else
    if ( st_ivas->mem_hp20_out != NULL )
    {
        for ( i = 0; i < getNumChanSynthesis( st_ivas ); i++ )
@@ -2974,6 +2994,7 @@ void ivas_destroy_dec(
        free( st_ivas->mem_hp20_out );
        st_ivas->mem_hp20_out = NULL;
    }
#endif

    /* ISM metadata handles */
    ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
Loading