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

All functions lib_dec

parent 7db5ca7a
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1418,7 +1418,11 @@ ivas_error ivas_binRenderer_open_fx(
    test();
    IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
    {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        IF( NE_32( ( 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( NE_32( ( error = ivas_binaural_reverb_open_fastconv_fx( &( 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
@@ -1179,6 +1179,13 @@ ivas_error ivas_init_decoder_front(
        }
    }

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) , IVAS_ERR_OK ) )
    {
        return error;
    }
#endif

    /*-------------------------------------------------------------------*
     * Allocate and initialize Binaural Renderer configuration handle
     *--------------------------------------------------------------------*/
@@ -1364,6 +1371,20 @@ ivas_error ivas_init_decoder_fx(
        }
    }

#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
@@ -2274,7 +2295,11 @@ ivas_error ivas_init_decoder_fx(

        IF( EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
        {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
            IF( NE_32( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) , IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) )
#endif
			{
                return error;
            }
@@ -2318,13 +2343,23 @@ ivas_error ivas_init_decoder_fx(
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        IF( NE_32( ( 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( NE_32( ( 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( NE_32( ( 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( NE_32( ( 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;
@@ -2862,6 +2897,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;
@@ -3096,6 +3134,11 @@ void ivas_destroy_dec_fx(
    /* Parametric binauralizer HRTF filters */
    ivas_HRTF_parambin_binary_close_fx( &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 ) );

+15 −3
Original line number Diff line number Diff line
@@ -220,7 +220,11 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(
                }
                IF( EQ_32( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
                {
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
                    IF( NE_32( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) , IVAS_ERR_OK ) )
#else
                    IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) )
#endif
					{
                        return error;
                    }
@@ -248,12 +252,20 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx(

            /* Open Crend Binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
            IF( NE_32( ( 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( NE_32( ( 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( NE_32( ( 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 ) )           
			{
                return error;
            }
#else
            IF( NE_32( ( 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
			{
                return error;
            }
+8 −0
Original line number Diff line number Diff line
@@ -1576,9 +1576,17 @@ static ivas_error ivas_mc_dec_reconfig_fx(
            ELSE IF( st_ivas->hCrendWrapper == NULL && ( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) || EQ_16( 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;