[FFmpeg-cvslog] r14144 - trunk/libavcodec/motion_est.c
michael
subversion
Wed Jul 9 21:21:08 CEST 2008
Author: michael
Date: Wed Jul 9 21:21:08 2008
New Revision: 14144
Log:
Remove ancient code that hasnt worked in many years.
Modified:
trunk/libavcodec/motion_est.c
Modified: trunk/libavcodec/motion_est.c
==============================================================================
--- trunk/libavcodec/motion_est.c (original)
+++ trunk/libavcodec/motion_est.c Wed Jul 9 21:21:08 2008
@@ -338,229 +338,6 @@ static inline void no_motion_search(Mpeg
*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(MpegEncC
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(MpegEncC
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:
{
More information about the ffmpeg-cvslog
mailing list