How seperate y-planar, u-planar and uv-planar from yuv bi planar in ios?
avfoundation, objective-c, video-streaming
Solution
The Y plane represents the luminance component, and the UV plane represents the Cb and Cr chroma components.
In the case of kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format, you will find the luma plane is 8bpp with the same dimensions as your video, your chroma plane will be 16bpp, but only a quarter of the size of the original video. You will have one Cb and one Cr component per pixel on this plane.
so if your input video is 352x288, your Y plane will be 352x288 8bpp, and your CbCr 176x144 16bpp. This works out to be about the same amount of data as a 12bpp 352x288 image, half what would be required for RGB888 and still less than RGB565.
So in the buffer, Y will look like this `[YYYYY . . . ]` and UV `[UVUVUVUVUV . . .]`
vs RGB being, of course, `[RGBRGBRGB . . . ]`
Problem
In application i used AVCaptureVideo. i got video in kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format. now i am getting y-planar and uv-planar from imagebuffer. ``` CVPlanarPixelBufferInfo_YCbCrBiPlanar *planar = CVPixelBufferGetBaseAddress(imageBuffer); size_t y-offset = NSSwapBigLongToHost(planar->componentInfoY.offset); size_t uv-offset = NSSwapBigLongToHost(planar->componentInfoCbCr.offset); ``` here yuv is biplanar format(y+UV). what is UV-planar? is this uuuu,yyyy format or uvuvuvuv format? How to i get u-planar and y-planar seperatly? can any one pls help me?