Commit 3e524c66 authored by vaclav's avatar vaclav
Browse files

port MR

parent ad827404
Loading
Loading
Loading
Loading
+140 −142
Original line number Diff line number Diff line
@@ -2175,7 +2175,8 @@ ivas_error only_reduce_bits_direction_fx(
    Word16 reduce_bits,
    const Word16 coding_subbands,
    const Word16 no_subframes,
    Word16 *ind_order );
    Word16 *ind_order 
);

void ivas_qmetadata_azimuth_elevation_to_direction_vector_fx(
    const Word32 az, /* i  : azimuth                            Q22     */
@@ -2289,7 +2290,6 @@ void stereo_dtf_cng_fx(
    Word16 q_dft                                                /* i  : Q factor of the DFT data                    */
);


void ivas_spar_update_md_hist_fx(
    ivas_spar_md_dec_state_t *hMdDec                            /* i/o: SPAR MD decoder handle                      */
);
@@ -2317,8 +2317,14 @@ 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] );
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] 
#endif
);

void ivas_dirac_dec_render_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                         */
@@ -2452,7 +2458,8 @@ ivas_error PsychoacousticParameters_Init_fx(
    const Word8 nBands,                                         /* i  : Number of spectrum subbands                                     */
    const Word16 isTCX20,                                       /* i  : Flag indicating if the subband division is for TCX20 or TCX10   */
    const Word16 isWarped,                                      /* i  : Flag indicating if the scale is linear or warped                */
    PsychoacousticParameters *pPsychParams );
    PsychoacousticParameters *pPsychParams 
);

ivas_error ivas_FB_mixer_open_fx(
    IVAS_FB_MIXER_HANDLE *hFbMixer_out,                         /* i/o: FB mixer handle                             */
@@ -2479,7 +2486,8 @@ void ivas_fb_mixer_cross_fading_fx(
    Word32 *pMdft_out_new_fx,
    const Word16 ch,
    const Word16 frame_len,
    const Word16 cf_offset );
    const Word16 cf_offset 
);

// ivas_omasa_dec.c
ivas_error ivas_omasa_dirac_td_binaural_jbm_fx(
@@ -2511,13 +2519,15 @@ Word16 ivas_sba_spar_sid_bitlen_fx(
void ivas_sba_get_spar_hoa_ch_ind_fx(
    const Word16 num_md_chs,       /* i  : number of MD channels       */
    const Word32 ivas_total_brate, /* i  : IVAS total bitrate           */
    Word16 HOA_md_ind[IVAS_SPAR_MAX_CH] );
    Word16 HOA_md_ind[IVAS_SPAR_MAX_CH] 
);

void ivas_sba_get_spar_hoa_md_flag_fx(
    const Word16 sba_order,        /* i  : Ambisonic (SBA) order        */
    const Word32 ivas_total_brate, /* i  : IVAS total bitrate           */
    Word16 *spar_hoa_md_flag,
    Word16 *spar_hoa_dirac2spar_md_flag );
    Word16 *spar_hoa_dirac2spar_md_flag 
);

void ivas_omasa_dirac_rend_jbm_fx(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder handle                      */
@@ -2654,28 +2664,15 @@ Word16 getNumChanAnalysis_fx(
    Encoder_Struct *st_ivas /* i  : IVAS encoder structure              */
);


/*----------------------------------------------------------------------------------*
 * Limiter prototypes
 *----------------------------------------------------------------------------------*/


ivas_error ivas_limiter_open(
    IVAS_LIMITER_HANDLE *hLimiter_out, /* o  : limiter struct handle                   */
    const int16_t num_channels,        /* i  : number of I/O channels                  */
    const int32_t sampling_rate        /* i  : sampling rate for processing            */
);

void ivas_limiter_close(
    IVAS_LIMITER_HANDLE *phLimiter /* i/o: pointer to limiter handle, can be NULL  */
);

void ivas_limiter_dec(
    IVAS_LIMITER_HANDLE hLimiter,       /* i/o: limiter struct handle                                           */
    float *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer                                             */
    const int16_t num_channels,         /* i  : number of channels to be processed                              */
    const int16_t output_frame,         /* i  : number of samples per channel in the buffer                     */
    const int16_t BER_detect            /* i  : BER detect flag                                                 */
);
void ivas_limiter_dec_fx(
    IVAS_LIMITER_HANDLE hLimiter,        /* i/o: limiter struct handle                                           */
    Word32 *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer                                             */
@@ -2684,13 +2681,7 @@ void ivas_limiter_dec_fx(
    const Word16 BER_detect,             /* i  : BER detect flag                                                 */
    Word16 q_factor                      /* i  : Q factor of the output samples                                  */
);
void limiter_process(
    IVAS_LIMITER_HANDLE hLimiter,  /* i/o: limiter struct handle                                           */
    const int16_t output_frame,    /* i  : number of samples to be processed per channel in the I/O buffer */
    const float threshold,         /* i  : signal amplitude above which limiting starts to be applied      */
    const int16_t BER_detect,      /* i  : BER detect flag                                                 */
    int16_t *strong_saturation_cnt /* i/o: counter of strong saturations (can be NULL)                     */
);

void limiter_process_fx(
    IVAS_LIMITER_HANDLE hLimiter,  /* i/o: limiter struct handle                                              */
    const Word16 output_frame,     /* i  : number of samples to be processed per channel in the I/O buffer    */
@@ -2739,13 +2730,15 @@ void ivas_lfe_lpf_enc_apply_fx(
// ivas_arith.c
void ivas_ari_done_encoding_14bits_fx(
    BSTR_ENC_HANDLE hBstr,
    Tastat *s );
    Tastat *s 
);

void ivas_ari_encode_14bits_ext_fx(
    BSTR_ENC_HANDLE hBstr,
    Tastat *s,
    Word32 symbol,
    const UWord16 *cum_freq );
    const UWord16 *cum_freq 
);

void ms_inv_mask_processing_fx(
    STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT encoder structure                  */
@@ -2856,6 +2849,7 @@ void ivas_spar_bitrate_dist_fx(
    const Word16 sba_order,        /* i  : Ambisonic (SBA) order                   */
    const Word16 bwidth            /* i  : audio bandwidth                         */
);

ivas_error ivas_corecoder_enc_reconfig_fx(
    Encoder_Struct *st_ivas,          /* i/o: IVAS encoder structure                */
    const Word16 nSCE_old,            /* i  : number of SCEs in previous frame      */
@@ -2872,6 +2866,7 @@ void ivas_sba_zero_vert_comp_fx(
    const Word16 sba_planar, /* i  : SBA planar flag             */
    const Word16 input_frame /* i  : frame length                */
);

void tdm_configure_dec_fx(
    const Word16 ivas_format,     /* i  : IVAS format                     */
    const Word16 ism_mode,        /* i  : ISM mode in combined format     */
@@ -2894,6 +2889,7 @@ Word16 mdct_classifier_ivas_fx(
    const Word32 brate         /* i  : current brate, IVAS: nominal bitrate, EVS: st->total_brate */
);


/*----------------------------------------------------------------------------------*
 * Range Coder prototypes
 *----------------------------------------------------------------------------------*/
@@ -6413,7 +6409,6 @@ void tdm_bit_alloc(
    const Word16 tdm_inst_ratio_idx                            /* i  : instantaneous correlation ratio index   */
);


/*! r: value of the indice */
uint16_t get_indice_st(
    Decoder_State *st,                                          /* i/o: decoder state structure                 */
@@ -6422,6 +6417,7 @@ uint16_t get_indice_st(
    const Word16 nb_bits                                        /* i  : number of bits to quantize the indice   */
);


/*----------------------------------------------------------------------------------*
 * MDCT Stereo prototypes
 *----------------------------------------------------------------------------------*/
@@ -6442,9 +6438,11 @@ Word16 write_stereo_to_bitstream_fx
    BSTR_ENC_HANDLE hBstr                                       /* i/o: bitstream handle                        */
);


/*----------------------------------------------------------------------------------*
 * Stereo CNG prototypes
 *----------------------------------------------------------------------------------*/

void stereo_cng_dec_update(
    CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure                   */
    const Word32 ivas_total_brate                               /* i  : IVAS total bitrate                    Q0*/
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#define NONBE_1293_SR_HRTF                              /* VA: issue 1293: add support of external HRTFs in split rendering */
#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */
#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */
#define FIX_1319_STACK_SBA_DECODER                      /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */

/* #################### End BASOP porting switches ############################ */

+152 −14
Original line number Diff line number Diff line
@@ -2146,6 +2146,8 @@ void ivas_dirac_dec_set_md_map_fx(

    return;
}


/*-------------------------------------------------------------------------
 * ivas_dirac_dec_render_fx()
 *
@@ -2222,8 +2224,11 @@ void ivas_dirac_dec_render_fx(
        }
    }

    IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ){
        IF( EQ_16( st_ivas->hDirAC->hConfig->dec_param_estim, 1 ) ){
    /* clang-format off */
    IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) )
    {
        IF( EQ_16( st_ivas->hDirAC->hConfig->dec_param_estim, 1 ) )
        {
            temp = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_CLDFB_TIMESLOTS );
            hSpatParamRendCom->dirac_read_idx = sub( temp, i_mult( idiv1616( temp, hSpatParamRendCom->dirac_md_buffer_length ), hSpatParamRendCom->dirac_md_buffer_length ) ); // Q0
        }
@@ -2239,6 +2244,85 @@ move16();

    return;
}
/* clang-format on */


#ifdef FIX_1319_STACK_SBA_DECODER
/*-------------------------------------------------------------------------
 * Local functions to perform binaural rendering with optimized stack
 *------------------------------------------------------------------------*/

static void binRenderer_split_fx(
    BINAURAL_RENDERER_HANDLE hBinRenderer,                                                                     /* i/o: binaural renderer handle                      */
    ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend,                                                          /* i/o: ISAR split binaural rendering handle          */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,                                                      /* i  : combined head and external orientation handle */
    const Word16 numTimeSlots,                                                                                 /* i  : number of time slots to render                */
    Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals                      */
    Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals                      */
    Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
    Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
    const Word16 slot_idx_start,
    const Word16 num_freq_bands,
    const Word16 nchan_out,
    Word16 *input_q )
{
    Word16 pos_idx, slot_idx, ch;
    Word32 Cldfb_RealBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX];

    /* Perform binaural rendering */
    ivas_binRenderer_fx( hBinRenderer, &hSplitBinRend->splitrend.multiBinPoseData, hCombinedOrientationData, numTimeSlots,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
                         NULL,
#endif
                         Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer, ImagBuffer, input_q );

    FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ )
    {
        FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            Copy32( Cldfb_RealBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_RealBuffer_Binaural[0][ch][slot_idx], num_freq_bands );
            Copy32( Cldfb_ImagBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_ImagBuffer_Binaural[0][ch][slot_idx], num_freq_bands );
        }
    }

    FOR( pos_idx = 0; pos_idx < hBinRenderer->numPoses; pos_idx++ )
    {
        FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ )
        {
            FOR( ch = 0; ch < nchan_out; ch++ )
            {
                Copy32( Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands );
                Copy32( Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands );
            }
        }
    }

    return;
}


static void binRenderer_fx(
    BINAURAL_RENDERER_HANDLE hBinRenderer,                                                                     /* i/o: binaural renderer handle                      */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,                                                      /* i  : combined head and external orientation handle */
    const Word16 numTimeSlots,                                                                                 /* i  : number of time slots to render                */
    Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals                      */
    Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals                      */
    Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
    Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                                   /* i  : LS signals                                    */
    Word16 *input_q )
{
    /* Perform binaural rendering */
    ivas_binRenderer_fx( hBinRenderer, NULL, hCombinedOrientationData, numTimeSlots,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
                         NULL,
#endif
                         Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, input_q );

    return;
}
#endif


/*-------------------------------------------------------------------------
 * ivas_dirac_dec_render_sf_fx()
@@ -2250,8 +2334,13 @@ 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;
@@ -2263,10 +2352,17 @@ 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();
@@ -2283,8 +2379,10 @@ 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
    Word16 cldfb_buf_q;
    Word16 offset = 0, buff_len = 0;
    move16();
@@ -2779,11 +2877,19 @@ 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();
@@ -2792,7 +2898,11 @@ void ivas_dirac_dec_render_sf_fx(
        test();
        IF( ( NE_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && NE_16( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) ) )
        {
#ifdef FIX_1319_STACK_SBA_DECODER
            ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx );
#else
            ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx );
#endif
        }
    }

@@ -2825,8 +2935,13 @@ 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
@@ -3874,7 +3989,19 @@ void ivas_dirac_dec_render_sf_fx(
        Word16 input_q;
        input_q = Q6;
        move16();

#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 ) )
        {
            binRenderer_split_fx( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx],
                                  Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out, &input_q );
        }
        ELSE
        {
            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, &input_q );
        }
#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 )
@@ -3899,6 +4026,7 @@ void ivas_dirac_dec_render_sf_fx(
                             hSpatParamRendCom->subframe_nbslots[subframe_idx],
                             Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx,
                             Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q );
#endif

        Word16 pos_idx;
        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 ) )
@@ -3921,8 +4049,13 @@ void ivas_dirac_dec_render_sf_fx(
        {
            /* 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];
@@ -3968,8 +4101,13 @@ 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;
+14 −0
Original line number Diff line number Diff line
@@ -1703,15 +1703,25 @@ 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];
@@ -1805,7 +1815,11 @@ void ivas_spar_dec_upmixer_sf_fx(
    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++ )
            {