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

Reimar Döffinger Reimar.Doeffinger
Tue Jun 30 11:31:49 CEST 2009


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.



More information about the ffmpeg-devel mailing list