codec: audio type with 5 lossy music formats
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 30 Oct 2021 02:42:10 +0000 (04:42 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Nov 2021 03:14:15 +0000 (04:14 +0100)
Some readily available facts and opinions about the most popular audio
codecs AFAIK.

codec-audio.inc.pl [new file with mode: 0644]
codec.plp

diff --git a/codec-audio.inc.pl b/codec-audio.inc.pl
new file mode 100644 (file)
index 0000000..5bd336d
--- /dev/null
@@ -0,0 +1,113 @@
+use utf8;
++{
+codec => {
+       mp3 => {
+               name => '<abbr title="MPEG-1 Audio Layer III">MP3</abbr>',
+               available => 1991,
+       },
+       vorbis => {
+               name => 'Vorbis',
+               available => 2000,
+       },
+       opus => {
+               name => 'Opus',
+               available => 2012,
+       },
+       aac => {
+               name => '<abbr title="Advanced Audio Coding">AAC</abbr>',
+               available => 1997,
+       },
+       atrac => {
+               name => '<abbr title="Adaptive Transform Acoustic Coding">ATRAC</abbr>',
+               available => 1992,
+       },
+},
+feature => {
+       default => {
+               children => [qw( quality limits royalties support )],
+       },
+       quality => {
+               name => 'compression quality',
+               children => [qw( quality_music quality_speech quality_ll )],
+               score => {
+               },
+       },
+       quality_music => {
+               name => 'music',
+               score => {
+                       mp3  => 3,
+                       atrac => 2,
+                       vorbis => 4,
+                       aac  => 5,
+                       opus => 5,
+               },
+       },
+       quality_speech => {
+               name => 'speech',
+               score => {
+                       mp3  => 3,
+               },
+       },
+       quality_ll => {
+               name => 'lossless',
+               score => {
+                       mp3  => 'n',
+                       vorbis => 'n',
+                       opus => 'n',
+                       flac => 4,
+               },
+       },
+       limits => {
+               children => [qw( channels bitrate latency peeling )],
+               score => {
+               },
+       },
+       channels => {
+               score => {
+                       mp3  => [3, 6, 'stereo, extended to upto 5.1'],
+                       vorbis => [4, 255],
+                       opus => [4, 255],
+               },
+       },
+       peeling => {
+               name => 'bitrate peeling',
+               score => {
+                       vorbis => [3, undef, 'yes but "unusable" quality'],
+                       mp3  => 'n',
+                       opus => 'n',
+                       aac  => 'n',
+               },
+       },
+       latency => {
+               name => 'frame size (ms)',
+               score => {
+                       mp3 => [3, 26, 'typical version and layer has 1152 samples at 44kHz'],
+                       opus => [5, 2.5],
+               },
+       },
+       bitrate => {
+               name => 'minimal bitrate',
+               score => {
+                       mp3 => [4, 8],
+                       opus => [4, 6],
+               },
+       },
+       royalties => {
+               score => {
+                       mp3  => [5, undef, 'expired'],
+                       vorbis => 5,
+                       opus => [4, undef, 'open and free design'],
+                       atrac => [2, undef, 'proprietary, but the original patents have expired'],
+               },
+       },
+       support => {
+               score => {
+                       mp3  => 5,
+                       vorbis => 4,
+                       aac  => 4,
+                       opus => 4,
+                       atrac => 1,
+               },
+       },
+},
+}
index 2349b1dc9747085742c468318d9eb41501575bfd..b2c3407f930af9c9e18e8f8c767fe25633b55d32 100644 (file)
--- a/codec.plp
+++ b/codec.plp
@@ -17,7 +17,7 @@ Html({
        '],
        stylesheet => [qw'light circus dark red'],
        data => [qw'codec.inc.pl'],
-       raw => '<style>td,th {width:10%} tbody th {white-space:nowrap}</style>',
+       raw => '<style>td,th {width:8%} tbody th {white-space:nowrap}</style>',
 });
 
 my $info = do "codec-$page.inc.pl";
@@ -60,7 +60,7 @@ while (defined (my $feat = shift @feat)) {
                        }
                }
                printf '<td class="l%d"', $score;
-               printf ' title="%s"', $_ for $title // ();
+               printf ' title="%s"', EscapeHTML($_) for $title // ();
                print '>', $data;
        }
        say '</td>';