Commit ba9b8de5 authored by Ke Zhao's avatar Ke Zhao
Browse files

Merge branch 'update-reverb-utils' into 'main'

[Non-BE] Use CLDFB HRTFs of the Appropriate SBA Order

See merge request !806
parents 015d279f cb95b706
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@
#define JBM_PARAMUPMIX                                  /* Dlb: Issue 471: Integrate the Multichannel Parametric Upmix into the JBM path */
#define FIX_582_INDEX_OUT_OF_BOUNDS_SNS_AVQ_DEC         /* FhG: fix an undefined behaviour error in SNS AVQ decoding */
#define FIX_614_ADD_TO_NULL_PTR_DIRAC_SETUP             /* FhG: Issue 614: prevent adding to a null pointer in dirac setup code */
#define UPDATE_REVERB_UTILS                             /* Use CLDFB HRTFs of the appropriate SBA order in get_IR_from_filter_taps() */

/* Fixes for bugs found during split rendering contribution development */
#define REND_STATIC_MEM_OPT                             /* Dlb: Static memory optimisation for external renderer */
+33 −1
Original line number Diff line number Diff line
@@ -52,7 +52,9 @@
#define FFT_SPECTRUM_SIZE         ( 1 + ( RV_FILTER_MAX_FFT_SIZE / 2 ) )

#define N_INITIAL_IGNORED_FRAMES 4
#ifndef UPDATE_REVERB_UTILS
#define NUM_CLDFB_TAPES 7
#endif

/*-----------------------------------------------------------------------------------------*
 * Local function prototypes
@@ -225,7 +227,11 @@ static void get_IR_from_filter_taps(
    output_sample_idx = 0;

    /* Assign CLDFB taps */
#ifdef UPDATE_REVERB_UTILS
    if ( input_audio_config == AUDIO_CONFIG_HOA3 )
#else
    if ( input_audio_config == AUDIO_CONFIG_FOA || input_audio_config == AUDIO_CONFIG_HOA2 || input_audio_config == AUDIO_CONFIG_HOA3 )
#endif
    {
        for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ )
        {
@@ -235,6 +241,28 @@ static void get_IR_from_filter_taps(
            convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA3[band_idx][hrtf_idx];
        }
    }
#ifdef UPDATE_REVERB_UTILS
    else if ( input_audio_config == AUDIO_CONFIG_HOA2 )
    {
        for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ )
        {
            convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA2[band_idx][hrtf_idx];
            convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA2[band_idx][hrtf_idx];
            convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA2[band_idx][hrtf_idx];
            convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA2[band_idx][hrtf_idx];
        }
    }
    else if ( input_audio_config == AUDIO_CONFIG_FOA )
    {
        for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ )
        {
            convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_FOA[band_idx][hrtf_idx];
            convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_FOA[band_idx][hrtf_idx];
            convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_FOA[band_idx][hrtf_idx];
            convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_FOA[band_idx][hrtf_idx];
        }
    }
#endif
    else
    {
        array_idx = 0;
@@ -313,7 +341,11 @@ static void get_IR_from_filter_taps(
            }
        }

#ifdef UPDATE_REVERB_UTILS
        ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, BINAURAL_NTAPS );
#else
        ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, NUM_CLDFB_TAPES );
#endif

        ppRealBuf[0] = out_CLDFB_real[0];
        ppImagBuf[0] = out_CLDFB_imag[0];