Variety of lossless audio codecs

There are currently 14 lossless audio codecs mentioned on MultiMedia Wiki page (look here for further links):

  • Proprietary (Apple Lossless, Meridian Lossless Packing, Real Lossless, WMA Lossless)
  • Closed source (LA, LPAC, LTAC, OptimFROG, RK Audio)
  • Open source (Bonk, FLAC, MPEG-4 ALS, Monkey’s Audio, Shorten, TrueAudio, WavPack)

FFmpeg currently has decoders for Bonk, FLAC, Shorten, TrueAudio and Apple Lossless. So, there are at least MPEG-4 ALS, Monkey’s Audio and WavPack decoders can be added.

I will work on WavPack decoder and ALS (I hope standard will appear soon). What about Monkey’s Audio? Yes, it’s popular but it has following difficulties for implementation:

  1. It has incredibly largeĀ  frame sizes (it may be more than one million samples) while competitors stick around 64k or less (hence the compression gain for MA). Current FFmpeg design cannot handle such frames.
  2. Source code is a mess – for almost every action there are at least several if(ver >= …) or if(ver< ...). Format is too unstable for me.

Well, I still hope it will be implemented some day.

7 Responses to “Variety of lossless audio codecs”

  1. Peter Lemenkov says:

    Will you use libwavpack from original WavPack bundle? Or you prefer to create its own implementation?

    Looks like using the official one (from http://wavpack.com ) is the optimal solution.

  2. Kostya says:

    Who said “We’re not looking for easy ways” ? Of course, it will be native implementation for FFmpeg. I’ve already begun to document WavPack format in Multimedia Wiki.

  3. Peter Lemenkov says:

    Native? Hmmm…
    Useless waste of your time, IMO. We already have working encoder/decoder with fancy BSD-license.

    At the other hand, we haven’t yet even a really open decoder for Monkey’s Audio (due to nonexistend documentation of format or inacceptable license for reference codec).

    Maybe it would be better to work at APE-decoder? Unlike other algorithms described above (LPAK, Rka, OFR, MLP etc) we got really HUGE amount or audio, compressed with Monkey’s Audio, but haven’t decoder under license approved by OSI.

    I personally need such decoder, so I could help with it. Unfortunately, I never work with FFmpeg

  4. As Kostya mentioned in the original post, there are some fundamental technical conflicts between MA and FFmpeg dealing the large block sizes. This might be resolved in the future as we know of at least one other audio codec that has this same issue.

    Yeah, FFmpeg could link to the official WavPack library. But that’s not really our style. We always prefer to have native implementations for a variety of reasons. Plus, we like to document things along the way, as Kostya is doing with WavPack. We place a high value on knowledge so that hopefully more hackers can join the effort and come up to speed quickly.

  5. Zero1 says:

    Good luck with the MPEG-4 ALS decoder; it will be great to finally be able to use this standard outside of a crippled winamp decoder.

    There is a small thread at Doom9 where you can find a few samples and maybe the odd bit of useful information. Perhaps they/we can be of assistance should you need any.
    http://forum.doom9.org/showthread.php?t=104744&page=2

    Just scanning through your post and it seems that you require the spec. I’d have thought that maybe you could put together a (basic?) decoder from the MPEG-4 ALS source (since the executable is also able to decode .als files to .wav). Perhaps it’s not even worth taking the time to look at (I’m no programmer by any means); but in case it is of assistance, the RM18 sources (with MP4 output) can be found at this address:
    http://www.nue.tu-berlin.de/forschung/projekte/lossless/mp4alsRM18.zip

    With regards to the decoder; how might you go about it? Making a windows .ax or some kind of library that will be usable in something such as FFDShow?

    Look forward to your work.

    Best regards
    Zero1

  6. Coderjoe says:

    I just looked at the ISO website again to make sure that my memory was correct. ALS is standardized in ISO/IEC 14496-3:2005/Amd 2:2006.

    This should link to the ammendment:
    http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=43026&ICS1=35&ICS2=40&ICS3=

  7. Zero1 says:

    I was checking out something unrelated today, and I came across this:
    http://www.chiariglione.org/mpeg/working_documents/mpeg-04/audio/lossless-scalable.zip

    I don’t think it’s the full spec (certainly not the most recent), but just from skimming through it looks like some of this information may be of use to you if you still plan on writing the ALS decoder.

    Unfortunately they do not seem to bundle the source with the RM18 encoder, so here it is available in RM17:
    http://www.nue.tu-berlin.de/forschung/projekte/lossless/mp4alsRM17fix.zip

    I hope these turn out useful in someway.

    Regards
    Zero1