I decided to improve Libav DTS decoder - dcadec. Here I want to explain what are its problems now and what I would like to do about them.
DTS encoded audio stream consists of core audio and may contain extended audio. Lavc dcadec supports XCH
and XLL
extensions but X96
, XXCH
and XBR
extensions are waiting to be implemented - I'd like to implement them later.
For the DTS lossless extension - XLL
, the decoded output audio should be a bit for bit accurate reproduction of the encoded input. However there are some problems.
- The main problem is that the core decoder converts integer coefficients read from the bitstream to floats just after reading them (along with dequantization). All other steps of audio reconstruction are done with floats and the output can not be bitexact reproduction of the input so it is not lossless. When the coefficients are read from the bitstream the core decoder does following:
dequantization (with int -> float conversion)
|
inverse ADPCM (when needed)
|
VQ decoding (when needed)
|
filtering: QMF, LFE, downmixing (when needed)
|
float output.
I'm working now on modifying the core to work with integer coefficients and then convert them to floats before QMF filtering for lossy output but use bitexact QMF (intermediate LFE coefficients should be always integers and I think it's not correct in the current version) for lossless output. Also I added an option called -force_fixed
to force fixed point reconstruction for any kind of input.
- Another problem is XLL extension presence detection. During the testing I found out that
XLL
extension is not detected sometimes and the core audio only is decoded in this case. I want to fix this issue as well.