[FFmpeg-devel] Float vs. fixed-point audio codecs
Fri May 14 20:00:58 CEST 2010
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> On Fri, May 14, 2010 at 04:20:44PM +0100, M?ns Rullg?rd wrote:
>> Systems we care
>> about can be broadly divided into three categories:
>> 1. No hardware FPU
>> 2. Slow FPU
>> 3. Fast FPU
> Maybe I'm wrong, but I would expect it might also depend on which
> SIMD features are available on some CPUs (something like a borderline FPU
> and optional integer-only SIMD).
That should also be considered. It makes the algorithm for choosing
version a bit more elaborate, but the principle remains the same.
>> In all of the above cases it may be desirable to enable both versions,
>> even if one is faster, letting the user choose. This brings us to the
>> question of how to choose implementation in the API as well as on the
>> command line. One possibility is to introduce a flag which when set
>> causes the float version to be chosen, the default depending on
>> configure options. Whatever the default, the flag could be set or
>> cleared from the command line.
> Is just one flag going to work out? The default would then have to be
> set during codec opening I guess and changing it later would be hard.
> I'd expect a prefer_float and a prefer_int flag might work better...
avcodec_alloc_context() and friends would set the flag to its default
as determined at build time. The user could then set or clear it as
desired before calling avcodec_open(). From the command line this
would be done with "-flags +float" or "-flags -float".
mans at mansr.com
More information about the ffmpeg-devel