• <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>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            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 楊粼波 閱讀(434) 評論(0)  編輯 收藏 引用

            久久伊人精品青青草原高清| 国产精品久久久香蕉| 久久久久久久女国产乱让韩| 亚洲?V乱码久久精品蜜桃 | 人妻丰满?V无码久久不卡| 2021精品国产综合久久| 久久九九全国免费| 久久精品九九亚洲精品天堂| 精品国产一区二区三区久久蜜臀| 久久久久久无码国产精品中文字幕| 免费无码国产欧美久久18| 伊人久久一区二区三区无码| 久久99国产精品久久| 精品久久一区二区三区| 狠狠色丁香久久综合婷婷| 久久发布国产伦子伦精品| 色天使久久综合网天天| 亚洲国产日韩综合久久精品| 久久免费国产精品一区二区| 99久久无码一区人妻| 久久婷婷激情综合色综合俺也去| 久久99精品久久久久久野外| 久久精品国产亚洲5555| 久久国产精品无| 久久久精品人妻一区二区三区四| 精品久久久久久亚洲| 久久久久久无码国产精品中文字幕| 欧美亚洲国产精品久久高清| 久久久久无码精品国产| 久久精品中文字幕有码| 99久久夜色精品国产网站| 国产亚洲精品自在久久| 久久综合色区| 影音先锋女人AV鲁色资源网久久| 99久久精品免费看国产一区二区三区| 久久国产乱子伦免费精品| 久久被窝电影亚洲爽爽爽| 伊人久久大香线蕉精品不卡| 999久久久免费精品国产| 亚洲欧美一级久久精品| 久久96国产精品久久久|