Commit bffc4d37 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1741_REVERB_TIMES_Q_FORMAT

parent 8643daf3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -102,7 +102,6 @@

#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/

#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  */
#define FIX_1835_REVERB_ACTIVATION                      /* FhG: Modified reverberation activation logic and corrected factEQ calculation */
#define LC3PLUS_LEA_COMPAT_BITRATES_48_6                /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel)  */
+0 −4
Original line number Diff line number Diff line
@@ -515,11 +515,7 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx(
                Copy( hrtfShCoeffsIm_fx[i][j], hrtfParambin->hrtfShCoeffsIm_fx[i][j], HRTF_NUM_BINS ); /*Q14*/
            }
        }
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
        Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q26*/
#else
        Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/
#endif
        Copy32( parametricReverberationEneCorrections_fx, hrtfParambin->parametricReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/
        Copy32( parametricEarlyPartEneCorrection_fx, hrtfParambin->parametricEarlyPartEneCorrection_fx, CLDFB_NO_CHANNELS_MAX );           /*Q28*/
        *hHrtfParambin = hrtfParambin;
+0 −2
Original line number Diff line number Diff line
@@ -1117,7 +1117,6 @@ void ivas_reverb_interpolate_acoustic_data_fx(
  Word16 *pOutput_t60_e, //output e
  Word16 *pOutput_dsr_e  //output e
);
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
void ivas_reverb_interpolate_energies_fx(
    const Word16 input_table_size,
    const Word32 *pInput_fc, //input in Q16
@@ -1130,7 +1129,6 @@ void ivas_reverb_interpolate_energies_fx(
    Word16 *pOutput_ene_l_e, //output e
    Word16 *pOutput_ene_r_e  //output e
);
#endif
/*---------------------------------------------------------------------------------*
 * Shoebox Prototypes
 *-----------------------------------------------------------------------------------*/
+0 −2
Original line number Diff line number Diff line
@@ -920,7 +920,6 @@ void ivas_reverb_interpolate_acoustic_data_fx(
    return;
}

#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
/*-------------------------------------------------------------------*
 * ivas_reverb_interpolate_energies_fx()
 *
@@ -1001,4 +1000,3 @@ void ivas_reverb_interpolate_energies_fx(

    return;
}
#endif
+0 −22
Original line number Diff line number Diff line
@@ -221,11 +221,7 @@ static void ivas_binaural_reverb_setPreDelay_fx(
static void ivas_binaural_reverb_setReverbTimes_fx(
    REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle                                  */
    const Word32 output_Fs,       /* i  : sampling_rate                                           */
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
    const Word32 *revTimes_fx, /*Q26 i  : reverberation times T60 for each CLDFB bin in seconds   */
#else
    const Word32 *revTimes_fx, /*Q31 i  : reverberation times T60 for each CLDFB bin in seconds   */
#endif
    const Word32 *revEnes_fx /*Q31 i  : spectrum for reverberated sound at each CLDFB bin       */
)
{
@@ -330,11 +326,7 @@ static void ivas_binaural_reverb_setReverbTimes_fx(
        /* Determine attenuation factor that generates the appropriate energy decay according to reverberation time */
        L_tmp = Mpy_32_32( 1677721600, revTimes_fx[bin] ); // e10 --> 800 * 2^21, + e0
        tmp = BASOP_Util_Divide3232_Scale( 1073741824, L_tmp, &scale );
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
        scale = add( scale, sub( 1, 15 ) ); // revTimes_fx in Q26
#else
        scale = add( scale, sub( 1, 10 ) );
#endif
        L_tmp = Mpy_32_16_1( -1610612736, tmp ); // * -3
        scale = add( 2, scale );
        L_tmp = Mpy_32_32( 1783446563, L_tmp ); // scale + 2
@@ -2389,11 +2381,7 @@ static ivas_error ivas_binaural_reverb_open_fx(
    const Word16 numBins,               /* i  : Q0 number of CLDFB bins                                    */
    const Word16 numCldfbSlotsPerFrame, /* i  : Q0 number of CLDFB slots per frame                         */
    const Word32 sampling_rate,         /* i  : Q0 sampling rate                                           */
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
    const Word32 *revTimes_fx, /* i  : Q26 reverberation times T60 for each CLDFB bin in seconds   */
#else
    const Word32 *revTimes_fx, /* i  : Q31 reverberation times T60 for each CLDFB bin in seconds   */
#endif
    const Word32 *revEnes_fx, /* i  : Q31 spectrum for reverberated sound at each CLDFB bin       */
    const Word16 preDelay     /* i  : Q0 reverb pre-delay in CLDFB slots                         */
)
@@ -2453,15 +2441,9 @@ static ivas_error ivas_binaural_reverb_open_fx(
         * but not excessively long loops to generate reverberation. */
        /* Note: the resulted length is very sensitive to the precision of the constants below (e.g. 1.45 vs. 1.45f) */
        // hReverb->loopBufLength[bin] = (int16_t) ( 1.45 * (int16_t) ( revTimes[bin] * 150.0 ) + 1 );
#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT
        Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 18 ), 18 );
        L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q17 );
        hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 17 ); /*Q0*/
#else
        Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 23 ), 23 );
        L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q22 );
        hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 22 ); /*Q0*/
#endif
        move16();
        hReverb->loopBufLength[bin] = s_min( hReverb->loopBufLength[bin], hReverb->loopBufLengthMax[bin] );

@@ -2561,11 +2543,7 @@ ivas_error ivas_binaural_reverb_init(
#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
        floatToFixed_arrL( t60_temp, t60, Q31, CLDFB_NO_CHANNELS_MAX );
#endif
        floatToFixed_arrL( ene_temp, ene, Q31, CLDFB_NO_CHANNELS_MAX );
    }
    else
Loading