Commit 91f046f4 authored by Arthur Tritthart's avatar Arthur Tritthart
Browse files

completed tuning of MC param: no more BE now

parent 0b5b38dd
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,5 +158,5 @@
#define FIX_MINOR_SVD_WMOPS_MR1010X             /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */
#define SVD_WMOPS_OPT                           /* Ittiam : SVD related optimizations */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST  /* FhG: reduces WMOPS of param_mc_prm_est, bit-exact to previous version */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST  /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version */
#endif

lib_enc/ivas_mc_param_enc.c

100644 → 100755
+49 −10
Original line number Diff line number Diff line
@@ -815,6 +815,24 @@ 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
                    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 );
                    if ( a_fx == 0 )
                    {
                        a_e = 0;
                        move16();
                    }
                    b_e = norm_l( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band] );
                    b_fx = L_shl( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], b_e );
                    b_e = sub( add20gb, b_e );
                    if ( b_fx == 0 )
                    {
                        b_e = 0;
                        move16();
                    }
#endif
                    FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 )
                    {
#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST
@@ -823,20 +841,23 @@ static void ivas_param_mc_param_est_enc_fx(
                        c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e );
                        d_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &d_e );
#else
                        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 );
                        b_e = norm_l( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band] );
                        b_fx = L_shl( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], b_e );
                        b_e = sub( add20gb, b_e );
                        c_e = norm_l( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band] );
                        c_fx = L_shl( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], c_e );
                        c_e = sub( add20gb, c_e );
                        if ( c_fx == 0 )
                        {
                            c_e = 0;
                            move16();
                        }
                        d_e = norm_l( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band] );
                        d_fx = L_shl( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], d_e );
                        d_e = sub( add20gb, d_e );
                        if ( d_fx == 0 )
                        {
                            d_e = 0;
                            move16();
                        }
#endif

                        /* (a-ib)(c+id) = ac + bd + i(ad-bc) */
                        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],
@@ -899,7 +920,7 @@ static void ivas_param_mc_param_est_enc_fx(
                        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, add( 20, gb ), &imag_e );
                        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;
@@ -967,9 +988,19 @@ static void ivas_param_mc_param_est_enc_fx(
                    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 );
                    if ( a_fx == 0 )
                    {
                        a_e = 0;
                        move16();
                    }
                    b_e = norm_l( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band] );
                    b_fx = L_shl( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], b_e );
                    b_e = sub( add20gb, b_e );
                    if ( b_fx == 0 )
                    {
                        b_e = 0;
                        move16();
                    }
#endif
                    FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 )
                    {
@@ -979,15 +1010,23 @@ static void ivas_param_mc_param_est_enc_fx(
                        c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e );
                        d_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &d_e );
#else

                        c_e = norm_l( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band] );
                        c_fx = L_shl( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], c_e );
                        c_e = sub( add20gb, c_e );
                        if ( c_fx == 0 )
                        {
                            c_e = 0;
                            move16();
                        }
                        d_e = norm_l( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band] );
                        d_fx = L_shl( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], d_e );
                        d_e = sub( add20gb, d_e );
                        if ( d_fx == 0 )
                        {
                            d_e = 0;
                            move16();
                        }
#endif

                        /* (a-ib)(c+id) = ac + bd + i(ad-bc) */
                        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,