int xmin, int ymin, int xmax, int ymax)
int xmin, int ymin, int xmax, int ymax, int pred_x, int pred_y)
static void halfpel_motion_search(MpegEncContext * s,				  int *mx_ptr, int *my_ptr, int dmin,				  int xmin, int ymin, int xmax, int ymax){    int mx, my, mx1, my1, d, xx, yy, dminh;    UINT8 *pix;    mx = *mx_ptr << 1;    my = *my_ptr << 1;    xx = 16 * s->mb_x;    yy = 16 * s->mb_y;    dminh = dmin;    /* Half pixel search */    mx1 = mx;    my1 = my;    pix = s->new_picture[0] + (yy * s->linesize) + xx;    if ((mx > (xmin << 1)) && mx < (xmax << 1) &&         (my > (ymin << 1)) && my < (ymax << 1)) {	    int dx, dy, px, py;	    UINT8 *ptr;        for (dy = -1; dy <= 1; dy++) {            for (dx = -1; dx <= 1; dx++) {                if (dx != 0 || dy != 0) {                    px = mx1 + dx;                    py = my1 + dy;                    ptr = s->last_picture[0] + ((py >> 1) * s->linesize) + (px >> 1);                    switch (((py & 1) << 1) | (px & 1)) {                    default:                    case 0:                        d = pix_abs16x16(pix, ptr, s->linesize, 16);                        break;                    case 1:                        d = pix_abs16x16_x2(pix, ptr, s->linesize, 16);                        break;                    case 2:                        d = pix_abs16x16_y2(pix, ptr, s->linesize, 16);                        break;                    case 3:                        d = pix_abs16x16_xy2(pix, ptr, s->linesize, 16);                        break;                    }                    if (d < dminh) {                        dminh = d;                        mx = px;                        my = py;                    }                }            }        }    }    *mx_ptr = mx - (xx << 1);    *my_ptr = my - (yy << 1);    //fprintf(stderr,"half  - MX: %d\tMY: %d\n",*mx_ptr ,*my_ptr);}