diff options
author | Måns Rullgård <mans@mansr.com> | 2010-04-12 16:05:10 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-04-12 16:05:10 +0000 |
commit | 843c7aa8fbffcfd303181bcfecdd9f39b2c75d80 (patch) | |
tree | f8ef64aa770c29e07c6949305629edbdee05c8bd /libavcodec | |
parent | 6a36798f9bad3568ba212a30d5cd3295e71d57dc (diff) | |
download | ffmpeg-843c7aa8fbffcfd303181bcfecdd9f39b2c75d80.tar.gz |
DCA: use FASTDIV in decode_blockcode()
Originally committed as revision 22855 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dca.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 79ea37316c..8db25fdae9 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -30,6 +30,7 @@ #include <stddef.h> #include <stdio.h> +#include "libavutil/intmath.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "dsputil.h" @@ -907,8 +908,9 @@ static int decode_blockcode(int code, int levels, int *values) int offset = (levels - 1) >> 1; for (i = 0; i < 4; i++) { - values[i] = (code % levels) - offset; - code /= levels; + int div = FASTDIV(code, levels); + values[i] = code - offset - div*levels; + code = div; } if (code == 0) |