[FFmpeg-devel] patch for DCA "floating point output" option
Benjamin Larsson
banan
Sat Jan 19 13:03:51 CET 2008
Michael Niedermayer wrote:
> 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:
>>
>> #define CONFIG_AUDIO_NONSHORT 1
>>
>> 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.
>
> [...]
>> +#ifdef CONFIG_AUDIO_NONSHORT
>> + samples[k] = s->samples[j + k * 256] / 32768.0f;
>
> isnt there a more efficient way than to scale each individual sample?
>
> besides this, the patch looks good
> [...]
>
I looked through the scaling issue before and something isn't right with
regard to the scaling, there are 2 cases where magic constants are used
to get the correct scale, I havn't tracked it down and the specification
is unclear in the matter. But the patch is ok and something like this
will be needed in the future for all codecs. I'll apply it soon.
MvH
Benjamin Larsson
More information about the ffmpeg-devel
mailing list