Quantcast

PIX_FMT_YUV420P format details?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PIX_FMT_YUV420P format details?

jiapei100
Hi, all:

 I can see my video is of PIX_FMT_YUV420P , however, what is the format of
PIX_FMT_YUV420P ?
I just want to know how many bits for a single pixel in the image by using
PIX_FMT_YUV420P ? It seems 12 bits are used for each pixel in this format,
unlike RAW data will probably use 24 bits ( RGB 3 channels, each channel 8
bits) to represent the whole image. However, I happened to come across

http://lists.mplayerhq.hu/pipermail/libav-user/2009-February/002394.html

if you are in 4:2:0, the Cb,Cr planes are (width / 2) * (height / 2) in size and
not (width * height) / 2.



which seems to tell, for PIX_FMT_YUV420P format, even the image plane is not
stored in original size, but half size. I really can't understand how
PIX_FMT_YUV420P works.

So, can anybody please give me a hand how what is the percentage of data
required by using PIX_FMT_YUV420P with reference to PIX_FMT_RGB24 ?


Best Regards
JIA

--
Welcome to Vision Open
http://www.visionopen.com
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PIX_FMT_YUV420P format details?

Basil Mohamed Gohar
On 09/26/2009 08:37 PM, JIA Pei wrote:

> Hi, all:
>
>  I can see my video is of PIX_FMT_YUV420P , however, what is the format of
> PIX_FMT_YUV420P ?
> I just want to know how many bits for a single pixel in the image by using
> PIX_FMT_YUV420P ? It seems 12 bits are used for each pixel in this format,
> unlike RAW data will probably use 24 bits ( RGB 3 channels, each channel 8
> bits) to represent the whole image. However, I happened to come across
>
> http://lists.mplayerhq.hu/pipermail/libav-user/2009-February/002394.html
>
> if you are in 4:2:0, the Cb,Cr planes are (width / 2) * (height / 2) in size and
> not (width * height) / 2.
>
>
>
> which seems to tell, for PIX_FMT_YUV420P format, even the image plane is not
> stored in original size, but half size. I really can't understand how
> PIX_FMT_YUV420P works.
>
> So, can anybody please give me a hand how what is the percentage of data
> required by using PIX_FMT_YUV420P with reference to PIX_FMT_RGB24 ?
>
>
> Best Regards
> JIA
>
>  
YUV420P stores 12 bits per pixel given an RGB24 source.  The Cb & Cr
planes are both stored at 1/4 the resolution, while the Y plane is
stored at full resolution.

http://en.wikipedia.org/wiki/YUV420P#Y.27UV420p_.28and_Y.27V12.29

That link may be helpful, as well.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PIX_FMT_YUV420P format details?

Stefano Sabatini
On date Wednesday 2009-10-14 10:22:25 -0400, Basil Mohamed Gohar encoded:

> On 09/26/2009 08:37 PM, JIA Pei wrote:
> > Hi, all:
> >
> >  I can see my video is of PIX_FMT_YUV420P , however, what is the format of
> > PIX_FMT_YUV420P ?
> > I just want to know how many bits for a single pixel in the image by using
> > PIX_FMT_YUV420P ? It seems 12 bits are used for each pixel in this format,
> > unlike RAW data will probably use 24 bits ( RGB 3 channels, each channel 8
> > bits) to represent the whole image. However, I happened to come across
> >
> > http://lists.mplayerhq.hu/pipermail/libav-user/2009-February/002394.html
> >
> > if you are in 4:2:0, the Cb,Cr planes are (width / 2) * (height / 2) in size and
> > not (width * height) / 2.
> >
> > which seems to tell, for PIX_FMT_YUV420P format, even the image plane is not
> > stored in original size, but half size. I really can't understand how
> > PIX_FMT_YUV420P works.
> >
> > So, can anybody please give me a hand how what is the percentage of data
> > required by using PIX_FMT_YUV420P with reference to PIX_FMT_RGB24 ?
[...]
> YUV420P stores 12 bits per pixel given an RGB24 source.  The Cb & Cr
> planes are both stored at 1/4 the resolution, while the Y plane is
> stored at full resolution.
>
> http://en.wikipedia.org/wiki/YUV420P#Y.27UV420p_.28and_Y.27V12.29

You can find some info in the sources, libavutil/pixfmt.h,
libavcodec/imgconvert.c and libavcodec/pixdesc.c if you're interested
at see how that information is coded inside FFmpeg.

Regards.
--
ffmpeg-user random tip #24
*Read* the mailing lists rules before posting new messages:
http://www.ffmpeg.org/mailinglists.html
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Loading...