Revision 52e20f9e host/lib/convert/convert_common.hpp
| b/host/lib/convert/convert_common.hpp | ||
|---|---|---|
| 23 | 23 |
#include <boost/cstdint.hpp> |
| 24 | 24 |
#include <complex> |
| 25 | 25 |
|
| 26 |
#define DECLARE_CONVERTER(fcn, prio) \
|
|
| 26 |
#define _DECLARE_CONVERTER(fcn, in_mark, num_in, out_mark, num_out, prio) \
|
|
| 27 | 27 |
static void fcn( \ |
| 28 | 28 |
const uhd::convert::input_type &inputs, \ |
| 29 | 29 |
const uhd::convert::output_type &outputs, \ |
| 30 |
size_t nsamps, double scale_factor \ |
|
| 30 |
const size_t nsamps, \ |
|
| 31 |
const double scale_factor \ |
|
| 31 | 32 |
); \ |
| 32 |
UHD_STATIC_BLOCK(register_##fcn##_##prio){ \
|
|
| 33 |
uhd::convert::register_converter(#fcn, fcn, prio); \ |
|
| 33 |
UHD_STATIC_BLOCK(__register_##fcn##_##prio){ \
|
|
| 34 |
uhd::convert::id_type id; \ |
|
| 35 |
id.input_markup = #in_mark; \ |
|
| 36 |
id.num_inputs = num_in; \ |
|
| 37 |
id.output_markup = #out_mark; \ |
|
| 38 |
id.num_outputs = num_out; \ |
|
| 39 |
uhd::convert::register_converter(id, fcn, prio); \ |
|
| 34 | 40 |
} \ |
| 35 | 41 |
static void fcn( \ |
| 36 | 42 |
const uhd::convert::input_type &inputs, \ |
| 37 | 43 |
const uhd::convert::output_type &outputs, \ |
| 38 |
size_t nsamps, double scale_factor \ |
|
| 44 |
const size_t nsamps, \ |
|
| 45 |
const double scale_factor \ |
|
| 39 | 46 |
) |
| 40 | 47 |
|
| 48 |
#define DECLARE_CONVERTER(in_mark, num_in, out_mark, num_out, prio) \ |
|
| 49 |
_DECLARE_CONVERTER(__convert_##in_mark##_##num_in##_##out_mark##_##num_out, in_mark, num_in, out_mark, num_out, prio) |
|
| 50 |
|
|
| 41 | 51 |
/*********************************************************************** |
| 42 | 52 |
* Typedefs |
| 43 | 53 |
**********************************************************************/ |
| 44 | 54 |
typedef std::complex<double> fc64_t; |
| 45 | 55 |
typedef std::complex<float> fc32_t; |
| 56 |
typedef std::complex<boost::int32_t> sc32_t; |
|
| 46 | 57 |
typedef std::complex<boost::int16_t> sc16_t; |
| 47 | 58 |
typedef std::complex<boost::int8_t> sc8_t; |
| 59 |
typedef double f64_t; |
|
| 60 |
typedef float f32_t; |
|
| 61 |
typedef boost::int32_t s32_t; |
|
| 62 |
typedef boost::int16_t s16_t; |
|
| 63 |
typedef boost::int8_t s8_t; |
|
| 64 |
|
|
| 48 | 65 |
typedef boost::uint32_t item32_t; |
| 49 | 66 |
|
| 50 | 67 |
/*********************************************************************** |
Also available in: Unified diff