1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

DCA: use FASTDIV in decode_blockcode()

Originally committed as revision 22855 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-04-12 16:05:10 +00:00
parent 6a36798f9b
commit 843c7aa8fb

View File

@ -30,6 +30,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include "libavutil/intmath.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h" #include "dsputil.h"
@ -907,8 +908,9 @@ static int decode_blockcode(int code, int levels, int *values)
int offset = (levels - 1) >> 1; int offset = (levels - 1) >> 1;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
values[i] = (code % levels) - offset; int div = FASTDIV(code, levels);
code /= levels; values[i] = code - offset - div*levels;
code = div;
} }
if (code == 0) if (code == 0)