Commit 2c7f3af5 authored by Jan Kiene's avatar Jan Kiene
Browse files

port fix for float issue 1559

parent 71deb78c
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ void initFdCngCom(
    move16();
    hFdCngCom->stopFFTbin = 0;
    move16();
#ifdef FIX_1559
    hFdCngCom->nFFTpart = 0;
    move16();
#endif
    hFdCngCom->frameSize = 0;
    move16();
    hFdCngCom->fftlen = 0;
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@
#define FIX_BASOP_2517_CLICK_IN_OMASA_LTV               /* FhG: BASOP #2517: preserve precision by removing one-bit headroom from Q_min and allowing saturation during buffer scaling */
#define FIX_BASOP_2559_Q_SYNTH_HISTORY_RESET            /* FhG: BASOP issue 2559: reset hTcxDec->q_synth_history_fx in allocate_CoreCoder_TCX_fx() */
#define FIX_FLOAT_1578_OMASA_REND_SPIKES                /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */
#define FIX_1559                                        /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */

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

+22 −0
Original line number Diff line number Diff line
@@ -4155,6 +4155,9 @@ void configureFdCngDec_ivas_fx(
{
    Word16 j, stopBandFR;
    HANDLE_FD_CNG_COM hsCom = hFdCngDec->hFdCngCom;
#ifdef FIX_1559
    Word16 nFFTpart_prev;
#endif

    hsCom->CngBandwidth = bwidth; /*Q0*/
    move16();
@@ -4289,6 +4292,10 @@ void configureFdCngDec_ivas_fx(
    hsCom->stopBand = add( hsCom->FdCngSetup.sidPartitions[( hsCom->FdCngSetup.numPartitions - 1 )], 1 ); /*Q0*/
    initPartitions( hsCom->FdCngSetup.sidPartitions, hsCom->FdCngSetup.numPartitions, hsCom->startBand, hsCom->stopBand, hsCom->part, &hsCom->npart, hsCom->midband, hsCom->psize, hsCom->psize_norm, &hsCom->psize_norm_exp, hsCom->psize_inv, 0 );

#ifdef FIX_1559

    nFFTpart_prev = hsCom->nFFTpart;
#endif
    IF( EQ_16( hsCom->stopFFTbin, 160 ) )
    {
        hsCom->nFFTpart = 17;
@@ -4314,6 +4321,21 @@ void configureFdCngDec_ivas_fx(
        move16();
    }

#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( NE_16( nFFTpart_prev, 0 ) )
    {
        FOR( j = nFFTpart_prev; j < hsCom->nFFTpart; ++j )
        {
            hFdCngDec->partNoiseShape[j] = hFdCngDec->partNoiseShape[nFFTpart_prev - 1];
            move16();
        }
    }
#endif

    stopBandFR = 40; //(Word16)floor(1000.f /*Hz*/ / 25.f /*Hz/Bin*/);
    move16();
    if ( GT_16( stopBandFR, hsCom->stopFFTbin ) )