Mercurial > libavcodec.hg
diff motion_est_template.c @ 2189:70b27300a496 libavcodec
quad tree based motion compensation (currently only 16x16 & 8x8 OBMC blocks, but can be extended to other block sizes easily)
different intra block coding (previous was just an ugly hack)
1.8% bitrate reduction -0.01PSNR (foreman@352x288 qscale=8)
1.5% bitrate reduction +0.05PSNR (foreman@352x288 qscale=1)
author | michael |
---|---|
date | Thu, 26 Aug 2004 20:04:54 +0000 |
parents | 3378d0677903 |
children | 4306aa6f8f16 |
line wrap: on
line diff
--- a/motion_est_template.c Wed Aug 25 22:35:04 2004 +0000 +++ b/motion_est_template.c Thu Aug 26 20:04:54 2004 +0000 @@ -221,13 +221,11 @@ } #endif -static int inline get_mb_score(MpegEncContext * s, int mx, int my, int src_index, - int ref_index) +int inline ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index, + int ref_index, int size, int h, int add_rate) { // const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp; MotionEstContext * const c= &s->me; - const int size= 0; - const int h= 16; const int penalty_factor= c->mb_penalty_factor; const int flags= c->mb_flags; const int qpel= flags & FLAG_QPEL; @@ -242,12 +240,12 @@ cmp_sub= s->dsp.mb_cmp[size]; chroma_cmp_sub= s->dsp.mb_cmp[size+1]; - assert(!c->skip); - assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp); +// assert(!c->skip); +// assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp); d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags); //FIXME check cbp before adding penalty for (0,0) vector - if(mx || my || size>0) + if(add_rate && (mx || my || size>0)) d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor; return d;