]> granicus.if.org Git - libx264/commitdiff
checkasm: ignore insignificant differences in floating-point ssim
authorLoren Merritt <pengvado@videolan.org>
Mon, 6 Nov 2006 22:38:42 +0000 (22:38 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 6 Nov 2006 22:38:42 +0000 (22:38 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@599 df754926-b1dd-0310-bc7b-ec298dee348c

tools/checkasm.c

index cc22f8b12e283ad7b1cdc4ba1d8059bca58f24f5..7e49a9150010ba16412733bc7a40624f651d5027 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 
 #include "common/common.h"
 #include "common/cpu.h"
@@ -139,7 +140,7 @@ static int check_pixel( int cpu_ref, int cpu_new )
         x264_cpu_restore( cpu_new );
         res_c = x264_pixel_ssim_wxh( &pixel_c,   buf1+2, 32, buf2+2, 32, 32, 28 );
         res_a = x264_pixel_ssim_wxh( &pixel_asm, buf1+2, 32, buf2+2, 32, 32, 28 );
-        if( res_c != res_a )
+        if( fabs(res_c - res_a) > 1e-8 )
         {
             ok = 0;
             fprintf( stderr, "ssim: %.7f != %.7f [FAILED]\n", res_c, res_a );