Commit 7cf5cace authored by malenov's avatar malenov
Browse files

cleanup

NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS
NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO
parent ceb8871f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -170,9 +170,7 @@
#define NONBE_FIX_1205_TD_STEREO_MOD_CT                 /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3             /*Dolby: issue 1213: fix for inverse of det < 0*/
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING    /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */
#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO            /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */

#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
#define NONBE_1211_DTX_BR_SWITCHING                     /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define NONBE_FIX_1189_GSC_IVAS_OMASA                   /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
+2 −45
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ static int16_t hf_spectrum_sparseness(
        inv_rms = 0.0f;
        crest_mod = 0.0f;
        maximum( A, L_SPEC_HB, &Amax );
#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO

        if ( Amax == 0 )
        {
            /* For all-zero input the crest is 1.0 */
@@ -626,50 +626,7 @@ static int16_t hf_spectrum_sparseness(
            crest = Amax * inv_rms;
            crest_mod = crest_mod * inv_rms;
        }
#else
        thr = Amax * PEAK_THRESHOLD;
        movmean = 0.0f;                        /* avoid uninitialized warning */
        p_num = &inv_tbl[HALF_WIN_LENGTH + 1]; /* Table for division 1./(11:21) */
        for ( i = 0; i < L_SPEC_HB; i++ )
        {
            inv_rms += A[i] * A[i];
            if ( A[i] < thr )
            {
                low_count += 1;
            }
            if ( i <= HALF_WIN_LENGTH )
            {
                if ( i == 0 )
                {
                    movmean = sum_f( &A[0], i + HALF_WIN_LENGTH + 1 ) * ( *p_num );
                }
                else
                {
                    p_num++;
                    movmean = movmean + ( A[i + HALF_WIN_LENGTH] - movmean ) * ( *p_num );
                }
            }
            else
            {
                if ( L_SPEC_HB <= i + HALF_WIN_LENGTH )
                {
                    p_num--;
                    movmean = movmean + ( movmean - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num );
                }
                else
                {
                    movmean = movmean + ( A[i + HALF_WIN_LENGTH] - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num );
                }
            }
            if ( crest_mod < movmean )
            {
                crest_mod = movmean;
            }
        }
        inv_rms = 1.0f / (float) sqrtf( inv_rms / L_SPEC_HB );
        crest = Amax * inv_rms;
        crest_mod = crest_mod * inv_rms;
#endif

        *crest_lp = HQ_CREST_FAC_SM * ( *crest_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest;
        *crest_mod_lp = HQ_CREST_FAC_SM * ( *crest_mod_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest_mod;

+0 −16
Original line number Diff line number Diff line
@@ -72,11 +72,7 @@ static void ivas_merge_sba_transports(
    {
        for ( j = 0; j < input_frame; j++ )
        {
#ifdef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS
            data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] );
#else
            data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] );
#endif
        }
    }

@@ -480,17 +476,5 @@ static void ivas_osba_render_ism_to_sba(
        }
    }

#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS
    /* Gain with loudness-matching gains */
    output_gain = 0.7499f;
    for ( j = 0; j < nchan_sba; j++ )
    {
        for ( k = 0; k < input_frame; k++ )
        {
            data_out_f[j][k] *= output_gain;
        }
    }
#endif

    return;
}