Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
586 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...