MESA_ycbcr_texture.spec revision 7357f20b1ee3ab0c58c7a20f44bf83fdfe0e256e
1Name
2
3    MESA_ycbcr_texture
4
5Name Strings
6
7    GL_MESA_ycbcr_texture
8
9Contact
10
11    Brian Paul, Tungsten Graphics, Inc. (brian 'at' tungstengraphics.com)
12    Keith Whitwell, Tungsten Graphics, Inc.  (keith 'at' tungstengraphics.com)
13
14Status
15
16    Shipping (Mesa 4.0.4 and later)
17
18Version
19
20    1.0
21
22Number
23
24    TBD
25
26Dependencies
27
28    OpenGL 1.0 or later is required
29    This extensions is written against the OpenGL 1.4 Specification.
30    NV_texture_rectangle effects the definition of this extension.
31
32Overview
33
34    This extension supports texture images in the YCbCr format.  There is
35    no support for converting YCbCr images to RGB or vice versa.  The
36    texture's YCbCr colors are converted to RGB during texture sampling.
37    Only 2D texture images are supported (not glDrawPixels, glReadPixels,
38    etc).
39
40    A YCbCr pixel (texel) is a 16-bit unsigned short with two components.
41    The first component is luminance (Y).  For pixels in even-numbered
42    image columns, the second component is Cb.  For pixels in odd-numbered
43    image columns, the second component is Cr.  If one were to convert the
44    data to RGB one would need to examine two pixels from columns N and N+1
45    (where N is even) to deduce the RGB color.
46
47IP Status
48
49    None
50
51Issues
52
53    None
54
55New Procedures and Functions
56
57    None
58
59New Tokens
60
61    Accepted by the <internalFormat> and <format> parameters of
62    TexImage2D and TexSubImage2D:
63
64        YCBCR_MESA                   0x8757
65
66    Accepted by the <type> parameter of TexImage2D and TexSubImage2D:
67
68        UNSIGNED_SHORT_8_8_MESA      0x85BA /* same as Apple's */
69        UNSIGNED_SHORT_8_8_REV_MESA  0x85BB /* same as Apple's */
70
71Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
72
73    None
74
75Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
76
77    In section 3.6.4, Rasterization of Pixel Rectangles, on page 102,
78    add the following to Table 3.8 (Packed pixel formats):
79    
80    type Parameter                GL Data   Number of        Matching
81     Token Name                    Type     Components     Pixel Formats
82    --------------                -------   ----------     -------------
83    UNSIGNED_SHORT_8_8_MESA       ushort         3         YCBCR_422_MESA
84    UNSIGNED_SHORT_8_8_REV_MESA   ushort         3         YCBCR_422_MESA
85
86
87    In section 3.6.4, Rasterization of Pixel Rectangles, on page 102,
88    add the following to Table 3.10 (UNSIGNED_SHORT formats):
89
90    UNSIGNED_SHORT_8_8_MESA:
91
92      15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
93    +-------------------------------+-------------------------------+
94    |              1st              |              2nd              |
95    +-------------------------------+-------------------------------+
96                        
97    UNSIGNED_SHORT_8_8_REV_MESA:
98
99      15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
100    +-------------------------------+-------------------------------+
101    |              2nd              |              1st              |
102    +-------------------------------+-------------------------------+
103
104
105    In section 3.6.4, Rasterization of Pixel Rectangles, on page 102,
106    add the following to Table 3.12 (Packed pixel fiedl assignments):
107
108                       First       Second     Third      Fourth
109    Format             Element     Element    Element    Element
110    ------             -------     -------    -------    -------
111    YCBCR_422_MESA     luminance   chroma
112
113
114    In section 3.8.1, Texture Image Specification, on page 125, add
115    another item to the list of TexImage2D and TexImage3D equivalence
116    exceptions:
117
118    * The value of internalformat and format may be YCBCR_MESA to
119      indicate that the image data is in YCbCr format.  type must
120      be either UNSIGNED_SHORT_8_8_MESA or UNSIGNED_SHORT_8_8_REV_MESA
121      as seen in tables 3.8 and 3.10.  Table 3.12 describes the mapping
122      between Y and Cb/Cr to the components.
123      If NV_texture_rectangle is supported target may also be
124      TEXTURE_RECTANGLE_NV or PROXY_TEXTURE_RECTANGLE_NV.
125      All pixel transfer operations are bypassed.  The texture is stored as
126      YCbCr, not RGB.  Queries of the texture's red, green and blue component
127      sizes will return zero.
128
129
130    In section 3.8.1, Texture Image Specification, on page 126, add
131    another item to the list of TexImage1D and TexImage2D equivalence
132    exceptions:
133
134    * The value of internalformat and format can not be YCBCR_MESA.
135
136
137    In section 3.8.2, Alternate Texture Image Specification Commands, on
138    page 129, insert this paragraph after the first full paragraph on the
139    page:
140
141         "If the internal storage format of the image being updated by
142    TexSubImage2D is YCBCR_MESA then format must be YCBCR_MESA.
143    The error INVALID_OPERATION will be generated otherwise."
144
145
146Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
147Operations and the Frame Buffer)
148
149    None
150
151Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
152
153    None
154
155Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
156State Requests)
157
158    None
159
160Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
161
162    None
163
164Additions to the AGL/GLX/WGL Specifications
165
166    None
167
168GLX Protocol
169
170    None
171
172Errors
173
174    INVALID_ENUM is generated by TexImage2D if <internalFormat> is
175    MESA_YCBCR but <format> is not MESA_YCBCR.
176
177    INVALID_ENUM is generated by TexImage2D if <format> is MESA_YCBCR but
178    <internalFormat> is not MESA_YCBCR.
179
180    INVALID_VALUE is generated by TexImage2D if <format> is MESA_YCBCR and
181    <internalFormat> is MESA_YCBCR and <border> is not zero.
182
183    INVALID_OPERATION is generated by TexSubImage2D if the internal image
184    format is YCBCR_MESA and <format> is not YCBCR_MESA.
185
186    INVALID_OPERATION is generated by CopyTexSubImage2D if the internal
187    image is YCBCR_MESA.
188    
189New State
190
191    Edit table 6.16 on page 231: change the type of TEXTURE_INTERNAL_FORMAT
192    from n x Z42 to n x Z43 to indicate that internal format may also be
193    YCBCR_MESA.
194
195Revision History
196
197    20 September 2002 - Initial draft
198    29 April 2003 - minor updates
199