MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / decode_texel

Function decode_texel

Source/astcenc_decompress_symbolic.cpp:66–86  ·  view source on GitHub ↗

* @brief Convert integer color value into a float value for the decoder. * * @param data The integer color value post-interpolation. * @param lns_mask If set treat lane as HDR (LNS) else LDR (unorm16). * * @return The float color value. */

Source from the content-addressed store, hash-verified

64 * @return The float color value.
65 */
66static inline vfloat4 decode_texel(
67 vint4 data,
68 vmask4 lns_mask
69) {
70 vint4 color_lns = vint4::zero();
71 vint4 color_unorm = vint4::zero();
72
73 if (any(lns_mask))
74 {
75 color_lns = lns_to_sf16(data);
76 }
77
78 if (!all(lns_mask))
79 {
80 color_unorm = unorm16_to_sf16(data);
81 }
82
83 // Pick components and then convert to FP16
84 vint4 datai = select(color_unorm, color_lns, lns_mask);
85 return float16_to_float(datai);
86}
87
88/* See header for documentation. */
89void unpack_weights(

Callers 1

Calls 6

lns_to_sf16Function · 0.85
unorm16_to_sf16Function · 0.85
anyFunction · 0.70
allFunction · 0.70
selectFunction · 0.70
float16_to_floatFunction · 0.70

Tested by

no test coverage detected