static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2] ) {

    int i;

    for( i = 0; i < 8; i++, pix += stride) {

        int index_a;

        int alpha;

        int beta;



        int qp_index;

        int bS_index = i;



        if( bS[bS_index] == 0 ) {

            continue;

        }



        qp_index = MB_FIELD ? (i >> 2) : (i & 1);

        index_a = qp[qp_index] + h->slice_alpha_c0_offset;

        alpha = (alpha_table+52)[index_a];

        beta  = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];



        if( bS[bS_index] < 4 ) {

            const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;

            const int p0 = pix[-1];

            const int p1 = pix[-2];

            const int q0 = pix[0];

            const int q1 = pix[1];



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

                FFABS( p1 - p0 ) < beta &&

                FFABS( q1 - q0 ) < beta ) {

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



                pix[-1] = av_clip_uint8( p0 + i_delta );    /* p0' */

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

                tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);

            }

        }else{

            const int p0 = pix[-1];

            const int p1 = pix[-2];

            const int q0 = pix[0];

            const int q1 = pix[1];



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

                FFABS( p1 - p0 ) < beta &&

                FFABS( q1 - q0 ) < beta ) {



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

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

                tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, pix[-3], p1, p0, q0, q1, pix[2], pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);

            }

        }

    }

}

static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2] ) {

    int i;

    for( i = 0; i < 8; i++, pix += stride) {

        int index_a;

        int alpha;

        int beta;



        int qp_index;

        int bS_index = i;



        if( bS[bS_index] == 0 ) {

            continue;

        }



        qp_index = MB_FIELD ? (i >> 2) : (i & 1);

        index_a = qp[qp_index] + h->slice_alpha_c0_offset;

        alpha = (alpha_table+52)[index_a];

        beta  = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];



        if( bS[bS_index] < 4 ) {

            const int tc = (tc0_table+52)[index_a][bS[bS_index]] + 1;

            const int p0 = pix[-1];

            const int p1 = pix[-2];

            const int q0 = pix[0];

            const int q1 = pix[1];



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

                FFABS( p1 - p0 ) < beta &&

                FFABS( q1 - q0 ) < beta ) {

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



                pix[-1] = av_clip_uint8( p0 + i_delta );    

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

                tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);

            }

        }else{

            const int p0 = pix[-1];

            const int p1 = pix[-2];

            const int q0 = pix[0];

            const int q1 = pix[1];



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

                FFABS( p1 - p0 ) < beta &&

                FFABS( q1 - q0 ) < beta ) {



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

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

                tprintf(h->s.avctx, "filter_mb_mbaff_edgecv i:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, pix[-3], p1, p0, q0, q1, pix[2], pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);

            }

        }

    }

}

static void FUNC_0( H264Context *VAR_0, uint8_t *VAR_1, int VAR_2, int16_t VAR_3[8], int VAR_4[2] ) {

    int VAR_5;

    for( VAR_5 = 0; VAR_5 < 8; VAR_5++, VAR_1 += VAR_2) {

        int VAR_6;

        int VAR_7;

        int VAR_8;



        int VAR_9;

        int VAR_10 = VAR_5;



        if( VAR_3[VAR_10] == 0 ) {

            continue;

        }



        VAR_9 = MB_FIELD ? (VAR_5 >> 2) : (VAR_5 & 1);

        VAR_6 = VAR_4[VAR_9] + VAR_0->slice_alpha_c0_offset;

        VAR_7 = (alpha_table+52)[VAR_6];

        VAR_8  = (beta_table+52)[VAR_4[VAR_9] + VAR_0->slice_beta_offset];



        if( VAR_3[VAR_10] < 4 ) {

            const int VAR_11 = (tc0_table+52)[VAR_6][VAR_3[VAR_10]] + 1;

            const int VAR_17 = VAR_1[-1];

            const int VAR_17 = VAR_1[-2];

            const int VAR_17 = VAR_1[0];

            const int VAR_17 = VAR_1[1];



            if( FFABS( VAR_17 - VAR_17 ) < VAR_7 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_8 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_8 ) {

                const int VAR_16 = av_clip( (((VAR_17 - VAR_17 ) << 2) + (VAR_17 - VAR_17) + 4) >> 3, -VAR_11, VAR_11 );



                VAR_1[-1] = av_clip_uint8( VAR_17 + VAR_16 );    

                VAR_1[0]  = av_clip_uint8( VAR_17 - VAR_16 );    

                tprintf(VAR_0->s.avctx, "FUNC_0 VAR_5:%d, VAR_4:%d, indexA:%d, VAR_7:%d, VAR_8:%d, VAR_11:%d\n# VAR_3:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", VAR_5, VAR_4[VAR_9], VAR_6, VAR_7, VAR_8, VAR_11, VAR_3[VAR_10], VAR_1[-3], VAR_17, VAR_17, VAR_17, VAR_17, VAR_1[2], VAR_17, VAR_1[-1], VAR_1[0], VAR_17);

            }

        }else{

            const int VAR_17 = VAR_1[-1];

            const int VAR_17 = VAR_1[-2];

            const int VAR_17 = VAR_1[0];

            const int VAR_17 = VAR_1[1];



            if( FFABS( VAR_17 - VAR_17 ) < VAR_7 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_8 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_8 ) {



                VAR_1[-1] = ( 2*VAR_17 + VAR_17 + VAR_17 + 2 ) >> 2;   

                VAR_1[0]  = ( 2*VAR_17 + VAR_17 + VAR_17 + 2 ) >> 2;   

                tprintf(VAR_0->s.avctx, "FUNC_0 VAR_5:%d\n# VAR_3:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", VAR_5, VAR_1[-3], VAR_17, VAR_17, VAR_17, VAR_17, VAR_1[2], VAR_1[-3], VAR_1[-2], VAR_1[-1], VAR_1[0], VAR_1[1], VAR_1[2]);

            }

        }

    }

}

static void FUNC_0( H264Context *VAR_0, uint8_t *VAR_1, int VAR_2, int16_t VAR_3[8], int VAR_4[2] ) { int VAR_5; for( VAR_5 = 0; VAR_5 < 8; VAR_5++, VAR_1 += VAR_2) { int VAR_6; int VAR_7; int VAR_8; int VAR_9; int VAR_10 = VAR_5; if( VAR_3[VAR_10] == 0 ) { continue; } VAR_9 = MB_FIELD ? (VAR_5 >> 2) : (VAR_5 & 1); VAR_6 = VAR_4[VAR_9] + VAR_0->slice_alpha_c0_offset; VAR_7 = (alpha_table+52)[VAR_6]; VAR_8  = (beta_table+52)[VAR_4[VAR_9] + VAR_0->slice_beta_offset]; if( VAR_3[VAR_10] < 4 ) { const int VAR_11 = (tc0_table+52)[VAR_6][VAR_3[VAR_10]] + 1; const int VAR_17 = VAR_1[-1]; const int VAR_17 = VAR_1[-2]; const int VAR_17 = VAR_1[0]; const int VAR_17 = VAR_1[1]; if( FFABS( VAR_17 - VAR_17 ) < VAR_7 &&
FFABS( VAR_17 - VAR_17 ) < VAR_8 &&
FFABS( VAR_17 - VAR_17 ) < VAR_8 ) { const int VAR_16 = av_clip( (((VAR_17 - VAR_17 ) << 2) + (VAR_17 - VAR_17) + 4) >> 3, -VAR_11, VAR_11 ); VAR_1[-1] = av_clip_uint8( VAR_17 + VAR_16 ); VAR_1[0]  = av_clip_uint8( VAR_17 - VAR_16 ); tprintf(VAR_0->s.avctx, "FUNC_0 VAR_5:%d, VAR_4:%d, indexA:%d, VAR_7:%d, VAR_8:%d, VAR_11:%d\n# VAR_3:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", VAR_5, VAR_4[VAR_9], VAR_6, VAR_7, VAR_8, VAR_11, VAR_3[VAR_10], VAR_1[-3], VAR_17, VAR_17, VAR_17, VAR_17, VAR_1[2], VAR_17, VAR_1[-1], VAR_1[0], VAR_17); } }else{ const int VAR_17 = VAR_1[-1]; const int VAR_17 = VAR_1[-2]; const int VAR_17 = VAR_1[0]; const int VAR_17 = VAR_1[1]; if( FFABS( VAR_17 - VAR_17 ) < VAR_7 &&
FFABS( VAR_17 - VAR_17 ) < VAR_8 &&
FFABS( VAR_17 - VAR_17 ) < VAR_8 ) { VAR_1[-1] = ( 2*VAR_17 + VAR_17 + VAR_17 + 2 ) >> 2; VAR_1[0]  = ( 2*VAR_17 + VAR_17 + VAR_17 + 2 ) >> 2; tprintf(VAR_0->s.avctx, "FUNC_0 VAR_5:%d\n# VAR_3:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", VAR_5, VAR_1[-3], VAR_17, VAR_17, VAR_17, VAR_17, VAR_1[2], VAR_1[-3], VAR_1[-2], VAR_1[-1], VAR_1[0], VAR_1[1], VAR_1[2]); } } } }