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: Why can’t FLAC work for DSD as it does for PCM? (Read 6062 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Why can’t FLAC work for DSD as it does for PCM?

I’m just trying to understand things. I realize technically DSD and PCM are a little like apples and orange as they are different methods of digitally storing audio content, but once you get down to a deeper level… are they not more similar than different?

Both are a series of samples taken at a certain constant rate, at a specified bit depth. commonly 16/24/32 bit for PCM, or 1 bit for DSD. Sampling rates on the scale of kHz with PCM, sampling rates in the mHz with DSD.

Couldn’t FLAC be used to handle that type of input the same way? Are there concerns that software/hardware compatible with FLAC would be expecting PCM and would not know how to interpret the data?

FLAC seems like it would resolve many of the issues with current file-based DSD storage formats… lack of compression, poor support for tagging, and no checksumminng.

Having gone down the rabbithole of DSF vs DFF (and still have no real clue on the *actual* difference or why these formats are the way they are) I can’t help but to think we are kindof in the dark ages of DSD and that FLAC as a possible container for DSD data could potentially resolve many problems with the way things are currently implemented.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #1
They are more different than similar.
PCM is pulse code modulation. You have samples.
DSD is pulse density modulation. You have no samples but a stream of 1's and 0's determining the pulse.
Contrary to PCM, DSD is not editable hence you can compress it either.
TheWellTemperedComputer.com

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #2
Sure you can compress it. WavPack can, and DST compression is even heavier.

The FLAC file format cannot accommodate the signal; for one thing, the sampling rate is too high. Still one could of course discuss whether the compression algorithm that FLAC employs, could be used hadn't it been stopped by such "header-imposed restrictions".
After all, the fourth frame header byte still leaves open some combinations: if a future revision would use those on signals that as of now are not possible to contain, then old decoders will reject files that they wouldn't anyway be able to make sense of.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #3
It is possible to pack DSD into DoP and compress it with FLAC. Bit it is absolutely useless. Because DoP is incompressible. And compatibility is even worse than with native DSD.

FLAC seems like it would resolve many of the issues with current file-based DSD storage formats… lack of compression, poor support for tagging, and no checksumminng.
All of this is resolved by WavPack already . WavPack does support DSD. Use it.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #4
Sure you can compress it. WavPack can, and DST compression is even heavier.

Thanks for the heads-up
TheWellTemperedComputer.com

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #5
I’m just trying to understand things. I realize technically DSD and PCM are a little like apples and orange as they are different methods of digitally storing audio content, but once you get down to a deeper level… are they not more similar than different?

Both are a series of samples taken at a certain constant rate, at a specified bit depth. commonly 16/24/32 bit for PCM, or 1 bit for DSD. Sampling rates on the scale of kHz with PCM, sampling rates in the mHz with DSD.
DSD has a set of rules to mandate the pattern of 1-bit samples, for example:
https://hydrogenaud.io/index.php/topic,125862.msg1043748.html#msg1043748

Also, you posted in this thread before, have you read the replies?
https://hydrogenaud.io/index.php/topic,124862.msg1033865.html#msg1033865

Even if flac supports DSD in the future, it won't be backwards compatible with a lot of older 3rd party software, let alone hardware like streamers and DAPs. 32-bit flac is not backwards compatible too.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #6
FLAC requires a minimum of one bit per sample for most audio. Even if you could stuff DSD into FLAC, it wouldn't be compressed.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #7
FLAC cannot use less than 1 bit per sample in its residual coding stage. Also, the prediction stage doesn't really work with only one bit. To compress PDM, the 'tools' the FLAC format has are insufficient.
Music: sounds arranged such that they construct feelings.

Re: Why can’t FLAC work for DSD as it does for PCM?

Reply #8
Compression algorithms that work well for PCM audio don't work well for DSD and vice versa. FLAC only contains an algorithm for PCM.
WavPack deals with this by including two separate algorithms:
WavPack's PCM algorithm is superficially similar to FLAC: the file contains parameters to predict samples given some small number of previous ones, and "residual" values to correct errors in the predictions.
WavPack's DSD algorithm is different and closer to to a normal file compression algorithm like in zip. DSD samples are grouped into blocks of 8. The file starts with a table of probabilities for each possible value of a block given the previous block's value. The file then contains a stream of data encoding how to select each block by looking up in the probability table. (this is a type of "Arithmetic Coding")