Commit 92461747 authored by Devansh Kandpal's avatar Devansh Kandpal
Browse files

All changes in lib_dec .c files

parent acfbcc3e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,11 @@ ivas_error ivas_binRenderer_open(
    /* Allocate memories needed for reverb module */
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
    {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != 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;
        }
+44 −1
Original line number Diff line number Diff line
@@ -1040,6 +1040,13 @@ ivas_error ivas_init_decoder_front(
        {
            return error;
        }

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        if ( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif
    }

    /*-------------------------------------------------------------------*
@@ -1194,6 +1201,20 @@ ivas_error ivas_init_decoder(
        }
    }

	#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    /*--------------------------------------------------------------------*
     * Allocate and initialize HRTF Statistics handle
     *--------------------------------------------------------------------*/

    if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
        if ( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /*-----------------------------------------------------------------*
     * Initialize binuaral split rendering
@@ -1942,7 +1963,12 @@ 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;
            }
@@ -1981,11 +2007,20 @@ ivas_error ivas_init_decoder(
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#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_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 == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
#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;
@@ -2432,6 +2467,9 @@ void ivas_initialize_handles_dec(
    st_ivas->hSetOfHRTF = NULL;
    st_ivas->hHrtfFastConv = NULL;
    st_ivas->hHrtfParambin = NULL;
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    st_ivas->hHrtfStatistics = NULL;
#endif
    st_ivas->hoa_dec_mtx = NULL;
    st_ivas->hMasaIsmData = NULL;
    st_ivas->hSbaIsmData = NULL;
@@ -2669,6 +2707,11 @@ void ivas_destroy_dec(
    /* Parametric binauralizer HRTF filters */
    ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin );

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    /* HRTF statistics */
    ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics );
#endif

    /* Config. Renderer */
    ivas_render_config_close( &( st_ivas->hRenderConfig ) );

+14 −1
Original line number Diff line number Diff line
@@ -201,7 +201,12 @@ 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;
                    }
@@ -230,9 +235,17 @@ static ivas_error ivas_ism_bitrate_switching_dec(

            /* Open Crend Binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#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, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != 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, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
#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;
+8 −0
Original line number Diff line number Diff line
@@ -1296,9 +1296,17 @@ static ivas_error ivas_mc_dec_reconfig(
            else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) )
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT
#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, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != 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, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
#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;
+24 −0
Original line number Diff line number Diff line
@@ -2040,6 +2040,30 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle(
    return IVAS_ERR_OK;
}


#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
/*---------------------------------------------------------------------*
 * IVAS_DEC_GetHrtfStatisticsHandle( )
 *
 *
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    IVAS_DEC_HANDLE hIvasDec,                         /* i/o: IVAS decoder handle       */
    IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o  : HRTF statistics handle    */
)
{
    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfStatistics == NULL )
    {
        return IVAS_ERR_WRONG_PARAMS;
    }

    *hHrtfStatistics = &hIvasDec->st_ivas->hHrtfStatistics;

    return IVAS_ERR_OK;
}
#endif

/*---------------------------------------------------------------------*
 * copyRendererConfigStruct( )
 *