From 6da06ef6bbc01b713f67ffb94e7697eb2393ebe4 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 23 May 2014 21:59:04 +0200
Subject: [PATCH] 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@gmx.at>
---
 libavcodec/dcadec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 868e3b67b93..684294e8bf9 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);
 }
 
 /**
-- 
GitLab