Commit 917a3390 authored by Jan Brouwer's avatar Jan Brouwer
Browse files

pass hrtf statistics to ivas_binaural_reverb_open*() functions

parent 7dd47044
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1231,7 +1231,11 @@ ivas_error ivas_binRenderer_open(
    /* Allocate memories needed for reverb module */
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = ivas_binaural_reverb_open_fastconv( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_binaural_reverb_open_fastconv( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
+4 −0
Original line number Diff line number Diff line
@@ -240,7 +240,11 @@ ivas_error ivas_dirac_dec_init_binaural_data(
#endif
            {
                /* Todo Philips: Room acoustics should be passed here once the underlying part works. Probably enough to pick it from st_ivas but you know best. */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
                if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
+8 −0
Original line number Diff line number Diff line
@@ -993,6 +993,10 @@ ivas_error ivas_rend_crendProcessSubframe(

ivas_error ivas_binaural_reverb_open_fastconv(
    REVERB_STRUCT_HANDLE *hReverbPr,                            /* i/o: binaural reverb handle                  */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    const HRTFS_STATISTICS_HANDLE hHrtfStatistics,              /* i  : HRTF statistics handle                  */
#else
#endif
    const int16_t numBins,                                      /* i  : number of CLDFB bins                    */
    const int16_t numCldfbSlotsPerFrame,                        /* i  : number of CLDFB slots per frame         */
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics,             /* i/o: room acoustics parameters               */
@@ -1003,6 +1007,10 @@ ivas_error ivas_binaural_reverb_open_fastconv(

ivas_error ivas_binaural_reverb_open_parambin(
    REVERB_STRUCT_HANDLE *hReverbPr,                            /* i/o: binaural reverb handle                  */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    const HRTFS_STATISTICS_HANDLE hHrtfStatistics,              /* i  : HRTF statistics handle                  */
#else
#endif
    const int16_t numBins,                                      /* i  : number of CLDFB bins                    */
    const int16_t numCldfbSlotsPerFrame,                        /* i  : number of CLDFB slots per frame         */
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics,             /* i/o: room acoustics parameters               */
+26 −6
Original line number Diff line number Diff line
@@ -1803,6 +1803,10 @@ void ivas_binaural_reverb_processSubframe(

static ivas_error ivas_binaural_reverb_open(
    REVERB_STRUCT_HANDLE *hReverbPr,     /* i/o: binaural reverb handle                                  */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i  : HRTF statistics handle                                  */
#else
#endif
    const int16_t numBins,                         /* i  : number of CLDFB bins                                    */
    const int16_t numCldfbSlotsPerFrame,           /* i  : number of CLDFB slots per frame                         */
    const int32_t sampling_rate,                   /* i  : sampling rate                                           */
@@ -1912,6 +1916,10 @@ static ivas_error ivas_binaural_reverb_open(

ivas_error ivas_binaural_reverb_open_fastconv(
    REVERB_STRUCT_HANDLE *hReverbPr,                /* i/o: binaural reverb handle               */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    const HRTFS_STATISTICS_HANDLE hHrtfStatistics,  /* i  : HRTF statistics handle               */
#else
#endif
    const int16_t numBins,                          /* i  : number of CLDFB bins                 */
    const int16_t numCldfbSlotsPerFrame,            /* i  : number of CLDFB slots per frame      */
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters            */
@@ -1946,7 +1954,11 @@ ivas_error ivas_binaural_reverb_open_fastconv(
        preDelay = 10;
    }

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    error = ivas_binaural_reverb_open( hReverbPr, hHrtfStatistics, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay );
#else
    error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay );
#endif

    return error;
}
@@ -1960,6 +1972,10 @@ ivas_error ivas_binaural_reverb_open_fastconv(

ivas_error ivas_binaural_reverb_open_parambin(
    REVERB_STRUCT_HANDLE *hReverbPr,                /* i/o: binaural reverb handle               */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    const HRTFS_STATISTICS_HANDLE hHrtfStatistics,  /* i  : HRTF statistics handle               */
#else
#endif
    const int16_t numBins,                          /* i  : number of CLDFB bins                 */
    const int16_t numCldfbSlotsPerFrame,            /* i  : number of CLDFB slots per frame      */
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters            */
@@ -1994,7 +2010,11 @@ ivas_error ivas_binaural_reverb_open_parambin(
        preDelay = 10;
    }

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    error = ivas_binaural_reverb_open( hReverbPr, hHrtfStatistics, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay );
#else
    error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay );
#endif

    return error;
}
+13 −0
Original line number Diff line number Diff line
@@ -9348,7 +9348,12 @@ static ivas_error ivas_masa_ext_rend_dirac_rend_init(
}

static ivas_error ivas_masa_ext_rend_parambin_init(
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    input_masa *inputMasa,                  /* i/o: MASA external renderer structure        */
    HRTFS_STATISTICS_HANDLE hHrtfStatistics /* i: HRTF statistics                           */
#else
    input_masa *inputMasa /* i/o: MASA external renderer structure        */
#endif
)
{
    DIRAC_DEC_BIN_HANDLE hDiracDecBin;
@@ -9449,7 +9454,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init(
#endif
            {
                /* Todo Philips: Room acoustics should be passed here once the underlying part works. In this case, it probably should come from render context or somewhere else suitable. */
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
                if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -9641,7 +9650,11 @@ static ivas_error initMasaExtRenderer(
            }
        }

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }