Commit 5ae0e0f6 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fix for computing reverb predelay in samples

parent 044fa947
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@
#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF              /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */

#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define FIX_1831_REVERB_REGRESSION                      /* Philips: fixes reverb regression issues  */

/* #################### End BASOP porting switches ############################ */

+11 −0
Original line number Diff line number Diff line
@@ -2426,6 +2426,10 @@ ivas_error ivas_binaural_reverb_init(
    Word32 t60[CLDFB_NO_CHANNELS_MAX];
    Word32 ene[CLDFB_NO_CHANNELS_MAX];
    Word16 preDelay;
#ifdef FIX_1831_REVERB_REGRESSION
    Word16 temp16, s;
    Word32 temp32;
#endif

    error = IVAS_ERR_OK;

@@ -2442,7 +2446,14 @@ ivas_error ivas_binaural_reverb_init(
            return error;
        }

#ifdef FIX_1831_REVERB_REGRESSION
        temp16 = BASOP_Util_Divide3216_Scale( sampling_rate, CLDFB_NO_CHANNELS_MAX, &s );
        temp16 = shl( temp16, s );                                          // Q0
        temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, temp16 );  // Q11
        preDelay = shr( add( temp32, shl( 1, 10 ) ), 11 );                  // Q0
#else
        preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX );
#endif
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
        floatToFixed_arrL( t60_temp, t60, Q26, CLDFB_NO_CHANNELS_MAX );
#else