summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-12-20 17:11:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-12-20 17:11:54 +0000
commite4d0e2edb977f08a9dffaf997496ae8686988784 (patch)
treec070260778f335d35268a7dd86d57d9096c842f3 /libavcodec/motion_est_template.c
parent0683a5c558704c2425b95d8852230121530a4394 (diff)
fix special casing of the 0,0 MV for b frames (slight PSNR/bitrate gain)
Originally committed as revision 7334 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r--libavcodec/motion_est_template.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index ff5ea63f69..1bfda10472 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -1023,7 +1023,9 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
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 */