
13 Feb
2013
13 Feb
'13
4:48 p.m.
Hi, I took a look into "channel.hpp" and found that packed_channel_value is not very efficient in construction. There are: packed_channel_value(integer_t v) { _value = static_cast< integer_t >( v % num_values ); } // I have no idea why this exists, seems OK to remove it template <typename Scalar> packed_channel_value(Scalar v) { _value = static_cast< integer_t >( v ) % num_values; } IIUC, "v % num_values" above could be replaced with a much cheaper "v & low_bits_mask_t<NumBits>::sig_bits_fast". That is: packed_channel_value(integer_t v) : _value(v & low_bits_mask_t<NumBits>::sig_bits_fast) {} What do you think? Am I missing some point? Thanks.