tprintf("filter_mb_edgeh i:%d d:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, d, qp, index_a, alpha, beta, bS[i], p2, p1, p0, q0, q1, q2, pix[-2*pix_next], pix[-pix_next], pix[0], pix[pix_next]);
static void filter_mb_edgeh( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) {    int i, d;    const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 );    const int alpha = alpha_table[index_a];    const int beta  = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];    const int pix_next  = stride;    for( i = 0; i < 4; i++ ) {        if( bS[i] == 0 ) {            pix += 4;            continue;        }        if( bS[i] < 4 ) {            const int tc0 = tc0_table[index_a][bS[i] - 1];            /* 4px edge length */            for( d = 0; d < 4; d++ ) {                const int p0 = pix[-1*pix_next];                const int p1 = pix[-2*pix_next];                const int p2 = pix[-3*pix_next];                const int q0 = pix[0];                const int q1 = pix[1*pix_next];                const int q2 = pix[2*pix_next];                if( ABS( p0 - q0 ) < alpha &&                    ABS( p1 - p0 ) < beta &&                    ABS( q1 - q0 ) < beta ) {                    int tc = tc0;                    int i_delta;                    if( ABS( p2 - p0 ) < beta ) {                        pix[-2*pix_next] = p1 + clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 );                        tc++;                    }                    if( ABS( q2 - q0 ) < beta ) {                        pix[pix_next] = q1 + clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 );                        tc++;                    }                    i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );                    pix[-pix_next] = clip_uint8( p0 + i_delta );    /* p0' */                    pix[0]         = clip_uint8( q0 - i_delta );    /* q0' */                }                pix++;            }        }else{            /* 4px edge length */            for( d = 0; d < 4; d++ ) {                const int p0 = pix[-1*pix_next];                const int p1 = pix[-2*pix_next];                const int p2 = pix[-3*pix_next];                const int q0 = pix[0];                const int q1 = pix[1*pix_next];                const int q2 = pix[2*pix_next];                if( ABS( p0 - q0 ) < alpha &&                    ABS( p1 - p0 ) < beta &&                    ABS( q1 - q0 ) < beta ) {                    const int p3 = pix[-4*pix_next];                    const int q3 = pix[ 3*pix_next];                    if(ABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){                        if( ABS( p2 - p0 ) < beta) {                            /* p0', p1', p2' */                            pix[-1*pix_next] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;                            pix[-2*pix_next] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;                            pix[-3*pix_next] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;                        } else {                            /* p0' */                            pix[-1*pix_next] = ( 2*p1 + p0 + q1 + 2 ) >> 2;                        }                        if( ABS( q2 - q0 ) < beta) {                            /* q0', q1', q2' */                            pix[0*pix_next] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;                            pix[1*pix_next] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;                            pix[2*pix_next] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;                        } else {                            /* q0' */                            pix[0*pix_next] = ( 2*q1 + q0 + p1 + 2 ) >> 2;                        }                    }else{                        /* p0', q0' */                        pix[-1*pix_next] = ( 2*p1 + p0 + q1 + 2 ) >> 2;                        pix[ 0*pix_next] = ( 2*q1 + q0 + p1 + 2 ) >> 2;                    }                }                pix++;            }        }    }}