d = pix_abs16x16(pix, s->last_picture[0] + (y * s->linesize) + x, s->linesize, 16);
d = pix_abs16x16(pix, s->last_picture[0] + (y * s->linesize) + x, s->linesize);
static int phods_motion_search(MpegEncContext * s,                               int *mx_ptr, int *my_ptr, int range,                               int xmin, int ymin, int xmax, int ymax){    int x1, y1, x2, y2, xx, yy, x, y, lastx, d;    int mx, my, dminx, dminy;    UINT8 *pix;    xx = s->mb_x << 4;    yy = s->mb_y << 4;    /* Left limit */    x1 = xx - range;    if (x1 < xmin)	x1 = xmin;    /* Right limit */    x2 = xx + range;    if (x2 > xmax)	x2 = xmax;    /* Upper limit */    y1 = yy - range;    if (y1 < ymin)	y1 = ymin;    /* Lower limit */    y2 = yy + range;    if (y2 > ymax)	y2 = ymax;    pix = s->new_picture[0] + (yy * s->linesize) + xx;    mx = 0;    my = 0;    x = xx;    y = yy;    do {        dminx = 0x7fffffff;        dminy = 0x7fffffff;	lastx = x;	for (x = x1; x <= x2; x += range) {	    d = pix_abs16x16(pix, s->last_picture[0] + (y * s->linesize) + x, s->linesize, 16);	    if (d < dminx || (d == dminx && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) {		dminx = d;		mx = x;	    }	}	x = lastx;	for (y = y1; y <= y2; y += range) {	    d = pix_abs16x16(pix, s->last_picture[0] + (y * s->linesize) + x, s->linesize, 16);	    if (d < dminy || (d == dminy && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) {		dminy = d;		my = y;	    }	}	range = range >> 1;	x = mx;	y = my;	x1 = mx - range;	if (x1 < xmin)	    x1 = xmin;	x2 = mx + range;	if (x2 > xmax)	    x2 = xmax;	y1 = my - range;	if (y1 < ymin)	    y1 = ymin;	y2 = my + range;	if (y2 > ymax)	    y2 = ymax;    } while (range >= 1);#ifdef DEBUG    fprintf(stderr, "phods     - MX: %d\tMY: %d\n", mx, my);#endif    /* half pixel search */    *mx_ptr = mx;    *my_ptr = my;    return dminy;}