aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-12 15:41:32 -0800
committerJosh Blum <josh@joshknows.com>2011-01-12 15:41:32 -0800
commit6f814f04c4af020a627f6772f7f9b14083d312f4 (patch)
tree586e9d103371d3840cc19477c323e37bfa8da086 /host/lib/convert
parent4f28afe2479856f1e0696983a206f05939b2edbf (diff)
downloaduhd-6f814f04c4af020a627f6772f7f9b14083d312f4.tar.gz
uhd-6f814f04c4af020a627f6772f7f9b14083d312f4.tar.bz2
uhd-6f814f04c4af020a627f6772f7f9b14083d312f4.zip
uhd: changed convert routines to return the function pointer
changed the vrt packet handler to get the function pointer (once), this may be a minor performance help
Diffstat (limited to 'host/lib/convert')
-rw-r--r--host/lib/convert/convert_impl.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp
index 74837cc51..6a5a1465d 100644
--- a/host/lib/convert/convert_impl.cpp
+++ b/host/lib/convert/convert_impl.cpp
@@ -90,28 +90,22 @@ void uhd::convert::register_converter(
/***********************************************************************
* The converter functions
**********************************************************************/
-void uhd::convert::io_type_to_otw_type(
+const convert::function_type &convert::get_converter_cpu_to_otw(
const io_type_t &io_type,
const otw_type_t &otw_type,
- input_type &input_buffs,
- output_type &output_buffs,
- size_t nsamps_per_io_buff
+ size_t num_input_buffs,
+ size_t num_output_buffs
){
- pred_type pred = make_pred(io_type, otw_type, input_buffs.size(), output_buffs.size());
- fcn_table_type table = get_cpu_to_otw_table();
- function_type fcn = table.at(pred).fcn;
- fcn(input_buffs, output_buffs, nsamps_per_io_buff);
+ pred_type pred = make_pred(io_type, otw_type, num_input_buffs, num_output_buffs);
+ return get_cpu_to_otw_table().at(pred).fcn;
}
-void uhd::convert::otw_type_to_io_type(
+const convert::function_type &convert::get_converter_otw_to_cpu(
const io_type_t &io_type,
const otw_type_t &otw_type,
- input_type &input_buffs,
- output_type &output_buffs,
- size_t nsamps_per_io_buff
+ size_t num_input_buffs,
+ size_t num_output_buffs
){
- pred_type pred = make_pred(io_type, otw_type, input_buffs.size(), output_buffs.size());
- fcn_table_type table = get_otw_to_cpu_table();
- function_type fcn = table.at(pred).fcn;
- fcn(input_buffs, output_buffs, nsamps_per_io_buff);
+ pred_type pred = make_pred(io_type, otw_type, num_input_buffs, num_output_buffs);
+ return get_otw_to_cpu_table().at(pred).fcn;
}