Commit f19926bf authored by multrus's avatar multrus
Browse files

Merge branch 'float-1559-synthesis-saturates-for-stereo-with-dtx-and-bitrate-switching' into 'main'

[non-BE] Float 1559 synthesis saturates for stereo with dtx and bitrate switching

See merge request !2606
parents 5d7a06a6 f5533a9f
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;
+1 −0
Original line number Diff line number Diff line
@@ -184,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 )
    {