changeset 12153:862dd5062000 libavcodec

aacdec: Use a LUT to generate CCE scale.
author alexc
date Mon, 12 Jul 2010 21:35:43 +0000
parents d102b12f69dc
children 8a50de6cf3f1
files aacdec.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aacdec.c	Mon Jul 12 21:23:03 2010 +0000
+++ b/aacdec.c	Mon Jul 12 21:35:43 2010 +0000
@@ -1454,6 +1454,13 @@
     return 0;
 }
 
+static const float cce_scale[] = {
+    1.09050773266525765921, //2^(1/8)
+    1.18920711500272106672, //2^(1/4)
+    M_SQRT2,
+    2,
+};
+
 /**
  * Decode coupling_channel_element; reference: table 4.8.
  *
@@ -1484,7 +1491,7 @@
     coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
 
     sign  = get_bits(gb, 1);
-    scale = pow(2., pow(2., (int)get_bits(gb, 2) - 3));
+    scale = cce_scale[get_bits(gb, 2)];
 
     if ((ret = decode_ics(ac, sce, gb, 0, 0)))
         return ret;