OMX_Image.h 13 KB

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