int16_t *top_mv=    s->current_picture.motion_val[0][s->block_wrap[0]*(( b_y   <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))]; int16_t *bottom_mv= s->current_picture.motion_val[0][s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
int16_t *top_mv=    s->current_picture.motion_val[0][s->b8_stride*( b_y   <<(1-is_luma)) + (b_x<<(1-is_luma))]; int16_t *bottom_mv= s->current_picture.motion_val[0][s->b8_stride*((b_y+1)<<(1-is_luma)) + (b_x<<(1-is_luma))];
static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){    int b_x, b_y;    uint8_t *cm = cropTbl + MAX_NEG_CROP;    for(b_y=0; b_y<h-1; b_y++){        for(b_x=0; b_x<w; b_x++){            int x;            int top_status   = s->error_status_table[(b_x>>is_luma) + ( b_y   >>is_luma)*s->mb_stride];            int bottom_status= s->error_status_table[(b_x>>is_luma) + ((b_y+1)>>is_luma)*s->mb_stride];            int top_intra=     IS_INTRA(s->current_picture.mb_type      [(b_x>>is_luma) + ( b_y   >>is_luma)*s->mb_stride]);            int bottom_intra=  IS_INTRA(s->current_picture.mb_type      [(b_x>>is_luma) + ((b_y+1)>>is_luma)*s->mb_stride]);            int top_damage =      top_status&(DC_ERROR|AC_ERROR|MV_ERROR);            int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);            int offset= b_x*8 + b_y*stride*8;            int16_t *top_mv=    s->current_picture.motion_val[0][s->block_wrap[0]*(( b_y   <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];            int16_t *bottom_mv= s->current_picture.motion_val[0][s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];                        if(!(top_damage||bottom_damage)) continue; // both undamaged                        if(   (!top_intra) && (!bottom_intra)                && ABS(top_mv[0]-bottom_mv[0]) + ABS(top_mv[1]+bottom_mv[1]) < 2) continue;                        for(x=0; x<8; x++){                int a,b,c,d;                                a= dst[offset + x + 7*stride] - dst[offset + x + 6*stride];                b= dst[offset + x + 8*stride] - dst[offset + x + 7*stride];                c= dst[offset + x + 9*stride] - dst[offset + x + 8*stride];                                d= ABS(b) - ((ABS(a) + ABS(c)+1)>>1);                d= FFMAX(d, 0);                if(b<0) d= -d;                                if(d==0) continue;                if(!(top_damage && bottom_damage))                    d= d*16/9;                                if(top_damage){                    dst[offset + x +  7*stride] = cm[dst[offset + x +  7*stride] + ((d*7)>>4)];                    dst[offset + x +  6*stride] = cm[dst[offset + x +  6*stride] + ((d*5)>>4)];                    dst[offset + x +  5*stride] = cm[dst[offset + x +  5*stride] + ((d*3)>>4)];                    dst[offset + x +  4*stride] = cm[dst[offset + x +  4*stride] + ((d*1)>>4)];                }                if(bottom_damage){                    dst[offset + x +  8*stride] = cm[dst[offset + x +  8*stride] - ((d*7)>>4)];                    dst[offset + x +  9*stride] = cm[dst[offset + x +  9*stride] - ((d*5)>>4)];                    dst[offset + x + 10*stride] = cm[dst[offset + x + 10*stride] - ((d*3)>>4)];                    dst[offset + x + 11*stride] = cm[dst[offset + x + 11*stride] - ((d*1)>>4)];                }            }        }    }}