Commit d08b37b4 authored by malenov's avatar malenov
Browse files

cleanup FIX_835_PARAMMC_BUFFER_VALUES

parent 0716af12
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -4014,7 +4014,6 @@ void ivas_dirac_dec_output_synthesis_cov_close(
);

void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    float *RealBuffer,                                                          /* i  : input channel filter bank samples (real part)         */
    float *ImagBuffer,                                                          /* i  : input channel filter bank samples (imaginary part     */
    float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS],      /* o  : accumulated input covariance (real part)              */
@@ -4022,14 +4021,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(
    const int16_t param_band,                                                   /* i  : parameter band                                        */
    PARAM_MC_DEC_HANDLE hParamMC,                                               /* i  : handle to Parametric MC state                         */
    const int16_t nchan_in                                                      /* i  : number of input channels                              */
#else
    float *RealBuffer,                                                                                        /* i  : input channel filter bank samples (real part)         */
    float *ImagBuffer,                                                                                        /* i  : input channel filter bank samples (imaginary part)    */
    float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS],      /* o  : accumulated input covariance (real part)              */
    float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o  : accumulated input covariance (imaginary part)         */
    PARAM_MC_DEC_HANDLE hParamMC,                                                                             /* i  : handle to Parametric MC state                         */
    const int16_t nchan_in                                                                                    /* i  : number of input channels                              */
#endif
);

void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot(
+0 −1
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@

/* ################### Start FIXES switches ########################### */

#define FIX_835_PARAMMC_BUFFER_VALUES                   /* FhG: issue 835: wide range of buffer values for cx in ParamMC */
#define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST    /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */
#define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE   /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */
#define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP        /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
+17 −45
Original line number Diff line number Diff line
@@ -307,7 +307,6 @@ void ivas_dirac_dec_output_synthesis_cov_close(
 *-------------------------------------------------------------------*/

void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    float *RealBuffer,                                                          /* i  : input channel filter bank samples (real part)         */
    float *ImagBuffer,                                                          /* i  : input channel filter bank samples (imaginary part     */
    float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS],      /* o  : accumulated input covariance (real part)              */
@@ -315,21 +314,9 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(
    const int16_t param_band,                                                   /* i  : parameter band                                        */
    PARAM_MC_DEC_HANDLE hParamMC,                                               /* i  : handle to Parametric MC state                         */
    const int16_t nchan_in                                                      /* i  : number of input channels                              */
#else
    float *RealBuffer,                                                                                        /* i  : input channel filter bank samples (real part)         */
    float *ImagBuffer,                                                                                        /* i  : input channel filter bank samples (imaginary part     */
    float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS],      /* o  : accumulated input covariance (real part)              */
    float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o  : accumulated input covariance (imaginary part)         */
    PARAM_MC_DEC_HANDLE hParamMC,                                                                             /* i  : handle to Parametric MC state                         */
    const int16_t nchan_in                                                                                    /* i  : number of input channels                              */
#endif
)
{
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    int16_t band_idx, ch_idx;
#else
    int16_t param_band, band_idx, ch_idx;
#endif
    int16_t brange[2];
    float real_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS];
    float imag_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS];
@@ -337,10 +324,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(
    float imag_buffer[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];

    /* estimate input covariance */
#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    for ( param_band = 0; param_band < hParamMC->num_param_bands_synth; param_band++ )
    {
#endif
    /* Already stack here instead of in the process_subframe */

    /* collect input frame */
@@ -361,19 +344,8 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot(

    cmplx_matrix_square( real_in_buffer, imag_in_buffer, num_bands, nchan_in, real_buffer, imag_buffer );

#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    v_add( cx, real_buffer, cx, nchan_in * nchan_in );

    v_add( cx_imag, imag_buffer, cx_imag, nchan_in * nchan_in );
#else
    v_add( cx[param_band], real_buffer, cx[param_band], nchan_in * nchan_in );

    v_add( cx_imag[param_band], imag_buffer, cx_imag[param_band], nchan_in * nchan_in );
#endif

#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    }
#endif

    return;
}
+119 −343
Original line number Diff line number Diff line
@@ -86,17 +86,9 @@ static int16_t ivas_param_mc_uniform_decoder( float *seq, const int16_t sz_seq,

static void ivas_param_mc_dequantize_cov( PARAM_MC_DEC_HANDLE hDirAC, float *ild_q, float *icc_q, const int16_t param_band_index, const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nY, const int16_t nX, float *Cx_state, float *Cproto, float *Cy_state );

#ifdef FIX_835_PARAMMC_BUFFER_VALUES
static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY );
#else
static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY );
#endif

#ifdef FIX_835_PARAMMC_BUFFER_VALUES
static void ivas_param_mc_get_mono_stereo_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_intern, const int16_t nX, const int16_t nY_cov );
#else
static void ivas_param_mc_get_mono_stereo_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_intern, const int16_t nX, const int16_t nY_cov );
#endif

static void param_mc_update_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float *mixing_matrix[], float *mixing_matrix_res[], const uint16_t nX, const uint16_t nY );

@@ -1338,24 +1330,18 @@ void ivas_param_mc_dec_digest_tc(
{
    PARAM_MC_DEC_HANDLE hParamMC;
    int16_t i, ch;
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    int16_t is_next_band, skip_next_band;
#endif
    int16_t slot_idx, param_band_idx;
    int16_t nchan_transport, nchan_out_transport, nchan_out_cldfb;
    int16_t nchan_out_cov;
    /*CLDFB*/
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    float *pCx, *pCx_imag;
    float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float cx_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float cx_imag_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
#else
    float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
#endif
    float real_part, imag_part;

    /* format converter */
    int16_t channel_active[MAX_OUTPUT_CHANNELS];
    IVAS_OUTPUT_SETUP *hSynthesisOutputSetup;
@@ -1413,7 +1399,6 @@ void ivas_param_mc_dec_digest_tc(
    ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator );


#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    /* loop over two bands at a time */
    for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 )
    {
@@ -1537,98 +1522,6 @@ void ivas_param_mc_dec_digest_tc(
        }
    }

#else
    for ( param_band_idx = 0; param_band_idx < PARAM_MC_MAX_PARAMETER_BANDS; param_band_idx++ )
    {
        set_zero( cx[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS );
        set_zero( cx_imag[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS );
    }

    /* slot loop for gathering the input data */
    for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ )
    {
        if ( st_ivas->hDecoderConfig->Opt_tsm )
        {
            float RealBuffer[CLDFB_NO_CHANNELS_MAX];
            float ImagBuffer[CLDFB_NO_CHANNELS_MAX];

            /* CLDFB Analysis*/
            for ( ch = 0; ch < nchan_transport; ch++ )
            {
                cldfbAnalysis_ts( &( transport_channels_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] );

                mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands );
                mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands );
            }
        }

        if ( slot_idx >= 2 * hParamMC->hMetadataPMC->attackIndex )
        {
            ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport],
                                                                       &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport],
                                                                       cx,
                                                                       cx_imag,
                                                                       hParamMC,
                                                                       nchan_transport );
        }
    }

    /* map from complex input covariance to real values */
    for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ )
    {
        /* Cx for transport channels */
        for ( i = 0; i < nchan_transport * nchan_transport; i++ )
        {
            real_part = cx[param_band_idx][i];
            imag_part = cx_imag[param_band_idx][i];

            /* (a-ib)(c+id) = ac + bd + i(ad-bc) */
            if ( param_band_idx < hParamMC->max_param_band_abs_cov )
            {
                cx[param_band_idx][i] = sqrtf( real_part * real_part + imag_part * imag_part );
            }
            else
            {
                cx[param_band_idx][i] = real_part;
            }
        }
    }

    /* we have to do it similar to the encoder in case of attacks (i.e. accumulate two bands) to ensure correct DMX of the target covariance*/
    if ( hParamMC->hMetadataPMC->bAttackPresent && ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) )
    {
        for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 )
        {
            v_add( cx[param_band_idx], cx[param_band_idx + 1], cx[param_band_idx], nchan_transport * nchan_transport );
            mvr2r( cx[param_band_idx], cx[param_band_idx + 1], nchan_transport * nchan_transport );
        }
    }

    if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO )
    {
        ivas_param_mc_get_mono_stereo_mixing_matrices( hParamMC,
                                                       cx,
                                                       hParamMC->h_output_synthesis_cov_state.mixing_matrix,
                                                       hParamMC->h_output_synthesis_cov_state.mixing_matrix_res,
                                                       nchan_out_transport,
                                                       nchan_transport,
                                                       nchan_out_cov );
    }
    else
    {
        /* generate mixing matrices */
        ivas_param_mc_get_mixing_matrices( hParamMC,
                                           hSynthesisOutputSetup,
                                           cx,
                                           hParamMC->h_output_synthesis_cov_state.mixing_matrix,
                                           hParamMC->h_output_synthesis_cov_state.mixing_matrix_res,
                                           nchan_out_transport,
                                           hParamMC->synthesis_conf,
                                           nchan_transport,
                                           nchan_out_cov );
    }
#endif

    pop_wmops();

    return;
@@ -2316,7 +2209,6 @@ static void remove_lfe_from_cy(
 *------------------------------------------------------------------------*/

static void ivas_param_mc_get_mixing_matrices(
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    PARAM_MC_DEC_HANDLE hParamMC, /* i  : Parametric MC handle */
    IVAS_OUTPUT_SETUP *hSynthesisOutputSetup,
    float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i  : input covariance for all parameter bands         */
@@ -2327,22 +2219,8 @@ static void ivas_param_mc_get_mixing_matrices(
    const PARAM_MC_SYNTHESIS_CONF synth_config,                               /* i  : Parametric MC synthesis config                   */
    const int16_t nX,                                                         /* i  : number of transport channels                     */
    const int16_t nY_cov                                                      /* i  : number of covariance synthesis output channels   */
#else
    PARAM_MC_DEC_HANDLE hParamMC, /* i  : Parametric MC handle */
    IVAS_OUTPUT_SETUP *hSynthesisOutputSetup,
    float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i  : input covariance for all parameter bands         */
    float *mixing_matrix[],                                                                                 /* o  : direct mixing matrices for all parameter bands   */
    float *mixing_matrix_res[],                                                                             /* o  : residual mixing matrices for all parameter bands */
    const int16_t nY_intern,                                                                                /* i  : number of channels in the transported format     */
    const PARAM_MC_SYNTHESIS_CONF synth_config,                                                             /* i  : Parametric MC synthesis config                   */
    const int16_t nX,                                                                                       /* i  : number of transport channels                     */
    const int16_t nY_cov                                                                                    /* i  : number of covariance synthesis output channels   */
#endif
)
{
#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    int16_t param_band_idx;
#endif
    float Cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float Cy[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS];
    float Cy_diag[MAX_CICP_CHANNELS];
@@ -2412,10 +2290,7 @@ static void ivas_param_mc_get_mixing_matrices(
        num_lfe_bands = PARAM_MC_MAX_BAND_LFE;
    }

#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ )
    {
#endif

    if ( hSynthesisOutputSetup->num_lfe > 0 && param_band_idx >= num_lfe_bands )
    {
        remove_lfe = 1;
@@ -2430,11 +2305,7 @@ static void ivas_param_mc_get_mixing_matrices(
    brange[0] = hParamMC->band_grouping[param_band_idx];
    brange[1] = hParamMC->band_grouping[param_band_idx + 1];

#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    Cx_state = Cx_in;
#else
    Cx_state = Cx_in[param_band_idx];
#endif
    Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx];
    Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx];

@@ -2578,9 +2449,6 @@ static void ivas_param_mc_get_mixing_matrices(
    {
        mvr2r( mixing_matrix_local, mixing_matrix[param_band_idx], nY_cov * nX );
    }
#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    }
#endif

    return;
}
@@ -2594,7 +2462,6 @@ static void ivas_param_mc_get_mixing_matrices(
 *------------------------------------------------------------------------*/

static void ivas_param_mc_get_mono_stereo_mixing_matrices(
#ifdef FIX_835_PARAMMC_BUFFER_VALUES
    PARAM_MC_DEC_HANDLE hParamMC,                                             /* i  : Parametric MC handle                                  */
    float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i  : transport channel covariance for all parameter bands  */
    const int16_t param_band_idx,                                             /* i  : parameter band index                                  */
@@ -2603,20 +2470,8 @@ static void ivas_param_mc_get_mono_stereo_mixing_matrices(
    const int16_t nY_intern,                                                  /* i  : number of channels of the transport format            */
    const int16_t nX,                                                         /* i  : number of transport channels                          */
    const int16_t nY_cov                                                      /* i  : number of output channels                             */
#else
    PARAM_MC_DEC_HANDLE hParamMC,                                                                           /* i  : Parametric MC handle                                  */
    float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i  : transport channel covariance for all parameter bands  */
    float *mixing_matrix[],                                                                                 /* o  : direct mixing matrices for all parameter bands   */
    float *mixing_matrix_res[],                                                                             /* o  : residual mixing matrices for all parameter bands */
    const int16_t nY_intern,                                                                                /* i  : number of channels of the transport format            */
    const int16_t nX,                                                                                       /* i  : number of transport channels                          */
    const int16_t nY_cov                                                                                    /* i  : number of output channels                             */
#endif
)
{
#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    int16_t param_band_idx;
#endif
    float Cy_full[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS];
    float mixing_matrix_woLFE[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS];
    float Nrqq[MAX_OUTPUT_CHANNELS];
@@ -2644,84 +2499,6 @@ static void ivas_param_mc_get_mono_stereo_mixing_matrices(
    mvr2r( hParamMC->h_output_synthesis_params.proto_matrix, proto_matrix, nY_cov * nX );
    nY_band = nY_cov;

#ifndef FIX_835_PARAMMC_BUFFER_VALUES
    for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ )
    {
        Cx_state = Cx_in[param_band_idx];
        Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx];
        Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx];

        set_zero( Nrqq, MAX_OUTPUT_CHANNELS );
        set_zero( target_ch_ener, MAX_OUTPUT_CHANNELS );
        set_zero( Cy_full, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS );
        set_zero( Cy_state, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS );
        set_zero( Cproto_diag, MAX_CICP_CHANNELS );
        ild_q = hParamMC->icld_q + param_band_idx * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe;

        /*get back Nrg*/
        for ( k = 0; k < nY_intern; k++ )
        {
            float ref_ener = 0.0f;
            int16_t ref_channel_cnt;
            int16_t ref_channel_idx;

            for ( ref_channel_cnt = 0; ref_channel_cnt < hParamMC->hMetadataPMC->ild_mapping_conf->num_ref_channels[k]; ref_channel_cnt++ )
            {
                ref_channel_idx = hParamMC->hMetadataPMC->ild_mapping_conf->ref_channel_idx[k][ref_channel_cnt];
                ref_ener += Cx_state[ref_channel_idx + ref_channel_idx * nX];
            }
            Nrqq[hParamMC->hMetadataPMC->ild_mapping_conf->ild_index[k]] = powf( 10.0f, ild_q[k] / 10.0f ) * hParamMC->hMetadataPMC->ild_factors[k] * ref_ener;
        }
        for ( k = 0; k < nY_cov; k++ )
        {
            for ( l = 0; l < nY_intern; l++ )
            {
                target_ch_ener[k] += hParamMC->ls_conv_dmx_matrix[k + l * nY_cov] * Nrqq[l];
            }
            Cy_state[k + nY_cov * k] = target_ch_ener[k];
        }

        /* Smoothing: Sum over two buffers */
        if ( hParamMC->hMetadataPMC->bAttackPresent )
        {
            /* no smoothing on attacks */
            mvr2r( Cx_state, Cx, nX * nX );
            mvr2r( Cy_state, Cy_full, nY_cov * nY_cov );
        }
        else
        {
            /* smoothing gains are now identical to one, simply add up */
            v_add( Cx_state, Cx_old_state, Cx, nX * nX );
            v_add( Cy_state, Cy_old_state, Cy_full, nY_cov * nY_cov );
        }

        /* cov buffer update */
        mvr2r( Cx_state, Cx_old_state, nX * nX );
        mvr2r( Cy_state, Cy_old_state, nY_cov * nY_cov );


        matrix_product( proto_matrix, nY_band, nX, 0, Cx, nX, nX, 0, mat_mult_buffer1 );

        matrix_product_diag( mat_mult_buffer1, nY_band, nX, 0, proto_matrix, nY_band, nX, 1, Cproto_diag );

        /* Computing the mixing matrices */
        for ( i = 0; i < nY_band; i++ )
        {
            Cy_diag[i] = Cy_full[i + nY_band * i];
            Cy_diag[i] = sqrtf( Cy_diag[i] / ( Cproto_diag[i] + EPSILON ) );
        }

        diag_matrix_product( Cy_diag, nY_band, proto_matrix, nY_band, nX, 0, mixing_matrix_woLFE );

        mvr2r( mixing_matrix_woLFE, mixing_matrix[param_band_idx], nY_cov * nX );
        if ( hParamMC->band_grouping[param_band_idx] < hParamMC->h_output_synthesis_params.max_band_decorr )
        {
            set_zero( mixing_matrix_res[param_band_idx], nY_cov * nY_cov );
        }
    }

#else

    Cx_state = Cx_in;
    Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx];
    Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx];
@@ -2792,7 +2569,6 @@ static void ivas_param_mc_get_mono_stereo_mixing_matrices(
    {
        set_zero( mixing_matrix_res[param_band_idx], nY_cov * nY_cov );
    }
#endif

    return;
}