codec: audio type with 5 lossy music formats
[sheet.git] / codec-audio.inc.pl
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,
+               },
+       },
+},
+}