static inline void h264_loop_filter_luma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta)

{

    int d;

    for( d = 0; d < 16; d++ ) {

        const int p2 = pix[-3*xstride];

        const int p1 = pix[-2*xstride];

        const int p0 = pix[-1*xstride];



        const int q0 = pix[ 0*xstride];

        const int q1 = pix[ 1*xstride];

        const int q2 = pix[ 2*xstride];



        if( FFABS( p0 - q0 ) < alpha &&

            FFABS( p1 - p0 ) < beta &&

            FFABS( q1 - q0 ) < beta ) {



            if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){

                if( FFABS( p2 - p0 ) < beta)

                {

                    const int p3 = pix[-4*xstride];

                    /* p0', p1', p2' */

                    pix[-1*xstride] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;

                    pix[-2*xstride] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;

                    pix[-3*xstride] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;

                } else {

                    /* p0' */

                    pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;

                }

                if( FFABS( q2 - q0 ) < beta)

                {

                    const int q3 = pix[3*xstride];

                    /* q0', q1', q2' */

                    pix[0*xstride] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;

                    pix[1*xstride] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;

                    pix[2*xstride] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;

                } else {

                    /* q0' */

                    pix[0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;

                }

            }else{

                /* p0', q0' */

                pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;

                pix[ 0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;

            }

        }

        pix += ystride;

    }

}

static inline void h264_loop_filter_luma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta)

{

    int d;

    for( d = 0; d < 16; d++ ) {

        const int p2 = pix[-3*xstride];

        const int p1 = pix[-2*xstride];

        const int p0 = pix[-1*xstride];



        const int q0 = pix[ 0*xstride];

        const int q1 = pix[ 1*xstride];

        const int q2 = pix[ 2*xstride];



        if( FFABS( p0 - q0 ) < alpha &&

            FFABS( p1 - p0 ) < beta &&

            FFABS( q1 - q0 ) < beta ) {



            if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){

                if( FFABS( p2 - p0 ) < beta)

                {

                    const int p3 = pix[-4*xstride];

                    

                    pix[-1*xstride] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;

                    pix[-2*xstride] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;

                    pix[-3*xstride] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;

                } else {

                    

                    pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;

                }

                if( FFABS( q2 - q0 ) < beta)

                {

                    const int q3 = pix[3*xstride];

                    

                    pix[0*xstride] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;

                    pix[1*xstride] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;

                    pix[2*xstride] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;

                } else {

                    

                    pix[0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;

                }

            }else{

                

                pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;

                pix[ 0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;

            }

        }

        pix += ystride;

    }

}

static inline void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5;

    for( VAR_5 = 0; VAR_5 < 16; VAR_5++ ) {

        const int VAR_6 = VAR_0[-3*VAR_1];

        const int VAR_7 = VAR_0[-2*VAR_1];

        const int VAR_8 = VAR_0[-1*VAR_1];



        const int VAR_9 = VAR_0[ 0*VAR_1];

        const int VAR_10 = VAR_0[ 1*VAR_1];

        const int VAR_11 = VAR_0[ 2*VAR_1];



        if( FFABS( VAR_8 - VAR_9 ) < VAR_3 &&

            FFABS( VAR_7 - VAR_8 ) < VAR_4 &&

            FFABS( VAR_10 - VAR_9 ) < VAR_4 ) {



            if(FFABS( VAR_8 - VAR_9 ) < (( VAR_3 >> 2 ) + 2 )){

                if( FFABS( VAR_6 - VAR_8 ) < VAR_4)

                {

                    const int VAR_12 = VAR_0[-4*VAR_1];

                    

                    VAR_0[-1*VAR_1] = ( VAR_6 + 2*VAR_7 + 2*VAR_8 + 2*VAR_9 + VAR_10 + 4 ) >> 3;

                    VAR_0[-2*VAR_1] = ( VAR_6 + VAR_7 + VAR_8 + VAR_9 + 2 ) >> 2;

                    VAR_0[-3*VAR_1] = ( 2*VAR_12 + 3*VAR_6 + VAR_7 + VAR_8 + VAR_9 + 4 ) >> 3;

                } else {

                    

                    VAR_0[-1*VAR_1] = ( 2*VAR_7 + VAR_8 + VAR_10 + 2 ) >> 2;

                }

                if( FFABS( VAR_11 - VAR_9 ) < VAR_4)

                {

                    const int VAR_13 = VAR_0[3*VAR_1];

                    

                    VAR_0[0*VAR_1] = ( VAR_7 + 2*VAR_8 + 2*VAR_9 + 2*VAR_10 + VAR_11 + 4 ) >> 3;

                    VAR_0[1*VAR_1] = ( VAR_8 + VAR_9 + VAR_10 + VAR_11 + 2 ) >> 2;

                    VAR_0[2*VAR_1] = ( 2*VAR_13 + 3*VAR_11 + VAR_10 + VAR_9 + VAR_8 + 4 ) >> 3;

                } else {

                    

                    VAR_0[0*VAR_1] = ( 2*VAR_10 + VAR_9 + VAR_7 + 2 ) >> 2;

                }

            }else{

                

                VAR_0[-1*VAR_1] = ( 2*VAR_7 + VAR_8 + VAR_10 + 2 ) >> 2;

                VAR_0[ 0*VAR_1] = ( 2*VAR_10 + VAR_9 + VAR_7 + 2 ) >> 2;

            }

        }

        VAR_0 += VAR_2;

    }

}

static inline void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5; for( VAR_5 = 0; VAR_5 < 16; VAR_5++ ) { const int VAR_6 = VAR_0[-3*VAR_1]; const int VAR_7 = VAR_0[-2*VAR_1]; const int VAR_8 = VAR_0[-1*VAR_1]; const int VAR_9 = VAR_0[ 0*VAR_1]; const int VAR_10 = VAR_0[ 1*VAR_1]; const int VAR_11 = VAR_0[ 2*VAR_1]; if( FFABS( VAR_8 - VAR_9 ) < VAR_3 &&
FFABS( VAR_7 - VAR_8 ) < VAR_4 &&
FFABS( VAR_10 - VAR_9 ) < VAR_4 ) { if(FFABS( VAR_8 - VAR_9 ) < (( VAR_3 >> 2 ) + 2 )){ if( FFABS( VAR_6 - VAR_8 ) < VAR_4)
{ const int VAR_12 = VAR_0[-4*VAR_1]; VAR_0[-1*VAR_1] = ( VAR_6 + 2*VAR_7 + 2*VAR_8 + 2*VAR_9 + VAR_10 + 4 ) >> 3; VAR_0[-2*VAR_1] = ( VAR_6 + VAR_7 + VAR_8 + VAR_9 + 2 ) >> 2; VAR_0[-3*VAR_1] = ( 2*VAR_12 + 3*VAR_6 + VAR_7 + VAR_8 + VAR_9 + 4 ) >> 3; } else { VAR_0[-1*VAR_1] = ( 2*VAR_7 + VAR_8 + VAR_10 + 2 ) >> 2; } if( FFABS( VAR_11 - VAR_9 ) < VAR_4)
{ const int VAR_13 = VAR_0[3*VAR_1]; VAR_0[0*VAR_1] = ( VAR_7 + 2*VAR_8 + 2*VAR_9 + 2*VAR_10 + VAR_11 + 4 ) >> 3; VAR_0[1*VAR_1] = ( VAR_8 + VAR_9 + VAR_10 + VAR_11 + 2 ) >> 2; VAR_0[2*VAR_1] = ( 2*VAR_13 + 3*VAR_11 + VAR_10 + VAR_9 + VAR_8 + 4 ) >> 3; } else { VAR_0[0*VAR_1] = ( 2*VAR_10 + VAR_9 + VAR_7 + 2 ) >> 2; } }else{ VAR_0[-1*VAR_1] = ( 2*VAR_7 + VAR_8 + VAR_10 + 2 ) >> 2; VAR_0[ 0*VAR_1] = ( 2*VAR_10 + VAR_9 + VAR_7 + 2 ) >> 2; } } VAR_0 += VAR_2; } }