Commit afc6325b authored by vaclav's avatar vaclav
Browse files

- SBA_CLEANING: replace IVAS_LFE_FADE_LEN_SEC_FLOAT by IVAS_LFE_FADE_NS

- remove unused constants
parent c9c13442
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -49,15 +49,13 @@
#define _180_OVER_PI                            ( 180.0f / EVS_PI )

#define SQRT2                                   1.414213562373095f
#define SQRT2_OVER_2                            (SQRT2 / 2.0f)

#define INV_SQRT2                               7.071067811865475e-1f /* 1/sqrt(2) */
#define INV_SQRT3                               0.577350269189626f    /* 1/sqrt(3) */

#define LOG_10                                  2.30258509299f

#define SQRT2_OVER_2                            (SQRT2 / 2.0f)

#define ALIGN8(x)                               ((((x)+7) >> 3) << 3)

/*----------------------------------------------------------------------------------*
 * IVAS formats
@@ -839,7 +837,7 @@ typedef enum
{
    SBA_MODE_NONE,
    SBA_MODE_DIRAC,
    SBA_MODE_SPAR,
    SBA_MODE_SPAR, // VE: this is actually SBA_MODE_SPAR_DIRAC
} SBA_MODE;


@@ -1266,7 +1264,11 @@ typedef enum
#define IVAS_LFE_NUM_COEFFS_IN_SUBGRP           2
#define IVAS_LFE_MAX_NUM_DCT_PASS_BINS          8
#define IVAS_LFE_MAX_NUM_DCT_COEFFS             (IVAS_LFE_MAX_NUM_DCT_PASS_BINS * IVAS_LFE_NUM_COEFFS_IN_SUBGRP)
#ifdef SBA_CLEANING
#define IVAS_LFE_FADE_NS                        8000000L    /* 8.0 ms */
#else
#define IVAS_LFE_FADE_LEN_SEC_FLOAT             ((float)0.008)
#endif
#define IVAS_MAX_NUM_QUANT_STRATS               2
#define IVAS_MAX_NUM_DCT_COEF_GROUPS            4
#define IVAS_LFE_SHIFT_BITS                     5
+6 −5
Original line number Diff line number Diff line
@@ -134,11 +134,12 @@ void ivas_mdct(
    const int16_t length )
{
    const float *pTwid_re, *pTwid_im;
    int16_t len_by_2 = length >> 1;
    float re[IVAS_480_PT_LEN];
    float im[IVAS_480_PT_LEN];
    float ivas_mdct_scaling_gain = ivas_get_mdct_scaling_gain( len_by_2 );
    int16_t i;
    int16_t i, len_by_2;
    float re[IVAS_480_PT_LEN], im[IVAS_480_PT_LEN];
    float ivas_mdct_scaling_gain;

    len_by_2 = length >> 1;
    ivas_mdct_scaling_gain = ivas_get_mdct_scaling_gain( len_by_2 );

    ivas_get_twid_factors( length, &pTwid_re, &pTwid_im );

+11 −3
Original line number Diff line number Diff line
@@ -53,7 +53,9 @@
#define IVAS_MDCT_SCALING_GAIN_48k 1.9699011974118126e-06f
#define IVAS_MDCT_SCALING_GAIN_32k 2.9548517961177197e-06f
#define IVAS_MDCT_SCALING_GAIN_16k 5.909703592235439e-06f
#ifndef SBA_CLEANING
#define IVAS_MDCT_SCALING_GAIN_8k 0.000011819f
#endif

#define IVAS_FLT_EPS ( 1e-10F )
#define IVAS_DBL_EPS ( (double) 1e-20 )
@@ -157,11 +159,13 @@ float ivas_get_mdct_scaling_gain(
            result = IVAS_MDCT_SCALING_GAIN_16k;
            break;
        }
#ifndef SBA_CLEANING
        case L_FRAME8k >> 2:
        {
            result = IVAS_MDCT_SCALING_GAIN_8k;
            break;
        }
#endif
        default:
        {
            assert( !"Unsupported frame length!" );
@@ -293,7 +297,11 @@ void lfe_window_init(
    hLFEWindow->dct_len = frame_len >> 1;

    /* 8ms of latency */
#ifdef SBA_CLEANING
    hLFEWindow->fade_len = NS2SA( sampling_rate, IVAS_LFE_FADE_NS );
#else
    hLFEWindow->fade_len = ( int16_t )( sampling_rate * IVAS_LFE_FADE_LEN_SEC_FLOAT );
#endif
    hLFEWindow->zero_pad_len = ( int16_t )( IVAS_ZERO_PAD_LEN_MULT_FAC * ( hLFEWindow->dct_len - hLFEWindow->fade_len ) );
    hLFEWindow->full_len = hLFEWindow->zero_pad_len + hLFEWindow->fade_len + hLFEWindow->dct_len;

+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define SIMPLIFY_SBA_RENDERING_LOGIC
#define SBA_CLEANING

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ ivas_error ivas_dec(
                ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 );
            }
        }
        else /* st_ivas->sba_mode == SBA_MODE_SPAR */
        else /* SBA_MODE_SPAR */
        {
            ivas_sba_upmixer_renderer( st_ivas, output, nchan_remapped, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
        }
Loading