Commit 9d9a506b authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1135_EXT_RENDERER_HANDLES

parent 26880763
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -169,10 +169,8 @@ typedef struct
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    int16_t Opt_Headrotation;
    int16_t Opt_ExternalOrientation;
#endif
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_REND_COMPLEXITY_LEVEL complexityLevel;
@@ -886,11 +884,7 @@ int main(

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -2518,10 +2512,8 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );
    clearString( args.externalOrientationFilePath );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    args.Opt_Headrotation = 0;
    args.Opt_ExternalOrientation = 0;
#endif
    args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;

    args.nonDiegeticPan = 0;
@@ -2611,9 +2603,7 @@ static void parseOption(
            break;
        case CmdLnOptionId_trajFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_Headrotation = 1;
#endif
            strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_outputMetadata:
@@ -2634,9 +2624,7 @@ static void parseOption(
            break;
        case CmdLnOptionId_exteriorOrientationFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_ExternalOrientation = 1;
#endif
            strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_customHrtfFile:
@@ -2761,12 +2749,10 @@ static CmdlnArgs parseCmdlnArgs(
        exit( -1 ); /* Error printout handled by failing function */
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        args.Opt_Headrotation = 1;
    }
#endif

    return args;
}
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */

#define FIX_POINT_ROM_CONST                             /* Ora: issue #1150 HRTF ROM tables should be defined as 'const'*/
#define FIX_1135_EXT_RENDERER_HANDLES                   /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */
#define FIX_1158_FASTCONV_REVERB_HRTF                   /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */
#define FIX_1166_TDREND_DIV0                            /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */
#define FIX_835_PARAMMC_BUFFER_VALUES                   /* FhG: BASOP issue 835: wide range of buffer values for cx in ParamMC */
+0 −7
Original line number Diff line number Diff line
@@ -510,13 +510,6 @@ ivas_error IVAS_DEC_Configure(
        hDecoderConfig->render_framesize = renderFramesize;
    }

#ifndef FIX_1135_EXT_RENDERER_HANDLES
    if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        hDecoderConfig->Opt_Headrotation = TRUE;
    }

#endif
    /* Set decoder parameters to initial values */
    if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK )
    {
+0 −139
Original line number Diff line number Diff line
@@ -204,11 +204,7 @@ struct IVAS_REND
    AUDIO_CONFIG outputConfig;
    EFAP_WRAPPER efapOutWrapper;
    IVAS_LSSETUP_CUSTOM_STRUCT customLsOut;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    SPLIT_REND_WRAPPER *splitRendWrapper;
#else
    SPLIT_REND_WRAPPER splitRendWrapper;
#endif
    IVAS_REND_AudioBuffer splitRendEncBuffer;

    IVAS_REND_HeadRotData headRotData;
@@ -1112,11 +1108,7 @@ static ivas_error initHeadRotation(
static void closeHeadRotation(
    IVAS_REND_HANDLE hIvasRend )
{
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( hIvasRend != NULL && hIvasRend->headRotData.headRotEnabled && hIvasRend->headRotData.hOrientationTracker != NULL )
#else
    if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) )
#endif
    {
        free( hIvasRend->headRotData.hOrientationTracker );
    }
@@ -1225,11 +1217,7 @@ static rendering_context getRendCtx(
    ctx.pHeadRotData = &hIvasRend->headRotData;
    ctx.hhRendererConfig = &hIvasRend->hRendererConfig;
    ctx.pSplitRendBFI = &hIvasRend->splitRendBFI;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ctx.pSplitRendWrapper = hIvasRend->splitRendWrapper;
#else
    ctx.pSplitRendWrapper = &hIvasRend->splitRendWrapper;
#endif
    ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData;

    return ctx;
@@ -1275,11 +1263,7 @@ static ivas_error initIsmMasaRendering(
        ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd );
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    ivas_reverb_close( &inputIsm->hReverb );

@@ -1383,11 +1367,7 @@ static ivas_error setRendInputActiveIsm(
        }
        else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
        {
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -1410,11 +1390,7 @@ static void clearInputIsm(
    initRendInputBase( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );

    /* Free input's internal handles */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    ivas_reverb_close( &inputIsm->hReverb );

@@ -2112,11 +2088,7 @@ static ivas_error initMcBinauralRendering(
    /* if we need to use TD renderer and CREND was open, close it */
    if ( useTDRend )
    {
#ifdef FIX_1135_EXT_RENDERER_HANDLES
        ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
        ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif
    }

    if ( !reconfigureFlag || ( !useTDRend && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb != NULL ) )
@@ -2208,11 +2180,7 @@ static ivas_error initMcMasaRendering(
        ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd );
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    ivas_reverb_close( &inputMc->hReverb );

@@ -2397,11 +2365,7 @@ static void clearInputMc(
        efap_free_data( &inputMc->efapInWrapper.hEfap );
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    ivas_reverb_close( &inputMc->hReverb );

@@ -2574,11 +2538,7 @@ static ivas_error updateSbaPanGains(
                    }
                    else
                    {
#ifdef FIX_1135_EXT_RENDERER_HANDLES
                        if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK )
#else
                        if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
                        {
                            return error;
                        }
@@ -2590,11 +2550,7 @@ static ivas_error updateSbaPanGains(
                        return error;
                    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
                    if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK )
#endif
                    {
                        return error;
                    }
@@ -2626,11 +2582,7 @@ static ivas_error initSbaMasaRendering(
{
    ivas_error error;

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper != NULL ? inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    if ( ( error = ivas_dirac_ana_open( &inputSba->hDirAC, inSampleRate ) ) != IVAS_ERR_OK )
    {
@@ -2708,11 +2660,7 @@ static void clearInputSba(
    initRendInputBase( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 );

    /* Free input's internal handles */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 );
#else
    ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses );
#endif

    if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL )
    {
@@ -2810,10 +2758,8 @@ ivas_error IVAS_REND_Open(
    const bool asHrtfBinary,           /* i  : load hrtf binary file                               */
    const int16_t nonDiegeticPan,      /* i  : non-diegetic object flag                            */
    const float nonDiegeticPanGain,    /* i  : non-diegetic panning gain                           */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    const int16_t Opt_Headrotation,        /* i  : indicates whether head-rotation is used             */
    const int16_t Opt_ExternalOrientation, /* i  : indicates whether external orientations are used    */
#endif
    const int16_t num_subframes /* i  : number of subframes                                 */
)
{
@@ -2869,46 +2815,34 @@ ivas_error IVAS_REND_Open(
    }

    /* Initialize headrotation data */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    hIvasRend->headRotData.headRotEnabled = 0;
    if ( Opt_Headrotation )
    {
#endif
        if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    }
#endif

    /* Initialize external orientation data */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    hIvasRend->hExternalOrientationData = NULL;
    if ( Opt_ExternalOrientation )
    {
#endif
        if ( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    }
#endif

    /* Initilize combined orientation data */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    hIvasRend->hCombinedOrientationData = NULL;
    if ( Opt_Headrotation || Opt_ExternalOrientation )
    {
#endif
        if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    }
#endif

    /* Initialize EFAP */
    if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK )
@@ -2918,7 +2852,6 @@ ivas_error IVAS_REND_Open(

    /* Initialize inputs */

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    hIvasRend->splitRendWrapper = NULL;
    if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
@@ -2929,9 +2862,6 @@ ivas_error IVAS_REND_Open(

        isar_init_split_rend_handles( hIvasRend->splitRendWrapper );
    }
#else
    isar_init_split_rend_handles( &hIvasRend->splitRendWrapper );
#endif
    hIvasRend->splitRendEncBuffer.data = NULL;

    for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
@@ -3023,17 +2953,13 @@ ivas_error IVAS_REND_Open(
        }
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
#endif
        if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    }
#endif

    return IVAS_ERR_OK;
}
@@ -3546,11 +3472,7 @@ ivas_error IVAS_REND_AddInput(
        int16_t cldfb_in_flag;
        cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
        if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -3968,11 +3890,7 @@ ivas_error IVAS_REND_GetDelay(
    {
        if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID )
        {
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            if ( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL )
#else
            if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL )
#endif
            {
                if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
                {
@@ -4474,22 +4392,14 @@ ivas_error IVAS_REND_FeedRenderConfig(
    {
        int16_t cldfb_in_flag;
        cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
        if ( hIvasRend->splitRendWrapper != NULL )
        {
            ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );
            free( hIvasRend->splitRendWrapper );
            hIvasRend->splitRendWrapper = NULL;
        }
#else
        ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );
#endif

#ifdef FIX_1135_EXT_RENDERER_HANDLES
        if ( ( error = ivas_pre_rend_init( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -4646,12 +4556,10 @@ ivas_error IVAS_REND_SetOrientationTrackingMode(
    const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i  : Head orientation tracking type */
)
{
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( hIvasRend->headRotData.headRotEnabled == 0 )
    {
        return IVAS_ERR_OK;
    }
#endif

    return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking );
}
@@ -5285,11 +5193,7 @@ static ivas_error renderIsmToBinauralRoom(

    hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData;
    combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( *hCombinedOrientationData != NULL )
#else
    if ( hCombinedOrientationData != NULL )
#endif
    {
        for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
        {
@@ -5903,11 +5807,7 @@ static ivas_error renderMcToBinaural(

    hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData;
    combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( *hCombinedOrientationData != NULL )
#else
    if ( hCombinedOrientationData != NULL )
#endif
    {
        for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
        {
@@ -5996,11 +5896,7 @@ static ivas_error renderMcToBinauralRoom(

    hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData;
    combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( *hCombinedOrientationData != NULL )
#else
    if ( hCombinedOrientationData != NULL )
#endif
    {
        for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
        {
@@ -6091,11 +5987,7 @@ static ivas_error renderMcCustomLsToBinauralRoom(

    hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData;
    combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( *hCombinedOrientationData != NULL )
#else
    if ( hCombinedOrientationData != NULL )
#endif
    {
        for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
        {
@@ -6701,11 +6593,7 @@ static ivas_error renderSbaToBinaural(

        hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData;
        combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
        if ( *hCombinedOrientationData != NULL )
#else
        if ( hCombinedOrientationData != NULL )
#endif
        {
            for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
            {
@@ -6782,11 +6670,7 @@ static ivas_error renderSbaToBinauralRoom(

    hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData;
    combinedOrientationEnabled = 0;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( *hCombinedOrientationData != NULL )
#else
    if ( hCombinedOrientationData != NULL )
#endif
    {
        for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ )
        {
@@ -7527,19 +7411,10 @@ static ivas_error getSamplesInternal(
         ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
    {
        int16_t num_poses_orig;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
        num_poses_orig = hIvasRend->splitRendWrapper->multiBinPoseData.num_poses;
#else
        num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses;
#endif
        outAudio = hIvasRend->splitRendEncBuffer;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
        ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper->multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis );
        assert( num_poses_orig == hIvasRend->splitRendWrapper->multiBinPoseData.num_poses && "number of poses should not change dynamically" );
#else
        ISAR_PRE_REND_GetMultiBinPoseData( &hIvasRend->hRendererConfig->split_rend_config, &hIvasRend->splitRendWrapper.multiBinPoseData, hIvasRend->headRotData.sr_pose_pred_axis );
        assert( num_poses_orig == hIvasRend->splitRendWrapper.multiBinPoseData.num_poses && "number of poses should not change dynamically" );
#endif

        /* Clear output buffer for split rendering bitstream */
        set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel );
@@ -7604,11 +7479,7 @@ static ivas_error getSamplesInternal(
            }
        }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
        if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper,
#else
        if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hIvasRend->splitRendWrapper,
#endif
                                                              hIvasRend->headRotData.headPositions[0],
                                                              hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate,
                                                              hIvasRend->hRendererConfig->split_rend_config.codec,
@@ -7780,16 +7651,12 @@ void IVAS_REND_Close(
    ivas_limiter_close( &hIvasRend->hLimiter );

    /* Split binaural rendering */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( hIvasRend->splitRendWrapper != NULL )
    {
        ISAR_PRE_REND_close( hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );
        free( hIvasRend->splitRendWrapper );
        hIvasRend->splitRendWrapper = NULL;
    }
#else
    ISAR_PRE_REND_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );
#endif

    closeHeadRotation( hIvasRend );

@@ -8437,9 +8304,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init(
    int32_t output_Fs;
    RENDERER_TYPE renderer_type;
    int16_t j, k, bin;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    int16_t num_poses;
#endif
    float binCenterFreq, tmpFloat;
    ivas_error error;
    float frequency_axis[CLDFB_NO_CHANNELS_MAX];
@@ -8454,7 +8319,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init(
    nBins = inputMasa->hMasaExtRend->hSpatParamRendCom->num_freq_bands;
    renderer_type = inputMasa->hMasaExtRend->renderer_type;

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    num_poses = 1;
    if ( inputMasa->base.ctx.pSplitRendWrapper != NULL )
    {
@@ -8462,9 +8326,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init(
    }

    for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
#else
    for ( pos_idx = 0; pos_idx < inputMasa->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; pos_idx++ )
#endif
    {
        hDiracDecBin = inputMasa->hMasaExtRend->hDiracDecBin[pos_idx];

+0 −2
Original line number Diff line number Diff line
@@ -113,10 +113,8 @@ ivas_error IVAS_REND_Open(
    const bool asHrtfBinary,                         /* i  : load hrtf binary file                               */
    const int16_t nonDiegeticPan,                    /* i  : non-diegetic object flag                            */
    const float nonDiegeticPanGain,                  /* i  : non-diegetic panning gain                           */
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    const int16_t Opt_Headrotation,                  /* i  : indicates whether head-rotation is used             */
    const int16_t Opt_ExternalOrientation,           /* i  : indicates whether external orientations are used    */
#endif
    const int16_t num_subframes                      /* i  : number of subframes                                 */
);