zoukankan      html  css  js  c++  java
  • (转)关于yuv 格式:planar和semi-planar格式

    关于yuv 格式

    YUV 格式通常有两大类:打包(packed)格式和平面(planar)格式。前者将 YUV 分量存放在同一个数组中,
    通常是几个相邻的像素组成一个宏像素(macro-pixel);而后者使用三个数组分开存放 YUV 三个分量,就像
    是一个三维平面一样。

    几种常见的yuv格式

    1.YUV422 Planar

    这里,YUV数据是分开存放的,每两个水平Y采样点,有一个Cb和一个Cr采样点,如下图

    ffmpeg 中的定义  PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)  

    android  OMX  中的定义  OMX_COLOR_FormatYUV422Planar     //*  YUV422Planar           : Three arrays Y,U,V.

    2. YUV420 Planar

    这个格式跟YUV422 Planar 类似,但对于Cb和Cr的采样在水平和垂直方向都减少为2:1,如下图

    ffmpeg 中定义  PIX_FMT_YUV420P    //< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)

    android OMX 中定义  OMX_COLOR_FormatYUV420Planar     //  *  YUV420Planar           : Three arrays Y,U,V   

    3.YUV422 Semi-Planar                                         

    Semi 是’半‘的意思 我的理解这个半平面模式,这个格式的数据量跟YUV422 Planar的一样,但是U、V是交叉存放的,如下图。

    ffmpeg 中 未找到定义

    android  OMX  中 OMX_COLOR_FormatYUV422SemiPlanar    ////YUV422SemiPlanar       : Two arrays, one is all Y, the other is U and V

    4.YUV420 Semi-Planar

     这个格式的数据量跟YUV420 Planar的一样,但是U、V是交叉存放的,如下图。

     ffmpeg 中定义  

    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)

    android   OMX  中定义 OMX_COLOR_FormatYUV420SemiPlanar    //YUV420SemiPlanar       : Two arrays, one is all Y, the other is U and V 

    5.YUV422 Interleaved        Interleaved -- 交错   

    这个格式的数据量跟YUV422 Planar的一样,但是Y、U、V是交叉存放的,如下图。 这个是打包(packed)模式的

    ffmpeg  中  PIX_FMT_UYVY422   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1

    android  OMX 中  OMX_COLOR_FormatCbYCrY    //CbYCrY                 : Organized as 16bit UYVY (i.e. CbYCrY)

     转自:http://blog.csdn.net/sunnylgz/article/details/7580628

  • 相关阅读:
    Interesting Finds: 2008.03.19
    Interesting Finds: 2008.03.11
    Interesting Finds: 2008.03.27
    Interesting Finds: 2008.03.21
    每日日报
    每日日报
    每日日报
    每日日报
    idea怎么创建properties文件
    移动端rem.js
  • 原文地址:https://www.cnblogs.com/lihaiping/p/5195475.html
Copyright © 2011-2022 走看看