Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: HDCD Decoder (Read 327145 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

HDCD Decoder

Reply #300
In preparing for my summer vacation, I tried to convert a few HDCD-encoded 16 bit FLAC (level 8) files to HDCD-decoded 24 bit FLAC (level 8) files using foobar2000, since I won't have access to HDCD decoding where I'm going.  I set up converter to convert to 24 bit, dither always, checked enable decode postprocessing (and no other processing).  I have foo_hdcd 1.14 installed in 1.1.3 final, and the album shows HDCD detected and peak extension enabled when I play the encoded version.

The issue: the decoded versions almost doubled in size - average file size grew from about 25MB to about 48MB.  The bit rate increased from about 750 kpbs to about 1453 kbps.  The decoded files show as 24 bits as I expected, and do not show any HDCD detection or flags when played (which seems to mean that HDCD was decoded as I wanted).  All the encoded and decoded files sound fine, so the only issue I see is the doubling of the file size and bit rate.

Is this the expected behavior, or am I overlooking something?  As an experiment, I also re-ripped one of the albums with and without HDCD decoding with dbpweramp and did not get a significant file size or bit rate difference, and I also used dbpoweramp to convert an encoded ripped file to a decoded version and also did not get a significant file size or bit rate difference.  While using dbpoweramp offers a solution for my vacation need, I'd rather not re-rip all the rest of the HDCD albums I want for vacation, and I'm very puzzled with what I did incorrectly or what went wrong in converting with foobar2000.  Thanks for any insight.


HDCD Decoder

Reply #301
Well, accordingly to my experience with 24 bit FLAC files, they always have bitrate above 1000kbps. Mine several 24 bit files were encoded using EAC (frontend)/flac 1.2.1 (command line encoder) . How about decoded files from dbpoweramp - they're 24bit or 16bit? If they're as small as not decoded files, they're maybe just 24bit truncated/dithered to 16bit?

HDCD Decoder

Reply #302
All encoded files are 16 bit 44.1k FLAC (level 8 selected in rip), all decoded are 24 bit 44.1k FLAC (level 8 selected in conversion or rip), and only the foobar2000-converted files doubled in size and bit rate.  All encoded files triggered HDCD detection and the PE flag when ripped or played, and none of the decoded files trigger HDCD detection when played.  I have no idea what the HDCD decoders do exactly, but I would expect a very similar result regardless of using foobar2000 or dbpoweramp, and I did not see that with respect to file size and bit rate.

HDCD Decoder

Reply #303
It isn't much of a surprise that filesize grows over-proportionally as bits-per-sample increases, as the lesser-significant bits sound more like noise, which is harder to compress.

But, this is way too much, because decoded HDCD isn't supposed to be more than 20 bits at most (I think the exact resolution is ... 19-point-something?). dBpoweramp stores in a 24-bit file for compatibility, padded with four bits of zeroes. So even HDCDs which utilize the full set of features, should encode to somewhat above (due to that over-proportionality I mentioned) 20 percent extra. My own very informal testing with hdcd.exe via dBpoweramp yield approximately 25 percent larger files.

So, what is going on? A shot in the dark: could it be that HDCD decoding should crop off the last 4 bits and that this algorithm doesn't – and that these 4 bits are more or less incompressible noise? Four-point-something bits of noise, even? Roughly fits a back-of-the-envelope calculation.


kode54, are you there?

HDCD Decoder

Reply #304
Porcus or anyone else, if you have an HDCD encoded 24 bit 44.1k flac file with PE flag detected, could you run foobar2000 converter like I did to decode HDCD to see what file size and bit rate difference you get?  If you can't duplicate roughly what I saw in foobar2000, then we can at least isolate the issue to something strange I'm doing versus an issue with foobar2000.  Thanks very much if you can.

HDCD Decoder

Reply #305
I'm not sure what cropping off the least significant bits has to do with noise, since they would only be filled in by either the peak extension table, or the low level adjustment reducing the level significantly. Yeah, this decoder is no longer strictly identical to Microsoft's, it does not mask off the results to exactly 20 bits, nor does it use the same low level adjustment ramping process.

HDCD Decoder

Reply #306
Porcus or anyone else, if you have an HDCD encoded 24 bit 44.1k flac file with PE flag detected, could you run foobar2000 converter like I did to decode HDCD to see what file size and bit rate difference you get?  If you can't duplicate roughly what I saw in foobar2000, then we can at least isolate the issue to something strange I'm doing versus an issue with foobar2000.  Thanks very much if you can.


foo_HDCD refuses to scan 24-bit files. I suppose you mean a 16-bit file?


I found two CD rips, all originally stored as 16 bits using FLAC -8 (without having had any HDCD decoding), all have Peak extension 'Enabled' except one track as stated:

Clawfinger (1999): s/t. (Style: Rage Against The Machine.) One track has peak extension 'Intermittent'. Minimum gain 0.
Mari Boine (1998): Woom of Worship. (Style: World music.) All tracks but one have minimum gain = –4.0 dB.


Average bitrate: 866.

Converting to FLAC (-8) 24-bit with DSP/post-processing enabled, having set HDCD to halve volume only when Peak Extension is enabled:
959 kB/s. 11 percent up.

For the hell of it, I cropped them down to 16 (no dither) just to measure: 818.
But, most of the tracks (the entire Boine CD and 4 of 12 Clawfinger's) still had HDCD signals :-o


Changing the setting to 'never' halve the volume: 965 kB/s.



Guess I should stop trying to explain a result before having checked it ...

HDCD Decoder

Reply #307
In preparing for my summer vacation, I tried to convert a few HDCD-encoded 16 bit FLAC (level 8) files to HDCD-decoded 24 bit FLAC (level 8) files using foobar2000, since I won't have access to HDCD decoding where I'm going.  I set up converter to convert to 24 bit, dither always, checked enable decode postprocessing (and no other processing).  I have foo_hdcd 1.14 installed in 1.1.3 final, and the album shows HDCD detected and peak extension enabled when I play the encoded version.


Why are you dithering?

Is there possibly dither being added that is pushing things out to 24 bits, rather than 20 bits with the last 4 padded to 0?

HDCD Decoder

Reply #308
Porcus' test indicates I was doing something incorrectly, and the dither setting seems to be the cause - when I selected one of the other options to turn it off for this conversion, the file size and bit rate were just a bit more than the original file.  Dithering should be unnecessary in this case since I'm converting from 16 bit to 24 bit, but this was not a setting I gave much thought to before your post.  Thanks to all for the help!

HDCD Decoder

Reply #309
What is the best way to "normalize" the volume (loudness) of a 20bit decoded hdcd in the 24 bit package?  How could one convert to a true 20 bit file with the correct volume levels?  (my stereo setup is purposely low gain.)


HDCD Decoder

Reply #311
What is the best way to "normalize" the volume (loudness) of a 20bit decoded hdcd in the 24 bit package?  How could one convert to a true 20 bit file with the correct volume levels?  (my stereo setup is purposely low gain.)


The best way of normalizing within the 24-bit container, is to do what you originally did: employ dither. This will resample the audio into all 24 bits (rather than leave 4 padded zero bits). Replay gain will work as well, of course.

To be honest, I've never been convinced by the HDCD format and see it as a gimmick. The fact that converting (without dither) barely raises the file size above the original 16-bit size just proves that there really isn't much extra audio information being decoded, even within the first 20 bits. Even just stepping up to 20-bit one would expect the file size to increase by about 25%. But it doesn't. It increases by a tiny fraction. I would say: only decode if the disc contains peak gain information. This restores the dynamics that were compressed in the 16-bit version. If there is no peak gain employed in the HDCD then decoding probably won't make any audible difference.

HDCD Decoder

Reply #312
What is the best way to "normalize" the volume (loudness) of a 20bit decoded hdcd in the 24 bit package?  How could one convert to a true 20 bit file with the correct volume levels?  (my stereo setup is purposely low gain.)


The best way of normalizing within the 24-bit container, is to do what you originally did: employ dither. This will resample the audio into all 24 bits (rather than leave 4 padded zero bits). Replay gain will work as well, of course.

To be honest, I've never been convinced by the HDCD format and see it as a gimmick. The fact that converting (without dither) barely raises the file size above the original 16-bit size just proves that there really isn't much extra audio information being decoded, even within the first 20 bits. Even just stepping up to 20-bit one would expect the file size to increase by about 25%. But it doesn't. It increases by a tiny fraction. I would say: only decode if the disc contains peak gain information. This restores the dynamics that were compressed in the 16-bit version. If there is no peak gain employed in the HDCD then decoding probably won't make any audible difference.



The real thing is that the adc (studio) and dac share the same filter,  so using hardware decoding there is a true benefit,  not a gimmick,  means the recording was done with a PM-2 (google Keith Johnson he was a genius.)  And you are decoding with a PMD-100.  Supposedly modern oversampling algorithms (apodising) have helped with the problem of adc-dac ringing/compatibility so it may not be a big deal anymore (I'm not an expert on modern DAC's.)

But decoding software helps if you don't have a hardware decoder (or want to use DSP), if the peak extend feature was used.  Makes a huge difference depending on who did the mastering.  Can be the difference between a nasty loudnesss war-ish recording vs something decent decoded.

If you are into DSP/mastering on the fly to your tastes then the decoding is fairly essential.  On-the fly HDCD decoding like this plug-in isn't possible on Mac's,  so this plugin is still a fairly important one in the computer audio field.  Hope foobar goes 64 bit one day.

But I agree with you as far as a gimmick if you were to compared decoded hdcd dithered to 16 bit vs 20 bit,  even with peak extend doubt one could hear the difference on any mastering.




It would be really nice if this plug-in had a "monitor" mode where it doesn't decode but displays the hdcd info.  Also installing it and uninstalling it is a PITA.


HDCD Decoder

Reply #313
I would say: only decode if the disc contains peak gain information. This restores the dynamics that were compressed in the 16-bit version. If there is no peak gain employed in the HDCD then decoding probably won't make any audible difference.


There are 2 instances where decoding will make an audible difference:

- Peak Extension
- Low Level Range Extension

Beyond that, there isn't a "probably". The only other thing that happens is a bit shift to reduce the volume.

 

HDCD Decoder

Reply #314
Today I had an automatic update of the HDCD decoder - to version 1.15.
What's new?

HDCD Decoder

Reply #315
Changes are listed on the update page. Tracks using peak extension should now be safe to play in album order, as it now looks ahead on track start and applies a detected status to the beginning of the track. No more funny volume bumps at the start of tracks in the middle of an album. It may need a bit of work, though.

HDCD Decoder

Reply #316
Cool, thanks. I see the page now.
I usually keep the albumes in separated folders, don't mix peak extension files with non-PE ones, so I didn't notice any differences.
Thanks for keeping this decoder "alive".

PS: Being an automated update, didn't realize that you switched to the .component format instead of .zip...

HDCD Decoder

Reply #317
Question to the usual suspects:  I noticed that many of my HDCD-encoded FLAC albums with peak extension detected have Replaygain album peaks close to 2.0 (1.999237, for example).  The HDCD component was installed and working before I calculated Replaygain tags for these albums.  I'm sure the correlation of these peaks and PE detected is not a coincidence, but my question is if the peak calculation is accurate in such cases and appropriately used by the Replaygain option of "prevent clipping according to peak". 

I was under the impression that uncompressed files should have an RMS peak no higher than 1.0 relative to a full scale signal of 103 dB per the Replaygain spec:
Quote
For uncompressed files simply, scanners store the maximum absolute sample value held in the file on any channel for positive or negative excursion. The single sample value should be converted to a floating-point representation, such that digital full scale is equivalent to a value of 1.0.

Enlightenment always appreciated.

HDCD Decoder

Reply #318
After a few experiments, the calculated peak levels for HDCD PE-enabled albums seem appropriate in working with the option of "prevent clipping according to peak", as long as the HDCD component remains in the playback chain.  Glad it works!

HDCD Decoder

Reply #319
The default for Peak Extension enabled tracks should be to halve the volume. Unless you changed the setting in the Advanced section of Preferences, under Decoding, HDCD decoder, Halve output volume.

PS: Being an automated update, didn't realize that you switched to the .component format instead of .zip...

Hint: .fb2k-component is still a .zip file, but the extension allows for automatic installation if you download the archive manually and open it with Explorer or your browser.

HDCD Decoder

Reply #320
Cool, didn't know. Thanks!

HDCD Decoder

Reply #321
I know this has been asked before, but the component has had some updates, so here goes: is there any way to permanently show which tracks are HDCD and which are not in the columns? I've used everything, $if($info(hdcd),'(HDCD)',), $if(%__hdcd%,HDCD ,) etc. but the "HDCD" shows up only when I play a track. I scanned all my library for HDCD-encoded tracks and found several of them, but I forgot which ones were they.

It would also be cool if we could use %__hdcd% as a parameter in the Search function. But that would require embedding an HDCD marker in the tags, right? What if you could implement a tagger in the HDCD scan utility? That would store all the info about peaks and stuff in the track's metadata and make it easier to show all HDCD-encoded tracks in the columns and the search function.

HDCD Decoder

Reply #322
The component can only provide that field when it knows its value, something whose discernment requires the track to be playing.

If you want this information to be available permanently, store it as permanent metadata in your files.

HDCD Decoder

Reply #323
What is the syntax (aka Pattern) for adding HDCD Peak Extend, HDCD Gain and HDCD Transient Filter columns in Foobar? I cant get anything to appear... 

[—]

Also, I don't get why the Foobar status bar shows a 24-bit bit depth for HDCD tracks, yet the Foobar column says 16-bit and my Audiophilleo1 transport only detects 16-bit. Is it because I am using WASAPI in Windows 8 as my output?

[—]

Sorry for all the questions, but does the %__hdcd_gain% variable show minimum or maximum gain? Reason I ask is that your HDCD Scan Results console shows a column for minimum and maximum gain. Can we get a variable for each so we can create a column for each in Foobar? (assuming I can get the columns to even work ...see post above)

Thanks!!! 

HDCD Decoder

Reply #324
I don't get why the Foobar status bar shows a 24-bit bit depth for HDCD tracks, yet the Foobar column says 16-bit and my Audiophilleo1 transport only detects 16-bit. Is it because I am using WASAPI in Windows 8 as my output?
To what bit-depth have you set said output?

Quote
does the %__hdcd_gain% variable show minimum or maximum gain? Reason I ask is that your HDCD Scan Results console shows a column for minimum and maximum gain.
You might compare the variable to the columns and deduce from there.