[FFmpeg-devel] [PATCH] Fast half-float to float conversion

Jimmy Christensen jimmy
Tue Jun 30 15:11:16 CEST 2009


On 2009-06-30 11:31, Reimar D?ffinger wrote:
> On Tue, Jun 30, 2009 at 11:18:47AM +0200, Reimar D?ffinger wrote:
>>> +float half2float(unsigned int v) {
>>> +    union {
>>> +        unsigned int u;
>>> +        float f;
>>> +    } r;
>>> +    r.u = half_float_mantissa[half_float_switch[v>>10]+(v&0x3ff)]+half_float_exponent[v>>10];
>>
>> This definitely would have to be documented. I also suspect it doesn't
>> handle denormals correctly at all.
>
> Sorry I got confused. I have to say I think it is quite idiotic to call
> a table half_float_mantissa when it also codes (part of) the exponent.

I did rename them. Probably needs better better names :) The original 
name was just hfm.

-- 
Best Regards
Jimmy Christensen
Developer
Ghost A/S



More information about the ffmpeg-devel mailing list