[FFmpeg-devel] patch for DCA "floating point output" option

madshi dear
Sat Jan 19 09:14:46 CET 2008

Michael Niedermayer schrieb:
> On Fri, Jan 04, 2008 at 01:36:50PM +0100, madshi wrote:
>> Not sure whether the DCA maintainers will like this patch. But maybe they 
>> will, so I'm posting it here just in case.
>> This patch adds optional floating point output to the DCA decoder. This 
>> optional feature must be enabled at compile time by adding the following 
>> switch to config.h:
>> I'm using this solution in my eac3to tool because 16bit PCM just doesn't 
>> cut it for a good audio transcoding tool. The idea for this option comes 
>>> from the MLP/TrueHD decoder which offers a similar feature.
> [...]
>> +                samples[k] = s->samples[j + k * 256] / 32768.0f;
> isnt there a more efficient way than to scale each individual sample?

To be honest, I'm not sure. I don't know the libav tool functions well.
Maybe there's a call which can scale a whole floating point buffer more
efficiently than scaling each sample separately?

Another option would be to try to scale elsewhere in the DCA decoder
code where it may be more efficient. But I was afraid of breaking
something. Also I wanted to keep the changes to the source code as
small as possible.

I've made a similar patch for the (native) AC3 decoder and there it
was the other way round: I had to disable a multiply of 32767.0f for
floating point output. It seems to me that the DCA compiler internally
works with unscaled samples while the AC3 decoder internally works
with scaled samples, but I'm not really sure.

> besides this, the patch looks good



More information about the ffmpeg-devel mailing list