Turn: http://blog.csdn.net/hhygcy/article/details/3339214
List of supported formats obtained using videocapture and iamstreamconfig.
The two formats are supported: yv12 and nv12.
The specific memory distribution is unknown. I checked some documents. You have modified several graphs. We can see some clues.
Yv12
First look at the definition of the standard on the http://www.fourcc.org/yuv.php:
Yv12
This is the format of choice for your software MPEG codecs. It comprises an nxm Y plane followed by (n/2) x (M/2) V and U planes.
| |
Horizontal |
Vertical |
| Y sample period |
1 |
1 |
| V sample period |
2 |
2 |
| U sample period |
2 |
2 |
Positive biheight implies top-down image (top line first)
This kind of image is not very clear.
The image example above this Wiki is very clear. The first image marks the true pixel representation of the image.
We can see that the four physically close pixels Y1, Y2, y7, and Y8 share the same U1 and V1, similar Y3, Y4, y9, y10 uses U2 and V2. Different colors present this feature very clearly. Impressive !! I have always felt that education, or basic education, must be explained in this way so that we can know why, the type of textbooks that blindly copy a foreign textbook or combine a few cracked books is not a teacher or a broken person. Let's get down to the truth. Previously, we talked about the representation of physical pixels. The distribution in memory is an array, and the order is YUV. Therefore, if you know the desired pleasing size, you can easily find the specific YUV position in the array.
Nv12
Nv12 and yv12 are slightly different. The difference lies in the UV position. Now let's look at a picture!
In yv12, U and V are arranged consecutively, while in nv12, U and V are arranged in a staggered manner. It is clear that the layout in the memory is Y in the first place, and then the layout is a staggered layout of u1v1u2v2. The effect of pixel compression is the same. However, it may be the support of hardware acceleration.