OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / hardware / ti / omap3 / omx / system / src / openmax_il / omx_core / inc / OMX_Image.h
1 /**\r
2  * Copyright (c) 2008 The Khronos Group Inc. \r
3  * \r
4  * Permission is hereby granted, free of charge, to any person obtaining\r
5  * a copy of this software and associated documentation files (the\r
6  * "Software"), to deal in the Software without restriction, including\r
7  * without limitation the rights to use, copy, modify, merge, publish,\r
8  * distribute, sublicense, and/or sell copies of the Software, and to\r
9  * permit persons to whom the Software is furnished to do so, subject\r
10  * to the following conditions: \r
11  * The above copyright notice and this permission notice shall be included\r
12  * in all copies or substantial portions of the Software. \r
13  * \r
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \r
21  */\r
22 \r
23 /** \r
24  * @file OMX_Image.h - OpenMax IL version 1.1.2\r
25  * The structures needed by Image components to exchange parameters and \r
26  * configuration data with the components.\r
27  */\r
28 #ifndef OMX_Image_h\r
29 #define OMX_Image_h\r
30 \r
31 #ifdef __cplusplus\r
32 extern "C" {\r
33 #endif /* __cplusplus */\r
34 \r
35 \r
36 /**\r
37  * Each OMX header must include all required header files to allow the \r
38  * header to compile without errors.  The includes below are required  \r
39  * for this header file to compile successfully \r
40  */\r
41 \r
42 #include <OMX_IVCommon.h>\r
43 \r
44 /** @defgroup imaging OpenMAX IL Imaging Domain\r
45  * @ingroup iv\r
46  * Structures for OpenMAX IL Imaging domain\r
47  * @{\r
48  */\r
49 \r
50 /** \r
51  * Enumeration used to define the possible image compression coding. \r
52  */\r
53 typedef enum OMX_IMAGE_CODINGTYPE {\r
54     OMX_IMAGE_CodingUnused,      /**< Value when format is N/A */\r
55     OMX_IMAGE_CodingAutoDetect,  /**< Auto detection of image format */\r
56     OMX_IMAGE_CodingJPEG,        /**< JPEG/JFIF image format */\r
57     OMX_IMAGE_CodingJPEG2K,      /**< JPEG 2000 image format */\r
58     OMX_IMAGE_CodingEXIF,        /**< EXIF image format */\r
59     OMX_IMAGE_CodingTIFF,        /**< TIFF image format */\r
60     OMX_IMAGE_CodingGIF,         /**< Graphics image format */\r
61     OMX_IMAGE_CodingPNG,         /**< PNG image format */\r
62     OMX_IMAGE_CodingLZW,         /**< LZW image format */\r
63     OMX_IMAGE_CodingBMP,         /**< Windows Bitmap format */\r
64     OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
65     OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
66     OMX_IMAGE_CodingMax = 0x7FFFFFFF\r
67 } OMX_IMAGE_CODINGTYPE;\r
68 \r
69 \r
70 /**\r
71  * Data structure used to define an image path. The number of image paths \r
72  * for input and output will vary by type of the image component.  \r
73  * \r
74  *  Input (aka Source) : Zero Inputs, one Output,\r
75  *  Splitter           : One Input, 2 or more Outputs,\r
76  *  Processing Element : One Input, one output,\r
77  *  Mixer              : 2 or more inputs, one output,\r
78  *  Output (aka Sink)  : One Input, zero outputs.\r
79  * \r
80  * The PortDefinition structure is used to define all of the parameters \r
81  * necessary for the compliant component to setup an input or an output  \r
82  * image path.  If additional vendor specific data is required, it should  \r
83  * be transmitted to the component using the CustomCommand function.   \r
84  * Compliant components will prepopulate this structure with optimal  \r
85  * values during the OMX_GetParameter() command.\r
86  *\r
87  * STRUCT MEMBERS:\r
88  *  cMIMEType             : MIME type of data for the port\r
89  *  pNativeRender         : Platform specific reference for a display if a \r
90  *                          sync, otherwise this field is 0\r
91  *  nFrameWidth           : Width of frame to be used on port if \r
92  *                          uncompressed format is used.  Use 0 for \r
93  *                          unknown, don't care or variable\r
94  *  nFrameHeight          : Height of frame to be used on port if \r
95  *                          uncompressed format is used. Use 0 for \r
96  *                          unknown, don't care or variable\r
97  *  nStride               : Number of bytes per span of an image (i.e. \r
98  *                          indicates the number of bytes to get from\r
99  *                          span N to span N+1, where negative stride \r
100  *                          indicates the image is bottom up\r
101  *  nSliceHeight          : Height used when encoding in slices\r
102  *  bFlagErrorConcealment : Turns on error concealment if it is supported by \r
103  *                          the OMX component\r
104  *  eCompressionFormat    : Compression format used in this instance of  \r
105  *                          the component. When OMX_IMAGE_CodingUnused is \r
106  *                          specified, eColorFormat is valid\r
107  *  eColorFormat          : Decompressed format used by this component\r
108  *  pNativeWindow         : Platform specific reference for a window object if a \r
109  *                          display sink , otherwise this field is 0x0. \r
110  */\r
111 typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {\r
112     OMX_STRING cMIMEType;\r
113     OMX_NATIVE_DEVICETYPE pNativeRender;\r
114     OMX_U32 nFrameWidth; \r
115     OMX_U32 nFrameHeight;\r
116     OMX_S32 nStride;     \r
117     OMX_U32 nSliceHeight;\r
118     OMX_BOOL bFlagErrorConcealment;\r
119     OMX_IMAGE_CODINGTYPE eCompressionFormat;\r
120     OMX_COLOR_FORMATTYPE eColorFormat;\r
121     OMX_NATIVE_WINDOWTYPE pNativeWindow;\r
122 } OMX_IMAGE_PORTDEFINITIONTYPE;\r
123 \r
124 \r
125 /**  \r
126  * Port format parameter.  This structure is used to enumerate the various \r
127  * data input/output format supported by the port.\r
128  * \r
129  * STRUCT MEMBERS:\r
130  *  nSize              : Size of the structure in bytes\r
131  *  nVersion           : OMX specification version information\r
132  *  nPortIndex         : Indicates which port to set\r
133  *  nIndex             : Indicates the enumeration index for the format from \r
134  *                       0x0 to N-1\r
135  *  eCompressionFormat : Compression format used in this instance of the \r
136  *                       component. When OMX_IMAGE_CodingUnused is specified, \r
137  *                       eColorFormat is valid\r
138  *  eColorFormat       : Decompressed format used by this component\r
139  */\r
140 typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {\r
141     OMX_U32 nSize;\r
142     OMX_VERSIONTYPE nVersion;\r
143     OMX_U32 nPortIndex;\r
144     OMX_U32 nIndex;\r
145     OMX_IMAGE_CODINGTYPE eCompressionFormat;\r
146     OMX_COLOR_FORMATTYPE eColorFormat;\r
147 } OMX_IMAGE_PARAM_PORTFORMATTYPE;\r
148 \r
149 \r
150 /** \r
151  * Flash control type \r
152  *\r
153  * ENUMS\r
154  *  Torch : Flash forced constantly on\r
155  */\r
156 typedef enum OMX_IMAGE_FLASHCONTROLTYPE {\r
157     OMX_IMAGE_FlashControlOn = 0,\r
158     OMX_IMAGE_FlashControlOff,\r
159     OMX_IMAGE_FlashControlAuto,\r
160     OMX_IMAGE_FlashControlRedEyeReduction,\r
161     OMX_IMAGE_FlashControlFillin,\r
162     OMX_IMAGE_FlashControlTorch,\r
163     OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
164     OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
165     OMX_IMAGE_FlashControlMax = 0x7FFFFFFF\r
166 } OMX_IMAGE_FLASHCONTROLTYPE;\r
167 \r
168 \r
169 /** \r
170  * Flash control configuration \r
171  *\r
172  * STRUCT MEMBERS:\r
173  *  nSize         : Size of the structure in bytes\r
174  *  nVersion      : OMX specification version information\r
175  *  nPortIndex    : Port that this structure applies to\r
176  *  eFlashControl : Flash control type\r
177  */\r
178 typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {\r
179     OMX_U32 nSize;\r
180     OMX_VERSIONTYPE nVersion;\r
181     OMX_U32 nPortIndex;\r
182     OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;\r
183 } OMX_IMAGE_PARAM_FLASHCONTROLTYPE;\r
184 \r
185 \r
186 /** \r
187  * Focus control type \r
188  */\r
189 typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {\r
190     OMX_IMAGE_FocusControlOn = 0,\r
191     OMX_IMAGE_FocusControlOff,\r
192     OMX_IMAGE_FocusControlAuto,\r
193     OMX_IMAGE_FocusControlAutoLock,\r
194     OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
195     OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
196     OMX_IMAGE_FocusControlMax = 0x7FFFFFFF\r
197 } OMX_IMAGE_FOCUSCONTROLTYPE;\r
198 \r
199  \r
200 /** \r
201  * Focus control configuration \r
202  *\r
203  * STRUCT MEMBERS:\r
204  *  nSize           : Size of the structure in bytes\r
205  *  nVersion        : OMX specification version information\r
206  *  nPortIndex      : Port that this structure applies to\r
207  *  eFocusControl   : Focus control\r
208  *  nFocusSteps     : Focus can take on values from 0 mm to infinity. \r
209  *                    Interest is only in number of steps over this range.\r
210  *  nFocusStepIndex : Current focus step index\r
211  */\r
212 typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {\r
213     OMX_U32 nSize;\r
214     OMX_VERSIONTYPE nVersion;\r
215     OMX_U32 nPortIndex;\r
216     OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;\r
217     OMX_U32 nFocusSteps;\r
218     OMX_U32 nFocusStepIndex;\r
219 } OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;\r
220 \r
221 \r
222 /** \r
223  * Q Factor for JPEG compression, which controls the tradeoff between image\r
224  * quality and size.  Q Factor provides a more simple means of controlling\r
225  * JPEG compression quality, without directly programming Quantization\r
226  * tables for chroma and luma \r
227  *\r
228  * STRUCT MEMBERS:\r
229  *  nSize      : Size of the structure in bytes         \r
230  *  nVersion   : OMX specification version information \r
231  *  nPortIndex : Port that this structure applies to \r
232  *  nQFactor   : JPEG Q factor value in the range of 1-100. A factor of 1 \r
233  *               produces the smallest, worst quality images, and a factor \r
234  *               of 100 produces the largest, best quality images.  A \r
235  *               typical default is 75 for small good quality images               \r
236  */\r
237 typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {\r
238     OMX_U32 nSize;            \r
239     OMX_VERSIONTYPE nVersion; \r
240     OMX_U32 nPortIndex;       \r
241     OMX_U32 nQFactor;                                        \r
242 } OMX_IMAGE_PARAM_QFACTORTYPE;\r
243 \r
244 /** \r
245  * Quantization table type \r
246  */\r
247 \r
248 typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {\r
249     OMX_IMAGE_QuantizationTableLuma = 0,\r
250     OMX_IMAGE_QuantizationTableChroma,\r
251     OMX_IMAGE_QuantizationTableChromaCb,\r
252     OMX_IMAGE_QuantizationTableChromaCr,\r
253     OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
254     OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
255     OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF\r
256 } OMX_IMAGE_QUANTIZATIONTABLETYPE;\r
257 \r
258 /** \r
259  * JPEG quantization tables are used to determine DCT compression for\r
260  * YUV data, as an alternative to specifying Q factor, providing exact \r
261  * control of compression \r
262  *\r
263  * STRUCT MEMBERS:\r
264  *  nSize                   : Size of the structure in bytes\r
265  *  nVersion                : OMX specification version information \r
266  *  nPortIndex              : Port that this structure applies to\r
267  *  eQuantizationTable      : Quantization table type\r
268  *  nQuantizationMatrix[64] : JPEG quantization table of coefficients stored \r
269  *                            in increasing columns then by rows of data (i.e. \r
270  *                            row 1, ... row 8). Quantization values are in \r
271  *                            the range 0-255 and stored in linear order\r
272  *                            (i.e. the component will zig-zag the \r
273  *                            quantization table data if required internally) \r
274  */\r
275 typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {\r
276     OMX_U32 nSize;\r
277     OMX_VERSIONTYPE nVersion;\r
278     OMX_U32 nPortIndex;\r
279     OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;\r
280     OMX_U8 nQuantizationMatrix[64];\r
281 } OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;\r
282 \r
283 \r
284 /** \r
285  * Huffman table type, the same Huffman table is applied for chroma and \r
286  * luma component \r
287  */\r
288 typedef enum OMX_IMAGE_HUFFMANTABLETYPE {\r
289     OMX_IMAGE_HuffmanTableAC = 0,\r
290     OMX_IMAGE_HuffmanTableDC,\r
291     OMX_IMAGE_HuffmanTableACLuma,\r
292     OMX_IMAGE_HuffmanTableACChroma,\r
293     OMX_IMAGE_HuffmanTableDCLuma,\r
294     OMX_IMAGE_HuffmanTableDCChroma,\r
295     OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ \r
296     OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */\r
297     OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF\r
298 } OMX_IMAGE_HUFFMANTABLETYPE;\r
299 \r
300 /** \r
301  * JPEG Huffman table \r
302  *\r
303  * STRUCT MEMBERS:\r
304  *  nSize                            : Size of the structure in bytes\r
305  *  nVersion                         : OMX specification version information\r
306  *  nPortIndex                       : Port that this structure applies to\r
307  *  eHuffmanTable                    : Huffman table type\r
308  *  nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each \r
309  *                                     possible length\r
310  *  nHuffmanTable[256]               : 0-255, the size used for AC and DC \r
311  *                                     HuffmanTable are 16 and 162 \r
312  */\r
313 typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {\r
314     OMX_U32 nSize;\r
315     OMX_VERSIONTYPE nVersion;\r
316     OMX_U32 nPortIndex;\r
317     OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;\r
318     OMX_U8 nNumberOfHuffmanCodeOfLength[16];\r
319     OMX_U8 nHuffmanTable[256];\r
320 }OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;\r
321 \r
322 /** @} */\r
323 #ifdef __cplusplus\r
324 }\r
325 #endif /* __cplusplus */\r
326 \r
327 #endif\r
328 /* File EOF */\r