| 36 | void ff_init_float2half_tables(Float2HalfTables *t); |
| 37 | |
| 38 | static inline uint16_t float2half(uint32_t f, const Float2HalfTables *t) |
| 39 | { |
| 40 | #if HAVE_FAST_FLOAT16 |
| 41 | union { |
| 42 | _Float16 f; |
| 43 | uint16_t i; |
| 44 | } u; |
| 45 | u.f = av_int2float(f); |
| 46 | return u.i; |
| 47 | #else |
| 48 | uint16_t h; |
| 49 | |
| 50 | h = t->basetable[(f >> 23) & 0x1ff] + ((f & 0x007fffff) >> t->shifttable[(f >> 23) & 0x1ff]); |
| 51 | |
| 52 | return h; |
| 53 | #endif |
| 54 | } |
| 55 | |
| 56 | #endif /* AVUTIL_FLOAT2HALF_H */ |
no test coverage detected