top of page
Search

A Rebuilt DSD Encoder, the New .dst Container, and a DST Compression Encoder

  • siseong3
  • 20 hours ago
  • 6 min read

The DSD encoder, rebuilt from scratch

For a long time, the format converter in Pine Player Pro handed DSD conversion over to the previous Pine Player encoder. It worked, but measurements kept showing room for improvement. In particular, raising the rate to DSD128 or DSD256 did not make the result any quieter — which, for an audio format, simply does not add up.


In this release both directions have been rewritten — PCM to DSD, and DSD back to PCM — and two things that were missing have been added: a DST compression encoder and a new container, .dst. Here is what changed, with the measurements.


Image introducing DSD (Direct Stream Digital) high-resolution one-bit audio
DSD records each sample as a single bit. Where the noise gets pushed when PCM becomes one bit decides the result — and that is the part rebuilt in this release.

At a glance

Metric

Previous Pine Player encoder

New implementation

DSD64 SNR (1kHz at −6dBFS)

100.0 dB

111.7 dB

DSD64 THD

−114.2 dB

−134.7 dB

Noise in silence (DSD64)

−108 dBFS

−137 dBFS

In-band noise (DSD128)

−136.3 dBFS

−180.8 dBFS

In-band noise (DSD256)

−156.8 dBFS

−191.9 dBFS

PCM to DSD, 30-second track

10.62 s

3.25 s

Creating DST compression

Not possible (read only)

49.0% · 2.04× (3.6× real time)


Conditions and methods are given in each section below. Every figure comes from decoding and analyzing under the same conditions.


1. PCM to DSD: a new sigma-delta modulator

DSD is a one-bit signal. Turning 16-bit or 24-bit PCM into one bit requires noise shaping that pushes the quantization error out of the audible band, and that design decides how the result sounds.


The new modulator uses an error-feedback structure. The zeros of the noise transfer function are spread inside the audible band in a Chebyshev arrangement to suppress noise where it matters, and the poles follow a Butterworth arrangement that holds the out-of-band peak gain at 1.5, leaving a one-bit modulator enough margin not to run away. Fifth, sixth, and seventh order designs are available, and a guard brings the modulator back if its state ever exceeds its limits.


Measured (DSD64, 1kHz at −6dBFS, decoded and analyzed the same way)

Previous Pine Player encoder — SNR 100.0dB, THD −114.2dB

New modulator, 6th order — SNR 111.7dB, THD −134.7dB

Noise during silent passages dropped from −108dBFS to −137dBFS, and the output level is unchanged. With real music, the response deviation from 31Hz to 16kHz is ±0.06dB.


2. Higher rates now really are quieter

The zeros of the noise transfer function have to be placed according to where the audible band falls in normalized frequency. The first implementation used a single coefficient table designed for DSD64 at every rate, so at DSD128 and DSD256 the zeros were pushed out to 40–80kHz and almost no noise was removed inside the audible band. Raising the rate bought you nothing.


Fifth, sixth, and seventh order tables have now been designed for each rate. In-band noise, measured with a silent input:

DSD64 — −140.1dBFS (unchanged)

DSD128 — −139.2 to −180.8dBFS (41.6dB better)

DSD256 — −141.5 to −191.9dBFS (50.4dB better)

SNR with a 1kHz sine also rose, from 126.1 to 130.8dB at DSD128 and from 127.9 to 130.8dB at DSD256. Raising the rate now pays off exactly as it should.


3. High frequencies from 44.1~48kHz sources, and three precision issues

Measuring side by side against the previous encoder turned up three more things worth fixing.


High frequencies were being shaved off 44.1~48kHz sources. At 32 taps per phase the interpolation filter had far too wide a transition band, and 18–20kHz lost between 1.4 and 4.3dB. Filter length is now derived from the transition-band width, and interpolation runs in two stages. The first raises the source eightfold through a sharp filter (140 taps per phase, Kaiser β=10); by the second stage the signal lives below 3% of the sample rate, so a light curve interpolation finishes the job. On a 44.1~48kHz sweep the result now matches the previous encoder to 0.00dB all the way to 20kHz, where 19–20kHz used to sit at −4.3dB.


Double quantization in the 16-bit Normalize path. The first pass was written as 16-bit, then read back and quantized a second time while the level was adjusted. The intermediate result is now kept as 32-bit float and quantized only once at the end, with TPDF dither for 16-bit output. With a quiet source, SNR rose from 58.1dB to 93.3dB.


Uncompensated filter delay. The encoder now reads ahead by the group delay and flushes the tail after the source ends, so the 16-sample offset against the source became zero samples — and the length comes out exactly right.


Speed improved along the way. Converting a 30-second track from PCM to DSD takes 3.25 seconds, 3.3 times faster than the previous encoder at 10.62 seconds. The DSD Gain (−10 to +10dB) and Normalize settings on screen are also honored for PCM sources now; they used to be ignored.


4. DSD to PCM demodulation, also written in house

The other direction is new as well. A byte-table 256-tap FIR decimates by eight, followed by up to four stages of a 63-tap half-band filter when more decimation is needed. The more the signal is decimated, the longer the filter, so ultrasonic noise cannot fold back into the audible band. TPDF dither is applied to 16-bit output.


At 44.1k, 48k, 96k, and 192k the SNR is about 100dB and THD −114dB — the same level as before — with 0.00dB of response difference from 20Hz to 30kHz and time alignment within one sample. The results from DSF, DFF, and DST inputs are sample-for-sample identical. Speed runs at 21 to 36 times real time for a 30-second DSD64 file.


5. A DST compression encoder — half the file size

DST (Direct Stream Transfer) is the lossless compression that SACD uses for DSD. Until now Pine Player Pro could only read material that was already DST compressed, such as a SACD ISO; it could not create DST, because there was no encoder to produce the compression.


That encoder has now been written from scratch: the arithmetic coder, the frame syntax, the prediction filter recomputed for every frame and channel (autocorrelation, then Levinson-Durbin, then 9-bit quantization at order 128), and the 64-entry probability table for prediction errors, all following the specification. Where compression would gain nothing, the encoder falls back to the specification's uncompressed frame.


Measured (a 29.7-second SACD source, 5 threads) — 20,971,520 bytes became 10,269,578 bytes: 49.0%, about 2.04 times smaller, finished in 8.3 seconds, or 3.6 times real time. Because it is lossless, decompressing returns a byte-for-byte match of the original, and the files play correctly in an independent third-party DST decoder as well.


A new output format, DFF(DFF with DST compression), has been added to the converter. The SACD specification defines DST only for DSD64, so choosing this format fixes the rate at DSD64. Compression progress continues in the existing progress bar, and when several files convert at once — up to five — the core count is divided among them so the jobs do not crowd each other out.


6. The new .dst container — tags and artwork on compressed DSD

DFF is an old container with no proper standard place for tags. DSF handles tags well but supports no compression. So a container that takes the better half of each now exists.


.dst carries DFF's DST-compressed audio exactly as it is, and appends an ID3v2.3 tag at the end of the file to hold track information and artwork. Programs that read DFF simply pass over the trailing tag bytes, so nothing breaks.


You can create it with the converter's DST(DSF with DST compression) output format, which carries over the track information and artwork from the source. Playback works through both the normal PCM path and the native DoP path, and the metadata editor reads and writes these tags.


Verification compared a .dst against a .dff of the same audio: all 5,644,930 bytes of decompressed DSD matched. PNG and JPEG artwork came back byte-identical after a round trip, and truncated files or files with an inflated tag size no longer bring the app down.


7. Other changes

DSD to DSD conversions only change the container now. Moving DSD of the same rate into a different DSD container used to make a round trip through PCM. The audio data is now carried over as it is. That covers DSF to DFF and back, and going from a DST-compressed DFF to DSF decompresses straight into the destination with no temporary file. Lossless, and far faster.


DST-compressed .dff files convert too. Only uncompressed DSD could be read before, so DST .dff conversions failed. They are now decompressed and processed, and both the track information and the output file name follow the original.


Native DoP playback covers more. SACD ISO tracks and DST-compressed .dff files now play natively over DoP, solved by an input path that hands the decompressed stream over as if it were a file. Seeking and moving to the next track behave normally.


Format names say what they mean. DFF(DST) became DFF(DFF with DST compression), and DST(DSD) became DST(DSF with DST compression). If an older name is still saved in your settings, it is read as the new one automatically.


In closing

Three things, then. A new DSD encoder improves SNR by 11.7dB at DSD64 and in-band noise by 41 to 50dB at DSD128 and DSD256; a DST compression encoder can now shrink DSD files to roughly half their size without losing anything; and a new container, .dst, finally lets compressed DSD carry tags and artwork.


Every figure above comes from decoding and analyzing under the same conditions. We hope this helps those of you who create and archive your own DSD material.

 
 
 

Comments


bottom of page