Commit 047f3afa authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into OPTIMIZE_FFT_STACK

- remove getScaleFactor32_cmplx()
parents 4626e827 88d2208d
Loading
Loading
Loading
Loading
Loading
+1 −60
Original line number Diff line number Diff line
@@ -758,68 +758,9 @@ Word16 getScaleFactor32( /* o: measured headroom in range [

    i = s_and( s_min( i_max, i_min ), 0x1F );

    return i;
}

#ifdef OPTIMIZE_FFT_STACK
/* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
Word16 getScaleFactor32_cmplx(
    cmplx *x,          /* i: array containing 32-bit data */
    const Word16 len_x /* i: length of the array to scan  */
)
{
    Word16 i, i_min, i_max, i_re, i_im;
    Word32 x_min_re, x_max_re, x_min_im, x_max_im;

    x_max_re = 0;
    move32();
    x_min_re = 0;
    move32();
    x_max_im = 0;
    move32();
    x_min_im = 0;
    move32();
    FOR( i = 0; i < len_x; i++ )
    {
        if ( x[i].re >= 0 )
            x_max_re = L_max( x_max_re, x[i].re );
        if ( x[i].re < 0 )
            x_min_re = L_min( x_min_re, x[i].re );
        if ( x[i].im >= 0 )
            x_max_im = L_max( x_max_im, x[i].im );
        if ( x[i].im < 0 )
            x_min_im = L_min( x_min_im, x[i].im );
    }

    i_max = 0x20;
    move16();
    i_min = 0x20;
    move16();

    if ( x_max_re != 0 )
        i_max = norm_l( x_max_re );

    if ( x_min_re != 0 )
        i_min = norm_l( x_min_re );

    i_re = s_and( s_min( i_max, i_min ), 0x1F );

    i_max = 0x20;
    move16();
    i_min = 0x20;
    move16();

    if ( x_max_im != 0 )
        i_max = norm_l( x_max_im );

    if ( x_min_im != 0 )
        i_min = norm_l( x_min_im );

    i_im = s_and( s_min( i_max, i_min ), 0x1F );

    return s_min( i_re, i_im );
    return i;
}
#endif

Word16 getScaleFactor32_copy(                      /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
                              const Word32 *x,     /* i: array containing 32-bit data */
+0 −8
Original line number Diff line number Diff line
@@ -235,14 +235,6 @@ Word16 getScaleFactor32(
    const Word32 *x,      /* i  : array containing 32-bit data */
    const Word16 len_x ); /* i  : length of the array to scan  */

#ifdef OPTIMIZE_FFT_STACK
/* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
Word16 getScaleFactor32_cmplx(
    cmplx *x,          /* i: array containing 32-bit data */
    const Word16 len_x /* i: length of the array to scan  */
);
#endif

Word16 getScaleFactor32_copy(                       /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */
                              const Word32 *x,      /* i: array containing 32-bit data */
                              const Word32 len_x ); /* i: length of the array to scan  */
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ void edct_fx(
    {
        *q = sub( 31, *q );
        move16();
        tmp = sub( getScaleFactor32_cmplx( spec, len1 ), find_guarded_bits_fx( len1 ) );
        tmp = sub( getScaleFactor32( (Word32 *) spec, shl( len1, 1 ) ), find_guarded_bits_fx( len1 ) );
        scale_sig32_cmplx( spec, len1, tmp );

        fft_fx( spec, len1 );
+26 −12
Original line number Diff line number Diff line
@@ -27,7 +27,9 @@ void fine_gain_pred_fx(
    Word16 *xq,              /* i/o: Quantized vector /quantized vector with finegain adj Q15*/
    Word16 *y,               /* i/o: Quantized vector (int)      Q0  */
    Word16 *fg_pred,         /* o  : Predicted fine gains        Q12 */
#ifndef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT
    const Word16 element_mode, /* i  : element mode                    */
#endif
    const Word16 core /* i  : Core                            */
)
{
@@ -74,6 +76,17 @@ void fine_gain_pred_fx(
                exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) );
                L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */

#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT
                IF( EQ_16( sfm_size[0], 10 ) ) /* If sfm_size[0] is 10, it means the extended ACELP->HQ transition frame is used. See hq_configure_fx(). */
                {
                    bw_idx = band_len_idx_ext[shr( bw, 3 )];
                    tmp1 = fine_gain_pred_sqrt_bw_ext[bw_idx];
                }
                ELSE
                {
                    tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
                }
#else
                IF( element_mode == EVS_MONO )
                {
                    tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
@@ -96,6 +109,7 @@ void fine_gain_pred_fx(
#endif
                    }
                }
#endif
                Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb );              /*31-exp+11-15=27-exp */
                gp = round_fx_sat( L_shl_sat( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */
                test();
+5 −1
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@
#define FIX_BASOP_2478_HARM_ENC_PRM_HM                  /* FhG: basop issue 2478: harmonize enc_prm_hm() and enc_prm_hm_ivas_fx() */
#define FIX_2455_HARMONIZE_generate_comfort_noise_enc /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define FIX_2455_HARMONIZE_configureFdCngEnc          /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define FIX_2463_EVS_BWE_LSF                            /* VA: basop issue 2463: harmonize calling of Quant_BWE_LSF_fx() */
#define OPTIMIZE_FFT_STACK                              /* VA: removal of intermediate FFT buffers */
#define HARMONIZE_DCT                                   /* VA: removal of duplicated DCT functions */

@@ -97,8 +98,11 @@
/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_BASOP_2451_HQ_FEC_SELECTOR                  /* Eri: Resolve basop issue 2451, wrong condition on env_stab_plc_fx */
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING        /* FhG: use refinement of Sqrt32 within certain functions*/

#define FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT           /* Eri: Basop issue 2486: IVAS BASOP used calculations with truncation, EVS BASOP used rounding. This aligns the use of a table lookup. */
#define FIX_1543_MID_LSF_BITS                           /* VA: float issue 1543: Resolve "MSAN: use-of-uninitialized-value in lib_enc/lsf_enc.c:262:5 for EVS encoder" */
#define FIX_2488_PREVENT_NEG_PITCH                      /* VA: Fix for 2488, use saturation to prevent possible wrap-around, thus negative pitch values */

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

Loading