Lines Matching +full:input +full:- +full:src

4  * SPDX-License-Identifier: Apache-2.0
35 * There are separate functions for floating-point, Q7, Q15, and Q31 data types.
40 * @brief Convert a Q7 fixed-point value to a floating-point (float32_t) value with a left shift.
42 * @param src The input Q7 fixed-point value.
43 * @param m The number of bits to left shift the input value (0 to 7).
44 * @return The converted floating-point (float32_t) value.
46 #define Z_SHIFT_Q7_TO_F32(src, m) ((float32_t)(((src << m)) / (float32_t)(1U << 7))) argument
49 * @brief Convert a Q15 fixed-point value to a floating-point (float32_t) value with a left shift.
51 * @param src The input Q15 fixed-point value.
52 * @param m The number of bits to left shift the input value (0 to 15).
53 * @return The converted floating-point (float32_t) value.
55 #define Z_SHIFT_Q15_TO_F32(src, m) ((float32_t)((src << m) / (float32_t)(1U << 15))) argument
58 * @brief Convert a Q31 fixed-point value to a floating-point (float32_t) value with a left shift.
60 * @param src The input Q31 fixed-point value.
61 * @param m The number of bits to left shift the input value (0 to 31).
62 * @return The converted floating-point (float32_t) value.
64 #define Z_SHIFT_Q31_TO_F32(src, m) ((float32_t)(((int64_t)src) << m) / (float32_t)(1U << 31)) argument
67 * @brief Convert a Q7 fixed-point value to a floating-point (float64_t) value with a left shift.
69 * @param src The input Q7 fixed-point value.
70 * @param m The number of bits to left shift the input value (0 to 7).
71 * @return The converted floating-point (float64_t) value.
73 #define Z_SHIFT_Q7_TO_F64(src, m) (((float64_t)(src << m)) / (1U << 7)) argument
76 * @brief Convert a Q15 fixed-point value to a floating-point (float64_t) value with a left shift.
78 * @param src The input Q15 fixed-point value.
79 * @param m The number of bits to left shift the input value (0 to 15).
80 * @return The converted floating-point (float64_t) value.
82 #define Z_SHIFT_Q15_TO_F64(src, m) (((float64_t)(src << m)) / (1UL << 15)) argument
85 * @brief Convert a Q31 fixed-point value to a floating-point (float64_t) value with a left shift.
87 * @param src The input Q31 fixed-point value.
88 * @param m The number of bits to left shift the input value (0 to 31).
89 * @return The converted floating-point (float64_t) value.
91 #define Z_SHIFT_Q31_TO_F64(src, m) ((float64_t)(((int64_t)src) << m) / (1ULL << 31)) argument
103 * There are separate functions for floating-point, Q7, Q15, and Q31 data types.
108 * @brief Convert a floating-point (float32_t) value to a Q7 fixed-point value with a right shift.
110 * @param src The input floating-point (float32_t) value.
111 * @param m The number of bits to right shift the input value (0 to 7).
112 * @return The converted Q7 fixed-point value.
114 #define Z_SHIFT_F32_TO_Q7(src, m) \ argument
115 ((q7_t)Z_CLAMP((int32_t)(src * (1U << 7)) >> m, INT8_MIN, INT8_MAX))
118 * @brief Convert a floating-point (float32_t) value to a Q15 fixed-point value with a right shift.
120 * @param src The input floating-point (float32_t) value.
121 * @param m The number of bits to right shift the input value (0 to 15).
122 * @return The converted Q15 fixed-point value.
124 #define Z_SHIFT_F32_TO_Q15(src, m) \ argument
125 ((q15_t)Z_CLAMP((int32_t)(src * (1U << 15)) >> m, INT16_MIN, INT16_MAX))
128 * @brief Convert a floating-point (float32_t) value to a Q31 fixed-point value with a right shift.
130 * @param src The input floating-point (float32_t) value.
131 * @param m The number of bits to right shift the input value (0 to 31).
132 * @return The converted Q31 fixed-point value.
134 #define Z_SHIFT_F32_TO_Q31(src, m) \ argument
135 ((q31_t)Z_CLAMP((int64_t)(src * (1U << 31)) >> m, INT32_MIN, INT32_MAX))
138 * @brief Convert a floating-point (float64_t) value to a Q7 fixed-point value with a right shift.
140 * @param src The input floating-point (float64_t) value.
141 * @param m The number of bits to right shift the input value (0 to 7).
142 * @return The converted Q7 fixed-point value.
144 #define Z_SHIFT_F64_TO_Q7(src, m) \ argument
145 ((q7_t)Z_CLAMP((int32_t)(src * (1U << 7)) >> m, INT8_MIN, INT8_MAX))
148 * @brief Convert a floating-point (float64_t) value to a Q15 fixed-point value with a right shift.
150 * @param src The input floating-point (float64_t) value.
151 * @param m The number of bits to right shift the input value (0 to 15).
152 * @return The converted Q15 fixed-point value.
154 #define Z_SHIFT_F64_TO_Q15(src, m) \ argument
155 ((q15_t)Z_CLAMP((int32_t)(src * (1U << 15)) >> m, INT16_MIN, INT16_MAX))
158 * @brief Convert a floating-point (float64_t) value to a Q31 fixed-point value with a right shift.
160 * @param src The input floating-point (float64_t) value.
161 * @param m The number of bits to right shift the input value (0 to 31).
162 * @return The converted Q31 fixed-point value.
164 #define Z_SHIFT_F64_TO_Q31(src, m) \ argument
165 ((q31_t)Z_CLAMP((int64_t)(src * (1U << 31)) >> m, INT32_MIN, INT32_MAX))