Question

Is there a way to do a color conversion in OpenGL (e.g. from RGB to YUV420p back and forth)? I can either use the contents of the back buffer, a texture or a FBO. I saw this question here, but is restricted to OpenGL 1.1, and I am not constrained to any particular version of OpenGL. OpenGL Colorspace Conversion

I was wondering if there is a newer/faster way to do this with the newer versions. I would prefer not to use anything that is hardware specific, but if it needs to be, I am working with Nvidia GPUs.

Was it helpful?

Solution

Since you want newer/faster, yes you can try using CUDA or OpenCL. Whether they will be much faster than a shader... I have no idea, do let us know. If anything, it gives you more control on how resources are allocated to the task.

Both frameworks have ways of sharing memory with OpenGL so you should be able to just write a kernel and pass it your opengl texture/fbo.

I happen to have written a number of such modules for xpra, you can find links for them here: xpra wiki: CSC (code is GPL2+)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top