Mercurial > libavcodec.hg
diff msmpeg4.c @ 1261:362947395f5c libavcodec
fastdiv patch by (BERO <bero at geocities dot co dot jp>) with fixes & cleanup by me
author | michaelni |
---|---|
date | Wed, 14 May 2003 15:12:13 +0000 |
parents | 625ccacd1113 |
children | a979fab41ed8 |
line wrap: on
line diff
--- a/msmpeg4.c Wed May 14 12:32:17 2003 +0000 +++ b/msmpeg4.c Wed May 14 15:12:13 2003 +0000 @@ -78,8 +78,6 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]); static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]); -extern uint32_t inverse[256]; - #ifdef DEBUG int intra_count = 0; @@ -699,7 +697,7 @@ sum+=src[x + y*stride]; } } - return (sum + (scale>>1))/scale; + return FASTDIV((sum + (scale>>1)), scale); } /* dir = 0: left, dir = 1: top prediction */ @@ -763,9 +761,9 @@ b = (b + (8 >> 1)) / 8; c = (c + (8 >> 1)) / 8; } else { - a = (a + (scale >> 1)) / scale; - b = (b + (scale >> 1)) / scale; - c = (c + (scale >> 1)) / scale; + a = FASTDIV((a + (scale >> 1)), scale); + b = FASTDIV((b + (scale >> 1)), scale); + c = FASTDIV((c + (scale >> 1)), scale); } #endif /* XXX: WARNING: they did not choose the same test as MPEG4. This