minor optimization of cv::LUT