image sampling format

來源:互聯網
上載者:User



image sampling format

    在對圖片進行編解碼時經常碰到S444, S422這些東西,這個是什麼呢?就是image sampling format,又叫color sampling,wikimedia上又叫chroma subsampling。這個東西的由來是這樣的。

    直接以RGB來編碼一張圖片,每一個象素都由RGB三個分量組成,一個3x3的圖片就如下:

     RGB RGB RGB

     RGB RGB RGB

     RGB RGB RGB

    這就是S444(為什麼是‘4’呢,後面再講),

    這樣有什麼問題呢,浪費頻寬,不低碳不環保。利用人的視覺系統對亮度比對顏色敏感這一特性,所以將RGB這種表示方法轉為YCbCr這種方式(Y亮度, Cb blue, Cr red)。因為顏色不如亮度敏感,所以可以每隔一象素存一個顏色分量,這樣就減少了頻寬。

    YCbCr Y YCbCr Y

    YCbCr Y YCbCr Y 

    YCbCr Y YCbCr Y

    YCbCr Y YCbCr Y

    這是一張4x4大小的圖片,這個圖片的特點是,Y分量每個象素都有,而CbCr分量是每隔一個象素有一份,這就是S422,sampling format是這樣一個運算式:J:a:b(比如這裡的4:2:2),

    J:horizontal sampling reference (width of the conceptual region). Usually, 4(這樣就明白了為什麼UIC裡面叫的ImageSamplingGeometry)

  a:number of chrominance samples (Cr, Cb) in the first row of J pixels

  b:number of (additional) chrominance samples (Cr, Cb) in the second row of J pixels.

  按照這個定義,我們就可以寫出S420的樣子:

  YCbCr Y YCbCr Y

  Y     Y   Y   Y

  YCbCr Y YCbCr Y

  Y     Y   Y   Y

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.