[FFmpeg-cvslog] r19942 - in trunk: libavcodec/dsputil.c libavutil/internal.h

lorenm subversion
Mon Sep 21 05:01:58 CEST 2009


Author: lorenm
Date: Mon Sep 21 05:01:57 2009
New Revision: 19942

Log:
extend ff_inverse[], and fix its documentation

Modified:
   trunk/libavcodec/dsputil.c
   trunk/libavutil/internal.h

Modified: trunk/libavcodec/dsputil.c
==============================================================================
--- trunk/libavcodec/dsputil.c	Mon Sep 21 04:56:12 2009	(r19941)
+++ trunk/libavcodec/dsputil.c	Mon Sep 21 05:01:57 2009	(r19942)
@@ -110,8 +110,9 @@ const uint8_t ff_alternate_vertical_scan
     38, 46, 54, 62, 39, 47, 55, 63,
 };
 
-/* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
-const uint32_t ff_inverse[256]={
+/* a*inverse[b]>>32 == a/b for all 0<=a<=16909558 && 2<=b<=256
+ * for a>16909558, is an overestimate by less than 1 part in 1<<24 */
+const uint32_t ff_inverse[257]={
          0, 4294967295U,2147483648U,1431655766, 1073741824,  858993460,  715827883,  613566757,
  536870912,  477218589,  429496730,  390451573,  357913942,  330382100,  306783379,  286331154,
  268435456,  252645136,  238609295,  226050911,  214748365,  204522253,  195225787,  186737709,
@@ -144,6 +145,7 @@ const uint32_t ff_inverse[256]={
   18512791,   18433337,   18354562,   18276457,   18199014,   18122225,   18046082,   17970575,
   17895698,   17821442,   17747799,   17674763,   17602325,   17530479,   17459217,   17388532,
   17318417,   17248865,   17179870,   17111424,   17043522,   16976156,   16909321,   16843010,
+  16777216
 };
 
 /* Input permutation for the simple_idct_mmx */

Modified: trunk/libavutil/internal.h
==============================================================================
--- trunk/libavutil/internal.h	Mon Sep 21 04:56:12 2009	(r19941)
+++ trunk/libavutil/internal.h	Mon Sep 21 05:01:57 2009	(r19942)
@@ -124,7 +124,7 @@
 
 /* math */
 
-extern const uint32_t ff_inverse[256];
+extern const uint32_t ff_inverse[257];
 
 #if ARCH_X86
 #    define FASTDIV(a,b) \



More information about the ffmpeg-cvslog mailing list