[FFmpeg-cvslog] fate: make compare() function compatible with POSIX bc
Mans Rullgard
git at videolan.org
Sun Mar 18 23:57:50 CET 2012
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Mar 18 17:44:18 2012 +0000| [a56fba502e9087c204b7d6cdc8e12d623f77d66d] | committer: Mans Rullgard
fate: make compare() function compatible with POSIX bc
Signed-off-by: Mans Rullgard <mans at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a56fba502e9087c204b7d6cdc8e12d623f77d66d
---
tests/fate-run.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index c3e39cd..b19f0ae 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -31,8 +31,7 @@ repfile="${outdir}/${test}.rep"
# $1=value1, $2=value2, $3=threshold
# prints 0 if absolute difference between value1 and value2 is <= threshold
compare(){
- v=$(echo "scale=2; if ($1 >= $2) { $1 - $2 } else { $2 - $1 }" | bc)
- echo "if ($v <= $3) { 0 } else { 1 }" | bc
+ echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc
}
do_tiny_psnr(){
More information about the ffmpeg-cvslog
mailing list