• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴(yán)以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            Converting Between YUV and RGB

            轉(zhuǎn)載自:http://msdn.microsoft.com/en-us/library/ms893078.aspx

            It is frequently necessary to convert between YUV pixel formats (used by the JPEG and MPEG compression methods) and RGB format (used by many hardware manufacturers.) The following formulas show how to compute a pixel's value in one format from the pixel value in the other format.

            YUV format allows for higher compression rates without a proportionately high loss of data, as the U and V portions can be highly compressed and computed from the non- or lowly-compressed Y portion.

            Computer RGB888, or full-scale RGB, uses 8 bits each for the red, green, and blue channels. Black is represented by R = G = B = 0, and white is represented by R = G = B = 255. The 4:4:4 YUV format uses 8 bits each for the Y, U, and V channels.

            Converting RGB888 to YUV

            The following formulas define the conversion from RGB to YUV:

            Y = ( (  66 * R + 129 * G +  25 * B + 128) >> 8) +  16
            U = ( ( -38 * R -  74 * G + 112 * B + 128) >> 8) + 128
            V = ( ( 112 * R -  94 * G -  18 * B + 128) >> 8) + 128
            

            These formulas produce 8-bit results using coefficients that require no more than 8 bits of (unsigned) precision. Intermediate results require up to 16 bits of precision.

            Converting 8-bit YUV to RGB888

            The following coefficients are used in conversion process:

            C = Y - 16
            D = U - 128
            E = V - 128
            

            Using the previous coefficients and noting that clip() denotes clipping a value to the range of 0 to 255, the following formulas provide the conversion from YUV to RGB:

            R = clip(( 298 * C           + 409 * E + 128) >> 8)
            G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8)
            B = clip(( 298 * C + 516 * D           + 128) >> 8)
            

            These formulas use some coefficients that require more than 8 bits of precision to produce each 8-bit result, and intermediate results require more than 16 bits of precision.

            Note   All units range from 0 (zero) to 1.0 (one). In DirectDraw, they range from 0 to 255. Overflow and underflow can (and does) occur, and the results must be saturated.

            To convert 4:2:0 or 4:2:2 YUV to RGB, convert the YUV data to 4:4:4 YUV, and then convert from 4:4:4 YUV to RGB.


             Last updated on Thursday, April 08, 2004

            © 1992-2003 Microsoft Corporation. All rights reserved.

             

            posted on 2013-01-24 23:27 楊粼波 閱讀(442) 評(píng)論(0)  編輯 收藏 引用


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            日韩人妻无码一区二区三区久久| 一本大道久久a久久精品综合| 国内精品欧美久久精品| 久久九九亚洲精品| 狠狠人妻久久久久久综合| 国产精品欧美久久久久天天影视 | 亚洲国产另类久久久精品黑人 | 亚洲伊人久久成综合人影院 | 久久久久亚洲国产| 久久精品中文字幕一区| 国产色综合久久无码有码| 欧美一区二区三区久久综合| 精品久久久久久无码中文字幕一区| 国产精品99久久99久久久| 久久亚洲国产午夜精品理论片| 国产精品免费久久久久影院 | 久久婷婷人人澡人人爽人人爱| 亚洲午夜久久久久久久久久| AAA级久久久精品无码片| 久久久精品久久久久久| 国产成人精品综合久久久| 99国产欧美久久久精品蜜芽| 国产精品亚洲美女久久久| 97久久婷婷五月综合色d啪蜜芽 | 久久久久久久人妻无码中文字幕爆 | 很黄很污的网站久久mimi色| 久久久久久久久波多野高潮| 国产精品毛片久久久久久久| 久久久久久一区国产精品| 少妇久久久久久久久久| 久久精品无码av| 精品久久久无码人妻中文字幕豆芽| 精品乱码久久久久久夜夜嗨| 无码日韩人妻精品久久蜜桃| 久久久久噜噜噜亚洲熟女综合| 国内精品久久久人妻中文字幕| 久久久久久国产精品美女| 国产成人无码久久久精品一| 亚洲国产精品无码久久九九| 国产精品伦理久久久久久| 久久精品国产精品国产精品污|