Commit ca924202 authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_906_SBA_LBR_SMOOTHING

parent 2e82bc1a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER                    /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/
#define NONBE_FIX_906_SBA_LBR_SMOOTHING                       /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */
#define NONBE_FIX_878_RS_FEC_STEREO_CNG                       /* Eri: Frame loss and Unified Stereo CNG may cause false BER detection which results in corrupt bitstream decoding */
#define NONBE_FIX_904_JBM_SBA_RS_FOA                          /* FhG: issue #904: fix JBM SBA RS to FOA decoding */
#define NONBE_FIX_898_ISM_BRATE_CRASH                         /* VA: issue 898: fix decoder crash in ISM bitrate switching with DTX and binaural output */
+0 −18
Original line number Diff line number Diff line
@@ -1050,10 +1050,8 @@ static void ivas_spar_calc_smooth_facs(
    float *cldfb_in_ts_re[CLDFB_NO_COL_MAX],
    float *cldfb_in_ts_im[CLDFB_NO_COL_MAX],
    int16_t nbands_spar,
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
    const int16_t nSlots,
    const int16_t isFirstSubframe,
#endif
    ivas_fb_bin_to_band_data_t *bin2band,
    float *smooth_fac,
    float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1] )
@@ -1075,18 +1073,13 @@ static void ivas_spar_calc_smooth_facs(
        subframe_band_nrg[b] = 0.f;
        while ( bin < CLDFB_NO_CHANNELS_MAX && b == bin2band->p_cldfb_map_to_spar_band[bin] )
        {
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
            for ( ts = 0; ts < nSlots; ts++ )
#else
            for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ )
#endif
            {
                subframe_band_nrg[b] += cldfb_in_ts_re[ts][bin] * cldfb_in_ts_re[ts][bin] + cldfb_in_ts_im[ts][bin] * cldfb_in_ts_im[ts][bin];
            }
            bin++;
        }
        subframe_band_nrg[b] = sqrtf( subframe_band_nrg[b] );
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
        if ( isFirstSubframe && nSlots < MAX_PARAM_SPATIAL_SUBFRAMES )
        {
            /* fill up to full 5ms subframe */
@@ -1094,11 +1087,8 @@ static void ivas_spar_calc_smooth_facs(
        }
        else
        {
#endif
            smooth_buf[b][0] = subframe_band_nrg[b];
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
        }
#endif
        /* calculate short and long energy averages */
        smooth_short_avg[b] = EPSILON;
        for ( i = 0; i < 2 * SBA_DIRAC_NRG_SMOOTH_SHORT; i++ )
@@ -1135,11 +1125,9 @@ static void ivas_spar_calc_smooth_facs(
        smooth_fac[b] = max( min_smooth_gains1[b], min( max_smooth_gains2[b], smooth_fac[b] ) );
    }

#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
    /* only update if we collected a full 5ms worth of energies for the buffer */
    if ( isFirstSubframe || nSlots == MAX_PARAM_SPATIAL_SUBFRAMES )
    {
#endif
        for ( b = 0; b < nbands_spar; b++ )
        {
            for ( i = 2 * SBA_DIRAC_NRG_SMOOTH_LONG; i > 0; i-- )
@@ -1147,9 +1135,7 @@ static void ivas_spar_calc_smooth_facs(
                smooth_buf[b][i] = smooth_buf[b][i - 1];
            }
        }
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
    }
#endif
    return;
}

@@ -1697,11 +1683,7 @@ void ivas_spar_dec_upmixer_sf(

    if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) )
    {
#ifdef NONBE_FIX_906_SBA_LBR_SMOOTHING
        ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf );
#else
        ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf );
#endif
    }

    for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ )