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

{

    int i, d;

    for( i = 0; i < 4; i++ ) {

        if( tc0[i] < 0 ) {

            pix += 4*ystride;

            continue;

        }

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

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

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

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

            const int q0 = pix[0];

            const int q1 = pix[1*xstride];

            const int q2 = pix[2*xstride];

    

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

                ABS( p1 - p0 ) < beta &&

                ABS( q1 - q0 ) < beta ) {

    

                int tc = tc0[i];

                int i_delta;

    

                if( ABS( p2 - p0 ) < beta ) {

                    pix[-2*xstride] = p1 + clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

                if( ABS( q2 - q0 ) < beta ) {

                    pix[xstride] = q1 + clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

    

                i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );

                pix[-xstride] = clip_uint8( p0 + i_delta );    /* p0' */

                pix[0]        = clip_uint8( q0 - i_delta );    /* q0' */

            }

            pix += ystride;

        }

    }

}

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

{

    int i, d;

    for( i = 0; i < 4; i++ ) {

        if( tc0[i] < 0 ) {

            pix += 4*ystride;

            continue;

        }

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

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

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

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

            const int q0 = pix[0];

            const int q1 = pix[1*xstride];

            const int q2 = pix[2*xstride];

    

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

                ABS( p1 - p0 ) < beta &&

                ABS( q1 - q0 ) < beta ) {

    

                int tc = tc0[i];

                int i_delta;

    

                if( ABS( p2 - p0 ) < beta ) {

                    pix[-2*xstride] = p1 + clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

                if( ABS( q2 - q0 ) < beta ) {

                    pix[xstride] = q1 + clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0[i], tc0[i] );

                    tc++;

                }

    

                i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );

                pix[-xstride] = clip_uint8( p0 + i_delta );    

                pix[0]        = clip_uint8( q0 - i_delta );    

            }

            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)

{

    int VAR_6, VAR_7;

    for( VAR_6 = 0; VAR_6 < 4; VAR_6++ ) {

        if( VAR_5[VAR_6] < 0 ) {

            VAR_0 += 4*VAR_2;

            continue;

        }

        for( VAR_7 = 0; VAR_7 < 4; VAR_7++ ) {

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

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

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

            const int VAR_11 = VAR_0[0];

            const int VAR_12 = VAR_0[1*VAR_1];

            const int VAR_13 = VAR_0[2*VAR_1];

    

            if( ABS( VAR_8 - VAR_11 ) < VAR_3 &&

                ABS( VAR_9 - VAR_8 ) < VAR_4 &&

                ABS( VAR_12 - VAR_11 ) < VAR_4 ) {

    

                int VAR_14 = VAR_5[VAR_6];

                int VAR_15;

    

                if( ABS( VAR_10 - VAR_8 ) < VAR_4 ) {

                    VAR_0[-2*VAR_1] = VAR_9 + clip( ( VAR_10 + ( ( VAR_8 + VAR_11 + 1 ) >> 1 ) - ( VAR_9 << 1 ) ) >> 1, -VAR_5[VAR_6], VAR_5[VAR_6] );

                    VAR_14++;

                }

                if( ABS( VAR_13 - VAR_11 ) < VAR_4 ) {

                    VAR_0[VAR_1] = VAR_12 + clip( ( VAR_13 + ( ( VAR_8 + VAR_11 + 1 ) >> 1 ) - ( VAR_12 << 1 ) ) >> 1, -VAR_5[VAR_6], VAR_5[VAR_6] );

                    VAR_14++;

                }

    

                VAR_15 = clip( (((VAR_11 - VAR_8 ) << 2) + (VAR_9 - VAR_12) + 4) >> 3, -VAR_14, VAR_14 );

                VAR_0[-VAR_1] = clip_uint8( VAR_8 + VAR_15 );    

                VAR_0[0]        = clip_uint8( VAR_11 - VAR_15 );    

            }

            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)
{ int VAR_6, VAR_7; for( VAR_6 = 0; VAR_6 < 4; VAR_6++ ) { if( VAR_5[VAR_6] < 0 ) { VAR_0 += 4*VAR_2; continue; } for( VAR_7 = 0; VAR_7 < 4; VAR_7++ ) { const int VAR_8 = VAR_0[-1*VAR_1]; const int VAR_9 = VAR_0[-2*VAR_1]; const int VAR_10 = VAR_0[-3*VAR_1]; const int VAR_11 = VAR_0[0]; const int VAR_12 = VAR_0[1*VAR_1]; const int VAR_13 = VAR_0[2*VAR_1]; if( ABS( VAR_8 - VAR_11 ) < VAR_3 &&
ABS( VAR_9 - VAR_8 ) < VAR_4 &&
ABS( VAR_12 - VAR_11 ) < VAR_4 ) { int VAR_14 = VAR_5[VAR_6]; int VAR_15; if( ABS( VAR_10 - VAR_8 ) < VAR_4 ) { VAR_0[-2*VAR_1] = VAR_9 + clip( ( VAR_10 + ( ( VAR_8 + VAR_11 + 1 ) >> 1 ) - ( VAR_9 << 1 ) ) >> 1, -VAR_5[VAR_6], VAR_5[VAR_6] ); VAR_14++; } if( ABS( VAR_13 - VAR_11 ) < VAR_4 ) { VAR_0[VAR_1] = VAR_12 + clip( ( VAR_13 + ( ( VAR_8 + VAR_11 + 1 ) >> 1 ) - ( VAR_12 << 1 ) ) >> 1, -VAR_5[VAR_6], VAR_5[VAR_6] ); VAR_14++; } VAR_15 = clip( (((VAR_11 - VAR_8 ) << 2) + (VAR_9 - VAR_12) + 4) >> 3, -VAR_14, VAR_14 ); VAR_0[-VAR_1] = clip_uint8( VAR_8 + VAR_15 ); VAR_0[0]        = clip_uint8( VAR_11 - VAR_15 ); } VAR_0 += VAR_2; } } }