[x264-devel] checkasm: Fix undefined behavior warnings

Anton Mitrofanov git at videolan.org
Sat Dec 20 21:10:41 CET 2014


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sun Nov 30 23:39:28 2014 +0300| [a46820e00ad3c86b80f5830ed92553de474b7d5c] | committer: Anton Mitrofanov

checkasm: Fix undefined behavior warnings

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=a46820e00ad3c86b80f5830ed92553de474b7d5c
---

 tools/checkasm.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/checkasm.c b/tools/checkasm.c
index a4cb97e..7163976 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -2311,12 +2311,16 @@ static int check_intra( int cpu_ref, int cpu_new )
             {\
                 fprintf( stderr, #name "[%d] :  [FAILED]\n", dir );\
                 ok = 0;\
-                for( int k = -1; k < 16; k++ )\
-                    printf( "%2x ", edge[16+k] );\
-                printf( "\n" );\
+                if( ip_c.name == (void *)ip_c.predict_8x8 )\
+                {\
+                    for( int k = -1; k < 16; k++ )\
+                        printf( "%2x ", edge[16+k] );\
+                    printf( "\n" );\
+                }\
                 for( int j = 0; j < h; j++ )\
                 {\
-                    printf( "%2x ", edge[14-j] );\
+                    if( ip_c.name == (void *)ip_c.predict_8x8 )\
+                        printf( "%2x ", edge[14-j] );\
                     for( int k = 0; k < w; k++ )\
                         printf( "%2x ", pbuf4[48+k+j*FDEC_STRIDE] );\
                     printf( "\n" );\
@@ -2324,7 +2328,8 @@ static int check_intra( int cpu_ref, int cpu_new )
                 printf( "\n" );\
                 for( int j = 0; j < h; j++ )\
                 {\
-                    printf( "   " );\
+                    if( ip_c.name == (void *)ip_c.predict_8x8 )\
+                        printf( "   " );\
                     for( int k = 0; k < w; k++ )\
                         printf( "%2x ", pbuf3[48+k+j*FDEC_STRIDE] );\
                     printf( "\n" );\



More information about the x264-devel mailing list