Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: kode54 on 2010-03-14 12:56:41

Title: HDCD Decoder
Post by: kode54 on 2010-03-14 12:56:41
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.
Title: HDCD Decoder
Post by: a3aan on 2010-03-14 13:57:06
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.
Title: HDCD Decoder
Post by: kode54 on 2010-03-14 14:10:48
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.)
Title: HDCD Decoder
Post by: a3aan on 2010-03-14 14:20:02
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.
Title: HDCD Decoder
Post by: Fool_on_the_hill on 2010-03-14 16:16:37
Thank you!
Long waited component.
But it seems it works only when Replay Gain is off...
Title: HDCD Decoder
Post by: ExtremeHunter on 2010-03-15 08:22:30
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.
Title: HDCD Decoder
Post by: kode54 on 2010-03-15 11:26:46
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.
Title: HDCD Decoder
Post by: sopparus on 2010-03-15 12:30:13
does this works on flac's?
Title: HDCD Decoder
Post by: db1989 on 2010-03-15 12:45:25
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.
Title: HDCD Decoder
Post by: kode54 on 2010-03-15 13:19:01
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.
Title: HDCD Decoder
Post by: krabapple on 2010-03-18 21:56:37
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?
Title: HDCD Decoder
Post by: a3aan on 2010-03-18 23:32:40
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 (http://en.wikipedia.org/wiki/HDCD#Windows_Media_Player) 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.
Title: HDCD Decoder
Post by: DigitalMan on 2010-03-18 23:50:53
List of HDCD recordings, in case it helps:

http://www.goodwinshighend.com/music/hdcd/..._recordings.htm (http://www.goodwinshighend.com/music/hdcd/hdcd_recordings.htm)

These seem fairly old - is HDCD still used often on new releases or is it similar to preemphasis in its prior use?
Title: HDCD Decoder
Post by: krabapple on 2010-03-19 04:15: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 (http://en.wikipedia.org/wiki/HDCD#Windows_Media_Player) 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 (http://www.hydrogenaudio.org/forums/index.php?showtopic=30999&view=findpost&p=516274)
Title: HDCD Decoder
Post by: 2Bdecided on 2010-03-19 14:28:16
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.
Title: HDCD Decoder
Post by: Zane on 2010-03-19 15:38:59
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 (http://www.referencerecordings.com/default.asp).

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?
Title: HDCD Decoder
Post by: a3aan on 2010-03-19 20:13:37
...
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.
Title: HDCD Decoder
Post by: Millstone on 2010-03-21 00:50:12
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.
Title: HDCD Decoder
Post by: krabapple on 2010-03-21 01:11:56
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
Title: HDCD Decoder
Post by: a3aan on 2010-03-21 11:24:00
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.
Title: HDCD Decoder
Post by: kode54 on 2010-03-21 21:18:26
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.
Title: HDCD Decoder
Post by: markanini on 2010-03-23 01:15:46
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!
Title: HDCD Decoder
Post by: Iron_Dreamer on 2010-03-25 05:06:16
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)?
Title: HDCD Decoder
Post by: kode54 on 2010-03-25 05:36:53
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.
Title: HDCD Decoder
Post by: Iron_Dreamer on 2010-03-25 06:19:10
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.
Title: HDCD Decoder
Post by: krabapple on 2010-03-28 08:54:32
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.


Mastering/level differences perhaps?  if not expectation bias?

Because for sure, not all HDCDs even use 'peak extension' (which gives them more 'dynamics' than their undecoded versions).


Quote
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)?


With HDCD decoding, HDCD tracks often are 'normalized' down in level, by as much as -6dB.  So the replaygain gain (typically a negative gain, i.e., reduction) is less drastic.

For some HDCDs, the *only* detectable change with hdcd.exe decoding is that the track level has been reduced compared to nondecoded.  This is equivalent to just turning down the playback volume.
Title: HDCD Decoder
Post by: lmancino on 2010-04-05 10:48:14
During a CD ripping (Of course the HDCD Plugin is the only DSP active) I am experiencing the silencing of the first 20  second of the tracks of the CD. If the control "Don't reset DSP between Tracks" is checked this problem affects only the first track, otherwise all the tracks have the first 20 second silenced.

The output format selected is .wav and the bit depth is 24 bit.

Thanks

Leonardo
Title: HDCD Decoder
Post by: kode54 on 2010-04-05 20:08:36
Which CD is this, or is it happening with all albums?
Title: HDCD Decoder
Post by: lmancino on 2010-04-06 10:36:35
The CD is 'TNT' by Tortoise but after your inquiry I also tried 'Sailing to Philadelphia' by Mark Knopfler with same result.
The ripping without HDCD module was regular. The playing with or without HDCD module was regular. In  ripping and playing, with HDCD module active, I received the msg 'HDCD detected' in the console.
I also tried, with same results
- both my driver (LiteOn SOHW-832S and Hitachi GD7000) with the correct offset (12 for LiteOn and 667 for Hitachi) as detected in the inquiry in Data Base
- to disinstall additional plugin (Burninate, UPNP and DVDA) to verify possible conflicts
- all the driving setup for the security (Disabled, Standard and Paranoid)
- Full speed and Limit speed

The PC processor is an Athlon XP2400 and the ram is 2GB. The setup is optimized with only 32 Task active without any antivirus active or installed
The Foobar2000 version is 1.0.1

Leonardo
Title: HDCD Decoder
Post by: kode54 on 2010-04-09 11:03:12
Version 1.3 uploaded. I changed the buffering mechanism used to prevent the decoder from applying its volume halving effect to non-HDCD material, which fixes CD ripping.
Title: HDCD Decoder
Post by: AleXH on 2010-04-15 06:03:47
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.


v1.3

But... If played 1st HDCD track, after 2nd HDCD track and seek back by 5-10 sec then hear different. Why?

May be HDCD don't detected on every automatic track change?

P.S. I'm sorry for my bad English, I speak Russian.
Title: HDCD Decoder
Post by: CarlosMC on 2010-04-18 23:21:56
I'm using hdcd 1.3 with foobar 1.0.2.1 under win7x64 and ds (wasapi doesn't work) on an alc660 chip; I disabled all other dsps and rg and I can't get any such 'hdcd detected' message someone mentioned, regardless. I tried all my hdcd rips (King Crimson, ELP, Yes - all in original 16 bit flac or ape cd image) but nada - all I can notice is the distinct background noise of unprocessed hdcds. :/

What am I doing wrong/missing?

Tx.
Title: HDCD Decoder
Post by: Zorlac on 2010-04-25 20:21:30
I'm using hdcd 1.3 with foobar 1.0.2.1 under win7x64 and ds (wasapi doesn't work) on an alc660 chip; I disabled all other dsps and rg and I can't get any such 'hdcd detected' message someone mentioned, regardless. I tried all my hdcd rips (King Crimson, ELP, Yes - all in original 16 bit flac or ape cd image) but nada - all I can notice is the distinct background noise of unprocessed hdcds. :/

What am I doing wrong/missing?

Tx.



I cant get mine to work either. My HDCD rips are .wav and Foobar reports them as 2116kbps | 44100 Hz | 16bit | stereo | PCM, but the console does not say anything about HDCD detected.

Im using Foobar 1.0.2.1, WASAPI 2.1, HDCD 1.3, Windows 7 x64 w/Sound Blaster Titanium SPDIF optical out in Audio Creation Bit Perfect output mode. 24bit set in Foobar and Windows.

Any ideas?
Title: HDCD Decoder
Post by: CarlosMC on 2010-04-26 06:54:10
Ok, so I reinstalled and now I'm getting hdcd detected.

Btw, shouldn't 'HDCD detected' show in the status bar?
Title: HDCD Decoder
Post by: Zorlac on 2010-04-26 06:59:56
Ok, so I reinstalled and now I'm getting hdcd detected.

Btw, shouldn't 'HDCD detected' show in the status bar?



What did you re-install?
Title: HDCD Decoder
Post by: Case on 2010-04-26 08:10:29
My HDCD rips are .wav and Foobar reports them as 2116kbps | 44100 Hz | 16bit | stereo | PCM

Something doesn't add up with the data you provided. 2116(.8) kbps is bitrate for 24 bit audio. That would indicate the rips are already HDCD decoded. If foobar shows you the data only has 16 bits something is wrong with the WAVs.
Title: HDCD Decoder
Post by: macross7ra on 2010-04-29 09:31:27
according to "any 16-bit PCM stream passed through it, resulting in 20-bit PCM"
So do I need to set the Playback output format to 24bits to encapsulate resulting 20-bits PCM??

thank you
Title: HDCD Decoder
Post by: HeresJohnny on 2010-05-01 12:56:36
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.


I propose a change in the foobar2000 structure, where replaygain would be taken out of the playback tab and put into a separate plugin so it can be included in a DSP chain. All post-processing before output should be done within the DSP, anyway, I don't see a reason why replaygain would be an exception. Then again, I'm no programmer, maybe other people know more.

This change would also take care of the HDCD problem because HDCD would be included at the top of the DSP chain whereas replaygain would be included at the end.
Title: HDCD Decoder
Post by: kode54 on 2010-05-01 13:06:02
I propose a change in the foobar2000 structure, where replaygain would be taken out of the playback tab and put into a separate plugin so it can be included in a DSP chain.

This change would also require all components which currently process input to include this DSP in their processing chain for any ReplayGain correction to be applied to their output.
Title: HDCD Decoder
Post by: HeresJohnny on 2010-05-01 19:48:36
This change would also require all components which currently process input to include this DSP in their processing chain for any ReplayGain correction to be applied to their output.


Agreed, and I think that's about the same amount of work than going to properties and selecting the replaygain modes. Foobar2000 already has a history of imposing beneficial changes, wouldn't say that this could be one of them?
Title: HDCD Decoder
Post by: CarlosMC on 2010-05-08 17:51:19
Ok, so I reinstalled and now I'm getting hdcd detected.

Btw, shouldn't 'HDCD detected' show in the status bar?



What did you re-install?


Foobar - removed it all and reinstalled. Don't know if it was that, but it's working, now, although not every song is detected, every time - i.e.: song 1 is, song 2 is not, song 3 is, but if I go back to 2, it is, now...
Title: HDCD Decoder
Post by: kode54 on 2010-05-09 08:48:52
It doesn't report every track change, only the first time it encounters HDCD per instance. This will be reset any time you manually change tracks.
Title: HDCD Decoder
Post by: AleXH on 2010-05-11 04:56:44
It doesn't report every track change, only the first time it encounters HDCD per instance. This will be reset any time you manually change tracks.


How I say above - sound change when seek back 2-nd played HDCD track, this equivalent to HDCD ON.

--------------------------------------------------
TEST

HARDWARE:
no importance

SOFTWARE:
WinXP SP2
Foobar2k 1.0.3

fb2k DSP:
HDCD decoder 1.3
Winamp DSP Bridge 1.4.5 [DFX 6.4]
SoX Resampler 0.5.4.1 [44.1->48kHz]

OUT:
Kernel Streaming

Playlist:
1. HDCD Track
2. HDCD Track

Action:
1. Press play 1-st track
2. Press backward

Result: sound not change

Action:
1. Press play 1-st track
2. Wait before foobar play 2-nd track more 15-20 sec
3. Press backward

Result: sound change, and equivalented without HDCD
--------------------------------------------------------------

You comments?
Title: HDCD Decoder
Post by: AleXH on 2010-05-12 12:01:02
Strange... Don't can edit my last post.

Quote
Result: sound change, and equivalented without HDCD


Write wrong - rightly: sound change, and equivalented with HDCD. Before backward sound was without HDCD.
Title: HDCD Decoder
Post by: Honeybadger on 2010-05-14 18:37:21
Hey guys!

I am running 1.0.3 of foobar2000 and the lastest version of the HDCD plugin.

I am using a reference recordings disk and confirmed it lights up the HDCD indicator in Mediaplayer11 so I know the Rom and PC work at detecting the extra bit.

THere is no indicator in Foobar(where should it show HDCD?) and it still reports 16bit when playing directly off the HDCD. the HDCD plugin is the only plugin I have enabled in DSPs.

What am I doing wrong?

Thanks!
Title: HDCD Decoder
Post by: kode54 on 2010-05-15 13:00:50
HDCD support is indicated by a message in the console. Oh, and files will never report as anything other than 16 bit, even if they are decoded properly. You have to set your output to 24 bit or greater manually.
Title: HDCD Decoder
Post by: a3aan on 2010-05-15 15:30:14
Indeed not all HDCDs seems to be leading to a 'HDCD detected' log entry. For example Midnite Vultures of Beck. All tracks have (according to hdcd.exe) only transient filter intermittently enabled (no peak and no gain).

On the other hand, Mutations by Beck, which hasn't a single HDCD feature enabled with the first 10 tracks, does report HDCD detected when playing the first track.
Title: HDCD Decoder
Post by: Honeybadger on 2010-05-15 17:41:50
HDCD support is indicated by a message in the console. Oh, and files will never report as anything other than 16 bit, even if they are decoded properly. You have to set your output to 24 bit or greater manually.


Ok, I do have it set to 24bit, where do I see this console and/or its message?
Title: HDCD Decoder
Post by: herojoker on 2010-05-15 22:26:24
View > Console
Title: HDCD Decoder
Post by: Cheung on 2010-06-26 15:06:02
HDCD support is indicated by a message in the console. Oh, and files will never report as anything other than 16 bit, even if they are decoded properly. You have to set your output to 24 bit or greater manually.


I don't have a way to select an output bit rate.  Is it because my sound card is a Creative SB X-FI?
The only modifiable options I have when I go to  Preferences / Playback / Output are:

Speakers (Creative SB X-FI) [THIS IS THE ONE IT DEFAULTED TO]
Null Output
Primary Sound Driver
SPDIF Out (Creative SB X-FI)

Then underneath that is a slider bar for Buffer Length

Underneath all the above I have a field box
that is labled Output data format but it is greyed out (can't enter anything in it)

Underneath that inacessible field box it says:
Output data format will be chosen automatically for the selected device.

How can I tell what my output bit-rate is?
Title: HDCD Decoder
Post by: Cheung on 2010-06-26 17:30:34
Okay, I made a little progress.  Found a Reset Page tab at the bottom of the Output window.  When I clicked on that it displayed my output as being 16-bit but it remained grayed over. And it still says Output data format will be chosen automatically for the selected device.


I would think that my  X-Fi Titanium Fatal1ty Pro sound card would have the capability to produce 24-bit output, no?
My whole purpose of trying to set Foobar output to 24-bit is so I can make use of the HDCD DSP plugin I installed.
Title: HDCD Decoder
Post by: Purple Monkey on 2010-06-26 19:17:48
Your OS supports 32bit Direct Sound processing so that page is disabled. Foobar passes the data still in 32bit and lets the OS make the decisions on output format.
Title: HDCD Decoder
Post by: Cheung on 2010-06-26 20:28:37
Your OS supports 32bit Direct Sound processing so that page is disabled. Foobar passes the data still in 32bit and lets the OS make the decisions on output format.
    Thank you for your prompt and clarifying reply Purple Monkey

I installed and activated the HDCD decoder plugin then downloaded some HD-CD lossless music from the Reference Recordings site.  The files were delivered in FLAC.  While the music was playing in Foobar  I went to see what was happening at View / Console and it was reporting HDCD detected.  Nice!
Title: HDCD Decoder
Post by: kode54 on 2010-07-25 21:35:06
I've updated the component to version 1.4, which now uses a new interface that requires foobar2000 1.1 or newer, beta included. It will automatically decode HDCD tracks from supported inputs, currently CDDA, WAV, FLAC, and WavPack. It will report whether the tracks contain HDCD data through an info tag, "hdcd". So you can add a $if(%__hdcd%) or $if($info(hdcd)) to your title formatting scripts to display the HDCD status of the current track.

I will add other HDCD information tags if anyone wants them. Probably just whether the current track is using peak extension and/or what the current gain level is.
Title: HDCD Decoder
Post by: Steve Forte Rio on 2010-07-25 22:24:52
And does this decoder (or postprocessor?) work for foo 1.1 converter?

Quote
you can add a $if(%__hdcd%) or $if($info(hdcd)) to your title formatting scripts to display the HDCD status of the current track.


$if(%__hdcd%) gives ""[INVALID SIF SYNTAX]", %__hdcd% gives "?", $info(hdcd) gives no text, while HDCD 1.3 shows "HDCD detected" in foobar2000 console for this track 
Title: HDCD Decoder
Post by: Yirkha on 2010-07-25 23:12:47
$if(%__hdcd%) gives ""[INVALID SIF SYNTAX]", %__hdcd% gives "?", $info(hdcd) gives no text, while HDCD 1.3 shows "HDCD detected" in foobar2000 console for this track 
"$if(%__hdcd%,HDCD ,)" or "HDCD: [%__hdcd%]" or "HDCD: $if2($info(hdcd),no" etc.
Title: HDCD Decoder
Post by: Hancoque on 2010-07-26 00:38:22
I will add other HDCD information tags if anyone wants them. Probably just whether the current track is using peak extension and/or what the current gain level is.

That would be much appreciated.
Title: HDCD Decoder
Post by: mjb2006 on 2010-07-26 08:24:03
Quote
I've updated the component to version 1.4, which now uses a new interface that requires foobar2000 1.1 or newer, beta included.


I did have foobar2000 1.0.3 installed, along with version 1.3 of foo_dsp_hdcd. I then installed fb2k 1.1 beta 1. The Components page in the Preferences shows HDCD decoder 1.3 is still installed, but when I press the 'Get updates' button, it's not telling me there's a new version of your component available. Is this expected behavior?
Title: HDCD Decoder
Post by: Steve Forte Rio on 2010-07-26 08:41:40
$if(%__hdcd%) gives ""[INVALID SIF SYNTAX]", %__hdcd% gives "?", $info(hdcd) gives no text, while HDCD 1.3 shows "HDCD detected" in foobar2000 console for this track 
"$if(%__hdcd%,HDCD ,)" or "HDCD: [%__hdcd%]" or "HDCD: $if2($info(hdcd),no" etc.


I'm adding the column to DUI playlist and what I see for my HDCD track is:


$if(%__hdcd%,HDCD ,) - no text
HDCD: [%__hdcd%] - "HDCD: "
$if2($info(hdcd),no) - "no"


But I'm sure that track has HDCD layer - it has been detected by HDCD DSP 1.3


Quote
I've updated the component to version 1.4, which now uses a new interface that requires foobar2000 1.1 or newer, beta included.


I did have foobar2000 1.0.3 installed, along with version 1.3 of foo_dsp_hdcd. I then installed fb2k 1.1 beta 1. The Components page in the Preferences shows HDCD decoder 1.3 is still installed, but when I press the 'Get updates' button, it's not telling me there's a new version of your component available. Is this expected behavior?


I think it happens because the plugins have different names (foo_dsp_hdcd and foo_hdcd)
Title: HDCD Decoder
Post by: Walrusbonzo on 2010-07-26 10:06:50
$if(%__hdcd%) gives ""[INVALID SIF SYNTAX]", %__hdcd% gives "?", $info(hdcd) gives no text, while HDCD 1.3 shows "HDCD detected" in foobar2000 console for this track 
"$if(%__hdcd%,HDCD ,)" or "HDCD: [%__hdcd%]" or "HDCD: $if2($info(hdcd),no" etc.


I'm adding the column to DUI playlist and what I see for my HDCD track is:


$if(%__hdcd%,HDCD ,) - no text
HDCD: [%__hdcd%] - "HDCD: "
$if2($info(hdcd),no) - "no"


But I'm sure that track has HDCD layer - it has been detected by HDCD DSP 1.3


This does not appear to work for the DUI columns, I have the same problem as you  Only the status/window title works with this info.

Can someone confirm that the HDCD processing is carried out before replaygain processing?
Title: HDCD Decoder
Post by: Steve Forte Rio on 2010-07-26 11:48:08
This does not appear to work for the DUI columns, I have the same problem as you  Only the status/window title works with this info.



Thank you very much! Works fine with $if(%__hdcd%, | HDCD,) in the status bar
Title: HDCD Decoder
Post by: madoka@ex-sounds on 2010-07-27 16:57:25
Question about foo_hdcd 1.4 using with foobar 1.0.3.
Does not "HDCD Scan" (at Context Menu > Util) work?

hdcd.exe reports as HDCD, but "HDCD Scan" of foo_hdcd reports blank fields...
Title: HDCD Decoder
Post by: kode54 on 2010-07-27 21:26:56
foo_hdcd requires foobar2000 1.1 or newer for the decoder to actually work, and the scanner requires that decoder to be used by inputs for it to detect anything.
Title: HDCD Decoder
Post by: madoka@ex-sounds on 2010-07-28 17:06:51
foo_hdcd requires foobar2000 1.1 or newer for the decoder to actually work, and the scanner requires that decoder to be used by inputs for it to detect anything.


Thank you very much 
I'm waiting for release of stable version 1.1 
Title: HDCD Decoder
Post by: Alex B on 2010-07-28 20:09:32
Replay Gain works now, but I think the current implementation is still a bit problematic. If the files have been measured using a standard decoder the old values are now incorrect when the files are played through the HDCD Decoder and it reduces the volume level. It is possible to reanalyze the files, but then the values will be incorrect on other players.

At least it would be nice to have an easily accessible on/off switch for HDCD decoding so that it could be switched off when mixed playlists are played and when Replay Gain is analyzed.

Here is a screenshot of the old and newly analyzed "HDCD" RG values for one album:

(http://i238.photobucket.com/albums/ff132/alexb2k/HA/HDCD.png)

EDIT

In general, HDCD decoding is rather useless when peak extension is not available. The album in the screenshot doesn't have it. Actually, only a very few of my HDCD albums seem to have it.
Title: HDCD Decoder
Post by: kode54 on 2010-07-31 02:16:22
I've added real-time HDCD info reporting, using the info variables "hdcd_gain," "hdcd_peak_extend" and "hdcd_transient filter." The latter isn't supported by this decoder, and I don't think it would be terribly useful for any decoder that doesn't upsample the output to 88200Hz or higher anyway.

Example addition to status bar formatting:
Code: [Select]
$if(%__hdcd%,' ('HDCD - pe:%__hdcd_peak_extend% tf:%__hdcd_transient_filter% gain:%__hdcd_gain%')',)
Title: HDCD Decoder
Post by: Nowings69 on 2010-07-31 08:28:50
HDCD decoder 1.5 with my Foobar2K

HDCD mode
  (http://img228.imagevenue.com/loc36/th_61002_ee_122_36lo.JPG) (http://img228.imagevenue.com/img.php?image=61002_ee_122_36lo.JPG)

  (http://img178.imagevenue.com/loc3/th_62451_dp_122_3lo.JPG) (http://img178.imagevenue.com/img.php?image=62451_dp_122_3lo.JPG)
   

Normal mode

  (http://img7.imagevenue.com/loc403/th_61646_99_122_403lo.JPG) (http://img7.imagevenue.com/img.php?image=61646_99_122_403lo.JPG)
   
   
Thank you so much
Title: HDCD Decoder
Post by: Steve Forte Rio on 2010-07-31 08:29:07
Thx.

And when it will be possible to decode HDCD from TAK source?
Title: HDCD Decoder
Post by: kode54 on 2010-08-01 02:00:34
Once the interface is finalized, and the TAK decoder component is updated to use it.
Title: HDCD Decoder
Post by: lvqcl on 2010-08-01 12:00:21
Once the interface is finalized


I think that converter interface should have an option to en/disable such components. 
Title: HDCD Decoder
Post by: n A r on 2010-08-02 09:53:45
HDCD decoder 1.5 with my Foobar2K 

Thank you so much



Hey, your config is fabulous  Would you mind sharing it ?

Best regards,

nAr
Title: HDCD Decoder
Post by: Nowings69 on 2010-08-02 13:00:11
HDCD decoder 1.5 with my Foobar2K 

Thank you so much



Hey, your config is fabulous  Would you mind sharing it ?

Best regards,

nAr



Sure

But right now

  (http://img268.imagevenue.com/loc498/th_50120_1280750120_122_498lo.jpg) (http://img268.imagevenue.com/img.php?image=50120_1280750120_122_498lo.jpg)
   

http://www.lastfm.jp/user/asajan/journal/2...r_my_foobar2000 (http://www.lastfm.jp/user/asajan/journal/2010/02/10/3eow7n_hdcd%2C_accuraterip%2C_lasrfm_mode_for_my_foobar2000)

Well,my FB2K is for HDCD,AccurateRip and LastFm right now

ttp://www.megaupload.com/?d=I38QJKFD

I know but this code

// PerSecond
$if(%__hdcd%,$imageabs(1,0,\images\HDCD.png,alpha-180),)

$if3($if(%__hdcd%,$align(right,middle)Peak extend = %__hdcd_peak_extend%$char(10) Transient filter = %__hdcd_transient_filter%$char(10) Gain = %__hdcd_gain%,),$if(%__hdcd%,$align(right,middle)Peak extend = %__hdcd_peak_extend% $char(10)  Transient filter = %__hdcd_transient_filter%$char(10) Gain = %__hdcd_gain%,),
$ifequal($len($ext(%filename_ext%)),9,$imageabs2(220,60,0,0,220,60,20,8,C:\program files\foobar2000\images\lastfm2.jpg,),

$if(%ACCURATERIPID%,$imageabs2(200,50,0,0,200,50,30,3,C:\program files\foobar2000\images\accuraterip.jpg,alpha-240)
$align(center,bottom)$if(%ACCURATERIPID%,%ACCURATERIPID%))),
$ifequal($len($info(encoding)),5,$imageabs(110,14,images\foobar2000.png,),),
$if(%isplaying%,$imageabs2(200,50,0,0,200,50,30,3,C:\program files\foobar2000\images\accuraterip.jpg,)
$align(center,bottom)disk not present in database,),)
Title: HDCD Decoder
Post by: n A r on 2010-08-02 18:26:07
Thanks very much !

Will try it ASAP

Brds,

n A r
Title: HDCD Decoder
Post by: n A r on 2010-08-03 09:03:58
I'm sorry, I tried but foobar doesn't start, error.

I'm on Windows 7 32 bit BTW. I think profile folder is not correct, I can't load any new one.

I ended up re-installing foobar2000, and I don't get the style.

Sorry, all this is off topic the hdcd decoder 

To get more on the subject, here is my formating template for implementing hdcd syntax ( foobar 1.1 beta 1 & hdcd decoder 1.5 )



Code: [Select]
%codec% | %bitrate% kbps | %samplerate% Hz | %channels% | %playback_time%[ / %length%] $if(%__hdcd%,' 'HDCD - Peak Extend: %__hdcd_peak_extend% Transient Filter: %__hdcd_transient_filter% Gain: %__hdcd_gain%' ',)


(http://img4.glowfoto.com/images/2010/08/03-0332227038M.png) (http://www.glowfoto.com/user_imageredirect.php?iid=3516075)

brds,

n A r
Title: HDCD Decoder
Post by: marktherob2001 on 2010-08-04 01:47:18
How do I simply identify if a song has HDCD encoded as DTS does? in the status bar? Where do you put this code?
Title: HDCD Decoder
Post by: n A r on 2010-08-04 08:09:20


Yes, it's status bar shown and it's status bar formating 
Title: HDCD Decoder
Post by: mundschuss on 2010-08-04 11:37:31
so, i dont get it. i switched the output of foobar 1.1 beta 2 to 24 bit, used a HDCD (tool - lateralus) and check with utilities for HDCD, he detected for every song a HDCD track. but when i playback it nothing changes, and nothing stands in the console.

im trying right now with the "old" version of foobar and the old plugin to playback some tracks. it would be cool if there would be still a DSP plugin for foobar because it is also cool to have the actual 20 bit file on the drive IMO (for DAW or so, so you can burn e.g. a 24bit DVD so you can listen to it over realy good equipment if you dont have a HDCD player)

seeya

edit: worked with the old plugin in the old foobar now, will check if i receive full 20 bit files with a bitmeter
Title: HDCD Decoder
Post by: johnsonlam on 2010-08-04 12:03:29
Is the HDCD decoder working?

I test with "BeeGees-This is where I came in" but Foobar2000 did show nothing in the HDCD Scan Results window, tried both TAK  compressed file and the Audio CD.

The latest HDCD decoder seems integrated into Foobar and no more a DSP, how can I know it's working correct?

Tested another "HDCD Sampler Volume 2" still nothing shown ...
Title: HDCD Decoder
Post by: n A r on 2010-08-04 12:17:05
Is the HDCD decoder working?

I test with "BeeGees-This is where I came in" but Foobar2000 did show nothing in the HDCD Scan Results window, tried both TAK  compressed file and the Audio CD.

The latest HDCD decoder seems integrated into Foobar and no more a DSP, how can I know it's working correct?

Tested another "HDCD Sampler Volume 2" still nothing shown ...

I use Kari Bremnes with the Svarta Bjorn CD ripped to flac by EAC in secure mode. With latest foobar beta and hdcd 1.5 + the status bar formating, I get a correct info about hdcd files.

Hope it helps,

n A r
Title: HDCD Decoder
Post by: johnsonlam on 2010-08-04 12:29:07
I use Kari Bremnes with the Svarta Bjorn CD ripped to flac by EAC in secure mode. With latest foobar beta and hdcd 1.5 + the status bar formating, I get a correct info about hdcd files.


Thanks for your information, will try that.
Title: HDCD Decoder
Post by: herojoker on 2010-08-04 12:31:23
Have you actually read the thread?

Steve Forte Rio said: And when it will be possible to decode HDCD from TAK source?
kode54 answered: Once the interface is finalized, and the TAK decoder component is updated to use it.
Title: HDCD Decoder
Post by: mundschuss on 2010-08-04 12:49:47
EAC-Ripped once again my lateralus copy (by tool) with perfect settings. HDCD was detected during playback and during enbcoding (just used HDCD as DSP and created a 24 bit file.

Quote
CLI encoder: flac.exe
Destination file: O:\Musik\Tool\2001 - Lateralus\Tool\2001 - Lateralus\09 - Lateralus.flac
HDCD detected.
Encoder stream format: 44100Hz / 2ch / 24bps
Command line: "C:\Programme\FLAC\flac.exe" -s --ignore-chunk-sizes -8 - -o "09 - Lateralus.flac"
Working folder: O:\Musik\Tool\2001 - Lateralus\Tool\2001 - Lateralus\
Encoder process still running, waiting...
Encoder process terminated cleanly.
Track converted successfully.


and checked in wavelab 6 with cakewalk bitlevel while encoding the 24bit flacs back to 24 bit wavs (shouldnt be a problem, right?)

so, see here the results:

first one, the original EAC-FLAC, converted as 24bit wav:
(http://img203.imageshack.us/img203/8431/02lat16.jpg) (http://img203.imageshack.us/i/02lat16.jpg/)

as you see, theres no information on the section from 16 to 24 bit, as expected because its only 16 bit (even if its a 24 bit file)


so, lets try the same with the HDCD encoded file (as 24bit wave). remember, it was HDCD detected, even on the encoding process.

(http://img844.imageshack.us/img844/3408/03lat24.jpg) (http://img844.imageshack.us/i/03lat24.jpg/)

so, you can see, there is no difference in the bitmeter, the range between 16 and 20 bit is still empty. the only thing is this version is around 6dB quieter then the EAC FLAC.


and thats what a 24 bit file looks like (Discipline by Nine Inch Nails, from their album The Slip, 24/96 version)

(http://img194.imageshack.us/img194/1214/01discipline.jpg) (http://img194.imageshack.us/i/01discipline.jpg/)


so, whats wrong?
Title: HDCD Decoder
Post by: n A r on 2010-08-04 13:10:01
The ripped .wav or even encoded in .flac by EAC keeps the hdcd tag in least significant bit.
For convenience I stock flac files only. So whenever I want to get the real 20-24 bit file (depends of original encoding anyways),
I use eac3to which outputs me correct full 24 bit wavs, even if often the first 20 bits are used (4 bits empty as padding I guess).

I'll try to grab a copy of the said wav file decoded in more than 16 bits definition running in Wavelab 6 this evening with the bits window open

Brds,

nAr
Title: HDCD Decoder
Post by: mundschuss on 2010-08-04 13:29:44
tried it now with eac3to and still the same problem...

eac3to log:
Quote
eac3to v3.22
command line: C:\eac3to\eac3to.exe "C:\01 - The Grudge.flac" "C:\01test.wav" -decodeHdcd
------------------------------------------------------------------------------
FLAC, 2.0 channels, 0:08:36, 16 bits <HDCD>, 865kbps, 44.1kHz
Decoding FLAC...
Writing WAV...
Decoding HDCD information...
Creating file "C:\01test.wav"...
Original audio track: max 20 bits, average 17 bits, most common 17 bits.
eac3to processing took 15 seconds.
Done.


will try another HDCD, maybe tool failed on this one.

seeya
Title: HDCD Decoder
Post by: mundschuss on 2010-08-04 13:44:31
worked with mark knopfler's sailing to philadelphia with eac3to...so it seems that the tool CD failed at mastering, but it has the HDCD logo on it and it is detected as 16 bit.

thats the picture from speedway at naazarteh:
[a href="http://img836.imageshack.us/i/04phil.jpg/" target="_blank"]

yay

edit: you can already see it at the filesize: the tool record was only increased by 2kbps, the mark knopfler record increased over 100kbps which is quiet ok for 20 bit.

seeya
Title: HDCD Decoder
Post by: johnsonlam on 2010-08-04 18:26:33
Have you actually read the thread?

Steve Forte Rio said: And when it will be possible to decode HDCD from TAK source?
kode54 answered: Once the interface is finalized, and the TAK decoder component is updated to use it.


Thanks for your bitter question, I've read the thread, but this is too long and I'm waiting for nice guys to show me directly.

I know TAK is not ready, that's why I put the Audio CD in the drive and test, and I'm quite surprise Foobar2000 v1.0.3 HDCD scan is nothing, then I upgraded to the latest v1.1 beta2 but still got nothing, then I tried rip from Foobar2000, and scan the WAV, still nothing ...

I left the PC alone and went out several hours, come back and test again, this time the scan result of Audio CD finally display the track was HDCD encoded, but ripped WAV still none ...

At last, I downloaded the latest EAC (I didn't use it for 2 years), and now I got the correct scan result, this proof that the Foobar2000's built-in ripping is NOT accurate.

Next question (sorry I really don't know), if I converted the HDCD WAV to FLAC or TAK with Foobar2000, will the HDCD content become decoded and I can use other players to play the converted FLAC with HDCD effect?

Thanks, really appreciate those nice people replied.
Title: HDCD Decoder
Post by: kode54 on 2010-08-04 21:18:46
HDCD doesn't magically add bit precision. If, like the Tool - Lateralus album, none of the HDCD features are used, then the only result of passing it through a HDCD decoder will be a 6dB reduction in volume. The only way to actually increase the bit precision in any way is to use the peak extension feature, or the gain reduction feature. And even then, it's not perfect.

I suppose it should also be possible to apply a low pass filter to the least significant bit dithering, to somehow simulate higher bit depth, but that seems kind of silly.

Also, reminding everyone again since we're on a new page, this new version only works with foobar2000 version 1.1, beta 1 or newer.
Title: HDCD Decoder
Post by: mundschuss on 2010-08-04 23:23:27
the problem seems to be that the HDCD.exe thing thats everyone using does not seem to work for some albums, such as lateralus.

Quote
The problem is that Lateralus uses HDCD features we don't know about; they are hidden away in patents and proprietary software, and the guy who implemented hdcd.exe could only go off the two publicly released algorithms.


seeya
Title: HDCD Decoder
Post by: kode54 on 2010-08-05 01:26:27
I modified the hdcd decoder a bit to collect some statistics, and also designed a simple console application which takes assumed stereo WAV files, skips the header, and parses only the left channel through the decoder, to detect present features. It had this to say:

Code: [Select]
Tool - Lateralus.wav: HDCD (packets(47284 / 47284) gain(-4.0 dB / 0.0 dB))


47284 detected HDCD packet headers (01111100000111111000000b sequence output from LFSR, most significant bit first) and 47284 of those resulting in a status byte being read from the input data. The status byte has room for the gain level (low 4 bits, range 0-15 translating to 0.0 ... -7.5 dB) and four feature bits. Two of the feature bits are known, peak extension and transient filter. Only the peak extension feature is supported by the decoder disassembled from WMP. Although, as you can see from the output of my testing tool, no feature bits are used at all. From playing the album, you can see that -4.0 dB gain being applied to the first few HDCD packets, then it shifts up to 0.0 dB for the rest of the album.

I uploaded the tool source code here (http://kode54.foobar2000.org/hdcd_test.tar.bz2), so you may repeat the results yourself. If anyone cares, I could also add a proper WAV parser, but there's not much point since it already served its purpose.
Title: HDCD Decoder
Post by: johnsonlam on 2010-08-05 03:30:20
Also, reminding everyone again since we're on a new page, this new version only works with foobar2000 version 1.1, beta 1 or newer.


This is the critical message since I found nothing in the documentation area.

Is it possible to let Foobar2000 pop up a window or dialog to let user know the file was HDCD encoded?
Or any variable like "%__replaygain_track_gain%" so I can display on the columns?

Thanks.
Title: HDCD Decoder
Post by: n A r on 2010-08-05 07:13:09
47284 detected HDCD packet headers (01111100000111111000000b sequence output from LFSR, most significant bit first) and 47284 of those resulting in a status byte being read from the input data. The status byte has room for the gain level (low 4 bits, range 0-15 translating to 0.0 ... -7.5 dB) and four feature bits. Two of the feature bits are known, peak extension and transient filter. Only the peak extension feature is supported by the decoder disassembled from WMP. Although, as you can see from the output of my testing tool, no feature bits are used at all. From playing the album, you can see that -4.0 dB gain being applied to the first few HDCD packets, then it shifts up to 0.0 dB for the rest of the album.



Thanks for clarifying

n A r
Title: HDCD Decoder
Post by: herojoker on 2010-08-05 09:00:16
@johnsonlam: Read the previous pages in this topic, it names the variable.
Title: HDCD Decoder
Post by: johnsonlam on 2010-08-05 14:27:29
@johnsonlam: Read the previous pages in this topic, it names the variable.


Thank you, someone should help rewrite it and put into the documentation.
If my English is better ...
Title: HDCD Decoder
Post by: Rollin on 2010-08-07 13:54:35
Is foo_hdcd 1.5 working in converter?
Title: HDCD Decoder
Post by: lvqcl on 2010-08-07 14:51:30
Is foo_hdcd 1.5 working in converter?


I think that HDCD processing should be enabled for wav->mp3 conversion and disabled for wav->flac conversion, but how to achieve this? 
Title: HDCD Decoder
Post by: Rollin on 2010-08-07 17:15:26
I think that HDCD processing should be enabled for wav->mp3 conversion and disabled for wav->flac conversion

I'm interested only in conversion HDCD to 24-bit lossless, not to lossy.
I tried to convert HDCD wav to 24-bit wav and got files with real 20 bit. Now I know foo_dsp works in converter too

But what about applying HDCD transient filter and gain info on conversion? Is it applying or not?
Title: HDCD Decoder
Post by: kode54 on 2010-08-07 19:32:51
Only gain and peak extension are applied. Transient filter is not supported, as there is no reference software to base the filter on. Besides which, the transient filter is really only useful if you're also upsampling the output to 88200Hz, or at least so I've heard.
Title: HDCD Decoder
Post by: Nowings69 on 2010-08-09 08:40:31
Is foo_hdcd 1.5 working in converter?


No (to me,try to wav)

I use CUETools with EAC log(means disc id ,,,)

I think FB2K?beta have so many problem?for conversion and  decoding,
if they are 3d party
Title: HDCD Decoder
Post by: kode54 on 2010-08-09 20:01:52
foo_hdcd 1.5 does work in the converter, but you must manually set the lossless conversion bit depth to 24.

Of course, if foo_hdcd 1.5 is installed and you use foobar2000 to rip the CD, the HDCD information will be decoded during the ripping process.
Title: HDCD Decoder
Post by: jimmanningjr on 2010-08-15 18:23:29
Hey Guys, Esp. Kode, 
I have been keeping up with THIS Forum since before the 1.5 update.
I happen to have a ton of Flac encoded HdCd's mostly Grateful Dead. At first i was lost as the update didnot write anything in the Console. using This:

$if(%album artist% - ,%album artist% - ,)$if(%title%,%title%,)    $if(%__hdcd%,<HDCD>,) $if(%__tool% - ,%__tool% - ,)$if(%codec%[ / %__codec_profile%],%codec% [ / %__codec_profile%],) $if(<%bitrate%kbps>,<%bitrate%kbps>,) $if(%__samplerate% Hz,%__samplerate% Hz,) $if(  %__bitspersample% Bit, %__bitspersample% Bit,) $if( $info(channels) Ch , $info(channels) Ch,) $if(  <First played :%first_played%,  < First played : %first_played%,)  $if( - Last played : %last_played% > ,- Last played : %last_played% > ,)   

  I get it to display just fine. I too use EAC. for most of my rips...but...If I want to use Foobar to rip HDCD's I must either remove the component or manually name to foo_hdcd.dll.OFF....Is there not a way to use a switch that then can be made into a button or am I asking to much...  I have only been using Foobar for 6 months...I still use Media Monkey to sort my music after it is ripped...But i am loving this foobar much...I have learned alot by downloading other peoples setups ,taking them apart piece by piece...Thats how I got into reading and writing CODE Foobar is soooooo customizable..I just thought there may be a way to make a switch..maybe for 1.6????Thanks for having me in this great community Peace,Jimmanningjr
Title: HDCD Decoder
Post by: jimmanningjr on 2010-08-15 18:42:07
HDCD decoder 1.5 with my Foobar2K 

Thank you so much



Hey, your config is fabulous  Would you mind sharing it ?

Best regards,

nAr



Sure

But right now

  [a href="http://img268.imagevenue.com/img.php?image=50120_1280750120_122_498lo.jpg" target="_blank"]    Downloading you foobar setup has increased my knowledge a hundredfold.
Title: HDCD Decoder
Post by: kode54 on 2010-08-15 19:44:44
If I want to use Foobar to rip HDCD's I must either remove the component or manually name to foo_hdcd.dll.OFF....Is there not a way to use a switch that then can be made into a button or am I asking to much...

The converter bundled with foobar2000 1.1 beta 3 and newer includes a switch for these processors. You can toggle that in your ripping preset.
Title: HDCD Decoder
Post by: jimmanningjr on 2010-08-16 06:30:17
If I want to use Foobar to rip HDCD's I must either remove the component or manually name to foo_hdcd.dll.OFF....Is there not a way to use a switch that then can be made into a button or am I asking to much...

The converter bundled with foobar2000 1.1 beta 3 and newer includes a switch for these processors. You can toggle that in your ripping preset.

Thanks so much for the tip...I was surprised at how fast you got back to me thanks again!!!!! 
Title: HDCD Decoder
Post by: JackieKu on 2010-08-24 04:19:09
Hello,

Is hybrid WavPack supported? I can't see "Scan for HDCD tracks" for those files, though.
Title: HDCD Decoder
Post by: kode54 on 2010-08-24 06:35:05
Hello,

Is hybrid WavPack supported? I can't see "Scan for HDCD tracks" for those files, though.

Probably reports an encoding type of "lossy" even when the correction data is present.
Title: HDCD Decoder
Post by: JackieKu on 2010-08-24 14:21:32
Probably reports an encoding type of "lossy" even when the correction data is present.

Don't know if it's related, but %__encoding% reports "hybrid".
Title: HDCD Decoder
Post by: kode54 on 2010-08-24 21:06:49
Yes, this processor, like the DTS processor, only works for encoding of "lossless." I will change it to also support "hybrid" but of course it won't work if the correction data is missing.
Title: HDCD Decoder
Post by: chuuey on 2010-08-25 09:09:14
nice plugin
Title: HDCD Decoder
Post by: Nowings69 on 2010-08-26 01:18:40
Without @ jimmanningjr
So he is my friend

Try this
(http://img43.imagevenue.com/loc214/th_81783_jjjjj_122_214lo.JPG) (http://img43.imagevenue.com/img.php?image=81783_jjjjj_122_214lo.JPG)
   
http://www.lastfm.jp/user/asajan/journal/2...w_to_do_my_fb2k (http://www.lastfm.jp/user/asajan/journal/2010/08/23/3v397m_%28825%29how_to_do_my_fb2k)
Title: HDCD Decoder
Post by: GeSomeone on 2010-08-27 13:24:18
I will change it to also support "hybrid" but of course it won't work if the correction data is missing.

Doesn't this produce unwanted side effect like different replaygain values? Restricting to only lossless seems like good sense to me.

edit: sorry my first reaction was about DTS
Title: HDCD Decoder
Post by: kode54 on 2010-08-27 21:12:50
Yes, it will have a different volume level if the recovery file is removed, since the HDCD information will no longer be present.
Title: HDCD Decoder
Post by: bryant on 2010-08-29 19:16:11
Yes, this processor, like the DTS processor, only works for encoding of "lossless." I will change it to also support "hybrid" but of course it won't work if the correction data is missing.

Having it support "hybrid" should work fine in most cases. I can imagine a scenario with a high lossy bitrate where the HDCD would be triggered during quiet passages causing the HDCD decoding to flip on and off (if the decoder works the same way that hardware ones do). I actually considered a mode for HDCD that would preserve the LSB even in the lossy mode (or warn people when they lossy encoded an HDCD track), but decided that was silly.

One solution would be if foobar reported the hybrid mode as either "hybrid lossy" or "hybrid lossless" (then the plugin could just search for "lossless" in the encoding), but that might not fit well for formatting in other areas.

BTW, thanks for making this available...it's very cool! 

David
Title: HDCD Decoder
Post by: kode54 on 2010-08-29 19:26:57
I don't expect the lossy data to actually trigger it. It uses a fairly secure LFSR, where the least significant bit is shifted into one register, then three bits from that register are XOR'd together and shifted into a second register. Then the 24 least significant bits in that register are compared against a sequence of 01111100000111111000000. And even then, the 16 or 24 bits that follow that sequence must indicate a valid command sequence. Likelihood is probably quite low that a semi-random sequence of bits could trigger it.

(The source is on my site if anyone is interested.)
Title: HDCD Decoder
Post by: bryant on 2010-08-29 21:47:04
Oh, that's not what I meant. I agree, lossy audio is exactly as likely to falsely trigger it as regular non-HDCD audio CDs, which is essentially never.

What I meant was HDCD audio using high bitrate lossy encoding (like 384+ kbps). During very quiet passages that can be perfectly lossless for many seconds at a stretch.
Title: HDCD Decoder
Post by: kode54 on 2010-08-30 01:37:44
Oh. My mistake then.

Well, my decoder also gives up if it fails to find a HDCD packet during the first 5 seconds of each track. That may help as well.
Title: HDCD Decoder
Post by: bryant on 2010-08-30 14:27:01
Yes, that should be fine then.

I have experimented with a hardware decoder and it would flip on and off (with the corresponding level change) in this situation, which would obviously be unacceptable.
Title: HDCD Decoder
Post by: The Observer on 2010-08-30 19:17:26
Forgive my ignorance in advance. I have installed foo_hdcd (version 1.5) and am using foobar2000 v1.1 stable. The HDCD scanner utility has picked out an album that is HDCD encoded -- The Pet Sounds Sessions -- but when I play it, there is no indication that has decoded the HDCD information, either in the console or in the status bar where I placed the little notification. My output is set to 'DS: Speakers (Realtek High Definition Audio)' with a buffer length of 1,300 ms. The output format cannot be altered from within foobar and is ostensibly controlled elsewhere as it is greyed out. Am I missing something crucial or what? (For the record, HDCD decoding also did not work when my sound device was WASAPI rather than DS.) Sorry for this probably rehashed-a-million-times question!
Title: HDCD Decoder
Post by: kode54 on 2010-08-30 20:11:26
What format are the tracks stored as? Did you have PCM processing turned on when you used the foobar2000 CD ripper? If so, the HDCD information was already decoded before the files were encoded to the target format.
Title: HDCD Decoder
Post by: The Observer on 2010-08-30 20:18:45
They're in FLAC format. They were ripped not with foobar but with EAC. Would the HDCD information have been decoded already before encoding to FLAC there as well? (That is how all my CDs are ripped, HDCD or otherwise.)
Title: HDCD Decoder
Post by: kode54 on 2010-08-30 22:06:32
Ah, no. Those FLACs should still contain HDCD information, and the %__hdcd% info tag should be showing as much in the status bar. (Or in the playlist, if you have a playlist view that updates with dynamic metadata.)
Title: HDCD Decoder
Post by: The Observer on 2010-08-30 23:21:16
It also doesn't seem to matter whether I leave the ReplayGain info tagged or not (although I understand, if I'm not mistaken, that it works only sans RG info). I also don't use DSPs or anything else that might alter the processing chain as far as I know...
Title: HDCD Decoder
Post by: kode54 on 2010-08-31 01:12:25
With 1.5, DSPs and ReplayGain do not matter.

Does a WAV decoded from that FLAC set show any useful results with hdcd.exe?
Title: HDCD Decoder
Post by: The Observer on 2010-08-31 03:20:16
I used hdcd.exe (version 0.2; command line: 'hdcd.exe -i file.wav') to check whether four tracks were in fact HDCD encoded. The results were all negative in hdcd.exe despite the fact that foobar's internal HDCD scanner suggested otherwise. The tracks were:

"Meet Me In My Dreams Tonight" from Brian Wilson {2000 Rhino remaster};
"Wouldn't It Be Nice" [stereo backing track] from Pet Sounds Sessions;
"Conversation" by Joni Mitchell; and,
"Big Mama's Door" by Alvin Youngblood Hart.

I'm not sure what's up with that?
Title: HDCD Decoder
Post by: HammerSandwich on 2010-08-31 16:47:03
I can't get the decoder installed.  It appears correctly under Components but is not listed in the DSP Manager.  This is with 1.1 stable.
Title: HDCD Decoder
Post by: kode54 on 2010-08-31 20:10:53
Version 1.5 is no longer a DSP, so it won't appear in the DSP manager.
Title: HDCD Decoder
Post by: HammerSandwich on 2010-09-01 01:04:25
I get it now.  It's been in & working, but I'd been checking in the console rather than adding the HDCD indicator to my status bar.  Probably not a bad idea to refresh the docs/first post for the latest version.
Title: HDCD Decoder
Post by: Nowings69 on 2010-09-01 13:51:07
(http://img207.imagevenue.com/loc478/th_41066_2_122_478lo.JPG) (http://img207.imagevenue.com/img.php?image=41066_2_122_478lo.JPG)

My new HDCD.png

ttp://www.megaupload.com/?d=FCIU7VOO
Title: HDCD Decoder
Post by: kumbbl on 2010-09-02 11:26:26
Version 1.5 is no longer a DSP, so it won't appear in the DSP manager.


I'm using Foobar 1.1 and hdcd-decoder 1.5 - well, i have understood, that it is not a DSP and therefore not listed in the DSP-list... I assume i have to enable the checkbox "enable decode postprocessing - for decoding DTS, HDCD etc...." in the Processing-Folder in the Converter-dialog, right?

But: Is there anything else to do to switch on this hdcd-processor? Sorry for a maybe dump question but what does this checkbox do? is this documented anywhere? Must i be aware about replay gain provessing as mentioned at the beginning of this thread...

Sorry again for maybe foolish questions, but aftre reading this thread i'm currently slightly confused what is now exactly to do in Foobar 1.1 with hdcd 1.5 to decode HDCD-encoded files correctly and to pass through "normal" (ie. no HDCD-encoding) audio-files?

Thanks a lot of in advance!



Title: HDCD Decoder
Post by: Yirkha on 2010-09-02 11:39:45
Playback: file -> decoder -> HDCD postprocessor -> replaygain -> DSPs (if enabled) -> soundcard.
Converter: file -> decoder -> HDCD posprocessor (if that checkbox is enabled) -> replaygain (if enabled) -> DSPs (if enabled) -> encoder -> ...
Title: HDCD Decoder
Post by: kumbbl on 2010-09-02 12:07:25
Playback: file -> decoder -> HDCD postprocessor -> replaygain -> DSPs (if enabled) -> soundcard.
Converter: file -> decoder -> HDCD posprocessor (if that checkbox is enabled) -> replaygain (if enabled) -> DSPs (if enabled) -> encoder -> ...


ah, thanks! If i understand you right then for Playback there is nothing to do (if the hdcd 1.5 ist installed) - HDCD-encoded files will be automatically encoded and others will be passed through
And for converting the only thing to do is to enable this checkbox...

may i ask you a concret example? well, here it is:

1. There is a flac-file xxx.flac from a HDCD-encoded CD, replay-gain-scanned after ripping with a track-gain-value of -1.79 - Ripping has been done wit Foobar 1.1 but BEFORE hdcd-decoder has been installed!)

In the playback preferences of foobar 1.1 i have set:
replaygain source-mode: track, processing: apply gain
Preamp: with RG-info: +5 db (94 db), without RG-info: 0 db

Now after installing hdcd 1.5:

2. I have concerted xxx.flac with the folling settings: Output-format: flac, 24 bit, Processing: hdcd-checkbox enabled, no DSPs, no Replay-Gain, Others: Replay-Gain scan output as albums
    result: xxx-converted.flac

3. then i have two files:
xxx.flac with this properties: trackgain: -1.79, track-peak: 0.90, HDCD:yes
xxx-converted.flac with this properties trackgain: +4.23, track-peak: 0.45, HDCD:no

4. Now playback of both files with above mentioned RG- and preamp-Preferenecs: xxx-converted.flac sounds much louder the the original xxx.flac - but the RG-values would indicate the opposite behaviour... i do not understand this...

Could anybody please explain me points 3 and 4? This would be very nice!

Thanks a lot in advance!
Title: HDCD Decoder
Post by: Alex B on 2010-09-02 15:27:23
You would need to re-analyze the old files. The old replay gain values are not correct when the files are decoded with the HDCD decoder.

I am quoting my old reply, because the problem is still persistent:

Replay Gain works now, but I think the current implementation is still a bit problematic. If the files have been measured using a standard decoder the old values are now incorrect when the files are played through the HDCD Decoder and it reduces the volume level. It is possible to reanalyze the files, but then the values will be incorrect on other players.

At least it would be nice to have an easily accessible on/off switch for HDCD decoding so that it could be switched off when mixed playlists are played and when Replay Gain is analyzed.

Here is a screenshot of the old and newly analyzed "HDCD" RG values for one album:

(http://i238.photobucket.com/albums/ff132/alexb2k/HA/HDCD.png)
...

We have now a switch in the converter, but that does not help if the user sometimes wants to switch HDCD off when the files are played or if the user wants to analyze and store replay gain tags that are correct on any "non-HDCD" player.
Title: HDCD Decoder
Post by: kode54 on 2010-09-02 19:09:32
I may add an option to boost the gain of HDCD decoded material by 6dB, even if that would push peaks of peak extended material up to 1.5. It has come to my attention that there are a number of places where this would be necessary, such as albums where only a few tracks are HDCD encoded, which would possibly throw off the album gain level.
Title: HDCD Decoder
Post by: Alex B on 2010-09-02 21:01:44
I think +6 db would be correct only when peak extension is not used.

After I posted my reply in July I have checked about two thousand albums and found about 25 HDCDs. Only three or four of them use  peak extension, but when it is used the measured replay gain values seem to differ less than 6 dB when compared with "non-HDCD" decoding. A bit surprisingly some of the HDCD albums don't have any indication of the HDCD encoding in the printed artwork.

And you are correct about albums that contain only some HDCD encoded tracks, I found a few such albums.
Title: HDCD Decoder
Post by: eevan on 2010-09-05 21:06:07
I rip my CDs to disc images with tracks referenced by apl files. I noticed this with EAC ripped FLAC images of a few HDCD disks that I have.
When I play the track (apl file), HDCD postprocessor doesn't report HDCD (%__hdcd% variable returns ?) but processing is in fact done (because the level is 6 dB lower. For the test, I converted the image to TAK format so the postprocessor can't decode it, and peaks are then near 0 dB). If I load the cuesheet instead, I get values for all variables. Also, 'Scan for HDCD tracks' works with the image itself and with the cuesheet loaded tracks, but not with apl referenced tracks.
It's not annoying, I just wanted to report

Cheers!
Title: HDCD Decoder
Post by: Orion25 on 2010-09-06 23:35:51
kode54, thanks for this long waited component!
It would be excellent, if HDCD decoder would work with Monkey's Audio source. When it will be possible?
Title: HDCD Decoder
Post by: kode54 on 2010-09-06 23:54:25
kode54, thanks for this long waited component!
It would be excellent, if HDCD decoder would work with Monkey's Audio source. When it will be possible?

As soon as Peter updates the Monkey's Audio component.
Title: HDCD Decoder
Post by: GeSomeone on 2010-09-07 12:33:38
albums where only a few tracks are HDCD encoded...

  What happens when these are played on a HW player that supports HDCD?
Besides the fact that I have very few CD with HDCD, that I'm aware of, it's these kind of issues (like -6dB) that make me stay away of using HDCD decoding.
+6 dB (compensating or not applying the -6dB) seems to solve most issues, and after applying replaygain the peaks would be at about the same level anyway. (those can be taken care of by the advanced limiter or clip preventing settings in replaygain as usual).
Title: HDCD Decoder
Post by: Alex B on 2010-09-07 13:26:31
What happens when these are played on a HW player that supports HDCD?

The listener would probably reach the volume knob or press the volume buttons on the remote to compensate if the HDCD tracks are too quiet. 

AFAIK, if those tracks don't contain peak extension they will just be 6 dB quieter than the other tracks if you compare the output to standard decoding. If they contain peak extension the perceived volume level difference may be more or less different.

I am going to post a detailed analysis of the albums in my collection that have peak extension and also report the albums that have only some HDCD tracks. I have not yet decided if I am going to post it here, to the recent HDCD thread on the CD Hardware/Software forum: http://www.hydrogenaudio.org/forums/index....showtopic=83028 (http://www.hydrogenaudio.org/forums/index.php?showtopic=83028), or to a new thread somewhere.
Title: HDCD Decoder
Post by: Honeybadger on 2010-09-12 22:29:14
Ok, I admit it...I am completely lost, HELP!

I am now running 1.1 and removed the HDCD plugin 1.3 and put in 1.5

I see it in my plug-in list, it is greyed out meaning loaded.

I have a ton of HDCDs, Reference Recodings and others. I put in one of the discs and it just shows at 16bit so I don't know if it's decoding right.

I've looked for file/decoder...etc, I can't find the right menu/area for this...

Also how do I load the HDCD png into my Foobar2000?

I know these are probably simple questions but I can't find anything be a Google search so if someone can give me a step-by-step to rub my nose in it, it would be appreciated!!
Title: HDCD Decoder
Post by: Alex B on 2010-09-13 18:52:29
HDCD decoding should be enabled automatically if the HDCD decoder is placed in the components folder. The bit depth value in file properties does not show the bit depth of the decoded audio signal.

When the component is installed you can select the files and do "right-click > Utilities > Scan for HDCD tracks". It will show the scan results in a new window.

You can add a HDCD column to playlists and a HDCD status text to the Status Bar:

(http://i224.photobucket.com/albums/dd212/AB2K/ha/nimrod.png)

I use this code for the HDCD column (in Columns UI):
Code: [Select]
$if(%__hdcd%,HDCD ,)

and this for the status line:
Code: [Select]
$if(%ispaused%,Paused,Playing) | %codec% | %bitrate% kbps | %samplerate% Hz | $caps(%channels%) | %playback_time%[ / %length%][ |$if(%__hdcd%,' 'HDCD '('gain: %__hdcd_gain%',' peak extension: %__hdcd_peak_extend%')',)]

The HDCD status will be displayed during playback.

Perhaps someone else can help you with "HDCD png".
Title: HDCD Decoder
Post by: Honeybadger on 2010-09-13 20:16:12
Wow Alex,

Thank you very much for your reply, time and expertise! They are very appreciated!

This will also work when I just put a HDCD disk into my CD/DVD tray and not just when I rip them, right?

Also I noticed that the displays of other HDCD desktops shows HDCD logo lighting up then they played HDCD.

How do I enable that?

Thanks again!
Title: HDCD Decoder
Post by: Honeybadger on 2010-09-13 23:43:44
Wow Alex,

Thank you very much for your reply, time and expertise! They are very appreciated!

This will also work when I just put a HDCD disk into my CD/DVD tray and not just when I rip them, right?

Also I noticed that the displays of other HDCD desktops shows HDCD logo lighting up then they played HDCD.

How do I enable that?

Thanks again!


Ok, I got the track list to say HDCD, how do I get a status area to say it...

I am trying to figure out the panel add in FB2k but I think a nice theme would be awesome!
Title: HDCD Decoder
Post by: -Richy- on 2010-09-15 01:36:57
Please Peter: Update the Monkey's Audio component that the HDCD decoder would work with Monkey's Audio source.
Title: HDCD Decoder
Post by: Glenda on 2010-09-19 13:22:49
What if we have a DAC that decodes HDCD,  how do we disable this v1.5 ?
Title: HDCD Decoder
Post by: eevan on 2010-09-19 16:53:20
Simply remove foo_hdcd folder (and dll inside it) it from your user-components folder.
Use shift+click on File menu in foobar and click Browse configuration folder if you don't know its location.

I'm assuming you use foobar2000 v1.1.
Title: HDCD Decoder
Post by: kode54 on 2010-09-19 21:03:56
Or use the components page of the configuration dialog to remove it.
Title: HDCD Decoder
Post by: Honeybadger on 2010-09-19 23:41:13
Ok, figured out where the playing and status scripts go..

They are lighting  up with HDCDs, YAY!

They are not lighting up with my FLAKs ripped from HDCDs.

I am using DBPowerAMP r14 with the HDCD plugin, it is producing 24bit files compared to my non-HDCDs that are producing 16bit files so the data is getting processed.

What am I doing wrong?
Title: HDCD Decoder
Post by: herojoker on 2010-09-20 00:04:02
The 24bit audio is the result of applying the HDCD data to the 16bit audio stream. AFAIK it's impossible to detect whether 24bit audio came from a 16bit+HDCD source.
Therefore you are doing nothing wrong. It's your choice whether you want to apply the HDCD transformations at real time (16bit in, 24bit out) or save the result and have a 24bit file.
Title: HDCD Decoder
Post by: Honeybadger on 2010-09-20 02:44:33
The 24bit audio is the result of applying the HDCD data to the 16bit audio stream. AFAIK it's impossible to detect whether 24bit audio came from a 16bit+HDCD source.
Therefore you are doing nothing wrong. It's your choice whether you want to apply the HDCD transformations at real time (16bit in, 24bit out) or save the result and have a 24bit file.


Ok, cool thanks, means I don't have to re-rip the already done CDs.. What methodogy do I use to get a FLAC file that still "lights" up the HDCD?
Title: HDCD Decoder
Post by: kode54 on 2010-09-20 02:58:25
Ripping it without using the HDCD decoder plug-in. I'm not sure how to do that with dbpa, but with foobar2000, you just need to find and disable the PCM postprocessing feature in the converter dialog.
Title: HDCD Decoder
Post by: herojoker on 2010-09-20 04:26:33
And if you just want to mark that some 24bit sound file has its origins in a 16bit HDCD, you can of course write your own tag to it via the tag editor (properties) and access that in your titleformatting string.
Title: HDCD Decoder
Post by: lmancino on 2010-11-24 09:56:57
When I rip an HDCD track from the CD in WAV format I experienced the following results

- with the 'ENABLE DECODE POSTOPROCESSING' enabled the track ripped lost the hdcd information and when i play or scan i don't detect the hdcd capabilities
- with the 'ENABLE DECODE POSTOPROCESSING' disabled the track is ripped correctly.

Is it right?
Title: HDCD Decoder
Post by: JWolf on 2010-12-03 17:27:04
Is there a way other then removing the HDCD plug-in to get replaygain values on HDCD tracks to not take into account HDCD?
Title: HDCD Decoder
Post by: JWolf on 2010-12-03 22:11:16
I may add an option to boost the gain of HDCD decoded material by 6dB, even if that would push peaks of peak extended material up to 1.5. It has come to my attention that there are a number of places where this would be necessary, such as albums where only a few tracks are HDCD encoded, which would possibly throw off the album gain level.


Why not add an option to turn it off when using replaygain or just plain off?

Title: HDCD Decoder
Post by: kode54 on 2010-12-04 03:12:12
Yes, but then the gain value would be incorrect when playing it with the HDCD decoder enabled, often producing quieter tracks.
Title: HDCD Decoder
Post by: drbeachboy on 2010-12-04 03:32:05
@kode54
Will you be adding support for ALAC in the near future?
Title: HDCD Decoder
Post by: kode54 on 2010-12-04 05:42:49
I cannot add support for any formats explicitly to the component, the authors of relevant input components must add support themselves.
Title: HDCD Decoder
Post by: drbeachboy on 2010-12-04 15:26:52
Thank you for the quick reply. So, it is the foo_input_alac component that needs to be updated?
Title: HDCD Decoder
Post by: JWolf on 2010-12-04 16:23:15
Yes, but then the gain value would be incorrect when playing it with the HDCD decoder enabled, often producing quieter tracks.


But the problem is that the HDCD tracks have a much lower volume then the others. So if replaygain didn't take into account HDCD, then everything would match.

Title: HDCD Decoder
Post by: Sandrine on 2010-12-04 16:45:02
Yes, but then the gain value would be incorrect when playing it with the HDCD decoder enabled, often producing quieter tracks.


Wouldn't it be possible to always use the original replaygain value, but to let the HDCD component modify the existing value by 6db when active? That way everybody would be content.
Title: HDCD Decoder
Post by: kode54 on 2010-12-04 23:07:22
It is possible that the HDCD tracks are quieter because they were scanned without the benefit of a HDCD decoder. You should probably rescan the files.
Title: HDCD Decoder
Post by: JWolf on 2010-12-04 23:38:57
Yes, but then the gain value would be incorrect when playing it with the HDCD decoder enabled, often producing quieter tracks.


Wouldn't it be possible to always use the original replaygain value, but to let the HDCD component modify the existing value by 6db when active? That way everybody would be content.


Why does HDCD have to be lower as long as it doesn't clip?

Title: HDCD Decoder
Post by: kode54 on 2010-12-04 23:50:29
Depending on HDCD features enabled, neither the gain nor the peak level calculated without the decoder will be accurate with the decoder. It will usually result in HDCD files being up to 6dB quieter than with the correct ReplayGain values.

It's not always 6dB, either. In fact, it's only 6dB if no HDCD features are enabled. The base HDCD decoding will halve the volume, but peak extension will scale the peak up to maximum, while resulting in a quieter track than without the HDCD decoding. There's also the gain reduction feature, which could also drop the volume of the decoded track by up to 7.5dB.

Anyway, the point is that you need to manually rescan your albums with the HDCD encoder installed for the volume to be adjusted to the correct level. There is no way to predict the correct difference between a non-HDCD gain and a HDCD gain.
Title: HDCD Decoder
Post by: SmartOne on 2010-12-11 15:26:45
Thank you for the plugin!  Will you add an option to perform a deep scan of files and report if Peak extend or Gain is used?  I have at least one boring album that appears to only use the Transient filter, and that's not implemented.  There's no reason for me to transcode these files.  Currently there's no way to be sure unless I play them all in real time and stare at the reported variables.
Title: HDCD Decoder
Post by: Glenda on 2010-12-24 13:04:23
My previous install of foobar with HDCD v1.5 had a info as far as peak extend used, transient filtering used shown in the bottom left as a track was playing.

Now I installed an SSD harddrive with a new windows install and using foobar v1.1.1 it does list the HDCD info.  I know that the HDCD v1.5 is installed and working as I can tell by the lower volume and VU meter readings with it installed when playing an HDCD rip.

Is there any way to get the HDCD info to list out peak extend (yes/no) transient filter (yes/no) on this new version of Foobar v1.1.1 ?

Edit never mind,  add $if(%__hdcd%,' ('HDCD - pe:%__hdcd_peak_extend% tf:%__hdcd_transient_filter% gain:%__hdcd_gain%')',) to the status bar formating.
Title: HDCD Decoder
Post by: twittles on 2010-12-25 16:18:07
I've read this entire thread, but still confused on what I see with my files in Foobar:

- installed latest version of Foobar and HDCD component
- added the 4 HDCD columns in DUI mentioned on the first page of this thread (I'm pretty experienced at adding column info, so I'm pretty sure I did this correctly)
- scanned my FLAC files (all are 16 bits per the displayed collumn I added)
- found several albums that where detected as HDCD

...but the detected albums do not display any data in any of the HDCD columns in DUI.  Did I forget to do something?  If not, what does this mean?  thanks
Title: HDCD Decoder
Post by: twittles on 2010-12-25 19:37:58
FWIW, I added the code a two replies above to my status bar in CUI for playback (thanks for the code!).

For tracks on albums for which HDCD was detected by the plugin, for all but two albums I see the following in the status bar:

"(HDCD - pe:yes tf:no gain:0.0dB)"

For just two albums for which HDCD was detected by the scanner, I saw the following on the status bar:

"(HDCD - pe:no tf:no gain:0.0dB)"

For tracks on albums that were not detected as HDCD by the scanner, I don't see any of the text above. 

This tells me something is being detected for all of the albums that were detected by the scanner, but why won't I get at least the %_hdcd% to display something other than a blank, and %hdcd_peak_extend% to display something other than a question mark, using the DUI?  For the HDCD detection column, I use $if(%__hdcd%,HDCD ,) to try to display "HDCD" when detected, per the tip in this thread.

I don't think it matters with respect to the column display, but I have Replaygain processing set to "none", no active DSPs, all FLACs have 44.1k sample rates in addition to being 16 bits deep, and I'm just trying to play back on my PC speakers (playback output device is Primary Sound Driver).
Title: HDCD Decoder
Post by: kode54 on 2010-12-25 22:32:04
Any HDCD columns, either in DUI or CUI, will only show values while the track is playing.
Title: HDCD Decoder
Post by: twittles on 2010-12-25 22:49:38
I did not realize that.  But still no joy using either UI.  I added these info variables to my item properties in CUI, and looked at the songs while playing in both UIs.

Because I had my Output Device set to "primary sound driver", output was fixed at 16 bits for all attempts previous to this sentence (selection to change the bit depth was grey and thus not changeable).  I also just changed output to WASAPI: Speakers..., and then was able to change the output data format to 24 bits.  Is setting output to 24 bits mandatory to see teh info variables as well?  Even if so, still no joy.
Title: HDCD Decoder
Post by: twittles on 2010-12-26 00:46:47
Also never have any entry indicating HDCD detection in the console.  No joy on any attempt, and I kept switching manually between tracks on HDCD and non-HDCD albums many times given the previous statement that only the first track of consecutive HDCD tracks within a selection will be show HDCD detection (at least that's what I thought it meant).

The only other thing I can think of is that I'm not playing my PC speakers at max volume, nor will I.  I only have one volume control on my PC for my integrated speakers, and it's the one that the WASAPI output is feeding.  I can't try outputting an HDMI or other digital signal to an external device.
Title: HDCD Decoder
Post by: Nalyd on 2010-12-28 11:53:35
It's nice to see 'HDCD detected' in the status windows.


Could someone tell me how to get the words "HDCD detected" to display?  I do know my HDCD tracks are being detected because the "Scan for HDCD Tracks" utility always finds them (which is great). However, my HDCD column (%__hdcd%) just has a "?" regardless of whether the track is HDCD or not. Can anyone help please? Thanks in advance.

EDIT

Sorry, I really should learn to fully read through threads before asking questions like that.  All sorted - great stuff!
Title: HDCD Decoder
Post by: Glenda on 2010-12-28 13:36:38
It's nice to see 'HDCD detected' in the status windows.


Could someone tell me how to get the words "HDCD detected" to display?  I do know my HDCD tracks are being detected because the "Scan for HDCD Tracks" utility always finds them (which is great). However, my HDCD column (%__hdcd%) just has a "?" regardless of whether the track is HDCD or not. Can anyone help please? Thanks in advance.

EDIT

Sorry, I really should learn to fully read through threads before asking questions like that.  All sorted - great stuff!



For foobar  add $if(%__hdcd%,' ('HDCD - pe:%__hdcd_peak_extend% tf:%__hdcd_transient_filter% gain:%__hdcd_gain%')',) to the status bar formating
Title: HDCD Decoder
Post by: d_headshot on 2011-01-01 01:12:54
If I play a track that has been HDCD decoded on a portable media player with lets say, FLAC support, will it play as if it were a normal 16-bit file or will there be playback problems?
Title: HDCD Decoder
Post by: kode54 on 2011-01-01 09:06:30
It will play like a normal 16-bit file. Of course, after the decoding and conversion, it will have the correct volume characteristics, in the event that it used either peak extension or gain reduction. If it used neither, then it will just be half as loud as it originally was.
Title: HDCD Decoder
Post by: Glenda on 2011-01-01 09:17:48
It will play like a normal 16-bit file. Of course, after the decoding and conversion, it will have the correct volume characteristics, in the event that it used either peak extension or gain reduction. If it used neither, then it will just be half as loud as it originally was.


Is there a means to set it to output 20 bit as that is technically correct for an HDCD decoder ?
Title: HDCD Decoder
Post by: kode54 on 2011-01-01 15:40:53
The HDCD decoder filter always outputs 20 bits precision. It is up to the user to set their output device to 24 bits or greater for playback. Or, if using the HDCD decoder when transcoding to another format, it's up to the user to transcode to a 24 bit format or greater, or some lossy format that accepts 24 bit or floating point sample data.

This is meaningless for portable players, since most of them only have 16 bit DACs anyway.
Title: HDCD Decoder
Post by: Glenda on 2011-01-02 04:03:50
The HDCD decoder filter always outputs 20 bits precision. It is up to the user to set their output device to 24 bits or greater for playback. Or, if using the HDCD decoder when transcoding to another format, it's up to the user to transcode to a 24 bit format or greater, or some lossy format that accepts 24 bit or floating point sample data.

This is meaningless for portable players, since most of them only have 16 bit DACs anyway.



thanks

Has there been any progress on adding transient filtering,  my understanding is the oversample filter used is only 2x,  so most computers could handle 88.2khz.
Title: HDCD Decoder
Post by: d_headshot on 2011-01-02 05:15:49
The HDCD decoder filter always outputs 20 bits precision. It is up to the user to set their output device to 24 bits or greater for playback. Or, if using the HDCD decoder when transcoding to another format, it's up to the user to transcode to a 24 bit format or greater, or some lossy format that accepts 24 bit or floating point sample data.

This is meaningless for portable players, since most of them only have 16 bit DACs anyway.


I'm aware of that but what I meant was, if the file was played from a 16 bit DAP, would the file be played without problems?
Title: HDCD Decoder
Post by: Glenda on 2011-01-02 07:47:04
The HDCD decoder filter always outputs 20 bits precision. It is up to the user to set their output device to 24 bits or greater for playback. Or, if using the HDCD decoder when transcoding to another format, it's up to the user to transcode to a 24 bit format or greater, or some lossy format that accepts 24 bit or floating point sample data.

This is meaningless for portable players, since most of them only have 16 bit DACs anyway.


I'm aware of that but what I meant was, if the file was played from a 16 bit DAP, would the file be played without problems?



Not really a problem but it would be truncated to 16 bits without proper dithering,  of course out of a DAP where absolute SQ is not really an goal I don't think there is an issue.
Title: HDCD Decoder
Post by: Charles Hansen on 2011-01-02 20:53:28
Has there been any progress on adding transient filtering,  my understanding is the oversample filter used is only 2x,  so most computers could handle 88.2khz.


"Transient Filtering" is a giant misunderstanding, created by the false advertising of Pacific Microsonics. They had brilliant engineers working for them, but sleazy marketing people.

The Pacific Microsonics (PM) D/A converter used two different anti-aliasing filters during the conversion to digital, depending on the spectral content and loudness of the signal. For some reason the choice of filters is encoded in the "hidden subcode" that triggers the correct decoding upon playback.

But there never has been two different playback digital reconstruction filters -- only one.

People were misled both by the ambiguous text of the HDCD literature and also by the fact that the "subcode" showed which filter was used during recording. So you do not have to worry about this. Not one little bit.

Another place where PM"s marketing team created a lot of (deliberate) confusion is that there are only two features that require decoding -- Peak Extend (PE) and Low-Level Extension (LLE). But these can be turned on or off by the mastering engineer. Many albums have been recorded with both of these features turned off. So there is nothing to decode.

But the "HDCD" light will still turn on, because this A/D converter always inserts the "subcode", whether or not it is needed. Another sleazy trick from the PM marketing department. (This is why there are so many discs with no HDCD logo on the cover, but that light up the "HDCD" light.)

Other instances where decoding is not needed include almost all usage of LLE. LLE does not activate until the signal level drops below -45 dBFS. With popular music, this pretty much happens only in the silence between tracks. You might see a second or two of activity as the song fades out, but that is it. With classical music, it is used a little bit more but still not much. I looked the the Reference Recordings album "Nojima Plays Ravel" and there were a few cases where there were very quiet passages that would trigger a dB or two of LLE for perhaps five or ten seconds.

Then there is PE. This doesn't start to do anything until the peak level reaches -9 dBFS. Many of Joni Mitchell's albums were remastered using HDCD. About half of them stay below -9 dBFS for pretty much the entire album and thereby gain no benefit from HDCD decoding. The other half do have peaks above -9 dBFS and will have some benefit. But to achieve the full benefit requires a really good stereo system. HDCD cannot make the peaks any louder, as digital has a hard limit. So what it does is keep the peaks loud and reduce the rest of the music by -6 dB in level. This also means that your Signal/Noise ratio will be reduced -6 dB. So you don't really want to do this unless you have a great system with a very low noise floor to begin with.

Finally, the engineer who designed the PM A/D converter, Keith Johnson, is a brilliant engineer. Even though the machine has been discontinued for at least 6 years, it is still one of the best sounding A/D converters ever made. So discs where the "HDCD" light lights up mean that the album is likely to sound exceptional, whether or not any of the actual HDCD features were engaged by the mastering engineer. The high sound quality of "HDCD" discs is due far more to the great A/D converter and far less to the "HDCD" features.
Title: HDCD Decoder
Post by: greynol on 2011-01-02 23:26:15
Finally, the engineer who designed the PM A/D converter, Keith Johnson, is a brilliant engineer. Even though the machine has been discontinued for at least 6 years, it is still one of the best sounding A/D converters ever made.

Do you have any test data that supports this claim which is compliant with our Terms of Service (http://www.hydrogenaudio.org/forums/index.php?showtopic=3974)?
Title: HDCD Decoder
Post by: Charles Hansen on 2011-01-02 23:56:40
Finally, the engineer who designed the PM A/D converter, Keith Johnson, is a brilliant engineer. Even though the machine has been discontinued for at least 6 years, it is still one of the best sounding A/D converters ever made.

Do you have any test data that supports this claim which is compliant with our Terms of Service (http://www.hydrogenaudio.org/forums/index.php?showtopic=3974)?


I presume you mean:

"8. All members that put forth a statement concerning subjective sound quality, must -- to the best of their ability -- provide objective support for their claims. Acceptable means of support are double blind listening tests (ABX or ABC/HR) demonstrating that the member can discern a difference perceptually, together with a test sample to allow others to reproduce their findings. Graphs, non-blind listening tests, waveform difference comparisons, and so on, are not acceptable means of providing support."

I am unaware of any ABX testing of A/D converters.

Every single mastering engineer in the industry chooses the equipment that sounds best to them (or occasionally chooses on the basis of its reputation of how it sounds to others), and none choose on the basis of ABX testing. Since no such ABX evidence exists I would assert that I have provided objective support to the best of my ability.

But you are the moderator. It is your forum. If you want to edit or delete my post, that is your decision.

Happy New Year!
Title: HDCD Decoder
Post by: greynol on 2011-01-03 00:35:31
I just wanted you to be aware of our rules and know that we have an expectation that they be followed.

Happy New Year to you as well!
Title: HDCD Decoder
Post by: Charles Hansen on 2011-01-03 01:23:25
I just wanted you to be aware of our rules and know that we have an expectation that they be followed.

Happy New Year to you as well!


I'll edit the original post. Let me know if you find it acceptable.

EDIT: OOPS! I can't edit it... I guess it's too old....
Title: HDCD Decoder
Post by: greynol on 2011-01-03 01:30:14
Don't worry about it.  That you care enough to want to make the edit speaks for itself.
Title: HDCD Decoder
Post by: Glenda on 2011-01-03 03:48:35
Has there been any progress on adding transient filtering,  my understanding is the oversample filter used is only 2x,  so most computers could handle 88.2khz.


"Transient Filtering" is a giant misunderstanding, created by the false advertising of Pacific Microsonics. They had brilliant engineers working for them, but sleazy marketing people.

The Pacific Microsonics (PM) D/A converter used two different anti-aliasing filters during the conversion to digital, depending on the spectral content and loudness of the signal. For some reason the choice of filters is encoded in the "hidden subcode" that triggers the correct decoding upon playback.



Some folks playing with hardware HDCD decoder came to the same conclusion:  HDCD hardware (http://www.diyaudio.com/forums/digital-source/141108-stand-alone-hdcd-decoder-project-5.html)

However I am also baffled by the fact that the inventor of hdcd.exe found the code for transient filtering (beyond the in use flag) in the HDCD's and was going to try and match it with an impulse analysis but abandonded the project when he realized he that he couldn't access the internal 2fs output of the hdcd decoder inside the pmd100.
Title: HDCD Decoder
Post by: Charles Hansen on 2011-01-03 21:00:32
However I am also baffled by the fact that the inventor of hdcd.exe found the code for transient filtering (beyond the in use flag) in the HDCD's and was going to try and match it with an impulse analysis but abandonded the project when he realized he that he couldn't access the internal 2fs output of the hdcd decoder inside the pmd100.


The developer of the HDCD system also developed the PMD-100 HDCD decoder / digital filter IC. There is no problem to access the 2 Fs output of the decoder. But that wouldn't help, as there is only one digital reconstruction filter inside the chip. So that was not the issue.

The system seems to work well enough with just one playback filter. So the real question is why did they include the flag for which filter was used during the recording process?

All we can do is speculate. There are a few things that we know. One is that they were tinkering with the system a bit. The first HDCD releases used a prototype encoder. That encoder had a shorter hidden subcode. Apparently they got some false positives (whereby the system would be triggered by musical passages), because the production system had a longer code that was essentially immune to false triggering.

Another thing we know is that silicon resources were much more limited in 1994 than they are today. The digital filter in the PMD-100 is not a half-band type (as is normally used in almost all digital products) and therefore requires double the number of taps. This means double the number of coefficients in ROM and twice as many hardware MACs. This was all "expensive" from a real-estate standpoint back then and they may not have had the space to fit it all in the part with another filter also.

The other thing is that I don't think that Pacific Microsonics was all that well funded. So it may have just been a question of insufficient funds to do what they really wanted. For example, the PMD-100 was made on a 0.6 micron process. The fab that was making the part shut that line down around 2002 and it would have cost close to $500,000 to make another version of the same part. Apparently they didn't have the money because the PMD-200 was just a Motorola DSP with a special ROM program burned into it. The '200 added support for higher sample rates, but not for two different playback filters. If they ever had a plan for implementing two playback filters, that would have been the time. But they must have been running out of money because Microsoft bought PM before the '200 was even put into full production. Judging from what MS has done with HDCD, I don't think they paid a lot for it. I would guess that the founders were glad to get out of it with something (rather than nothing).

As noted before, Keith Johnson is one of the top engineers in audio, and he did an outstanding job on the Model One and Model Two A/D converters. The power supplies, clocks, audio circuitry, and converters themselves were far more advanced than what others were doing in 1994, or even in 2004 for that matter. (I hope that statement is within the guidelines!) Used units still fetch top dollar today. In fact there is a used Model Two on Audiogon right now. The asking price is $20,000, which was the original list price. Many mastering engineers were able to purchase them new for half that price.
Title: HDCD Decoder
Post by: greynol on 2011-01-03 23:33:44
The power supplies, clocks, audio circuitry, and converters themselves were far more advanced than what others were doing in 1994, or even in 2004 for that matter. (I hope that statement is within the guidelines!)

Yes this is within the guidelines.  Had you said this hardware offered better sound quality then you would be obligated to provide objective evidence in the way of DBT results.
Title: HDCD Decoder
Post by: Glenda on 2011-01-04 11:55:31
Very informative post Mr Hansen.  Thankyou .
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-03 06:39:08
I have installed the HDCD foobar2000 add-on. But when I play a HDCD file, in the console doesn't say that file is recognized as HDCD. But, if I "scan" for HDCD tracks the utility reports that finds the HDCD tracks.
Is this normal?
Title: HDCD Decoder
Post by: kode54 on 2011-02-03 07:38:00
As indicated in the original post, the HDCD status is indicated by dynamic file info fields, which you may retrieve with %__hdcd% or $info(hdcd) in your status bar or other dynamically updated title formatting scripts.
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-03 12:02:39
Maybe you can add a tutorial on the foobar add-on documentation page. Just for people like me
Thanks for the app! I have four players capable of HDCD decoding (one from SPDIF), foobar decoding is from FLAC files on PC (WMP can do it only from optical medium).
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-04 02:30:38
I did it... thank you.
Looks nice like below - shows (HDCD) when plays HDCD and nothing for the rest:
Code: [Select]
$if($info(hdcd),'(HDCD)',)
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-04 04:04:23
All the info "out":
Code: [Select]
 $if($info(hdcd),'(HDCD:',) $if($info(hdcd_gain),Gain= $info(hdcd_gain) Peak extend=$info(hdcd_peak_extend) Transient Filter=$info(hdcd_transient_filter)')',)

Awesome info! Exemples:

Yes - 90125 : Gain= 0dB Peak extend= no Transient filter= yes/no (varies quickly)
Mike Oldfield - Five Miles out :  Gain= 0dB Peak extend= yes Transient filter= no
Mike Oldfield - Islands :  Gain= 0dB Peak extend= no Transient filter= no
Roxy Music - Avalon :  Gain= 0dB Peak extend= no Transient filter= no
Shana Morrison - Caledonia : Gain= 0dB Peak extend= yes Transient filter= no
The Beach Boys - Surfin' Safary : Gain= 0dB Peak extend= no Transient filter= no
Joe Walsh - The Smoker You Drink : Gain= 0dB Peak extend= no Transient filter= yes/no (varies quickly)
Title: HDCD Decoder
Post by: -Richy- on 2011-02-05 22:26:59
Sorry, in Version 1.10 I don't found the advanced preferences option under the Decoding from HDCD decoding.
Title: HDCD Decoder
Post by: Sandrine on 2011-02-05 23:02:28
@kode54
Could you tell us a bit about the mechanism used when "Don't half volume" is ticked? Are you applying gain, maybe?
Title: HDCD Decoder
Post by: markanini on 2011-02-05 23:44:00
[quote author=-Richy- link=msg=742468 date=1296944819]Sorry, in Version 1.10 I don't found the advanced preferences option under the Decoding from HDCD decoding.[/quote]

Look again, it's there. (Advanced > Decoding > HDCD Decoder)
@kode54
Could you tell us a bit about the mechanism used when "Don't half volume" is ticked? Are you applying gain, maybe?

Yeah, kode54, where's my bits at? ;);)
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-06 00:44:00
My HDCD players have in the output stage a +6dB selective amplifier. When a HDCD signal is detected, that activate the +6dB gain...
6dB means double/half of the output voltage.
Title: HDCD Decoder
Post by: kode54 on 2011-02-06 01:38:12
HDCD decoding effectively halves the volume, reducing the output by 6dB. This isn't a problem if peak extension is enabled, but if not, then your output will always be half as loud if HDCD information is found.

Enabling that option doubles the volume of decoded HDCD output, which is fine when peak extension is not used, but when it is, peaks can reach as high as 2.0.

Enabling it or not doesn't really matter if you use ReplayGain on the resulting tracks with this component installed.
Title: HDCD Decoder
Post by: SoNic67 on 2011-02-06 02:46:33
I didn't measured by now, but I might open one of my players to test it - to see if the HDCD's with "peak extend" activate that +6dB analog stage or no. Now, that I know which HDCD's have that active.
Title: HDCD Decoder
Post by: GeSomeone on 2011-02-06 21:27:32
Enabling it or not doesn't really matter if you use ReplayGain on the resulting tracks with this component installed.

I'd like to add that it only doesn't matter if the tracks were also ReplayGained with the HDCD plugin installed and all users, on all their computers, that use those tracks have the HDCD plugin in their profile as well.

I think turning off the -6dB is the right solution for all of this, thanks a lot for adding this option. After all, IMO the -6dB in the HDCD spec is just a hack (they had better made every track -6dB in the (HD)CD decoder and then raise the output in the analog part, but whatever.
Title: HDCD Decoder
Post by: kode54 on 2011-02-07 01:36:44
The -6dB is necessary if any tracks use peak extension, as it can add up to 6dB to the volume.
Title: HDCD Decoder
Post by: GeSomeone on 2011-02-07 12:35:19
The -6dB is necessary if any tracks use peak extension, as it can add up to 6dB to the volume.

That is understood, however replaygain will counter the -6dB anyway, so within the setting of foobar it is my preference not to apply it in the first place. Thanks again for providing this choice.

Reasoning:
Foobar2000 handles the audio after decoding in (32bit) floats, so every peak is preserved at that point. Only after applying pre-amp, replaygain and the DSP chain the max values are to be considered, as is the case anyway. It is wise to always put the "Advanced Limiter" at the end of the DSP chain, just in case.
Title: HDCD Decoder
Post by: kode54 on 2011-02-07 15:36:15
Except maybe not in Windows Vista and newer, where DirectSound performs its own peak limiting.
Title: HDCD Decoder
Post by: a3aan on 2011-02-13 17:47:07
I run into a false positive where foo_hdcd says track is hdcd encoded and hdcd.exe says it isn't. hdcd.exe is right here. foo_hdcd is only mislead when playing the song from the start. Oddly the seekbar signature doesn't show like the -6db has been applied. I can provide the song if you feel like diving into it.
Title: HDCD Decoder
Post by: Honeybadger on 2011-02-14 04:42:58
hey guys,

Sorry to ask this but I have been trying off and on to figure out how to install the HDCD theme in here into my copy of foobar2000...

I have the PGN file, but I think it's just a graphics file and I can't figure out how it's a FB2K theme.

Usually themes seems to be TFS (I think they are TFS files).

Anyway, I don't see how to import a PNG and get a functioning Foobar system, what plugins do I need, how the heck do I even load it?

Thanks!
Title: HDCD Decoder
Post by: -Richy- on 2011-02-22 12:38:48
Is it possible to add in Advanced Preferences - HDCD decoder a auto function option for

a) halve output volume if Peak Extension is present or
b) don't halve output volume if Peak Extension isn't present.

Thanks
Title: HDCD Decoder
Post by: kode54 on 2011-02-22 14:36:02
Done.
Title: HDCD Decoder
Post by: a3aan on 2011-02-22 15:18:17
Done.

Cool. Killing all the relevant waveform signatures now...
Title: HDCD Decoder
Post by: -Richy- on 2011-02-22 16:06:05
Done.


Wow, many thanks!
Title: HDCD Decoder
Post by: Orion25 on 2011-02-25 01:42:50
Monkey's Audio decoder has been updated and now compatible with HDCD decoder.
Title: HDCD Decoder
Post by: audio123 on 2011-02-26 14:37:30
Hey guys,

I´ve read this entire thread, but still have some questions ...

I have some HDCDs that I want to convert to 24bit wav files - seems there are several ways to get there - which one is the best ?

- using kode54´s HDCD component for foobar - my tracks are correctly displayed as "HDCD" by the scanner, I´ve set the output manually to 24bit before converting - works perfect (tested with Armageddon Score HDCD)
- using eac3to (with command line option -decodehdcd): the tracks are converted to 24bit wav files also - except there is that thing with -6dB
- using MS WMP (as "official" HDCD-capable player) with wav out plugin

... but: what´s the best way to get 24bit wav files and most important is there a difference between these methods ?



audio123
Title: HDCD Decoder
Post by: blackstyle on 2011-03-09 18:47:35
Could it support apple lossless audio code (ALAC )format?
Title: HDCD Decoder
Post by: drbeachboy on 2011-03-09 20:14:10
Could it support apple lossless audio code (ALAC )format?
I think that is more a question for Peter. I was kind of surprised that it wasn't added during the last update a week or two ago. I say this because the latest update for Monkey's Audio included it.
Title: HDCD Decoder
Post by: kevnhuys on 2011-04-04 17:38:12
The developer of the HDCD system also developed the PMD-100 HDCD decoder / digital filter IC. There is no problem to access the 2 Fs output of the decoder. But that wouldn't help, as there is only one digital reconstruction filter inside the chip. So that was not the issue.




I understand from reading this thread that 'filter switching' at output is a red herring, since there was only ever one filter.  But if the PMD-100 used a specific reconstruction filter,  wouldn't faithful software emulation of HDCD decoding require emulating that particular filter?  (leaving aside whether it makes an audible difference)
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-05 00:48:26
Done.

On discs "Blondie-No Exit", "Shana Morrison-Caledonia", "Mike Oldfield-Discovery" (HDCD peak extend), the actual result is now -6dB lover level in average (using the VU meter) than other HDCD that don't have the "peak extend" active (Roxy Music, Van Hallen).
The regular CD level is same like the HDCD with no peak extend active.

I can see the reason for -6dB when the "peak extend" is active. But the masterings that I have don't have peaks - or I cannot see them with the VU meter in the Foobar (it has max hold).
Title: HDCD Decoder
Post by: kode54 on 2011-04-05 03:49:53
Are you sure it's set to the default of only attenuating tracks which have peak extend enabled?
Title: HDCD Decoder
Post by: GeSomeone on 2011-04-05 17:33:10
On discs "Blondie-No Exit", "Shana Morrison-Caledonia", "Mike Oldfield-Discovery" (HDCD peak extend), the actual result is now -6dB lover level in average than other HDCD that don't have the "peak extend" active

Are you sure it's set to the default of only attenuating tracks which have peak extend enabled?

apparently that is what happened. Go in Preferences to Advanced->Decoding->HDCD Decoder and set the "halve output volume" (meaning 6 dB attenuation) to the setting of your choice.
Alternatively run the Replaygain scanner again on those discs and it will fix the volume difference (but only in foobar2000).

Quote
But the masterings that I have don't have peaks - or I cannot see them with the VU meter in the Foobar (it has max hold).

You don't see the real peaks with the VU meter, use the peak meter for that.  Also, when ReplayGain is applied, the level might be lowered already so peaks will not be as high as you might expect. Lastly, have a look in your DSP chain, because a plugin, like the Advanced Limiter, could "hide peaks" as well.

edit: -6 and attenuation is like a double negative
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-06 01:58:06
Yes, the option was selected (default?) to lower the output only on files with PE active. Didn't have the ideea that kode54 have included that option there... Cool!
Thanks for the hint with peak meter too.
The HDCD encoded with PE, can go up to +3dB, the others only to 0dB (like the regular CD's). But in reality only "Blondie-No Exit" does that from the above ones... that is so eery to see the peaks above 0dB.
I need to go and get a Tom Petty disc... from "Playback" box set (http://www.amazon.com/Playback-Tom-Petty/dp/B000002OYT).
Yes, there it is - also true peak extend! "Jumps" even more than Blondie one! No wonder always sounded sooo good to me... (on my players/receiver with HDCD decoding).

I will let it lower the output for the Peak Extend enabled discs so it doesn't overdrive the output unecessarely - I can always turn up the volume.

PS: I don't use the Replay Gain, I don't like it. Prefer to use the volume slider. Generally try to keep the chain as "clean" as possible... Some upsampling maybe
Title: HDCD Decoder
Post by: lvqcl on 2011-04-06 15:07:04
Quote
PS: I don't use the Replay Gain, I don't like it. Prefer to use the volume slider.

What's the difference between RG and volume slider?
Title: HDCD Decoder
Post by: Sandrine on 2011-04-06 15:44:20
Quote
PS: I don't use the Replay Gain, I don't like it. Prefer to use the volume slider.

What's the difference between RG and volume slider?


Maybe a bit OT... while the above question seems humorous at first thought, I do wonder what becomes of the relationship when the volume slider is at 100% and the RG value is positive? Is amplification more detrimental to the sound than volume reduction via slider?
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-07 01:32:09
I think that volume slider in PC at 100% preserves the maximum sound quality. I am adjusting the actual level with an analog volume control for headphones (I have Creative X-Fi Platinum with the 5-1/4" bay) or via the volume control in my receiver if I am listening on speakers.

Replay Gain is changing the digital audio data. I am maybe just paranoic... I want to have the digital signal "untouched" as much as posssible, only unavoidable DSP operations - like decoding HDCD, eventual the upsampling to 2x-4x...
Title: HDCD Decoder
Post by: Glenda on 2011-04-10 12:36:43
I think that volume slider in PC at 100% preserves the maximum sound quality. I am adjusting the actual level with an analog volume control for headphones (I have Creative X-Fi Platinum with the 5-1/4" bay) or via the volume control in my receiver if I am listening on speakers.

Replay Gain is changing the digital audio data. I am maybe just paranoic... I want to have the digital signal "untouched" as much as posssible, only unavoidable DSP operations - like decoding HDCD, eventual the upsampling to 2x-4x...


Ok can we please have a simple method to turn off the decoding while still having the reporting functions?  So that those of us with HDCD decoding DAC's can see which files have peak/transient without having to uninstall and reinstall.  Its a hassel and sometimes seems to require a fresh install of foobar just to reistall the HDCDdll after previously installing it

Thanks,  great plugin otherwise..
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-11 10:15:45
Play those files with another software player that will output to SPDIF?
I did move the "foo_hdcd.dll" file from "Components" folder to the main folder of foobar and use the "Install" to add it to foobar. Now I have for it option "Remove" click-able...
Title: HDCD Decoder
Post by: kode54 on 2011-04-11 15:38:57
The component does not need to be placed anywhere in the foobar2000 installation folder to use the Install... feature. In fact, placing the component in the installation folder (but not the components folder) does nothing. Installing places the component in the user-components folder, which is located inside the user profile folder.
Title: HDCD Decoder
Post by: Glenda on 2011-04-12 11:44:37
The component does not need to be placed anywhere in the foobar2000 installation folder to use the Install... feature. In fact, placing the component in the installation folder (but not the components folder) does nothing. Installing places the component in the user-components folder, which is located inside the user profile folder.



Which is a pain to find and locate if you have to turn it on/off.


For those of us with external HDCD decoders it would be nice to have the component display the HDCD data but not decode as an option.
Title: HDCD Decoder
Post by: kode54 on 2011-04-12 14:30:32
I will consider adding that. (Also, by that folder option I meant the simple option. Remove: Open preferences, right click component, remove. Install again: Use the Install... button or drag the downloaded archive onto the same preferences page.)
Title: HDCD Decoder
Post by: Sandrine on 2011-04-13 00:45:39
For those of us with external HDCD decoders it would be nice to have the component display the HDCD data but not decode as an option.


There are external HDCD decoders for digital files that do different stuff than what is implemented in fb2k?
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-13 03:00:10
I don't think.
But it might make sense - in my case, I have the PC in one room and sometimes I want to listen in another via WDTV Live connected to a HDCD decoding receiver.
Title: HDCD Decoder
Post by: Glenda on 2011-04-13 10:58:23
For those of us with external HDCD decoders it would be nice to have the component display the HDCD data but not decode as an option.


There are external HDCD decoders for digital files that do different stuff than what is implemented in fb2k?



You are asking why I don't just decode with the software?  The PMD100 HDCD digital filter used in nearly all classic DAC's is just a wonderful sounding filter,  this goes beyond HDCD its oversampling algorithm and filtering are just incredible.  So I want to feed it bit-perfect not decoded as it was designed for.  It just so happens that my DAC uses a PMD100 but the HDCD  indicator light is located inside not visible (for obvious reasons.)

So,

I just want there to be a readout on the status bar with hdcd-yes, gain, peak extend, transient filter.  while not decoding.
Title: HDCD Decoder
Post by: Sandrine on 2011-04-13 11:33:03
You are asking why I don't just decode with the software?  The PMD100 HDCD digital filter used in nearly all classic DAC's is just a wonderful sounding filter,  this goes beyond HDCD its oversampling algorithm and filtering are just incredible.  So I want to feed it bit-perfect not decoded as it was designed for.  It just so happens that my DAC uses a PMD100 but the HDCD  indicator light is located inside not visible (for obvious reasons.)


I wasn't aware that there are such filters implemented in other devices except CD players. I'll have to doublecheck my own Onkyo TX-SR606 now.

Update: Onkyos don't seem to have them. Do you have any info where a stand-alone (non-soldering) PMD100 could be bought?
Title: HDCD Decoder
Post by: Charles Hansen on 2011-04-16 00:40:05
I understand from reading this thread that 'filter switching' at output is a red herring, since there was only ever one filter.  But if the PMD-100 used a specific reconstruction filter,  wouldn't faithful software emulation of HDCD decoding require emulating that particular filter?  (leaving aside whether it makes an audible difference)


Yes and no.

Every soundcard, soundboard, or external D/A converter has a DAC chip. 99.9% of the time, this DAC chip has a built-in digital filter. 0.1% of the time there is a separate external digital filter. The digital filtering is basically never handled in software by your computer.

So the real question you need to ask is, "How much variation there are in various hardware digital filters, and furthermore how much they differ from the one built into the Pacific Microsonics decoder chips"?

The answer is that, in general, the differences are very small. There are a few new (expensive) external D/A converters that have minimum-phase digital filters. There are a few (expensive) old and new D/A converters that have "slow-rolloff" digital filters. These can make small changes in the response of the filter, both in terms of amplitude and phase. These changes are restricted to the top octave (above 10 kHz), so there sonic impact will be minimal.

The bottom line is that the only way to exactly copy a PMD-100 is to exactly copy a PMD-100. But the tools available to you now will get you 99% of the way there, and maybe more.
Title: HDCD Decoder
Post by: Charles Hansen on 2011-04-16 00:47:08
Update: Onkyos don't seem to have them. Do you have any info where a stand-alone (non-soldering) PMD100 could be bought?


The PMD-100 was a digital filter / HDCD decoder chip designed to be used with a D/A converter chip. It hasn't been made for ten years. You can still find them on eBay from time-to-time, but building a DAC box with these chips is a seriously advanced project. You can't just add this to your receiver...

There were other HDCD decoding chips also, but they were all discontinued within a few years of the PMD-100. The only way to decode HDCD now is either with software (eg, this Foobar plug-in or the "official" WMP package) or with programmable hardware. These are DSP chips that are typically built into either DVD players or Blu-ray players and the developers pay a license fee to Microsoft to build an HDCD decoder into the chip.
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-16 14:37:14
Denon and Harman Kardon had those DSP-based decoders in their top-tier receivers and DVD-players. Now, with the plague of "bluray" based sound formats, and MS lack of commitment, I think that support for HDCD divindled to almost zero.

Personally I have also an Apex AD3201 player (from 2000) that decodes HDCD.
Chinese DVD playes are the only ones still in the HDCD area - don't know why. Sound quality is unknown...
Title: HDCD Decoder
Post by: johnsonlam on 2011-04-19 03:00:16
I think that support for HDCD divindled to almost zero.

Absolutely correct.

Quote
Chinese DVD playes are the only ones still in the HDCD area - don't know why. Sound quality is unknown...

As a Hong Kong Chinese myself, my advise is -- Don't trust anything which is purely "Made in China" without any western participation
Title: HDCD Decoder
Post by: kevnhuys on 2011-04-19 22:57:17
Denon and Harman Kardon had those DSP-based decoders in their top-tier receivers and DVD-players. Now, with the plague of "bluray" based sound formats, and MS lack of commitment, I think that support for HDCD divindled to almost zero.

Personally I have also an Apex AD3201 player (from 2000) that decodes HDCD.
Chinese DVD playes are the only ones still in the HDCD area - don't know why. Sound quality is unknown...



A few years ago Oppo DVD players also featured HDCD decoding.  Not sure if that's still the case.
Title: HDCD Decoder
Post by: SoNic67 on 2011-04-21 23:58:02
Yes, Oppo players still suport HDCD decoding. To the latest bluray 3D capable BDP-95.
Personally I think an older Denon is a cheaper option with similar quality - I have DVD-2930 and DVD-2910 with HDCD decoding. And Denon AVR-3805 with same...
Title: HDCD Decoder
Post by: felipebw on 2011-09-08 17:00:50
I don't know if it's decoding my HDCD CDs, because when i use "scan for HDCD tracks" nothing is found. But when I scan my WAV or FLAC HDCD files they're recognized. the version is 1.11... can it be a problem with my drive?
Title: HDCD Decoder
Post by: kode54 on 2011-09-09 00:07:27
It may be a conflict due to the scanner attempting to process multiple tracks at once, which is impractical for audio CDs.
Title: HDCD Decoder
Post by: felipebw on 2011-09-10 00:15:34
so there's still the possiblity of despite that they're being decoded? It happens with individual tracks too
I'm using Windows 7 64, Xonar STX beta ASIO drivers(wit the foobar asio plugin enabled) and a Sony BWU 500s(whose offset is not present in database so not configured).
Title: HDCD Decoder
Post by: Northpack on 2011-09-11 14:04:56
Thanks for your work in this, kode54.

My question is, if I have a "HDCD" without peak extension enabled, would I possibly gain anything by decoding it? What happens with the control bits after decoding? I guess they are just replaced by regular dither?

So after decoding to 20 bit the last 4 bit will be emtpy and the 16th bit will only hold regular dither instead of the dither with control bits hidden in it. The possibility that one would ever hear a difference is about zero. Right?
Title: HDCD Decoder
Post by: kode54 on 2011-09-11 21:49:06
Actually, the control bits are encoded in the dithering. There is no way to remove them, really.
Title: HDCD Decoder
Post by: Northpack on 2011-09-12 09:39:49
Actually, the control bits are encoded in the dithering. There is no way to remove them, really.

OK, but what is done with the signal at all when there's no peak extension enabled? I examined some tracks with foobar and the bit comparison did show some minor differences (~0.01% of the samples), though the peak values were unchanged and I didn't ever bother to try to ABX the tracks.
Title: HDCD Decoder
Post by: kode54 on 2011-09-12 09:42:21
There should be no difference at all if the volume isn't being halved and there's no peak extension. The signal is otherwise passed through unmodified, except for the conversion from and back to float.
Title: HDCD Decoder
Post by: Northpack on 2011-09-12 09:46:32
There should be no difference at all if the volume isn't being halved and there's no peak extension. The signal is otherwise passed through unmodified, except for the conversion from and back to float.

So the differences are most likeley due to rounding error, I guess. But what about this low level extention stuff?
Title: HDCD Decoder
Post by: kode54 on 2011-09-13 00:13:53
Ah, right. That's another thing that affects volume. It can reduce the volume level up to 7.5 dB, with some minor ramping between each volume change.
Title: HDCD Decoder
Post by: Northpack on 2011-09-13 08:31:55
Is the low level compression/expansion always enabled in HDCD audio or is it triggered by a control bit like the dynamic range expansion? I ask because there is no info variable related to it.

PS. Argh, excuse my horrible typos
Title: HDCD Decoder
Post by: kode54 on 2011-09-13 19:15:35
Yes, there is %__hdcd_gain% or $info(hdcd_gain) if you prefer. It will show negative gain levels other than 0.0 dB in the event that the low level adjustment is active.
Title: HDCD Decoder
Post by: Northpack on 2011-09-13 20:38:44
Oh, I didn't know that it relates to the low level extension. I thought it was just an overall gain. TFEM
Title: HDCD Decoder
Post by: Charles Hansen on 2011-09-14 19:42:59
Is the low level compression/expansion always enabled in HDCD audio or is it triggered by a control bit like the dynamic range expansion?


Earlier in the thread is an example string that you can place in the status bar that will give the status of the HDCD decoding. The one I use now is:

%codec% | %samplerate% Hz | $info(bitspersample) bits | %channels% | %playback_time%[ / %length%] | %bitrate% kbps | HDCD = %__hdcd% | $if(%__hdcd%,'('PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%')')

I keep refining it to give the information I like. I'm getting there...

As far as LLE goes, it is pretty much dead in the water as you found when you compared files. The problem is that they wanted to use compansion techniques to create a 20-bit dynamic range from a 16 bit system.

Peak Extend (PE) is either on or off for the entire song (actually the entire album except in the case of compilations). One the other hand LLE varies throughout the song. But here's the catch -- it's useless! The reason is that although it can theoretically provide another 7.5 dB of dynamic range (in 0.5 dB steps), it isn't activated until the average signal level drops to -40 dBFS! For any pop recording this only happens in the silence between tracks. So sometimes you will see the LLE come on as a track fades out. For classical music this level is reached when a solo instrument is playing pianissimo. As soon as a second instrument comes in or they start to play at normal volume, the LLE goes off because the level is above -40 dBFS. So even on classical music LLE is only used about 1% of the time...
Title: HDCD Decoder
Post by: Charles Hansen on 2011-09-14 20:15:07
OK, after fiddling around for a while I think that I have the status bar info I like:

%codec% | %samplerate% Hz | $info(bitspersample) bits | %channels% | %playback_time%[ / %length%] | %bitrate% kbps | HDCD = $if(%__hdcd%,'yes | ','no')$if(%__hdcd%,PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%)

The previous one gave a "?" for the HDCD status of a non-HDCD file, while this one gives a "yes" or "no".
Title: HDCD Decoder
Post by: EpicForever on 2011-09-14 22:23:37
OK, my wife is now really angry, because she wanted me to clean our flat, but I've said that first I need to figure out how to make "foo_hdcd" plugin to work. It took some time to read whole 10 pages and in the end I am still bit confused if it works or no. I use foobar 1.1.7, with latest version of HDCD encoder to date - 1.11.  As I said I am not sure if it works or not. I mean - if the output is really "HDCD decoded". I had only 4 CDs that use HDCD technique - Mike Oldfield's "Incantations", "Amarok" and "Tubular Bells" - remasters from around 2001 - and "Lateralus" by Tool. I ripped them in EAC to FLAC files and mostly I listen to them on PC rather than on my inexpensive CD player. My audio equipment was never capable of decoding HDCD, so I find it very usefull to have opportunity to fully unfold potential of sound engeneering techniques from that 4 CDs, especially using my favourite software audio player. But now I find it quite complicated to use this potential. So - my foobar uses DUI interface. I added 2 custom columns - one showing samplerate and other one showing bits per sample value. For all tracks from these 4 CDs both columns have values "44100" and "16" - which is OK and which was expected. Also I added appropiate switches to my status bar, that show info about samplerate, bits  per sample value, and HDCD status (yes/no + PE/LLE/TF) - similar to that from post above. What I see in status bar while I play for example "Incantations Part 1" is: "FLAC  886kbps  ¤  44100Hz / 24 Bit, stereo  ¤  1:39 / 19:07  ¤  HDCD: yes  (Peak Extension: yes, Transient Filter: no, Gain: 0.0 dB)". So - file is 16 bit as it should be, but it looks like output is 24 bit. For rest FLACs, from standard CDs that doesn't use HDCD status bar shows 16 bits. "OK, so it works" I thought. I also played with settings in advanced options - I tried to enable and disable volume halving. And I've heard results - when it was turned on for tracks with PE enabled, music was noticeably quiter than when I switched it to "Never". "OK, so volume is halved then HDCD must be decoded" I thought. Then I opened console and... there was nothing about HDCD. There was nothing like "HDCD detected". I thought that it's the problem with RG, but it was disabled - so I deleted appropiate dll from components folder to permanently disable any RG functionality but still nothing showed up in console. I realised, that my old SB0100 soundcard (SoundBlaster Live!) produces only 16 bit output so I turned on an onboard "Realtec HD Audio" codec (ALC892), changed output in foobar to "Speakers" and... nothing changed. File is still 16 bit, output is still 24 bit, halving volume works but console doesn't show any HDCD related info. I assume that if "Output data format" option in foobar config is grayed out, it means that it is configured by OS - in soundcard driver app. So I opened it and I went to "Default Format" tab and set there "output when running in shared mode" as "24 bit 192 kHz". "OK now it had to work" I said to myself and... I noticed that nothing changed... console still doesn't show anything. So my questions are:
1. What are the detailed requirements for 1.11 version of foo_hdcd" to work ?
2. What are all the indicators that HDCD decoding works - but I mean "works absolutely for sure" ?
3. What are the indicators that HDCD decoding doesn't work ?

Regards
Epic

PS
One more thing - is there any possibility to add working custom column showing info about HDCD status? (like "HDCD" when file is HDCD encoded and just show nothing when it isn't or "no"). Nevermind if it will be showed while file is played or permanently. I'm asking because I tried it using many patterns in my Default User Interface, and it never worked - HDCD tracks were always blank or just everything was "HDCD".
Title: HDCD Decoder
Post by: kode54 on 2011-09-15 03:29:59
There is no information in the console, you must use the specified %__hdcd*% variables, either in the status bar, or possibly in a playlist which supports dynamic info updates.
Title: HDCD Decoder
Post by: Northpack on 2011-09-15 08:02:36
Peak Extend (PE) is either on or off for the entire song (actually the entire album except in the case of compilations). One the other hand LLE varies throughout the song. But here's the catch -- it's useless!

Thanks for your remarks. It seems to me that the whole HDCD thing was marketing above all, and those albums mastered as HDCD rarely ever take any advantage of the technology. The only examples I've seen so far were HDCD has a considerable effect are those pop CDs which are mastered too loud, so that the peak compression kicks in all the time. I suppose HDCD works best as some perverted countermeasure against loudness war mastering...

2. What are all the indicators that HDCD decoding works - but I mean "works absolutely for sure" ?
3. What are the indicators that HDCD decoding doesn't work ?

Whenever %__hdcd% reads yes, HDCD material is detected and decoded according to what's specified by the control bits (peak extension and low level extention). If neither low level extension (%__hdcd_gain% reads permanently 0.0dB) nor peak extention are enabled, there is no decoding needed, so the decoder recognizes the HDCD bits bot does nothing to the audio, just adding empty bits.

The funny thing is that many so-called HDCDs (from my experience even most of them) don't have either of those features enabled, yet they are labeled as HDCD. But it only means that they were mastered on a HDCD capable device - they contain nothing that needs to be decoded.

They only contain the control bits that will cause the HDCD light on an HDCD capable player to lighten up, so people in audiophile internet forums can rant about how much better this or that album sounds on a HDCD player, not knowing that there's really no difference at all.

Now you should relax and make peace with your wife
Title: HDCD Decoder
Post by: EpicForever on 2011-09-15 10:50:14
Hmmm... So how do I know that HDCD decoding is NOT working? I mean - I have a file that is for sure HDCD encoded (WAV or FLAC) and I play it in my foobar, but something goes wrong with configuration - software conf. or hardware conf. Then how do I know that there's something wrong?  From my point of view it looks like foo_hdcd plugin can just detect HDCD material and show info about HDCD parameters, but it isn't explicit that it have to be properly decoded, even when it's properly detected. So? What will be explicit sign that HDCD decoding is not working even if this type of encoding is detected ?
Title: HDCD Decoder
Post by: Northpack on 2011-09-15 11:01:59
What will be explicit sign that HDCD decoding is not working even if this type of encoding is detected ?

The explicit sign is in the %__hdcd% variable. Whenever the plugin is installed and your output format (on Preferences > Playback > Output) is set to >= 24 bit (only XP, it is always 32 bit in Vista/7) and your sound device supports 24 bit (almost any device does today).

Of course foobar doesn't know what happens to the audio after it's been handed over to the sound driver so it can't say "what you are hearing is 24 bit audio", because only the driver knows for sure.
Title: HDCD Decoder
Post by: EpicForever on 2011-09-15 11:18:28
Thak you for your quick reply. Then how about my first question from my first post - what are the detailed requirements for 1.11 version of foo_hdcd" to work ? How about ReplayGain, DSP chain, etc ?
Title: HDCD Decoder
Post by: Northpack on 2011-09-15 11:24:59
No requirements. foo_hdcd is now implemented as a postprocessor service, so you can do anything you like with DSP, ReplayGain or whatever. It is always applied after the HDCD decoding.

Note that if you want to you convert HDCD material to decoded, 24 bit audio, you have to enable the checkbox "additional decoding" in foobar's converter setup
Title: HDCD Decoder
Post by: EpicForever on 2011-09-15 20:55:56
Many thanks for clarifications. So it looks like everything was working OK since the begining... lol.
Title: HDCD Decoder
Post by: felipebw on 2011-09-23 23:40:50
I've just figured that the HDCD scan doesn't find the tracks only when the CD is played through autorun. When I use the File>Open Audio CD>Play it works... what could be causing this? and again, scan failing means it won't be decoded?
ps.: when the CD is played through autorun, the failed scan is pretty faster
Title: HDCD Decoder
Post by: Glenda on 2011-09-25 17:43:30
If I have a 16 bit soundcard,  can I use the foo_hdcd to decode to the 24bit while playing and use a VST to dither to 16 bit?  With the soundcard being 16 bit I can't select 24 bit.    So as the flac is playing does the foo_hdcd process to 24 bit with the peak extend,  then the VST do a proper dither to 16 bit output even with the output device selected as 16 bit?
Title: HDCD Decoder
Post by: SoNic67 on 2011-09-30 09:59:52
If I have a 16 bit soundcard,  can I use the foo_hdcd to decode to the 24bit while playing and use a VST to dither to 16 bit?  With the soundcard being 16 bit I can't select 24 bit.    So as the flac is playing does the foo_hdcd process to 24 bit with the peak extend,  then the VST do a proper dither to 16 bit output even with the output device selected as 16 bit?

A 16 bit soundcard is worthless. Even to listen CD's. Why? Because that means it has supercheap DAC's, no analog filtering stage, cheap passive components and power supply - that will lead to a final audio performance level of only 11-13 bits, the rest will be lost in noise.
You need a GOOD soundcard in order to fully benefit of the dynamic offerd by a proper recorded CD or HDCD.
Title: HDCD Decoder
Post by: Glenda on 2011-09-30 12:04:57
Actually its not a 16 bit DAC  I am using a 24 bit DAC,  but with a a very well designed asynchrous USB to SPDIF 16 bit converter,  designed by the best RFI engineer in the busines.  We can argue the merits of this wonderful 16 bit usb converter vs 24/192 asynch spdif outputs and their issues or answer the original question.  BTW I would love to see a DBT comparing 24 bit HDCD decoded vs the same file dithered to 16 bit.  Remember even a decoded HDCD has typically no more than 40dB dynamic range ~ 7 bit.


Does the HDCD plugin decoding live "work" at 24 bits to the VST which does a proper dither to 16bit if the soundcard in foobar is set to 16 bit?
Title: HDCD Decoder
Post by: SoNic67 on 2011-10-01 01:17:32
Personally I don't care for 16 bit output instead of the 20 bit. Why? Beacuse it will be an artificial dither, something that is not in the original signal.
HDCD encoders had one of the best filters at that time, I seriously doubt that any plug-in can compete with that. It will only "damage" that initial quality.
Title: HDCD Decoder
Post by: Glenda on 2011-10-01 01:51:22
I agree and is why I use a PMD100 DAC,  but there are some instances where a need to "remaster" some titles that had poor studio work.

Hence the question:

Does the HDCD foobar plugin work in 24 bit bit resolution prior to being sent to a VST if the soundcard is 16 bit  ???
Title: HDCD Decoder
Post by: kode54 on 2011-10-01 01:59:42
The HDCD decoder doesn't care about your sound card capabilities. It would work even if you somehow had an 8-bit sound card and dithered down to that.
Title: HDCD Decoder
Post by: Northpack on 2011-10-14 18:37:52
Adding to all the HDCD oddities out there I have just discovered an example where an album sounded considerably worse after HDCD decoding! It's the album Saints by the early music ensemble Sequentia, one of their excellent albums covering the medieval repertoire of Hildegard von Bingen. The recording however, is not that excellent - there's some amout of ugly digital clipping during fortissimo passages. Only those passages are affected by peak extension, so basically the only thing that's extended are the distortions, which are twice as loud after decoding! I ended up dithering that album to get rid of the HDCD bits.
Title: HDCD Decoder
Post by: Glenda on 2011-10-14 18:57:45
The HDCD decoder doesn't care about your sound card capabilities. It would work even if you somehow had an 8-bit sound card and dithered down to that.



thankyou
Title: HDCD Decoder
Post by: CapitalQ on 2011-11-04 13:49:47
Is there any way this plugin could be made to work with Apple Lossless (ALAC) files? http://www.foobar2000.org/components/view/foo_input_alac (http://www.foobar2000.org/components/view/foo_input_alac)

I know the HDCD data is preserved fine (why wouldn't it be?) because this plugin's indicator will display properly if I convert ALAC files (sourced from HDCD) into WAV.
Title: HDCD Decoder
Post by: kode54 on 2011-11-04 19:35:45
Support for any specific lossless format is up to the developer of that format's input component.
Title: HDCD Decoder
Post by: RastaMan on 2011-12-03 17:47:53
Tried using the HDCD plugin to convert an HDCD album in foobar2000 v1.1.10, and it didn't work. Files were, originally, ALAC files that I purposefully converted over to WAV before attempting the HDCD conversion. Even though the plugin could correctly detect the HDCD data, it refused to properly convert to HDCD. The same WAV files, though, converted over fine to HDCD with the HDCD.exe encoder.
Title: HDCD Decoder
Post by: herojoker on 2011-12-03 23:14:32
This is a decoder. You can use it to convert HDCD encoded audio to 24bit PCM.
Title: HDCD Decoder
Post by: kode54 on 2011-12-04 07:02:37
If you are performing a conversion, you must also specify in the converter that the bit depth of the output is to be 24 bits, not automatic. The auto detection fails when filters such as this or the DTS decoder are active.

Also, if your HDCD material does not use Peak Extension or Low Level Adjustment (or whatever it's called), then with the default settings of this decoder, the output will be identical to the input. You may verify the presence of these effects by running the HDCD scanner from the Utilities section of the playlist context menu, and check for gain levels other than 0.0 dB and/or Peak Extension enabled or intermittent. Transient filter is merely an indicator of the encoder's selection of transient filter, and has no effect on decoding. In fact, there is no known decoder which makes use of that flag, since hardware solutions employ a transient filter that combines the properties of the two filters used by the encoder, or something like that.
Title: HDCD Decoder
Post by: HarryYTM on 2011-12-09 20:39:33
[Bug Feedback]The latest release(1.12) of foo_hdcd report false positive via %__HDCD% and $info(hdcd) when playing audio which is not encode in HDCD format, last version(1.11) don't have this problem. please aware of this issues, thanks!
Title: HDCD Decoder
Post by: kode54 on 2011-12-10 00:48:22
Good catch, sorry I didn't put the new decoder through more thorough testing. The bug is now fixed.
Title: HDCD Decoder
Post by: Porcus on 2011-12-16 15:37:21
My apologies in advance that the following is just as much questions on HDCD itself than of the component.  Two brief component-specific inquiries first: (1) How do I apply the info tags? (2) There is no way to export info from report window? (Oh, by the way, it seems that quite some info given during these 11 pages, has changed along the way? Found the thread hard to read ... so hard I would volunteer to write a FAQ had I had any clue on the facts.)


So, I did a few years ago convert a lot of my (HD)CD rips into 24-bits using hdcd.exe before I was aware that decoding could be done on-the-fly.  Now having scanned my entire lossless collection, I do have a few questions on the output (I used the current-as-of-today version 1.14), and then a few on interpreting data from my 24-bits files:

* I have a couple of CDs and at least one isolated track -- which report minimum gain = 0, maximum gain = 0, PE enabled and transient filter "Intermittent". Now I have no idea what the latter means, but is it so that the plugin does nothing about the transient filter at all (apart from detecting)? Various internet sources claim that no software decoder does.

* Quite a few of the HDCD tracks (including entire discs) have minimum gain = maximum gain = 0 dB, and both features reported to be "Disabled".  These are the ones which have only been touched by a HDCD-enabled device, but not used any of the features?  I.e., these should be regarded a "non-HDCD with extra noise in the LSB"? (And the plugin does so, when I have checked volume reduction to be applied only when P.E. enabled, right?)

* I found a CD where all tracks except one report gain 0, T.F. disabled, P.E. enabled -- and the exceptional track #2 reporting peak extension as "Intermittent". I can only guess that the entire CD is supposed to be treated equal? Or? How does the plugin react?

* There seems to be some difference between the component and the hdcd.exe utility, as one track which was skipped by the latter, was identified by foo_hdcd -- this on a CD which both of them agree, has both HDCD and non-HDCD tracks.



Then the 24 bits tracks:

* There are a few which peak at .5 or slightly below.  Is this due to hdcd having halved volume on discs with no peak extension? Would these have been better off not coded over to 24 bits?

* Are there other values to look out for? (There are quite a few close to the square root of .5). Other signs so?  For example, while peak scan shows that one end of the bitword is unused, is there any easy scan which will reveal it if the other end is unused?
Title: HDCD Decoder
Post by: Glenda on 2011-12-18 07:07:24
The funny thing is that many so-called HDCDs (from my experience even most of them) don't have either of those features enabled, yet they are labeled as HDCD. But it only means that they were mastered on a HDCD capable device - they contain nothing that needs to be decoded.

They only contain the control bits that will cause the HDCD light on an HDCD capable player to lighten up, so people in audiophile internet forums can rant about how much better this or that album sounds on a HDCD player, not knowing that there's really no difference at all.

Now you should relax and make peace with your wife


The HDCD flag lets you know that the recordings was made with a PM-2 in the studio which many still believe is the best ADC ever made,  it also means the mastering engineer was smart not to use the peak extend/gain/filter. There are also some technical arguments that a recording transferred with an ADC that has the same digital filter as the one you use at home has an advantage.  Google PM2 mastered to study up on it if you are curious.
Title: HDCD Decoder
Post by: markanini on 2011-12-18 10:29:34
Why is the PM-2 considered to be that great exactly?
Title: HDCD Decoder
Post by: Glenda on 2011-12-18 10:56:50
Why is the PM-2 considered to be that great exactly?



Well I am no expert but its all discreet even the converters. Purely engineering theoretical talk you can build an R2R  discrete better than a chip as far as matching.  But this is assuming that you agree R2R is a better means to and end that a 1 bit switcher.  The other thing is the filtering,  the PM engineers were a rare group that understood digital theory and had a solid background in analog sound engineering.  If you search the web you can find some interesting info as far as the history and modern use by some of the top studio guys.

The funny thing about big business is the HDCD "gimmicks" like peak extend wre purely a marketing thing.  I mean if a recording is mastered right you don't need peak extend.  But the legacy is they gave the engineer who designed and built the PM ADC/DAC an unlimited budge to build a handful of the PM2's soley for the major sudios.  And he didn't just take the easy way out,  but did some real hard work and enginnering to build something that turned into a bit of a legacy.  I almost bought one in 2001 for $8k,  now you can't even touch one.  If you are a top-dog studio with the connections you can borrow one,  that says something.


Maybe its all a bunch of audiophile mubo-jumbo,  but who knows.
Title: HDCD Decoder
Post by: kode54 on 2011-12-18 15:17:01
* I have a couple of CDs and at least one isolated track -- which report minimum gain = 0, maximum gain = 0, PE enabled and transient filter "Intermittent". Now I have no idea what the latter means, but is it so that the plugin does nothing about the transient filter at all (apart from detecting)? Various internet sources claim that no software decoder does.

Nope, does nothing but report that the encoder used it.

* Quite a few of the HDCD tracks (including entire discs) have minimum gain = maximum gain = 0 dB, and both features reported to be "Disabled".  These are the ones which have only been touched by a HDCD-enabled device, but not used any of the features?  I.e., these should be regarded a "non-HDCD with extra noise in the LSB"? (And the plugin does so, when I have checked volume reduction to be applied only when P.E. enabled, right?)

Correct, they use no features.

* I found a CD where all tracks except one report gain 0, T.F. disabled, P.E. enabled -- and the exceptional track #2 reporting peak extension as "Intermittent". I can only guess that the entire CD is supposed to be treated equal? Or? How does the plugin react?

The default setting will halve the volume if P.E. is enabled, otherwise not. It probably means it was switched off at some point in the track, although it would need a full graph plot, or at least sample position ranges, to indicate where.

* There seems to be some difference between the component and the hdcd.exe utility, as one track which was skipped by the latter, was identified by foo_hdcd -- this on a CD which both of them agree, has both HDCD and non-HDCD tracks.

This component only checks within the first 5 seconds or so of a track, otherwise ignores it.

* There are a few which peak at .5 or slightly below.  Is this due to hdcd having halved volume on discs with no peak extension? Would these have been better off not coded over to 24 bits?

hdcd.exe would always reduce the volume by half, whether or not the original track used any HDCD features, so peak would often be 0.5 or lower. The only extension which would change this would be Peak Extension.

My component defaults to doubling the output of the HDCD decoder unless P.E. is turned on. This can be changed in the Advanced section of Preferences.

* Are there other values to look out for? (There are quite a few close to the square root of .5). Other signs so?  For example, while peak scan shows that one end of the bitword is unused, is there any easy scan which will reveal it if the other end is unused?

Well, again, unless Peak Extension or Low Level Adjustment are enabled, then the least significant bits won't be used either. It does not attempt to undo the dithering into more resolution than there was in the original signal. So while there may be perceptibly more signal room due to dithering, there is no actual information below the 16 bits of the input signal unless either of those two features is used.
Title: HDCD Decoder
Post by: Porcus on 2011-12-18 21:45:47
@kode54,

thanks for the "customer" support (and for maintaining the thing). Now I played around a bit with the component, and with the hdcd.exe utility on the CD where there was one "intermittent" peak extension (the CD is Clawfinger: s/t). There are some odd results:

(1) hdcd.exe: Does not detect HDCD on any of the tracks.  Maybe due to not scanning the entire track?
(2) your component scanning FLACs: first track "intermittent" peak extension, 9 of the remaining 11 tracks "enabled" (last two not showing any sign of being HDCDs).
(3) I then convert the FLACs from point (2) to WAVs and verify that they are bit-identical, and run your component on these. Result: one more track (#2) showing up as "intermittent" in addition to track #1. (Other tracks as in (2).)
(4) I am not sure how to use your component to encode a HDCD -- I suspect I have to set bit-depth manually? Anyway, I enabled post-processing and converted the WAVs to FLAC. Result was 16-bit, but different from the original, so I suppose I did manage to apply the HDCD decoding. But even then, four tracks (## 3, 4, 6, 10 -- i.e., none of the troublesome "intermittents" from the outset), report as Peak Extension "Enabled".
Title: HDCD Decoder
Post by: Glenda on 2011-12-25 06:04:56
. So while there may be perceptibly more signal room due to dithering, there is no actual information below the 16 bits of the input signal unless either of those two features is used.


Xmas request

Are there any plans to add a button to bypass the hdcd decoder,  so one doesn't have to unistall it when switching between HDCD and HDCD capable DAC's ?

For example my home theater receiver has hdcd,  my main stereo DAC has hdcd,  but my headphone DAC/amp doesn't.  Just seems there should be an off button for the decoder.

Title: HDCD Decoder
Post by: kode54 on 2011-12-25 06:32:09
That should also be up to the player, since it can control whether these post processing filters are enabled per decoder instance.
Title: HDCD Decoder
Post by: Gumboot on 2011-12-26 11:38:29
(1) hdcd.exe: Does not detect HDCD on any of the tracks.  Maybe due to not scanning the entire track?


It detects nothing, or it detects nothing useful?  If the former then you may have got something in your FLAC decode process which messes up the HDCD signalling.  If you used Fb2k then you might want to switch off dither.

It appears to be quite rare for an HDCD disc to do anything useful with the HDCD signalling: http://www.head-fi.org/t/65414/hdcd-list/510#post_7202096 (http://www.head-fi.org/t/65414/hdcd-list/510#post_7202096)
I got similar results in my own quick survey.

There's other information about HDCD here: http://www.hydrogenaudio.org/forums/index....showtopic=30999 (http://www.hydrogenaudio.org/forums/index.php?showtopic=30999)



(4) I am not sure how to use your component to encode a HDCD -- I suspect I have to set bit-depth manually?


Where you say "encode a HDCD" I assume you mean that you want to convert HDCD input into 24-bit PCM output.

As I recall, you declare the encoder (being FLAC or WAV output) as being 24-bit.  Fb2k is floating-point internally, and components like this aren't going to change any explicit bit depth on the data path.
Title: HDCD Decoder
Post by: Porcus on 2011-12-30 14:01:12
This seems more and more like a bug -- versions 1.12 and 1.14 differ in behaviour:


In a posting above, (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=79427&view=findpost&p=779483) I described a case where "Scan for HDCD" yields peak extension
- "Enabled" on file.flac
- "Intermittent" on file.wav
and for the record, they verify as identical using foo_bitcompare.


I just checked this with another computer which used version 1.12, and the issue was not present. Upgraded to 1.14 and applied changes to (= restarted) fb2k, and problem reproduced on that other computer. So, problem seems to be introduced in 1.13 or 1.14. (Both fb2ks were current version 1.10.)



Also, to clarify:
(1) hdcd.exe: Does not detect HDCD on any of the tracks.  Maybe due to not scanning the entire track?

It returns "HDCD not detected".
Title: HDCD Decoder
Post by: felipebw on 2012-01-16 23:57:36
quick question: isn't this plugin bypassed if I use ASIO output?
Title: HDCD Decoder
Post by: SoNic67 on 2012-01-23 02:54:25
I am interested if there are any HDCD encoders that can be added in foobar. If I am playing a 24bit, 88.2kHz (native) file, to be able to convert it to a HDCD 16bit, 44.1kHz with both extensions enabled (to play at 20bit level in my universal DVD player or in my receiver - the WDTV Live that I use doesn't pass over SPDIF the 88.2k files, just the 96k ones).
Title: HDCD Decoder
Post by: Chinch on 2012-02-26 15:36:08
I apologize if this info has already been posted but right now I don't have time to read all 10+ pages of posts, but in experimenting with this, trying to get it to work on a CD rip that I *knew* was HDCD (Tool - Lateralus - 2001), I could not get it to work on FLAC, WAV, using CUE, no CUE, etc.

I had disabled all DSP's and ReplyGain as mentioned, but it still kept saying invalid files or no valid files found.

I found the problem that foobar was reporting these as WAV files (they are Windows .WAV format files)... but I noticed without using the CUE sheet, it reported the WAV file as merely PCM. So, I found this interesting; I went into the CUE file and changed the type after the filename from WAVE to AIFF (this was ripped SINGLE IMAGE+CUE) and I then encode to FLAC and embed the CUE and art.

Back to the point, after changing this line:

FILE "TOOL - Lateralus - 2001.wav" WAVE
to
FILE "TOOL - Lateralus - 2001.wav" AIFF

It now showed all files (when loading the CUE file, which obviously, here, references the indexes in the single WAV image, it reports them as PCM, and the plugin works (albeit it only works on the current file playing when using the variables %hdcd%, etc). Not sure if that is intended or something I'm doing wrong.

Any insights into why this was a problem? I know (at least I believe I know) that the main difference between WAV, PCM and AIFF is basically that WAV is a "Windows" format primarily, whereas AIFF is Mac's preferred format... PCM is like raw audio date, but I *thought* it was equivalent to WAV format... "WAV=PCM"; I know also that WAV (supposedly) cannot hold any tagging data, while AIFF can.

One last question, when using CUETools, there's an option to encode HDCD detected stuff to 24-bit lossless files (FLAC) (which it really plays back as 20-bit, which I understand that is all that HDCD is, anyway...).

I do understand some detailed audio information, such as Nyquist's theorum (to accurately duplicate audio it has to be double the highest + 1 at minimum-- therefore 44,100Hz has to go to say, for example... 89,000Hz and some extra at very minimum for the dB)-- which is what the half the volume has to do with, I trust... which is the vertical axis... whereas the horizontal is split up to certain periods, called samples... and the higher your sampling rate, the smaller your samples will be, and the higher your accuracy will be...

But 16-bit tracks will output up to like 96dBHL or 98dBHL; which I have read is pretty much more than your average stereo system/speakers can reproduce anyway, making the 20-bit/24-bit idea pretty superfluous? 20 or 24-bit goes to 120dBHL or more, (vague recall... this is all just from my head)... but furthermore, this 20/24-bit data is actually stored WITHIN a 16-bit depth digital waveform by some form of using higher frequency hackery to store this, or using data below the human threshold (like 10Hz, for super sure... I know 20Hz is average, but in lab studies they've shown that ppl, esp young children can hear down to 16Hz or 12Hz). Don't worry about answering anything regarding the dynamics of HDCD, I already saw some posts with links to detailed info on HDCD above, so I'll have those to read. (Thanks for the links!)

Insights/corrections? I think I probably need to go re-study the difference between a WAVE file and a PCM file, because I was under the impression that there was no difference -- but if this were true, then changing the file type in the CUE from WAV to AIFF wouldn't have made any difference to the plugin...?

Gotta run, but I'll be sure to read through this whole thread and some more when I get the extra time. Thank you all for reading/any responses!

P.S. Just read this while closing out this tag, saw this in my search results:

Quote
First, WAV and AIFF are almost exactly the same thing. They are both containers for RAW PCM audio. The only difference is that WAV originally was a Microsoft / IBM standard and AIFF originaly was an Apple standard. They both will preserve the resolution of the CD PCM audio perfectly and untouched. The downside is that the size of the files will be exactly the same as it was on the CD and thus very large (about 10MB per minute of CD audio).


I understand this, though... as I sort of explained earlier... I'll look further into the CONTAINER formats though since this says for a fact (hopefully... I didn't know for a FACT that PCM was actually just the RAW data inside WAV container... or that WAV was indeed actually a container, since it didn't support tagging; I would have figured AIFF would be a container more than WAV... anyways, enough... GG)
Title: HDCD Decoder
Post by: Chinch on 2012-02-26 15:45:26
I am interested if there are any HDCD encoders that can be added in foobar. If I am playing a 24bit, 88.2kHz (native) file, to be able to convert it to a HDCD 16bit, 44.1kHz with both extensions enabled (to play at 20bit level in my universal DVD player or in my receiver - the WDTV Live that I use doesn't pass over SPDIF the 88.2k files, just the 96k ones).


I read somewhere that the reason for this is that 88,200Hz <-> 44,100Hz conversion is not as simple or "accurate" of one because of floating point math being used? It said that using 48,000Hz source was much better and more accurate because of the frequency conversion over directly to 96,000Hz was "easier/better". So, having said that... could you try having it use 48,000Hz and then resample it/downsample to 44,100Hz?

Have the others critique that, though.
Title: HDCD Decoder
Post by: kode54 on 2012-02-26 17:27:17
Tool - Lateralus does not use any noticeable HDCD features. It does use the gain level reduction at the very beginning of the first track, but only during a region of digital silence. The rest of the CD has all features disabled, so the output should be identical to the input.
Title: HDCD Decoder
Post by: lukpac on 2012-04-25 21:18:22
OK, but what is done with the signal at all when there's no peak extension enabled? I examined some tracks with foobar and the bit comparison did show some minor differences (~0.01% of the samples), though the peak values were unchanged and I didn't ever bother to try to ABX the tracks.


There should be no difference at all if the volume isn't being halved and there's no peak extension. The signal is otherwise passed through unmodified, except for the conversion from and back to float.


So the differences are most likeley due to rounding error, I guess. But what about this low level extention stuff?


I'm not sure if this is the correct place to address this or not, but...how is the 6dB reduction (regardless of HDCD content) accomplished? I've been doing some comparisons between the original 16-bit audio and the HDCD decoded 24-bit audio, and my concern is that there seems to be a low level signal (dither?) present beyond what is expected for Peak Extension and Low Level Extension (the latter which is quite obvious on the tails of fades). This low level signal is present whether or not the input was HDCD encoded.

Shouldn't HDCD.exe just be doing a bit shift to reduce the level by 6 dB? And then applying PE and LLE where applicable?

This is how I've been looking at things:

1) Load both files in Audacity.
2) Reduce level of original file by 6dB.
3) Invert original file.
4) Export the combined result and analyze.

I'm using 32-bit float within Audacity. Now, I have a feeling there may be some rounding happening in Audacity rather than a simple bit shift, but even so, the above process is resulting in greater low level signal than essentially doing the same thing in Audacity - leaving one file untouched and adjusting the other down by 6 dB and then back up by 6dB.
Title: HDCD Decoder
Post by: lvqcl on 2012-04-25 21:41:54
"bit shift" is 6,020599913...dB, not just 6 dB.
Title: HDCD Decoder
Post by: SoNic67 on 2012-04-29 01:50:06
I think the best thing to do is to use the analog volume control. Not as precise, but who cares, you set the level at what you like anyway... and you don't have to fudge with digital rounding errors.
Title: HDCD Decoder
Post by: lukpac on 2012-04-29 06:39:46
"bit shift" is 6,020599913...dB, not just 6 dB.


Come again?

Edit: Never mind, I found the math. However, do we know if the HDCD volume change is exactly 6 dB or 1 bit? 1 bit certainly seems more logical.
Title: HDCD Decoder
Post by: kode54 on 2012-04-29 17:14:08
The main volume change in this decoder is a bit shift, while the low level extension is in half decibel increments.
Title: HDCD Decoder
Post by: lukpac on 2012-04-29 17:57:31
The main volume change in this decoder is a bit shift, while the low level extension is in half decibel increments.


Ok, thanks. I just tried a null test in Audacity, adjusting the undecoded files by -6.020599913 dB instead of -6 dB, and that does seem to effectively null out everything except the effects of PE and LLRE.
Title: HDCD Decoder
Post by: zdravke on 2012-05-06 09:26:53
Greetings! Thanks for providing this wonderful component to the community, I just discovered it yesterday and it works great!

However, I have one small problem - when I try to convert ape to flac, it seems that HDCD encoding is lost in the process. If I convert to 24-bit, it's gone all the way - however, if I convert to auto or 16-bit, HDCD flag is on for first 10 seconds of the converted track and then it disappears! Any idea what I am doing wrong?

Title: HDCD Decoder
Post by: lvqcl on 2012-05-06 09:42:48
Convert -> Processing -> untick Additional decoding checkbox.
Title: HDCD Decoder
Post by: zdravke on 2012-05-06 10:06:23
Convert -> Processing -> untick Additional decoding checkbox.


Thank you, spot on!
Title: HDCD Decoder
Post by: Porcus on 2012-05-31 10:15:18
Kode54: I refer to the posting below.  Looks like I no longer have any 1.12 version.  Are there anywhere old versions available, which I can use for testing?


This seems more and more like a bug -- versions 1.12 and 1.14 differ in behaviour:


In a posting above, (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=79427&view=findpost&p=779483) I described a case where "Scan for HDCD" yields peak extension
- "Enabled" on file.flac
- "Intermittent" on file.wav
and for the record, they verify as identical using foo_bitcompare.


I just checked this with another computer which used version 1.12, and the issue was not present. Upgraded to 1.14 and applied changes to (= restarted) fb2k, and problem reproduced on that other computer. So, problem seems to be introduced in 1.13 or 1.14. (Both fb2ks were current version 1.10.)



Also, to clarify:
(1) hdcd.exe: Does not detect HDCD on any of the tracks.  Maybe due to not scanning the entire track?

It returns "HDCD not detected".

Title: HDCD Decoder
Post by: godrick on 2012-06-24 03:45:34
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.

Title: HDCD Decoder
Post by: EpicForever on 2012-06-24 13:32:03
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?
Title: HDCD Decoder
Post by: godrick on 2012-06-24 14:46:37
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.
Title: HDCD Decoder
Post by: Porcus on 2012-06-24 17:06:34
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?
Title: HDCD Decoder
Post by: godrick on 2012-06-24 17:10:43
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.
Title: HDCD Decoder
Post by: kode54 on 2012-06-24 18:31:16
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.
Title: HDCD Decoder
Post by: Porcus on 2012-06-24 19:51:53
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 ...
Title: HDCD Decoder
Post by: lukpac on 2012-06-24 21:11:11
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?
Title: HDCD Decoder
Post by: godrick on 2012-06-25 13:14:35
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!
Title: HDCD Decoder
Post by: Glenda on 2012-07-03 06:43:55
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.)
Title: HDCD Decoder
Post by: Porcus on 2012-07-03 07:57:40
What is the best way to "normalize" the volume (loudness) of a 20bit decoded hdcd in the 24 bit package?


ReplayGain? As usual, that doesn't change the files, only the tags.

Title: HDCD Decoder
Post by: Nalyd on 2012-07-20 11:05:24
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.
Title: HDCD Decoder
Post by: Glenda on 2012-07-20 12:21:57
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.

Title: HDCD Decoder
Post by: lukpac on 2012-07-20 13:23:07
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.
Title: HDCD Decoder
Post by: SoNic67 on 2012-07-24 02:04:43
Today I had an automatic update of the HDCD decoder - to version 1.15.
What's new?
Title: HDCD Decoder
Post by: kode54 on 2012-07-24 19:50:29
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.
Title: HDCD Decoder
Post by: SoNic67 on 2012-07-25 00:28:06
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...
Title: HDCD Decoder
Post by: godrick on 2012-07-26 01:49:08
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.
Title: HDCD Decoder
Post by: godrick on 2012-07-27 13:47:35
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!
Title: HDCD Decoder
Post by: kode54 on 2012-07-27 21:21:41
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.
Title: HDCD Decoder
Post by: SoNic67 on 2012-07-28 00:16:39
Cool, didn't know. Thanks!
Title: HDCD Decoder
Post by: torturesauce on 2012-08-26 12:54:54
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.
Title: HDCD Decoder
Post by: db1989 on 2012-08-26 15:35:23
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.
Title: HDCD Decoder
Post by: Zorlac on 2012-08-31 05:49:44
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!!! 
Title: HDCD Decoder
Post by: db1989 on 2012-08-31 08:39:24
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.
Title: HDCD Decoder
Post by: Zorlac on 2012-08-31 09:12:38
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?


I figured out how to get my transport to receive all 24-bits. You have to go into Foobar's Advanced options and set the HDCD decoder to Halve output volume Always. This makes me think the only way to get bitperfect output is via this method when using the HDCD decoder. The Foobar column shows the source bit depth by using %__bitspersample% and the Foobar status bar shows the output after the HDCD decoder processes the source file when using the same %__bitspersample%
Title: HDCD Decoder
Post by: torturesauce on 2012-09-10 17:48:44
I figured out how to get my transport to receive all 24-bits. You have to go into Foobar's Advanced options and set the HDCD decoder to Halve output volume Always. This makes me think the only way to get bitperfect output is via this method when using the HDCD decoder. The Foobar column shows the source bit depth by using %__bitspersample% and the Foobar status bar shows the output after the HDCD decoder processes the source file when using the same %__bitspersample%


However, if you are using the SimPlaylist addon and create a custom %__bitspersample% column, it will show the output instead of the source bit depth, just like the status bar.
Title: HDCD Decoder
Post by: drbeachboy on 2012-10-23 19:48:33
Hi Kode54,

I am having an issue decoding lossless HDCD to another lossless codec or to WAV. If I convert a track to WAV I have "Additional decoding" unchecked, yet the WAV file loses the HDCD encoding. If I delete foo_hdcd.dll and restart fb2k to decode the same file with the same converter settings, the HDCD encoding is intact when I reinstall foo_hdcd.dll. Do you have any idea why this is happening? It seems like postprocessing decoding is happening whether the box is checked or not.

Using version 1.15
Title: HDCD Decoder
Post by: a3aan on 2013-01-05 11:48:10
I discovered that with tracks from Talking Heads – Stop Making Sense  - Special New Edition (http://www.discogs.com/release/534950) the output level is halved in the middle of the track when "Only if peak extension is enabled" is selected. The Scan for HDCD tracks reports that some songs have intermittent peak extension on some not at all (disabled).

Moreover, Beck – Beck (http://www.discogs.com/release/1514540) contains only one HDCD track (without peak extension).

These (exceptions) require another approach for halving the output level, probably tag based. Else, 'Always halve the output' seems to be the one I need.

Oh well...

Cheers,
Adriaan.
Title: HDCD Decoder
Post by: kode54 on 2013-01-06 20:33:20
Hi Kode54,

I am having an issue decoding lossless HDCD to another lossless codec or to WAV. If I convert a track to WAV I have "Additional decoding" unchecked, yet the WAV file loses the HDCD encoding. If I delete foo_hdcd.dll and restart fb2k to decode the same file with the same converter settings, the HDCD encoding is intact when I reinstall foo_hdcd.dll. Do you have any idea why this is happening? It seems like postprocessing decoding is happening whether the box is checked or not.

Using version 1.15

That would be beyond my control, as that setting is supposed to be observed by all postprocessed inputs, unless something recently broke in the converter.
Title: HDCD Decoder
Post by: EpicForever on 2013-01-26 17:24:09
What is the probability of detecting presence of HDCD coding erroneously? I mean - how possible is that foo_hdcd reports HDCD coding erroneously on tracks that aren't HDCD encoded? I found one double CD compilation that shows surprisingly as HDCD (but not every track - ca 8 from 34 tracks aren't displayed as HDCD). It is soundtrack from PSP game Ridge Racers, released in Japan. It was released twice. First release appers to be HDCD encoded in foobar, but second edition is shown as simple Audio CD... I can't just bitcompare them as newer edition has audio signal placed after several samples of silence (audio tracks begin just several samples later than in previous edition, or it's just case of different ripping settings). That tracks that are detected to be HDCD encoded doesn't use any HDCD features - PE is disabled, TF is disabled, gain is 0,0 dB... What should I think about it?
Title: HDCD Decoder
Post by: lvqcl on 2013-01-26 20:25:58
I found an album where foo_hdcd works very strange.
Title: HDCD Decoder
Post by: a3aan on 2013-01-26 21:49:32
I found an album where foo_hdcd works very strange.

With what settings? See post #329 (http://www.hydrogenaudio.org/forums/index.php?showtopic=79427&st=325&p=819492&#entry819492).
Title: HDCD Decoder
Post by: lukpac on 2013-01-30 07:01:48
I can't just bitcompare them as newer edition has audio signal placed after several samples of silence (audio tracks begin just several samples later than in previous edition, or it's just case of different ripping settings).


Why can't you edit the start points to match and then compare them?
Title: HDCD Decoder
Post by: EpicForever on 2013-01-30 07:55:01
As far as I know you don't say about internal function of bitcomparator. So you think that I should edit tracks in some wave editor?
Title: HDCD Decoder
Post by: Vodnik on 2013-02-19 21:37:09
Could someone please explain to me the consequences of setting the "halve output volume" parameter to Never for HDCD encoded track with peak extension feature present? Does it effectively disable the peak extension?
Title: HDCD Decoder
Post by: Porcus on 2013-02-20 10:38:24
As far as I know you don't say about internal function of bitcomparator. So you think that I should edit tracks in some wave editor?


If the album is in AccurateRip, you can check both; if the same track-by-track checksums show up but with different offset, then they are different pressings of the same master.
Title: HDCD Decoder
Post by: GeSomeone on 2013-02-24 23:58:37
.. "halve output volume" parameter to Never for HDCD encoded track ..? Does it effectively disable the peak extension?

No it doesn't. In foobar2000 the whole decoding and DSP chain is floating point.
So at the output stage you have the combination of decoded input, replaygain, (preamp setting) and DSP chain (I might forget something). If you worry about clipping caused by peak extension, put the "advanced limiter" at the end of your active DSPs and you're good.
Title: HDCD Decoder
Post by: jacobacci on 2013-03-24 09:59:59
Hi,
When I try to download foo_hdcd.dll 1.15 from the official foobar repository I get redirected to the main foobar program download page. Has foo_hdcd.dll disappeared?
Title: HDCD Decoder
Post by: marc2003 on 2013-03-24 10:06:53
works for me. i *think* the links on the page might be dynamically generated and may expire after a certain time. perhaps you had the page open for a long time before clicking download?
Title: HDCD Decoder
Post by: EpicForever on 2013-03-24 10:12:35
i *think* the links on the page might be dynamically generated and may expire after a certain time.


It is exactly like that. I know it from my experience  . Waiting half a day before clicking "download" gives results described by GeSomeone.
Title: HDCD Decoder
Post by: SoNic67 on 2013-03-25 02:19:19
I found an album where foo_hdcd works very strange.

What's strange? It has Gain=0, Peak Extend=yes, Transient Filter=no...
Title: HDCD Decoder
Post by: lvqcl on 2013-03-25 14:55:06
What's strange?

The left channel is OK(?), but the right channel becomes 4 dB quieter than it should be.

Also, standalone hdcd.exe doesn't detect HDCD encoding.
Title: HDCD Decoder
Post by: SoNic67 on 2013-03-28 22:53:55
Sometimes this is how they are recorded. Right is lower on kode54 add-on, but maybe voice is panned onto that channel latter in the song? When I have time maybe I will test it on one of my hardware HDCD players.
Title: HDCD Decoder
Post by: torturesauce on 2013-04-01 15:28:19
I've had the same problem with the album lvqcl mentioned.
Title: HDCD Decoder
Post by: Sandrine on 2013-04-02 09:51:40
I found an album where foo_hdcd works very strange.


Haven't actually listened to it, but if I deduce from the title that this is the Genesis track, maybe Robert Fripp incorporated his Frippertronics even in the HDCD encoding  Anyway, I heartily recommend the SACD version.
Title: HDCD Decoder
Post by: lvqcl on 2013-04-02 15:51:27
Haven't actually listened to it, but if I deduce from the title that this is the Genesis track

http://en.wikipedia.org/wiki/For_the_Masses (http://en.wikipedia.org/wiki/For_the_Masses), track #2
Title: HDCD Decoder
Post by: Sandrine on 2013-04-02 20:40:50
I've been testing with my own CD's a bit and something strange is going on. Replaygain is on (album/apply gain). I've listened to Asia/Asia (2010 Gold HDCD) and Boz Scaggs/Speak Low (2008 HDCD) through headphones and both are reproduced considerably louder than "normal" CDs, even though I've set "Halve Output: Always". How can I check if HDCD decoding is being done, because I get a feeling that it's not ("Scan for HDCD tracks" produces results on both discs). I've cleared the DSP for the test.

Update: For shits and giggles I installed foobar2000 1.2 and lo and behold, now my statusbar shows "HDCD 24bit". I deduct there is a bug in the current 1.2.4 processor. 1.2.3 works correctly, too.

My statusbar script:
$if(%ispaused%,Paused,Playing) | %codec% | %bitrate% kbps | %samplerate% Hz | $if(%__bitspersample%,%__bitspersample% bit | ,)$if(%__hdcd%,HDCD | ,)$caps(%channels%) | %playback_time%[' > '%length%]

Update update:
Could someone please notify the powers that be that this seems to be a core bug, since we are in the 3rd party forum
Title: HDCD Decoder
Post by: Sandrine on 2013-04-12 17:24:02
Seems to be fixed in 1.2.5b1.
Title: HDCD Decoder
Post by: Despair on 2013-04-12 18:16:46
So since I don't really want to read 14 pages here, can anyone tell me what settings I should use to try to decode the HDCDs? Or do you just have to play around with it to get the best settings? I'm entirely new to this.

I read elsewhere that none of the decoders use the filters, do they not make a big difference?

And finally, could I use this plugin with a WAV rip of an HDCD? SInce I'd like to use EAC to make sure it's accurate and all.
Title: HDCD Decoder
Post by: SoNic67 on 2013-04-13 13:06:09
Seems to be fixed in 1.2.5b1.

Yes it is fixed (1.2.3, 1.2.4).
PS: My status bar is:
Code: [Select]
%codec% | %bitrate% kbps | %samplerate% Hz | $if(%__bitspersample%,%__bitspersample% bit | ,) %channels% | %playback_time%[ / %length%] | $if($info(hdcd),'(HDCD:',) $if($info(hdcd_gain),Gain= $info(hdcd_gain) Peak Extend=$info(hdcd_peak_extend) Transient Filter=$info(hdcd_transient_filter)')',)
Title: HDCD Decoder
Post by: Case on 2013-04-13 14:34:09
can anyone tell me what settings I should use to try to decode the HDCDs? Or do you just have to play around with it to get the best settings? I'm entirely new to this.


Defaults are OK. If you don't use ReplayGain proper HDCD files will play at half the volume compared to your regular CDs. If you change the volume halving setting to Never, then peak extension utilizing tracks would clip. If you use ReplayGain then the setting doesn't matter, as long as albums are re-replaygained if the halving setting is toggled.

Quote
could I use this plugin with a WAV rip of an HDCD? SInce I'd like to use EAC to make sure it's accurate and all.


Absolutely. Infact if you ripped with foobar2000 with this component installed, you'd have to be careful not to cripple the files unintentionally.
Title: HDCD Decoder
Post by: Despair on 2013-04-13 19:38:44
So I should just set the volume halving to only if peak extension is enabled? And I'm not seeing an option for replaygain.
Title: HDCD Decoder
Post by: SoNic67 on 2013-04-13 19:55:59
Don't worry about replay gain. Is another foobar component, not part of HDCD. Worthless for CD sources in my opinion.
Title: HDCD Decoder
Post by: Despair on 2013-04-13 20:50:08
Alright, but as it stands I can't seem to do anything with the WAV files. the HDCD scanner confirms they're HDCD, but I don't see any option to converting them to the higher bits
Title: HDCD Decoder
Post by: EpicForever on 2013-04-13 22:02:17
You can. Use built in Coverter and in Processing section configure it to "Enable decode postprocessing". I'm not sure whether you have to manually select bit depth for output files or it will be set automatically in such situation - test it on your own.
Title: HDCD Decoder
Post by: Despair on 2013-04-13 23:52:18
Not seeing any difference. If both the peak extension and the transient filters are disabled, I'm guessing there is no change, right? In that case both my HDCD's are useless as HDCD
Title: HDCD Decoder
Post by: lukpac on 2013-04-16 05:58:25
Not seeing any difference. If both the peak extension and the transient filters are disabled, I'm guessing there is no change, right? In that case both my HDCD's are useless as HDCD


The filters don't matter for decoding. What *do* matter are peak extension and low level range extend.
Title: HDCD Decoder
Post by: Despair on 2013-04-16 07:50:00
Not seeing any difference. If both the peak extension and the transient filters are disabled, I'm guessing there is no change, right? In that case both my HDCD's are useless as HDCD


The filters don't matter for decoding. What *do* matter are peak extension and low level range extend.


Right, but if the scanner says peak extension is disabled doesn't that mean there's no change? I'm not seeing/hearing any low level extension either so I'm assuming that's the case.
Title: HDCD Decoder
Post by: Porcus on 2013-04-16 12:50:41
The filters don't matter for decoding.


What do they do then? I know that there is no software implementation (not foo_HDCD, not hdcd.exe, not WMP), but what are they really there for? Anyone?
Title: HDCD Decoder
Post by: kode54 on 2013-04-16 12:53:59
I had heard that it merely indicated which filter the ADC chose for that block, and that the resulting digital signal was meant to be played with a filter that was a balance between the two. Or something like that. Maybe you'll have some luck digging that up from this or other HDCD topics on this forum?
Title: HDCD Decoder
Post by: Porcus on 2013-04-16 12:57:37
Right, but if the scanner says peak extension is disabled doesn't that mean there's no change? I'm not seeing/hearing any low level extension either so I'm assuming that's the case.


If the scanner says no peak extension and no low level extension (and no filters), then this HDCD just has a flag saying “I'm a HDCD and the following features are used:” (with nothing listed). Then a HDCD decoder will just pass it through (unless you have set the 6dB reduction to “always”).

If the scanner says no peak extension and no low level extension but transient filters applied (not that I have ever encounted one), then it is for all practical purposes the same as without the filters, as long as you stick to software solutions.
Title: HDCD Decoder
Post by: EpicForever on 2013-04-16 18:15:00
I'm still wondering how likely is false poitive report of HDCD file by HDCD plugin? Especially when there are no HDCD features reported. Is there a method that is intended to check whether file is being HDCD encoded with least 95% certainty?
Title: HDCD Decoder
Post by: kode54 on 2013-04-17 00:36:47
A full scan would be necessary. The current playback detection requires at least two consecutive HDCD packets to continue decoding at least until the end of the track, otherwise it gives up. It also rewinds to the start of the track and restarts decoding from the beginning, in case the first packet is delayed well into the audible portion, so that any peak extension or gain level adjustment is applied continuously.
Title: HDCD Decoder
Post by: SoNic67 on 2013-04-17 01:46:41
If the scanner says no peak extension and no low level extension (and no filters), then this HDCD just has a flag saying “I'm a HDCD and the following features are used:” (with nothing listed). Then a HDCD decoder will just pass it through (unless you have set the 6dB reduction to “always”).

Yes. I already said, there are discs that where mastered on HDCD recording equipment, because of the ADC filters quality. However, the sound engineer choose not to use dynamic range extension (virtual 20 bit), in order to sound the same on any HDCD or CD player or from other reasons (transients). However, the last bit that is used to encode HDCD will be lost.
Does it matter? On some recordings it does not, because the total dynamic of source is below the 15 bit level. It's up to the recording engineer to determine that.

Remember, 15bit of real resolution equal to a THD+N=0.003%. How many players reach that number?
Title: HDCD Decoder
Post by: EpicForever on 2013-04-17 18:10:08
I'm not sure whether to post it here or just sent a private message to you kode54. But OK, I decided to clearly explain my problem in public.
So the history goes like this:
My friend got PSP and a game Ridge Racers PSP. I loved the music, I wanted CD and yes, it was released in Japan of course, in 2005 under cat# KICA 1366-1367. But it was out of print at the time when I wanted to get it. So I downloaded whole 2CD compilation illegaly from the internet in form of FLAC files with additional cuesheet. I listened to it and it was fine. In 2007 this compilation was re-released under cat# KICA 1441-1442 with bit different coverart. I was lucky to buy original copy of re-release version in about 2009. However I haven't deleted my first illegal copy. In ca. 2010 I started upgrading foobar. One of upgrades was adding HDCD support as I own 4 original CDs with HDCD remastered albums of Mike Oldfield - Amarok, Tubular Bells, Incantations and Ommadawn. That was the only option for me to decode HDCD signal as my CD players were always inexpensive. After some time things changed, HDCD decoder wasn't DSP anymore, I got problems with dterminating whether my foobar installation really decodes HDCD or not, that's how I came to this forum. Some time has passed from that moment. And suddenly, several weeks ago I discovered that the old, illegal copy of first Ridge Racers PSP soundtrack (KICA 1366-1367) reports being HDCD encoded. But not all the tracks, some of them are loosing HDCD status after several seconds, and all the rest reports that it uses any of the HDCD features - gain is 0, PE is disabled and TF is of course disabled. Re-released version (KICA 1441-1442) is not HDCD encoded. Any track. All the tracks that are present on these CDs were produced digitally, on computers using software synthesizers - there was no transfer from analog to digital, so I don't think that it could even be passed through HDCD equipment to catch any benefit of it's glorious ADC converters. But first edition shows up as HDCD. Even after full scan. And even the tracks that loose their HDCD status during playback shows up as HDCD in full scan report. Because of differencies in ripping process tracks from both editions have bit different durations and definitely there are shifted beginnings of the tracks (tracks from KICA1366-1367 start after ~1 sec. of silence, tracks from my EAC Secure rip starts immediately).Because of that I can not perform simple comparison of the tracks. I wanted to know for sure whether there are so big differencies between both editions. I wanted to know for shure whether first edition was really HDCD encoded which seems strange to me. What should I do kode54? Send you an e-mail with links to uploaded all files from all discs of both compilations ? Please, give me some advice... I don't have and I never had any access to hardware HDCD player so I can't just burn CD and check it in such way.
Title: HDCD Decoder
Post by: Charles Hansen on 2013-06-06 01:41:27
A full scan would be necessary. The current playback detection requires at least two consecutive HDCD packets to continue decoding at least until the end of the track, otherwise it gives up. It also rewinds to the start of the track and restarts decoding from the beginning, in case the first packet is delayed well into the audible portion, so that any peak extension or gain level adjustment is applied continuously.


Hello Kode54,

Please note that (unless I am misunderstanding your post) your playback detection method is not necessary and inefficient.

If you read the Instruction Manual for the HDCD Encoder (PM me and I can e-mail you a copy), in the section labeled "Compact Disc Release Mastering" it states:


"HDCD Silence
When producing HDCD release masters, at least 200 milliseconds (1/5 second or 6 NTSC
video frames) of “HDCD Silence” must be provided before the beginning of each segment of
program audio. HDCD Silence is simply an HDCD signal with no program content. “Digital
(Video) Black” may be inserted prior to the 200 msec of HDCD Silence and immediately
following the end of HDCD program audio. The 200 msec of HDCD Silence allows HDCD
playback equipment time to perform any necessary switching or level adjustment."

This means that if any song has any HDCD process applied to it that there will be at least 200 milliseconds of HDCD signal in the pre-track gap.

You do not need to scan the entire song -- only the silence between the songs. This will be sufficient to inform the decoder if any decoding is required.

Also it is extremely rare for a commercial disc to have a mix of HDCD and non-HDCD tracks. Only a few test discs, and perhaps some compilation discs that were made from different mastering sessions. On the other hand, compilations made by users could easily have a mix of HDCD and non-HDCD tracks. Furthermore, the pre-track gap would probably not have the HDCD code that is required by a commercially released compilation.

Hope this helps,
Charles Hansen
Title: HDCD Decoder
Post by: Charles Hansen on 2013-06-06 02:09:50
I had heard that it merely indicated which filter the ADC chose for that block, and that the resulting digital signal was meant to be played with a filter that was a balance between the two. Or something like that. Maybe you'll have some luck digging that up from this or other HDCD topics on this forum?


Hello Kode54,

There is no explicit documentation for this anywhere, but the datasheet for both the original Pacific Microsonics PMD-100 HDCD decoder/digital filter chip and the later 192/24 capable PMD-200 (PM me if you would like a copy e-mailed) shows only one frequency response curve.

I therefore contacted one of the developers regarding the topic of the embedded flag that shows which anti-aliasing filter (of the two available) was used during a given section of the recording. He confirmed that there was only ever one playback filter. When I e-mailed him again to ask why the flag was included, he never replied. I assume that they had planned to use it but either could not find a good way to do so (eg, it would interfere with proper playback on a non-HDCD player) or they simply ran out of time and/or money to do so.

Therefore there are only two relevant processes that require decoding:

1) Peak Extend-- this is constant for the entire track and compresses the top 9 dB of signal into only 3 dB of bits of a linear scale (normal) recording.

2) Low Level Extension -- this is a dynamically varying amount of gain that is applied to the track, but only takes effect when the recorded signal level is below -45 dBFS. This is extremely rare in any recording. On pop music, I have only ever seen this activated in the fade-out between tracks, and in classical music only during a very quiet passage with only one or two instruments playing. In fact it is so rarely used, that it is almost not worth decoding it.

On the other hand, every recording made with this A/D converter will light the HDCD inidcator, ever if neither of the two features above was enabled during the recording process. I call these "fake HDCD's". Some examples are the Grateful Dead re-issues. The mastering engineer chose to use the Pacific Microsonics converter for personal reasons, but did not enable any features that require decoding. Yet when played on a HDCD-capable player, the HDCD light will come on, apparently in an attempt to scare people into thinking that they need to purchase an HDCD-capable CD player....  Sleazy marketing practice at best, although that converter was very well engineered and had higher performance than any other converter of its day.

Best regards,
Charles Hansen
Title: HDCD Decoder
Post by: lukpac on 2013-06-06 02:21:09
2) Low Level Extension -- this is a dynamically varying amount of gain that is applied to the track, but only takes effect when the recorded signal level is below -45 dBFS. This is extremely rare in any recording. On pop music, I have only ever seen this activated in the fade-out between tracks, and in classical music only during a very quiet passage with only one or two instruments playing. In fact it is so rarely used, that it is almost not worth decoding it.


It's rare that any pieces will have long passages at levels that low. But I'd argue that short sections (mostly fades, but also pauses within songs) aren't rare at all, and can be quite noticeable. For years I wondered why the hiss on the Buffalo Springfield HDCD remasters got noticeably louder during the fades. Turns out it was LLE.
Title: HDCD Decoder
Post by: kode54 on 2013-06-06 04:05:42
This means that if any song has any HDCD process applied to it that there will be at least 200 milliseconds of HDCD signal in the pre-track gap.

And foobar2000 itself does not decode the track pre-gap. And I've seen HDCD continue across track boundaries on gapless albums.

The whole purpose of detection is so that my component does not run on non-HDCD content longer than it has to, as it definitely slows decoding down, although not by a margin noticeable by means other than unthrottled benchmarking.
Title: HDCD Decoder
Post by: Porcus on 2013-06-10 17:35:08
Charles Hansen: Thanks for the info on the filter. I've been curious enough to google quite a bit around for that piece of information.


This means that if any song has any HDCD process applied to it that there will be at least 200 milliseconds of HDCD signal in the pre-track gap.

You do not need to scan the entire song -- only the silence between the songs. This will be sufficient to inform the decoder if any decoding is required.


But a CD player does not start at the pregap, it starts at index 01. Index 00 is only played if one plays across the last index of the previous track, or rewind. It is quite common upon ripping to append the pregap to the previous track. Therefore, when you skip to track X, the pregap won't even be noticed, as kode54 points out.

(Do ordinary CD players even read the audio of the pregap when skipping to a given track?)
Title: HDCD Decoder
Post by: rbbert on 2013-06-16 18:51:03
...
On the other hand, every recording made with this A/D converter will light the HDCD inidcator, ever if neither of the two features above was enabled during the recording process. I call these "fake HDCD's". Some examples are the Grateful Dead re-issues. The mastering engineer chose to use the Pacific Microsonics converter for personal reasons, but did not enable any features that require decoding. Yet when played on a HDCD-capable player, the HDCD light will come on, apparently in an attempt to scare people into thinking that they need to purchase an HDCD-capable CD player....  Sleazy marketing practice at best, although that converter was very well engineered and had higher performance than any other converter of its day.

Best regards,
Charles Hansen


Actually, the overwhelming majority of the GD releases have PE and LLE enabled.  The two most recent ones don't, which may represent a trend.
Title: HDCD Decoder
Post by: EpicForever on 2013-06-16 20:06:11
But a CD player does not start at the pregap, it starts at index 01. Index 00 is only played if one plays across the last index of the previous track, or rewind. It is quite common upon ripping to append the pregap to the previous track. Therefore, when you skip to track X, the pregap won't even be noticed, as kode54 points out.

(Do ordinary CD players even read the audio of the pregap when skipping to a given track?)


Why are so sure about CD starting exactly at block 0 of second 0 of given track? I used many CD players - my own, my friends', my parents', my uncles' etc. They got lots of differences - some of them were starting several blocks/frames after real start of track (it was audible when track was starting with strong beat as first sound at very beginning - that beat was always cut at the beginning), and some of them were starting several blocks/frames before track was starting (it was audible on mixed CDs with electronic music, when some beat from previous track was audible as a short crackle in next track). I assume that all CD players suffer the same thing as computer CD-ROMs, which need to be set to start reading for example at +102 or +667 samples (my LG drives). Other thing is that I don't see a problem with CD player reading pre-track gap silently, and starting playing audio after certain point. Of course there is a question if anyone made such algorithm working inside of any CD, but maybe those capable of HDCD are working this way?
Anyway - it seems that HDCD is a regular product for audiophiles. Seems it never really works (like most of products for audiophiles - golden power sockets for example) because of audio signal properties, it was never properly finished at engineering stage, but it cost more than regular CD player (the aim of all audiophile products - higher price). And it seems that it's able to produce false positive reports (like with my Ridge Racers CD).
Title: HDCD Decoder
Post by: Boiled Beans on 2013-08-17 20:12:45
I discovered that with tracks from Talking Heads – Stop Making Sense  - Special New Edition (http://www.discogs.com/release/534950) the output level is halved in the middle of the track when "Only if peak extension is enabled" is selected. The Scan for HDCD tracks reports that some songs have intermittent peak extension on some not at all (disabled).

Moreover, Beck – Beck (http://www.discogs.com/release/1514540) contains only one HDCD track (without peak extension).

These (exceptions) require another approach for halving the output level, probably tag based. Else, 'Always halve the output' seems to be the one I need.

Oh well...

Cheers,
Adriaan.


I've found an odd CD. It's Madonna's GHV2. Only 2 tracks are HDCD - "Don't Cry for Me Argentina" and "Beautiful Stranger".

In "Don't Cry for Me Argentina", the Transient Filter status constantly flickers between 'yes' and 'no' during some sections of the song.

Also it isn't consistent. For example, around 3:15, Transient Filter says 'yes'. The song plays on for a while, then I drag the foobar slider back to 3:15. Now the Transient Filter says 'no'.

Another problem is a drop-out at 3:27, when Madonna sings the word "Argentina". One of the channel drops out momentarily if decoded with the HDCD decoder, for both the 'Always' and 'Never' halve volume settings. If I don't use the HDCD decoder, then there is no problem, it plays smoothly.

For "Beautiful Stranger", the Peak Extend status is 'yes'. But looking at the waveforms for both the non-decoded and decoded version, the only difference is the decoded version is quieter. If I zoom in, there doesn't seem to be any extra dynamics at all.
Also, they both sound the same when ReplayGain matched, I can't ABX them at all.
Title: HDCD Decoder
Post by: drSeehas on 2013-08-18 06:44:44
... If the scanner says no peak extension and no low level extension but transient filters applied (not that I have ever encounted one), ...

Hm, look at this:
Code: [Select]
HDCD Detected
Decoding Statistics:
  Packets Processed              : 941
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 3091
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 2430
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 1834
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 1290
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 2708
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 1792
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 1669
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 4471
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 1780
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 2542
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
HDCD Detected
Decoding Statistics:
  Packets Processed              : 2452
  Peak extend                    : Never enabled
  Minimum gain                   : 0.0dB
  Maximum gain                   : 0.0dB
  Transient filter (Unsupported) : Enabled intermittently
...
Title: HDCD Decoder
Post by: d125q on 2014-02-10 12:00:53
How come I am unable to read $info(hdcd) from within a WSH panel? Trying to use something like fb.TitleFormat("$info(hdcd)").EvalWithMetadb(fb.GetNowPlaying()) simply doesn't work.

EDIT: Okay, I assume that the WSH simply isn't aware of the HDCD decoding that is going on. Putting fb.TitleFormat("$info(bitspersample)").EvalWithMetadb(fb.GetNowPlaying()) on a HDCD-encoded track yields 16, whereas $info(bitspersample) in the status bar yields 24 (since the status bar is completely aware of HDCD and can also use $info(hdcd) and so on). Can anyone confirm this?
Title: HDCD Decoder
Post by: kode54 on 2014-02-11 00:37:34
Obviously, WSH panels are unaware of dynamically generated track information, which is updated after the file starts playing.
Title: HDCD Decoder
Post by: marc2003 on 2014-02-11 03:13:23
Quote
// Dynamic info (VBR bitrate etc) change
function on_playback_dynamic_info() {}

// Per-track dynamic info (stream track titles etc) change. Happens less often than on_playback_dynamic_info().
function on_playback_dynamic_info_track() {}

// Called every second, for time display
// time - float value, in sec
function on_playback_time(time) {}


edit: you should try fb.TitleFormat("$info(hdcd)").Eval() rather than EvalWithMetadb.
Title: HDCD Decoder
Post by: kode54 on 2014-02-11 03:54:30
Oh good, I love when it's merely user error and not a shortcoming in the relevant component.
Title: HDCD Decoder
Post by: krabapple on 2014-02-25 21:29:17
FWIW, the HDCD remaster of Mike Oldfield's Ommadawn is only semi-HDCD; the indicator light goes off during the last track ('On Horseback') .  An odd mastering decision.....
Title: HDCD Decoder
Post by: ChronoSphere on 2014-02-26 16:13:21
Hmm, having the hdcd decoder plugin active, all my HDCD rips* fail the integrity check. Removing the plugin results in passing.
Is it possible to make the decoder not decode HDCD when running an integrity check? If not, then maybe an option to temporary turn it off to be able to verify the rip.

*those with peak extend.
Title: HDCD Decoder
Post by: Porcus on 2014-02-26 18:45:43
Hmm, having the hdcd decoder plugin active, all my HDCD rips* fail the integrity check.


You mean the AccurateRip verification? They don't show up as decoding failed?


FWIW, the HDCD remaster of Mike Oldfield's Ommadawn is only semi-HDCD; the indicator light goes off during the last track ('On Horseback') .  An odd mastering decision.....


What features are enabled on the last track? As pointed out by someone, it goes on if it goes through a particular processor often found in studios, even when no features are enabled.
Title: HDCD Decoder
Post by: ChronoSphere on 2014-02-26 18:53:19
No, I mean the integrity verification which decodes the track and compares it with the checksum stored in the file. Obviously, the file contains the checksum of the "redbook version" while hdcd decoder decodes the "hdcd version", so audio checksums don't match.

edit: though I guess it's the same foo_verfier plugin for both integrity and accuraterip. Accuraterip also fails for the same reason...
Title: HDCD Decoder
Post by: torturesauce on 2014-05-16 01:52:43
http://en.wikipedia.org/wiki/For_the_Masses (http://en.wikipedia.org/wiki/For_the_Masses), track #2


I have found another album like the one lvqcl mentions that has the same problem - 12 Rounds' "Pleasant Smell" (http://www.discogs.com/12-Rounds-Pleasant-Smell/release/310912) single. The right channel is quieter than the left one in all channels, no matter which HDCD Halve output volume setting I use (when I use "Never", both channels become louder, but the right one still isn't as loud as the left one).

Here's a screenshot from foobar's Waveform Seekbar of one track from "Pleasant Smell" when decoded with HDCD Decoder:
(http://i.imgur.com/WUNxOF7.png)

Here's the same track loaded in Audacity:
(http://i.imgur.com/sCIJoNw.png)

I can confirm the same thing happens with the "For the Masses" album. lvqcl posted a 15-second sample of the song "Fly on the Windscreen" two pages back, and it also happens with all the other tracks in the album. I can post a 15-second sample of a "Pleasant Smell" track too, if needed.

Edit: This does not happen with any other HDCD's I've tested.
Title: HDCD Decoder
Post by: kode54 on 2014-05-16 09:18:15
Neat, an HDCD that only encodes the signaling information in one of the stereo channels. I'm open to suggestions as to how to deal with this.
Title: HDCD Decoder
Post by: ChronoSphere on 2014-05-16 12:15:58
Would it make sense to apply the signaling information to both channels? If not, then dropping that information seems best to me.
Title: HDCD Decoder
Post by: Porcus on 2014-05-16 14:11:20
This has HDCD flags in one channel (and the same, continuously)?

If so:
A first feature request would be scan/detect/report.
A second would be a playback-by-tag.

Maybe one should have two or three tag fields to deal with this. Like:

<HDCD_DETECTED>: This writes a "comprehensive" report of what a scan finds, enough to know what you would do upon decoding. Should not be written unless the track is completely scanned (i.e. not from scanning just the first part). Could even - in a more advanced version - report whether the HDCD decoding would actually do anything. To keep the length of the HDCD_DETECTED tag down, it could prescribe e.g. HDCD=SCAN or PE=FULLSCAN, which effectively tells the component to read it from a scan every time it wants to know it.

<HDCD_DECODE>: This specifies what to actually do. Values could be e.g. PE=YES; LLE=LEFTONLY or e.g. HDCD=NO. Default for each switch would be whatever information is read out from the HDCD_DETECTED tag, and in the absence of such, default to scanning (like today).

The HDCD_DETECTED tag need not be there if the user is satisfied with having a HDCD_DECODE tag that does not tell whether it is an override or a scan result. If HDCD_DETECTED present, then the component could report an error if it does not match the actual content (e.g. if it is changed by mistake, or in the hypothetical situation that the component has had a necessary bugfix).
Title: HDCD Decoder
Post by: mysterix on 2014-06-24 08:07:39
I use ReplayGain with an "Processing: Prevent clipping according to peak" option. So, gain itself is not used and ReplayGain does nothing  without it on lossless sources. Will HDCD-decoder work in this case? I loaded an HDCD-album and the decoder recognized it by $info(hdcd) bit during playing.
P.S. Are you planning to add Monkey's audio and ALAC support?
Title: HDCD Decoder
Post by: kode54 on 2014-06-24 08:38:59
Monkey's Audio and ALAC support are out of my control, as they need to be implemented by the decoder component, not mine.
Title: HDCD Decoder
Post by: mysterix on 2014-06-24 08:52:27
And what about my previous question? I mean that I use ReplayGain for clipping protection in mp3's only and just leave option enabled when listen to lossless. But seems you wrote that HDCD decoder will not work with ReplayGain enabled. So, that is my question - will HDCD-decoder work when no gain really used but just with an "Prevent clipping according to peak" option ticked on? Does true value of $info(hdcd) during playback mean that HDCD-decoder works in my case?
Title: HDCD Decoder
Post by: drbeachboy on 2014-06-24 14:42:37
Monkey's Audio and ALAC support are out of my control, as they need to be implemented by the decoder component, not mine.

ALAC is supported in fb2k. All my HDCD's decode fine in ALAC or am I missing something else that the OP is questioning?
Title: HDCD Decoder
Post by: kode54 on 2014-06-25 02:52:20
The HDCD decoder works regardless of ReplayGain support. However, changing the gain settings around will break existing ReplayGain tags.
Title: HDCD Decoder
Post by: jacobacci on 2015-04-26 12:21:08
I have been struggling a bit, getting the foobar HDCD plugin to work and would like to make sure that I am doing this correctly.

I have loaded up the undecoded FLAC files and when I play them the status line of foobar shows HDCD = yes and the relevant HDCD parameters. So everything seems to be installed correctly.

Now I would like to convert / HDCD decode these files.
Right click, open the convert dialogue. Check the tick box "additional decoding" under processing.
Output format FLAC.

Now for my problem:
If I chose AUTO for the output bit depth of FLAC, the conversion result is a FLAC file, which the foobar status line lists as 24bit/44.1kHz HDCD=yes
If I chose 24bit for the output bit depth of FLAC, the conversion result is a FLAC file, which the foobar status line lists as 24bit/44.1kHz HDCD=no

The second file seems to be decoded, the first one not.
It this a bug?

Thanks a lot
Title: HDCD Decoder
Post by: kode54 on 2015-04-27 05:43:04
The first file is also decoded, but it's still 16 bits, and apparently the decoding did not have any impact on the actual bit depth, as the least significant bit at 16 bits is still passing through HDCD information.
Title: HDCD Decoder
Post by: Paesc on 2015-05-25 09:08:46
Great plugin. Gives Foobar2000 another advantage over other many audio software.

Output format:
In Foobar, the output format in Preferences - Playback - Output is 16-bit by default. I haven't seen a comment if this needs to be changed. To make use of the HDCD decoder, version 1.15, do I need to change the bit depth to 24-bit? Or can I just leave it at 16-bit?

View - Console:
The HDCD detection is displayed in the left bottom edge by the Syntax $if($info(hdcd),'HDCD'). It shows HDCD when a HDCD track is played. So if no HDCD tracks are played, the field simply is left blank. It works well so far. However, in View - Console, there is no information that a HDCD track has been detected. Do I need to change something, or is my installation faulty? Maybe this is not showed in the Console anymore?

Any other changes required after installation?
Is there anything that needs to be changed at all after the HDCD plugin has been installed from the Foobar Components homepage http://www.foobar2000.org/components/view/foo_hdcd (http://www.foobar2000.org/components/view/foo_hdcd)? Under Links - Documentation, there is no information given for this plugin.

Many thanks for your support!
Title: HDCD Decoder
Post by: Charles Hansen on 2015-06-05 15:38:48
Neat, an HDCD that only encodes the signaling information in one of the stereo channels. I'm open to suggestions as to how to deal with this.


Hi Kode,

Sorry for the late reply. Basically the answer is that if the code is only present in one channel, it is NOT valid. Here is an extract from the AES paper presented by Keith Johnson:

The arrival of a valid packet for a channel resets a code detect timer for that channel. If both
channels have active timers, then code is deemed to be present and the filter select data is
considered valid immediately. However, any command data which would effect the level of the
signal must match between the two channels in order to take effect. The primary reason for this is
to handle the case where an error on one channel destroys the code. In such a case, the decoder
will mistrack for a short time until the next command comes along, which is much less audible
than a change in gain on only one channel, causing a shift in balance and lateral image
movement. If either of the code detect timers times out, then code is deemed not to be present,
and all commands are canceled, returning the decode system to its default state. If the conditions
on the encoder side are not changing, then command packets are inserted on a regular basis to
keep the code detect timers in the decoder active and to update the decoder if one starts playing a
selection in the middle of a continuous recording.

Hope this helps!
Title: HDCD Decoder
Post by: Porcus on 2015-06-08 10:09:51
Neat, an HDCD that only encodes the signaling information in one of the stereo channels. I'm open to suggestions as to how to deal with this.


Hi Kode,

Sorry for the late reply. Basically the answer is that if the code is only present in one channel, it is NOT valid.


OK, per specification invalid, but then: what the [hell|HDCD] does this invalid code mean in practice?

If there was some known misimplementation that someone chose to deal with, how was it dealt with?
If HDCD has been applied in an intermediate step (and, I think I got this from you: some devices would leave HDCD code by default) and then there has been additional processing, what then? If the DAC they used to play it back when listening to the master did process the HDCD, what then?

Title: HDCD Decoder
Post by: Porcus on 2015-08-12 22:28:51
I have some issues with foo_hdcd vs CUETools vs hdcd.exe on tracks with only low-level gain. Posted in the CUETools thread: http://www.hydrogenaud.io/forums/index.php...700#entry904751 (http://www.hydrogenaud.io/forums/index.php?showtopic=66233&pid=904751&mode=threaded&start=2700#entry904751)
Wombat cannot reproduce my results though, so there might be human error.

@kode54: I have uploaded a test file, I'll pm you the URL and the password.

If anyone else is interested in testing this, let me know.
Title: HDCD Decoder
Post by: kode54 on 2015-08-15 11:12:26
Perhaps the results will be more in line with what's expected if the optimized hdcd_decode.c has SHITTY_ARITHMETIC defined at compile time? Otherwise, it's just doing its own pow calculation function for the gain table, which follows the spec's 0.5 dB steps between settings, but isn't binary accurate.
Title: HDCD Decoder
Post by: Porcus on 2015-08-15 16:09:09
Perhaps the results will be more in line with what's expected if the optimized hdcd_decode.c has SHITTY_ARITHMETIC defined at compile time? Otherwise, it's just doing its own pow calculation function for the gain table, which follows the spec's 0.5 dB steps between settings, but isn't binary accurate.


That was all Greek to me ... if you compile a test version, I can run a bitcompare or five.
Title: HDCD Decoder
Post by: kode54 on 2015-08-16 07:14:01
Try this:

https://static.kode54.net/foo_hdcd.fb2k-component (https://static.kode54.net/foo_hdcd.fb2k-component)
Title: HDCD Decoder
Post by: Porcus on 2015-08-16 19:08:24
old kode54 vs new kode54, the only one without halving volume. Difference range of 0.0000026 to 0.0000153 should be interpreted accordingly.

Code: [Select]
Differences found in all track pairs.
Zero offset detected in 6 out of 6 non-identical track pairs.

Comparing:
"C:\£V03\01 ~ Larks' Tongues in Aspic, Part One.wav"
"G:\£V03\01 ~ Larks' Tongues in Aspic, Part One.wav"
Compared 35959140 samples.
Differences found: 6090809 values, starting at 0:00.104807, peak: 0.0000026 at 10:00.564195, 2ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\02 ~ Book of Saturday.wav"
"G:\£V03\02 ~ Book of Saturday.wav"
Compared 7755720 samples.
Differences found: 456573 values, starting at 0:00.033651, peak: 0.0000011 at 2:47.675488, 2ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\03 ~ Exiles.wav"
"G:\£V03\03 ~ Exiles.wav"
Compared 20324220 samples.
Differences found: 776787 values, starting at 0:00.052721, peak: 0.0000014 at 0:02.798934, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\04 ~ Easy Money.wav"
"G:\£V03\04 ~ Easy Money.wav"
Compared 20859300 samples.
Differences found: 969334 values, starting at 0:00.024603, peak: 0.0000087 at 3:17.769456, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\05 ~ The Talking Drum.wav"
"G:\£V03\05 ~ The Talking Drum.wav"
Compared 19650960 samples.
Differences found: 5789500 values, starting at 0:00.000000, peak: 0.0000060 at 2:09.109615, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\06 ~ Larks' Tongues in Aspic, Part Two.wav"
"G:\£V03\06 ~ Larks' Tongues in Aspic, Part Two.wav"
Compared 18840696 samples.
Differences found: 1294054 values, starting at 3:51.635601, peak: 0.0000153 at 6:50.609546, 1ch
Detected offset as 0 samples.






hdcd.exe (the .wav.hdcd.wav files) vs new kode54, close except track 5
Code: [Select]
Differences found in all track pairs.
Zero offset detected in 6 out of 6 non-identical track pairs.

Comparing:
"C:\V03\01.wav.hdcd.wav"
"C:\V03\01 ~ Larks' Tongues in Aspic, Part One.wav"
Compared 35959140 samples.
Differences found: 8375504 values, starting at 0:00.104626, peak: 0.0000031 at 0:05.395986, 1ch
Detected offset as 0 samples.

Comparing:
"C:\V03\02.wav.hdcd.wav"
"C:\V03\02 ~ Book of Saturday.wav"
Compared 7755720 samples.
Differences found: 790220 values, starting at 0:00.033651, peak: 0.0000021 at 0:00.284966, 2ch
Detected offset as 0 samples.

Comparing:
"C:\V03\03.wav.hdcd.wav"
"C:\V03\03 ~ Exiles.wav"
Compared 20324220 samples.
Differences found: 1003446 values, starting at 0:00.052721, peak: 0.0000025 at 0:05.212608, 1ch
Detected offset as 0 samples.

Comparing:
"C:\V03\04.wav.hdcd.wav"
"C:\V03\04 ~ Easy Money.wav"
Compared 20859300 samples.
Differences found: 1314510 values, starting at 0:00.024603, peak: 0.0000041 at 3:17.882993, 1ch
Detected offset as 0 samples.

Comparing:
"C:\V03\05.wav.hdcd.wav"
"C:\V03\05 ~ The Talking Drum.wav"
Compared 19650960 samples.
Differences found: 7811623 values, starting at 0:00.000000, peak: 0.0004261 at 0:00.005850, 2ch
Detected offset as 0 samples.

Comparing:
"C:\V03\06.wav.hdcd.wav"
"C:\V03\06 ~ Larks' Tongues in Aspic, Part Two.wav"
Compared 18840696 samples.
Differences found: 1435872 values, starting at 3:51.635601, peak: 0.0000073 at 6:50.370000, 1ch
Detected offset as 0 samples.


That improves a tiny bit over the fairly close comparisons hdcd.exe vs. old kode54 - same issue with track #5:

Code: [Select]
Differences found in all track pairs.
Zero offset detected in 6 out of 6 non-identical track pairs.

Comparing:
"C:\£V03\01.wav.hdcd.wav"
"G:\£V03\01 ~ Larks' Tongues in Aspic, Part One.wav"
Compared 35959140 samples.
Differences found: 8582736 values, starting at 0:00.104626, peak: 0.0000026 at 10:55.775986, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\02.wav.hdcd.wav"
"G:\£V03\02 ~ Book of Saturday.wav"
Compared 7755720 samples.
Differences found: 805810 values, starting at 0:00.033651, peak: 0.0000024 at 2:47.694104, 2ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\03.wav.hdcd.wav"
"G:\£V03\03 ~ Exiles.wav"
Compared 20324220 samples.
Differences found: 1047606 values, starting at 0:00.052721, peak: 0.0000024 at 0:05.137075, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\04.wav.hdcd.wav"
"G:\£V03\04 ~ Easy Money.wav"
Compared 20859300 samples.
Differences found: 1352023 values, starting at 0:00.024603, peak: 0.0000057 at 3:17.770113, 1ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\05.wav.hdcd.wav"
"G:\£V03\05 ~ The Talking Drum.wav"
Compared 19650960 samples.
Differences found: 7964942 values, starting at 0:00.000000, peak: 0.0004264 at 0:00.005850, 2ch
Detected offset as 0 samples.

Comparing:
"C:\£V03\06.wav.hdcd.wav"
"G:\£V03\06 ~ Larks' Tongues in Aspic, Part Two.wav"
Compared 18840696 samples.
Differences found: 1484115 values, starting at 3:51.635601, peak: 0.0000091 at 6:50.608889, 1ch
Detected offset as 0 samples.


CUETools I am getting more problems with ...
Title: HDCD Decoder
Post by: Porcus on 2015-08-18 06:38:05
Oh. The reason why I reacted in the first place, were due to processing tracks vs. images. Update posted here: http://www.hydrogenaud.io/forums/index.php...mp;#entry905120 (http://www.hydrogenaud.io/forums/index.php?showtopic=66233&pid=905120&start=2700&#entry905120)

Comparing images:

HDCD.exe/CUETools output compared to official foo_hdcd:
Differences found: 21246657 values, starting at 0:00.104626, peak: 0.0000091 at 46:21.342222, 1ch

HDCD.exe/CUETools output compared to new foo_hdcd build:
Differences found: 20740436 values, starting at 0:00.104626, peak: 0.0000073 at 46:21.103333, 1ch

Diff old/new:
Differences found: 11208954 values, starting at 0:00.104830, peak: 0.0000076 at 46:21.342880, 1ch



A wishlist item, by the way: make it possible to sort and right-click for properties (or move to playlist) the output of scan-for-HDCD. (Or: auto-tagging those which employ any HDCD feature.)
Title: HDCD Decoder
Post by: yayacek on 2015-10-08 19:19:19
Great plugin. Gives Foobar2000 another advantage over other many audio software.

Output format:
In Foobar, the output format in Preferences - Playback - Output is 16-bit by default. I haven't seen a comment if this needs to be changed. To make use of the HDCD decoder, version 1.15, do I need to change the bit depth to 24-bit? Or can I just leave it at 16-bit?

View - Console:
The HDCD detection is displayed in the left bottom edge by the Syntax $if($info(hdcd),'HDCD'). It shows HDCD when a HDCD track is played. So if no HDCD tracks are played, the field simply is left blank. It works well so far. However, in View - Console, there is no information that a HDCD track has been detected. Do I need to change something, or is my installation faulty? Maybe this is not showed in the Console anymore?

Any other changes required after installation?
Is there anything that needs to be changed at all after the HDCD plugin has been installed from the Foobar Components homepage http://www.foobar2000.org/components/view/foo_hdcd (http://www.foobar2000.org/components/view/foo_hdcd)? Under Links - Documentation, there is no information given for this plugin.

Many thanks for your support!


View -> Console: There is no information that a HDCD has been detected.
Is it correct?
Title: HDCD Decoder
Post by: Porcus on 2015-12-17 00:13:27
Bug report.  A quite strange issue. I converted some hundred GBs, and verified afterwards, and one file simply refused to verify identical with foo_bitcompare.

After throwing out components one by one, it boils down to foo_hdcd - and throwing out foo_hdcd eliminates what I thought was a brief dropout in the left channel. Note that I have disabled ("Never") halve volume.
Changing to the new build in post 401, eliminates the differences, but not the "dropout".

fb2k reports the apparent differences as 3072 values, starting at 0:13.061224, peak: 0.4141083 at 0:13.087098, 1ch

Scanning for HDCD it is reported as a "fake" one: HDCD yes, but no features. Why is it then processing the file?

(hdcd.exe does not report it as HDCD. I can get you the file.)
Title: Re: HDCD Decoder
Post by: Midiman on 2016-03-07 07:43:09
Having just discovered this plugin - which is excellent BTW - I have a couple of questions:

I have an MP3 version of an HDCD encoded CD which I purchased a few years ago from emusic. It is a RR HDCD classical CD - but emusic obviously did not decode it properly prior to creating the MP3 files. Obviously, the control bits for PCM are not in the MP3 file. Is it possible for you to allow HDCD processing to be enabled via an option such that a user can turn on PE for files that the user absolutely wants to process during playback? I would be happy to take the default - in other words - reduce gain by 6 dB and decompress the data above 3 dB back to its original 9 dB range.

Similarly, is it possible for you to provide an option to disable hdcd processing "on the fly" - so that one could hear the FLAC rip with and without HDCD processing. This would be useful when showing other audio guys what the HDCD stuff is all about ;-) It is not easy to do this at present as the whole component has to be deinstalled to play a file back "normally".

Many thanks,

Mike
Title: Re: HDCD Decoder
Post by: GeSomeone on 2016-03-09 13:27:31
Similarly, is it possible for you to provide an option to disable hdcd processing "on the fly" - so that one could hear the FLAC rip with and without HDCD processing. This would be useful when showing other audio guys what the HDCD stuff is all about ;-) It is not easy to do this at present as the whole component has to be deinstalled to play a file back "normally".
It seems excessive to change the plugin for such demonstration. I suggest you decode the track from HDCD to PCM (wav), disable the HDCD plugin (as you described) and compare between the original and decoded track.

Luckily HDCD is hardly used anymore and I hope it will disappear completely. Why? It distorts the sound (http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html) when not decoded (as in most cases) and it makes no sense in the shift to downloads/streaming music.
Title: Re: HDCD Decoder
Post by: Midiman on 2016-03-10 07:16:46
It seems excessive to change the plugin for such demonstration. I suggest you decode the track from HDCD to PCM (wav), disable the HDCD plugin (as you described) and compare between the original and decoded track.

Luckily HDCD is hardly used anymore and I hope it will disappear completely. Why? It distorts the sound (http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html) when not decoded (as in most cases) and it makes no sense in the shift to downloads/streaming music.


So - you agree with me about one thing ;-) I want to hear the "undistorted" sound from my MP3 files of an HDCD transfer. I can handle the ability not to "turn it off" on the fly. I just thought if the developer was in there playing around with the code, that they could do two changes instead of one.

Agreed that HDCD is dead - for new recordings only! However, there are at least 5000 old recordings which one would like to be processed properly. The Reference Recording classical music HDCD are magnificent when played back in foobar2000 via this component. HDCD will not disappear completely - just like DVD-Audio did not disappear completely ;-)
Title: Re: HDCD Decoder
Post by: torturesauce on 2016-03-10 22:44:58
It seems excessive to change the plugin for such demonstration. I suggest you decode the track from HDCD to PCM (wav), disable the HDCD plugin (as you described) and compare between the original and decoded track.

Luckily HDCD is hardly used anymore and I hope it will disappear completely. Why? It distorts the sound (http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html) when not decoded (as in most cases) and it makes no sense in the shift to downloads/streaming music.


So - you agree with me about one thing ;-) I want to hear the "undistorted" sound from my MP3 files of an HDCD transfer. I can handle the ability not to "turn it off" on the fly. I just thought if the developer was in there playing around with the code, that they could do two changes instead of one.

Agreed that HDCD is dead - for new recordings only! However, there are at least 5000 old recordings which one would like to be processed properly. The Reference Recording classical music HDCD are magnificent when played back in foobar2000 via this component. HDCD will not disappear completely - just like DVD-Audio did not disappear completely ;-)


When I want to do a comparison, I load an HDCD-encoded track in Audacity then export it as AIFF. This makes the foo_hdcd plugin not decode the HDCD data.
Title: Re: HDCD Decoder
Post by: lukpac on 2016-03-10 23:23:45
When I want to do a comparison, I load an HDCD-encoded track in Audacity then export it as AIFF. This strips all HDCD information from the file.

The only reason it would do that is if you have dither enabled. Otherwise it will be identical to the original file (presumably WAVE).
Title: Re: HDCD Decoder
Post by: torturesauce on 2016-03-10 23:37:34
The only reason it would do that is if you have dither enabled. Otherwise it will be identical to the original file (presumably WAVE).

You're right. I edited my post.
Title: Re: HDCD Decoder
Post by: Funodav on 2016-08-06 18:46:17
New version, I have a little bug, in my status bar : %__hdcd% and $info(hdcd) reports "yes" even if I play a non HDCD track.
Title: Re: HDCD Decoder
Post by: kode54 on 2016-08-06 21:47:56
This should be fixed now. It was calling something uninitialized, which, when I changed it back to supporting arbitrary channel counts as well as the new stereo decoder mode, caused a crash.
Title: Re: HDCD Decoder
Post by: Funodav on 2016-08-07 10:37:20
Great, as far as I can tell, it's fixed now !
Good job :)
Title: Re: HDCD Decoder
Post by: musigny23 on 2016-08-31 02:39:35
Hi, new to this forum. Joined because I'm trying to find out about how to decode HDCD into 20 (or 24) bit files. to then convert to FLAC. I want to do this so I can play HDCD enhanced files into a modern DAC and get the benefit of the 20 bit quality. I have a HDCD cd player that's pretty good but it won't live forever.

I am usually a Mac guy so I don't have a Windows PC or foobar but it appears this is the only way to do it. So I may need to get my hands on one.

Does this decoder need to play the HDCD files in real time to decode them? And then have to capture the output as it goes to new 24 bit files?

Or does it perform a decode process that can be saved as new files when finished? Or both?

Thanks!
Title: Re: HDCD Decoder
Post by: kode54 on 2016-08-31 05:28:22
This decoder can do both real time playback and quite rapid offline conversion. FFmpeg also employs the same converter now, but you must enable it in your conversion process.
Title: Re: HDCD Decoder
Post by: musigny23 on 2016-08-31 06:39:42
This decoder can do both real time playback and quite rapid offline conversion. FFmpeg also employs the same converter now, but you must enable it in your conversion process.

Ah Ok thanks!

This has been a bit of a "thing" for at least 10 years now. I've come across many forum threads about it during that time and at least somewhere I saw comments to the effect that only the Pacific Microsonics chips running in real time did it 100% correctly. That may have been true at the time or entirely wrong. It sounds like there is absolute confidence that an offline foobar software decode is 100% correctly done too.

And then there's FFmpeg now, which is new to me. A quick look at that has me curious because it appears it can be run in OSX (yes?) but it is also a command line tool which would normally be beyond me. However it may be that very specific conversions (such as HDCD decoding of 44/16 PCM audio) calling for just one or two command lines might be something I could do with some guidance. FFmpeg appears to be extremely powerful and versatile which means it has a vast amount of configurations and settings to do all that it does. In other words, if it can run in OSX and setting it up to run HDCD decodes was relatively simple to explain, I would do it, but it sorting it out myself as I've never been a code guy or software engineer might be over my head.
Title: Re: HDCD Decoder
Post by: radorn on 2016-11-12 21:36:07
I'm trying to add an HDCD display to the status bar, but I don't want to see yes/no strings, as the fields return, but rather something like this:

HDCD [PE/TF/0.0dB]
HDCD [__/__/0.0dB]

I tried this:

$if(%__hdcd%, | HDCD '['$if(%__hdcd_peak_extend%,PE,__)'/'$if(%__hdcd_transient_filter%,TF,__)'/'%__hdcd_gain%']',)

Unfortunately this approach always shows PE and TF as if they were active as the variables return a yes/no answer in text, which are both interpreted as "true" by $if().
$replace() doesn't seem to help here either because I would need to use two and a yes would result in "PEyes" or "TFyes%" and a "no" would yield "no__"

Is there a way to achieve this?
Title: Re: HDCD Decoder
Post by: kode54 on 2016-11-12 22:04:08
$replace(%__hdcd_peak_extend%,yes,PE,no,__)
$replace(%__hdcd_transient_filter%,yes,TF,no,__)
Title: Re: HDCD Decoder
Post by: radorn on 2016-11-12 22:45:33
OK, I'm a dumbass and I completely missed that part in the wiki and didn't realize you could chain them within a single statement.
Doing too many unrelated things at a time sure develops a short attention span...

Thank you once more.
Title: Re: HDCD Decoder
Post by: SmartOne on 2016-12-08 10:08:14
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.

Similar issue:  I have an album with tracks that have HDCD packets with peak extension at the beginning, but apparently the packets stop, as indicated by %__hdcd% changing to false mid-track.  (Maybe the mastering person wanted to set the HDCD peak extension setting at the beginning of the track and then replace the HDCD packets with a higher-quality, noise-shaped dither?)  This causes an unnatural volume increase in the middle of the track.  I have "Halve output volume" set to "Always," but I imagine the issue would be the same with any setting value.  Of course, I plan on using Replaygain to counter the HDCD volume change, but the mid-track jump seems to be a bug.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-04 11:21:11
Also, %__bitspersample% displays "24" for HDCD.  I would expect it to be "20" or at least "16" to be consistent with the variable's meaning (source bits before 32-bit processing).
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-04 11:54:44
Returning "20" would nearly uniquely identify them, but AFAIK the "20" is marketing bogus.

As for your previous question:

Similar issue:  I have an album with tracks that have HDCD packets with peak extension at the beginning, but apparently the packets stop, as indicated by %__hdcd% changing to false mid-track.  (Maybe the mastering person wanted to set the HDCD peak extension setting at the beginning of the track and then replace the HDCD packets with a higher-quality, noise-shaped dither?) 

By "mid-track", do you mean farther out than some ten seconds?

If so, I imagine that it could be an "error" in the mastering: someone has spliced a part encoded with HDCD together with one part without.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-04 18:12:30
Yeah, could be a mastering error for all I know, but it is a real CD.  How would I go about playing this CD with extended peaks if the HDCD codes stop after some seconds, without a volume disparity?  Maybe real HDCD hardware would maintain its state for the duration of the track, regardless.

About the bits per sample, yeah, the whole one-bit-isn't-exactly-6-dB thing.
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-05 14:02:23
How would I go about playing this CD with extended peaks if the HDCD codes stop after some seconds, without a volume disparity?

- How many seconds out in the track is it? If it is only ten, it could (for all that I know) be an unfortunate track boundary.
- Have you tried all three "halve volume" options?
- At least originally, foo_hdcd supported only the "CDDA, WAV, FLAC, and WavPack inputs" (ref. the first posting of this thread). Try to convert to a different lossless format then?
- Processing down to 15 bits resolution does kill the HDCD flags.


Maybe real HDCD hardware would maintain its state for the duration of the track, regardless.
I think it is supposed to reset after ten seconds.

About the bits per sample, yeah, the whole one-bit-isn't-exactly-6-dB thing.
No, in that the HDCD format expands by much less than four bits. As far as I remember, some of the "resolution enhancement" was either dithering or noise shaping which is not part of the format itself. But it was part of the HDCD chip, and therefore counted into the marketing of "HDCD" even if it could be achieved by other means.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-09 21:30:19
It's about ten seconds into the tracks when the HDCD flag turns off.  All of the voluming halving options either cause the same volume disparity or risk clipping.  Keep in mind that the volume halving setting should be "set it and forget it;" in other words I shouldn't have to change it per-album.  I'm using FLAC.  I haven't done any processing of the files, and it seems pretty unlikely that processing has occurred upstream that would only affect the tracks after ten seconds in.

Assuming this plugin's HDCD detection is correct, it seems clear that there are mastering errors.  Given this assumption, this is still a real-life album, so the plugin should handle this failure mode if possible, correct?  I'll assume you agree.

I don't think "unfortunate track boundary" is the case here, because some of the tracks do not enable the HDCD flag and come before some of the problem tracks.  Since the tracks that do enable the HDCD flag do so from the beginning of the track, why shouldn't this plugin maintain HDCD processing for the rest of the track (in other words, maintain the volume halving until the track is complete).  We're assuming that this album is incorrectly mastered, so given that, how would this proposed fix break correctly mastered albums?  If it doesn't break the behavior in the correct HDCD case, I think this error condition should be handled as proposed only because this is a real album.

Otherwise I'd say, "Too bad, screw it.  Manually zero the 16-bit."  Or something.
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-10 08:37:55
Edit: This thread is relevant: https://hydrogenaud.io/index.php/topic,112348.0.html
And suggests that the ten seconds I refer to below (I do not edit it out) could be arbitrary and might not correspond to a real-world DAC.

It's about ten seconds into the tracks when the HDCD flag turns off. 
kode54 could weigh in on whether my suggestion is technically plausible, but I'd put my $.02 on the track boundary.

IIRC, HDCD is supposed to turn off after ten seconds with no HDCD packet. I can only assume the rationale is that a (physical) HDCD was supposed to be HDCD on all tracks, and ten seconds would give the DAC time to reset when switching to a new CD.

My hypothesis would then be that this CD has a HDCD-enabled track number N followed by a non-HDCD track number N+1, and in the mastering, the track boundary has been set a bit too far "to the left" so that a few HDCD packets from track N has ended up in the file which is supposed to be track N+1. You start track N+1, but due to the mastering quirks you do get a split second of what was supposed to be the end of track N - and there are the HDCD flags.

That said, I have encountered a similar issue when playing back the file which contained an already decoded HDCD signal. Seems to me that some HDCD packets did survive the conversion.  (Oh, and: you do not have two HDCD components installed?)

Assuming this plugin's HDCD detection is correct, it seems clear that there are mastering errors.  Given this assumption, this is still a real-life album, so the plugin should handle this failure mode if possible, correct?  I'll assume you agree.

That depends on what you mean by "correct". Do you mean it should handle it like a physical CD player and DAC (with HDCD support) would do (which I think it actually does, see below)? In that case, you have probably misunderstood something about how ("physical") HDCD works:

Since the tracks that do enable the HDCD flag do so from the beginning of the track, why shouldn't this plugin maintain HDCD processing for the rest of the track

Because a physical DAC will not maintain HDCD status "for the rest of the track"! A physical DAC does not know track boundaries, and cannot know what is "the rest of the track". That is why HDCD processing turns off a fixed time after the last HDCD packet.

Likely, a physical DAC would also "mess up" here. My conjecture is that the final master was not reviewed on a HDCD DAC, and so no-one understood it could be an issue.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-10 19:06:36
I understand the incorrect track boundary theory, it's just that some of the HDCD-beginning-flagged tracks are preceded by completely non-HDCD ones, which seems to remove some correlation.  Isn't this the opposite of the N+1 example you describe?  Ah, but doesn't this component stop analyzing after some arbitrary amount of seconds into a track if no HDCD packets are found?

"Correct" means as close to the specification and reverse engineered information as possible, and now that we're out in the wild, accounts as much as possible for discs that incorrectly follow the specification without compromising the performance of correctly mastered discs. :D

Because a physical DAC will not maintain HDCD status "for the rest of the track"!

Therein lies our advantage.  This software has more information. :)

A physical DAC does not know track boundaries, and cannot know what is "the rest of the track". That is why HDCD processing turns off a fixed time after the last HDCD packet.

So there was never CD player + HDCD DAC combo hardware?

Here's a better proposed solution to this incorrect disc because it doesn't involve volume halving:  This component could disable itself when it reads a per-track "disable HDCD processing" tag.  Kind of like how the De-emphasis plugin works.

HDCD: Yet another example of stupid (that's redundant) over-engineering.  This is fun though, ain't it? :P
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-11 08:36:29
Here's a better proposed solution to this incorrect disc because it doesn't involve volume halving:  This component could disable itself when it reads a per-track "disable HDCD processing" tag. 

Agreed. kode54, are you there? ;)

Suggestion:
-> scan track for a HDCD tag.  If <HDCD> is "no", then do not process this track.

I would also suggest to let the component populate tags with, e.g., "PE" or "LLC" after scanning (excluding those with the "no"). In order to review later.

Also, is the ten-seconds reset what it should be?
Title: Re: HDCD Decoder
Post by: GeSomeone on 2017-01-17 10:48:36
A (sort of) work around is to set Advanced ->Decoding ->HDCD ->Halve output volume to Never.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-17 19:05:52
But that risks clipping.  No?  If no, then what's the point of the option in the first place.
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-17 19:17:22
But that risks clipping.  No?  If no, then what's the point of the option in the first place.

Foobar2000 can limit level according to %replaygain_track_peak% or %replaygain_album_peak% in order to prevent clipping.

Why that option? Not sure, but maybe to emulate actual HDCD behaviour?
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-18 10:25:12
That depends on whether this component clips samples above digital full scale.  The %__bitspersample% value of "24" suggests that the component outputs integer samples, which means values above 0 dBFS would be clipped.

Ring around the rosie.
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-21 19:14:28
OK, I spent some time on a problem child in my collection (https://hydrogenaud.io/index.php/topic,112348.msg925894.html#msg925894). Note, all tracks verify AccurateRip.

Per-track scans:
hdcd.exe reports no HDCD in no tracks.
foo_hdcd reports PE enabled at the beginning, but 0 dB peak in all tracks but numbers 5 and 12, which have no HDCD.
All these ten "lose" their HDCD status after ten seconds, according to fb2k with foo_hdcd.

Converting to image
Converted to WavPack image with embedded cuesheet using CUETools, no HDCD decoding.
Rescanned for HDCD using foo_hdcd. Tracks 2 through 8 report as HDCD. Note that this includes track 5, which was not HDCD if scanned standalone.
Same procedure, but to TAK. Now, tracks 1 through 10 report as HDCD.

Transcoding between lossless formats (using a fb2k without foo_hdcd)
Lossless is lossless if I use a fb2k without foo_hdcd. However, if I bit-compare these files using foobar2000 with foo_hdcd, they differ in some thousand samples.  That is: foo_hdcd treats the same signal (slightly) different according to codec.
Also, comparing image vs. single tracks of same codec will yield differences (naturally, as foo_hdcd converts some).

Attempted to get rid of HDCD by converting to lossywav.
Only track 2 tested. Complete failure. foo_hdcd identified as HDCD at absolutely every quality setting.

Converted with dithering
Converted to ALAC-in-mp4 using refalac, 16 bit to 16 bit with dithering. Success. No HDCD reported.

Title: Re: HDCD Decoder
Post by: kode54 on 2017-01-21 20:13:10
Okay, so false detection. Do you propose I scan entire tracks before allowing HDCD processing to be enabled?
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-21 20:45:58
Here's a better proposed solution to this incorrect disc because it doesn't involve volume halving:  This component could disable itself when it reads a per-track "disable HDCD processing" tag.  Kind of like how the De-emphasis plugin works.
Title: Re: HDCD Decoder
Post by: kode54 on 2017-01-21 22:05:14
Done. Sorry for taking so long.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-21 23:21:31
Thank you!  No problem, you have no obligation to fulfill requests.  Doesn't mean I won't bug you, though. :)
Title: Re: HDCD Decoder
Post by: Porcus on 2017-01-21 23:41:09
Well it could be - for all that I know - that there was an outright bug that caused foo_hdcd to treat different filetypes/codecs different. At least to a complete amateur it doesn't seem very "lossless is lossless".
(Also, the ten-seconds countdown is still arbitrary?)

Thank you!  No problem, you have no obligation to fulfill requests.  Doesn't mean I won't bug you, though. :)

Seconed. All three parts.
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-22 03:59:59
The "HDCD" "no" tag doesn't work in an external m-TAGS file: http://www.m-tags.org/

It works if applied directly to the FLAC file.
Title: Re: HDCD Decoder
Post by: kode54 on 2017-01-22 04:05:38
Feel free to submit a pull request to add inter-component dependency so it can specifically ask the m-TAGS component whether its "hdcd" tag is set to "no", without using title formatting scripts. I have this:

Code: [Select]
class hdcd_postprocessor_entry : public decode_postprocessor_entry
{
public:
virtual bool instantiate( const file_info & info, decode_postprocessor_instance::ptr & out )
{
        if ( info.info_get_decoded_bps() != 16)
{
            return false;
        }
const char * encoding = info.info_get( "encoding" );
if ( !encoding || pfc::stricmp_ascii( encoding, "lossless" ) )
{
return false;
}
const char * hdcd = info.meta_get( "hdcd", 0 );
if ( hdcd && pfc::stricmp_ascii( hdcd, "no" ) == 0 )
{
return false;
}
out = new service_impl_t< hdcd_postprocessor_instance >;
return true;
}
};
Title: Re: HDCD Decoder
Post by: SmartOne on 2017-01-22 04:51:56
Aw, no API?  Darn.  (You wouldn't really want a dependency on another component, would you?)
Title: Re: HDCD Decoder
Post by: kode54 on 2017-01-23 00:17:18
It would just need to attempt to instantiate a service implemented by the m-TAGS component for retrieving from it. Then it would attempt to query "hdcd" = "no". No service, no failure.
Title: Re: HDCD Decoder
Post by: GeSomeone on 2017-01-24 11:45:23
A (sort of) work around is to set Advanced ->Decoding ->HDCD ->Halve output volume to Never.
But that risks clipping.  No?  If no, then what's the point of the option in the first place.
In theory, but in practice the risk is small because replaygain (and/or volume) mitigates this.
Also, as Porcus mentioned, one could use the "prevent clipping setting" of replaygain.
Finally, if you put Advanced Limiter at the end of the DSP chain, the occasional clipping (if any) will be prevented.

That depends on whether this component clips samples above digital full scale.
Foobar2000 is designed so the whole decode+DSP+volume is done in 32 float. Only at the output stage the stream is converted.

Anyway, I think the HDCD format is flawed by design and this is for me the best compromise to deal with it. Sorry I didn't check back on this sooner.
Title: Re: HDCD Decoder
Post by: j7n on 2018-05-28 20:26:33
When converting a HDCD track to a lossy format (vorbis, opus, fhg aac) with the setting Halve output volume = Never, the resulting overs are clipped. If I add a DSP that does nothing (convert mono to stereo, or foo_dsp_amplify by 0) the overs are correctly encoded. Shouldn't the output of HDCD be treated as processed by DSP by default and passed in floating-point to lossy encoders?

I would typically normalize, but suppose one forgets to do it. (Halve = Never is the correct setting to prevent large changes in loudness and inaccurate ReplayGain from being written.)
Title: Re: HDCD Decoder
Post by: kode54 on 2018-05-29 03:10:27
This is a converter issue, not one with my component.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-05-31 21:40:27
Issue. (Cannot anymore remember what specs say about it.)

Tool's infamous Lateralus. Has a -4 dB gain in the fade-in at the beginning of track 1, and - AFAIK - no HDCD features anywhere else. CUETools detects it. ffmpeg detects it.

foo_hdcd (version 1.19 on fb2k1.4beta15) does not detect it because it is at the very beginning. Here is what I did:
- checked, converted to .wav an checked again.
- concatenated tracks 2+1 in that order; hacked the cuesheet to move the track boundary .4 seconds. That means, I got a copy of track 2 with the first .4 seconds of track 1 included at the end.
Now foo_hdcd detects it.

Title: Re: HDCD Decoder
Post by: kode54 on 2018-05-31 23:00:15
It only detects two consecutive HDCD frames within the first ten seconds of a given track. Otherwise, it disables itself and flushes all buffered audio.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-01 00:04:59
It only detects two consecutive HDCD frames within the first ten seconds of a given track. Otherwise, it disables itself and flushes all buffered audio.

It identifies as HDCD everywhere, but no features except in the first second of track 1. Because it is at the beginning, foo_hdcd does not detect the gain.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-02 01:16:15
And this is really difficult to fix, since it would require a full CD image file, and a scanner that can be told to check the beginning of the image file, before it seeks to the specified offset for the CUE sheet.
Title: Re: HDCD Decoder
Post by: EpicForever on 2018-06-02 09:18:39
So is this plugin unreliable?
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-02 09:58:02
And this is really difficult to fix, since it would require a full CD image file, and a scanner that can be told to check the beginning of the image file, before it seeks to the specified offset for the CUE sheet.
No, the error is not dependent upon images or cuesheets. I did not use any cuesheet to create any pregap.

See the attachment. The situation is the following. For a single file - no cuesheets! -
* foo_hdcd fails to detect the low level gain at the beginning of the track, and
* the very same signal is detected if it is not at the beginning.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-02 20:42:24
And as I said, the HDCD signaling in that CD is only in the beginning of the first track. The entire remainder of the album is devoid of signaling information. There is no way to detect it easily in other tracks, short of having a tag report that something should be applied to the tracks themselves.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-02 23:51:53
The problem is not "in other tracks". The problem is that it does not detect the gain where there is supposed to be a gain.
(Because it is supposed to apply a -4 dB at the beginning of the first track, right?)

This is why I don't understand what you mean about "image file", "offset" and "CUE sheet". foo_hdcd reports 0.0 dB when - according to "everything else" - receiving a signal to apply -4 dB.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-03 21:51:59
How many HDCD signal packets are encoded in the first track? My component ignores any files with less than two consecutive packets.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-03 22:57:11
@kode54: does it ignore the first ten seconds?!? The attachment can indicate so.

How many HDCD signal packets are encoded in the first track?
How can I tell? New upload ...

My component ignores any files with less than two consecutive packets.
That cannot be the full explanation: when I repeat the first 30 frames sufficiently many times, it kicks in. If so, it would have to be the very last and very first moment of those thirty frames - and even then, it should have kicked in when only two were merged.

Attached are three files: For the file Tool10xfirst1sec.flac, I extracted the first second (using ffmpeg -to 1) and concatenated ten copies of the audio together. I get no HDCD. For Tool11xfirst1sec.flac, I concatenated eleven - and then it applies gain! For Tool10xfirst1.01sec.flac, I extracted the first 1.01 seconds and concatenated ten copies - that is 10.1 seconds, and now you can check what it says about that :-o
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-03 22:58:28
Seems only two of three files were uploaded. Here is the third ... or first.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-04 00:54:14
Ah, my bad. It's not two consecutive chunks. It needs to still be enabled after a minimum of two chunks of audio and ten seconds.

Note that in a real HDCD player, after the requisite timer from a single packet counts down, the HDCD effect shuts off.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-04 08:09:54
Ah, my bad. It's not two consecutive chunks. It needs to still be enabled after a minimum of two chunks of audio and ten seconds.

There are enough HDCD packets throughout the entire album for foo_hdcd to report all tracks as HDCD.
The problem is that foo_hdcd does not apply the -4 dB gain, apparently because it ignores the first seconds.

Note that in a real HDCD player, after the requisite timer from a single packet counts down, the HDCD effect shuts off.

In a real HDCD player, HDCD will be turned off after ten (?) seconds of HDCD inactivity.
foo_hdcd seems not to be turned on until ten seconds of activity.

Looks like a bug to me?

(Why not let foo_hdcd observe a HDCD tag to be set to "yes"?)


There is an issue, of course: since mastering can get offsets and track boundaries wrong, then ripping a compilation album could get the last few samples (with HDCD) track x at the beginning of track y.
A real HDCD DAC will keep HDCD on until timeout. (It will even do so if you play a non-HDCD track right after a HDCD track in a playlist - unwanted behaviour, sure.)
A software player could look ahead a few seconds. If nothing - reset. If something - keep on.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-04 22:11:45
Gain is not applied globally. Gain is reported by every packet, and last I checked that album, it has a gain of -4 for about a second, then ramps up to 0 for the remainder of the album.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-05 00:35:09
Gain is not applied globally. Gain is reported by every packet, and last I checked that album, it has a gain of -4 for about a second, then ramps up to 0 for the remainder of the album.

So why does foo_hdcd fail to apply that -4 dB gain for about that second?  (I know that gain is reported by the packet, that is not the question.)

If I concatenate ten copies of that second, it fails to identify it as HDCD at all.
If I concatenate ten copies of 1.01 seconds, it identifies it as HDCD, but does not see the gain.
If I concatenate eleven copies of that second ... wow, it sees that there is -4 dB gain there. But such a packet is in every one of the ten copies it fails to recognize.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-05 00:53:48
Clearly, the fade is shorter than the requisite 10 seconds my decoder needs to warm up. Maybe I should eliminate the warm up period, so we can get a lot more false positives.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-05 09:01:30
Clearly, the fade is shorter than the requisite 10 seconds my decoder needs to warm up. Maybe I should eliminate the warm up period, so we can get a lot more false positives.
How many false positives do you think you will get among those tracks that foo_hdcd actually recognizes as HDCD?
foo_hdcd does indeed recognize the track - from way before 00:01.00 it can tell me it is a HDCD - it just throws away the gain instead of applying it.

(How would this work with loud track transitions? Applying +6 dB at the end of track N and instantly dropping it at the track boundary even though the entire track N+1 has HDCD packets?)
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-07 00:38:44
As I said, it detects it at all, but it doesn't do any processing unless it detects it for a full 10 seconds and a minimum of two audio_chunks from the input.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-06-11 23:45:55
As I said, it detects it at all, but it doesn't do any processing unless it detects it for a full 10 seconds and a minimum of two audio_chunks from the input.
So you are saying that there is not as much as ten seconds of HDCD packets in that track?
Title: Re: HDCD Decoder
Post by: kode54 on 2018-06-12 08:55:44
I don't believe so. I could check further, though. Really, the only way to check for multiple consecutive packets at all, is to process in shorter intervals, and regularly check for the interval counter increasing again, as it is reset to a full second again when a new packet is detected.

Pull requests are welcome, in case anyone else knows a neat and easy way to do this, and doesn't want to wait for me.
Title: Re: HDCD Decoder
Post by: j7n on 2018-06-20 00:14:52
(Why not let foo_hdcd observe a HDCD tag to be set to "yes"?)
I'd like to use HDCD=yes on the few HDCDs to eliminate lag upon opening and also seeking in all 44,100/16-bit files, among which the overwhelming majority are not HDCD. Adding "no" to the entire collection is excessive.
Title: Re: HDCD Decoder
Post by: j7n on 2018-06-24 07:12:55
I have made more observations and found that the poor performance and lag on track change and seeking is connected to the running time of Foobar or perhaps amount of data played. If I leave Foobar2000 open overnight, idle, not playing, then play an HDCD track next day, it is slow. The mouse pointer freezes on track change. Only lossless CD-resolution tracks without the HDCD=no are affected. If I restart Foobar without making any changes (not the computer, just Foobar), the performance is ok. Why would this be?
Title: Re: HDCD Decoder
Post by: jaynyc on 2018-07-27 18:17:50
Hi - would like to confirm 2 things please--

1.  is it still true that ReplayGain must be set to off for realtime decode with this plugin?
2.  in latest Foobar 1.4x beta, nothing is written to the console, but the bit depth column will switch from 16-->24 when the decoder is active during playback with an HDCD identified track?

thanks
Title: Re: HDCD Decoder
Post by: kode54 on 2018-07-27 23:08:20
1) No. ReplayGain is applied after this plugin decodes the signal.
2) Dynamically applied metadata will reflect the HDCD mode and its properties.
Title: Re: HDCD Decoder
Post by: TimsFong on 2018-07-28 15:30:25
1) No. ReplayGain is applied after this plugin decodes the signal.
2) Dynamically applied metadata will reflect the HDCD mode and its properties.
Excuse me, will there be "FOO_INPUT_MQA" in the future?
Title: Re: HDCD Decoder
Post by: kode54 on 2018-07-29 08:28:59
Yeah, sure, I'll get right on that, as soon as there's a library for it that doesn't have an evil license. Last I checked, there's only one library, usually bundled with things like Tidal, and it requires that the audio go directly to a DAC, and not any digital output, or to any other process where the decoded data can be read or logged or processed further.
Title: Re: HDCD Decoder
Post by: TimsFong on 2018-07-29 11:51:20
Yeah, sure, I'll get right on that, as soon as there's a library for it that doesn't have an evil license. Last I checked, there's only one library, usually bundled with things like Tidal, and it requires that the audio go directly to a DAC, and not any digital output, or to any other process where the decoded data can be read or logged or processed further.
About:http://www.2l.no/hires/index.html
Title: Re: HDCD Decoder
Post by: kode54 on 2018-07-31 03:45:42
Yeah, no, that doesn't look like a decoder library, it looks like a selection of sample media.

The HDCD decoder was reverse engineered from an existing player (Windows Media Player), it was not reverse engineered from simply having sample media.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-08-11 14:33:23
@kode54:
I had another look at this and tried to catch a little bit of the code, although I do not speak C++

The big mistake is to discard 10 seconds of HDCD packets. Your component has a timer for when HDCD is turned ON after the FIRST packet.  Obviously that is not the same as what a HDCD DAC does: it has a timeout for when HDCD is to be turned OFF after the LAST packet.
Consequence: if full volume is reached by 10 seconds, your component will all for sudden boost the volume by 6 dB.  I had issues like that. 
The "easy" fix is to drop that count-up.  Do what a physical HDCD DAC would do: apply HDCD once valid HDCD is found.

Also, an "easy" fix, as mentioned earlier: Honor a HDCD tag set to "yes": if so, assume that HDCD is activated throughout the track, period.


But we still have the issue of when to switch HDCD off. For physical CDs, a ten-seconds timeout will suffice for replacing a (HD)CD with a different CD and pressing Play.
File playback does not work that way - a track from the next (non-HDCD?) album will start immediately. 
Fix: HDCD should be reset when starting on a file from a different album

Then there is an issue for compilation CDs with both HDCD and non-HDCD tracks.  That issue is "unresolved" even for physical CDs, but potentially much worse for files that have appended the next track's pregap. Also, the CD write/rip offset issue means that samples could bleed over into the neighbouring track (previous or next). 
"Easy fix": the user can set the HDCD tag to "NO".
Feature request: scanner could report if HDCD packets are present only at the beginning or the end (2.1 seconds would cover appended "track N+1 index 0" and wrong offset).


As for Lateralus, you got a few things wrong (there are HDCD packets throughout the entire CD!), but the misimplementations are much more serious than the consequences for this particular release.
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-02 17:22:10
@kode54
my layout [$info(bitspersample)-bit[ $info(bitspersample_extra)] ][%codec% | ][%bitrate% kbps | ][%samplerate% Hz | ][%channels% | ]%playback_time%[ / %length%] $if($info(hdcd),'(HDCD:’,) $if(%__hdcd%,PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%’)’)
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-02 22:27:57
This appears to be possibly a bug in 1.4.1 or even 1.4. It's a pity I haven't listened to any of my HDCDs in so long that I didn't even notice it whenever it first appeared. I notice, with my component installed, that neither missing info nor present info are reported for those tags.
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-03 00:23:03
@kode54  is a fix possible ?
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-03 02:50:34
I doubt I can apply a fix to foobar2000 itself. I haven't changed anything in the component itself to cause it to stop working.
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-07 21:59:37
@kode54  I believe it had to be  the 1.4.1 final as it was working previous you should see I PMed peter and CC'd you id really like this issue fixed and usabke again i have alot of contrent and having the display was great
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-08 00:39:17
Then it's out of my control.
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-08 02:32:06
 @kode54  we should atlest try wither its something you can compensate for via a update or if its something peter needs to patch I do not want it to just die just because
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-09 04:32:08
He claims it's because dynamic tags aren't supposed to work in the playlist. I found they're not working in the status bar, either.  Nothing I can "compensate for".
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-09 16:39:46
@kode54  well it should be noted that i only ever use the status bar so while peter may have intended to limit dynamic tags in playlists it clearly effects foobar  as a whole  @Peter  please address this this plugin is a staple for me and the fault seems to be in foobar core
Title: Re: HDCD Decoder
Post by: Case on 2018-12-09 17:15:15
What are you people talking about? HDCD's dynamics fields work fine if you don't use incorrect string from MJmusicguy. His string has ' replaced with incorrect escape character.
Corrected string is
Code: [Select]
[$info(bitspersample)-bit[ $info(bitspersample_extra)] ][%codec% | ][%bitrate% kbps | ][%samplerate% Hz | ][%channels% | ]%playback_time%[ / %length%] $if($info(hdcd),'(HDCD:',) $if(%__hdcd%,PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%')')
Though it can be simplified to just
Code: [Select]
[$info(bitspersample)-bit[ $info(bitspersample_extra)] ][%codec% | ][%bitrate% kbps | ][%samplerate% Hz | ][%channels% | ]%playback_time%[ / %length%][ '('HDCD: PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%')']
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-09 23:37:24
Bah, I was tricked. I didn't even notice the "smart" quote usage when I blindly copied his string for testing.
Title: Re: HDCD Decoder
Post by: Porcus on 2018-12-10 08:35:04
He claims it's because dynamic tags aren't supposed to work in the playlist. I found they're not working in the status bar, either.  Nothing I can "compensate for".

I wonder what you asked him about ...
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-10 10:11:38
I made a mistake. I hope I have sufficiently owned up to it. I failed to check my own variables properly.

The code snippet that I used verbatim contained a single open apostrophe / single quote, unterminated because all subsequent quotes were "smart" quotes. The resulting unterminated string was a parameter to an $if, so it was not emitted.
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-11 00:02:06
@kode54 Well that is awesome because that was my old code which always worked however cases code worked just fine so i am happy sorry everyone  @Case thank you
Title: Re: HDCD Decoder
Post by: Sparky14 on 2018-12-26 17:55:50
Hi all, newbie here just trying to get this HDCD thing all working. Need some guidance. Here's where I stand:
1. Took an HDCD disc, played in WMP, saw HDCD logo to confirm HDCD
2. Ripped to WAV files using WMP
3. Used HDCD.EXE to create 24bit.wav files
4. Converted 24bit.wav files to FLAC using FOOBAR2000
5. Using FOOBAR 1.41 and HDCD component 1.19, using ASIO output to external DAC
6. Added the HDCD flag to the status bar
7. Put all 3 files (*.wav, *.24bit.wav, *.flac) into FOOBAR and played.

The HDCD flag does not show up during playback of any files. The *wav files show as 1411 kbps/44100 Hz, the *24bit.wav files as 2116 kbps/44100 Hz, and the FLAC files as 851 kbps/44100 Hz. I expected the last two to be 48000 Hz.

Also, when I use the "Scan for HDCD tracks" utility, only the *.wav tracks are listed, each with 0.0 min and max gain and Disabled peak extension. I would have thought the *.wav tracks would be the only ones NOT listed.

Any thoughts on where I messed up? Thanks!
Title: Re: HDCD Decoder
Post by: MJmusicguy on 2018-12-26 19:33:04
@Sparky14  you actusslly want to rip  files sttright from the disc to flac via fooboor without any processing [$info(bitspersample)-bit[ $info(bitspersample_extra)] ][%codec% | ][%bitrate% kbps | ][%samplerate% Hz | ][%channels% | ]%playback_time%[ / %length%][ ‘(‘HDCD: PE: %__hdcd_peak_extend% LLE: %__hdcd_gain% TF: %__hdcd_transient_filter%’)’] then copy the hdcd portion of this status bar layout
Title: Re: HDCD Decoder
Post by: Sparky14 on 2018-12-27 21:39:37
Thanks MJ - eveything looks good now. Appreciate the help!
Title: Re: HDCD Decoder
Post by: j7n on 2018-12-30 02:17:14
Why might the plugin become much slower to open/scan 44kHz files over time? Seeking and jumping to a new track incurs a noticeable pause. If I close Foobar and reopen it, it is back to acceptable again. I am not sure if time is a factor or opening of certain other applications.
Title: Re: HDCD Decoder
Post by: kode54 on 2018-12-30 08:15:24
I wouldn't have any idea, as the decoder isn't supposed to remain resident after closing a track. Maybe you have a track scanner of some sort running in the background? The waveform seekbar components spring to mind.
Title: Re: HDCD Decoder
Post by: jacobacci on 2019-02-13 16:29:23
I have a question about the "minimum gain" and "maximum gain" parameters of the HDCD scanner:
(https://i.postimg.cc/1zR3MDLN/Choying-Drolma-Selwa-HDCD.jpg)
In this CD, the only parameter that would indicate the presence of HDCD encoding is minimum gain -4db. Everything else is not active. Does this CD have to be decoded for optimum quality?


Title: Re: HDCD Decoder
Post by: kode54 on 2019-02-14 03:14:28
No, but its volume level may be reduced if you decode it, or may vary between 0.0 and -4.0 dB differences across the entire track if you decode it, and not if you don't. I'd decode and check what the difference is in a waveform viewer, just to be sure.
Title: Re: HDCD Decoder
Post by: jacobacci on 2019-02-14 08:08:00
Thanks @kode54
I checked and indeed there were some differences in the first track, especially in the fadeout. Subsequently I played the undecoded track with foobar and during the fadeout LLE fluctuated between 0 and -4db. I will play the album in decoded form in Roon, as Roon does not have an HDCD decoder.
I think this exercise has helped me to understand the minimum gain and maximum gain parameters.
I am assuming that:

the minimum gain db number would indicate the largest gain decrease occurring during playback of the track
the maximum gain db number would indicate the largest gain increase occurring during the playback of the track

hence tracks which show 0db for both parameters (and of course no encoding for the other parameters) would be safe to leave in undecoded 16bit form.

Is this correct?
Title: Re: HDCD Decoder
Post by: kode54 on 2019-02-15 00:38:42
They are only a range. The gain can fluctuate between ±0.0 dB and -4.0 dB in steps of 0.5 dB, and the decoder transitions between the steps smoothly. Minimum and maximum are only the known range used by the entire track, not the exact values used for any given part of the track.
SimplePortal 1.0.0 RC1 © 2008-2019