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 326146 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

HDCD Decoder

This PCM postprocessor component, currently utilized by the CDDA, WAV, FLAC, and WavPack inputs, will process 16-bit PCM data with HDCD packets into 20-bit PCM. If it fails to find any packet headers within the first 5 seconds of a track, it gives up.

The HDCD status will be indicated in the info variable "hdcd," retrievable with either %__hdcd% or $info(hdcd). Extra info variables are "hdcd_peak_extend," "hdcd_transient_filter" and "hdcd_gain."

Also included is a simple scanner that processes up to 5 seconds of each track selected and reports all tracks which contain HDCD information. If users want it, I will impement a full file scanner that also reports which HDCD features are used throughout the tracks.

Although all features are reported, like hdcd.exe, my component does not implement the transient filter, so that feature will have no effect on the output.

HDCD Decoder

Reply #1
Great. Thanks a lot for this one. This will save some disk space.

Can you elaborate on the HDCD processing? I take it the component does the gain and the peek extension features of HDCD. Does it include the filters too?

Cheers,
Adriaan.

HDCD Decoder

Reply #2
I have no reference for the implementation of the filters. Besides, I was under the impression those were only useful when upsampling the material. (I can detect when filters are enabled, but I don't actually perform any additional processing. This is identical to WMP, as far as I know.)

HDCD Decoder

Reply #3
WMP does the filters (HDCD is microsoft technology these days). All others I know (hdcd.exe and derivatives) only do the peaks and gains. But in my HDCD collection the usage of filters is less common then the other two.

Adriaan.

HDCD Decoder

Reply #4
Thank you!
Long waited component.
But it seems it works only when Replay Gain is off...

HDCD Decoder

Reply #5
Thanks for this component! Here's a question, i like to create an icon that highlights when HDCD is detected. How can i retrieve this information? Can you add some title formatting option like %hdcd% or something? Or maybe you know is there a way to read console information HDCD detected with wsh panel mod somehow.

HDCD Decoder

Reply #6
Yes, it only works with ReplayGain disabled, since ReplayGain is applied to the signal before DSP processing, and there is currently no way to query what the current ReplayGain scale level is.

As for an indicator, there is no way for a DSP to report any metadata changes, dynamic or not.

Slightly off-topic, but this decoder, as well as the DTS decoder, would probably be better off in some service that is automatically called to process sample data produced by all inputs, even when converting or ReplayGain scanning. That way, the audio data is untouched by other DSPs, and the processing is acknowledged by the ReplayGain scanner and other input parsers. Although this still sounds like a load of crap, and will probably never be implemented on a global scale.

HDCD Decoder

Reply #7
does this works on flac's?

HDCD Decoder

Reply #8
According to the above link, "This DSP component will decode HDCD data in any 16-bit PCM stream passed through it". So, yes, if the FLACs' source is an HDCD-encoded CD.

HDCD Decoder

Reply #9
And you'll either have to disable ReplayGain processing, or remove the ReplayGain tags from your files. And in either case, the applicable preamp or gain adjustment has to be +0dB.

HDCD Decoder

Reply #10
WMP does the filters (HDCD is microsoft technology these days).



Has it really been verified that WMP 'does the filters', and if so, can you point me to that proof?

HDCD Decoder

Reply #11
Has it really been verified that WMP 'does the filters', and if so, can you point me to that proof?

You can process an HDCDs utilizing filters as described at Wikipedia and with hdcd.exe and bit compare the resulting files. The files will be different. You can do the same with an HDCD that doesn't utilize filters and the resulting files will be identical.

I'm using WMP9 to convert my filters utilizing HDCDs. It will show an HDCD logo when it detects one. You need a 24-bit sound card and enable 24-bit in WMP. The WMP plug-in I use for writing to disk  is named Chronotron WAV Output.

Before the Foobar HDCD plug-in I was processing non filter utilizing HDCDs with HDCD.exe. Luckily I kept the 16-bit files and now can get rid of these 24-bit files. Excellent.

Hope this helps.
Adriaan.


HDCD Decoder

Reply #13
Has it really been verified that WMP 'does the filters', and if so, can you point me to that proof?

You can process an HDCDs utilizing filters as described at Wikipedia and with hdcd.exe and bit compare the resulting files. The files will be different. You can do the same with an HDCD that doesn't utilize filters and the resulting files will be identical.



What processing is that?  By filtering , I mean the filter switching option ("transient filter" also called dynamic filtering), not peak extend or gain adjust.

Let me quote from cjk32, who developed hdcd.exe:

Quote
HDCD allows the use of three features: peak extend, gain adjustment and reconstruction filter switching. Windows media player supports peak extend and gain adjustment, and it has hence been possible to fully implement these features.

Filter switching, however, only makes sense when you are upsampling, something which wmp doesn't do, and there's hence no reference to implement it from. Investigation of various test CDs and various (usually contradictory) literature has led to the conlusion that there are only two filters available at playback, the normal filter and the transient filter.


This doesn't say that WMP 'does' filtering in the sense I mean it...indeed, it seems to imply the opposite.  My understanding has been that only hardware HDCD decoders have 'done' such transient/dynamic, not software decoders.  IIRC from email exchanges I had with cjk20, he decided the measured difference from 'doing' filtering versus not doing it (on those HDCDs where filter switching was enabled) was rather insignificant anyway.

edit:  ah, here we go

http://www.hydrogenaudio.org/forums/index....st&p=516274

HDCD Decoder

Reply #14
And you'll either have to disable ReplayGain processing, or remove the ReplayGain tags from your files. And in either case, the applicable preamp or gain adjustment has to be +0dB.
I think I'd convert to 20-bit with this plug-in (without any other DSPs in the conversion chain), and then use ReplayGain as normal on the converted files. Archive the originals somewhere.

Until/unless someone embeds this and DTS decoding before ReplayGain, as suggested by kode54. In both cases, what you really have is a completely different format that just happens to be in a .wav container (though with HDCD, in a fairly benign and mostly backwards compatible way), so maybe some different approach would be better.

Cheers,
David.

HDCD Decoder

Reply #15
These seem fairly old - is HDCD still used often on new releases or is it similar to preemphasis in its prior use?

Many newer remasters are done via HDCD. Meaning the remaster is done on HDCD equipment but may not be an actual HDCD. One company using HDCD is Reference Recordings.

Many people cannot tell the difference between Red Book CD and HDCD. We all have different ears and hearing levels so that is understanable. I personally can hear subtle difference between such recordings and really enjoy my HDCDs. For the same price, using the same media, why not stick a little more in there?

HDCD Decoder

Reply #16
...
This doesn't say that WMP 'does' filtering in the sense I mean it...indeed, it seems to imply the opposite.  My understanding has been that only hardware HDCD decoders have 'done' such
...

I rerun my comparison between WMP and hdcd.exe using Beck's Midnite Vulture and the results turned out to be identical. I must have made some mistake the other time. Sorry.

Adriaan.

HDCD Decoder

Reply #17
It doesn't seem to catch it every time...

Quote
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\02 Uninvited.m4a"
HDCD detected.
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\01 If God Will Send His Angels.m4a"
HDCD detected.
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\07 Iris.m4a"
HDCD detected.
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\01 If God Will Send His Angels.m4a"


**** no "HDCD detected." here


Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\01 If God Will Send His Angels.m4a"
HDCD detected.
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\01 If God Will Send His Angels.m4a"
HDCD detected.
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Compilations\City of Angels\02 Uninvited.m4a"
HDCD detected.
Album List refreshed in: 0:00.113711
Opening track for playback: "C:\Users\nope\Music\iTunes\iTunes Music\Tool\Lateralus\05 Schism.m4a"
HDCD detected.

HDCD Decoder

Reply #18
Or some tracks are HDCD-flagged and some aren't. 

I have a Johnny Cash compolation disc where only one track trips the HDCD flag.  Same with a Thelonius Monk CD

HDCD Decoder

Reply #19
It doesn't seem to catch it every time...
..

You can try HDCD.exe with the -a switch. This will scan the whole file. Note sure how many samples foo_dsp_hdcd.dll considers to detect hdcd coding.

Adriaan.

HDCD Decoder

Reply #20
It only reports HDCD detected for the first packet it detects in the stream when the DSP is initialized, or after some non-HDCD data is passed through the DSP. It does not report on every automatic track change.

HDCD Decoder

Reply #21
This plugin employs peak extention on titles that use it as expected. It's nice to see 'HDCD detected' in the status windows. Finally I can use foobar2000 for all my listening ripping and conversion needs!

HDCD Decoder

Reply #22
Wow, thanks a ton for creating this plugin, I've wondered for years about what, if any, benefit HDCD discs really have.

All I can say is that the first couple of HDCD's I've played back have sounded noticeable cleaner and more dynamic.

However, I have tried converting them with the HDCD decoder DSP active, replaygain disabled, and the resulting files have been 16-bit.  They are not the same as the source files, as a replaygain scan shows a much lower album gain in both cases.  I'm wondering why the files are showing up as 16-bit, shouldn't they be 20-bit (or padded to 24-bit)?

 

HDCD Decoder

Reply #23
The converter does not detect what bit depth changes are caused by any DSPs you activate. You must manually change the target bit depth for lossless files from "same as source" to "24-bit." Until such time as DSPs can report any effective bit depth changes they cause and affect the converter, that is.

HDCD Decoder

Reply #24
The converter does not detect what bit depth changes are caused by any DSPs you activate. You must manually change the target bit depth for lossless files from "same as source" to "24-bit." Until such time as DSPs can report any effective bit depth changes they cause and affect the converter, that is.


Ah, I see.  Thanks for that little tidbit of important info.

Of course, I guess I don't really NEED to decode and convert all my HDCD files, since there wouldn't seem to be any harm in leaving the HDCD decoder permanently enabled.