diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-09 19:21:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-09 19:21:08 +0000 |
commit | fdbb1feb270ec3c39236f3cdafe24a517b53340b (patch) | |
tree | 45c7753f5c85c8bc80ca8410fb2f8c85e2665628 /libavcodec/motion_est.c | |
parent | 18c640054c1dc94eeaee2d975ae1d93e16095470 (diff) | |
download | ffmpeg-fdbb1feb270ec3c39236f3cdafe24a517b53340b.tar.gz |
Remove ancient code that hasnt worked in many years.
Originally committed as revision 14144 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r-- | libavcodec/motion_est.c | 257 |
1 files changed, 0 insertions, 257 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index d3877c0682..71fe90f420 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -338,229 +338,6 @@ static inline void no_motion_search(MpegEncContext * s, *my_ptr = 16 * s->mb_y; } -#if 0 /* the use of these functions is inside #if 0 */ -static int full_motion_search(MpegEncContext * s, - int *mx_ptr, int *my_ptr, int range, - int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture) -{ - int x1, y1, x2, y2, xx, yy, x, y; - int mx, my, dmin, d; - uint8_t *pix; - - xx = 16 * s->mb_x; - yy = 16 * s->mb_y; - x1 = xx - range + 1; /* we loose one pixel to avoid boundary pb with half pixel pred */ - if (x1 < xmin) - x1 = xmin; - x2 = xx + range - 1; - if (x2 > xmax) - x2 = xmax; - y1 = yy - range + 1; - if (y1 < ymin) - y1 = ymin; - y2 = yy + range - 1; - if (y2 > ymax) - y2 = ymax; - pix = s->new_picture.data[0] + (yy * s->linesize) + xx; - dmin = 0x7fffffff; - mx = 0; - my = 0; - for (y = y1; y <= y2; y++) { - for (x = x1; x <= x2; x++) { - d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x, - s->linesize, 16); - if (d < dmin || - (d == dmin && - (abs(x - xx) + abs(y - yy)) < - (abs(mx - xx) + abs(my - yy)))) { - dmin = d; - mx = x; - my = y; - } - } - } - - *mx_ptr = mx; - *my_ptr = my; - -#if 0 - if (*mx_ptr < -(2 * range) || *mx_ptr >= (2 * range) || - *my_ptr < -(2 * range) || *my_ptr >= (2 * range)) { - av_log(NULL, AV_LOG_ERROR, "error %d %d\n", *mx_ptr, *my_ptr); - } -#endif - return dmin; -} - - -static int log_motion_search(MpegEncContext * s, - int *mx_ptr, int *my_ptr, int range, - int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture) -{ - int x1, y1, x2, y2, xx, yy, x, y; - int mx, my, dmin, d; - uint8_t *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.data[0] + (yy * s->linesize) + xx; - dmin = 0x7fffffff; - mx = 0; - my = 0; - - do { - for (y = y1; y <= y2; y += range) { - for (x = x1; x <= x2; x += range) { - d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x, s->linesize, 16); - if (d < dmin || (d == dmin && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) { - dmin = d; - mx = x; - my = y; - } - } - } - - range = range >> 1; - - 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 - av_log(s->avctx, AV_LOG_DEBUG, "log - MX: %d\tMY: %d\n", mx, my); -#endif - *mx_ptr = mx; - *my_ptr = my; - return dmin; -} - -static int phods_motion_search(MpegEncContext * s, - int *mx_ptr, int *my_ptr, int range, - int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture) -{ - int x1, y1, x2, y2, xx, yy, x, y, lastx, d; - int mx, my, dminx, dminy; - uint8_t *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.data[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 = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (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 = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (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 - av_log(s->avctx, AV_LOG_DEBUG, "phods - MX: %d\tMY: %d\n", mx, my); -#endif - - /* half pixel search */ - *mx_ptr = mx; - *my_ptr = my; - return dminy; -} -#endif /* 0 */ - #define Z_THRESHOLD 256 #define CHECK_SAD_HALF_MV(suffix, x, y) \ @@ -1225,23 +1002,6 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, my-= mb_y*16; dmin = 0; break; -#if 0 - case ME_FULL: - dmin = full_motion_search(s, &mx, &my, range, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; - case ME_LOG: - dmin = log_motion_search(s, &mx, &my, range / 2, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; - case ME_PHODS: - dmin = phods_motion_search(s, &mx, &my, range / 2, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; -#endif case ME_X1: case ME_EPZS: { @@ -1513,23 +1273,6 @@ static int ff_estimate_motion_b(MpegEncContext * s, mx-= mb_x*16; my-= mb_y*16; break; -#if 0 - case ME_FULL: - dmin = full_motion_search(s, &mx, &my, range, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; - case ME_LOG: - dmin = log_motion_search(s, &mx, &my, range / 2, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; - case ME_PHODS: - dmin = phods_motion_search(s, &mx, &my, range / 2, ref_picture); - mx-= mb_x*16; - my-= mb_y*16; - break; -#endif case ME_X1: case ME_EPZS: { |