Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 3 | LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/lib:$LD_LIBRARY_PATH |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 4 | export LD_LIBRARY_PATH |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 5 | PATH=../src/flac:../src/test_streams:../obj/bin:$PATH |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 6 | |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 7 | if test_streams ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 8 | echo "ERROR during test_streams" 1>&2 |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 12 | test_file () |
| 13 | { |
| 14 | name=$1 |
| 15 | channels=$2 |
| 16 | bps=$3 |
| 17 | encode_options="$4" |
| 18 | |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 19 | echo -n "$name: encode..." |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 20 | cmd="flac -V -s -fr -fb -fs 44100 -fp $bps -fc $channels $encode_options $name.raw $name.flac" |
| 21 | echo "### ENCODE $name #######################################################" >> ./streams.log |
| 22 | echo "### cmd=$cmd" >> ./streams.log |
| 23 | if $cmd 1>/dev/null 2>>./streams.log ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 24 | echo "ERROR during encode of $name" 1>&2 |
| 25 | exit 1 |
| 26 | fi |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 27 | echo -n "decode..." |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 28 | cmd="flac -s -fb -d -fr $name.flac $name.cmp"; |
| 29 | echo "### DECODE $name #######################################################" >> ./streams.log |
| 30 | echo "### cmd=$cmd" >> ./streams.log |
| 31 | if $cmd 2>>./streams.log ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 32 | echo "ERROR during decode of $name" 1>&2 |
| 33 | exit 1 |
| 34 | fi |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 35 | ls -1l $name.raw >> ./streams.log |
| 36 | ls -1l $name.flac >> ./streams.log |
| 37 | ls -1l $name.cmp >> ./streams.log |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 38 | echo -n "compare..." |
| 39 | if cmp $name.raw $name.cmp ; then : ; else |
| 40 | echo "ERROR during compare of $name" 1>&2 |
| 41 | exit 1 |
| 42 | fi |
| 43 | echo OK |
| 44 | } |
| 45 | |
| 46 | echo "Testing small files..." |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 47 | test_file test01 1 16 "-0 -l 8 -m -e" |
| 48 | test_file test02 2 16 "-0 -l 8 -m -e" |
| 49 | test_file test03 1 16 "-0 -l 8 -m -e" |
| 50 | test_file test04 2 16 "-0 -l 8 -m -e" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 51 | |
| 52 | echo "Testing 8-bit full-scale deflection streams..." |
| 53 | for b in 01 02 03 04 05 06 07 ; do |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 54 | test_file fsd8-$b 1 8 "-0 -l 8 -m -e -q 15" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 55 | done |
| 56 | |
| 57 | echo "Testing 16-bit full-scale deflection streams..." |
| 58 | for b in 01 02 03 04 05 06 07 ; do |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 59 | test_file fsd16-$b 1 16 "-0 -l 8 -m -e -q 15" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 60 | done |
| 61 | |
| 62 | echo "Testing sine wave streams..." |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 63 | for b in 00 01 02 03 04 ; do |
| 64 | test_file sine-$b 1 16 "-0 -l 8 -m -e" |
| 65 | done |
| 66 | for b in 10 11 12 13 14 15 16 17 18 19 ; do |
| 67 | test_file sine-$b 2 16 "-0 -l 8 -m -e" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 68 | done |
| 69 | |
| 70 | echo "Testing some frame header variations..." |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 71 | test_file sine-01 1 16 "-0 -l 8 -m -e --lax -b 16" |
| 72 | test_file sine-01 1 16 "-0 -l 8 -m -e --lax -b 65535" |
| 73 | test_file sine-01 1 16 "-0 -l 8 -m -e -b 16" |
| 74 | test_file sine-01 1 16 "-0 -l 8 -m -e -b 65535" |
| 75 | test_file sine-01 1 16 "-0 -l 8 -m -e --lax -fs 9" |
| 76 | test_file sine-01 1 16 "-0 -l 8 -m -e --lax -fs 90" |
| 77 | test_file sine-01 1 16 "-0 -l 8 -m -e --lax -fs 90000" |
| 78 | test_file sine-01 1 16 "-0 -l 8 -m -e -fs 9" |
| 79 | test_file sine-01 1 16 "-0 -l 8 -m -e -fs 90" |
| 80 | test_file sine-01 1 16 "-0 -l 8 -m -e -fs 90000" |
| 81 | |
| 82 | echo "Testing option variations..." |
| 83 | for f in 00 01 02 03 04 ; do |
| 84 | for opt in 0 1 2 4 5 6 8 ; do |
Josh Coalson | c5f2f3f | 2001-02-08 22:21:45 +0000 | [diff] [blame^] | 85 | for extras in '' '-p' '-e' ; do |
| 86 | test_file sine-$f 1 16 "-$opt $extras" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 87 | done |
| 88 | done |
| 89 | done |
| 90 | for f in 10 11 12 13 14 15 16 17 18 19 ; do |
| 91 | for opt in 0 1 2 4 5 6 8 ; do |
Josh Coalson | c5f2f3f | 2001-02-08 22:21:45 +0000 | [diff] [blame^] | 92 | for extras in '' '-p' '-e' ; do |
| 93 | test_file sine-$f 2 16 "-$opt $extras" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 94 | done |
| 95 | done |
| 96 | done |
| 97 | |
| 98 | echo "Testing noise..." |
| 99 | for opt in 0 1 2 4 5 6 8 ; do |
Josh Coalson | c5f2f3f | 2001-02-08 22:21:45 +0000 | [diff] [blame^] | 100 | for extras in '' '-p' '-e' ; do |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 101 | for blocksize in '' '-b 32' '-b 32768' '-b 65535' ; do |
| 102 | for channels in 1 2 4 ; do |
| 103 | for bps in 8 16 ; do |
Josh Coalson | c5f2f3f | 2001-02-08 22:21:45 +0000 | [diff] [blame^] | 104 | test_file noise $channels $bps "-$opt $extras $blocksize" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 105 | done |
| 106 | done |
| 107 | done |
| 108 | done |
| 109 | done |