[flac-dev] [PATCH] Improve LPC order guess
Jan Stary
hans at stare.cz
Fri Dec 5 03:30:42 PST 2014
On Dec 04 11:05:24, mle+la at mega-nerd.com wrote:
> Martijn van Beurden wrote:
>
> > This patch improves compression a very tiny bit on average, but
> > up to 0.1 percentage point for classical music. I haven't found
> > any tracks that show worsening compression with this patch.
>
> Applied, thanks.
>
> I think this points to the need to have a centralised repository
> of of test files for studying and validating compression ratios
> and speed.
>
> Martjin, are you able to make your test material available? DO
> you have any test scripts your use to run your tests?
Surely Martijn has something more sophisticated,
here is my test script using SoX to generate the audio.
Jan
#!/bin/sh
# Test FLAC compression on a set of audio files.
# For each of the test files, we measure the time it takes to compress,
# and the compression ratio, for compression levels from -0 to -8.
die()
{
echo $* >&2
exit 1
}
FLAC=`which flac`
test -n $FLAC || die flac not found
FLAC="$FLAC --silent -f"
SOX=`which sox`
test -n $SOX || die sox not found
SOX="$SOX -c 1 -b 16 -n"
TIME=`which time`
test -n $TIME || die time not found
TIME="$TIME -p"
_size()
{
ls -l "$1" | awk '{print$5}'
}
_time()
{
$TIME $* 2>&1 | grep real | awk '{print$2}'
}
while read wave ; do
ifile=${wave%%:*}.wav
synth=${wave##*:}
SOXCL="$SOX $ifile synth 60 $synth gain -4"
echo $SOXCL ; $SOXCL || die SoX failed
isize=`_size $ifile`
for level in 0 1 2 3 4 5 6 7 8 ; do
ofile=$ifile.$level.flac
otime=`_time $FLAC -$level $ifile -o $ofile`
osize=`_size $ofile`
ratio=`echo "scale = 10 ; $osize / $isize" | bc`
printf "%16s -%d %d/%d bytes (%f) in %f seconds\n" \
$ifile $level $osize $isize $ratio $otime
rm -f $ofile
done
rm -f $ifile
done << EOF
sine: sine 440
square: square 440
triangle: triangle 440
sawtooth: sawtooth 440
trapeze: trapez 440
exp: exp 440
whitenoise: whitenoise
tpdfnoise: tpdfnoise
pinknoise: pinknoise
brownnoise: brownnoise
EOF
More information about the flac-dev
mailing list