15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci APPLE_ycbcr_422 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_APPLE_ycbcr_422 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Geoff Stahl, Apple (gstahl 'at' apple.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciStatus 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Shipping as of August 24, 2002 (Mac OS X v10.2) 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci $Date: 2002/09/19 00:01:25 $ $Revision: 1.6 $ 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciNumber 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci 275 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciDependencies 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci OpenGL 1.1 is required 285bd8deadSopenharmony_ci APPLE_packed_pixels or OpenGL 1.2 is required 295bd8deadSopenharmony_ci Written against OpenGL 1.2.1 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciOverview 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci This extension provides a method for GL to read, store and optionally 345bd8deadSopenharmony_ci process textures that are defined in Y'CbCr 422 video formats. This 355bd8deadSopenharmony_ci extension supports the two common Y'CbCr 422 video formats (known by 365bd8deadSopenharmony_ci QuickTime FourCC as '2vuy' and 'yuvs'). These formats represent one of the 375bd8deadSopenharmony_ci most common 16 bit Y'CbCr formats in both standard and reverse byte 385bd8deadSopenharmony_ci ordering. From a client stand point these can be assumed to be decoded 395bd8deadSopenharmony_ci immediately (even though the implementation is free to optimize the data 405bd8deadSopenharmony_ci storage and keep it in the native format) and otherwise function as any 415bd8deadSopenharmony_ci other texture format. The texture command <internalformat> parameter 425bd8deadSopenharmony_ci normally be should be specified as RGB, since Y'CbCr is just a form of RGB 435bd8deadSopenharmony_ci data. This extension can be supported with either hardware or software 445bd8deadSopenharmony_ci decoding and it is up to the specific implementation to determine which is 455bd8deadSopenharmony_ci used. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci A new <format> is added, YCBCR_422_APPLE. Additionally, to handle the 485bd8deadSopenharmony_ci difference in pixel size and byte ordering for 422 video, the pixel storage 495bd8deadSopenharmony_ci operations treat YCBCR_422_APPLE as a 2 component format using 505bd8deadSopenharmony_ci the UNSIGNED_SHORT_8_8_APPLE or UNSIGNED_SHORT_8_8_REV_APPLE <type>. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci The '2vuy' or k2vuyPixelFormat pixel format is an 8-bit 4:2:2 Component 535bd8deadSopenharmony_ci Y'CbCr format. Each 16 bit pixel is represented by an unsigned eight bit 545bd8deadSopenharmony_ci luminance component and two unsigned eight bit chroma components. Each pair 555bd8deadSopenharmony_ci of pixels shares a common set of chroma values. The components are ordered 565bd8deadSopenharmony_ci in memory; Cb, Y0, Cr, Y1. The luminance components have a range of [16, 575bd8deadSopenharmony_ci 235], while the chroma value has a range of [16, 240]. This is consistent 585bd8deadSopenharmony_ci with the CCIR601 spec. This format is fairly prevalent on both Mac and Win32 595bd8deadSopenharmony_ci platforms. The equivalent Microsoft fourCC is 'UYVY'. This format is 605bd8deadSopenharmony_ci supported with the UNSIGNED_SHORT_8_8_REV_APPLE type for pixel storage 615bd8deadSopenharmony_ci operations. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci The 'yuvs' or kYUVSPixelFormat is an 8-bit 4:2:2 Component Y'CbCr format. 645bd8deadSopenharmony_ci Identical to the k2vuyPixelFormat except each 16 bit word has been byte 655bd8deadSopenharmony_ci swapped. This results in a component ordering of; Y0, Cb, Y1, Cr. This is 665bd8deadSopenharmony_ci most prevalent yuv 4:2:2 format on both Mac and Win32 platforms. The 675bd8deadSopenharmony_ci equivalent Microsoft fourCC is 'YUY2'. This format is supported with the 685bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_APPLE type for pixel storage operations. 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ciIssues 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci Why is YCRCR_422 not provided as an <internalformat>? 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci The internalFormat parameter passes two distinct pieces of information: 755bd8deadSopenharmony_ci which one of the six texEnv equations to use *and* what the desired 765bd8deadSopenharmony_ci internal storage format is. All of the existing internal format enums 775bd8deadSopenharmony_ci have one of {RGBA, RGB, L, LA, A, I} embedded in the name to specify 785bd8deadSopenharmony_ci which of the six texEnv equations. Since the YUV data contains RGB 795bd8deadSopenharmony_ci information, only the RGB texEnv setting is meaningful. Thus, if we did 805bd8deadSopenharmony_ci provide a new internal format enum it would have to be something of the 815bd8deadSopenharmony_ci form GL_RGB_YCRCR422 (weird, but has the right meaning). Using 825bd8deadSopenharmony_ci YCRCR_422 as an internalFormat setting would be incorrect with respect 835bd8deadSopenharmony_ci to the texEnv equations. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciNew Procedures and Functions 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci None 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ciNew Tokens 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Accepted by the <format> parameter of DrawPixels, ReadPixels, TexImage1D, 925bd8deadSopenharmony_ci TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, 935bd8deadSopenharmony_ci TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, 945bd8deadSopenharmony_ci ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, 955bd8deadSopenharmony_ci SeparableFilter2D, SeparableFilter3D, GetSeparableFilter, ColorTable, 965bd8deadSopenharmony_ci GetColorTable: 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci YCBCR_422_APPLE 0x85B9 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D, 1015bd8deadSopenharmony_ci TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, 1025bd8deadSopenharmony_ci TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, 1035bd8deadSopenharmony_ci ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, 1045bd8deadSopenharmony_ci SeparableFilter2D, SeparableFilter3D, GetSeparableFilter, ColorTable, 1055bd8deadSopenharmony_ci GetColorTable: 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_APPLE 0x85BA 1085bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Two entries are added to table 3.5 (DrawPixels and ReadPixels type parameter 1135bd8deadSopenharmony_ci values and the corresponding OpenGL data types): 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci type Parameter Corresponding Special 1165bd8deadSopenharmony_ci Token Name GL Data Type Interpretation 1175bd8deadSopenharmony_ci -------------- ------------- -------------- 1185bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_APPLE ushort Yes 1195bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_REV_APPLE ushort Yes 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci One entry is added to table 3.6 (DrawPixels and ReadPixels formats): 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci Format Name Element Meaning and Order Target Buffer 1255bd8deadSopenharmony_ci ----------- ------------------------- ------------- 1265bd8deadSopenharmony_ci YCBCR_422_APPLE Y luminance value, Color 1275bd8deadSopenharmony_ci [Cb,Cr] chroma value 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci Two entries are added to table 3.8 (Packed pixel formats): 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci type Parameter GL Data Number of Matching 1335bd8deadSopenharmony_ci Token Name Type Components Pixel Formats 1345bd8deadSopenharmony_ci -------------- ------- ---------- ------------- 1355bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_APPLE ushort 3 YCBCR_422_APPLE 1365bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_REV_APPLE ushort 3 YCBCR_422_APPLE 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci Two entries are added to table 3.10 (UNSIGNED SHORT formats): 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_APPLE: 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1445bd8deadSopenharmony_ci +-------------------------------+-------------------------------+ 1455bd8deadSopenharmony_ci | 1st | 2nd | 1465bd8deadSopenharmony_ci +-------------------------------+-------------------------------+ 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_REV_APPLE: 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1525bd8deadSopenharmony_ci +-------------------------------+-------------------------------+ 1535bd8deadSopenharmony_ci | 2nd | 1st | 1545bd8deadSopenharmony_ci +-------------------------------+-------------------------------+ 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci One entry is added to table 3.12 (Packed pixel field assignments): 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci First Second Third Fourth 1605bd8deadSopenharmony_ci Format Element Element Element Element 1615bd8deadSopenharmony_ci ------ ------- ------- ------- ------- 1625bd8deadSopenharmony_ci YCBCR_422_APPLE luminance chroma 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci The new format YCBCR_422_APPLE is added to the discussion of Conversion to 1665bd8deadSopenharmony_ci RGB: 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci If the format is YCBCR_422_APPLE, the chroma and luminance values in each 1695bd8deadSopenharmony_ci group are converted to R, G, and B values using an undefined algorithm. This 1705bd8deadSopenharmony_ci conversion does not necessarily occur immediately as implementations are 1715bd8deadSopenharmony_ci free to pass Y'CbCr 422 formated pixels directly to hardware that is capable 1725bd8deadSopenharmony_ci of processing it. From a client stand point it can be assumed any 1735bd8deadSopenharmony_ci optimization will be transparently applied and not affect rendering results. 1745bd8deadSopenharmony_ci Pixel transfer operations will likely force conversion to RGB and will 1755bd8deadSopenharmony_ci likely negate hardware Y'CbCr acceleration. Additionally, if the format is 1765bd8deadSopenharmony_ci YCBCR_422_APPLE, the conversion algorithm may produce undefined RGB values 1775bd8deadSopenharmony_ci for final pixel of any row where the row length is not a multiple of 2. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment Operations 1805bd8deadSopenharmony_ciand the Framebuffer) 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci Add after last paragraph of Final Conversion: 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci For an RGBA color and if the <type> is UNSIGNED_SHORT_8_8_APPLE or 1855bd8deadSopenharmony_ci UNSIGNED_SHORT_8_8_REV_APPLE, the conversion to Y'CbCr occurs via an 1865bd8deadSopenharmony_ci undefined reverse component conversion. The actual equation used may vary 1875bd8deadSopenharmony_ci per implementation. If the row length is odd the final pixel maybe defined 1885bd8deadSopenharmony_ci otherwise the conversion to the requested Y'CbCr output <type> is in all 1895bd8deadSopenharmony_ci ways the same and any other <type>. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ciAdditions to the GLX Specification 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci None 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ciGLX Protocol 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci None 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ciErrors 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci None 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ciNew State 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci None 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ciNew Implementation Dependent State 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci None 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ciRevision History 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci None 2145bd8deadSopenharmony_ci 215