New object and helper functions can remove duplicated code from nvenc/nvdec. Also this is prework for CUDA device context sharing among nvdec(s)/nvenc(s).