NV12 to RGB24 color space conversion code in Media SDK software

NV12 to RGB24 color space conversion code in Media SDK software

Bild des Benutzers Ramanand

Hi all,

Does anyone know how to convert Intel Media SDK (version: Media SDK 2010) H.264 video frame decoded output NV12 format to RGB888 (RGB24) bit conversion?

Basically Media SDK decoder output will be in NV12 color format and the render needs the RGB24 color bit format, so if any conversion code avaiable for converting NV12-->RGB24 would be great help for us.

Thanks in advance,


4 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Vassili Yakovlev

Hi Ramanand,

If you use DirectX for rendering, you can easily convert NV12 to YUV12, and do converting from YUV12 to RGB by DirectX itself, by copying the surfaces.

Kind regards,


Vassily, thanks for pointing out the DirectX color conversion capability.

Ramanand, if you are not using D3D surfaces you can instead explore the CPU based color conversion routines that are part of Intel Performance Primitives (IPP). I believe there is a primitive that supports this conversion.



I think the DirectX conversion does only apply to DX9 as of now? As far as I know only DXVA supports this conversion and that would be connected to DX9. In DX10 and DX11 there is no build-in support.

This will change with Windows 8 where DX11 features direct support of various YUV format surfaces in hardware. But then this would be limited to Windows 8 and remains lacking on Windows 7.

But you can always move the NV12 data into a texture and write your own pixel shader to convert the color space. It might be easier to convert the NV12 to YUV444 beforehand, but then you could also do the RGB conversion on the CPU by hand.

If you are in for speed you would have to do the UV upsampling in the pixel shader as well. The conversion can be derived from here, for example:



Melden Sie sich an, um einen Kommentar zu hinterlassen.