Commit c66231ed authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Reverb: average HRTF energies and inter-aural coherence always read from ROM...

Reverb: average HRTF energies and inter-aural coherence always read from ROM or custom HRTF file [prototype]
parent 30c67d12
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -209,6 +209,9 @@ int main(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL;
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStat = NULL;
#endif
#endif
#ifdef DEBUGGING
    int32_t noClipping;
@@ -787,7 +790,16 @@ int main(

#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStat ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
        if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfStat, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK )
#else
        if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
#endif
        {
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
            {
+12 −0
Original line number Diff line number Diff line
@@ -765,6 +765,9 @@ int main(
    IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL;
    IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL;
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStat = NULL;
#endif
#endif
    IsmPositionProvider *positionProvider;
    LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS];
@@ -1087,7 +1090,16 @@ int main(
            }

#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
            if ( ( error = IVAS_REND_GetHrtfStatisticsHandle( hIvasRend, &hHrtfStat ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" );
                goto cleanup;
            }
            if ( ( hHrtfStat != NULL ) && ( error = load_reverb_binary( *hHrtfStat, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
+3 −0
Original line number Diff line number Diff line
@@ -165,6 +165,9 @@ typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE;
typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE;
typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE;
typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE;
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE;
#endif
typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE;

typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE;
+9 −0
Original line number Diff line number Diff line
@@ -2022,7 +2022,11 @@ ivas_error ivas_init_decoder(

        if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -2070,9 +2074,14 @@ ivas_error ivas_init_decoder(
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
                                            st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
                                            st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config,
                                            st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
#endif
        {
            return error;
+8 −0
Original line number Diff line number Diff line
@@ -204,7 +204,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
                }
                if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
                {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
                    if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        return error;
                    }
@@ -234,8 +238,12 @@ static ivas_error ivas_ism_bitrate_switching_dec(
            /* Open Crend Binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#else
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
            if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
#endif
            {
                return error;
Loading