summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.h b/common.h
index 7eea8b6..da22d2e 100644
--- a/common.h
+++ b/common.h
@@ -180,6 +180,7 @@
typedef u32 fixed16_16;
+typedef u32 fixed8_24;
#define float_to_fp16_16(value) \
(fixed16_16)((value) * 65536.0) \
@@ -196,6 +197,12 @@ typedef u32 fixed16_16;
#define fp16_16_fractional_part(value) \
((value) & 0xFFFF) \
+#define float_to_fp8_24(value) \
+ (fixed8_24)((value) * 16777216.0) \
+
+#define fp8_24_fractional_part(value) \
+ ((value) & 0xFFFFFF) \
+
#define fixed_div(numerator, denominator, bits) \
(((numerator * (1 << bits)) + (denominator / 2)) / denominator) \