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

Eli Friedman eli.friedman
Tue Jul 6 05:09:58 CEST 2010


2010/7/3 M?ns Rullg?rd <mans at mansr.com>:
> The warnings this thread is about are of the rare variety which cannot
> be so easily silenced without adding clutter or having the actual code
> change.

Is the attached sufficiently unobtrusive to be acceptable?

-Eli
-------------- next part --------------
Index: motion_est.c
===================================================================
--- motion_est.c	(revision 24018)
+++ motion_est.c	(working copy)
@@ -1509,22 +1509,23 @@
 { 1, 1, 1,-1}, {-1,-1,-1, 1}, { 1, 1,-1, 1}, {-1,-1, 1,-1}, { 1,-1, 1, 1}, {-1, 1,-1,-1}, {-1, 1, 1, 1}, { 1,-1,-1,-1},
 { 1, 1,-1,-1}, {-1,-1, 1, 1}, { 1,-1,-1, 1}, {-1, 1, 1,-1}, { 1,-1, 1,-1}, {-1, 1,-1, 1},
         };
+#define HASH_T(fx,fy,bx,by) ((uint8_t)HASH(fx,fy,bx,by))
         static const uint8_t hash[]={
-HASH( 0, 0, 0, 1), HASH( 0, 0, 0,-1), HASH( 0, 0, 1, 0), HASH( 0, 0,-1, 0), HASH( 0, 1, 0, 0), HASH( 0,-1, 0, 0), HASH( 1, 0, 0, 0), HASH(-1, 0, 0, 0),
+HASH_T( 0, 0, 0, 1), HASH_T( 0, 0, 0,-1), HASH_T( 0, 0, 1, 0), HASH_T( 0, 0,-1, 0), HASH_T( 0, 1, 0, 0), HASH_T( 0,-1, 0, 0), HASH_T( 1, 0, 0, 0), HASH_T(-1, 0, 0, 0),
 
-HASH( 0, 0, 1, 1), HASH( 0, 0,-1,-1), HASH( 0, 1, 1, 0), HASH( 0,-1,-1, 0), HASH( 1, 1, 0, 0), HASH(-1,-1, 0, 0), HASH( 1, 0, 0, 1), HASH(-1, 0, 0,-1),
-HASH( 0, 1, 0, 1), HASH( 0,-1, 0,-1), HASH( 1, 0, 1, 0), HASH(-1, 0,-1, 0),
-HASH( 0, 0,-1, 1), HASH( 0, 0, 1,-1), HASH( 0,-1, 1, 0), HASH( 0, 1,-1, 0), HASH(-1, 1, 0, 0), HASH( 1,-1, 0, 0), HASH( 1, 0, 0,-1), HASH(-1, 0, 0, 1),
-HASH( 0,-1, 0, 1), HASH( 0, 1, 0,-1), HASH(-1, 0, 1, 0), HASH( 1, 0,-1, 0),
+HASH_T( 0, 0, 1, 1), HASH_T( 0, 0,-1,-1), HASH_T( 0, 1, 1, 0), HASH_T( 0,-1,-1, 0), HASH_T( 1, 1, 0, 0), HASH_T(-1,-1, 0, 0), HASH_T( 1, 0, 0, 1), HASH_T(-1, 0, 0,-1),
+HASH_T( 0, 1, 0, 1), HASH_T( 0,-1, 0,-1), HASH_T( 1, 0, 1, 0), HASH_T(-1, 0,-1, 0),
+HASH_T( 0, 0,-1, 1), HASH_T( 0, 0, 1,-1), HASH_T( 0,-1, 1, 0), HASH_T( 0, 1,-1, 0), HASH_T(-1, 1, 0, 0), HASH_T( 1,-1, 0, 0), HASH_T( 1, 0, 0,-1), HASH_T(-1, 0, 0, 1),
+HASH_T( 0,-1, 0, 1), HASH_T( 0, 1, 0,-1), HASH_T(-1, 0, 1, 0), HASH_T( 1, 0,-1, 0),
 
-HASH( 0, 1, 1, 1), HASH( 0,-1,-1,-1), HASH( 1, 1, 1, 0), HASH(-1,-1,-1, 0), HASH( 1, 1, 0, 1), HASH(-1,-1, 0,-1), HASH( 1, 0, 1, 1), HASH(-1, 0,-1,-1),
-HASH( 0,-1, 1, 1), HASH( 0, 1,-1,-1), HASH(-1, 1, 1, 0), HASH( 1,-1,-1, 0), HASH( 1, 1, 0,-1), HASH(-1,-1, 0, 1), HASH( 1, 0,-1, 1), HASH(-1, 0, 1,-1),
-HASH( 0, 1,-1, 1), HASH( 0,-1, 1,-1), HASH( 1,-1, 1, 0), HASH(-1, 1,-1, 0), HASH(-1, 1, 0, 1), HASH( 1,-1, 0,-1), HASH( 1, 0, 1,-1), HASH(-1, 0,-1, 1),
-HASH( 0, 1, 1,-1), HASH( 0,-1,-1, 1), HASH( 1, 1,-1, 0), HASH(-1,-1, 1, 0), HASH( 1,-1, 0, 1), HASH(-1, 1, 0,-1), HASH(-1, 0, 1, 1), HASH( 1, 0,-1,-1),
+HASH_T( 0, 1, 1, 1), HASH_T( 0,-1,-1,-1), HASH_T( 1, 1, 1, 0), HASH_T(-1,-1,-1, 0), HASH_T( 1, 1, 0, 1), HASH_T(-1,-1, 0,-1), HASH_T( 1, 0, 1, 1), HASH_T(-1, 0,-1,-1),
+HASH_T( 0,-1, 1, 1), HASH_T( 0, 1,-1,-1), HASH_T(-1, 1, 1, 0), HASH_T( 1,-1,-1, 0), HASH_T( 1, 1, 0,-1), HASH_T(-1,-1, 0, 1), HASH_T( 1, 0,-1, 1), HASH_T(-1, 0, 1,-1),
+HASH_T( 0, 1,-1, 1), HASH_T( 0,-1, 1,-1), HASH_T( 1,-1, 1, 0), HASH_T(-1, 1,-1, 0), HASH_T(-1, 1, 0, 1), HASH_T( 1,-1, 0,-1), HASH_T( 1, 0, 1,-1), HASH_T(-1, 0,-1, 1),
+HASH_T( 0, 1, 1,-1), HASH_T( 0,-1,-1, 1), HASH_T( 1, 1,-1, 0), HASH_T(-1,-1, 1, 0), HASH_T( 1,-1, 0, 1), HASH_T(-1, 1, 0,-1), HASH_T(-1, 0, 1, 1), HASH_T( 1, 0,-1,-1),
 
-HASH( 1, 1, 1, 1), HASH(-1,-1,-1,-1),
-HASH( 1, 1, 1,-1), HASH(-1,-1,-1, 1), HASH( 1, 1,-1, 1), HASH(-1,-1, 1,-1), HASH( 1,-1, 1, 1), HASH(-1, 1,-1,-1), HASH(-1, 1, 1, 1), HASH( 1,-1,-1,-1),
-HASH( 1, 1,-1,-1), HASH(-1,-1, 1, 1), HASH( 1,-1,-1, 1), HASH(-1, 1, 1,-1), HASH( 1,-1, 1,-1), HASH(-1, 1,-1, 1),
+HASH_T( 1, 1, 1, 1), HASH_T(-1,-1,-1,-1),
+HASH_T( 1, 1, 1,-1), HASH_T(-1,-1,-1, 1), HASH_T( 1, 1,-1, 1), HASH_T(-1,-1, 1,-1), HASH_T( 1,-1, 1, 1), HASH_T(-1, 1,-1,-1), HASH_T(-1, 1, 1, 1), HASH_T( 1,-1,-1,-1),
+HASH_T( 1, 1,-1,-1), HASH_T(-1,-1, 1, 1), HASH_T( 1,-1,-1, 1), HASH_T(-1, 1, 1,-1), HASH_T( 1,-1, 1,-1), HASH_T(-1, 1,-1, 1),
 };
 
 #define CHECK_BIDIR(fx,fy,bx,by)\



More information about the ffmpeg-devel mailing list