static av_always_inline void rv40_weak_loop_filter(uint8_t *src,

                                                   const int step,

                                                   const int 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)

{

    uint8_t *cm = ff_cropTbl + 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 int 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)

{

    uint8_t *cm = ff_cropTbl + 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)];

        }

    }

}

                                                   const int stride,
static av_always_inline void FUNC_0(uint8_t *src,

                                                   const int step,

                                                   const int 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)

{

    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

    int VAR_0, VAR_1, VAR_2, VAR_3;



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

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

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

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

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



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

        if (!VAR_1)

            continue;



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

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

            continue;



        VAR_1 <<= 2;

        if (filter_p1 && filter_q1)

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



        VAR_3 = CLIP_SYMM((VAR_1 + 4) >> 3, lim_p0q0);

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

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



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

            VAR_1 = (VAR_4 + VAR_6 - VAR_3) >> 1;

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

        }



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

            VAR_1 = (VAR_5 + VAR_7 + VAR_3) >> 1;

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

        }

    }

}

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