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