static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,

                                  uint8_t *base_lag_int, int subframe)

{

    if (subframe == 0 || subframe == 2) {

        if (pitch_index < 376) {

            *lag_int  = (pitch_index + 137) >> 2;

            *lag_frac = pitch_index - (*lag_int << 2) + 136;

        } else if (pitch_index < 440) {

            *lag_int  = (pitch_index + 257 - 376) >> 1;

            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;

            /* the actual resolution is 1/2 but expressed as 1/4 */

        } else {

            *lag_int  = pitch_index - 280;

            *lag_frac = 0;

        }

        /* minimum lag for next subframe */

        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),

                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);

        // XXX: the spec states clearly that *base_lag_int should be

        // the nearest integer to *lag_int (minus 8), but the ref code

        // actually always uses its floor, I'm following the latter

    } else {

        *lag_int  = (pitch_index + 1) >> 2;

        *lag_frac = pitch_index - (*lag_int << 2);

        *lag_int += *base_lag_int;

    }

}

static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,

                                  uint8_t *base_lag_int, int subframe)

{

    if (subframe == 0 || subframe == 2) {

        if (pitch_index < 376) {

            *lag_int  = (pitch_index + 137) >> 2;

            *lag_frac = pitch_index - (*lag_int << 2) + 136;

        } else if (pitch_index < 440) {

            *lag_int  = (pitch_index + 257 - 376) >> 1;

            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;

            

        } else {

            *lag_int  = pitch_index - 280;

            *lag_frac = 0;

        }

        

        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),

                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);

        

        

        

    } else {

        *lag_int  = (pitch_index + 1) >> 2;

        *lag_frac = pitch_index - (*lag_int << 2);

        *lag_int += *base_lag_int;

    }

}

            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;
static void FUNC_0(int *VAR_0, int *VAR_1, int VAR_2,

                                  uint8_t *VAR_3, int VAR_4)

{

    if (VAR_4 == 0 || VAR_4 == 2) {

        if (VAR_2 < 376) {

            *VAR_0  = (VAR_2 + 137) >> 2;

            *VAR_1 = VAR_2 - (*VAR_0 << 2) + 136;

        } else if (VAR_2 < 440) {

            *VAR_0  = (VAR_2 + 257 - 376) >> 1;

            *VAR_1 = (VAR_2 - (*VAR_0 << 1) + 256 - 376) << 1;

            

        } else {

            *VAR_0  = VAR_2 - 280;

            *VAR_1 = 0;

        }

        

        *VAR_3 = av_clip(*VAR_0 - 8 - (*VAR_1 < 0),

                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);

        

        

        

    } else {

        *VAR_0  = (VAR_2 + 1) >> 2;

        *VAR_1 = VAR_2 - (*VAR_0 << 2);

        *VAR_0 += *VAR_3;

    }

}

static void FUNC_0(int *VAR_0, int *VAR_1, int VAR_2,
uint8_t *VAR_3, int VAR_4)
{ if (VAR_4 == 0 || VAR_4 == 2) { if (VAR_2 < 376) { *VAR_0  = (VAR_2 + 137) >> 2; *VAR_1 = VAR_2 - (*VAR_0 << 2) + 136; } else if (VAR_2 < 440) { *VAR_0  = (VAR_2 + 257 - 376) >> 1; *VAR_1 = (VAR_2 - (*VAR_0 << 1) + 256 - 376) << 1; } else { *VAR_0  = VAR_2 - 280; *VAR_1 = 0; } *VAR_3 = av_clip(*VAR_0 - 8 - (*VAR_1 < 0),
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15); } else { *VAR_0  = (VAR_2 + 1) >> 2; *VAR_1 = VAR_2 - (*VAR_0 << 2); *VAR_0 += *VAR_3; } }