[FFmpeg-devel] [PATCH] Fix warnings in bidir_refine (in libavcodec/motion_est.c)

Eli Friedman eli.friedman
Sat Jul 3 09:19:12 CEST 2010


Patch attached.  Fixes a bunch of warnings of the form "large integer
implicitly truncated to unsigned type" coming from the static table
"hash".  No significant change in the generated code.

-Eli
-------------- next part --------------
Index: libavcodec/motion_est.c
===================================================================
--- libavcodec/motion_est.c	(revision 24018)
+++ libavcodec/motion_est.c	(working copy)
@@ -1475,12 +1475,12 @@
     const int ymin= c->ymin<<shift;
     const int xmax= c->xmax<<shift;
     const int ymax= c->ymax<<shift;
-#define HASH(fx,fy,bx,by) ((fx)+17*(fy)+63*(bx)+117*(by))
+#define HASH(fx,fy,bx,by) ((uint8_t)((fx)+17*(fy)+63*(bx)+117*(by)))
     int hashidx= HASH(motion_fx,motion_fy, motion_bx, motion_by);
     uint8_t map[256];
 
     memset(map,0,sizeof(map));
-    map[hashidx&255] = 1;
+    map[hashidx] = 1;
 
     fbmin= check_bidir_mv(s, motion_fx, motion_fy,
                           motion_bx, motion_by,



More information about the ffmpeg-devel mailing list