Commit 1cfc2212 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_MDCT_BASED_BWD

parent f9293108
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -141,7 +141,6 @@
#define DISABLE_ADAP_RES_COD_TMP                        /* temporary fix for IVAS-403, disables adaptive residual coding */
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

#define FIX_MDCT_BASED_BWD                              /* FhG: fixes for BWD for issues with reaction to transients for MDCT-stereo and MCT */
#define DISCRETE_ISM_DTX_CNG                            /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */
#define NCHAN_ISM_PARAMETER                             /* VA: make 'nchan_ism' parameter part of st_ivas/hEncoderConfig */
#define FIX_382_MASA_META_FRAMING_ASYNC                 /* Nokia: Issue 382: detect potential MASA metadata framing offset */
+0 −2
Original line number Diff line number Diff line
@@ -3823,10 +3823,8 @@ void bw_detect(
    const float signal_in[], /* i  : input signal                                */
    float *spectrum,         /* i  : MDCT spectrum                               */
    const float *enerBuffer  /* i  : energy buffer                               */
#ifdef FIX_MDCT_BASED_BWD
    ,
    const int16_t mct_on /* i  : flag MCT mode */
#endif
);


+0 −2
Original line number Diff line number Diff line
@@ -343,10 +343,8 @@ void amr_wb_enc(
     *----------------------------------------------------------------*/

    bw_detect( st, st->input, NULL, NULL
#ifdef FIX_MDCT_BASED_BWD
               ,
               0
#endif
    );

    /* in AMR_WB IO, limit the maximum band-width to WB */
+0 −35
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@

#define BWD_COUNT_MAX      100
#define BWD_COUNT_WIDER_BW 10
#ifdef FIX_MDCT_BASED_BWD
#define BWD_COUNT_WIDER_BW_MDCT 0
#endif

#define CLDFB_ENER_OFFSET 1.6f

@@ -74,10 +72,8 @@ void bw_detect(
    const float signal_in[], /* i  : input signal        */
    float *spectrum,         /* i  : MDCT spectrum       */
    const float *enerBuffer  /* i  : energy buffer       */
#ifdef FIX_MDCT_BASED_BWD
    ,
    const int16_t mct_on /* i  : flag MCT mode */
#endif
)
{
    int16_t i, j, k, bw_max, bin_width, n_bins;
@@ -87,7 +83,6 @@ void bw_detect(
    const float *pt, *pt1;
    float max_NB, max_WB, max_SWB, max_FB, mean_NB, mean_WB, mean_SWB, mean_FB;
    int16_t cldfb_bin_width = 4;
#ifdef FIX_MDCT_BASED_BWD
    int16_t bwd_count_wider_bw, l_frame;

    bwd_count_wider_bw = BWD_COUNT_WIDER_BW;
@@ -95,7 +90,6 @@ void bw_detect(
    {
        bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT;
    }
#endif

    if ( st->input_Fs > 8000 )
    {
@@ -189,10 +183,6 @@ void bw_detect(
            }
            else
            {
#ifndef FIX_MDCT_BASED_BWD
                bin_width *= (int16_t) ( ( st->input_Fs / FRAMES_PER_SEC ) / BWD_TOTAL_WIDTH );
                mvr2r( spectrum, spect, (int16_t) ( st->input_Fs / FRAMES_PER_SEC ) );
#else
                l_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC );
                if ( st->core == TCX_10_CORE )
                {
@@ -201,7 +191,6 @@ void bw_detect(

                bin_width *= ( l_frame / BWD_TOTAL_WIDTH );
                mvr2r( spectrum, spect, l_frame );
#endif
            }
            /*---------------------------------------------------------------------*
             * compute energy per spectral bins
@@ -419,29 +408,17 @@ void bw_detect(
            /* switching to a higher BW */
            if ( st->last_input_bwidth == NB )
            {
#ifdef FIX_MDCT_BASED_BWD
                if ( st->count_WB > bwd_count_wider_bw )
#else
                if ( st->count_WB > BWD_COUNT_WIDER_BW )
#endif
                {
                    st->input_bwidth = WB;
                    st->count_WB = BWD_COUNT_MAX;

#ifdef FIX_MDCT_BASED_BWD
                    if ( st->count_SWB > bwd_count_wider_bw )
#else
                    if ( st->count_SWB > BWD_COUNT_WIDER_BW )
#endif
                    {
                        st->input_bwidth = SWB;
                        st->count_SWB = BWD_COUNT_MAX;

#ifdef FIX_MDCT_BASED_BWD
                        if ( st->count_FB > bwd_count_wider_bw )
#else
                        if ( st->count_FB > BWD_COUNT_WIDER_BW )
#endif
                        {
                            st->input_bwidth = FB;
                            st->count_FB = BWD_COUNT_MAX;
@@ -452,20 +429,12 @@ void bw_detect(

            if ( st->last_input_bwidth == WB && st->input_Fs > 16000 )
            {
#ifdef FIX_MDCT_BASED_BWD
                if ( st->count_SWB > bwd_count_wider_bw )
#else
                if ( st->count_SWB > BWD_COUNT_WIDER_BW )
#endif
                {
                    st->input_bwidth = SWB;
                    st->count_SWB = BWD_COUNT_MAX;

#ifdef FIX_MDCT_BASED_BWD
                    if ( st->count_FB > bwd_count_wider_bw )
#else
                    if ( st->count_FB > BWD_COUNT_WIDER_BW )
#endif
                    {
                        st->input_bwidth = FB;
                        st->count_FB = BWD_COUNT_MAX;
@@ -475,11 +444,7 @@ void bw_detect(

            if ( st->last_input_bwidth == SWB && st->input_Fs > 32000 )
            {
#ifdef FIX_MDCT_BASED_BWD
                if ( st->count_FB > bwd_count_wider_bw )
#else
                if ( st->count_FB > BWD_COUNT_WIDER_BW )
#endif
                {
                    st->input_bwidth = FB;
                    st->count_FB = BWD_COUNT_MAX;
+0 −2
Original line number Diff line number Diff line
@@ -480,10 +480,8 @@ ivas_error pre_proc_front_ivas(
    if ( st->idchan == 0 && element_mode != IVAS_CPE_MDCT )
    {
        bw_detect( st, st->input, NULL, enerBuffer
#ifdef FIX_MDCT_BASED_BWD
                   ,
                   0
#endif
        );
    }

Loading