From 6f814f04c4af020a627f6772f7f9b14083d312f4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 12 Jan 2011 15:41:32 -0800 Subject: 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 --- host/lib/convert/convert_impl.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'host/lib/convert') 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; } -- cgit v1.2.3