changeset 7230:6aa2f54e6c98 libavcodec

Remove ancient code that hasnt worked in many years.
author michael
date Wed, 09 Jul 2008 19:21:08 +0000
parents f03d29b6fefe
children 21f5d934ccbd
files motion_est.c
diffstat 1 files changed, 0 insertions(+), 257 deletions(-) [+]
line wrap: on
line diff
--- a/motion_est.c	Wed Jul 09 18:59:52 2008 +0000
+++ b/motion_est.c	Wed Jul 09 19:21:08 2008 +0000
@@ -338,229 +338,6 @@
     *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 @@
         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 @@
         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:
        {