diff motion_est_template.c @ 4313:13c897abcab3 libavcodec

fix special casing of the 0,0 MV for b frames (slight PSNR/bitrate gain)
author michael
date Wed, 20 Dec 2006 17:11:54 +0000
parents eb0ae1ce40a5
children 9af83350d4fd
line wrap: on
line diff
--- a/motion_est_template.c	Wed Dec 20 01:30:17 2006 +0000
+++ b/motion_est_template.c	Wed Dec 20 17:11:54 2006 +0000
@@ -1023,7 +1023,9 @@
     dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
     map[0]= map_generation;
     score_map[0]= dmin;
-    if(s->flags&CODEC_FLAG_MV0)
+
+    //FIXME precalc first term below?
+    if((s->pict_type == B_TYPE  || s->flags&CODEC_FLAG_MV0) && !(c->flags & FLAG_DIRECT))
         dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
 
     /* first line */