| OLD | NEW |
| (Empty) | |
| 1 #!/bin/sh |
| 2 |
| 3 rm logs_mono.txt |
| 4 rm logs_stereo.txt |
| 5 |
| 6 if [ "$#" -ne "3" ]; then |
| 7 echo "usage: run_vectors.sh <exec path> <vector path> <rate>" |
| 8 exit 1 |
| 9 fi |
| 10 |
| 11 CMD_PATH=$1 |
| 12 VECTOR_PATH=$2 |
| 13 RATE=$3 |
| 14 |
| 15 OPUS_DEMO=$CMD_PATH/opus_demo |
| 16 OPUS_COMPARE=$CMD_PATH/opus_compare |
| 17 |
| 18 if [ -d $VECTOR_PATH ]; then |
| 19 echo Test vectors found in $VECTOR_PATH |
| 20 else |
| 21 echo No test vectors found |
| 22 #Don't make the test fail here because the test vectors |
| 23 #will be distributed separately |
| 24 exit 0 |
| 25 fi |
| 26 |
| 27 if [ -x $OPUS_DEMO ]; then |
| 28 echo Decoding with $OPUS_DEMO |
| 29 else |
| 30 echo ERROR: Decoder not found: $OPUS_DEMO |
| 31 exit 1 |
| 32 fi |
| 33 |
| 34 echo "==============" |
| 35 echo Testing mono |
| 36 echo "==============" |
| 37 echo |
| 38 |
| 39 for file in 01 02 03 04 05 06 07 08 09 10 11 12 |
| 40 do |
| 41 if [ -e $VECTOR_PATH/testvector$file.bit ]; then |
| 42 echo Testing testvector$file |
| 43 else |
| 44 echo Bitstream file not found: testvector$file.bit |
| 45 fi |
| 46 if $OPUS_DEMO -d $RATE 1 $VECTOR_PATH/testvector$file.bit tmp.out >> logs_mo
no.txt 2>&1; then |
| 47 echo successfully decoded |
| 48 else |
| 49 echo ERROR: decoding failed |
| 50 exit 1 |
| 51 fi |
| 52 $OPUS_COMPARE -r $RATE $VECTOR_PATH/testvector$file.dec tmp.out >> logs_mono
.txt 2>&1 |
| 53 float_ret=$? |
| 54 if [ "$float_ret" -eq "0" ]; then |
| 55 echo output matches reference |
| 56 else |
| 57 echo ERROR: output does not match reference |
| 58 exit 1 |
| 59 fi |
| 60 echo |
| 61 done |
| 62 |
| 63 echo "==============" |
| 64 echo Testing stereo |
| 65 echo "==============" |
| 66 echo |
| 67 |
| 68 for file in 01 02 03 04 05 06 07 08 09 10 11 12 |
| 69 do |
| 70 if [ -e $VECTOR_PATH/testvector$file.bit ]; then |
| 71 echo Testing testvector$file |
| 72 else |
| 73 echo Bitstream file not found: testvector$file |
| 74 fi |
| 75 if $OPUS_DEMO -d $RATE 2 $VECTOR_PATH/testvector$file.bit tmp.out >> logs_st
ereo.txt 2>&1; then |
| 76 echo successfully decoded |
| 77 else |
| 78 echo ERROR: decoding failed |
| 79 exit 1 |
| 80 fi |
| 81 $OPUS_COMPARE -s -r $RATE $VECTOR_PATH/testvector$file.dec tmp.out >> logs_s
tereo.txt 2>&1 |
| 82 float_ret=$? |
| 83 if [ "$float_ret" -eq "0" ]; then |
| 84 echo output matches reference |
| 85 else |
| 86 echo ERROR: output does not match reference |
| 87 exit 1 |
| 88 fi |
| 89 echo |
| 90 done |
| 91 |
| 92 |
| 93 |
| 94 echo All tests have passed successfully |
| 95 grep quality logs_mono.txt | awk '{sum+=$4}END{print "Average mono quality is",
sum/NR, "%"}' |
| 96 grep quality logs_stereo.txt | awk '{sum+=$4}END{print "Average stereo quality i
s", sum/NR, "%"}' |
| OLD | NEW |