[FFmpeg-cvslog] avcodec/dcadec: make dca_dmix_code() 650% faster
Michael Niedermayer
git at videolan.org
Fri May 23 22:09:48 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 23 21:59:04 2014 +0200| [6da06ef6bbc01b713f67ffb94e7697eb2393ebe4] | committer: Michael Niedermayer
avcodec/dcadec: make dca_dmix_code() 650% faster
This effectively replaces the ldexpf() function call by a multiplication
with a constant.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6da06ef6bbc01b713f67ffb94e7697eb2393ebe4
---
libavcodec/dcadec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 868e3b6..684294e 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2107,7 +2107,7 @@ static float dca_dmix_code(unsigned code)
{
int sign = (code >> 8) - 1;
code &= 0xff;
- return ldexpf((dca_dmixtable[code] ^ sign) - sign, -15);
+ return ((dca_dmixtable[code] ^ sign) - sign) * pow(2, -15);
}
/**
More information about the ffmpeg-cvslog
mailing list