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

    int i;

    int index_a = qp + h->slice_alpha_c0_offset;

    int alpha = (alpha_table+52)[index_a];

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

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

        const int bS_index = i*bsi;



        if( bS[bS_index] == 0 ) {

            continue;

        }



        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[4], int bsi, int qp ) {

    int i;

    int index_a = qp + h->slice_alpha_c0_offset;

    int alpha = (alpha_table+52)[index_a];

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

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

        const int bS_index = i*bsi;



        if( bS[bS_index] == 0 ) {

            continue;

        }



        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[4], int VAR_4, int VAR_5 ) {

    int VAR_6;

    int VAR_7 = VAR_5 + VAR_0->slice_alpha_c0_offset;

    int VAR_8 = (alpha_table+52)[VAR_7];

    int VAR_9  = (beta_table+52)[VAR_5 + VAR_0->slice_beta_offset];

    for( VAR_6 = 0; VAR_6 < 4; VAR_6++, VAR_1 += VAR_2) {

        const int VAR_10 = VAR_6*VAR_4;



        if( VAR_3[VAR_10] == 0 ) {

            continue;

        }



        if( VAR_3[VAR_10] < 4 ) {

            const int VAR_11 = (tc0_table+52)[VAR_7][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_8 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_9 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_9 ) {

                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_6:%d, VAR_5:%d, indexA:%d, VAR_8:%d, VAR_9:%d, VAR_11:%d\n# VAR_3:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", VAR_6, VAR_5[qp_index], VAR_7, VAR_8, VAR_9, 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_8 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_9 &&

                FFABS( VAR_17 - VAR_17 ) < VAR_9 ) {



                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_6:%d\n# VAR_3:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", VAR_6, 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[4], int VAR_4, int VAR_5 ) { int VAR_6; int VAR_7 = VAR_5 + VAR_0->slice_alpha_c0_offset; int VAR_8 = (alpha_table+52)[VAR_7]; int VAR_9  = (beta_table+52)[VAR_5 + VAR_0->slice_beta_offset]; for( VAR_6 = 0; VAR_6 < 4; VAR_6++, VAR_1 += VAR_2) { const int VAR_10 = VAR_6*VAR_4; if( VAR_3[VAR_10] == 0 ) { continue; } if( VAR_3[VAR_10] < 4 ) { const int VAR_11 = (tc0_table+52)[VAR_7][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_8 &&
FFABS( VAR_17 - VAR_17 ) < VAR_9 &&
FFABS( VAR_17 - VAR_17 ) < VAR_9 ) { 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_6:%d, VAR_5:%d, indexA:%d, VAR_8:%d, VAR_9:%d, VAR_11:%d\n# VAR_3:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", VAR_6, VAR_5[qp_index], VAR_7, VAR_8, VAR_9, 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_8 &&
FFABS( VAR_17 - VAR_17 ) < VAR_9 &&
FFABS( VAR_17 - VAR_17 ) < VAR_9 ) { 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_6:%d\n# VAR_3:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", VAR_6, 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]); } } } }