]> git.sesse.net Git - ffmpeg/commitdiff
Original Commit: r105 | ods15 | 2006-10-01 18:09:55 +0200 (Sun, 01 Oct 2006) | 2...
authorOded Shimon <ods15@ods15.dyndns.org>
Mon, 2 Oct 2006 06:09:30 +0000 (06:09 +0000)
committerOded Shimon <ods15@ods15.dyndns.org>
Mon, 2 Oct 2006 06:09:30 +0000 (06:09 +0000)
slight simplification for channel coupling

Originally committed as revision 6509 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/vorbis_enc.c

index b43738f3a16007bf9d1ce9e60f0b499ed0c11269..8922829977b18ef295e09285d98ecf7acfe35165 100644 (file)
@@ -1424,17 +1424,10 @@ static int vorbis_encode_frame(AVCodecContext * avccontext, unsigned char * pack
         float * ang = venc->coeffs + mapping->angle[i] * samples;
         int j;
         for (j = 0; j < samples; j++) {
-            float m = mag[j];
             float a = ang[j];
-            if (m > 0) {
-                ang[j] = m - a;
-                if (a > m) mag[j] = a;
-                else mag[j] = m;
-            } else {
-                ang[j] = a - m;
-                if (a > m) mag[j] = m;
-                else mag[j] = a;
-            }
+            ang[j] -= mag[j];
+            if (mag[j] > 0) ang[j] = -ang[j];
+            if (ang[j] < 0) mag[j] = a;
         }
     }