420YpCbCr8BiPlanarVideoRange To YUV420 ?/How to copy Y and Cbcr plane to Single plane?

Deadly 提交于 2019-12-29 03:33:28

问题


i have captured video using AVFoundation .i have set (video setting )and get in outputsamplebuffer kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange format. But i need YUV420 format for further processing .

My doubt is

1.difference among 420YpCbCr8BiPlanarVideoRange,420YpCbCr8BiPlanarFULLRange, 420YpCbCr8PlanarFullRange,420YpCbCr8Planar and YUV420 ?
2.how can i convert 420YpCbCr8BiPlanarVideoRange to YUV420 ?
3. How to Convert YUV420 To 32BGRA ?

4) or some other Way to do this??? that is Any open source library or Apple Framework....

i have gone through Accelerate framework ...... it has image conversion for following planar8,planerF,RGBA8888 etc... Any way to equal those formats with 32BGRA/YUV420/ 420YpCbCr8BiPlanarVideoRange and Do my requirement?????

Thanks in advance

thanks in advance


回答1:


The main differences are:

If you have a biplanar format, then the Y data (luminance) and the CbCr data (chroma or color information) are in two separate memory areas called planes. You can use CVPixelBufferGetBaseAddressOfPlane with index 0 to get the Y data and index 1 to get the CbCr data. If the format is planar, then both kinds of data are in the same plane (first all the Y values, then all Cb values and finally the Cr values).

If you have a full range format, then the values from 0 to 255 are used for each luma or chroma value. Video range format only use values from 16 to 235 (for some historical reasons).

The term 420 indicates how much luma and how much chroma information the format contains. It basically says that there is luma information for each pixel and chroma information for each 2x2 block.

YUV420 is - as far as I can tell - not a precisely specified format. It is often use for a planar YpCbCr 420 format.



来源:https://stackoverflow.com/questions/6314966/420ypcbcr8biplanarvideorange-to-yuv420-how-to-copy-y-and-cbcr-plane-to-singl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!