aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert/convert_common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/convert/convert_common.hpp')
-rw-r--r--host/lib/convert/convert_common.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/host/lib/convert/convert_common.hpp b/host/lib/convert/convert_common.hpp
index cc287114a..699d6301b 100644
--- a/host/lib/convert/convert_common.hpp
+++ b/host/lib/convert/convert_common.hpp
@@ -135,6 +135,20 @@ static UHD_INLINE fc64_t item32_sc16_to_fc64(item32_t item, double scale_factor)
}
/***********************************************************************
+ * Convert items32 sc8 buffer to complex char
+ **********************************************************************/
+static UHD_INLINE void item32_sc8_to_sc8(item32_t item, sc8_t &out0, sc8_t &out1, double){
+ out0 = sc8_t(
+ boost::int8_t(item >> 8),
+ boost::int8_t(item >> 0)
+ );
+ out1 = sc8_t(
+ boost::int8_t(item >> 24),
+ boost::int8_t(item >> 16)
+ );
+}
+
+/***********************************************************************
* Convert items32 sc8 buffer to complex short
**********************************************************************/
static UHD_INLINE void item32_sc8_to_sc16(item32_t item, sc16_t &out0, sc16_t &out1, double){