關於yuv 的pack(緊縮格式)和planner(平面格式)格式 [轉]

來源:互聯網
上載者:User

標籤:

關於yuv 格式

YUV 格式通常有兩大類:打包(packed)格式和平面(planar)格式。前者將 YUV 分量存放在同一個數組中,
通常是幾個相鄰的像素組成一個宏像素(macro-pixel);而後者使用三個數組分開存放 YUV 三個分量,就像
是一個三維平面一樣。

 

幾種常見的yuv格式

1.YUV422 Planar

這裡,Y\U\V資料是分開存放的,每兩個水平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)

 
 

 24bit RGB888 -> 16bit RGB565 的轉換

  24ibt RGB888 R7 R6 R5 R4 R3 R2 R1 R0 G7 G6 G5 G4 G3 G2 G1 G0 B7 B6 B5 B4 B3 B2 B1 B0

  16bit RGB656 R7 R6 R5 R4 R3 G7 G6 G5 G4 G3 G2 B7 B6 B5 B4 B3

 

未完

關於yuv 的pack(緊縮格式)和planner(平面格式)格式 [轉]

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.