Commit 8e168ec7 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge branch...

Merge branch '1371-uninitialized-earlypartenecorrection-for-fastconv-path-in-cldfb-reverb-init' into 'main'

Resolve "Uninitialized earlyPartEneCorrection for FASTCONV path in CLDFB reverb init"

See merge request !2226
parents 663b271c 1f5635d1
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#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_1330_JBM_MEMORY                             /* VA: issue 1330: memory savings in the JBM decoder */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define FIX_1371_EARLY_PART_INIT_FASTCONV               /* Nokia: fix uninitialized variable in FASTCONV path of binaural reverb init */

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

+7 −1
Original line number Diff line number Diff line
@@ -1007,7 +1007,13 @@ ivas_error ivas_binRenderer_open(
                                                  st_ivas->hDecoderConfig->output_Fs,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationTimes,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections,
                                                  hBinRenderer->earlyPartEneCorrection ) ) != IVAS_ERR_OK )
#ifdef FIX_1371_EARLY_PART_INIT_FASTCONV
                                                  NULL
#else
                                                  hBinRenderer->earlyPartEneCorrection
#endif
                                                  ) ) != IVAS_ERR_OK )

        {
            return error;
        }
+10 −0
Original line number Diff line number Diff line
@@ -1924,13 +1924,23 @@ ivas_error ivas_binaural_reverb_init(
            energyModifier = ( adjustedRevTime - revTimes[bin] ) / adjustedRevTime;

            /* Adjust early and late energies, by moving late energy to early energy */
#ifdef FIX_1371_EARLY_PART_INIT_FASTCONV
            if ( earlyEne != NULL )
            {
                adjustedEarlyEne = earlyEne[bin] + revEne[bin] * energyModifier;
                earlyEne[bin] = adjustedEarlyEne; /* Store already here */
            }
#else
            adjustedEarlyEne = earlyEne[bin] + revEne[bin] * energyModifier;
#endif
            adjustedLateEne = revEne[bin] * ( 1.0f - energyModifier );

            /* Store adjusted room effect parameters to be used in reverb processing */
            revTimes[bin] = adjustedRevTime;
            revEne[bin] = adjustedLateEne;
#ifndef FIX_1371_EARLY_PART_INIT_FASTCONV
            earlyEne[bin] = adjustedEarlyEne;
#endif
        }
    }