MinimServer Forum
HDCD CDs and transcoding - Printable Version

+- MinimServer Forum (
+-- Forum: MinimServer (/forumdisplay.php?fid=1)
+--- Forum: MinimStreamer (/forumdisplay.php?fid=11)
+--- Thread: HDCD CDs and transcoding (/showthread.php?tid=1502)

Pages: 1 2 3 4 5 6

RE: HDCD CDs and transcoding - GreenMtnGringo - 09-07-2019 22:06

Hi Simon, wow, that is great information and sounds very encouraging, thanks! I just acquired a 3-CD set that is HDCD-encoded and the HDCD "Peak Extension" flag is enabled, meaning that proper HDCD decoding is necessary for maximum sound quality. I will rip it to 16/44.1k FLAC and follow your very clear and precise instructions to set up the HDCD decoding. Thanks again!

RE: HDCD CDs and transcoding - ac16161 - 10-07-2019 18:40

Interesting discussion. Couple of thoughts.

Transcoding all 16-bit FLAC to WAV24 with the HDCD filter via ffmpeg is good for the HDCD-encoded files, but it may or may not be good for regular 16-bit sources, depending on what the DAC does with the stream? I've never been convinced that packing a 16-bit source into a 24-bit stream actually sounds better with my Linn streamers, in fact I think it sounds worse. But that might depend on my hearing or on how the 16 bits are upsampled by the DAC?

For the very small number of HDCD-encoded titles in my collection, I have previously decoded at the ripping stage with the dbpoweramp utility, I'm curious to compare with in-play conversion via ffmpeg. Anyway, just an observation: I notice that the pre-decoded FLAC files that put the decoded HDCD in a 24-bit container are much smaller than their ALAC equivalents. You can flip back and forth between FLAC and ALAC and see this. Could the FLAC compression algorithm be spotting that the true bit depth is not 24 bit, and able to apply much greater degree of lossless compression than ALAC does? Not knowing any of the technical detail of FLAC vs ALAC, I have always just noticed this as a curiosity. It's a moot point if the file is not pre-decoded.

RE: HDCD CDs and transcoding - simoncn - 11-07-2019 09:14

On your first point, the HDCD decoding process looks for HDCD markers in the audio data and makes gain adjustments when it sees these markers. If these markers are not present, no gain adjustments are made and the output audio data sent to the DAC should be identical to the input audio data.

Edit: The above is incorrect. See this post.

I don't have sufficently detailed knowledge of the FLAC and ALAC encoding algorithms to comment on your second point.

RE: HDCD CDs and transcoding - GreenMtnGringo - 12-07-2019 02:11

I am back to ripping HDCDs to 24-bit FLAC files with dBpoweramp. In my system, the ffmpeg HDCD decoder seems to decrease the volume of even non-HDCD FLAC rips, and rather dramatically so.

RE: HDCD CDs and transcoding - simoncn - 12-07-2019 09:10

Do you see this volume reduction for all non-HDCD FLAC files or only some of them? I will try this myself on a few test tracks.

RE: HDCD CDs and transcoding - simoncn - 12-07-2019 10:33

I tried this on a couple of non-HDCD files and there is a volume reduction of approximately -6dB when using -af hdcd. From a bit of web searching, it seems this volume reduction is expected. I presume the FFmpeg hdcd filter does this to allow for a +6dB boost if/when this is signalled by an HDCD marker in the audio data (if any such markers are found). With a non-HDCD file, no markers are found and the whole file plays with a reduced volume level.

When you apply HDCD decoding as part of the ripping process, do you activate this selectively for albums that you know to be HDCD-encoded?

RE: HDCD CDs and transcoding - GreenMtnGringo - 13-07-2019 17:48

Hi Simon and thanks for testing and reporting back. It seems your findings match mine, that is, the FFmpeg HDCD filter chops all file playback by 6 dB regardless of whether the file is HDCD-encoded. To me, that is a major flaw in the filter. I believe the Foobar2000 HDCD plug-in I linked above only kicks in when it encounters an HDCD-encoded file.

As far as HDCD ripping is concerned, I only use dBpoweramp when ripping HDCDs to 24-bit, 44.1k FLAC files, so I leave the ripper's HDCD DSP Effect on at all times. It is my understanding that there is no harm in ripping a non-HDCD disc with the HDCD DSP Effect on, as the Effect supposedly only kicks in when it encounters an HDCD disc. As explained in this dBpoweramp link (my emphasis):

"Depending upon which audio player is used, if the player can handle 24 bit audio files, then adding the DSP effect HDCD is useful, in that any HDCD audio CDs (a special encoded audio CD with 20 bits of encoded audio information) will be detected and encoded to a 24 bit audio file, non HDCDs are left at 16 bit."

RE: HDCD CDs and transcoding - simoncn - 14-07-2019 08:17

I don't see how the FFmpeg filter could know in advance whether or not HDCD information is present at some point in the audio that the filter hasn't read yet (so that it can only apply the -6dB reduction if HDCD information is present). In contrast, processing performed at the ripping stage can scan the whole file and identify whether the file is HDCD or not.

Forum discussions that I have seen suggest that the user can compensate for this -6dB reduction by adding album gain or track gain tags to non-HDCD files. This isn't ideal but is probably the best that can be achieved with the filtering approach.

RE: HDCD CDs and transcoding - GreenMtnGringo - 14-07-2019 13:54

Hi Simon. FWIW, the author of the HDCD plugin for Foobar2000 claims his plugin does not reduce the volume on non-HDCD files. See Reply #29 of this thread:,79427.msg699511.html#msg699511

RE: HDCD CDs and transcoding - simoncn - 14-07-2019 15:04

The claim is that this "fixes CD ripping", not playback of a file that was already ripped as 16-bit.