RGB to YUV conversion Color convertion

Hi, I’ve just started looking as the use of GPU to aid in image processing and encoding.

What I’m trying to do it to encode 16bit RGB using NVENC. It appears that NVENC only accepts either YUV, or RGB 32bpp.

Logically this means I will need to do a colour conversion as a preprocessing step, ideally in the GPU (I actually may also want to do things like resize as well), I understand that a standard approach is to perform a series of steps on the GPU, to avoid copying data between GPU/CPU (as discussed here NVIDIA FFmpeg Transcoding Guide | NVIDIA Developer Blog )

In looking on the web and in API documentation, I cant see any direct support for RGB16bpp conversion to 32 bit in either NVENC, or NPP.

My question is, is there a standard way of doing this in the GPU, I hope this is simple an oversight due to unfamiliarity with the topic, otherwise is there a fundamental reason this format isn’t supported?

Probably I would just write a CUDA kernel to convert RGB 565 to RGB 888, then call a function from the npp library if further conversion was needed (e.g. RGB to YUV).

I wouldn’t be able to answer “why” questions. I don’t think there is any “fundamental” reason you don’t find library implementations for RGB 565 (lets say in npp). It might be just not popular enough.

Regarding NVENC, that is a HW engine. So the hardware designers are not going to just provide hardware support for a large variety of little-used formats. I don’t know if that is actually the reason, but it might be. That would have real silicon costs, which are going to be weighed carefully against the perceived need or use case. I haven’t seen a large number of questions like this, which suggests to me that there are not a lot of people who are chafing at the lack of direct support for RGB 565.

If you want to see support for something in CUDA, a good way to express that is to file a bug