Commit 87195f3a authored by malenov's avatar malenov
Browse files

cleanup FIX_976_USAN_PVQ_ENC_DEC_EVS_CR

parent 7dbe7c8a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@

/* ################### Start FIXES switches ########################### */

#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR                 /* Ericsson:  premature cast to unsigned detected by USAN corrected  */
#define FIX_1027_GSC_INT_OVERFLOW                       /* VA: issue 2207: overflow in GSC */
#define NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO    /* FhG: avoid sidegain DFT-Stereo param to be larger than 1 when converting from Dirac parameters */
#define NON_BE_1055_RESET_LP_MEMORIES                   /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */
+0 −16
Original line number Diff line number Diff line
@@ -112,18 +112,10 @@ static void pvq_decode_band(

    for ( j = 0; j < Np; j++ )
    {
#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR
        g_part[j] = -( (float) g_part_s[j] ) / 32768;
        /* note: here  g_part   needs to be become exactly  1.0(float) thus in BASOP  Word16 g_part_s is in the negative Q15 domain */
#endif


#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR
        /* aligned to BASOP to avoid USAN undefined negation warning for -(-32768) */
        g_part_s[j] = negate( g_part_s[j] );
#else
        g_part_s[j] = -g_part_s[j];
#endif
    }

    srt_vec_ind( g_part_s, sg_part, idx_sort, Np );
@@ -429,11 +421,7 @@ static void densitySymbolIndexDecode(
    {
        tot = res * ( res + 1 ) + 1;
        dec_freq = rc_decode( &st->BER_detect, hPVQ, tot );
#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR
        alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( ( res + 1 ) * ( res + 1 ) - dec_freq ) ) + res + 1;
#else
        alpha = (int16_t) floor_sqrt_exact( (uint32_t) ( res + 1 ) * ( res + 1 ) - dec_freq ) + res + 1;
#endif
        sym_freq = 2 * ( res - alpha ) + 1;
        cum_freq = alpha * ( 2 * ( res + 1 ) - alpha );
    }
@@ -451,11 +439,7 @@ static void densitySymbolIndexDecode(
        dec_freq = rc_decode( &st->BER_detect, hPVQ, tot );
        if ( dec_freq < tot - ( res + 1 ) - ( res - ( c + 1 ) ) * ( res - c ) * c + c + 1 )
        {
#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR
            alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) ( res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) ) / ( 2 * res_c );
#else
            alpha = ( res_c - 1 + (int16_t) floor_sqrt_exact( (uint32_t) res_c * ( res_c + 4 * dec_freq - 2 ) + 1 ) ) / ( 2 * res_c );
#endif
            sym_freq = 2 * alpha * res_c + 1;
            cum_freq = alpha * ( ( alpha - 1 ) * res_c + 1 );
        }
+0 −4
Original line number Diff line number Diff line
@@ -124,12 +124,8 @@ static void pvq_encode_band(
    for ( j = 0; j < Np; j++ )
    {
        g_part[j] = -( (float) g_part_s[j] ) / 32768;
#ifdef FIX_976_USAN_PVQ_ENC_DEC_EVS_CR
        /* aligned to BASOP to avoid USAN undefined negation warning with -(-32768) */
        g_part_s[j] = negate( g_part_s[j] );
#else
        g_part_s[j] = -g_part_s[j];
#endif
    }

    srt_vec_ind( g_part_s, sg_part, idx_sort, Np );