Just curious if anyone knows how OMX_COLOR_FormatYUV420SemiPlanar and OMX_COLOR_FormatYUV420Planar map to the fourcc defined formats. The OMX IL spec doesn't explicitly define the ordering for "U" anv "V" components.

The spec defines OMX_COLOR_FormatYUV420Planar as:

YUV planar format, organized with three separate planes for each color component, namely Y, U, and V. U and V pixels are subsampled by a factor of two both horizontally and vertically.

The spec defines OMX_COLOR_FormatYUV420SemiPlanar as:

YUV planar format, organized with a first plane containing Y pixels, and a second plane containing interleaved U and V pixels. U and V pixels are subsampled by a factor of two both horizontally and vertically

Assuming U and V are listed in the order in which the components appear in the YUV buffer, then OMX_COLOR_FormatYUV420Planar maps to Fourcc I420 (duplicate of IYUV) and OMX_COLOR_FormatYUV420SemiPlanar maps to Fourcc NV12.

The reason I ask this is because it seems that some companies have used OMX_COLOR_FormatYUV420SemiPlanar with NV12 and NV21 interchangeably, which is to say that one (or some) of these companies are wrong. And the IL spec isn't 100% clear without making some assumption.

To make matters even more confusing, StageFright (Android) seems to map PIXEL_FORMAT_YUV420SP to NV21 and PIXEL_FORMAT_YUV420P to YV12 (opposed to I420/IYUV). Obviously, PIXEL_FORMAT_YUV420SP maps to OMX_COLOR_FormatYUV420SemiPlanar, and PIXEL_FORMAT_YUV420P maps to OMX_COLOR_FormatYUV420Planar. Could Google have messed up here?

Hope that someone can help clarify some of these details.