summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-08-26 20:04:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-08-26 20:04:54 +0000
commit155ec6edf82692bcf3a5f87d2bc697404f4e5aaf (patch)
treecbd180563f98372c770bed15c39b3a5054f115f5 /libavcodec/motion_est.c
parent714872547db409728e914916f5e070b2f18e5f8c (diff)
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.c')
-rw-r--r--libavcodec/motion_est.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 9239503373..a43cd13619 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -268,14 +268,16 @@ void ff_init_me(MpegEncContext *s){
}
// 8x8 fullpel search would need a 4x4 chroma compare, which we dont have yet, and even if we had the motion estimation code doesnt expect it
- if((c->avctx->me_cmp&FF_CMP_CHROMA) && !s->dsp.me_cmp[2]){
- s->dsp.me_cmp[2]= zero_cmp;
- }
- if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
- s->dsp.me_sub_cmp[2]= zero_cmp;
+ if(s->codec_id != CODEC_ID_SNOW){
+ if((c->avctx->me_cmp&FF_CMP_CHROMA) && !s->dsp.me_cmp[2]){
+ s->dsp.me_cmp[2]= zero_cmp;
+ }
+ if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
+ s->dsp.me_sub_cmp[2]= zero_cmp;
+ }
+ c->hpel_put[2][0]= c->hpel_put[2][1]=
+ c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
}
- c->hpel_put[2][0]= c->hpel_put[2][1]=
- c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
c->temp= c->scratchpad;
}
@@ -1313,7 +1315,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= get_mb_score(s, mx, my, 0, 0);
+ dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
if((s->flags&CODEC_FLAG_4MV)
&& !c->skip && varc>50 && vard>10){
@@ -1529,7 +1531,7 @@ static int ff_estimate_motion_b(MpegEncContext * s,
dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16);
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= get_mb_score(s, mx, my, 0, ref_index);
+ dmin= ff_get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
//printf("%d %d %d %d//", s->mb_x, s->mb_y, mx, my);
// s->mb_type[mb_y*s->mb_width + mb_x]= mb_type;
@@ -1719,7 +1721,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y)
dmin = hpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= get_mb_score(s, mx, my, 0, 0);
+ dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed