aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-07-12 21:35:43 +0000
committerAlex Converse <alex.converse@gmail.com>2010-07-12 21:35:43 +0000
commit93c6ff6c8c2ea39d6b4173efc9732010c51d0703 (patch)
tree8300a53993e568a4a5bbdcf2a0de4ac2d85be981 /libavcodec/aacdec.c
parentf07c9895e0737f0f6a9874f0494f92a59c085f20 (diff)
downloadffmpeg-93c6ff6c8c2ea39d6b4173efc9732010c51d0703.tar.gz
aacdec: Use a LUT to generate CCE scale.
Originally committed as revision 24224 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r--libavcodec/aacdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 19e7783dbf..9214c18b91 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1454,6 +1454,13 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
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, GetBitContext *gb, ChannelElement *che)
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;