[x264-devel] checkasm: Fix load_deinterleave_chroma_fdec test

Henrik Gramner git at videolan.org
Mon May 22 00:00:11 CEST 2017


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Sat Mar 25 00:02:11 2017 +0100| [d6eb2c9630d40a2765d5092f87637f4e4d084ed1] | committer: Henrik Gramner

checkasm: Fix load_deinterleave_chroma_fdec test

The function only writes to parts of the destination buffer but the test
verifies the content of the entire buffer. The problem is that some earlier
IDCT functions clobbers the same part of the buffer with garbage when
benchmarked which would incorrectly cause test failures.

Fix this by explicitly zeroing the buffers beforehand.

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

 tools/checkasm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/checkasm.c b/tools/checkasm.c
index 7427c338..3db44cf5 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -1370,6 +1370,8 @@ static int check_mc( int cpu_ref, int cpu_new )
     }
     report( "mc offsetsub :" );
 
+    memset( pbuf3, 0, 64*16 );
+    memset( pbuf4, 0, 64*16 );
     ok = 1; used_asm = 0;
     for( int height = 8; height <= 16; height += 8 )
     {
@@ -1377,8 +1379,6 @@ static int check_mc( int cpu_ref, int cpu_new )
         {
             set_func_name( "store_interleave_chroma" );
             used_asm = 1;
-            memset( pbuf3, 0, 64*height );
-            memset( pbuf4, 0, 64*height );
             call_c( mc_c.store_interleave_chroma, pbuf3, (intptr_t)64, pbuf1, pbuf1+16, height );
             call_a( mc_a.store_interleave_chroma, pbuf4, (intptr_t)64, pbuf1, pbuf1+16, height );
             if( memcmp( pbuf3, pbuf4, 64*height ) )



More information about the x264-devel mailing list