Current tests use 0 as the target value, so absolute difference isn't really
needed currently, but it will be useful later when using higher target values.
---
 tests/fate-run.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 419a3eb..4ae9376 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -30,7 +30,8 @@ do_tiny_psnr(){
     val=$(expr "$psnr" : ".*$3: *\([0-9.]*\)")
     size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)')
     size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
-    res=$(echo "if ($val $4 $fuzz) 1" | bc)
+    val=$(echo "scale=2; if ($val >= $4) { $val - $4 } else { $4 - $val }" | 
bc)
+    res=$(echo "if ($val <= $fuzz) 1" | bc)
     if [ "$res" != 1 ] || [ $size1 != $size2 ]; then
         echo "$psnr"
         return 1
@@ -38,11 +39,11 @@ do_tiny_psnr(){
 }
 
 oneoff(){
-    do_tiny_psnr "$1" "$2" MAXDIFF '<='
+    do_tiny_psnr "$1" "$2" MAXDIFF 0
 }
 
 stddev(){
-    do_tiny_psnr "$1" "$2" stddev  '<='
+    do_tiny_psnr "$1" "$2" stddev 0
 }
 
 run(){
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to