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: DSD / DST compress/decompress in Foobar (Read 20239 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

DSD / DST compress/decompress in Foobar

As DSD fans know, DST is simply losslessly-compressed DSD (just like FLAC is losslessly-compressed wav/PCM).

With the required plug-in, Foobar can play DSD files, as well as DST files (both ending in .dff). However, it cannot convert (compress/decompress) between the two.

There are already one or two programs that can compress DSD to DST (e.g. Philips ProTECH DSTEncoder). This is great for saving disc space. However, I am not aware of a single program that will decompress DST back to DSD.

We know Foobar can decompress DST on-the-fly because it plays back the files just fine. So, any chance a developer could develop this to make Foobar produce actual decompressed DSD (.dff) files?

Thanks in advance.

DSD / DST compress/decompress in Foobar

Reply #1
When I read about such topics and I see phrases like "Philips ProTECH DSTEncoder" then I think answer why something is missing is clear - patents, copyrights on intellectual property, etc.
OK, I am not an expert in this matter but I expect that if you will get any kind of official answer on your request it will be "foobar isn't about reverse engineering closed sources and breaking any copyrights".

DSD / DST compress/decompress in Foobar

Reply #2
There is an open source reference implementation floating around somewhere, which was how I was able to produce a DST from a DSD file I had acquired from a free samples archive. However, both compression and decompression using this reference code is quite slow. Even decompression is sub real time on modern systems. Thankfully, each block is independently compressed, so multiple blocks may be decoded in parallel using multiple processor cores, which is what the SACD input component does.

EDIT: Here, have the reference decoder and encoder implementations, along with the included sample files. Beware of slow, also beware of patent encumbrance.

EDIT 2: foo_input_sacd manages to multithread decoding by using unique instances of the ebunch object from the reference decoder, and feeding each block, in turn, to a different thread, then waiting when all threads are occupied. It does make sure that it reads the output in a serial fashion, though. I'm not sure if the state data used by the encoder would allow for encoding every N blocks with one instance, without hurting the performance of the encoder.

DSD / DST compress/decompress in Foobar

Reply #3
When I read about such topics and I see phrases like "Philips ProTECH DSTEncoder" then I think answer why something is missing is clear - patents, copyrights on intellectual property, etc.
OK, I am not an expert in this matter but I expect that if you will get any kind of official answer on your request it will be "foobar isn't about reverse engineering closed sources and breaking any copyrights".


@ EpicForever: You seem to have missed my point (I cited ProTECH merely as an example of a program that can compress to DST, which is the complete opposite of what I need, not as something to be reverse-engineered.) My point was: Foobar already knows how to decompress DST on-the-fly anyway; is there a chance this could be used to create a file, instead of just on-the-fly audio.

foo_input_sacd manages to multithread decoding by using unique instances of the ebunch object from the reference decoder, and feeding each block, in turn, to a different thread, then waiting when all threads are occupied. It does make sure that it reads the output in a serial fashion, though. I'm not sure if the state data used by the encoder would allow for encoding every N blocks with one instance, without hurting the performance of the encoder.


@kode54: Are you saying that the on-the-fly DST decompression that Foobar does for the purpose of playback could not be adapted to create a file instead?  (Thanks for the info and link - I'm not at all technical but will check it out.)

DSD / DST compress/decompress in Foobar

Reply #4
On the fly decompression would need to be adapted to write a file, yes. And it couldn't be through the input code already playing the file, or at least optimally, it wouldn't. It should be something like the converter.

DSD / DST compress/decompress in Foobar

Reply #5
Thanks, kode54. Is there any chance a dff/dhf converter could be implemented? For those of us who create either DST or DoP files, there's currently no way to convert them back to plain dff/dhf; it's a one-way street. A converter would solve that issue...

DSD / DST compress/decompress in Foobar

Reply #6
Any chance? If not, no worries, but thought I'd humbly ask...

DSD / DST compress/decompress in Foobar

Reply #7
That depends on whether a developer wishes to step forward and make this happen.

DSD / DST compress/decompress in Foobar

Reply #8
That depends on whether a developer wishes to step forward and make this happen.


Oh! Sorry, I thought you were one! Okay, thanks anyway for your responses.

DSD / DST compress/decompress in Foobar

Reply #9
kode54 is a developer, but that doesn’t mean he has to make everyone’s every wish into reality.

DSD / DST compress/decompress in Foobar

Reply #10
kode54 is a developer, but that doesn’t mean he has to make everyone’s every wish into reality.


Oh I see; so his last response was a snark. Thanks for clarifying, and I certainly wasn't presuming that anyone had to make anyone's wish a reality.

DSD / DST compress/decompress in Foobar

Reply #11
Oh I see; so his last response was a snark. Thanks for clarifying
What? No. Don’t put words in his or my mouth. It wasn’t necessarily that at all. It’s a factually accurate statement. A plugin appearing will require someone developing it. Not explicitly saying ‘but it won’t be me’ isn’t confirmation of sarcasm. He’s not the only developer around, nor does his high productivity mean that he has to develop everything himself.

DSD / DST compress/decompress in Foobar

Reply #12
BTW there are two plugins that can decode DST files:
* foo_input_dsdiff by kode54
* foo_input_sacd by manisiutkin

 

DSD / DST compress/decompress in Foobar

Reply #13
Yes, but he doesn't want real time decoding, he wants offline conversion between raw DSD and DST compressed. And I wasn't necessarily refusing to do this, either. I just wasn't trying to get your hopes up by committing to doing it.

First, I have to look and see if it's possible to encode or decode DST blocks out of order with different instances of a DST encoder or decoder, and produce identical results. Then I can decide whether it would be beneficial to multithread the whole thing for a decent speed boost.

That's just converting one file. I haven't really stepped up to do a full converter utility. Certainly, it would be nice if it were something integrated with the stock converter component, or something which could be referenced from my component by the actual converter. I would hate to have to implement a dialog and conversion queue from scratch if I didn't need to.

EDIT: I have performed a quick test and determined that the reference DST encoder state is only specific to each individual block, and that the state going in and coming out is completely irrelevant, other than the fields containing the base information about the encoder mode, such as the block size and sample rate. This matches with what manisiutkin has determined and applied to foo_input_sacd for DST decoding. Thus, encoding may also be optimized by queueing each block of samples through multiple threads.

DSD / DST compress/decompress in Foobar

Reply #14
As DSD fans know, DST is simply losslessly-compressed DSD (just like FLAC is losslessly-compressed wav/PCM).

With the required plug-in, Foobar can play DSD files, as well as DST files (both ending in .dff). However, it cannot convert (compress/decompress) between the two.

There are already one or two programs that can compress DSD to DST (e.g. Philips ProTECH DSTEncoder). This is great for saving disc space. However, I am not aware of a single program that will decompress DST back to DSD.

We know Foobar can decompress DST on-the-fly because it plays back the files just fine. So, any chance a developer could develop this to make Foobar produce actual decompressed DSD (.dff) files?

Thanks in advance.

There is one program for sure doing what you asking (converting DST back to DSD and not just decompress on the fly). It's very simple actually to guess and it's  J River .
I have version 20 and it works just fine doing that 

DSD / DST compress/decompress in Foobar

Reply #15
AFAIK JRiver first converts DSD/DST to PCM and then converts it back to DSD. It's a lossy conversion, not lossless DST->DSD decompression.

Re: DSD / DST compress/decompress in Foobar

Reply #16
There is something new. Wavpack5. You can save space using this format and decoding such files are can be done in real time even on atom 230.

Re: DSD / DST compress/decompress in Foobar

Reply #17
There is something new. Wavpack5. You can save space using this format and decoding such files are can be done in real time even on atom 230.
Yes, wavpack is faster than dst decoding. Note that wavpack won't accept DST encoded files, it needs uncompressed DSD/DFF files. If you have DST files you will first need a decoder.