gen-sync-adoc.sh 763 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. echo ".sync-codec-resistence"
  3. echo '[frame="topbot",options="header",cols="<2,6*>1"]'
  4. echo '|=========================='
  5. echo -n "| "
  6. for STRENGTH in $(seq 10 -1 5)
  7. do
  8. echo -n "| $STRENGTH"
  9. done
  10. echo
  11. for TEST in mp3 double-mp3 ogg
  12. do
  13. if [ $TEST == mp3 ]; then
  14. echo -n "| mp3 128kbit/s"
  15. elif [ $TEST == double-mp3 ]; then
  16. echo -n "| double mp3 128kbit/s"
  17. elif [ $TEST == ogg ]; then
  18. echo -n "| ogg 128kbit/s"
  19. else
  20. echo "error: bad TEST $TEST ???"
  21. exit 1
  22. fi
  23. for STRENGTH in $(seq 10 -1 5)
  24. do
  25. cat $STRENGTH-$TEST-* | grep -v '^#' | awk '{bad += $1; n += $2} END {if (n==0) n=1;fer=100.0*bad/n; bold=fer>0?"*":" ";printf ("| %s%.2f%s", bold, fer, bold)}'
  26. done
  27. echo
  28. done
  29. echo
  30. echo '|=========================='