19 #ifndef AVCODEC_HALF2FLOAT_H
20 #define AVCODEC_HALF2FLOAT_H
29 while (!(m & 0x00800000)) {
41 uint16_t *offsettable)
44 for (
int i = 1;
i < 1024;
i++)
46 for (
int i = 1024;
i < 2048;
i++)
47 mantissatable[
i] = 0x38000000UL + ((
i - 1024) << 13UL);
50 for (
int i = 1;
i < 31;
i++)
51 exponenttable[
i] =
i << 23;
52 for (
int i = 33;
i < 63;
i++)
53 exponenttable[
i] = 0x80000000UL + ((
i - 32) << 23UL);
54 exponenttable[31]= 0x47800000UL;
55 exponenttable[32]= 0x80000000UL;
56 exponenttable[63]= 0xC7800000UL;
59 for (
int i = 1;
i < 64;
i++)
60 offsettable[
i] = 1024;
64 static uint32_t
half2float(uint16_t
h, uint32_t *mantissatable, uint32_t *exponenttable,
65 uint16_t *offsettable)
69 f = mantissatable[offsettable[
h >> 10] + (
h & 0x3ff)] + exponenttable[
h >> 10];