From a58ee6e29a9859b7eebb261fdcddf60de627c1aa Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 29 Feb 2012 09:52:46 -0800 Subject: uhd: fix sc16 to sc8 conversion table 1) this was registered as the sc8 to sc16 converter, probably messed that up as well 2) the cast to index was wrong, now unit test passes --- host/lib/convert/convert_with_tables.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'host/lib/convert') diff --git a/host/lib/convert/convert_with_tables.cpp b/host/lib/convert/convert_with_tables.cpp index 4a3ce29b2..cd7773d4b 100644 --- a/host/lib/convert/convert_with_tables.cpp +++ b/host/lib/convert/convert_with_tables.cpp @@ -59,16 +59,16 @@ public: item32_t lookup(const sc16_t &in0, const sc16_t &in1){ if (swap){ //hope this compiles out, its a template constant return - (item32_t(_table[size_t(in0.real())]) << 16) | - (item32_t(_table[size_t(in0.imag())]) << 24) | - (item32_t(_table[size_t(in1.real())]) << 0) | - (item32_t(_table[size_t(in1.imag())]) << 8) ; + (item32_t(_table[boost::uint16_t(in0.real())]) << 16) | + (item32_t(_table[boost::uint16_t(in0.imag())]) << 24) | + (item32_t(_table[boost::uint16_t(in1.real())]) << 0) | + (item32_t(_table[boost::uint16_t(in1.imag())]) << 8) ; } return - (item32_t(_table[size_t(in0.real())]) << 8) | - (item32_t(_table[size_t(in0.imag())]) << 0) | - (item32_t(_table[size_t(in1.real())]) << 24) | - (item32_t(_table[size_t(in1.imag())]) << 16) ; + (item32_t(_table[boost::uint16_t(in0.real())]) << 8) | + (item32_t(_table[boost::uint16_t(in0.imag())]) << 0) | + (item32_t(_table[boost::uint16_t(in1.real())]) << 24) | + (item32_t(_table[boost::uint16_t(in1.imag())]) << 16) ; } private: @@ -272,11 +272,11 @@ UHD_STATIC_BLOCK(register_convert_sc16_item32_1_to_fcxx_1){ id.input_format = "sc8_item32_le"; uhd::convert::register_converter(id, &make_convert_sc8_item32_le_1_to_sc16_1, PRIORITY_TABLE); - id.output_format = "sc16"; - id.input_format = "sc8_item32_be"; + id.input_format = "sc16"; + id.output_format = "sc8_item32_be"; uhd::convert::register_converter(id, &make_convert_sc16_1_to_sc8_item32_be_1, PRIORITY_TABLE); - id.output_format = "sc16"; - id.input_format = "sc8_item32_le"; + id.input_format = "sc16"; + id.output_format = "sc8_item32_le"; uhd::convert::register_converter(id, &make_convert_sc16_1_to_sc8_item32_le_1, PRIORITY_TABLE); } -- cgit v1.2.3