diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-08-26 20:04:54 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-08-26 20:04:54 +0000 |
commit | 155ec6edf82692bcf3a5f87d2bc697404f4e5aaf (patch) | |
tree | cbd180563f98372c770bed15c39b3a5054f115f5 /libavcodec/motion_est_template.c | |
parent | 714872547db409728e914916f5e070b2f18e5f8c (diff) | |
download | ffmpeg-155ec6edf82692bcf3a5f87d2bc697404f4e5aaf.tar.gz |
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)
Originally committed as revision 3416 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r-- | libavcodec/motion_est_template.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index db7c2a4cbc..6a0509f810 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -221,13 +221,11 @@ static int hpel_motion_search(MpegEncContext * s, } #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 @@ static int inline get_mb_score(MpegEncContext * s, int mx, int my, int src_index 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; |