Skip to main content

Notice

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

Re: Title formatting/syntax for proper bitdepth

Reply #75
@wojak - foo_hdcd reports 20 bits because I blindly trusted the information floating around. At the moment foo_hdcd decoding differs from the supposed reference source and that's why the bitdepth is higher. High intersample overs are not a reason to halve loudness of fake HDCD discs.

The more samples and data I gather the more confused I get. @Porcus - that one second sample is recognized as HDCD by ffmpeg. Even if I restrict foo_hdcd to require hdcd packets every 200 ms like was stated in some document (though that was related to start of a track), it's recognized as HDCD.
Clawfinger will no longer be treated as HDCD with that 200 ms restriction. Though it does appear to contain HDCD packets, but decoding it as such produces rather silly results.
I burned some test tracks to a CD and tested Windows Media Player. Though I repeated the one second clip 10 times as I figured the original is too short for WMP to even react.
I added one test HDCD track from my Sampler disc, the repeated clip and one track from Clawfinger. WMP shows HDCD logo for them all.
And here comes more confusion: I recorded the output from WMP in 24 bit playback mode. The recordings had no peaks extended, even though the tracks use this feature a lot. The Sampler sourced HDCD track came out as real 20 bit file, the others are just 17 bits (16 bits shifted one bit down to make them quieter).

I googled that Model Two HDCD DAC, seems to have been selling used for around $10K some years back. Way out of my toy budget, which is a shame. I would really like to see what it does.

Re: Title formatting/syntax for proper bitdepth

Reply #76
@Porcus - that one second sample is recognized as HDCD by ffmpeg.
Huh ...

...

Found my mistake, I forgot to tell ffmpeg to output pcm_s24le.  I am still not used to that, apparently. Why should choice of output matter to whether it identifies the input ... anyway, this line does it:
Code: [Select]
ffmpeg -i onesec.flac -af hdcd -acodec pcm_s24le -f wav -y NUL -loglevel verbose

But hdcd.exe doesn't detect HDCD. (Checked again, version 0.2.)

Re: Title formatting/syntax for proper bitdepth

Reply #77
@Case
while rescanning HDCD files for TBPS I found that some files changed Peaks from ex. -5 to +0,8 so the whole albums changed peaks to that value and Clippings were discovered. When I played those songs they did not show HDCD but when I manually "rewound" such track (ex. with mouse on minibar mod) they suddenly become hdcd and get quieter but when I play them from the begining again they do not show hdcd and never become hdcd while normal playing (only manual rewinding enables hdcd). It wasn't like that with previous versions of the decoder. The effect is that some hdcd albums become "mixed" and the volume is inconsistent (+6dB). This seems weird. 

Re: Title formatting/syntax for proper bitdepth

Reply #78
Nothing in my collection seems to behave weirdly, so it's probably not necessary for me to send any. I wish I still had my old DVD player with the HDCD light.
Think millionaire, but with cannons.

Re: Title formatting/syntax for proper bitdepth

Reply #79
I found another album that behaves strangely with new plugin. It is 2 disc set. Disc one now is marked as not being hdcd but when scanned through properties one track is found as hdcd but all tracks including this one show 16 bits in TBS.
The second disc of that set is also marked as not hdcd and again one track is hdcd when scanned through properties and that one track shows 17 bits in TBS.

Re: Title formatting/syntax for proper bitdepth

Reply #80
Please download updated test build: https://foobar.hyv.fi/foo_hdcd.fb2k-component.

HDCD scanner converted to newer SDK tech, now even supports column sorting Porcus wished.
HDCD detection routines are tweaked. At the moment I don't treat track as HDCD if it contains more non-HDCD enabled frames that there are HDCD enabled frames.
HDCD postprocessor now buffers the audio for a bit so it can detect such fake results that appear HDCD in the first seconds and then prove not to be. And peak extension volume halving decision is made from the buffered content and won't change later in the same track. Also seeking in a track should no longer cause any misbehaviors. Despite the added buffering Porcus' short tracks still won't be skipped.

Since I haven't had time to do any work towards making the output actually 20 bits, I changed the decoded_bitspersample field to 24 bps for now.

Re: Title formatting/syntax for proper bitdepth

Reply #81
First test of newest component - very positive.
1. I like 24 better than 20.
2. The tracks from my Reply #77 (I do not know how to point to the reply) are fine now - the whole album became HDCD again and is halved (despite the above mentioned track being described as HDCD but 16bit (not 17 or 24)) - the whole album plays at equal volume.
3. The album from my Reply #79 is not detected as HDCD at all (both in status bar and by scanner) and shows 16 bit. That's fine with me - at least it's consistent.
I will try and check another albums tomorrow.
Thank you for your great work.

Re: Title formatting/syntax for proper bitdepth

Reply #82
If you wish to test: https://foobar.hyv.fi/foo_truepeak_preview.fb2k-component

Updated the above file with faster bitdepth analysis. Also bennetng's oldsCool features inspired me to add detection for possible dither-noise-inflating-bitdepth case. If such suspicion is detected in a track the Status column will print a note about that.
No HDCD detections included (yet). The actual HDCD component needs to first be reliable in that regard.

Re: Title formatting/syntax for proper bitdepth

Reply #83
Updated the above file with faster bitdepth analysis.
Currently I am only interested in bitdepth analysis; can you allow for having analysis types more selectively? I hope to speed up scanning this way.
It's already very useful. I check single files from suspicious albums, where the flac bitrate seems to low for 24 bits. Found quite a few albums with reported bit depths 18-20, mostly it was my conversions and I forgot to tag them.

 

Re: Title formatting/syntax for proper bitdepth

Reply #84
Newest (todays version) bitdepth analysis shows:
- DSD - 32bit
- mp3 - 32 bit or 32 bit floating point (sometimes mixed within the same album)
- dtswav - 32 bit
- dtsflac - 32 bit
- ac3 - 32 bit or 32 bit floating point (sometimes mixed within the same album)
- dts96/24 - 32 bit
-  HDCD - 17, 24 or even 32! (files that were 17 or 24 with previous version)
- mp3 converted to 24 bit flac - 24
- wavpack 32 int - 32 int
- flac 16 bit converted to flac 32 bit - 16
- mp3 converted to flac 32 bit - 32 bit
- did not test .m2ts yet

Re: Title formatting/syntax for proper bitdepth

Reply #85
I am wondering: Does TRUEPEAK_SCANNER_ALBUM_BPS make any sense or is it in any way useful? I'd like to leave that tag out.

Currently I am only interested in bitdepth analysis; can you allow for having analysis types more selectively? I hope to speed up scanning this way.
New preview version of True Peak Scanner uploaded to the above url. Now if you configure a tag field name empty it will not be shown on the results and it won't be written to a file, so for example unwanted album-based BPS can be left out that way.

And I hope I understood correctly what you wanted. I made True Peak scanning optional too so the component can be used to scan just BPS if you so wish.

Coding remotely from a tiny laptop over RDP. I will blame that for any old and new bugs that may have found their way in.

Re: Title formatting/syntax for proper bitdepth

Reply #86
New preview version of True Peak Scanner uploaded to the above url. Now if you configure a tag field name empty it will not be shown on the results and it won't be written to a file, so for example unwanted album-based BPS can be left out that way.

And I hope I understood correctly what you wanted. I made True Peak scanning optional too so the component can be used to scan just BPS if you so wish.
Will look later, changes sound great. Big TY.

Re: Title formatting/syntax for proper bitdepth

Reply #87
I am wondering: Does TRUEPEAK_SCANNER_ALBUM_BPS make any sense or is it in any way useful? I'd like to leave that tag out.

Currently I am only interested in bitdepth analysis; can you allow for having analysis types more selectively? I hope to speed up scanning this way.
New preview version of True Peak Scanner uploaded to the above url. Now if you configure a tag field name empty it will not be shown on the results and it won't be written to a file, so for example unwanted album-based BPS can be left out that way.

And I hope I understood correctly what you wanted. I made True Peak scanning optional too so the component can be used to scan just BPS if you so wish.

Coding remotely from a tiny laptop over RDP. I will blame that for any old and new bugs that may have found their way in.
Thx.

I'll patiently await the addition of HDCD fields.


Re: Title formatting/syntax for proper bitdepth

Reply #88
More and more of my HDCDs are now described as 32 bit by TBS, especially those without PE.
Stereo PCM .m2ts was correctly described as 24 (will try later with DTSHDMA and TrueHD).
Isn't this new version (since yesterday) just showing 32 when it can't see "proper" 16 or 24 (like mp3, ac3, dts or hdcd w/o PE)?

Re: Title formatting/syntax for proper bitdepth

Reply #89
I still plan to improve the BPS scanner, I for example realized my optimizations made it not always detect when source is float. But even now it doesn't just randomly show 32, it means the decoded signal resulted in sample values that needed the lowest bits. With lossy sources it's expected, though they should also say "float".
I was planning on taking a look at the HDCD decoder next and try to figure out why it produces such results.

Re: Title formatting/syntax for proper bitdepth

Reply #90
I don't really understand what is going on. This on a portable install to eliminate all other errors, I have a track that behaves as follows:
* HDCD scanning: identifies but no features: 0 dB gain, PE & TF disabled
* Bitspersample scanning depends on what I set "halve volume" to:
   32 (float) and peak 1.06 if "Never"
   24 and peak 0.528 if "Always" or "Only if peak extension is enabled"

So it says it doesn't use PE, but it does halve volume.

Bit depths reported for other identified HDCD tracks: 16, 17, 23, 24, 31, 32 and 32 (float)

Re: Title formatting/syntax for proper bitdepth

Reply #91
I'd definitely be interested in a sample, if that's with the yesterday's foo_hdcd.

Re: Title formatting/syntax for proper bitdepth

Reply #92
Made further tests:
- DTS shows 32
- DTSHDMA - proper 24
- TrueHD with ATMOS -  24 (which is proper for bed channels and ATMOS is not a channel just a metadata).
I use "bitspersample", "true bitdepth" (taken from the scanner), "decode bitspersample" (with comment "decoded to) and "bitspersample extra".
Just for the display part of it the weirdest combination is for:
-DSD which shows 1 (from "bitdepth"), 32 (from "true bitdepth") and decoded to 24 (from "decoded bitdepth") and
- HDCD which sometimes shows 16, true 32, decoded to 24.
What also suprised me were these values for mp3 converted to flac - I expected empty bits inside (meaning it would not show 24 or 32 but something less).  Whereas for upconverted from lossy to 32 it also showed "integer" (from "bitspersample extra").

Edit. After reading @Porcus last post I remembered that I too had HDCDs with 23 or 31 and those values were for tracks that contained very little music like short tracks with only vocal and acoustic guitar. Other tracks from such discs but containing "full band of instruments" showed 24 or 32 respectively.


Re: Title formatting/syntax for proper bitdepth

Reply #94
That's good to hear, I think.

I analyzed the HDCD decoder sources now. Peak Extension produces real 24-bit output. There's a huge lookup table to convert the higher 16-bit source values to 24-bits. I know the highly spoken HDCD authoring device Model Two DAC was 24-bit device and capable of convering HDCD back to 24-bits, I think these may very well be actually correct replacement values.

I plotted the ratio of actual samples vs extended samples in Excel to get a graph:
X
Surprisingly linear except where the exponential growth really takes off.

The LLE gain and volume ramp code however is suspicious. The volume ramping code looks bogus, it doesn't do adjustment smoothly but will cause 32-bit output samples. This looks so random that it can't be from original implementation.
I also wonder about the gain adjustments, apart from 0 dB value the other gains look suspicious. For example -6 dB multiplies the samples by 0.501190185546875. That's very close to -6 dB (-5.9999 dB), but causes 32 bit output. I wonder why samples aren't just multiplied by 0.5. The other gain values aren't any better.
If these gain values are correct, only way to fix the output to 24 bps will be to truncate the output.

Re: Title formatting/syntax for proper bitdepth

Reply #95
I also wonder about the gain adjustments, apart from 0 dB value the other gains look suspicious. For example -6 dB multiplies the samples by 0.501190185546875.
Hm, 6 dB low-level gain isn't supposed to be in CDs, so that must be "special mode" only?
Anyway, that figure is 0.100000000100111 in binary, so it gives an error 9 bits down. And when does the 6 dB gain kick in? This could get the 20th bit wrong or something like that?

If the decoding chip worked in the integer domain, then it couldn't be designed for more than the resolution (but then, what was that internally ...?) But maybe it is a bold assumption that the encoding was designed for decoding to reverse it - "lossless decoding" isn't even an ambition when there is a downmix.

Re: Title formatting/syntax for proper bitdepth

Reply #96
This most probably won't be popular but... if it produces 32-bit output samples (even if it is against the "marketing talk" or original hardware capabilities) why not leave it as 32 and do not truncate it. Maybe better change the "decoded bitdepth" command to show 32.

Re: Title formatting/syntax for proper bitdepth

Reply #97
Biggest harm in leaving it like that is the annoyance knowing that the output is far from what it should be.

Btw, does anyone have foo_hdcd sources from 2010-2012? Optimizations done in 2016 have introduced some bug making the decoding differ a lot from hdcd.exe reference. I see a rather nasty glitch in a fadeout causing a 50 dB error.


Re: Title formatting/syntax for proper bitdepth

Reply #99
Thanks musicmusic. I actually was trying archive.org earlier today but it claimed that file wasn't indexed. But your link clearly works.

I shouldn't have blamed optimizations for the difference glitch. It was actually caused by my change of letting go of HDCD processing after 200 ms. That should be plenty of time for packets according to specs but apparently not in reality.