Commit abade70c authored by Vidhya V P's avatar Vidhya V P
Browse files

Replacing the subswitches of split renderer with the parent switch

parent a516e3ec
Loading
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -150,12 +150,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

/*#define SPLIT_REND_WITH_HEAD_ROT*/                    /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN               /* Nokia: Issue 623: Split rendering support for parambin renderer */
#define FIX_658_SPLIT_REND_MASA                         /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/
#define OSBA_SPLIT_RENDERING
#define FIX_712_713_SPLIT_REND_MASA_MC                 /*Dlb : Fix for issue 712 and 713*/
#endif

#define FIX_818_DOUBLE_PREC_KERNEN_SW                   /* FhG: Issue 818: Avoid double precision in kernel switching */

+9 −9
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ ivas_error ivas_dirac_dec_config(

    if ( !need_parambin )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
        ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin );
#else
        ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );
@@ -865,7 +865,7 @@ ivas_error ivas_dirac_dec_config(
                }
            }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( st_ivas->hDiracDecBin[0] == NULL )
#else
            if ( st_ivas->hDiracDecBin == NULL )
@@ -879,20 +879,20 @@ ivas_error ivas_dirac_dec_config(
            else
            {
                /* This is required to keep BE in rate switching. This probably means that 1TC and 2TC MASA perform differently. */
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params != NULL && !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nSCE > 0 ) )
#else
                if ( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params != NULL && !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nSCE > 0 ) )
#endif
                {
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    ivas_dirac_dec_decorr_close( &st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params, &st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state );
#else
                    ivas_dirac_dec_decorr_close( &st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params, &st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state );
#endif
                }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK )
@@ -901,7 +901,7 @@ ivas_error ivas_dirac_dec_config(
                    return error;
                }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#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++ )
                {
@@ -914,7 +914,7 @@ ivas_error ivas_dirac_dec_config(
#endif

                {
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    if ( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params == NULL )
#else
                    if ( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params == NULL )
@@ -924,7 +924,7 @@ ivas_error ivas_dirac_dec_config(

                        ivas_dirac_dec_get_frequency_axis( frequency_axis, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSpatParamRendCom->num_freq_bands );

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                        if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin[0]->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS,
#else
                        if ( ( error = ivas_dirac_dec_decorr_open( &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_params ), &( st_ivas->hDiracDecBin->h_freq_domain_decorr_ap_state ), st_ivas->hSpatParamRendCom->num_freq_bands, BINAURAL_CHANNELS, BINAURAL_CHANNELS,
@@ -936,7 +936,7 @@ ivas_error ivas_dirac_dec_config(
                    }
                }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
                for ( int16_t pos_idx = 0; pos_idx < st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; pos_idx++ )
                {
                    st_ivas->hDiracDecBin[pos_idx]->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate );
+13 −13
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
    ivas_error error;
    int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag;
    SPLIT_REND_WRAPPER *hSplitRendWrapper;
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
    CLDFB_TYPE cldfbMode;
#endif

@@ -93,7 +93,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
    ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis );

    isCldfbNeeded = 0;
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
    cldfbMode = CLDFB_ANALYSIS;
#else
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
@@ -107,21 +107,21 @@ static ivas_error ivas_dec_reconfig_split_rend(
        if ( cldfb_in_flag == 0 )
        {
            isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
            cldfbMode = CLDFB_ANALYSIS;
#endif
        }
        else if ( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
            cldfbMode = CLDFB_SYNTHESIS;
#endif
        }
        else if ( pcm_out_flag && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
            cldfbMode = CLDFB_SYNTHESIS;
#endif
        }
@@ -144,7 +144,7 @@ static ivas_error ivas_dec_reconfig_split_rend(

        for ( ch = 0; ch < num_ch; ch++ )
        {
#ifndef OSBA_SPLIT_RENDERING
#ifndef SPLIT_REND_WITH_HEAD_ROT
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), cldfbMode, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
#else
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
@@ -155,7 +155,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
            }
        }

#ifdef OSBA_SPLIT_RENDERING
#ifdef SPLIT_REND_WITH_HEAD_ROT
        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 )
@@ -177,7 +177,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
            }
        }

#ifdef OSBA_SPLIT_RENDERING
#ifdef SPLIT_REND_WITH_HEAD_ROT
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            if ( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] != NULL )
@@ -192,7 +192,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
        hSplitRendWrapper->hCldfbHandles = NULL;
    }

#ifdef OSBA_SPLIT_RENDERING
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) &&
         ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) )
#else
@@ -252,7 +252,7 @@ static ivas_error ivas_dec_init_split_rend(
        return error;
    }

#ifdef OSBA_SPLIT_RENDERING
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
    {
        cldfb_in_flag = 0;
@@ -2461,7 +2461,7 @@ void ivas_initialize_handles_dec(

    /* rendering handles */
    st_ivas->hBinRenderer = NULL;
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
    for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ )
    {
        st_ivas->hDiracDecBin[i] = NULL;
@@ -2655,7 +2655,7 @@ void ivas_destroy_dec(
#endif

    /* Parametric binaural renderer handle */
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
    ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin );
#else
    ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );
@@ -2818,7 +2818,7 @@ void ivas_init_dec_get_num_cldfb_instances(
                    *numCldfbAnalyses = st_ivas->nchan_transport + 1;
                }
            }
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( st_ivas->hDiracDecBin[0]->useTdDecorr )
#else
            if ( st_ivas->hDiracDecBin->useTdDecorr )
+2 −2
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        )
        {
            /* close the parametric binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
            ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin );
#else
            ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );
@@ -223,7 +223,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
        if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
        {
            /* close the parametric binaural renderer */
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
            ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin );
#else
            ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin );
+3 −3
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ static ivas_error ivas_param_ism_rendering_init(
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) );
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
#else
    if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
@@ -545,7 +545,7 @@ ivas_error ivas_param_ism_dec_open(
        }
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ||
            output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
#else
@@ -568,7 +568,7 @@ ivas_error ivas_param_ism_dec_open(
    hSpatParamRendCom->dirac_bs_md_write_idx = 0;
    hSpatParamRendCom->dirac_read_idx = 0;

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
    if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
Loading