[FFmpeg-cvslog] r24224 - trunk/libavcodec/aacdec.c

alexc subversion
Mon Jul 12 23:35:44 CEST 2010


Author: alexc
Date: Mon Jul 12 23:35:43 2010
New Revision: 24224

Log:
aacdec: Use a LUT to generate CCE scale.

Modified:
   trunk/libavcodec/aacdec.c

Modified: trunk/libavcodec/aacdec.c
==============================================================================
--- trunk/libavcodec/aacdec.c	Mon Jul 12 23:23:03 2010	(r24223)
+++ trunk/libavcodec/aacdec.c	Mon Jul 12 23:35:43 2010	(r24224)
@@ -1454,6 +1454,13 @@ static int decode_cpe(AACContext *ac, Ge
     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 @@ static int decode_cce(AACContext *ac, Ge
     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;



More information about the ffmpeg-cvslog mailing list