Mercurial > libavcodec.hg
changeset 4326:9af83350d4fd libavcodec
test DIRECT{0,0} too if flag mv0 is used
slight PSNR/bitrate increase
author | michael |
---|---|
date | Fri, 22 Dec 2006 23:30:57 +0000 |
parents | e2621acf32f1 |
children | a9f4d5c92218 |
files | motion_est.c motion_est_template.c |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/motion_est.c Fri Dec 22 10:10:13 2006 +0000 +++ b/motion_est.c Fri Dec 22 23:30:57 2006 +0000 @@ -1978,6 +1978,8 @@ } //FIXME something smarter if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //dont try direct mode if its invalid for this MB + if(s->codec_id == CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy]) + type |= CANDIDATE_MB_TYPE_DIRECT0; #if 0 if(s->out_format == FMT_MPEG1) type |= CANDIDATE_MB_TYPE_INTRA;
--- a/motion_est_template.c Fri Dec 22 10:10:13 2006 +0000 +++ b/motion_est_template.c Fri Dec 22 23:30:57 2006 +0000 @@ -1025,7 +1025,7 @@ score_map[0]= dmin; //FIXME precalc first term below? - if((s->pict_type == B_TYPE || s->flags&CODEC_FLAG_MV0) && !(c->flags & FLAG_DIRECT)) + if((s->pict_type == B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0) dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; /* first line */