Revision 324e7ee2 libavutil/intfloat_readwrite.c
libavutil/intfloat_readwrite.c  

31  31  
32  32 
double av_int2dbl(int64_t v){ 
33  33 
if(v+v > 0xFFEULL<<52) 
34 
return 0.0/0.0;


34 
return NAN;


35  35 
return ldexp(((v&((1LL<<52)1)) + (1LL<<52)) * (v>>631), (v>>52&0x7FF)1075); 
36  36 
} 
37  37  
38  38 
float av_int2flt(int32_t v){ 
39  39 
if(v+v > 0xFF000000U) 
40 
return 0.0/0.0;


40 
return NAN;


41  41 
return ldexp(((v&0x7FFFFF) + (1<<23)) * (v>>311), (v>>23&0xFF)150); 
42  42 
} 
43  43  
...  ...  
49  49 
m = (m<<8) + ext.mantissa[i]; 
50  50 
e = (((int)ext.exponent[0]&0x7f)<<8)  ext.exponent[1]; 
51  51 
if (e == 0x7fff && m) 
52 
return 0.0/0.0;


52 
return NAN;


53  53 
e = 16383 + 63; /* In IEEE 80 bits, the whole (i.e. 1.xxxx) 
54  54 
* mantissa bit is written as opposed to the 
55  55 
* single and double precision formats. */ 
...  ...  
88  88 
ext.mantissa[i] = m>>(56(i<<3)); 
89  89 
} else if (f != 0.0) { 
90  90 
ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff; 
91 
if (f != 1/0.0)


91 
if (f != INFINITY)


92  92 
ext.mantissa[0] = ~0; 
93  93 
} 
94  94 
if (d < 0) 
Also available in: Unified diff