Commit c0fa3972 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept FIX_1319_STACK_SBA_DECODER

parent cc5a7487
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -2309,13 +2309,8 @@ void ivas_dirac_dec_render_sf_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                      */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output  */
    const Word16 nchan_transport,                               /* i  : number of transport channels                */
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]
#else
    Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] 
#endif
);

void ivas_dirac_dec_render_fx(
+0 −1
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@
#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define NONBE_1302_FIX_OMASA_JBM_FLUSH                  /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */
#define FIX_1319_STACK_SBA_DECODER                      /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */
#define FIX_1377_HANDLE_ERROR_CODE                      /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */
+0 −72
Original line number Diff line number Diff line
@@ -2152,7 +2152,6 @@ void ivas_dirac_dec_render_fx(
/* clang-format on */


#ifdef FIX_1319_STACK_SBA_DECODER
/*-------------------------------------------------------------------------
 * Local functions to perform binaural rendering with optimized stack
 *------------------------------------------------------------------------*/
@@ -2243,7 +2242,6 @@ static void binRenderer_fx(

    return;
}
#endif


/*-------------------------------------------------------------------------
@@ -2256,13 +2254,8 @@ void ivas_dirac_dec_render_sf_fx(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder structure                                  */
    Word32 *output_buf_fx[],      /* i/o: synthesized core-coder transport channels/DirAC output  Q(6-1)*/
    const Word16 nchan_transport, /* i  : number of transport channels                            */
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]
#else
    Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], /*Q6*/
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX]  /*Q6*/
#endif
)
{
    Word16 i, ch, idx_in, idx_lfe;
@@ -2274,17 +2267,10 @@ void ivas_dirac_dec_render_sf_fx(
    Word16 slot_idx_start, slot_idx_start_cldfb_synth, md_idx;

    /*CLDFB: last output channels reserved to LFT for CICPx*/
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_RealBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
#else
    Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#endif
    Word16 index = 0, num_freq_bands = 0;
    move16();
    move16();
@@ -2301,10 +2287,6 @@ void ivas_dirac_dec_render_sf_fx(
    Word16 surCohRatio_q_fx = 0, temp_q = 0;
    move16();
    move16();
#ifndef FIX_1319_STACK_SBA_DECODER
    Word32 Cldfb_RealBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
#endif
#ifndef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES
    Word16 cldfb_buf_q;
#endif
@@ -2799,19 +2781,11 @@ void ivas_dirac_dec_render_sf_fx(
            {
                q_temp_cldfb = Q11;
                move16();
#ifdef FIX_1319_STACK_SBA_DECODER
                cldfbAnalysis_ts_fx_fixed_q( &( st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ),
                                             Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */
                                             Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */
                                             hSpatParamRendCom->num_freq_bands,
                                             st_ivas->cldfbAnaDec[ch], &q_temp_cldfb );
#else
                cldfbAnalysis_ts_fx_fixed_q( &st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][offset],
                                             Cldfb_RealBuffer_Temp_fx[ch][slot_idx],
                                             Cldfb_ImagBuffer_Temp_fx[ch][slot_idx],
                                             hSpatParamRendCom->num_freq_bands,
                                             st_ivas->cldfbAnaDec[ch], &q_temp_cldfb );
#endif
            }
            q_cldfb = q_temp_cldfb;
            move16();
@@ -2819,14 +2793,10 @@ void ivas_dirac_dec_render_sf_fx(

        IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) )
        {
#ifdef FIX_1319_STACK_SBA_DECODER
#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES
            ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &q_cldfb, hSpatParamRendCom->num_freq_bands, subframe_idx );
#else
            ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx );
#endif
#else
            ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx );
#endif
        }
    }
@@ -2860,13 +2830,8 @@ void ivas_dirac_dec_render_sf_fx(
        {
            FOR( ch = 0; ch < nchan_transport; ch++ )
            {
#ifdef FIX_1319_STACK_SBA_DECODER
                Copy32( Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands );
                Copy32( Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands );
#else
                Copy32( Cldfb_RealBuffer_Temp_fx[ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands );
                Copy32( Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands );
#endif
            }
        }
        ELSE
@@ -3840,7 +3805,6 @@ void ivas_dirac_dec_render_sf_fx(
        }

        /* Perform binaural rendering, output in Q6 format */
#ifdef FIX_1319_STACK_SBA_DECODER
        test();
        IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
@@ -3870,45 +3834,14 @@ void ivas_dirac_dec_render_sf_fx(
            binRenderer_fx( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx],
                            Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx );
        }
#else
        IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
            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++ )
                    {
                        Copy32( Cldfb_RealBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands );
                        Copy32( Cldfb_ImagBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands );
                    }
                }
                st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config;
                move16();
            }
        }

        /*Binaural output in Q6 format*/
        ivas_binRenderer_fx( st_ivas->hBinRenderer,
                             ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData,
                             st_ivas->hCombinedOrientationData,
                             hSpatParamRendCom->subframe_nbslots[subframe_idx],
                             Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx,
                             Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q );
#endif

        /* Inverse CLDFB*/
        FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ )
        {
            /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */
            Word32 *synth_fx = &output_buf_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands];
#ifdef FIX_1319_STACK_SBA_DECODER
            Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME];
            Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME];
#else
            Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
            Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
#endif
            FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ )
            {
                RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i];
@@ -3954,13 +3887,8 @@ void ivas_dirac_dec_render_sf_fx(
    }
    ELSE
    {
#ifdef FIX_1319_STACK_SBA_DECODER
        Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME];
        Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME];
#else
        Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
        Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
#endif
        Word16 outchannels;

        idx_in = 0;
+0 −18
Original line number Diff line number Diff line
@@ -1683,25 +1683,15 @@ void ivas_spar_dec_upmixer_sf_fx(
)
{
    Word16 cldfb_band, num_cldfb_bands, numch_in, numch_out;
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *cldfb_in_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX];
    Word32 *cldfb_in_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX];
#else
    Word32 *cldfb_in_ts_re_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX];
    Word32 *cldfb_in_ts_im_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX];
#endif
    Word16 i, b, ts, out_ch, in_ch;
    Word16 num_spar_bands, spar_band, nchan_transport;
    Word16 num_in_ingest, split_band;
    Word16 slot_size, slot_idx_start;
    Word16 md_idx;
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *p_tc_fx[HOA3_CHANNELS];
    Word32 Pcm_tmp_fx[HOA3_CHANNELS][2 /* Re, Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES];
#else
    Word32 *p_tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS];
    Word32 Pcm_tmp_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k];
#endif
    Word16 numch_out_dirac;
    Word32 mixer_mat_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS];
    Word16 b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH];
@@ -1793,21 +1783,13 @@ void ivas_spar_dec_upmixer_sf_fx(
     * Prepare CLDFB buffers
     *---------------------------------------------------------------------*/

#ifdef FIX_1319_STACK_SBA_DECODER
    set_zero_fx( &Pcm_tmp_fx[0][0], HOA3_CHANNELS * 2 * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES );
#else
    set_zero_fx( &Pcm_tmp_fx[0][0], ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) * L_FRAME48k );
#endif

    /* set-up pointers */
    IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) )
    {
        /* at this point, output channels are used as intermediate procesing buffers */
#ifdef FIX_1319_STACK_SBA_DECODER
        FOR( in_ch = 0; in_ch < HOA3_CHANNELS; in_ch++ )
#else
        FOR( in_ch = 0; in_ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; in_ch++ )
#endif
        {
            FOR( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ )
            {