Commit d62b512d authored by multrus's avatar multrus
Browse files

remove switch FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31

parent ea79cf43
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1095,15 +1095,7 @@ static Word16 ivas_calculate_abs_fr_fx(
                move16();
            }

#ifndef FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31
            pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] = L_shr( Mult_32_16( pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i], tmp ), exp_diff );
#else
            /* Note: 16-bit division result has bad accuracy for num=denom */
            Word32 L_tmp = BASOP_Util_Divide3232_Scale_cadence( pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i], sum_over_spar_bands_fx, &exp_diff ); // Q31
            if ( exp_diff != 0 )
                L_tmp = L_shl_sat( L_tmp, exp_diff );                            /* convert to Q31 with saturation */
            pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] = L_tmp; // Q31
#endif
            move32();
        }
        pFb->fb_bin_to_band.p_spar_start_bands[j] = spar_start;
+0 −1
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@
/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS  /* FhG: Defines 1.0f-weight variables, uses Madd operation instead of L_add_sat */
#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SPLIT_LOOPS           /* FhG: Splits single loop with IF-statements into two low-complex loops */
//#define FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31          /* FhG: BUGFIX2-FAILURE: +ivas_fb_mixer.c: Saturate weight parameters during reformatting in Q31, BUGFIX1 is obsolete, do not activate, fails with SBA rendering */
#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SATURATE_WEIGHTS      /* FhG: BUGFIX1: Saturate weight parameters during reformatting in Q22, fixes overflow in extract_l */
#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_HQ_CONSTANTS          /* FhG: IMPROVE PRECISION: Uses 1/6 and 1/20 in full-precise Q31 constants instead of Q15 */
#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL        /* FhG: Uses unique shift amount in each loop iteration */
+0 −10
Original line number Diff line number Diff line
@@ -1928,21 +1928,15 @@ void ivas_spar_dec_upmixer_sf_fx(
                            FOR( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ )
                            {
                                /* accumulate contributions from all SPAR bands */
#ifndef FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31
#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SATURATE_WEIGHTS
                                acc = W_mac_32_32( acc, mixer_mat_fx[out_ch][in_ch][spar_band], bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band] ); // q1+ Q23
#else
                                Word32 tmp = L_shl_sat( bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band], 9 );    /*Q22 -> Q31(sat)*/
                                cldfb_par_fx = L_add_sat( cldfb_par_fx, Mpy_32_32( mixer_mat_fx[out_ch][in_ch][spar_band], tmp ) ); /*q1*/
#endif
#else
                                cldfb_par_fx = L_add_sat( cldfb_par_fx, Mpy_32_32( mixer_mat_fx[out_ch][in_ch][spar_band], bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band] ) ); /*q1*/
#endif /* FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31 */
                            }
#ifndef FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31
#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SATURATE_WEIGHTS
                            cldfb_par_fx = W_shl_sat_l( acc, -23 ); // q1
#endif
#endif
                        }

@@ -2036,7 +2030,6 @@ void ivas_spar_dec_upmixer_sf_fx(
                        FOR( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ )
                        {
                            /* accumulate contributions from all SPAR bands */
#ifndef FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31
#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SATURATE_WEIGHTS
                            Word16 tmp = extract_l( L_shr( bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band], 7 ) ); /*Q15*/
                            cldfb_par_fx = L_add_sat( cldfb_par_fx, Mpy_32_16_1( mixer_mat_fx[out_ch][in_ch][spar_band], tmp ) );     /*q1*/
@@ -2044,9 +2037,6 @@ void ivas_spar_dec_upmixer_sf_fx(
                            Word32 tmp = L_shl_sat( bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band], 9 );    /*Q22 -> Q31(sat)*/
                            cldfb_par_fx = L_add_sat( cldfb_par_fx, Mpy_32_32( mixer_mat_fx[out_ch][in_ch][spar_band], tmp ) ); /*q1*/
#endif
#else
                            cldfb_par_fx = L_add_sat( cldfb_par_fx, Mpy_32_32( mixer_mat_fx[out_ch][in_ch][spar_band], bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band] ) ); /*q1*/
#endif /* FIX_1101_IVAS_SPAR_DEC_SATURATE_WEIGHTS_IN_Q31 */
                        }
                        Out_re_fx = Madd_32_32( Out_re_fx, cldfb_in_ts_re_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); /*q1-25*/
                        Out_im_fx = Madd_32_32( Out_im_fx, cldfb_in_ts_im_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); /*q1-25*/