Tizen 2.1 base
[adaptation/xorg/driver/xserver-xorg-video-emulfb.git] / src / xv / fbdev_video_fourcc.h
1 /**************************************************************************
2
3 xserver-xorg-video-emulfb
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: Boram Park <boram1288.park@samsung.com>
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
16
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
19 of the Software.
20
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 **************************************************************************/
30
31 #ifndef __FBDEV_VIDEO_FOURCC_H__
32 #define __FBDEV_VIDEO_FOURCC_H__
33
34 #include <fourcc.h>
35
36 #define B(c,s)              ((((unsigned int)(c)) & 0xff) << (s))
37 #define FOURCC(a,b,c,d)     (B(d,24) | B(c,16) | B(b,8) | B(a,0))
38
39 /* http://www.fourcc.org/yuv.php
40  * http://en.wikipedia.org/wiki/YUV
41  */
42 #define FOURCC_RGB565   FOURCC('R','G','B','P')
43 #define XVIMAGE_RGB565 \
44    { \
45     FOURCC_RGB565, \
46     XvRGB, \
47     LSBFirst, \
48     {'R','G','B','P', \
49         0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
50     16, \
51     XvPacked, \
52     1, \
53     16, 0x0000F800, 0x000007E0, 0x0000001F, \
54     0, 0, 0, 0, 0, 0, 0, 0, 0, \
55     {'R','G','B',0, \
56         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
57     XvTopToBottom \
58    }
59
60 #define FOURCC_RGB24    FOURCC('R','G','B','3')
61 #define XVIMAGE_RGB24 \
62    { \
63     FOURCC_RGB24, \
64     XvRGB, \
65     LSBFirst, \
66     {'R','G','B',0, \
67         0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
68     24, \
69     XvPacked, \
70     1, \
71     24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
72     0, 0, 0, 0, 0, 0, 0, 0, 0, \
73     {'R','G','B',0, \
74         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
75     XvTopToBottom \
76    }
77
78 #define FOURCC_RGB32    FOURCC('R','G','B','4')
79 #define XVIMAGE_RGB32 \
80    { \
81     FOURCC_RGB32, \
82     XvRGB, \
83     LSBFirst, \
84     {'R','G','B',0, \
85         0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
86     32, \
87     XvPacked, \
88     1, \
89     24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
90     0, 0, 0, 0, 0, 0, 0, 0, 0, \
91     {'X','R','G','B', \
92         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
93     XvTopToBottom \
94    }
95
96 #define FOURCC_ST12     FOURCC('S','T','1','2')
97 #define XVIMAGE_ST12 \
98    { \
99     FOURCC_ST12, \
100     XvYUV, \
101     LSBFirst, \
102     {'S','T','1','2', \
103       0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
104     12, \
105     XvPlanar, \
106     3, \
107     0, 0, 0, 0, \
108     8, 8, 8, \
109     1, 2, 2, \
110     1, 2, 2, \
111     {'Y','U','V', \
112       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
113     XvTopToBottom \
114    }
115
116 #define FOURCC_SN12     FOURCC('S','N','1','2')
117 #define XVIMAGE_SN12 \
118    { \
119     FOURCC_SN12, \
120     XvYUV, \
121     LSBFirst, \
122     {'S','N','1','2', \
123       0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
124     12, \
125     XvPlanar, \
126     3, \
127     0, 0, 0, 0, \
128     8, 8, 8, \
129     1, 2, 2, \
130     1, 2, 2, \
131     {'Y','U','V', \
132       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
133     XvTopToBottom \
134    }
135
136 #define FOURCC_NV12     FOURCC('N','V','1','2')
137 #define XVIMAGE_NV12 \
138    { \
139     FOURCC_NV12, \
140     XvYUV, \
141     LSBFirst, \
142     {'N','V','1','2', \
143       0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
144     12, \
145     XvPacked, \
146     1, \
147     0, 0, 0, 0, \
148     8, 8, 8, \
149     1, 2, 2, \
150     1, 2, 2, \
151     {'Y','U','V', \
152       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
153     XvTopToBottom \
154    }
155
156 #define FOURCC_S420     FOURCC('S','4','2','0')
157 #define XVIMAGE_S420 \
158    { \
159         FOURCC_S420, \
160         XvYUV, \
161         LSBFirst, \
162         {'S','4','2','0', \
163           0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
164         12, \
165         XvPlanar, \
166         3, \
167         0, 0, 0, 0, \
168         8, 8, 8, \
169         1, 2, 2, \
170         1, 2, 2, \
171         {'Y','U','V', \
172           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
173         XvTopToBottom \
174    }
175 #define FOURCC_SUYV     FOURCC('S','U','Y','V')
176 #define XVIMAGE_SUYV \
177    { \
178         FOURCC_SUYV, \
179         XvYUV, \
180         LSBFirst, \
181         {'S','U','Y','V', \
182           0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
183         16, \
184         XvPacked, \
185         1, \
186         0, 0, 0, 0, \
187         8, 8, 8, \
188         1, 2, 2, \
189         1, 1, 1, \
190         {'Y','U','Y','V', \
191           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
192         XvTopToBottom \
193    }
194
195
196 #endif // __FBDEV_VIDEO_FOURCC_H__