Commit 9e068a2b authored by multrus's avatar multrus
Browse files

Merge branch 'cleanup_20220819' into 'main'

Cleanup 20220819

See merge request !85
parents 7fd3fe4f e6c750f6
Loading
Loading
Loading
Loading
Loading

lib_com/ivas_mdft_imdft.c

100644 → 100755
+2 −62
Original line number Diff line number Diff line
@@ -50,72 +50,31 @@

static void ivas_get_mdft_twid_factors(
    const int16_t length,
#ifndef MDFT_ROM_OPTIMIZE
    const float **ppTwid_re,
    const float **ppTwid_im
#else
    const float **ppTwid
#endif
)
    const float **ppTwid )
{
    switch ( length )
    {
        case L_FRAME48k:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_960[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_960[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_960[0];
#endif
            break;
        case L_FRAME32k:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_640[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_640[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_640[0];
#endif

            break;
        case L_FRAME16k:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_320[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_320[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_320[0];
#endif
            break;
        case IVAS_240_PT_LEN:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_240[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_240[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_240[0];
#endif
            break;
        case IVAS_160_PT_LEN:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_160[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_160[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_160[0];
#endif
            break;
        case IVAS_80_PT_LEN:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_80[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_80[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_80[0];
#endif
            break;
        case IVAS_40_PT_LEN:
#ifndef MDFT_ROM_OPTIMIZE
            *ppTwid_re = &ivas_mdft_coeff_cos_twid_40[0];
            *ppTwid_im = &ivas_mdft_coeff_sin_twid_40[0];
#else
            *ppTwid = &ivas_mdft_coeff_cos_twid_40[0];
#endif
            break;

        default:
@@ -256,45 +215,26 @@ void ivas_mdft(
    float re[L_FRAME48k];
    float im[L_FRAME48k];
    int16_t j, len_by_2;
#ifndef MDFT_ROM_OPTIMIZE
    const float *pTwid_re, *pTwid_im;
#else
    const float *pTwid;
#endif
    len_by_2 = mdft_length >> 1;

    ivas_get_mdft_twid_factors( mdft_length,
#ifndef MDFT_ROM_OPTIMIZE
                                &pTwid_re, &pTwid_im
#else
                                &pTwid
#endif
    );
                                &pTwid );

    if ( mdft_length == input_length )
    {
        for ( j = 0; j < mdft_length; j++ )
        {
#ifndef MDFT_ROM_OPTIMIZE
            re[j] = pIn[j] * pTwid_re[j];
            im[j] = -pIn[j] * pTwid_im[j];
#else
            re[j] = pIn[j] * pTwid[j];
            im[j] = -pIn[j] * pTwid[mdft_length - j];
#endif
        }
    }
    else
    {
        for ( j = 0; j < mdft_length; j++ )
        {
#ifndef MDFT_ROM_OPTIMIZE
            re[j] = pIn[j] * pTwid_re[j] - pIn[j + mdft_length] * pTwid_im[j];
            im[j] = -pIn[j] * pTwid_im[j] - pIn[j + mdft_length] * pTwid_re[j];
#else
            re[j] = pIn[j] * pTwid[j] - pIn[j + mdft_length] * pTwid[mdft_length - j];
            im[j] = -pIn[j] * pTwid[mdft_length - j] - pIn[j + mdft_length] * pTwid[j];
#endif
        }
    }

+0 −604

File changed.

Preview size limit exceeded, changes collapsed.

+0 −21
Original line number Diff line number Diff line
@@ -363,33 +363,12 @@ extern const float ivas_cos_twiddle_80[IVAS_80_PT_LEN >> 1];
 *------------------------------------------------------------------------------------------*/

extern const float ivas_mdft_coeff_cos_twid_240[IVAS_240_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_240[IVAS_240_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_160[IVAS_160_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_160[IVAS_160_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_80[IVAS_80_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_80[IVAS_80_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_40[IVAS_40_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_40[IVAS_40_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_960[IVAS_960_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_960[IVAS_960_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_640[IVAS_640_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_640[IVAS_640_PT_LEN];
#endif
extern const float ivas_mdft_coeff_cos_twid_320[IVAS_320_PT_LEN + 1];
#ifndef MDFT_ROM_OPTIMIZE
extern const float ivas_mdft_coeff_sin_twid_320[IVAS_320_PT_LEN];
#endif
extern const int16_t dirac_gains_P_idx[16];
extern const float dirac_gains_norm_term[9];
extern const float dirac_gains_Pnm[91][9];
+0 −4
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/


#define DIRAC_DRCT_GAIN_TUNING                          /* issue 64: tuning of DirAC energy-compensation gains */
#define MDFT_ROM_OPTIMIZE                               /*Optimise ROM tables for MDFT/iMDFT*/
#define LFE_NO_ENTROPY_CODING                           /* issue 65: changes to add no entropy coding in LFE */
#define FIX_79_MASA2TC_BITRATE_SWITCHING                /* Nokia: Fix issue 79 on MASA 2TC bitrate switching crash in decoder. */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+0 −5
Original line number Diff line number Diff line
@@ -729,13 +729,8 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd(
            g1 = 0.3679f + onset_filter[l] * ( 0.1175f - 0.3679f );
            g2 = ( 1.f - g1 ) * *( p_gains_dir );
            g2 += g1 * ( *( p_cy_cross_dir_smooth++ ) );
#ifdef DIRAC_DRCT_GAIN_TUNING
            g2 = max( g2, 0.85f );
            g2 = min( g2, 1.15f );
#else
            g2 = max( g2, 0.5f );
            g2 = min( g2, 2.f );
#endif
            *( p_gains_dir++ ) = g2;
        }
    }
Loading