diff --git a/lib_com/options.h b/lib_com/options.h index 45ca705378ba7ac1916c7255687aad51aa0a5a6c..42f17f9081d30208ab776204fc4410ba465a39b3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 ################################## */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 4b2c4c7d0730f215a9a9e4e5be207181a2f10b0b..7cd919233e031442c775f5da63ffe3c24a970e0e 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -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; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 2811a3c4d03ec644555e7daa56eca3dd233f1638..3119f5fdf9a355a531929c9aaff3d8187c0dc8e8 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -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 } }