changeset 9051:0cffed11ee33 libavcodec

Use const to better allow the compiler to optimize AAC independent coupling.
author alexc
date Thu, 26 Feb 2009 01:50:00 +0000
parents 9653d4585183
children 54973ad4b7cf
files aac.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aac.c	Thu Feb 26 01:38:51 2009 +0000
+++ b/aac.c	Thu Feb 26 01:50:00 2009 +0000
@@ -1456,8 +1456,13 @@
  */
 static void apply_independent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) {
     int i;
+    const float gain = cce->coup.gain[index][0];
+    const float bias = ac->add_bias;
+    const float* src = cce->ch[0].ret;
+    float* dest = target->ret;
+
     for (i = 0; i < 1024; i++)
-        target->ret[i] += cce->coup.gain[index][0] * (cce->ch[0].ret[i] - ac->add_bias);
+        dest[i] += gain * (src[i] - bias);
 }
 
 /**