Bayer2YUV (420 or 422) using CUDA

Hi,

I searched this forum for a solution to generate YUV frames from raw RGGB data. I found a lot of threads trying to do this, so I wondered if anyone has already a fast and working implementation, or even some hints how to start.

Hi,

AFAIK, there is no sample to demonstrate the conversion from Bayer to YUV.
In our MMAPI sample, there is a cuda function convert YUV to RGB/BGR. Maybe can give you some hints.

convertIntToFloat((CUdeviceptr) eglFrame.frame.pPitch[0],
                   width,
                   height,
                   eglFrame.pitch,
                   color_format,
                   cuda_buf);

Thank you Aasta,

for now I am using NVIDIA NPP library to do the conversion bayer->rgb->yuv: The performance is ok but it could be better with direct conversion.

Hi,

Looks like we doesn’t have direct function for bayer to YUV.
But you can implement cuda function by yourself. Source posted in #2 can help.