Commit 47cfc0a1 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fix issue 1371 by not touching earlyPartEneCorrection when FASTCONV path is used.

parent f4c2831a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define FIX_1348_OVERFLOW                               /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */
#define FIX_1369_HQ_LR_OVERFLOW                         /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */
#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;
        }
+14 −0
Original line number Diff line number Diff line
@@ -1924,13 +1924,27 @@ 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;
            }
#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;
#ifdef FIX_1371_EARLY_PART_INIT_FASTCONV
            if ( earlyEne != NULL )
            {
                earlyEne[bin] = adjustedEarlyEne;
            }
#else
            earlyEne[bin] = adjustedEarlyEne;
#endif
        }
    }