From 843c7aa8fbffcfd303181bcfecdd9f39b2c75d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Mon, 12 Apr 2010 16:05:10 +0000 Subject: [PATCH] DCA: use FASTDIV in decode_blockcode() Originally committed as revision 22855 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dca.c | 6 ++++-- 1 file 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 #include +#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)