# HG changeset patch # User michael # Date 1166634714 0 # Node ID 13c897abcab34c978b7d3aadb6dfd0e7865bf46e # Parent eb0ae1ce40a5de5db24237c4dc09ca96235e7ddc fix special casing of the 0,0 MV for b frames (slight PSNR/bitrate gain) diff -r eb0ae1ce40a5 -r 13c897abcab3 motion_est_template.c --- 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 */