Commit a54e7146 authored by Arthur Tritthart's avatar Arthur Tritthart Committed by Manuel Jander
Browse files

version now with 2 macros for NONBE and BE code parts

parent 0a4281e6
Loading
Loading
Loading
Loading
+34 −10
Original line number Diff line number Diff line
@@ -720,14 +720,14 @@ static void ivas_param_mc_param_est_enc_fx(
        }
    }

#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#if defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE ) || defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE )
    Word16 gb = find_guarded_bits_fx( l_ts );
    Word16 add20gb = add( 20, gb );
#endif

    FOR( ts = start_ts; ts < num_time_slots; ts++ )
    {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#if !defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE ) && !defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE )
        Word16 gb = find_guarded_bits_fx( l_ts );
#endif
        ivas_fb_mixer_get_windowed_fr_fx( hParamMC->hFbMixer, pcm_in_fx, p_slot_frame_f_real_fx, p_slot_frame_f_imag_fx, l_ts, l_ts, hParamMC->hFbMixer->fb_cfg->num_in_chans, gb );
@@ -738,6 +738,7 @@ static void ivas_param_mc_param_est_enc_fx(
        FOR( i = 0; i < nchan_input; i++ )
        {
            pcm_in_fx[i] += l_ts;
            move32();
        }
        /* Computing the downmix */
        FOR( cur_param_band = 0; cur_param_band < hParamMC->max_param_band_abs_cov; cur_param_band++ )
@@ -755,6 +756,7 @@ static void ivas_param_mc_param_est_enc_fx(

                FOR( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 )
                {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE
                    dmx_real_fx[ch_idx1] = 0;
                    move32();
                    dmx_real_e[ch_idx1] = 0;
@@ -773,6 +775,28 @@ static void ivas_param_mc_param_est_enc_fx(
                        move32();
                        p_dmx_fac_fx++;
                    }
#else
                    Word32 real_fx = L_add(0,0);
                    Word16 real_e = add(0, 0);
                    Word32 imag_fx = L_add( 0, 0 );
                    Word16 imag_e = add( 0, 0 );
                    FOR( inp_ch = 0; inp_ch < nchan_input; inp_ch++ )
                    {
                        L_tmp = Mpy_32_32( slot_frame_f_real_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) );
                        real_fx = BASOP_Util_Add_Mant32Exp( real_fx, real_e, L_tmp, add20gb, &real_e );
                        L_tmp = Mpy_32_32( slot_frame_f_imag_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) );
                        imag_fx = BASOP_Util_Add_Mant32Exp( imag_fx, imag_e, L_tmp, add20gb, &imag_e );
                        p_dmx_fac_fx++;
                    }
                    dmx_real_fx[ch_idx1] = real_fx;
                    dmx_real_e[ch_idx1] = real_e;
                    dmx_imag_fx[ch_idx1] = imag_fx;
                    dmx_imag_e[ch_idx1] = imag_e;
                    move32();
                    move16();
                    move32();
                    move16();
#endif
                }

                /* Cx for transport channels */
@@ -812,7 +836,7 @@ static void ivas_param_mc_param_est_enc_fx(
                /* Cy for input channels */
                FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 )
                {
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE
                    a_e = norm_l( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band] );
                    a_fx = L_shl( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], a_e );
                    a_e = sub( add20gb, a_e );
@@ -832,7 +856,7 @@ static void ivas_param_mc_param_est_enc_fx(
#endif
                    FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 )
                    {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE
                        a_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &a_e );
                        b_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &b_e );
                        c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e );
@@ -884,7 +908,7 @@ static void ivas_param_mc_param_est_enc_fx(

                FOR( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 )
                {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE
                    dmx_real_fx[ch_idx1] = 0;
                    move32();
                    dmx_real_e[ch_idx1] = 0;
@@ -934,7 +958,7 @@ static void ivas_param_mc_param_est_enc_fx(
                /* Cx for transport channels */
                FOR( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 )
                {
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE
                    a_fx = dmx_real_fx[ch_idx1];
                    move32();
                    a_e = dmx_real_e[ch_idx1];
@@ -946,7 +970,7 @@ static void ivas_param_mc_param_est_enc_fx(
#endif
                    FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 )
                    {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE
                        a_fx = dmx_real_fx[ch_idx1];
                        move32();
                        a_e = dmx_real_e[ch_idx1];
@@ -981,7 +1005,7 @@ static void ivas_param_mc_param_est_enc_fx(
                /* Cy for input channels */
                FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 )
                {
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE
                    a_e = norm_l( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band] );
                    a_fx = L_shl( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], a_e );
                    a_e = sub( add20gb, a_e );
@@ -1001,7 +1025,7 @@ static void ivas_param_mc_param_est_enc_fx(
#endif
                    FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 )
                    {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE
                        a_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &a_e );
                        b_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &b_e );
                        c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e );
@@ -1028,7 +1052,7 @@ static void ivas_param_mc_param_est_enc_fx(
                        L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e );
                        Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e,
                                                                                                &Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] );
                        move32();
pri                        move32();
                    }
                }
            }