Menu

#85 HDCD decoding support

Usability
open
nobody
None
5
2024-07-02
2024-06-25
No

Now that the patents have expired on HDCD and an open-source decoder is available, is it possible to integrate HDCD detection and decoding (prior to MP3 encoding) into LAME? At present if you have an HDCD-encoded disc you have to rip to WAV, load into something like foobar2000 with the HDCD plug-in enabled and batch convert from there.

Add to this that a lot of HDCD-encoded discs aren't actually marked as such and it becomes a challenge to know which discs need the workflow above, and which can just be ripped as standard with EAC / lame.

It would be a huge benefit to merge the available open-source implementation of the HDCD encoder into lame to allow the decoding to happen as part of the standard workflow.

Discussion

  • Elio Blanca

    Elio Blanca - 2024-07-01

    Currently lame provides native support for a bunch of uncompressed audio formats (WAV, AIFF, RAW...). External libmpg123 provides support for mpeg audio formats, and libsndfile does so for further compressed/uncompressed formats. Now, the best place for libhdcd inclusion would be the latter, so in a glance you will get hdcd format supported in a whole range of different applications (including lame). The devs are also quite reactive.

     
    • Glenn Richards

      Glenn Richards - 2024-07-02

      HDCD isn't an "audio format" as such; it's an encoding that's applied to PCM data, with in-band signalling used to indicate when the encoding is applied. Essentially it encodes the top and bottom 4dB of range using a logarithmic scale, increasing the apparent dynamic range to 20-bit but folding it into a 16-bit sample.

      Unfortunately there are very few players out there which can decode it. My old Arcam DV79 would, but only via the analogue out (the HDCD decoder needs to be in the DAC). There were a couple of AV receivers which would decode it via the SPDIF input and so would correctly decode a WAV or FLAC file being streamed to them, but the in-band signalling will not survive the MP3 encoding process (or AAC, OGG etc).

      Hence why I suggested the decoding should be incorporated into lame - given that MP3 encoding (or any other perceptual coding) destroys the in-band signalling, any HDCD decoding needs to be done ahead of the MP3 encoder. (Again, the same applies to other codecs such as AAC.)

      I wasn't aware that lame used libsndfile? Certainly when I've tried passing a FLAC file to it as input it's complained with an "unsupported input format" error; I've always had to pipe the output of the FLAC decoder into lame when converting.

       

Log in to post a comment.