[FFmpeg-devel] [PATCH] Use more appropriate types when decoding vorbisfloats

Alex Converse alex.converse
Sat Jul 24 01:03:32 CEST 2010


2010/7/23 M?ns Rullg?rd <mans at mansr.com>:
> Alex Converse <alex.converse at gmail.com> writes:
>
>> Reduces object code by 56 bytes on x86_64
>>
>> Index: libavcodec/vorbis_dec.c
>> ===================================================================
>> --- libavcodec/vorbis_dec.c ? (revision 24471)
>> +++ libavcodec/vorbis_dec.c ? (working copy)
>> @@ -178,11 +178,11 @@
>>
>> ?static float vorbisfloat2float(uint_fast32_t val)
>> ?{
>> - ? ?double mant = val & 0x1fffff;
>> - ? ?long exp ? ?= (val & 0x7fe00000L) >> 21;
>> + ? ?float mant = val & 0x1fffff;
>> + ? ?int exp ? ?= (val & 0x7fe00000L) >> 21;
>> ? ? ?if (val & 0x80000000)
>> ? ? ? ? ?mant = -mant;
>> - ? ?return ldexp(mant, exp - 20 - 768);
>> + ? ?return ldexpf(mant, exp - 20 - 768);
>> ?}
>
> I bet at least two BSDs are missing the f version of ldexp, but we can
> deal with that.
>

I think they are too busy complaining about people not writing
portable software.

I don't want to add a maintenance burden elsewhere. Maybe we should
just keep the int part of the patch and drop the rest?



More information about the ffmpeg-devel mailing list