Commit a9b39e0f authored by vaillancour's avatar vaillancour
Browse files

Merge branch 'voiceage/prec_compl' into 'main'

[non-BE] [allow regression] [split-non-BE] [Rend non-BE] BASOP precision and complexity improvements

See merge request !1309
parents f48f63ab 6f187732
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1375,7 +1375,11 @@ void pca_enc_s3_fx(

    q_ang_2surv_fx( ph1_fx, n1, ph1_q_fx, ind1 );

#ifdef FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE
    tmp = mac_r( L_mac( L_mult( q_fx[1], q_fx[1] ), q_fx[2], q_fx[2] ), q_fx[3], q_fx[3] ); // Q15 + Q15 - Q15 -> Q15
#else
    tmp = add( add( mult( q_fx[1], q_fx[1] ), mult( q_fx[2], q_fx[2] ) ), mult( q_fx[3], q_fx[3] ) ); // Q15 + Q15 - Q15 -> Q15
#endif
    r_e = 0;
    move16();
    r_fx = Sqrt16( tmp, &r_e );
@@ -1429,8 +1433,11 @@ void pca_enc_s3_fx(
        q_ang_2surv_fx( ph2_fx, n2[i], ph2_q_fx + 2 * i, ind2 + 2 * i );
    }

#ifdef FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE
    r_fx = Sqrt16( mac_r( L_mult( q_fx[2], q_fx[2] ), q_fx[3], q_fx[3] ), &r_e );
#else
    r_fx = Sqrt16( add( mult( q_fx[2], q_fx[2] ), mult( q_fx[3], q_fx[3] ) ), &r_e );

#endif

    v_fx = BASOP_Util_Divide1616_Scale( q_fx[2], r_fx, &v_e );
    v_e = add( v_e, sub( 0, r_e ) );
+3 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */
#define FIX_2254_IMPROV_COMPLEXITY_BE                   /* VA: BE small complexity reduction  */

/* #################### End BE switches ################################## */

@@ -99,6 +100,7 @@
#define FIX_2041_SPECTRAL_GAPS_FOR_INACTIVE_FRAMES      /* FhG: Using rounding in multiplication to improve precision in cngNoiseLevel[] */
#define FIX_2264_OUT_OF_BOUND_READING_IN_LOG2_NORM_LC   /* VA: Fix issue 2264 by adding a proper safeguard in log2 and by adding a missing normalization in swb_pre_proc_ivas_fx()*/
#define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT  /* Dolby: Issue 2250:  random vector generation in GenShapedSHBExcitation() */
#define FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE  /* VA: Precision improvement without increasing complexity, or complexity reduction that might be not BE on the LSB */

/* ##################### End NON-BE switches ########################### */

@@ -117,4 +119,5 @@

/* #################### End BASOP optimization switches ############################ */


#endif
+5 −1
Original line number Diff line number Diff line
@@ -58,9 +58,13 @@ void pred_lt4_ivas_fx(
            FOR( i = 0; i < nb_coef; i++ )
            {
                /*s += (*x1--) * (*c1) + (*x2++) * (*c2);*/
#ifdef FIX_2254_IMPROV_COMPLEXITY_BE
                s64 = W_mac_32_16( s64, ( *c1 ), *x1-- ); /* Q_exc + Q32 */
                s64 = W_mac_32_16( s64, ( *c2 ), *x2++ ); /* Q_exc + Q32 */
#else
                s64 = W_mac_32_32( s64, L_deposit_l( *x1-- ), ( *c1 ) ); /* Q_exc + Q32 */
                s64 = W_mac_32_32( s64, L_deposit_l( *x2++ ), ( *c2 ) ); /* Q_exc + Q32 */

#endif
                c1 += up_sample;
                c2 += up_sample;
            }
+4 −0
Original line number Diff line number Diff line
@@ -1041,7 +1041,11 @@ Word16 res_bpf_adapt_ivas_fx(
        bpf_error_ratio = ONE_IN_Q14; // Q13
        move16();
    }
#ifdef FIX_2254_IMPROV_PRECISION_OR_COMPLEXITY_NON_BE
    bpf_error_ratio = mac_r( L_mult( STEREO_DFT_BPF_ADAPT_BETA_FX, bpf_error_ratio ), ( MAX_16 - STEREO_DFT_BPF_ADAPT_BETA_FX ), hStereoDft->bpf_error_ratio_mem_fx );
#else
    bpf_error_ratio = add( mult( STEREO_DFT_BPF_ADAPT_BETA_FX, bpf_error_ratio ), mult( ( MAX_16 - STEREO_DFT_BPF_ADAPT_BETA_FX ), hStereoDft->bpf_error_ratio_mem_fx ) );
#endif
    hStereoDft->bpf_error_ratio_mem_fx = bpf_error_ratio;
    move16();

+8 −0
Original line number Diff line number Diff line
@@ -81,7 +81,11 @@ static void sns_1st_dec_fx(

    FOR( i = 0; i < M / 2; i++ )
    {
#ifdef FIX_2254_IMPROV_COMPLEXITY_BE
        snsq_fx[i] = L_mac( L_mult( ( *p_dico++ ), cdbk_fix ), means[i], means_fix ); // Q16
#else
        snsq_fx[i] = L_add( L_mult( ( *p_dico++ ), cdbk_fix ), L_mult( means[i], means_fix ) ); // Q16
#endif
        move32();
    }

@@ -89,7 +93,11 @@ static void sns_1st_dec_fx(

    FOR( i = M / 2; i < M; i++ )
    {
#ifdef FIX_2254_IMPROV_COMPLEXITY_BE
        snsq_fx[i] = L_mac( L_mult( ( *p_dico++ ), cdbk_fix ), means[i], means_fix ); /*Q16*/
#else
        snsq_fx[i] = L_add( L_mult( ( *p_dico++ ), cdbk_fix ), L_mult( means[i], means_fix ) ); /*Q16*/
#endif
        move32();
    }

Loading