{"id":926,"date":"2009-01-21T22:52:02","date_gmt":"2009-01-22T06:52:02","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=926"},"modified":"2009-01-21T22:56:26","modified_gmt":"2009-01-22T06:56:26","slug":"lossless-audio-anomalies","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/lossless-audio-anomalies\/","title":{"rendered":"Lossless Audio Anomalies"},"content":{"rendered":"<p>Some years ago, I took a 1-minute sample of a song from a CD and compressed it using every lossless audio coder I knew of at the time &#8212; a dozen of them in all. <a href=\"http:\/\/samples.mplayerhq.hu\/A-codecs\/lossless\/\">I put the samples here<\/a>. This effort predated <a href=\"http:\/\/fate.multimedia.cx\/\">FATE<\/a> by a number of years. Nowadays, <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> contains native decoding support for 7 of those lossless audio algorithms. And since lossless decoders, by definition, are supposed to have bitexact results, this should be an easy task to add automated tests to FATE.<\/p>\n<p>My pragmatic rule for FATE samples is to try to keep the samples under 2 MB where feasible. Since most of these lossless samples I created weigh in between 6-7 MB, I set about slicing off the first megabyte of each supported sample. And that&#8217;s when I noticed that the output was not bitexact across configurations, at least not for all the algorithms. This struck me as odd. <\/p>\n<p>The following lossless algorithms produced identical output across platforms, even with an incomplete final chunk:<\/p>\n<ul>\n<li><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=FLAC\">FLAC<\/a><\/li>\n<li><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Monkey%27s_Audio\">Monkey&#8217;s Audio\/APE<\/a><\/li>\n<li><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Meridian_Lossless_Packing\">Meridian Lossless Packing (MLP)<\/a><\/li>\n<li><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Shorten\">Shorten<\/a><\/li>\n<li><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=WavPack\">WavPack<\/a><\/li>\n<\/ul>\n<p><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Apple_Lossless_Audio_Coding\">Apple Lossless<\/a> generates 4 results &#8212; all Linux\/x86_32 agreed, all Linux\/x86_64 agreed, all Linux\/PPC agreed, and Mac OS X x86_64 and PPC agreed.<\/p>\n<p><a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=True_Audio\">True Audio Lossless<\/a> generates 19 different results &#8212; all configurations disagreed except for Mac OS X x86_64 and PPC, which agreed with each other.<\/p>\n<p>Digging deeper using &#8216;-f framecrc&#8217; demonstrates that all frames agree across configurations until the last, incomplete frame (and, of course, the complete files are bitexact). No big emergency; I just thought it was interesting. I will be able to contrive a new, smaller ALAC sample using iTunes (or FFmpeg using Jai&#8217;s encoder), and it looks like <a href=\"http:\/\/www.true-audio.com\/\">True Audio&#8217;s encoder<\/a> is still around as well, and available for Linux to boot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Incomplete chunks of lossless audio decode differently on different configurations<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[134,108,135],"class_list":["post-926","post","type-post","status-publish","format-standard","hentry","category-fate-server","tag-audio","tag-fate","tag-lossless"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=926"}],"version-history":[{"count":5,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/926\/revisions"}],"predecessor-version":[{"id":931,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/926\/revisions\/931"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}