Commit b1d5203f authored by vaclav's avatar vaclav
Browse files

issue 1079: Allocate ISAR data handle dynamically; under SPLIT_REND_WITH_HEAD_ROT

parent 95fed5b1
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1148,9 +1148,9 @@ ivas_error ivas_binRenderer_open(
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
        hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses + 1;
        hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses + 1;
#else
        hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses;
        hBinRenderer->numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
#endif
    }
    else
+20 −9
Original line number Diff line number Diff line
@@ -765,6 +765,9 @@ ivas_error ivas_dirac_dec_config(
    int16_t need_parambin;
    int16_t dec_param_estim_old;
    int16_t dec_param_estim_new;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    int16_t num_poses, pos_idx;
#endif

    error = IVAS_ERR_OK;

@@ -775,6 +778,14 @@ ivas_error ivas_dirac_dec_config(
    hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order );
    dec_param_estim_old = ( dec_config_flag == DIRAC_RECONFIGURE ) ? st_ivas->hDirAC->hConfig->dec_param_estim : FALSE;

#ifdef SPLIT_REND_WITH_HEAD_ROT
    num_poses = 1;
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
    }
#endif

    sparfoa_flag = 0;
    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag )
    {
@@ -904,7 +915,7 @@ ivas_error ivas_dirac_dec_config(

#ifdef SPLIT_REND_WITH_HEAD_ROT
                /* copy td-decorr flag to split renderer side rendereres */
                for ( int16_t pos_idx = 1; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ )
                for ( pos_idx = 1; pos_idx < num_poses; pos_idx++ )
                {
                    st_ivas->hDiracDecBin[pos_idx]->useTdDecorr = st_ivas->hDiracDecBin[0]->useTdDecorr;
                }
@@ -938,7 +949,7 @@ ivas_error ivas_dirac_dec_config(
                }

#ifdef SPLIT_REND_WITH_HEAD_ROT
                for ( int16_t pos_idx = 0; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ )
                for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
                {
                    st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate );
                }
@@ -2337,17 +2348,17 @@ void ivas_dirac_dec_render_sf(
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL )
            if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL )
            {
                for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ )
                {
                    for ( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ )
                    {
                        mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend.hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                    }
                }
                st_ivas->hSplitBinRend.hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
                st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
            }
        }
#endif
@@ -2355,7 +2366,7 @@ void ivas_dirac_dec_render_sf(
        /* Perform binaural rendering */
        ivas_binRenderer( st_ivas->hBinRenderer,
#ifdef SPLIT_REND_WITH_HEAD_ROT
                          &st_ivas->hSplitBinRend.splitrend.multiBinPoseData,
                          ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
#endif

                          st_ivas->hCombinedOrientationData,
@@ -2374,8 +2385,8 @@ void ivas_dirac_dec_render_sf(
                {
                    for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
                    {
                        mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                        mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands );
                    }
                }
            }
+4 −234
Original line number Diff line number Diff line
@@ -37,11 +37,6 @@
#include "ivas_rom_com.h"
#include "ivas_stat_enc.h"
#include "prot.h"
#ifdef SPLIT_REND_WITH_HEAD_ROT
#include "lib_isar_pre_rend.h"
#include "isar_prot.h"
#include "isar_stat.h"
#endif
#include <assert.h>
#include <math.h>
#include <stdint.h>
@@ -59,187 +54,6 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r

static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas );

#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas );


/*-------------------------------------------------------------------*
 * ivas_dec_reconfig_split_rend()
 *
 * IVAS decoder split rend reconfig
 *-------------------------------------------------------------------*/

static ivas_error ivas_dec_reconfig_split_rend(
    Decoder_Struct *st_ivas /* i  : IVAS decoder structure      */
)
{
    ivas_error error;
    int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag;
    SPLIT_REND_WRAPPER *hSplitRendWrapper;

    hSplitRendWrapper = &st_ivas->hSplitBinRend.splitrend;
    pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
    cldfb_in_flag = 0;

    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
         st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
         st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
         st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
    {
        cldfb_in_flag = 1;
    }

    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );

    isCldfbNeeded = 0;

    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
         ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) )
    {
        cldfb_in_flag = 0;
    }

    if ( st_ivas->renderer_type != RENDERER_DISABLE )
    {
        if ( cldfb_in_flag == 0 )
        {
            isCldfbNeeded = 1;
        }
        else if ( st_ivas->hRenderConfig->split_rend_config.codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
        }
        else if ( pcm_out_flag && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
        }
    }
    else if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan )
    {
        isCldfbNeeded = 1;
    }

    if ( isCldfbNeeded == 1 && hSplitRendWrapper->hCldfbHandles == NULL )
    {
        if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) );
        }

        num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS;
        for ( ch = 0; ch < num_ch; ch++ )
        {
            hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL;
        }

        num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS;

        for ( ch = 0; ch < num_ch; ch++ )
        {
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not open CLDFB handles\n" ) );
            }
        }

        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }
    else if ( isCldfbNeeded == 0 && hSplitRendWrapper->hCldfbHandles != NULL )
    {
        num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS;
        for ( ch = 0; ch < num_ch; ch++ )
        {
            if ( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] != NULL )
            {
                deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] );
                hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL;
            }
        }

        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            if ( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] != NULL )
            {
                deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] );
                hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] = NULL;
            }
        }

        free( hSplitRendWrapper->hCldfbHandles );
        hSplitRendWrapper->hCldfbHandles = NULL;
    }

    if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) &&
         ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) &&
         !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) /* td-rend not needed? */
    {
        for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
        {
            if ( st_ivas->hTdRendHandles[i] != NULL )
            {
                st_ivas->hTdRendHandles[i]->HrFiltSet_p = NULL;
                ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] );
            }
        }
    }

    return IVAS_ERR_OK;
}


/*-------------------------------------------------------------------*
 * ivas_dec_init_split_rend()
 *
 * IVAS decoder split rend init
 *-------------------------------------------------------------------*/

static ivas_error ivas_dec_init_split_rend(
    Decoder_Struct *st_ivas /* i  : IVAS decoder structure      */
)
{
    ivas_error error;
    int16_t cldfb_in_flag, pcm_out_flag;
    int16_t mixed_td_cldfb_flag;

    pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
    cldfb_in_flag = 0;

    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
         st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
         st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
         st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
    {
        cldfb_in_flag = 1;
    }

    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );

    if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend.splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) )
    {
        if ( ( st_ivas->hSplitBinRend.hCldfbDataOut = (ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for cldfb data out buffer\n" ) );
        }
    }

    mixed_td_cldfb_flag = 0;
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
         ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) )
    {
        mixed_td_cldfb_flag = 1;
    }

    error = ISAR_PRE_REND_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize, mixed_td_cldfb_flag );
    return error;
}
#endif


/*-------------------------------------------------------------------*
 * ivas_dec_setup()
@@ -694,20 +508,6 @@ ivas_error ivas_dec_setup(
        }
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /*-----------------------------------------------------------------*
     * reconfig split rendering as renderer might change after bitrate switching
     *-----------------------------------------------------------------*/

    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = ivas_dec_reconfig_split_rend( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
#endif

    /*----------------------------------------------------------------*
     * Reset bitstream pointers
     *----------------------------------------------------------------*/
@@ -1240,25 +1040,6 @@ ivas_error ivas_init_decoder(
        }
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /*-----------------------------------------------------------------*
     * Initialize binuaral split rendering
     *-----------------------------------------------------------------*/

    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
         ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) )
    {
        if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
    else
    {
        st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses = 1;
    }
#endif

    /*-----------------------------------------------------------------*
     * Allocate and initialize SCE/CPE and other handles
     *-----------------------------------------------------------------*/
@@ -2043,7 +1824,7 @@ 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->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
                                            st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : 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->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
@@ -2546,10 +2327,7 @@ void ivas_initialize_handles_dec(
    st_ivas->hCombinedOrientationData = NULL;

#ifdef SPLIT_REND_WITH_HEAD_ROT
    st_ivas->hSplitBinRend.hMultiBinCldfbData = NULL;
    st_ivas->hSplitBinRend.hCldfbDataOut = NULL;
    st_ivas->hSplitBinRend.numTdSamplesPerChannelCached = 0;
    isar_init_split_rend_handles( &st_ivas->hSplitBinRend.splitrend );
    st_ivas->hSplitBinRend = NULL;
    for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
    {
        st_ivas->hTdRendHandles[i] = NULL;
@@ -2693,9 +2471,7 @@ void ivas_destroy_dec(
    ivas_binRenderer_close( &st_ivas->hBinRenderer );

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /* Split binaural renderer handle */
    ISAR_PRE_REND_close( &st_ivas->hSplitBinRend.splitrend, NULL );

    /* TD binaural renderer handles */
    for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
    {
        if ( st_ivas->hTdRendHandles[i] != NULL )
@@ -2704,12 +2480,6 @@ void ivas_destroy_dec(
            ivas_td_binaural_close( &st_ivas->hTdRendHandles[i] );
        }
    }

    if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL )
    {
        free( st_ivas->hSplitBinRend.hCldfbDataOut );
        st_ivas->hSplitBinRend.hCldfbDataOut = NULL;
    }
#endif

    /* Parametric binaural renderer handle */
@@ -2722,7 +2492,7 @@ void ivas_destroy_dec(
    /* Crend handle */

#ifdef SPLIT_REND_WITH_HEAD_ROT
    ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses );
    ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
#else
    ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif
+2 −2
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ 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->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
            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 == NULL ) ? 1 : 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->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
@@ -298,7 +298,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(

            /* close the crend binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT
            ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses );
            ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
#else
            ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) );
#endif
+2 −2
Original line number Diff line number Diff line
@@ -1332,7 +1332,7 @@ ivas_error ivas_jbm_dec_render(
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
                {
                    if ( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                    if ( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                            &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK )
                    {
                        return error;
@@ -1497,7 +1497,7 @@ ivas_error ivas_jbm_dec_render(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses;
        nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
    }
    else
    {
Loading