Commit b949948e authored by Arthur Tritthart's avatar Arthur Tritthart
Browse files

version now with 2 macros for NONBE and BE code parts

parent d9eb2c88
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -160,7 +160,9 @@
#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, not bit-exact to previous version */
/* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE    /* FhG: reduces WMOPS of param_mc_prm_est, bit-exact to previous version */
#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version */
#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 FIX_ISSUE_1279                          /* VA: correction of wrong scaling update */
#define FIX_ISSUE_1247
+34 −10
Original line number Diff line number Diff line
@@ -723,14 +723,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 );
@@ -741,6 +741,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++ )
@@ -758,6 +759,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;
@@ -776,6 +778,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 */
@@ -815,7 +839,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 );
@@ -835,7 +859,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 );
@@ -887,7 +911,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;
@@ -937,7 +961,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];
@@ -949,7 +973,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];
@@ -984,7 +1008,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 );
@@ -1004,7 +1028,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 );
@@ -1031,7 +1055,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();
                    }
                }
            }