Commit af2d6a5a authored by vaclav's avatar vaclav
Browse files

HARMONIZE_DoRTFTn

parent dd5db31f
Loading
Loading
Loading
Loading
Loading
+47 −7
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@
 * Local constants
 *-----------------------------------------------------------------*/

#define Mpy_32_xx Mpy_32_16_1

#define FFTC( x ) WORD322WORD16( (Word32) x )

/* DCT related */
@@ -83,17 +81,18 @@
#define FFT_C165 ( FFTC( 0x30fbc54d ) ) /* FL2WORD32( 3.826834323650898e-1)  COS_3PI_DIV8 Q15*/
#define FFT_C166 ( FFTC( 0xcf043ab3 ) ) /* FL2WORD32(-3.826834323650898e-1) -COS_3PI_DIV8 Q15*/

#define SCALEFACTOR16 ( 0 )
#define SCALEFACTOR20 ( 0 )

/*-----------------------------------------------------------------*
 * Local function prototypes
 *-----------------------------------------------------------------*/

#ifndef HARMONIZE_DoRTFTn
static void cdftForw( Word16 n, Word32 *a, const Word16 *ip, const Word16 *w );
static void bitrv2_SR( Word16 n, const Word16 *ip, Word32 *a );
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 );
@@ -1088,7 +1087,11 @@ 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++ )
    {
@@ -1130,7 +1133,11 @@ 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++ )
    {
@@ -1171,7 +1178,11 @@ 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++ )
    {
@@ -1212,7 +1223,11 @@ 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++ )
    {
@@ -1253,7 +1268,11 @@ 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++ )
    {
@@ -1292,7 +1311,11 @@ 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++ )
    {
@@ -1433,7 +1456,11 @@ static void fft4_5(
        move32();
    }

#ifdef HARMONIZE_DoRTFTn
    cdftForw_fx( 8, z, Ip_fft4, w_fft4_fx );
#else
    cdftForw( 8, z, Ip_fft4, w_fft4_fx );
#endif

    FOR( i = 0; i < 4; i++ )
    {
@@ -1760,7 +1787,11 @@ 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();
@@ -1777,6 +1808,7 @@ void DoRTFT128_fx(
    return;
}

#ifndef HARMONIZE_DoRTFTn
/*-----------------------------------------------------------------*
 * cdftForw()
 * Main fuction of Complex Discrete Fourier Transform
@@ -2439,7 +2471,7 @@ static void cftmdl(

    return;
}

#endif
#ifndef HARMONIZE_DCT
static void cftbsub(
    Word16 n,       // Q0
@@ -2737,7 +2769,7 @@ void edct2_fx_ivas(
    }
}
#endif

#ifndef HARMONIZE_DoRTFTn
void DoRTFTn_fx_ivas(
    Word32 *x,     /* i/o: real part of input and output data Qx      */
    Word32 *y,     /* i/o: imaginary part of input and output data Qx */
@@ -2793,7 +2825,7 @@ void DoRTFTn_fx_ivas(

    return;
}

#endif
#ifndef HQ_ALIGN_DUPLICATED_CODE
void fft3_fx_ivas(
    const Word32 X[], // Qx
@@ -4277,7 +4309,11 @@ void DoFFT_fx(
            DoRTFT320_fx( re2, im2 );
            BREAK;
        case 256:
#ifdef HARMONIZE_DoRTFTn
            DoRTFTn_fx( re2, im2, NULL, 256 );
#else
            DoRTFTn_fx_ivas( re2, im2, 256 );
#endif
            BREAK;
        case 240:
            DoRTFT240( re2, im2 );
@@ -4301,7 +4337,11 @@ void DoFFT_fx(
            DoRTFT80_fx( re2, im2 );
            BREAK;
        case 64:
#ifdef HARMONIZE_DoRTFTn
            DoRTFTn_fx( re2, im2, NULL, 64 );
#else
            DoRTFTn_fx_ivas( re2, im2, 64 );
#endif
            BREAK;
        case 40:
            DoRTFT40_fx( re2, im2 );
+30 −0
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ 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
static void bitrv2_SR_fx( Word16 n, const Word16 *ip, Word32 *a );
static void cftfsub_fx( Word16 n, Word32 *a, const Word16 *w );
static void cft1st_fx( Word16 n, Word32 *a, const Word16 *w );
@@ -90,27 +92,51 @@ void DoRTFTn_fx(

    IF( EQ_16( n, 16 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft16, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft16, w_fft512_fx_evs );
#endif
    }
    ELSE IF( EQ_16( n, 32 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft32, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft32, w_fft512_fx_evs );
#endif
    }
    ELSE IF( EQ_16( n, 64 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft64, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft64, w_fft512_fx_evs );
#endif
    }
    ELSE IF( EQ_16( n, 128 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft128, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft128, w_fft512_fx_evs );
#endif
    }
    ELSE IF( EQ_16( n, 256 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft256, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft256, w_fft512_fx_evs );
#endif
    }
    ELSE IF( EQ_16( n, 512 ) )
    {
#ifdef HARMONIZE_DoRTFTn
        cdftForw_fx( 2 * n, z, Ip_fft512, w_fft512_fx );
#else
        cdftForw_fx( 2 * n, z, Ip_fft512, w_fft512_fx_evs );
#endif
    }
    ELSE
    {
@@ -159,7 +185,11 @@ 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                */
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@
#define FIX_FLOAT_1528_5MS_REND_ISM_META_DELAY_COMPENSATION  /* Nokia: float issue 1528: Fixes incorrect compensation for ISM metadata delay in 5ms TD rendering */
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING        /* FhG: use refinement of Sqrt32 within certain functions*/
#define FIX_2462_PARCOR_FIX                             /* VA: issue 2462: Fix bug in calculating parcor coefficient in Calc_rc0_h() */
#define HARMONIZE_DoRTFTn                               /* VA: harmonize functions DoRTFTn_fx() and DoRTFTn_fx_ivas() */

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

+12 −2
Original line number Diff line number Diff line
@@ -4067,6 +4067,15 @@ void fft16( Word32 *re, Word32 *im, Word16 s, Word16 bScale );
void BASOP_cfft( cmplx *pComplexBuf, Word16 sizeOfFft, Word16 *scale, Word32 workBuffer[2 * BASOP_CFFT_MAX_LENGTH] );
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*/
);
#endif

void DoRTFTn_fx(
    Word32 *x, /* i/o : real part of i   and output data       */
    Word32 *y, /* i/o : imaginary part of i   and output data  */
@@ -4146,12 +4155,13 @@ void rfft_fx(
    const Word16 isign   /* i  : sign                      */
);

#ifndef HARMONIZE_DoRTFTn
void DoRTFTn_fx_ivas(
    Word32 *x,     /* i/o: real part of input and output data       */
    Word32 *y,     /* i/o: imaginary part of input and output data  */
    const Word16 n /* i  : size of the FFT up to 1024 */
);

#endif
Word16 find_guarded_bits_fx( const Word32 n );

Word16 L_norm_arr( const Word32 *arr, Word16 size );
+2 −0
Original line number Diff line number Diff line
@@ -1080,7 +1080,9 @@ extern const Word16 Ip_fft128[10]; // Q0
extern const Word32 w_fft128_16fx[64];    // Q30
extern const Word16 Ip_fft256[10];        // Q0
extern const Word16 Ip_fft512[18];        // Q0
#ifndef HARMONIZE_DoRTFTn
extern const Word16 w_fft512_fx_evs[256]; // Q14
#endif
extern const Word16 Idx_dortft40[40];     // Q0
extern const Word16 Odx_fft8_5[8];        // Q0
extern const Word16 ip_edct2_64[6];       // Q0
Loading