From d8fb15b3d9a345d0c936e036b47a7a0708ffbb74 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 30 Oct 2021 04:42:10 +0200 Subject: [PATCH] codec: audio type with 5 lossy music formats Some readily available facts and opinions about the most popular audio codecs AFAIK. --- codec-audio.inc.pl | 113 +++++++++++++++++++++++++++++++++++++++++++++ codec.plp | 4 +- 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 codec-audio.inc.pl diff --git a/codec-audio.inc.pl b/codec-audio.inc.pl new file mode 100644 index 0000000..5bd336d --- /dev/null +++ b/codec-audio.inc.pl @@ -0,0 +1,113 @@ +use utf8; ++{ +codec => { + mp3 => { + name => 'MP3', + available => 1991, + }, + vorbis => { + name => 'Vorbis', + available => 2000, + }, + opus => { + name => 'Opus', + available => 2012, + }, + aac => { + name => 'AAC', + available => 1997, + }, + atrac => { + name => 'ATRAC', + 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, + }, + }, +}, +} diff --git a/codec.plp b/codec.plp index 2349b1d..b2c3407 100644 --- a/codec.plp +++ b/codec.plp @@ -17,7 +17,7 @@ Html({ '], stylesheet => [qw'light circus dark red'], data => [qw'codec.inc.pl'], - raw => '', + raw => '', }); my $info = do "codec-$page.inc.pl"; @@ -60,7 +60,7 @@ while (defined (my $feat = shift @feat)) { } } printf '', $data; } say ''; -- 2.30.0