Commit c460b5a0 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Cleanup of saturations in find_enr_dft_fx and ivas_find_enr1

parent a70744eb
Loading
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -747,10 +747,8 @@ enum
#define PIT_UP_SAMP6                        6
#define PIT_L_INTERPOL6_2                   17
#define PIT_FIR_SIZE6_2                     ( PIT_UP_SAMP6 * PIT_L_INTERPOL6_2 + 1 )
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define E_MIN                               0.0035f                /* minimum allowable energy */
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define E_MIN_Q16_FX                         229                      /* minimum allowable energy in Q16*/
#define STEP_DELTA                          0.0625f                /* quantization step for tilt compensation of gaussian cb. excitation */
#define GAMMA_EV                            0.92f                  /* weighting factor for core synthesis error weighting */
#define FORMANT_SHARPENING_NOISE_THRESHOLD  21.0f                  /* lp_noise level above which formant sharpening is deactivated */
+20 −0
Original line number Diff line number Diff line
@@ -7282,6 +7282,26 @@ Word16 L_norm_arr( Word32 *arr, Word16 size )
    return q;
}

Word16 norm_arr( Word16 *arr, Word16 size )
{
    Word16 q = 15;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = norm_s( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 get_min_scalefactor( Word32 x, Word32 y )
{
#ifndef FIX_1104_OPT_GETMINSCALEFAC
+1 −0
Original line number Diff line number Diff line
@@ -4560,6 +4560,7 @@ void DoRTFTn_fx_ivas(
Word16 find_guarded_bits_fx( Word32 n );
Word16 L_norm_arr( Word32 *arr, Word16 size );
Word16 norm_arr( Word16 *arr, Word16 size );
Word16 get_min_scalefactor( Word32 x, Word32 y );
+1 −14
Original line number Diff line number Diff line
@@ -720,20 +720,7 @@ static void update_exp(
    }
    return;
}
static Word16 norm_arr(
    Word16 *arr,
    Word32 size /* Q0 */
)
{
    Word16 q = 15;
    move16();
    FOR( Word32 i = 0; i < size; i++ )
    IF( arr[i] != 0 )
    {
        q = s_min( q, norm_s( arr[i] ) );
    }
    return q;
}

void updateBuffersForDmxMdctStereo_fx(
    CPE_DEC_HANDLE hCPE,                      /* i/o: CPE handle                              */
    const Word16 output_frame,                /* i  : output frame length                   Q0*/
+2 −0
Original line number Diff line number Diff line
@@ -550,6 +550,8 @@ ivas_error acelp_core_enc(
        {
            st->mem_deemp_preQ_fx = 0;
            move16();
            st->mem_preemp_preQ_fx = 0;
            move16();
            st->last_code_preq = 0;
            move16();
            st->last_nq_preQ = 0;
Loading