# HG changeset patch # User Chris Cannam # Date 1382114407 -3600 # Node ID 12a0c2e493c4e26a3808d362542545901c0ab768 # Parent 7d4165ded830ebba78a3175d30ee9e8510eb2f4e Two-stage decimate for factors not supported in a single stage diff -r 7d4165ded830 -r 12a0c2e493c4 run-tests.sh --- a/run-tests.sh Fri Oct 18 17:15:54 2013 +0100 +++ b/run-tests.sh Fri Oct 18 17:40:07 2013 +0100 @@ -46,11 +46,26 @@ "$mydir/garage-resampler/resample" --snr 50 --bandwidth 0.05 --to "$(($original/$factor))" "$infile" "$outfile" } +decimate_twice() { + first="$1" + second="$2" + infile="$3" + outfile="$4" + "$mydir/qm-dsp-decimate/decimate" --by "$first" "$infile" "$outfile".tmp + "$mydir/qm-dsp-decimate/decimate" --by "$second" "$outfile".tmp "$outfile" + rm "$outfile".tmp +} + do_decimate() { factor="$1" infile="$2" outfile="$3" - "$mydir/qm-dsp-decimate/decimate" --by "$factor" "$infile" "$outfile" + case "$factor" in + 16) decimate_twice 4 4 "$infile" "$outfile";; + 32) decimate_twice 8 4 "$infile" "$outfile";; + 64) decimate_twice 8 8 "$infile" "$outfile";; + *) "$mydir/qm-dsp-decimate/decimate" --by "$factor" "$infile" "$outfile";; + esac } mkdir -p "$mydir"/out