diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-02-08 18:23:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-02-08 18:23:39 +0000 |
commit | c40c34828a1dc775225bdd7b0d6f04cc24deaa7a (patch) | |
tree | cd5fa454a820883ea4aaa80049e307248130c4c3 /libavcodec/h263.c | |
parent | 16e83cbbc4023ab89c0ac7c193ab02e22ce72790 (diff) | |
download | ffmpeg-c40c34828a1dc775225bdd7b0d6f04cc24deaa7a.tar.gz |
direct blocksize in bframes fix (might fix qpel+bframe bug)
Originally committed as revision 1557 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 63bf190597..a9c1fc7421 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -403,17 +403,20 @@ void ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){ uint16_t time_pp= s->pp_time; uint16_t time_pb= s->pb_time; int i; - + //FIXME avoid divides switch(s->co_located_type_table[mb_index]){ case 0: - s->mv_type= MV_TYPE_16X16; - s->mv[0][0][0] = s->motion_val[xy][0]*time_pb/time_pp + mx; - s->mv[0][0][1] = s->motion_val[xy][1]*time_pb/time_pp + my; - s->mv[1][0][0] = mx ? s->mv[0][0][0] - s->motion_val[xy][0] + s->mv[0][0][0] = s->mv[0][1][0] = s->mv[0][2][0] = s->mv[0][3][0] = s->motion_val[xy][0]*time_pb/time_pp + mx; + s->mv[0][0][1] = s->mv[0][1][1] = s->mv[0][2][1] = s->mv[0][3][1] = s->motion_val[xy][1]*time_pb/time_pp + my; + s->mv[1][0][0] = s->mv[1][1][0] = s->mv[1][2][0] = s->mv[1][3][0] = mx ? s->mv[0][0][0] - s->motion_val[xy][0] : s->motion_val[xy][0]*(time_pb - time_pp)/time_pp; - s->mv[1][0][1] = my ? s->mv[0][0][1] - s->motion_val[xy][1] + s->mv[1][0][1] = s->mv[1][1][1] = s->mv[1][2][1] = s->mv[1][3][1] = my ? s->mv[0][0][1] - s->motion_val[xy][1] : s->motion_val[xy][1]*(time_pb - time_pp)/time_pp; + if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample) + s->mv_type= MV_TYPE_16X16; + else + s->mv_type= MV_TYPE_8X8; break; case CO_LOCATED_TYPE_4MV: s->mv_type = MV_TYPE_8X8; |