Commit 3982d1d7 authored by vaclav's avatar vaclav
Browse files

keep cdftForw()

parent 34e13c26
Loading
Loading
Loading
Loading
Loading
+16 −34
Original line number Diff line number Diff line
@@ -86,13 +86,14 @@
 * Local function prototypes
 *-----------------------------------------------------------------*/

#ifndef HARMONIZE_DoRTFTn
static void cdftForw( Word16 n, Word32 *a, const Word16 *ip, const Word16 *w );
#ifndef HARMONIZE_DoRTFTn
static void bitrv2_SR( Word16 n, const Word16 *ip, Word32 *a );
#endif
static void cftfsub( Word16 n, Word32 *a, const Word16 *w );
static void cft1st( Word16 n, Word32 *a, const Word16 *w );
static void cftmdl( Word16 n, Word16 l, Word32 *a, const Word16 *w );
#endif

static void fft16_ivas( Word32 *x, Word32 *y, const Word16 *Idx );
static void fft5_shift1( Word16 n1, Word32 *zRe, Word32 *zIm, const Word16 *Idx );
static void fft8( Word32 *x, Word32 *y, const Word16 *Idx );
@@ -1087,11 +1088,7 @@ static void fft64(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 128, z, Ip_fft64, w_fft64_fx );
#else
    cdftForw( 128, z, Ip_fft64, w_fft64_fx );
#endif

    FOR( i = 0; i < 64; i++ )
    {
@@ -1133,11 +1130,7 @@ static void fft32_15(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 64, z, Ip_fft32, w_fft32_fx );
#else
    cdftForw( 64, z, Ip_fft32, w_fft32_fx );
#endif

    FOR( i = 0; i < 32; i++ )
    {
@@ -1178,11 +1171,7 @@ static void fft32_5(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 64, z, Ip_fft32, w_fft32_fx );
#else
    cdftForw( 64, z, Ip_fft32, w_fft32_fx );
#endif

    FOR( i = 0; i < 32; i++ )
    {
@@ -1223,11 +1212,7 @@ static void fft16_ivas(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 32, z, Ip_fft16, w_fft16_fx );
#else
    cdftForw( 32, z, Ip_fft16, w_fft16_fx );
#endif

    FOR( i = 0; i < 16; i++ )
    {
@@ -1268,11 +1253,7 @@ static void fft8(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 16, z, Ip_fft8, w_fft8_fx );
#else
    cdftForw( 16, z, Ip_fft8, w_fft8_fx );
#endif

    FOR( i = 0; i < 8; i++ )
    {
@@ -1311,11 +1292,7 @@ static void fft8_5(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 16, z, Ip_fft8, w_fft8_fx );
#else
    cdftForw( 16, z, Ip_fft8, w_fft8_fx );
#endif

    FOR( i = 0; i < 8; i++ )
    {
@@ -1456,7 +1433,7 @@ static void fft4_5(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
#ifdef HARMONIZE_DoRTFTnAA
    cdftForw_fx( 8, z, Ip_fft4, w_fft4_fx );
#else
    cdftForw( 8, z, Ip_fft4, w_fft4_fx );
@@ -1787,11 +1764,7 @@ void DoRTFT128_fx(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 256, z, Ip_fft128, w_fft128_fx );
#else
    cdftForw( 256, z, Ip_fft128, w_fft128_fx );
#endif

    x[0] = z[0];
    move32();
@@ -1808,7 +1781,7 @@ void DoRTFT128_fx(
    return;
}

#ifndef HARMONIZE_DoRTFTn

/*-----------------------------------------------------------------*
 * cdftForw()
 * Main fuction of Complex Discrete Fourier Transform
@@ -1822,12 +1795,20 @@ static void cdftForw(
)
{
    /* bit reversal */
#ifdef HARMONIZE_DoRTFTn
    bitrv2_SR_fx( n, ip + 2, a );
#else
    bitrv2_SR( n, ip + 2, a );
#endif

    /* Do FFT */
    cftfsub( n, a, w );

    return;
}


#ifndef HARMONIZE_DoRTFTn
/*-----------------------------------------------------------------*
 * bitrv2_SR()
 * Bit reversal
@@ -2029,6 +2010,7 @@ static void bitrv2_SR(

    return;
}
#endif

/*-----------------------------------------------------------------*
 * cftfsub()
@@ -2471,7 +2453,7 @@ static void cftmdl(

    return;
}
#endif

#ifndef HARMONIZE_DCT
static void cftbsub(
    Word16 n,       // Q0
+8 −6
Original line number Diff line number Diff line
@@ -36,10 +36,10 @@ static void fft64_16fx( Word16 *x, Word16 *y, const Word16 *Idx );
static void fft5_32_16fx( Word16 *zRe, Word16 *zIm, const Word16 *Idx );
static void cdftForw_16fx( Word16 n, Word16 *a, const Word16 *ip, const Word32 *w );

#ifndef HARMONIZE_DoRTFTn
static void cdftForw_fx( Word16 n, Word32 *a, const Word16 *ip, const Word16 *w );
#endif
#ifndef HARMONIZE_DoRTFTn
static void bitrv2_SR_fx( Word16 n, const Word16 *ip, Word32 *a );
#endif
static void cftfsub_fx( Word16 n, Word32 *a, const Word16 *w );
static void cft1st_fx( Word16 n, Word32 *a, const Word16 *w );
static void cftmdl_fx( Word16 n, Word16 l, Word32 *a, const Word16 *w );
@@ -185,11 +185,8 @@ void DoRTFTn_fx(
 * cdftForw_fx()
 * Main fuction of Complex Discrete Fourier Transform
 *-----------------------------------------------------------------*/
#ifdef HARMONIZE_DoRTFTn
void cdftForw_fx(
#else

static void cdftForw_fx(
#endif
    Word16 n,         /* i    : data length of real and imag              */
    Word32 *a,        /* i/o  : input/output data                     Q(q)*/
    const Word16 *ip, /* i    : work area for bit reversal                */
@@ -209,7 +206,12 @@ static void cdftForw_fx(
 * bitrv2_SR_fx()
 * Bit reversal
 *-----------------------------------------------------------------*/

#ifdef HARMONIZE_DoRTFTn
void bitrv2_SR_fx(
#else
static void bitrv2_SR_fx(
#endif
    Word16 n,         /* i    : data length of real and imag              */
    const Word16 *ip, /* i/o  : work area for bit reversal                */
    Word32 *a         /* i/o  : input/output data                     Q(q)*/
+24 −3
Original line number Diff line number Diff line
@@ -52,9 +52,17 @@
#define IVAS_MDCT_SCALING_GAIN_16k_Q31 0X00003193 /* 5.909703592235439e-06f */
#define IVAS_MDCT_SCALING_GAIN_16k_Q46 0x18C97EF4


#define IVAS_ONE_BY_IMDCT_SCALING_GAIN_Q16 0x08432A51 /* 1 / 2115.165304808f */

#ifdef HARMONIZE_DoRTFTn

/*------------------------------------------------------------------------------------------*
 * Local functions prototypes
 *------------------------------------------------------------------------------------------*/

static void ivas_get_twid_factors_fx( const Word16 length, const Word16 **pTwid_re, const Word16 **pTwid_im );

#endif

/*-----------------------------------------------------------------------------------------*
 * Function ivas_tda_fx()
@@ -154,7 +162,11 @@ void ivas_mdct_fx(
    len_by_2 = shr( length, 1 );
    ivas_mdct_scaling_gain = ivas_get_mdct_scaling_gain_fx( len_by_2 ); // Q46

#ifdef HARMONIZE_DoRTFTn
    ivas_get_twid_factors_fx( length, &pTwid_re, &pTwid_im );
#else
    ivas_get_twid_factors_fx1( length, &pTwid_re, &pTwid_im );
#endif

    FOR( i = 0; i < len_by_2; i++ )
    {
@@ -299,8 +311,11 @@ void ivas_imdct_fx(
    Word32 im[IVAS_480_PT_LEN];
    len_by_2 = shr( length, 1 );

#ifdef HARMONIZE_DoRTFTn
    ivas_get_twid_factors_fx( length, &pTwid_re, &pTwid_im );
#else
    ivas_get_twid_factors_fx1( length, &pTwid_re, &pTwid_im );

#endif
    FOR( i = 0; i < len_by_2; i++ )
    {
        re[i] = L_add( Mpy_32_16_1( pIn[length - 2 * i - 1], pTwid_re[i] ), Mpy_32_16_1( pIn[2 * i], pTwid_im[i] ) ); /*stl_arr_index  Q24*/
@@ -310,6 +325,7 @@ void ivas_imdct_fx(
    }

    ivas_ifft_cplx( &re[0], &im[0], len_by_2 );

    IF( len_by_2 > 0 )
    {
        *q_out = sub( *q_out, Q15 );
@@ -351,11 +367,16 @@ void ivas_imdct_fx(


/*-----------------------------------------------------------------------------------------*
 * Function ivas_get_twid_factors_fx1()
 * Function ivas_get_twid_factors_fx()
 *
 * Sets/Maps the fft twiddle tables based on fft length
 *-----------------------------------------------------------------------------------------*/

#ifdef HARMONIZE_DoRTFTn
static void ivas_get_twid_factors_fx(
#else
void ivas_get_twid_factors_fx1(
#endif
    const Word16 length,      // Q0
    const Word16 **pTwid_re,  // Q15
    const Word16 **pTwid_im ) // Q15
+2 −0
Original line number Diff line number Diff line
@@ -216,12 +216,14 @@ void ivas_dct_windowing_fx(
    Word32 *pTemp_lfe 
);

#ifndef HARMONIZE_DoRTFTn
void ivas_get_twid_factors_fx1(
    const Word16 length,     // Q0
    const Word16 **pTwid_re, // Q15
    const Word16 **pTwid_im 
);

#endif
Word32 ivas_get_mdct_scaling_gain_fx(
    const Word16 dct_len_by_2 
);
+4 −5
Original line number Diff line number Diff line
@@ -4044,11 +4044,10 @@ void BASOP_cfft( cmplx *pComplexBuf, Word16 sizeOfFft, Word16 *scale, Word32 wor
void BASOP_rfft( Word32 *x, Word16 sizeOfFft, Word16 *scale, Word16 isign );

#ifdef HARMONIZE_DoRTFTn
void cdftForw_fx(
    Word16 n,         /* i    : data length of real and imag              */
    Word32 *a,        /* i/o  : input/output data                     Q(q)*/
    const Word16 *ip, /* i    : work area for bit reversal                */
    const Word16 *w   /* i    : cos/sin table                          Q14*/
void bitrv2_SR_fx(
    Word16 n,         /* i  : data length of real and imag Q0 */
    const Word16 *ip, /* i/o: work area for bit reversal Q0   */
    Word32 *a         /* i/o: input/output data Qx            */
);
#endif