4:2:0 Video Pixel Formats

To decode compressed 4:2:0 video, use one of the following uncompressed pixel formats.

Pixel Format Description

YUY2


As described in 4:2:2 Video Pixel Formats, except that two lines of output Cb and Cr samples are produced for each actual line of 4:2:0 Cb and Cr samples. The second line of each pair of output lines is generally either a duplicate of the first line or is produced by averaging
the samples in the first line of the pair with the samples of the first line of the next pair.


UYVY


As described in 4:2:2 Video Pixel Formats, except that two lines of output Cb and Cr samples are produced for each actual line of 4:2:0 Cb and Cr samples. The second line of each pair of output lines is generally either a duplicate of the first line or is produced by averaging
the samples in the first line of the pair with the samples of the first line of the next pair.


YV12


All Y samples are found first in memory as an array of unsigned char (possibly with a larger stride for memory alignment), followed immediately by all Cr samples (with half the stride of the Y lines, and half the number of lines), then followed immediately
by all Cb samples in a similar fashion.


IYUV


The same as YV12, except for swapping the order of the Cb and Cr planes.


NV12


A format in which all Y samples are found first in memory as an array of unsigned char with an even number of lines (possibly with a larger stride for memory alignment). This is followed immediately by an array of unsigned char containing interleaved Cb
and Cr samples. If these samples are addressed as a little-endian WORD type, Cb would be in the least significant bits and Cr would be in the most significant bits with the same total stride as the Y samples. NV12 is the preferred 4:2:0 pixel format.


NV21


The same as NV12, except that Cb and Cr samples are swapped so that the chroma array of unsigned char would have Cr followed by Cb for each sample (such that if addressed as a little-endian WORD type, Cr would be in the least significant bits and Cb would
be in the most significant bits).


IMC1


The same as YV12, except that the stride of the Cb and Cr planes is the same as the stride in the Y plane. Also, the Cb and Cr planes must fall on memory boundaries that are a multiple of 16 lines. The following code examples show calculations for the Cb
and Cr planes.

BYTE* pCr = pY + (((Height + 15) & ~15) * Stride);
BYTE* pCb = pY + (((((Height * 3) / 2) + 15) & ~15) * Stride);

In the preceding examples, pY is a byte pointer that points to the beginning of the memory array, and Height must be a multiple of 16.


IMC2


The same as IMC1, except that Cb and Cr lines are interleaved at half-stride boundaries. In other words, each full-stride line in the chrominance area starts with a line of Cr, followed by a line of Cb that starts at the next half-stride boundary. (This
is a more address-space-efficient format than IMC1, because it cuts the chrominance address space in half, and thus cuts the total address space by 25 percent.) This is an optionally preferred format in relation to NV12, but NV12 appears to be more popular.


IMC3


The same as IMC1, except for swapping Cb and Cr.


IMC4


The same as IMC2, except for swapping Cb and Cr.

For more information about these formats, see Recommended 8-Bit YUV Formats for Video Rendering in the Microsoft Media Foundation documentation.

http://msdn.microsoft.com/en-us/library/windows/hardware/ff538197%28v=vs.85%29.aspx

https://wiki.videolan.org/YUV/#NV21

时间: 2024-12-19 15:03:05

4:2:0 Video Pixel Formats的相关文章

FFmpeg 'scale' filter not present, cannot convert pixel formats.

/*************************************************************************** * FFmpeg 'scale' filter not present, cannot convert pixel formats. * 说明: * 使用FFmpeg的过程中遇到这个问题,记录一下解决办法. * * 2017-2-6 深圳 南山平山村 曾剑锋 *******************************************

premultiplied pixel formats的具体含义

Anti-aliasing problem  with  render_scanlines_compound_layered> However, I have no clue what this change means. I read about> premultiplied pixel formats here and there, but never really> understood what they are. Search in Google for "premu

Comparison of video container formats

Comparison of video container formats MOV跟MP4具体区别在哪里?

FFmpeg API 变更记录

最近一两年内FFmpeg项目发展的速度很快,本来是一件好事.但是随之而来的问题就是其API(接口函数)一直在发生变动.这么一来基于旧一点版本的FFmpeg的程序的代码在最新的类库上可能就跑不通了. 例如一年前的程序中,获取媒体信息使用的函数是av_find_stream_info().但是最近的版本中,av_find_stream_info()函数已经无法使用了,取而代之的是avformat_find_stream_info().再比如,早一些的程序中,打开解码器可以使用avcodec_open

Android L SurfaceFlinger dump信息全解(1)

SurfaceFlinger的dump信息详解 对于很多Android的显示问题,我们需要使用adb shell dumpsys SurfaceFlinger命令来获取SurfaceFlinger的dump信息,这对于我们分析问题有很大的帮助,因此我们这里来详细讲解下SurfaceFlinger的dump. SurfaceFlinger的dump信息主要通过dumpAllLocked 函数来获取,因此我们这里就以android 5.0在主屏幕上的一份dump来详细说明下dump的作用. 1 特殊

【转】Video Rendering with 8-Bit YUV Formats

http://msdn.microsoft.com/en-us/library/aa904813(VS.80).aspx Summary This article describes the 8-bit YUV formats that are recommended for video rendering in the Microsoft Windows operating system. This article presents techniques for converting betw

Video for Linux Two API Specification revision0.24【转】

转自:http://blog.csdn.net/jmq_0000/article/details/7536805#t136 Video for Linux Two API Specification Revision 0.24 Michael H Schimek <[email protected]> Bill Dirks Hans Verkuil Martin Rubli Copyright © 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,

Video for Linux Two API Specification Revision 2.6.32【转】

转自:https://www.linuxtv.org/downloads/legacy/video4linux/API/V4L2_API/spec-single/v4l2.html Video for Linux Two API Specification Revision 2.6.32 Michael H Schimek <[email protected]> Bill Dirks Original author of the V4L2 API and documentation. Hans

LibVLC video controls

原文 http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__video.html VLC  3.0.0-git Main Page Related Pages Modules Data Structures Files Enumerations | Functions LibVLC media player Collaboration diagram for LibVLC video controls: En