summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-03-24 04:58:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-03-24 04:58:54 +0000
commit122546a6d151d3af88cc2330b9d9bb6e4fcaef68 (patch)
treee5c7b7fb41a3d0f937dfa101c8f02053384aabfc /libavcodec/motion_est.c
parent174489bdcc90dca16cbc9500381877d475e0f3a6 (diff)
seems the old intra/inter decission is slightly better with a threshold, than the new one
Originally committed as revision 357 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 4c0a0cc8cc..ce80505bf9 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -733,10 +733,16 @@ int estimate_motion(MpegEncContext * s,
pix = s->new_picture[0] + (yy * s->linesize) + xx;
/* At this point (mx,my) are full-pell and the absolute displacement */
ppix = s->last_picture[0] + (my * s->linesize) + mx;
-
+
sum = pix_sum(pix, s->linesize);
- varc = pix_dev(pix, s->linesize, (sum+128)>>8);
+#if 0
+ varc = pix_dev(pix, s->linesize, (sum+128)>>8) + INTER_BIAS;
vard = pix_abs16x16(pix, ppix, s->linesize, 16);
+#else
+ sum= (sum+8)>>4;
+ varc = ((pix_norm1(pix, s->linesize) - sum*sum + 128 + 500)>>8);
+ vard = (pix_norm(pix, ppix, s->linesize)+128)>>8;
+#endif
s->mb_var[s->mb_width * mb_y + mb_x] = varc;
s->avg_mb_var += varc;
@@ -746,7 +752,7 @@ int estimate_motion(MpegEncContext * s,
printf("varc=%4d avg_var=%4d (sum=%4d) vard=%4d mx=%2d my=%2d\n",
varc, s->avg_mb_var, sum, vard, mx - xx, my - yy);
#endif
- if (vard <= 64 || vard < varc + INTER_BIAS) {
+ if (vard <= 64 || vard < varc) {
if (s->full_search != ME_ZERO) {
halfpel_motion_search(s, &mx, &my, dmin, xmin, ymin, xmax, ymax, pred_x, pred_y);
} else {