changeset 5372:04a9bb415804 libavcodec

Another minor simplification
author vitor
date Wed, 18 Jul 2007 20:23:43 +0000
parents 74680ec68fd1
children 69eac3e47b9a
files alac.c
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/alac.c	Wed Jul 18 18:40:03 2007 +0000
+++ b/alac.c	Wed Jul 18 20:23:43 2007 +0000
@@ -412,19 +412,16 @@
     /* weighted interlacing */
     if (interlacing_leftweight) {
         for (i = 0; i < numsamples; i++) {
-            int32_t difference, midright;
-            int16_t left;
-            int16_t right;
+            int32_t a, b;
 
-            midright = buffer[0][i];
-            difference = buffer[1][i];
+            a = buffer[0][i];
+            b = buffer[1][i];
 
+            a -= (b * interlacing_leftweight) >> interlacing_shift;
+            b += a;
 
-            right = midright - ((difference * interlacing_leftweight) >> interlacing_shift);
-            left = right + difference;
-
-            buffer_out[i*numchannels] = left;
-            buffer_out[i*numchannels + 1] = right;
+            buffer_out[i*numchannels] = b;
+            buffer_out[i*numchannels + 1] = a;
         }
 
         return;