Commit 537d685e authored by multrus's avatar multrus
Browse files

[cleanup] accept HARM_2336_DOTP

parent 896c25a3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARM_2336_DOTP                                       /* VA: basop 2336; Harmonisation of some dot_product function + some BE optimisation */
#define FIX_2431_AVOID_CALLOC                           /* VA: basp issue 2431: avoid use of calloc() */
#define FIX_2424_REMOVE_GAUSS_L2_ENC                    /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */
#define FIX_MDCT_STEREO_ENC_STACK                       /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */
+0 −27
Original line number Diff line number Diff line
@@ -5590,15 +5590,6 @@ void v_add_fx_me(
    const Word16 N,    /* i  : Vector length                                    */
    const Word16 hdrm  /* i  : headroom for when subtraction result > 1 or < -1 */
);
#ifndef HARM_2336_DOTP
void v_add_w64(
    const Word64 x1[], /* i  : Input vector 1                                   */
    const Word64 x2[], /* i  : Input vector 2                                   */
    Word64 y[],        /* o  : Output vector that contains vector 1 - vector 2  */
    const Word16 N,    /* i  : Vector length                                    */
    const Word16 hdrm  /* i  : headroom for when subtraction result > 1 or < -1 */
);
#endif
void v_sub_fx(
    const Word32 x1[], /* i  : Input vector 1                                   */
    const Word32 x2[], /* i  : Input vector 2                                   */
@@ -5628,15 +5619,6 @@ Word32 dotp_fx32_o(
    const Word16 n,       /* i  : vector length                 */
    const Word16 log_len, /* i  : max factor added to result q after dot product (equal to log2(n))                 */
    Word16 *res_q );
#ifndef HARM_2336_DOTP
Word32 dotp_fx32_fac(
    const Word32 x[],     /* i  : vector x[]                    */
    const Word32 y[],     /* i  : vector y[]                    */
    const Word16 n,       /* i  : vector length                 */
    const Word16 log_len, /* i  : max factor added to result q after dot product (equal to log2(n))                 */
    Word16 *res_q         /*stores resultant Q*/
);
#endif
Word32 dotp_fx_ivas_fx(
    const Word32 x[], /* i  : vector x[]                    */
    Word16 x_e,
@@ -5650,15 +5632,6 @@ Word32 dotp_fx_guarded(
    const Word32 y[], /* i  : vector y[]                    */
    const Word16 n    /* i  : vector length                 */
);
#ifndef HARM_2336_DOTP
Word32 dotp_me_fx(
    const Word32 x[], /* i  : vector x[]                    */
    const Word32 y[], /* i  : vector y[]                    */
    const Word16 n,   /* i  : vector length                 */
    Word16 exp_x,
    Word16 exp_y,
    Word16 *exp_suma );
#endif
void lsf_end_dec_fx(
    Decoder_State *st,           /* i/o: decoder state structure                 */
    Word16 mode2_flag,           /* Q0 */
+0 −103
Original line number Diff line number Diff line
@@ -630,63 +630,6 @@ Word32 dotp_fx32_o(
    return W_extract_l( suma );
}

#ifndef HARM_2336_DOTP
Word32 dotp_fx32_fac(
    const Word32 x[],     /* i  : vector x[]                    */
    const Word32 y[],     /* i  : vector y[]                    */
    const Word16 n,       /* i  : vector length                 */
    const Word16 log_len, /* i  : max factor added to result q after dot product (equal to log2(n))                 */
    Word16 *res_q         /*stores resultant Q*/
)
{
    Word16 i;
    Word64 suma; /*resultant q= q(x)+q(y)-9-x such that q<=31*/

    suma = W_shr( W_mult_32_32( x[0], y[0] ), log_len );

    FOR( i = 1; i < n; i++ )
    {
        suma = W_add( suma, W_shr( W_mult_32_32( x[i], y[i] ), log_len ) );
    }
    *res_q = add( *res_q, add( sub( *res_q, log_len ), 1 ) );
    move16();
    test();
    test();
    FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); )
    {
        suma = W_shr( suma, 1 );
        *res_q = sub( *res_q, 1 );
        move16();
    }
    return W_extract_l( suma );
}


/*-------------------------------------------------------------------*
 * v_add_w64()
 *
 * Subtraction of two vectors sample by sample
 *-------------------------------------------------------------------*/

void v_add_w64(
    const Word64 x1[], /* i  : Input vector 1                                   */
    const Word64 x2[], /* i  : Input vector 2                                   */
    Word64 y[],        /* o  : Output vector that contains vector 1 - vector 2  */
    const Word16 N,    /* i  : Vector length                                    */
    const Word16 hdrm  /* i  : headroom for when subtraction result > 1 or < -1 */
)
{
    Word16 i;

    FOR( i = 0; i < N; i++ )
    {
        y[i] = W_add( W_shr( x1[i], hdrm ), W_shr( x2[i], hdrm ) );
        move64();
    }

    return;
}
#endif


/*-------------------------------------------------------------------*
@@ -704,18 +647,12 @@ void v_sub_fx(
)
{
    Word16 i;
#ifdef HARM_2336_DOTP
    Word32 wtmp;
    assert( hdrm < 31 && hdrm > 0 );
    wtmp = L_shl_sat( 1, sub( 31, hdrm ) );
#endif
    FOR( i = 0; i < N; i++ )
    {
#ifndef HARM_2336_DOTP
        y[i] = L_sub( L_shr( x1[i], hdrm ), L_shr( x2[i], hdrm ) );
#else
        y[i] = Msub_32_32( Mpy_32_32( x1[i], wtmp ), x2[i], wtmp );
#endif
        move32();
    }

@@ -5152,30 +5089,6 @@ UWord32 mvl2s_r(

    return noClipping;
}
#ifndef HARM_2336_DOTP
Word32 dotp_me_fx(
    const Word32 x[], /* i  : vector x[]                    */
    const Word32 y[], /* i  : vector y[]                    */
    const Word16 n,   /* i  : vector length                 */
    Word16 exp_x,
    Word16 exp_y,
    Word16 *exp_suma )
{
    Word16 i;
    Word32 suma;
    Word32 mul;
    Word16 mul_exp = add( exp_x, exp_y );
    suma = Mpy_32_32( x[0], y[0] );
    *exp_suma = mul_exp;
    FOR( i = 1; i < n; i++ )
    {
        mul = Mpy_32_32( x[i], y[i] );
        suma = BASOP_Util_Add_Mant32Exp( suma, *exp_suma, mul, mul_exp, exp_suma ); // exp_x+exp_A
    }

    return suma;
}
#endif
Word32 dotp_fx_guarded(
    const Word32 x[], /* i  : vector x[]                    */
    const Word32 y[], /* i  : vector y[]                    */
@@ -5204,21 +5117,6 @@ Word32 dotp_fx_ivas_fx(
    const Word16 n, /* i  : vector length                 */
    Word16 *out_e )
{
#ifndef HARM_2336_DOTP
    Word16 i, exp;
    Word32 suma = 0;

    exp = 31;
    move16();

    FOR( i = 0; i < n; i++ )
    {
        suma = BASOP_Util_Add_Mant32Exp( suma, exp, Mpy_32_32( x[i], y[i] ), x_e + y_e, &exp );
    }

    *out_e = exp;
    move16();
#else
    Word16 i;
    Word32 suma;
    Word32 mul;
@@ -5231,7 +5129,6 @@ Word32 dotp_fx_ivas_fx(
        mul = Mpy_32_32( x[i], y[i] );
        suma = BASOP_Util_Add_Mant32Exp( suma, *out_e, mul, mul_exp, out_e ); // exp_x+exp_A
    }
#endif
    return suma;
}

+0 −5
Original line number Diff line number Diff line
@@ -235,17 +235,12 @@ static void getCorrelationMatrix_fx(

                FOR( n = 0; n < nSubframes; n++ )
                {
#ifndef HARM_2336_DOTP
                    res_q = sub( 31, sts[0]->hTcxEnc->spectrum_e[0] );
                    L_tmp = dotp_fx32_fac( sts[ch1]->hTcxEnc->spectrum_fx[n], sts[ch2]->hTcxEnc->spectrum_fx[n], L_subframe, 1, &res_q );
#else
                    Word16 tmp_Q;
                    res_q = sub( 31, sts[0]->hTcxEnc->spectrum_e[0] );
                    tmp_Q = res_q;
                    move16();
                    L_tmp = dotp_fx32_o( sts[ch1]->hTcxEnc->spectrum_fx[n], sts[ch2]->hTcxEnc->spectrum_fx[n], L_subframe, 1, &res_q );
                    res_q = add( res_q, tmp_Q );
#endif
                    xCorrMatrix[ch1][ch2] = BASOP_Util_Add_Mant32Exp( xCorrMatrix[ch1][ch2], xCorrMatrix_exp[ch1][ch2], L_tmp, sub( 31, res_q ), &xCorrMatrix_exp[ch1][ch2] );
                    move32();
                }
+0 −4
Original line number Diff line number Diff line
@@ -1740,11 +1740,7 @@ Word16 ivas_smc_gmm_fx(
        move16();
        len = mel_fb_len[i];
        move16();
#ifndef HARM_2336_DOTP
        temp32 = dotp_me_fx( &PS_fx[j], pt_mel_fb_fx, len, 31 - Qfact_PS, Q1, &dotp_exp );
#else
        temp32 = dotp_fx_ivas_fx( &PS_fx[j], 31 - Qfact_PS, pt_mel_fb_fx, Q1, len, &dotp_exp );
#endif
        IF( LT_16( dotp_exp, -17 ) ) /*-18 is exponent of 10737:to avoid overflow when left shifting 10737*/
        {
            temp32 = L_shr( temp32, sub( -17, dotp_exp ) );