Mercurial > libavcodec.hg
diff motion_est.c @ 1422:efeed6e29f9b libavcodec
oooooops, having 2 Eterms open and doing cvs diff in one and cvs commit in the other sucks, especially if they are in different directories (MPlayer/main/libavcodec vs. ffmpeg/libavcodec)
author | michaelni |
---|---|
date | Mon, 25 Aug 2003 22:54:53 +0000 |
parents | 340c90faa1dc |
children | b0f89a7855aa |
line wrap: on
line diff
--- a/motion_est.c Mon Aug 25 22:47:32 2003 +0000 +++ b/motion_est.c Mon Aug 25 22:54:53 2003 +0000 @@ -32,8 +32,8 @@ #include "dsputil.h" #include "mpegvideo.h" -#undef NDEBUG -#include <assert.h> +//#undef NDEBUG +//#include <assert.h> #define SQ(a) ((a)*(a)) @@ -1674,53 +1674,3 @@ } } } -#if 0 -/** - * estimates global motion and inits sprite_ref - */ -void ff_estimate_global_motion(MpegEncContext *s, int sprite_ref[3][2]){ - int y; - int num= 16<<s->f_code; - int score[2][num]; - int best_i[2]={0,0}; - int best_score[2]={0,0}; - - memset(score, 0, 2*num*sizeof(int)); - - for(y=0; y<s->mb_height; y++){ - int x; - int xy= (y+1)* (s->mb_width+2)+1; - int i= y*s->mb_width; - for(x=0; x<s->mb_width; x++){ - int mv[2]; - - if(!(s->mb_type[i]&MB_TYPE_INTER)) - continue; - - mv[0]= s->p_mv_table[xy][0]; - mv[1]= s->p_mv_table[xy][1]; - - if(mv[0]==0 && mv[1]==0) continue; - - score[0][mv[0] + num/2]++; - score[1][mv[1] + num/2]++; - } - } - - for(n=0; n<2; n++){ - for(i=1; i<num-1; i++){ - int s= score[n][i-1] + score[n][i]*2 + score[n][i+1]; - - if(s > best_score[n]){ - best_score[n]= s; - best_i[n]= i; - } - } - } - - sprite_ref[0][0]= best_i[0] - num/2; - sprite_ref[0][1]= best_i[1] - num/2; - - // decide block type -} -#endif