diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-03-23 20:21:33 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-03-23 20:21:33 +0000 |
commit | 9d2a0355299c7c6004f1b804e6339e5e8759cd27 (patch) | |
tree | eb1faa9f689e41b5442815066eeb9c9222e131a4 /libavcodec/h263.c | |
parent | 098eefe183bc3430de4330525becc89da7468d20 (diff) | |
download | ffmpeg-9d2a0355299c7c6004f1b804e6339e5e8759cd27.tar.gz |
fixing motion estimation with h263p hopefully
Originally committed as revision 355 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 329db317be..4513288e01 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -51,6 +51,7 @@ extern UINT32 inverse[256]; static UINT16 mv_penalty[MAX_FCODE][MAX_MV*2+1]; static UINT8 fcode_tab[MAX_MV*2+1]; +static UINT8 umv_fcode_tab[MAX_MV*2+1]; int h263_get_picture_format(int width, int height) { @@ -689,13 +690,16 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s) mv_penalty[f_code][mv+MAX_MV]= len; } } - for(f_code=MAX_FCODE; f_code>0; f_code--){ for(mv=-(16<<f_code); mv<(16<<f_code); mv++){ fcode_tab[mv+MAX_MV]= f_code; } } + + for(mv=0; mv<MAX_MV*2+1; mv++){ + umv_fcode_tab[mv]= 1; + } } void h263_encode_init(MpegEncContext *s) @@ -709,10 +713,11 @@ void h263_encode_init(MpegEncContext *s) init_mv_penalty_and_fcode(s); } - s->mv_penalty= mv_penalty; + s->mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p - // use fcodes >1 only for mpeg4&h263 FIXME - if(!s->h263_msmpeg4) s->fcode_tab= fcode_tab; + // use fcodes >1 only for mpeg4 & h263 & h263p FIXME + if(s->h263_plus) s->fcode_tab= umv_fcode_tab; + else if(s->h263_pred) s->fcode_tab= fcode_tab; } static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) |