
CONSTANT BITRATES VS VARIABLE BITRATES

For the testing purposes I used cdwrite to read the well known Pink Floyd's
album ``Dark Side of the Moon'' to WAV files.  Then I used cdwrite to encode
those WAV files to MP3 ones as well as to OGG ones using different constant
and variable bitrates.  I did not put ID3 tags to these files because I
wanted to compare them in their original sizes.

The first table shows the total times of ripping the album to WAV files (in
minutes and seconds) and the total sizes of the created WAV files (in bytes)
as a result of ripping that album with cdparanoia and cdda2wav.  When
ripping does not encounter any problems WAV files produced by both
cdparanoia and cdda2wav are identical when compared with cmp command.  In
the case of the Pink Floyd's album printed in the U.K. by EMI as CDEMD 1064
the first track causes some problems during ripping while the remaining
tracks are fine.  As a result cdparanoia and cdda2wav output WAV files of
the first track differ while the other tracks output WAV files are the
same.

The second table shows the results of encoding those WAV files to MP3 ones
with lame including the total times of the encoding all nine tracks (in
minutes and seconds), the total sizes of all nine generated MP3 files (in
bytes), and the resulting compression ratios (in per cents).

The third table shows the results of encoding those WAV files to OGG ones
with oggenc including the nominal bitrates (in kilobytes per second), the
total times of the encoding all nine tracks (in minutes and seconds), the
total sizes of all nine generated OGG files (in bytes), and the resulting
compression ratios (in per cents).

If you own that album you can convert it to WAV files (the first nine tracks
without possible bonuses) and then convert those files to MP3 or OGG ones
using some selected bitrate -- for example variable bitrate --r3mix for lame
and MP3 or quality -q 6 for oggenc and OGG.  Finally you can scale the other
results I reported below in order to approximate the encoding times specific
for your machine.

When you encode the same files for a few times using the same encoding
method the consecutive processes last for the similar but not exactly the
same time.  Take that into consideration analysing the second and the third
tables below.  The difference of a few seconds is not any difference when
you encode an entire audio CD.  In the case of the mentioned album encoding
the same WAV files to MP3 or OGG ones a few times with the same bitrate
lasted for a few seconds fewer or a few seconds more during the consecutive
attempts.  You can observe that comparing the corresponding encoding times
for OGGs or comparing the times of encoding with constant bitrate -b 320 and
variable bitrate --preset insane in the case of MP3s.  These encodings are
the same while these times are similar but not the same.

  Tab. 1. Ripping audio CD to WAV files:

   ripper     | time | size
  ------------+------+--------
   cdparanoia | 3:53 | 444000
   cdda2wav   | 8:01 | 444000

  Tab. 2. Encoding WAV files to MP3 ones with lame:

    bitrate               | time | size   | ratio
  ------------------------+------+--------+--------
   -b 128                 | 4:10 |  40298 |  9.07%
   -b 160                 | 4:13 |  50368 | 11.34%
   -b 192                 | 3:31 |  60433 | 13.61%
   -b 224                 | 3:37 |  70511 | 15.88%
   -b 256                 | 3:36 |  80581 | 18.14%
   -b 320                 | 3:39 | 100717 | 22.68%
  ------------------------+------+--------+--------
   --r3mix                | 2:55 |  55928 | 12.59%
  ------------------------+------+--------+--------
   --preset medium        | 5:45 |  52910 | 11.91%
   --preset fast standard | 2:58 |  62483 | 14.07%
   --preset standard      | 4:47 |  62884 | 14.16%
   --preset fast extreme  | 3:05 |  76053 | 17.12%
   --preset extreme       | 4:26 |  75604 | 17.02%
   --preset insane        | 3:37 | 100717 | 22.68%

  Tab. 3. Encoding WAV files to OGG ones with oggenc:

    bitrate   | nominal   | time | size   | ratio
  ------------+-----------+------+--------+--------
   -q 3       | 112       | 3:41 |  34929 |  7.86%
   -q 4       | 128       | 3:18 |  39197 |  8.82%
   -q 5       | 160       | 3:22 |  49074 | 11.05%
  ------------+-----------+------+--------+--------
   -q 5.75    | 184       | 3:25 |  54627 | 12.30%
  ------------+-----------+------+--------+--------
   -q 6       | 192       | 3:21 |  59021 | 13.29%
   -q 7       | 224       | 3:28 |  67885 | 15.29%
   -q 8       | 256       | 3:30 |  79492 | 17.90%
   -q 9       | 320       | 3:38 | 101229 | 22.80%
   -q 10      | 500       | 3:43 | 143951 | 32.42%
  ------------+-----------+------+--------+--------
   -b 112     |           | 3:43 |  34929 |  7.86%
   -b 128     |           | 3:16 |  39197 |  8.82%
   -b 160     |           | 3:22 |  49074 | 11.05%
   -b 192     |           | 3:24 |  59021 | 13.29%
   -b 224     |           | 3:26 |  67885 | 15.29%
   -b 256     |           | 3:30 |  79492 | 17.90%
   -b 320     |           | 3:39 | 101229 | 22.80%

Attention: starting from cdwrite 3.5.1 the MP3 192 kb/s and higher bitrates
as well as all variable bitrates use stereo mode instead of joint-stereo and
OGG files use quality 6 instead of 5.75.  As a result the MP3 and OGG files
produced with these bitrates are slightly bigger than the sizes stored in
the table above.

In the case of the encoding with lame to MP3 files variable --preset insane
gives exactly the same result as constant bitrate -b 320 -- an uncompressed
MP3 file.  Just compare the total of the encoding times and the total of the
file sizes in these two cases.

You will find more information about available presets on ``man lame'' or
running ``lame --preset help'' command.  The setting --r3mix is not
documented there -- it is a shortcut for a well designed set of options: -V3
--vbr-new --lowpass 18.  Since cdwrite 3.5.1 it uses real stereo instead of
joint-stereo.

In the case of the encoding with oggenc to OGG files neither predefined
qualities nor bitrates are constant values.  The actual average bitrate of
the consecutive encoded tracks oscillate near the nominal bitrate and varies
from file to file.

Variable bitrate compared to constant bitrate at the same level sounds
always better because it compresses more complex passages at higher bitrate
and less complex passages at lower bitrate.  So a direct comparison of the
sound quality of OGG file using for example nominal bitrate -b 128 to MP3
file using constant bitrate -b 128 is not fair.

As for the subjective feeling of the quality of the resulting MP3 or OGG
files you have to compare these bitrates yourself.  The cdwrite default MP3
quality setting is --r3mix and default OGG quality setting is -q 6.  With
these settings lame works faster but produces bigger files while oggenc
works more slowly but produces smaller files.  If you believe in the saying
``time is money'' use MP3s -- if you believe in the saying ``small is
beautiful'' use OGGs.

When I started to convert my music library to MP3 files at the beginning I
used constant bitrate -b 160 then I used constant bitrate -b 192 and now I
use variable bitrate --r3mix.  The last one combines the shortest encoding
time, relatively moderate files sizes and well designed compression
algorithm resulting in subjective impression of the high quality of the
sound.  The choice between MP3 and OGG formats is a matter of belief
unless you did a double-blind tests.


Copyright (C) 2011-2014 Cezary M. Kruk <c.kruk@bigfoot.com>

