Commit 57b3a061 authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch '2052-basop-PortMr2088-from-float-leftovers-after-nonbe_unified_decoding_paths' into 'main'

Port MR2088 from float to BASOP - Leftovers after NONBE_UNIFIED_DECODING_PATHS

Closes #2052

See merge request !2287
parents 0f050e87 77a632a2
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -195,7 +195,11 @@ typedef enum
#define MAX_JBM_L_FRAME48k                      1920
#define MAX_JBM_L_FRAME_NS                      40000000L
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
#define MAX_CLDFB_DIGEST_CHANNELS               3                           /* == maximum of ParamISM TCs and ParamMC TCs */
#else
#define MAX_CLDFB_DIGEST_CHANNELS               (FOA_CHANNELS + MAX_NUM_OBJECTS)
#endif

typedef enum
{
+7 −14
Original line number Diff line number Diff line
@@ -641,6 +641,7 @@ void ivas_jbm_dec_get_adapted_subframes_fx(
    Word16 *nb_subframes                                        /* i/o: number of subframes in the frame        */
);

#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS
void ivas_jbm_dec_copy_tc_no_tsm_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                 Q0  */
    Word32 *tc_fx[],                                            /* i  : transport channels                  Q11 */
@@ -654,7 +655,7 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    Word32 *transport_channels_f[],                             /* i  : synthesized core-coder transport channels/DirAC output  Q_tc*/
    Word16 *Q_tc                                                /* i/o : Q of input tc buffer                   */
);

#endif
/*! r: number of bits read */
Word16 read_GR0(
    const UWord16 *bit_stream,                                  /* i  : bitstream to be read                    */
@@ -4234,14 +4235,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const Word16 nSamplesForRendering,                          /* i  : number of TC samples available for rendering                */
    Word16 *nSamplesResidual,                                   /* o  : number of samples not fitting into the renderer grid and buffer for the next call*/
    Word32 *data                                                /* i/o: transport channels/output synthesis signal                  */
);

void ivas_jbm_dec_feed_tc_to_renderer_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const Word16 nSamplesForRendering,                          /* i  : number of TC samples available for rendering                */
    Word16 *nSamplesResidual,                                   /* o  : number of samples not fitting into the renderer grid and buffer for the next call*/
    Word32 *data                                                /* i/o: transport channels/output synthesis signal                  */
    Word32 *data_fx                                             /* i/o: transport channels/output synthesis signal                  */
);

void ivas_dec_prepare_renderer_fx(
@@ -4336,11 +4330,10 @@ void ivas_ism_dec_digest_tc_fx(
void ivas_param_ism_dec_digest_tc_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                         */
    const UWord16 nCldfbSlots,                                  /* i  : number of CLDFB slots in transport channels */
    Word32 *transport_channels[],                               /* i  : synthesized core-coder transport channels/DirAC output  */
    const Word16 q_tc_in 
    Word32 *p_data_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output  */
    const Word16 q_data_in                                      /* i  : Q-factor of input signal for single channel */
);


void ivas_param_ism_dec_dequant_md_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder handle                         */
);
@@ -4355,7 +4348,7 @@ void ivas_param_ism_dec_render_fx(
    const UWord16 nSamplesAsked,                                /* i  : number of CLDFB slots requested             */
    UWord16 *nSamplesRendered,                                  /* o  : number of CLDFB slots rendered              */
    UWord16 *nSamplesAvailable,                                 /* o  : number of CLDFB slots still to render       */
    Word32 *output_f_fx[] 
    Word32 *output_f_fx[]                                       /* i/o: synthesized core-coder TCs / rendered signal*/
);

void ivas_param_ism_params_to_masa_param_mapping_fx(
@@ -5145,7 +5138,7 @@ void ivas_param_mc_dec_digest_tc_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                             */
    const UWord8 nCldfbSlots,                                   /* i  : number of CLFBS slots in the transport channels */
    Word32 *p_data_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output */
    const Word16 transport_f_e
    const Word16 q_data                                         /* i  : Q-factor of input signal for single channel     */
);

void ivas_param_mc_dec_prepare_renderer(
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/
#define LIB_DEC_REVISION                                /* VA: cleaning and simplification of lib_dec.c */
#define UNIFIED_DECODING_PATHS_LEFTOVERS                /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
+1 −1
Original line number Diff line number Diff line
@@ -2076,7 +2076,7 @@ void ivas_dirac_dec_render_fx(
    move16();
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
    Word32 *output_f_local_fx[MAX_OUTPUT_CHANNELS];
    Word32 output_f_local_buff_fx[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 }; // VE2SB: TBV
    Word32 output_f_local_buff_fx[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 };

    hSpatParamRendCom = st_ivas->hSpatParamRendCom;

+122 −52
Original line number Diff line number Diff line
@@ -44,6 +44,15 @@
#include "debug.h"


#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
/*-----------------------------------------------------------------------*
 * Local function declarations
 *-----------------------------------------------------------------------*/

static void ivas_ism_param_dec_tc_gain_adjust_fx( Decoder_Struct *st_ivas, const Word16 nSamples, const Word16 nFadeLength, Word32 *p_data_fx[], Word16 *q_data );

#endif

/*-----------------------------------------------------------------------*
 * Local function definitions
 *-----------------------------------------------------------------------*/
@@ -72,6 +81,7 @@ static void ivas_param_ism_dec_dequant_DOA_fx(
    return;
}


static void ivas_param_ism_dec_dequant_powrat_fx(
    PARAM_ISM_DEC_HANDLE hParamIsmDec /* i/o: decoder ParamISM handle         */
)
@@ -167,6 +177,7 @@ static void ivas_ism_get_proto_matrix_fx(
    return;
}


static void ivas_param_ism_collect_slot_fx(
    PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */
    Word32 *Cldfb_RealBuffer_in_fx,    /*Q(31-exp_real)*/
@@ -183,7 +194,6 @@ static void ivas_param_ism_collect_slot_fx(
    Word16 exp_tmp;

    /* loop over parameter bands to collect transport channel energies */

    FOR( band_idx = 0; band_idx < hParamIsmDec->hParamIsm->nbands; band_idx++ )
    {
        brange[0] = hParamIsmDec->hParamIsm->band_grouping[band_idx];
@@ -210,6 +220,7 @@ static void ivas_param_ism_collect_slot_fx(
            move16();
        }
    }

    return;
}

@@ -391,6 +402,7 @@ static void ivas_param_ism_compute_mixing_matrix_fx(
    return;
}


static void ivas_param_ism_render_slot_fx(
    PARAM_ISM_DEC_HANDLE hParamIsmDec,
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom,
@@ -435,6 +447,7 @@ static void ivas_param_ism_render_slot_fx(
            }
        }
    }

    FOR( bin_idx = 0; bin_idx < hSpatParamRendCom->num_freq_bands; bin_idx++ )
    {
        /* smooth the mixing matrix */
@@ -519,11 +532,11 @@ static ivas_error ivas_param_ism_rendering_init_fx(
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for proto matrix\n" ) );
    }


    IF( ( hParamIsmRendering->interpolator_fx = (Word16 *) malloc( subframe_nbslots * sizeof( Word16 ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) );
    }

    test();
    test();
    test();
@@ -539,6 +552,7 @@ static ivas_error ivas_param_ism_rendering_init_fx(
    return IVAS_ERR_OK;
}


static void ivas_param_ism_update_mixing_matrix_fx(
    PARAM_ISM_DEC_HANDLE hParamIsmDec,
    Word32 mixing_matrix_fx[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_CHAN * PARAM_ISM_MAX_DMX], /*Q(31-mixing_matrix_exp)*/
@@ -580,6 +594,7 @@ static void ivas_param_ism_update_mixing_matrix_fx(
 *
 * Open Param ISM handle
 *-------------------------------------------------------------------------*/

ivas_error ivas_param_ism_dec_open_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
@@ -629,6 +644,7 @@ ivas_error ivas_param_ism_dec_open_fx(
    move32();
    output_config = st_ivas->hDecoderConfig->output_config;
    move32();

    ivas_param_ism_config_fx( hParamIsmDec->hParamIsm, st_ivas->nchan_ism ); // assuming Q14 for gains;

    /*-----------------------------------------------------------------*
@@ -833,6 +849,7 @@ ivas_error ivas_param_ism_dec_open_fx(
    return error;
}


/*-------------------------------------------------------------------------*
 * ivas_param_ism_dec_close()
 *
@@ -917,6 +934,7 @@ void ivas_param_ism_dec_close_fx(
 *
 *
 *-------------------------------------------------------------------------*/

void ivas_ism_dec_digest_tc_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
@@ -1083,15 +1101,22 @@ void ivas_ism_dec_digest_tc_fx(
void ivas_param_ism_dec_digest_tc_fx(
    Decoder_Struct *st_ivas,   /* i/o: IVAS decoder handle                                              */
    const UWord16 nCldfbSlots, /* i  : number of CLDFB slots in transport channels                      */
    Word32 *transport_channels[], /* i  : synthesized core-coder transport channels/DirAC output  q_tc_in   */
    const Word16 q_tc_in )
    Word32 *p_data_fx[],       /* i/o: synthesized core-coder transport channels/DirAC output q_data_in */
    const Word16 q_data_in     /* i  : Q-factor of input signal for single channel                      */
)
{
#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
    Word16 i, ch, slot_idx, output_frame;
    Word16 num_freq_bands, cldfb_ch, n_ch_cldfb;
    Word32 *cldfb_real_buffer, *cldfb_imag_buffer;
    Word16 q_data = q_data_in;
    move16();
#else
    move16();
    move16();
    move16();

    Word16 q_tc = q_tc_in;
    Word16 q_tc = q_data_in;
    move16();
    Word16 ch, nchan_transport, i;
    Word16 slot_idx;
@@ -1100,8 +1125,38 @@ void ivas_param_ism_dec_digest_tc_fx(
    PARAM_ISM_DEC_HANDLE hParamIsmDec;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
    Word16 fade_len;
#endif

    /* Initialization */
#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
    num_freq_bands = st_ivas->hSpatParamRendCom->num_freq_bands;
    move16();
    output_frame = imult1616( nCldfbSlots, st_ivas->hSpatParamRendCom->num_freq_bands );
    n_ch_cldfb = sub( st_ivas->hTcBuffer->nchan_transport_jbm, st_ivas->hTcBuffer->nchan_buffer_full );

    cldfb_real_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx;
    cldfb_imag_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx;

    ivas_ism_param_dec_tc_gain_adjust_fx( st_ivas, output_frame, shr( output_frame, 1 ), p_data_fx, &q_data );

    IF( !st_ivas->hDecoderConfig->Opt_tsm )
    {
        Scale_sig32( p_data_fx[0], output_frame, sub( Q11, q_data ) ); /*keepeing p_data_fx at Q11*/
        Scale_sig32( p_data_fx[1], output_frame, sub( Q11, q_data ) ); /*keepeing p_data_fx at Q11*/
    }
    ELSE
    {
        IF( NE_16( q_data, q_data_in ) )
        {
            FOR( i = 0; i < MAX_PARAM_ISM_WAVE; i++ )
            {
                scale_sig32( p_data_fx[i], output_frame, sub( q_data_in, q_data ) ); // q_data_in
            }
            q_data = q_data_in;
            move16();
        }
    }
#else
    hParamIsmDec = st_ivas->hParamIsmDec;
    assert( hParamIsmDec );
    hSpatParamRendCom = st_ivas->hSpatParamRendCom;
@@ -1112,9 +1167,6 @@ void ivas_param_ism_dec_digest_tc_fx(
    nchan_transport = st_ivas->nchan_transport;
    move16();

    push_wmops( "ivas_param_ism_dec" );


    IF( st_ivas->hDecoderConfig->Opt_tsm )
    {
        /*TODO : FhG to check*/
@@ -1130,7 +1182,29 @@ void ivas_param_ism_dec_digest_tc_fx(
            move16();
        }
    }
#endif

#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
    /* CLDFB Analysis */
    FOR( ( ch = 0, cldfb_ch = 0 ); cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch++ ) )
    {
        FOR( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ )
        {
            q_data = q_data_in;
            move16();

            cldfbAnalysis_ts_fx_fixed_q( &( p_data_fx[ch][num_freq_bands * slot_idx] ),
                                         &cldfb_real_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands],
                                         &cldfb_imag_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands],
                                         num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch], &q_data );

            st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_exp = sub( 31, q_data );
            move16();
            st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp = sub( 31, q_data );
            move16();
        }
    }
#else
    FOR( ch = 0; ch < nchan_transport; ch++ )
    {
        /* CLDFB Analysis */
@@ -1152,8 +1226,7 @@ void ivas_param_ism_dec_digest_tc_fx(
            }
        }
    }

    pop_wmops();
#endif

    return;
}
@@ -1223,10 +1296,9 @@ void ivas_param_ism_dec_prepare_renderer_fx(
    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;

    /* Initialization */

    hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_exp = 25;
    hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_exp = Q25;
    move16();
    hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp = 25;
    hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp = Q25;
    move16();
    IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) )
    {
@@ -1243,7 +1315,6 @@ void ivas_param_ism_dec_prepare_renderer_fx(
        nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE;
        move16();
    }
    push_wmops( "ivas_param_ism_dec_digest_tc" );

    /* general setup */
    ivas_jbm_dec_get_adapted_linear_interpolator_fx( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator_fx );
@@ -1371,33 +1442,32 @@ void ivas_param_ism_dec_prepare_renderer_fx(
    ivas_param_ism_compute_mixing_matrix_fx( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response_fx, nchan_transport, nchan_out_woLFE, cx_diag_fx, exp_cx_diag,
                                             hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_fx, hParamIsmDec->hParamIsmRendering->exp_mixing_matrix_lin_fx );


    pop_wmops();

    return;
}


/*-------------------------------------------------------------------------*
 * ivas_ism_param_dec_tc_gain_ajust()
 * ivas_ism_param_dec_tc_gain_adjust()
 *
 *
 *-------------------------------------------------------------------------*/

#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
static void ivas_ism_param_dec_tc_gain_adjust_fx(
#else
void ivas_ism_param_dec_tc_gain_ajust_fx(
#endif
    Decoder_Struct *st_ivas,  /* i/o: IVAS decoder handle                                           */
    const UWord16 nSamples,         /* i  : number of samples to be compensate                          */
    const UWord16 nFadeLength,      /* i  : length of the crossfade in samples                          */
    Word32 *transport_channels_f[], /* i  : synthesized core-coder transport channels/DirAC output  Q_tc*/
    Word16 *Q_tc                    /* i/o : Q of input tc buffer                                       */
    const Word16 nSamples,    /* i  : number of samples to be compensate                            */
    const Word16 nFadeLength, /* i  : length of the crossfade in samples                            */
    Word32 *p_data_fx[],      /* i  : synthesized core-coder transport channels/DirAC output q_data */
    Word16 *q_data            /* i/o : Q of input data buffer                                       */
)

{
    Word16 i, tmp_e1, tmp_e2, tmp, tmp2, invFade;
    Word32 L_tmp1, L_tmp2;

    Word16 gain_fx, last_gain_fx;
    Word32 ene_tc_fx, ene_sum_fx;

    Word16 ene_tc_e, ene_sum_e;

    ene_tc_fx = 0;
@@ -1409,7 +1479,6 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    ene_sum_e = 0;
    move16();


    last_gain_fx = st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_fx;
    move16();

@@ -1426,14 +1495,13 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
        move16();
        ch1_e = 0;
        move16();
        ch0 = transport_channels_f[0][i];
        ch0 = p_data_fx[0][i];
        move16();
        ch1 = transport_channels_f[1][i];
        ch1 = p_data_fx[1][i];
        move16();
        ch0 = BASOP_Util_Add_Mant32Exp( ch0, ch0_e, 0, 0, &ch0_e );
        ch1 = BASOP_Util_Add_Mant32Exp( ch1, ch1_e, 0, 0, &ch1_e );


        L_tmp1 = Mpy_32_32( ch0, ch0 ); /*L*L*/
        tmp_e1 = add( ch0_e, ch0_e );
        L_tmp2 = Mpy_32_32( ch1, ch1 ); /*R*R*/
@@ -1442,7 +1510,6 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
        ene_tc_fx = BASOP_Util_Add_Mant32Exp( ene_tc_fx, ene_tc_e, L_tmp1, tmp_e1, &ene_tc_e );
        ene_tc_fx = BASOP_Util_Add_Mant32Exp( ene_tc_fx, ene_tc_e, L_tmp2, tmp_e2, &ene_tc_e );


        L_tmp1 = BASOP_Util_Add_Mant32Exp( ch0, ch0_e, ch1, ch1_e, &tmp_e1 ); /*L + R*/
        L_tmp1 = Mpy_32_32( L_tmp1, L_tmp1 );                                 // Q(31-(tmp_e1+tmp_e1           /*(L + R)*(L + R)*/
        tmp_e1 = add( tmp_e1, tmp_e1 );
@@ -1492,6 +1559,7 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    {
        /* Smoothing */
        gain_fx = add( mult_r( 24574, gain_fx ), mult_r( 8192, last_gain_fx ) ); // 24574 =.75f in Q15 , 8192=.25f in Q15

        /* 10ms ramp */
        /* slope between two consecutive gains, 480 samples length */
        invFade = div_s( 1, nFadeLength ); // Q15
@@ -1502,18 +1570,18 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
            /* tmp2 = ( last_gain_fx + i * grad_fx )*/
            tmp2 = add( mult_r( sub( 32767, tmp ), last_gain_fx ), mult_r( tmp, gain_fx ) ); // 32767= 1.0f in Q15,

            transport_channels_f[0][i] = Mpy_32_16_1( transport_channels_f[0][i], tmp2 ); // Q(Q_tc-tmp_e1)
            p_data_fx[0][i] = Mpy_32_16_1( p_data_fx[0][i], tmp2 ); // Q(Q_tc-tmp_e1)
            move32();
            transport_channels_f[1][i] = Mpy_32_16_1( transport_channels_f[1][i], tmp2 ); // Q(Q_tc-tmp_e1)
            p_data_fx[1][i] = Mpy_32_16_1( p_data_fx[1][i], tmp2 ); // Q(Q_tc-tmp_e1)
            move32();

            tmp = add( tmp, invFade );
        }
        FOR( ; i < nSamples; i++ )
        {
            transport_channels_f[0][i] = Mpy_32_16_1( transport_channels_f[0][i], gain_fx ); // Q(Q_tc-tmp_e1)
            p_data_fx[0][i] = Mpy_32_16_1( p_data_fx[0][i], gain_fx ); // Q(Q_tc-tmp_e1)
            move32();
            transport_channels_f[1][i] = Mpy_32_16_1( transport_channels_f[1][i], gain_fx ); // Q(Q_tc-tmp_e1)
            p_data_fx[1][i] = Mpy_32_16_1( p_data_fx[1][i], gain_fx ); // Q(Q_tc-tmp_e1)
            move32();
        }
    }
@@ -1521,9 +1589,9 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    {
        FOR( i = 0; i < nSamples; i++ )
        {
            transport_channels_f[0][i] = Mpy_32_16_1( transport_channels_f[0][i], gain_fx ); // Q(Q_tc-tmp_e1)
            p_data_fx[0][i] = Mpy_32_16_1( p_data_fx[0][i], gain_fx ); // Q(Q_tc-tmp_e1)
            move32();
            transport_channels_f[1][i] = Mpy_32_16_1( transport_channels_f[1][i], gain_fx ); // Q(Q_tc-tmp_e1)
            p_data_fx[1][i] = Mpy_32_16_1( p_data_fx[1][i], gain_fx ); // Q(Q_tc-tmp_e1)
            move32();
        }
    }
@@ -1533,16 +1601,19 @@ void ivas_ism_param_dec_tc_gain_ajust_fx(
    st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_e = tmp_e1;
    move16();

    *Q_tc = sub( *Q_tc, tmp_e1 );
    *q_data = sub( *q_data, tmp_e1 );
    move16();

    return;
}


/*-------------------------------------------------------------------------*
 * ivas_ism_param_dec_render_sf()
 *
 *
 *-------------------------------------------------------------------------*/

static void ivas_ism_param_dec_render_sf_fx(
    Decoder_Struct *st_ivas,
    IVAS_OUTPUT_SETUP hSetup,
@@ -1552,7 +1623,7 @@ static void ivas_ism_param_dec_render_sf_fx(
    Word32 *output_f_fx[], /*Q_output*/
    Word16 Q_output[] )
{
    Word16 ch, slot_idx, i, index_slot;
    Word16 ch, slot_idx, i, index_slot, cldfb_idx;
    /* CLDFB Output Buffers */
    Word32 Cldfb_RealBuffer_fx[PARAM_ISM_MAX_CHAN][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; // Q(31-real_exp)
    Word32 Cldfb_ImagBuffer_fx[PARAM_ISM_MAX_CHAN][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; // Q(31-imag_exp)
@@ -1565,12 +1636,14 @@ static void ivas_ism_param_dec_render_sf_fx(
    Word16 idx_lfe;
    Word16 subframe_idx;
    Word16 samplesProcessed, no_col_cldfb, size_cldfb;

    hParamIsmDec = st_ivas->hParamIsmDec;
    hSpatParamRendCom = st_ivas->hSpatParamRendCom;
    slot_idx_start = hSpatParamRendCom->slots_rendered;
    move16();
    subframe_idx = hSpatParamRendCom->subframes_rendered;
    move16();

    /* Set some memories to zero */
    FOR( ch = 0; ch < nchan_out_woLFE; ch++ )
    {
@@ -1581,17 +1654,15 @@ static void ivas_ism_param_dec_render_sf_fx(
        }
    }


    Word16 real_exp[JBM_CLDFB_SLOTS_IN_SUBFRAME];
    Word16 imag_exp[JBM_CLDFB_SLOTS_IN_SUBFRAME];
    FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ )
    {
        index_slot = add( slot_idx_start, slot_idx );


        FOR( ch = 0; ch < nchan_transport; ch++ )
        {
            Word16 cldfb_idx = add( imult1616( imult1616( index_slot, hSpatParamRendCom->num_freq_bands ), nchan_transport ), imult1616( ch, hSpatParamRendCom->num_freq_bands ) );
            cldfb_idx = add( imult1616( imult1616( index_slot, hSpatParamRendCom->num_freq_bands ), nchan_transport ), imult1616( ch, hSpatParamRendCom->num_freq_bands ) );
            Cldfb_RealBuffer_in_fx[ch] = &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx[cldfb_idx]; // Q11
            Cldfb_ImagBuffer_in_fx[ch] = &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx[cldfb_idx]; // Q11
        }
@@ -1628,7 +1699,6 @@ static void ivas_ism_param_dec_render_sf_fx(
        }
        ELSE
        {

            Word32 *RealBuffer_fx[16];
            Word32 *ImagBuffer_fx[16];

@@ -1693,15 +1763,15 @@ static void ivas_ism_param_dec_render_sf_fx(
 *
 *
 *-------------------------------------------------------------------------*/

void ivas_param_ism_dec_render_fx(
    Decoder_Struct *st_ivas,        /* i/o: IVAS decoder handle                             */
    const UWord16 nSamplesAsked,    /* i  : number of CLDFB slots requested                 */
    UWord16 *nSamplesRendered,      /* o  : number of CLDFB slots rendered                  */
    UWord16 *nSamplesAvailableNext, /* o  : number of CLDFB slots still to render           */
    Word32 *output_f_fx[]           /*Q11*/
    Word32 *output_f_fx[]           /* i/o: synthesized core-coder TCs / rendered signal Q11*/
)
{

    Word16 ch, slots_to_render, first_sf, last_sf, subframe_idx;
    UWord16 slot_size, n_samples_sf;
    PARAM_ISM_DEC_HANDLE hParamIsmDec;
@@ -1800,6 +1870,7 @@ void ivas_param_ism_dec_render_fx(

    *nSamplesAvailableNext = imult1616( sub( hSpatParamRendCom->num_slots, hSpatParamRendCom->slots_rendered ), (Word16) slot_size );
    move16();

    return;
}

@@ -1834,7 +1905,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx(
    nBins = hSpatParamRendCom->num_freq_bands;
    move16();


    IF( st_ivas->hISMDTX.dtx_flag )
    {
        Word32 energy_ratio_fx;                                                                                                                                                /* Q30 */
Loading