Mercurial > libavcodec.hg
changeset 11611:a207cc043de8 libavcodec
DCA: use FASTDIV in decode_blockcode()
author | mru |
---|---|
date | Mon, 12 Apr 2010 16:05:10 +0000 |
parents | 475eab960878 |
children | 90b6d031c821 |
files | dca.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/dca.c Mon Apr 12 13:28:59 2010 +0000 +++ b/dca.c Mon Apr 12 16:05:10 2010 +0000 @@ -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 @@ 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)