Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 3 | # FLAC - Free Lossless Audio Codec |
Josh Coalson | 1152f9f | 2002-01-26 18:05:12 +0000 | [diff] [blame] | 4 | # Copyright (C) 2001,2002 Josh Coalson |
Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 5 | # |
| 6 | # This program is part of FLAC; you can redistribute it and/or |
| 7 | # modify it under the terms of the GNU General Public License |
| 8 | # as published by the Free Software Foundation; either version 2 |
| 9 | # of the License, or (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 20 | LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/lib:$LD_LIBRARY_PATH |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 21 | export LD_LIBRARY_PATH |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 22 | PATH=../src/flac:../src/test_streams:../obj/bin:$PATH |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 23 | |
Josh Coalson | bc15aee | 2002-06-15 05:12:31 +0000 | [diff] [blame] | 24 | flac --help 1>/dev/null 2>/dev/null || (echo "ERROR can't find flac executable" 1>&2 && exit 1) |
| 25 | if [ $? != 0 ] ; then exit 1 ; fi |
Josh Coalson | bc86950 | 2002-06-14 06:36:16 +0000 | [diff] [blame] | 26 | |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 27 | echo "Generating streams..." |
Josh Coalson | 67fcd8e | 2001-01-19 23:10:56 +0000 | [diff] [blame] | 28 | if test_streams ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 29 | echo "ERROR during test_streams" 1>&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 33 | echo "Checking for --ogg support in flac..." |
| 34 | if flac --ogg wacky1.wav 1>/dev/null 2>&1 ; then |
| 35 | has_ogg=yes; |
| 36 | echo "flac --ogg works" |
| 37 | else |
| 38 | has_ogg=no; |
| 39 | echo "flac --ogg doesn't work" |
| 40 | fi |
| 41 | |
| 42 | # |
| 43 | # multi-file tests |
| 44 | # |
| 45 | echo "Generating multiple input files from noise..." |
Josh Coalson | eb20903 | 2002-08-20 20:37:26 +0000 | [diff] [blame] | 46 | if flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 noise.raw ; then : ; else |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 47 | echo "ERROR generating FLAC file" 1>&2 |
| 48 | exit 1 |
| 49 | fi |
Josh Coalson | 6a8ff47 | 2002-08-12 20:26:22 +0000 | [diff] [blame] | 50 | if flac --decode --silent noise.flac ; then : ; else |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 51 | echo "ERROR generating WAVE file" 1>&2 |
| 52 | exit 1 |
| 53 | fi |
| 54 | rm -f noise.flac |
Josh Coalson | 76e8725 | 2002-08-08 22:54:03 +0000 | [diff] [blame] | 55 | mv noise.wav file0.wav |
| 56 | cp file0.wav file1.wav |
| 57 | cp file1.wav file2.wav |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 58 | |
| 59 | test_multifile () |
| 60 | { |
| 61 | streamtype=$1 |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 62 | sector_align=$2 |
| 63 | encode_options="$3" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 64 | |
| 65 | if [ $streamtype = ogg ] ; then |
| 66 | suffix=ogg |
| 67 | encode_options="$encode_options --ogg" |
| 68 | else |
| 69 | suffix=flac |
| 70 | fi |
| 71 | |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 72 | if [ $sector_align = sector_align ] ; then |
| 73 | encode_options="$encode_options --sector-align" |
| 74 | fi |
| 75 | |
Josh Coalson | 76e8725 | 2002-08-08 22:54:03 +0000 | [diff] [blame] | 76 | if flac $encode_options file0.wav file1.wav file2.wav ; then : ; else |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 77 | echo "ERROR" 1>&2 |
| 78 | exit 1 |
| 79 | fi |
| 80 | for n in 0 1 2 ; do |
Josh Coalson | 76e8725 | 2002-08-08 22:54:03 +0000 | [diff] [blame] | 81 | mv file$n.$suffix file${n}x.$suffix |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 82 | done |
Josh Coalson | 6a8ff47 | 2002-08-12 20:26:22 +0000 | [diff] [blame] | 83 | if flac --decode file0x.$suffix file1x.$suffix file2x.$suffix ; then : ; else |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 84 | echo "ERROR" 1>&2 |
| 85 | exit 1 |
| 86 | fi |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 87 | if [ $sector_align != sector_align ] ; then |
| 88 | for n in 0 1 2 ; do |
| 89 | if cmp file$n.wav file${n}x.wav ; then : ; else |
| 90 | echo "ERROR: file mismatch on file #$n" 1>&2 |
| 91 | exit 1 |
| 92 | fi |
| 93 | done |
| 94 | fi |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 95 | for n in 0 1 2 ; do |
Josh Coalson | 76e8725 | 2002-08-08 22:54:03 +0000 | [diff] [blame] | 96 | rm -f file${n}x.$suffix file${n}x.wav |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 97 | done |
| 98 | } |
| 99 | |
| 100 | echo "Testing multiple files without verify..." |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 101 | test_multifile flac no_sector_align "" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 102 | |
| 103 | echo "Testing multiple files with verify..." |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 104 | test_multifile flac no_sector_align "--verify" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 105 | |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 106 | echo "Testing multiple files with --sector-align, without verify..." |
| 107 | test_multifile flac sector_align "" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 108 | |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 109 | echo "Testing multiple files with --sector-align, with verify..." |
| 110 | test_multifile flac sector_align "--verify" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 111 | |
| 112 | if [ $has_ogg = "yes" ] ; then |
| 113 | echo "Testing multiple files with --ogg, without verify..." |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 114 | test_multifile ogg no_sector_align "" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 115 | |
| 116 | echo "Testing multiple files with --ogg, with verify..." |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 117 | test_multifile ogg no_sector_align "--verify" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 118 | |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 119 | echo "Testing multiple files with --ogg and --sector-align, without verify..." |
| 120 | test_multifile ogg sector_align "" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 121 | |
Josh Coalson | a1283a2 | 2002-08-16 05:36:53 +0000 | [diff] [blame] | 122 | echo "Testing multiple files with --ogg and --sector-align, with verify..." |
| 123 | test_multifile sector_align ogg "--verify" |
Josh Coalson | 07414eb | 2002-09-04 07:56:02 +0000 | [diff] [blame] | 124 | |
| 125 | echo "Testing multiple files with --ogg and --serial-number, with verify..." |
| 126 | test_multifile ogg no_sector_align "--serial-number=321 --verify" |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 127 | fi |
| 128 | |
Josh Coalson | 9bcf9e8 | 2002-08-07 17:07:37 +0000 | [diff] [blame] | 129 | # |
| 130 | # single-file tests |
| 131 | # |
| 132 | |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 133 | test_file () |
| 134 | { |
| 135 | name=$1 |
| 136 | channels=$2 |
| 137 | bps=$3 |
| 138 | encode_options="$4" |
| 139 | |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 140 | echo -n "$name (--channels=$channels --bps=$bps $encode_options): encode..." |
Josh Coalson | eb20903 | 2002-08-20 20:37:26 +0000 | [diff] [blame] | 141 | cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options $name.raw" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 142 | echo "### ENCODE $name #######################################################" >> ./streams.log |
| 143 | echo "### cmd=$cmd" >> ./streams.log |
Josh Coalson | cc78fb5 | 2001-05-03 00:59:27 +0000 | [diff] [blame] | 144 | if $cmd 2>>./streams.log ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 145 | echo "ERROR during encode of $name" 1>&2 |
| 146 | exit 1 |
| 147 | fi |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 148 | echo -n "decode..." |
Josh Coalson | 5f39e9f | 2002-08-21 05:27:01 +0000 | [diff] [blame] | 149 | cmd="flac --silent --endian=big --sign=signed --decode --force-raw-format --output-name=$name.cmp $name.flac" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 150 | echo "### DECODE $name #######################################################" >> ./streams.log |
| 151 | echo "### cmd=$cmd" >> ./streams.log |
Josh Coalson | 970cd3d | 2001-07-09 18:15:36 +0000 | [diff] [blame] | 152 | if $cmd 2>>./streams.log ; then : ; else |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 153 | echo "ERROR during decode of $name" 1>&2 |
| 154 | exit 1 |
| 155 | fi |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 156 | ls -1l $name.raw >> ./streams.log |
| 157 | ls -1l $name.flac >> ./streams.log |
| 158 | ls -1l $name.cmp >> ./streams.log |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 159 | echo -n "compare..." |
| 160 | if cmp $name.raw $name.cmp ; then : ; else |
| 161 | echo "ERROR during compare of $name" 1>&2 |
| 162 | exit 1 |
| 163 | fi |
| 164 | echo OK |
| 165 | } |
| 166 | |
Josh Coalson | a59ff6f | 2002-06-10 18:24:51 +0000 | [diff] [blame] | 167 | test_file_piped () |
| 168 | { |
| 169 | name=$1 |
| 170 | channels=$2 |
| 171 | bps=$3 |
| 172 | encode_options="$4" |
| 173 | |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 174 | if [ `env | grep -ic '^comspec='` != 0 ] ; then |
| 175 | is_win=yes |
| 176 | else |
| 177 | is_win=no |
| 178 | fi |
| 179 | |
Josh Coalson | a59ff6f | 2002-06-10 18:24:51 +0000 | [diff] [blame] | 180 | echo -n "$name: encode via pipes..." |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 181 | if [ $is_win = yes ] ; then |
Josh Coalson | eb20903 | 2002-08-20 20:37:26 +0000 | [diff] [blame] | 182 | cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout $name.raw" |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 183 | echo "### ENCODE $name #######################################################" >> ./streams.log |
| 184 | echo "### cmd=$cmd" >> ./streams.log |
| 185 | if $cmd 1>$name.flac 2>>./streams.log ; then : ; else |
| 186 | echo "ERROR during encode of $name" 1>&2 |
| 187 | exit 1 |
| 188 | fi |
| 189 | else |
Josh Coalson | eb20903 | 2002-08-20 20:37:26 +0000 | [diff] [blame] | 190 | cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout -" |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 191 | echo "### ENCODE $name #######################################################" >> ./streams.log |
| 192 | echo "### cmd=$cmd" >> ./streams.log |
| 193 | if cat $name.raw | $cmd 1>$name.flac 2>>./streams.log ; then : ; else |
| 194 | echo "ERROR during encode of $name" 1>&2 |
| 195 | exit 1 |
| 196 | fi |
Josh Coalson | a59ff6f | 2002-06-10 18:24:51 +0000 | [diff] [blame] | 197 | fi |
| 198 | echo -n "decode via pipes..." |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 199 | if [ $is_win = yes ] ; then |
Josh Coalson | 5f39e9f | 2002-08-21 05:27:01 +0000 | [diff] [blame] | 200 | cmd="flac --silent --endian=big --sign=signed --decode --force-raw-format --stdout $name.flac" |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 201 | echo "### DECODE $name #######################################################" >> ./streams.log |
| 202 | echo "### cmd=$cmd" >> ./streams.log |
| 203 | if $cmd 1>$name.cmp 2>>./streams.log ; then : ; else |
| 204 | echo "ERROR during decode of $name" 1>&2 |
| 205 | exit 1 |
| 206 | fi |
| 207 | else |
Josh Coalson | 5f39e9f | 2002-08-21 05:27:01 +0000 | [diff] [blame] | 208 | cmd="flac --silent --endian=big --sign=signed --decode --force-raw-format --stdout -" |
Josh Coalson | d57c8d3 | 2002-06-11 06:15:28 +0000 | [diff] [blame] | 209 | echo "### DECODE $name #######################################################" >> ./streams.log |
| 210 | echo "### cmd=$cmd" >> ./streams.log |
| 211 | if cat $name.flac | $cmd 1>$name.cmp 2>>./streams.log ; then : ; else |
| 212 | echo "ERROR during decode of $name" 1>&2 |
| 213 | exit 1 |
| 214 | fi |
Josh Coalson | a59ff6f | 2002-06-10 18:24:51 +0000 | [diff] [blame] | 215 | fi |
| 216 | ls -1l $name.raw >> ./streams.log |
| 217 | ls -1l $name.flac >> ./streams.log |
| 218 | ls -1l $name.cmp >> ./streams.log |
| 219 | echo -n "compare..." |
| 220 | if cmp $name.raw $name.cmp ; then : ; else |
| 221 | echo "ERROR during compare of $name" 1>&2 |
| 222 | exit 1 |
| 223 | fi |
| 224 | echo OK |
| 225 | } |
| 226 | |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 227 | if [ "$FLAC__EXHAUSTIVE_TESTS" = yes ] ; then |
| 228 | max_lpc_order=32 |
| 229 | else |
| 230 | max_lpc_order=16 |
| 231 | fi |
| 232 | |
Josh Coalson | a59ff6f | 2002-06-10 18:24:51 +0000 | [diff] [blame] | 233 | echo "Testing noise through pipes..." |
| 234 | test_file_piped noise 1 8 "-0" |
| 235 | |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 236 | echo "Testing small files..." |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 237 | test_file test01 1 16 "-0 -l $max_lpc_order -m -e -p" |
| 238 | test_file test02 2 16 "-0 -l $max_lpc_order -m -e -p" |
| 239 | test_file test03 1 16 "-0 -l $max_lpc_order -m -e -p" |
| 240 | test_file test04 2 16 "-0 -l $max_lpc_order -m -e -p" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 241 | |
| 242 | echo "Testing 8-bit full-scale deflection streams..." |
| 243 | for b in 01 02 03 04 05 06 07 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 244 | test_file fsd8-$b 1 8 "-0 -l $max_lpc_order -m -e -p" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 245 | done |
| 246 | |
| 247 | echo "Testing 16-bit full-scale deflection streams..." |
| 248 | for b in 01 02 03 04 05 06 07 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 249 | test_file fsd16-$b 1 16 "-0 -l $max_lpc_order -m -e -p" |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 250 | done |
| 251 | |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 252 | echo "Testing 24-bit full-scale deflection streams..." |
| 253 | for b in 01 02 03 04 05 06 07 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 254 | test_file fsd24-$b 1 24 "-0 -l $max_lpc_order -m -e -p" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 255 | done |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 256 | |
Josh Coalson | d041849 | 2001-03-27 23:58:23 +0000 | [diff] [blame] | 257 | echo "Testing 16-bit wasted-bits-per-sample streams..." |
| 258 | for b in 01 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 259 | test_file wbps16-$b 1 16 "-0 -l $max_lpc_order -m -e -p" |
Josh Coalson | d041849 | 2001-03-27 23:58:23 +0000 | [diff] [blame] | 260 | done |
| 261 | |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 262 | for bps in 8 16 24 ; do |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 263 | echo "Testing $bps-bit sine wave streams..." |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 264 | for b in 00 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 265 | test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order -m -e --sample-rate=48000" |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 266 | done |
| 267 | for b in 01 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 268 | test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order -m -e --sample-rate=96000" |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 269 | done |
| 270 | for b in 02 03 04 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 271 | test_file sine${bps}-$b 1 $bps "-0 -l $max_lpc_order -m -e" |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 272 | done |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 273 | for b in 10 11 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 274 | test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order -m -e --sample-rate=48000" |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 275 | done |
| 276 | for b in 12 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 277 | test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order -m -e --sample-rate=96000" |
Josh Coalson | 9fb180b | 2002-08-22 07:26:06 +0000 | [diff] [blame] | 278 | done |
| 279 | for b in 13 14 15 16 17 18 19 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 280 | test_file sine${bps}-$b 2 $bps "-0 -l $max_lpc_order -m -e" |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 281 | done |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 282 | done |
| 283 | |
| 284 | echo "Testing some frame header variations..." |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 285 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax -b $max_lpc_order" |
| 286 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax -b 65535" |
| 287 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=9" |
| 288 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90" |
| 289 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90000" |
Josh Coalson | e2281f3 | 2002-09-11 00:31:47 +0000 | [diff] [blame] | 290 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=9" |
| 291 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90" |
| 292 | test_file sine16-01 1 16 "-0 -l $max_lpc_order -m -e -p --lax --sample-rate=90000" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 293 | |
| 294 | echo "Testing option variations..." |
| 295 | for f in 00 01 02 03 04 ; do |
| 296 | for opt in 0 1 2 4 5 6 8 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 297 | for extras in '' '-p' '-e' ; do |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 298 | test_file sine16-$f 1 16 "-$opt $extras" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 299 | done |
| 300 | done |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 301 | if [ "$FLAC__EXHAUSTIVE_TESTS" = yes ] ; then |
| 302 | test_file sine16-$f 1 16 "-b 16384 -m -r 8 -l $max_lpc_order -e -p" |
| 303 | fi |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 304 | done |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 305 | |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 306 | for f in 10 11 12 13 14 15 16 17 18 19 ; do |
| 307 | for opt in 0 1 2 4 5 6 8 ; do |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 308 | for extras in '' '-p' '-e' ; do |
Josh Coalson | f6237c8 | 2001-02-28 23:43:29 +0000 | [diff] [blame] | 309 | test_file sine16-$f 2 16 "-$opt $extras" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 310 | done |
| 311 | done |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 312 | if [ "$FLAC__EXHAUSTIVE_TESTS" = yes ] ; then |
| 313 | test_file sine16-$f 2 16 "-b 16384 -m -r 8 -l $max_lpc_order -e -p" |
| 314 | fi |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 315 | done |
| 316 | |
| 317 | echo "Testing noise..." |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 318 | for channels in 1 2 4 8 ; do |
| 319 | for bps in 8 16 24 ; do |
| 320 | for opt in 0 1 2 3 4 5 6 7 8 ; do |
| 321 | for extras in '' '-p' '-e' ; do |
Josh Coalson | 214d319 | 2002-08-31 05:47:33 +0000 | [diff] [blame] | 322 | for blocksize in '' '--lax -b 32' '--lax -b 32768' '--lax -b 65535' ; do |
Josh Coalson | c5f2f3f | 2001-02-08 22:21:45 +0000 | [diff] [blame] | 323 | test_file noise $channels $bps "-$opt $extras $blocksize" |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 324 | done |
| 325 | done |
| 326 | done |
Josh Coalson | 9b14518 | 2002-08-30 05:39:36 +0000 | [diff] [blame] | 327 | if [ "$FLAC__EXHAUSTIVE_TESTS" = yes ] ; then |
| 328 | test_file noise $channels $bps "-b 16384 -m -r 8 -l $max_lpc_order -e -p" |
| 329 | fi |
Josh Coalson | 29b4af8 | 2001-02-08 22:00:05 +0000 | [diff] [blame] | 330 | done |
| 331 | done |