MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_init_half2float_tables

Function ff_init_half2float_tables

libavutil/half2float.c:39–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37#endif
38
39void ff_init_half2float_tables(Half2FloatTables *t)
40{
41#if !HAVE_FAST_FLOAT16
42 t->mantissatable[0] = 0;
43 for (int i = 1; i < 1024; i++)
44 t->mantissatable[i] = convertmantissa(i);
45 for (int i = 1024; i < 2048; i++)
46 t->mantissatable[i] = 0x38000000UL + ((i - 1024) << 13UL);
47 for (int i = 2048; i < 3072; i++)
48 t->mantissatable[i] = t->mantissatable[i - 1024] | 0x400000UL;
49 t->mantissatable[2048] = t->mantissatable[1024];
50
51 t->exponenttable[0] = 0;
52 for (int i = 1; i < 31; i++)
53 t->exponenttable[i] = i << 23;
54 for (int i = 33; i < 63; i++)
55 t->exponenttable[i] = 0x80000000UL + ((i - 32) << 23UL);
56 t->exponenttable[31]= 0x47800000UL;
57 t->exponenttable[32]= 0x80000000UL;
58 t->exponenttable[63]= 0xC7800000UL;
59
60 t->offsettable[0] = 0;
61 for (int i = 1; i < 64; i++)
62 t->offsettable[i] = 1024;
63 t->offsettable[31] = 2048;
64 t->offsettable[32] = 0;
65 t->offsettable[63] = 2048;
66#endif
67}

Callers 3

decode_initFunction · 0.85
phm_dec_initFunction · 0.85
ff_init_filtersFunction · 0.85

Calls 1

convertmantissaFunction · 0.85

Tested by

no test coverage detected