[Ffmpeg-cvslog] r5576 - trunk/libavcodec/flacenc.c

michael subversion
Sun Jul 2 15:10:09 CEST 2006


Author: michael
Date: Sun Jul  2 15:10:08 2006
New Revision: 5576

Modified:
   trunk/libavcodec/flacenc.c

Log:
simplify


Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	(original)
+++ trunk/libavcodec/flacenc.c	Sun Jul  2 15:10:08 2006
@@ -649,7 +649,7 @@
                                int32_t *lpc_out, int *shift)
 {
     int i;
-    double d, cmax;
+    double cmax;
     int32_t qmax;
     int sh;
 
@@ -659,18 +659,13 @@
     /* find maximum coefficient value */
     cmax = 0.0;
     for(i=0; i<order; i++) {
-        d = lpc_in[i];
-        if(d < 0) d = -d;
-        if(d > cmax)
-            cmax = d;
+        cmax= FFMAX(cmax, fabs(lpc_in[i]));
     }
 
     /* if maximum value quantizes to zero, return all zeros */
     if(cmax * (1 << MAX_LPC_SHIFT) < 1.0) {
         *shift = 0;
-        for(i=0; i<order; i++) {
-            lpc_out[i] = 0;
-        }
+        memset(lpc_out, 0, sizeof(int32_t) * order);
         return;
     }
 




More information about the ffmpeg-cvslog mailing list