static av_always_inline void rv40_weak_loop_filter(uint8_t *src,

                                                   const int step,

                                                   const ptrdiff_t stride,

                                                   const int filter_p1,

                                                   const int filter_q1,

                                                   const int alpha,

                                                   const int beta,

                                                   const int lim_p0q0,

                                                   const int lim_q1,

                                                   const int lim_p1)

{

    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;

    int i, t, u, diff;



    for (i = 0; i < 4; i++, src += stride) {

        int diff_p1p0 = src[-2*step] - src[-1*step];

        int diff_q1q0 = src[ 1*step] - src[ 0*step];

        int diff_p1p2 = src[-2*step] - src[-3*step];

        int diff_q1q2 = src[ 1*step] - src[ 2*step];



        t = src[0*step] - src[-1*step];

        if (!t)

            continue;



        u = (alpha * FFABS(t)) >> 7;

        if (u > 3 - (filter_p1 && filter_q1))

            continue;



        t <<= 2;

        if (filter_p1 && filter_q1)

            t += src[-2*step] - src[1*step];



        diff = CLIP_SYMM((t + 4) >> 3, lim_p0q0);

        src[-1*step] = cm[src[-1*step] + diff];

        src[ 0*step] = cm[src[ 0*step] - diff];



        if (filter_p1 && FFABS(diff_p1p2) <= beta) {

            t = (diff_p1p0 + diff_p1p2 - diff) >> 1;

            src[-2*step] = cm[src[-2*step] - CLIP_SYMM(t, lim_p1)];

        }



        if (filter_q1 && FFABS(diff_q1q2) <= beta) {

            t = (diff_q1q0 + diff_q1q2 + diff) >> 1;

            src[ 1*step] = cm[src[ 1*step] - CLIP_SYMM(t, lim_q1)];

        }

    }

}

static av_always_inline void rv40_weak_loop_filter(uint8_t *src,

                                                   const int step,

                                                   const ptrdiff_t stride,

                                                   const int filter_p1,

                                                   const int filter_q1,

                                                   const int alpha,

                                                   const int beta,

                                                   const int lim_p0q0,

                                                   const int lim_q1,

                                                   const int lim_p1)

{

    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;

    int i, t, u, diff;



    for (i = 0; i < 4; i++, src += stride) {

        int diff_p1p0 = src[-2*step] - src[-1*step];

        int diff_q1q0 = src[ 1*step] - src[ 0*step];

        int diff_p1p2 = src[-2*step] - src[-3*step];

        int diff_q1q2 = src[ 1*step] - src[ 2*step];



        t = src[0*step] - src[-1*step];

        if (!t)

            continue;



        u = (alpha * FFABS(t)) >> 7;

        if (u > 3 - (filter_p1 && filter_q1))

            continue;



        t <<= 2;

        if (filter_p1 && filter_q1)

            t += src[-2*step] - src[1*step];



        diff = CLIP_SYMM((t + 4) >> 3, lim_p0q0);

        src[-1*step] = cm[src[-1*step] + diff];

        src[ 0*step] = cm[src[ 0*step] - diff];



        if (filter_p1 && FFABS(diff_p1p2) <= beta) {

            t = (diff_p1p0 + diff_p1p2 - diff) >> 1;

            src[-2*step] = cm[src[-2*step] - CLIP_SYMM(t, lim_p1)];

        }



        if (filter_q1 && FFABS(diff_q1q2) <= beta) {

            t = (diff_q1q0 + diff_q1q2 + diff) >> 1;

            src[ 1*step] = cm[src[ 1*step] - CLIP_SYMM(t, lim_q1)];

        }

    }

}

        t <<= 2;
static av_always_inline void FUNC_0(uint8_t *src,

                                                   const int step,

                                                   const ptrdiff_t stride,

                                                   const int filter_p1,

                                                   const int filter_q1,

                                                   const int alpha,

                                                   const int beta,

                                                   const int lim_p0q0,

                                                   const int lim_q1,

                                                   const int lim_p1)

{

    const uint8_t *VAR_0 = ff_crop_tab + MAX_NEG_CROP;

    int VAR_1, VAR_2, VAR_3, VAR_4;



    for (VAR_1 = 0; VAR_1 < 4; VAR_1++, src += stride) {

        int VAR_5 = src[-2*step] - src[-1*step];

        int VAR_6 = src[ 1*step] - src[ 0*step];

        int VAR_7 = src[-2*step] - src[-3*step];

        int VAR_8 = src[ 1*step] - src[ 2*step];



        VAR_2 = src[0*step] - src[-1*step];

        if (!VAR_2)

            continue;



        VAR_3 = (alpha * FFABS(VAR_2)) >> 7;

        if (VAR_3 > 3 - (filter_p1 && filter_q1))

            continue;



        VAR_2 <<= 2;

        if (filter_p1 && filter_q1)

            VAR_2 += src[-2*step] - src[1*step];



        VAR_4 = CLIP_SYMM((VAR_2 + 4) >> 3, lim_p0q0);

        src[-1*step] = VAR_0[src[-1*step] + VAR_4];

        src[ 0*step] = VAR_0[src[ 0*step] - VAR_4];



        if (filter_p1 && FFABS(VAR_7) <= beta) {

            VAR_2 = (VAR_5 + VAR_7 - VAR_4) >> 1;

            src[-2*step] = VAR_0[src[-2*step] - CLIP_SYMM(VAR_2, lim_p1)];

        }



        if (filter_q1 && FFABS(VAR_8) <= beta) {

            VAR_2 = (VAR_6 + VAR_8 + VAR_4) >> 1;

            src[ 1*step] = VAR_0[src[ 1*step] - CLIP_SYMM(VAR_2, lim_q1)];

        }

    }

}

static av_always_inline void FUNC_0(uint8_t *src,
const int step,
const ptrdiff_t stride,
const int filter_p1,
const int filter_q1,
const int alpha,
const int beta,
const int lim_p0q0,
const int lim_q1,
const int lim_p1)
{ const uint8_t *VAR_0 = ff_crop_tab + MAX_NEG_CROP; int VAR_1, VAR_2, VAR_3, VAR_4; for (VAR_1 = 0; VAR_1 < 4; VAR_1++, src += stride) { int VAR_5 = src[-2*step] - src[-1*step]; int VAR_6 = src[ 1*step] - src[ 0*step]; int VAR_7 = src[-2*step] - src[-3*step]; int VAR_8 = src[ 1*step] - src[ 2*step]; VAR_2 = src[0*step] - src[-1*step]; if (!VAR_2)
continue; VAR_3 = (alpha * FFABS(VAR_2)) >> 7; if (VAR_3 > 3 - (filter_p1 && filter_q1))
continue; VAR_2 <<= 2; if (filter_p1 && filter_q1)
VAR_2 += src[-2*step] - src[1*step]; VAR_4 = CLIP_SYMM((VAR_2 + 4) >> 3, lim_p0q0); src[-1*step] = VAR_0[src[-1*step] + VAR_4]; src[ 0*step] = VAR_0[src[ 0*step] - VAR_4]; if (filter_p1 && FFABS(VAR_7) <= beta) { VAR_2 = (VAR_5 + VAR_7 - VAR_4) >> 1; src[-2*step] = VAR_0[src[-2*step] - CLIP_SYMM(VAR_2, lim_p1)]; } if (filter_q1 && FFABS(VAR_8) <= beta) { VAR_2 = (VAR_6 + VAR_8 + VAR_4) >> 1; src[ 1*step] = VAR_0[src[ 1*step] - CLIP_SYMM(VAR_2, lim_q1)]; } } }