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

michael subversion
Thu Jul 13 13:41:53 CEST 2006


Author: michael
Date: Thu Jul 13 13:41:52 2006
New Revision: 5727

Modified:
   trunk/libavcodec/flacenc.c

Log:
dither lpc cpeffs


Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	(original)
+++ trunk/libavcodec/flacenc.c	Thu Jul 13 13:41:52 2006
@@ -661,7 +661,7 @@
                                int32_t *lpc_out, int *shift)
 {
     int i;
-    double cmax;
+    double cmax, error;
     int32_t qmax;
     int sh;
 
@@ -697,8 +697,11 @@
     }
 
     /* output quantized coefficients and level shift */
+    error=0;
     for(i=0; i<order; i++) {
-        lpc_out[i] = (int32_t)(lpc_in[i] * (1 << sh));
+        error += lpc_in[i] * (1 << sh);
+        lpc_out[i] = clip(lrintf(error), -qmax, qmax);
+        error -= lpc_out[i];
     }
     *shift = sh;
 }




More information about the ffmpeg-cvslog mailing list