1 /** 2 * Copyright (c) 2007 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 24 /** 25 * @file OMX_Video.h - OpenMax IL version 1.1.1 26 * The structures is needed by Video components to exchange parameters 27 * and configuration data with OMX components. 28 */ 29 #ifndef OMX_Video_h 30 #define OMX_Video_h 31 32 /** @defgroup video OpenMAX IL Video Domain 33 * @ingroup iv 34 * Structures for OpenMAX IL Video domain 35 * @{ 36 */ 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif /* __cplusplus */ 41 42 43 /** 44 * Each OMX header must include all required header files to allow the 45 * header to compile without errors. The includes below are required 46 * for this header file to compile successfully 47 */ 48 49 #include <OMX_IVCommon.h> 50 51 52 /** 53 * Enumeration used to define the possible video compression codings. 54 * NOTE: This essentially refers to file extensions. If the coding is 55 * being used to specify the ENCODE type, then additional work 56 * must be done to configure the exact flavor of the compression 57 * to be used. For decode cases where the user application can 58 * not differentiate between MPEG-4 and H.264 bit streams, it is 59 * up to the codec to handle this. 60 */ 61 typedef enum OMX_VIDEO_CODINGTYPE { 62 OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ 63 OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ 64 OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ 65 OMX_VIDEO_CodingH263, /**< H.263 */ 66 OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ 67 OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ 68 OMX_VIDEO_CodingRV, /**< all versions of Real Video */ 69 OMX_VIDEO_CodingAVC, /**< H.264/AVC */ 70 OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ 71 OMX_VIDEO_CodingMax = 0x7FFFFFFF 72 } OMX_VIDEO_CODINGTYPE; 73 74 75 /** 76 * Data structure used to define a video path. The number of Video paths for 77 * input and output will vary by type of the Video component. 78 * 79 * Input (aka Source) : zero Inputs, one Output, 80 * Splitter : one Input, 2 or more Outputs, 81 * Processing Element : one Input, one output, 82 * Mixer : 2 or more inputs, one output, 83 * Output (aka Sink) : one Input, zero outputs. 84 * 85 * The PortDefinition structure is used to define all of the parameters 86 * necessary for the compliant component to setup an input or an output video 87 * path. If additional vendor specific data is required, it should be 88 * transmitted to the component using the CustomCommand function. Compliant 89 * components will prepopulate this structure with optimal values during the 90 * GetDefaultInitParams command. 91 * 92 * STRUCT MEMBERS: 93 * cMIMEType : MIME type of data for the port 94 * pNativeRender : Platform specific reference for a display if a 95 * sync, otherwise this field is 0 96 * nFrameWidth : Width of frame to be used on channel if 97 * uncompressed format is used. Use 0 for unknown, 98 * don't care or variable 99 * nFrameHeight : Height of frame to be used on channel if 100 * uncompressed format is used. Use 0 for unknown, 101 * don't care or variable 102 * nStride : Number of bytes per span of an image 103 * (i.e. indicates the number of bytes to get 104 * from span N to span N+1, where negative stride 105 * indicates the image is bottom up 106 * nSliceHeight : Height used when encoding in slices 107 * nBitrate : Bit rate of frame to be used on channel if 108 * compressed format is used. Use 0 for unknown, 109 * don't care or variable 110 * xFramerate : Frame rate to be used on channel if uncompressed 111 * format is used. Use 0 for unknown, don't care or 112 * variable. Units are Q16 frames per second. 113 * bFlagErrorConcealment : Turns on error concealment if it is supported by 114 * the OMX component 115 * eCompressionFormat : Compression format used in this instance of the 116 * component. When OMX_VIDEO_CodingUnused is 117 * specified, eColorFormat is used 118 * eColorFormat : Decompressed format used by this component 119 * pNativeWindow : Platform specific reference for a window object if a 120 * display sink , otherwise this field is 0x0. 121 */ 122 typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { 123 OMX_STRING cMIMEType; 124 OMX_NATIVE_DEVICETYPE pNativeRender; 125 OMX_U32 nFrameWidth; 126 OMX_U32 nFrameHeight; 127 OMX_S32 nStride; 128 OMX_U32 nSliceHeight; 129 OMX_U32 nBitrate; 130 OMX_U32 xFramerate; 131 OMX_BOOL bFlagErrorConcealment; 132 OMX_VIDEO_CODINGTYPE eCompressionFormat; 133 OMX_COLOR_FORMATTYPE eColorFormat; 134 OMX_NATIVE_WINDOWTYPE pNativeWindow; 135 } OMX_VIDEO_PORTDEFINITIONTYPE; 136 137 /** 138 * Port format parameter. This structure is used to enumerate the various 139 * data input/output format supported by the port. 140 * 141 * STRUCT MEMBERS: 142 * nSize : Size of the structure in bytes 143 * nVersion : OMX specification version information 144 * nPortIndex : Indicates which port to set 145 * nIndex : Indicates the enumeration index for the format from 146 * 0x0 to N-1 147 * eCompressionFormat : Compression format used in this instance of the 148 * component. When OMX_VIDEO_CodingUnused is specified, 149 * eColorFormat is used 150 * eColorFormat : Decompressed format used by this component 151 * xFrameRate : Indicates the video frame rate in Q16 format 152 */ 153 typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { 154 OMX_U32 nSize; 155 OMX_VERSIONTYPE nVersion; 156 OMX_U32 nPortIndex; 157 OMX_U32 nIndex; 158 OMX_VIDEO_CODINGTYPE eCompressionFormat; 159 OMX_COLOR_FORMATTYPE eColorFormat; 160 OMX_U32 xFramerate; 161 } OMX_VIDEO_PARAM_PORTFORMATTYPE; 162 163 164 /** 165 * This is a structure for configuring video compression quantization 166 * parameter values. Codecs may support different QP values for different 167 * frame types. 168 * 169 * STRUCT MEMBERS: 170 * nSize : Size of the structure in bytes 171 * nVersion : OMX specification version info 172 * nPortIndex : Port that this structure applies to 173 * nQpI : QP value to use for index frames 174 * nQpP : QP value to use for P frames 175 * nQpB : QP values to use for bidirectional frames 176 */ 177 typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { 178 OMX_U32 nSize; 179 OMX_VERSIONTYPE nVersion; 180 OMX_U32 nPortIndex; 181 OMX_U32 nQpI; 182 OMX_U32 nQpP; 183 OMX_U32 nQpB; 184 } OMX_VIDEO_PARAM_QUANTIZATIONTYPE; 185 186 187 /** 188 * Structure for configuration of video fast update parameters. 189 * 190 * STRUCT MEMBERS: 191 * nSize : Size of the structure in bytes 192 * nVersion : OMX specification version info 193 * nPortIndex : Port that this structure applies to 194 * bEnableVFU : Enable/Disable video fast update 195 * nFirstGOB : Specifies the number of the first macroblock row 196 * nFirstMB : specifies the first MB relative to the specified first GOB 197 * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB 198 * and nFirstMB 199 */ 200 typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { 201 OMX_U32 nSize; 202 OMX_VERSIONTYPE nVersion; 203 OMX_U32 nPortIndex; 204 OMX_BOOL bEnableVFU; 205 OMX_U32 nFirstGOB; 206 OMX_U32 nFirstMB; 207 OMX_U32 nNumMBs; 208 } OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; 209 210 211 /** 212 * Enumeration of possible bitrate control types 213 */ 214 typedef enum OMX_VIDEO_CONTROLRATETYPE { 215 OMX_Video_ControlRateDisable, 216 OMX_Video_ControlRateVariable, 217 OMX_Video_ControlRateConstant, 218 OMX_Video_ControlRateVariableSkipFrames, 219 OMX_Video_ControlRateConstantSkipFrames, 220 OMX_Video_ControlRateMax = 0x7FFFFFFF 221 } OMX_VIDEO_CONTROLRATETYPE; 222 223 224 /** 225 * Structure for configuring bitrate mode of a codec. 226 * 227 * STRUCT MEMBERS: 228 * nSize : Size of the struct in bytes 229 * nVersion : OMX spec version info 230 * nPortIndex : Port that this struct applies to 231 * eControlRate : Control rate type enum 232 * nTargetBitrate : Target bitrate to encode with 233 */ 234 typedef struct OMX_VIDEO_PARAM_BITRATETYPE { 235 OMX_U32 nSize; 236 OMX_VERSIONTYPE nVersion; 237 OMX_U32 nPortIndex; 238 OMX_VIDEO_CONTROLRATETYPE eControlRate; 239 OMX_U32 nTargetBitrate; 240 } OMX_VIDEO_PARAM_BITRATETYPE; 241 242 243 /** 244 * Enumeration of possible motion vector (MV) types 245 */ 246 typedef enum OMX_VIDEO_MOTIONVECTORTYPE { 247 OMX_Video_MotionVectorPixel, 248 OMX_Video_MotionVectorHalfPel, 249 OMX_Video_MotionVectorQuarterPel, 250 OMX_Video_MotionVectorEighthPel, 251 OMX_Video_MotionVectorMax = 0x7FFFFFFF 252 } OMX_VIDEO_MOTIONVECTORTYPE; 253 254 255 /** 256 * Structure for configuring the number of motion vectors used as well 257 * as their accuracy. 258 * 259 * STRUCT MEMBERS: 260 * nSize : Size of the struct in bytes 261 * nVersion : OMX spec version info 262 * nPortIndex : port that this structure applies to 263 * eAccuracy : Enumerated MV accuracy 264 * bUnrestrictedMVs : Allow unrestricted MVs 265 * bFourMV : Allow use of 4 MVs 266 * sXSearchRange : Search range in horizontal direction for MVs 267 * sYSearchRange : Search range in vertical direction for MVs 268 */ 269 typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { 270 OMX_U32 nSize; 271 OMX_VERSIONTYPE nVersion; 272 OMX_U32 nPortIndex; 273 OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; 274 OMX_BOOL bUnrestrictedMVs; 275 OMX_BOOL bFourMV; 276 OMX_S32 sXSearchRange; 277 OMX_S32 sYSearchRange; 278 } OMX_VIDEO_PARAM_MOTIONVECTORTYPE; 279 280 281 /** 282 * Enumeration of possible methods to use for Intra Refresh 283 */ 284 typedef enum OMX_VIDEO_INTRAREFRESHTYPE { 285 OMX_VIDEO_IntraRefreshCyclic, 286 OMX_VIDEO_IntraRefreshAdaptive, 287 OMX_VIDEO_IntraRefreshBoth, 288 OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF 289 } OMX_VIDEO_INTRAREFRESHTYPE; 290 291 292 /** 293 * Structure for configuring intra refresh mode 294 * 295 * STRUCT MEMBERS: 296 * nSize : Size of the structure in bytes 297 * nVersion : OMX specification version information 298 * nPortIndex : Port that this structure applies to 299 * eRefreshMode : Cyclic, Adaptive, or Both 300 * nAirMBs : Number of intra macroblocks to refresh in a frame when 301 * AIR is enabled 302 * nAirRef : Number of times a motion marked macroblock has to be 303 * intra coded 304 * nCirMBs : Number of consecutive macroblocks to be coded as "intra" 305 * when CIR is enabled 306 */ 307 typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { 308 OMX_U32 nSize; 309 OMX_VERSIONTYPE nVersion; 310 OMX_U32 nPortIndex; 311 OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; 312 OMX_U32 nAirMBs; 313 OMX_U32 nAirRef; 314 OMX_U32 nCirMBs; 315 } OMX_VIDEO_PARAM_INTRAREFRESHTYPE; 316 317 318 /** 319 * Structure for enabling various error correction methods for video 320 * compression. 321 * 322 * STRUCT MEMBERS: 323 * nSize : Size of the structure in bytes 324 * nVersion : OMX specification version information 325 * nPortIndex : Port that this structure applies to 326 * bEnableHEC : Enable/disable header extension codes (HEC) 327 * bEnableResync : Enable/disable resynchronization markers 328 * nResynchMarkerSpacing : Resynch markers interval (in bits) to be 329 * applied in the stream 330 * bEnableDataPartitioning : Enable/disable data partitioning 331 * bEnableRVLC : Enable/disable reversible variable length 332 * coding 333 */ 334 typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { 335 OMX_U32 nSize; 336 OMX_VERSIONTYPE nVersion; 337 OMX_U32 nPortIndex; 338 OMX_BOOL bEnableHEC; 339 OMX_BOOL bEnableResync; 340 OMX_U32 nResynchMarkerSpacing; 341 OMX_BOOL bEnableDataPartitioning; 342 OMX_BOOL bEnableRVLC; 343 } OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; 344 345 346 /** 347 * Configuration of variable block-size motion compensation (VBSMC) 348 * 349 * STRUCT MEMBERS: 350 * nSize : Size of the structure in bytes 351 * nVersion : OMX specification version information 352 * nPortIndex : Port that this structure applies to 353 * b16x16 : Enable inter block search 16x16 354 * b16x8 : Enable inter block search 16x8 355 * b8x16 : Enable inter block search 8x16 356 * b8x8 : Enable inter block search 8x8 357 * b8x4 : Enable inter block search 8x4 358 * b4x8 : Enable inter block search 4x8 359 * b4x4 : Enable inter block search 4x4 360 */ 361 typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { 362 OMX_U32 nSize; 363 OMX_VERSIONTYPE nVersion; 364 OMX_U32 nPortIndex; 365 OMX_BOOL b16x16; 366 OMX_BOOL b16x8; 367 OMX_BOOL b8x16; 368 OMX_BOOL b8x8; 369 OMX_BOOL b8x4; 370 OMX_BOOL b4x8; 371 OMX_BOOL b4x4; 372 } OMX_VIDEO_PARAM_VBSMCTYPE; 373 374 375 /** 376 * H.263 profile types, each profile indicates support for various 377 * performance bounds and different annexes. 378 * 379 * ENUMS: 380 * Baseline : Baseline Profile: H.263 (V1), no optional modes 381 * H320 Coding : H.320 Coding Efficiency Backward Compatibility 382 * Profile: H.263+ (V2), includes annexes I, J, L.4 383 * and T 384 * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), 385 * includes annex F 386 * ISWV2 : Interactive Streaming Wireless Profile: H.263+ 387 * (V2), includes annexes I, J, K and T 388 * ISWV3 : Interactive Streaming Wireless Profile: H.263++ 389 * (V3), includes profile 3 and annexes V and W.6.3.8 390 * HighCompression : Conversational High Compression Profile: H.263++ 391 * (V3), includes profiles 1 & 2 and annexes D and U 392 * Internet : Conversational Internet Profile: H.263++ (V3), 393 * includes profile 5 and annex K 394 * Interlace : Conversational Interlace Profile: H.263++ (V3), 395 * includes profile 5 and annex W.6.3.11 396 * HighLatency : High Latency Profile: H.263++ (V3), includes 397 * profile 6 and annexes O.1 and P.5 398 */ 399 typedef enum OMX_VIDEO_H263PROFILETYPE { 400 OMX_VIDEO_H263ProfileBaseline = 0x01, 401 OMX_VIDEO_H263ProfileH320Coding = 0x02, 402 OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, 403 OMX_VIDEO_H263ProfileISWV2 = 0x08, 404 OMX_VIDEO_H263ProfileISWV3 = 0x10, 405 OMX_VIDEO_H263ProfileHighCompression = 0x20, 406 OMX_VIDEO_H263ProfileInternet = 0x40, 407 OMX_VIDEO_H263ProfileInterlace = 0x80, 408 OMX_VIDEO_H263ProfileHighLatency = 0x100, 409 OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF 410 } OMX_VIDEO_H263PROFILETYPE; 411 412 413 /** 414 * H.263 level types, each level indicates support for various frame sizes, 415 * bit rates, decoder frame rates. 416 */ 417 typedef enum OMX_VIDEO_H263LEVELTYPE { 418 OMX_VIDEO_H263Level10 = 0x01, 419 OMX_VIDEO_H263Level20 = 0x02, 420 OMX_VIDEO_H263Level30 = 0x04, 421 OMX_VIDEO_H263Level40 = 0x08, 422 OMX_VIDEO_H263Level45 = 0x10, 423 OMX_VIDEO_H263Level50 = 0x20, 424 OMX_VIDEO_H263Level60 = 0x40, 425 OMX_VIDEO_H263Level70 = 0x80, 426 OMX_VIDEO_H263LevelMax = 0x7FFFFFFF 427 } OMX_VIDEO_H263LEVELTYPE; 428 429 430 /** 431 * Specifies the picture type. These values should be OR'd to signal all 432 * pictures types which are allowed. 433 * 434 * ENUMS: 435 * Generic Picture Types: I, P and B 436 * H.263 Specific Picture Types: SI and SP 437 * H.264 Specific Picture Types: EI and EP 438 * MPEG-4 Specific Picture Types: S 439 */ 440 typedef enum OMX_VIDEO_PICTURETYPE { 441 OMX_VIDEO_PictureTypeI = 0x01, 442 OMX_VIDEO_PictureTypeP = 0x02, 443 OMX_VIDEO_PictureTypeB = 0x04, 444 OMX_VIDEO_PictureTypeSI = 0x08, 445 OMX_VIDEO_PictureTypeSP = 0x10, 446 OMX_VIDEO_PictureTypeEI = 0x11, 447 OMX_VIDEO_PictureTypeEP = 0x12, 448 OMX_VIDEO_PictureTypeS = 0x14, 449 OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF 450 } OMX_VIDEO_PICTURETYPE; 451 452 453 /** 454 * H.263 Params 455 * 456 * STRUCT MEMBERS: 457 * nSize : Size of the structure in bytes 458 * nVersion : OMX specification version information 459 * nPortIndex : Port that this structure applies to 460 * nPFrames : Number of P frames between each I frame 461 * nBFrames : Number of B frames between each I frame 462 * eProfile : H.263 profile(s) to use 463 * eLevel : H.263 level(s) to use 464 * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE 465 * (specified in the 1998 version of H.263) to 466 * indicate custom picture sizes or clock 467 * frequencies 468 * nAllowedPictureTypes : Specifies the picture types allowed in the 469 * bitstream 470 * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is 471 * not constrained. It is recommended to change 472 * the value of the RTYPE bit for each reference 473 * picture in error-free communication 474 * nPictureHeaderRepetition : Specifies the frequency of picture header 475 * repetition 476 * nGOBHeaderInterval : Specifies the interval of non-empty GOB 477 * headers in units of GOBs 478 */ 479 typedef struct OMX_VIDEO_PARAM_H263TYPE { 480 OMX_U32 nSize; 481 OMX_VERSIONTYPE nVersion; 482 OMX_U32 nPortIndex; 483 OMX_U32 nPFrames; 484 OMX_U32 nBFrames; 485 OMX_VIDEO_H263PROFILETYPE eProfile; 486 OMX_VIDEO_H263LEVELTYPE eLevel; 487 OMX_BOOL bPLUSPTYPEAllowed; 488 OMX_U32 nAllowedPictureTypes; 489 OMX_BOOL bForceRoundingTypeToZero; 490 OMX_U32 nPictureHeaderRepetition; 491 OMX_U32 nGOBHeaderInterval; 492 } OMX_VIDEO_PARAM_H263TYPE; 493 494 495 /** 496 * MPEG-2 profile types, each profile indicates support for various 497 * performance bounds and different annexes. 498 */ 499 typedef enum OMX_VIDEO_MPEG2PROFILETYPE { 500 OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ 501 OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ 502 OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ 503 OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ 504 OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ 505 OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ 506 OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF 507 } OMX_VIDEO_MPEG2PROFILETYPE; 508 509 510 /** 511 * MPEG-2 level types, each level indicates support for various frame 512 * sizes, bit rates, decoder frame rates. No need 513 */ 514 typedef enum OMX_VIDEO_MPEG2LEVELTYPE { 515 OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ 516 OMX_VIDEO_MPEG2LevelML, /**< Main Level */ 517 OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ 518 OMX_VIDEO_MPEG2LevelHL, /**< High Level */ 519 OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF 520 } OMX_VIDEO_MPEG2LEVELTYPE; 521 522 523 /** 524 * MPEG-2 params 525 * 526 * STRUCT MEMBERS: 527 * nSize : Size of the structure in bytes 528 * nVersion : OMX specification version information 529 * nPortIndex : Port that this structure applies to 530 * nPFrames : Number of P frames between each I frame 531 * nBFrames : Number of B frames between each I frame 532 * eProfile : MPEG-2 profile(s) to use 533 * eLevel : MPEG-2 levels(s) to use 534 */ 535 typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { 536 OMX_U32 nSize; 537 OMX_VERSIONTYPE nVersion; 538 OMX_U32 nPortIndex; 539 OMX_U32 nPFrames; 540 OMX_U32 nBFrames; 541 OMX_VIDEO_MPEG2PROFILETYPE eProfile; 542 OMX_VIDEO_MPEG2LEVELTYPE eLevel; 543 } OMX_VIDEO_PARAM_MPEG2TYPE; 544 545 546 /** 547 * MPEG-4 profile types, each profile indicates support for various 548 * performance bounds and different annexes. 549 * 550 * ENUMS: 551 * - Simple Profile, Levels 1-3 552 * - Simple Scalable Profile, Levels 1-2 553 * - Core Profile, Levels 1-2 554 * - Main Profile, Levels 2-4 555 * - N-bit Profile, Level 2 556 * - Scalable Texture Profile, Level 1 557 * - Simple Face Animation Profile, Levels 1-2 558 * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 559 * - Basic Animated Texture Profile, Levels 1-2 560 * - Hybrid Profile, Levels 1-2 561 * - Advanced Real Time Simple Profiles, Levels 1-4 562 * - Core Scalable Profile, Levels 1-3 563 * - Advanced Coding Efficiency Profile, Levels 1-4 564 * - Advanced Core Profile, Levels 1-2 565 * - Advanced Scalable Texture, Levels 2-3 566 */ 567 typedef enum OMX_VIDEO_MPEG4PROFILETYPE { 568 OMX_VIDEO_MPEG4ProfileSimple = 0x01, 569 OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, 570 OMX_VIDEO_MPEG4ProfileCore = 0x04, 571 OMX_VIDEO_MPEG4ProfileMain = 0x08, 572 OMX_VIDEO_MPEG4ProfileNbit = 0x10, 573 OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, 574 OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, 575 OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, 576 OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, 577 OMX_VIDEO_MPEG4ProfileHybrid = 0x200, 578 OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, 579 OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, 580 OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, 581 OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, 582 OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, 583 OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF 584 } OMX_VIDEO_MPEG4PROFILETYPE; 585 586 587 /** 588 * MPEG-4 level types, each level indicates support for various frame 589 * sizes, bit rates, decoder frame rates. No need 590 */ 591 typedef enum OMX_VIDEO_MPEG4LEVELTYPE { 592 OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ 593 OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ 594 OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ 595 OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ 596 OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ 597 OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ 598 OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ 599 OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ 600 OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF 601 } OMX_VIDEO_MPEG4LEVELTYPE; 602 603 604 /** 605 * MPEG-4 configuration. This structure handles configuration options 606 * which are specific to MPEG4 algorithms 607 * 608 * STRUCT MEMBERS: 609 * nSize : Size of the structure in bytes 610 * nVersion : OMX specification version information 611 * nPortIndex : Port that this structure applies to 612 * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ 613 * Annex K). Put zero if not used 614 * bSVH : Enable Short Video Header mode 615 * bGov : Flag to enable GOV 616 * nPFrames : Number of P frames between each I frame (also called 617 * GOV period) 618 * nBFrames : Number of B frames between each I frame 619 * nIDCVLCThreshold : Value of intra DC VLC threshold 620 * bACPred : Flag to use ac prediction 621 * nMaxPacketSize : Maximum size of packet in bytes. 622 * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. 623 * Interpreted as described in MPEG4 standard. 624 * eProfile : MPEG-4 profile(s) to use. 625 * eLevel : MPEG-4 level(s) to use. 626 * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream 627 * nHeaderExtension : Specifies the number of consecutive video packet 628 * headers within a VOP 629 * bReversibleVLC : Specifies whether reversible variable length coding 630 * is in use 631 */ 632 typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { 633 OMX_U32 nSize; 634 OMX_VERSIONTYPE nVersion; 635 OMX_U32 nPortIndex; 636 OMX_U32 nSliceHeaderSpacing; 637 OMX_BOOL bSVH; 638 OMX_BOOL bGov; 639 OMX_U32 nPFrames; 640 OMX_U32 nBFrames; 641 OMX_U32 nIDCVLCThreshold; 642 OMX_BOOL bACPred; 643 OMX_U32 nMaxPacketSize; 644 OMX_U32 nTimeIncRes; 645 OMX_VIDEO_MPEG4PROFILETYPE eProfile; 646 OMX_VIDEO_MPEG4LEVELTYPE eLevel; 647 OMX_U32 nAllowedPictureTypes; 648 OMX_U32 nHeaderExtension; 649 OMX_BOOL bReversibleVLC; 650 } OMX_VIDEO_PARAM_MPEG4TYPE; 651 652 653 /** 654 * WMV Versions 655 */ 656 typedef enum OMX_VIDEO_WMVFORMATTYPE { 657 OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ 658 OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ 659 OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ 660 OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ 661 OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF 662 } OMX_VIDEO_WMVFORMATTYPE; 663 664 665 /** 666 * WMV Params 667 * 668 * STRUCT MEMBERS: 669 * nSize : Size of the structure in bytes 670 * nVersion : OMX specification version information 671 * nPortIndex : Port that this structure applies to 672 * eFormat : Version of WMV stream / data 673 */ 674 typedef struct OMX_VIDEO_PARAM_WMVTYPE { 675 OMX_U32 nSize; 676 OMX_VERSIONTYPE nVersion; 677 OMX_U32 nPortIndex; 678 OMX_VIDEO_WMVFORMATTYPE eFormat; 679 } OMX_VIDEO_PARAM_WMVTYPE; 680 681 682 /** 683 * Real Video Version 684 */ 685 typedef enum OMX_VIDEO_RVFORMATTYPE { 686 OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ 687 OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ 688 OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ 689 OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ 690 OMX_VIDEO_RVFormatMax = 0x7FFFFFFF 691 } OMX_VIDEO_RVFORMATTYPE; 692 693 694 /** 695 * Real Video Params 696 * 697 * STUCT MEMBERS: 698 * nSize : Size of the structure in bytes 699 * nVersion : OMX specification version information 700 * nPortIndex : Port that this structure applies to 701 * eFormat : Version of RV stream / data 702 * nBitsPerPixel : Bits per pixel coded in the frame 703 * nPaddedWidth : Padded width in pixel of a video frame 704 * nPaddedHeight : Padded Height in pixels of a video frame 705 * nFrameRate : Rate of video in frames per second 706 * nBitstreamFlags : Flags which internal information about the bitstream 707 * nBitstreamVersion : Bitstream version 708 * nMaxEncodeFrameSize: Max encoded frame size 709 * bEnablePostFilter : Turn on/off post filter 710 * bEnableTemporalInterpolation : Turn on/off temporal interpolation 711 * bEnableLatencyMode : When enabled, the decoder does not display a decoded 712 * frame until it has detected that no enhancement layer 713 * frames or dependent B frames will be coming. This 714 * detection usually occurs when a subsequent non-B 715 * frame is encountered 716 */ 717 typedef struct OMX_VIDEO_PARAM_RVTYPE { 718 OMX_U32 nSize; 719 OMX_VERSIONTYPE nVersion; 720 OMX_U32 nPortIndex; 721 OMX_VIDEO_RVFORMATTYPE eFormat; 722 OMX_U16 nBitsPerPixel; 723 OMX_U16 nPaddedWidth; 724 OMX_U16 nPaddedHeight; 725 OMX_U32 nFrameRate; 726 OMX_U32 nBitstreamFlags; 727 OMX_U32 nBitstreamVersion; 728 OMX_U32 nMaxEncodeFrameSize; 729 OMX_BOOL bEnablePostFilter; 730 OMX_BOOL bEnableTemporalInterpolation; 731 OMX_BOOL bEnableLatencyMode; 732 } OMX_VIDEO_PARAM_RVTYPE; 733 734 735 /** 736 * AVC profile types, each profile indicates support for various 737 * performance bounds and different annexes. 738 */ 739 typedef enum OMX_VIDEO_AVCPROFILETYPE { 740 OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ 741 OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ 742 OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ 743 OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ 744 OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ 745 OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ 746 OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ 747 OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF 748 } OMX_VIDEO_AVCPROFILETYPE; 749 750 751 /** 752 * AVC level types, each level indicates support for various frame sizes, 753 * bit rates, decoder frame rates. No need 754 */ 755 typedef enum OMX_VIDEO_AVCLEVELTYPE { 756 OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ 757 OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ 758 OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ 759 OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ 760 OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ 761 OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ 762 OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ 763 OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ 764 OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ 765 OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ 766 OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ 767 OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ 768 OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ 769 OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ 770 OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ 771 OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ 772 OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF 773 } OMX_VIDEO_AVCLEVELTYPE; 774 775 776 /** 777 * AVC loop filter modes 778 * 779 * OMX_VIDEO_AVCLoopFilterEnable : Enable 780 * OMX_VIDEO_AVCLoopFilterDisable : Disable 781 * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries 782 */ 783 typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { 784 OMX_VIDEO_AVCLoopFilterEnable = 0, 785 OMX_VIDEO_AVCLoopFilterDisable, 786 OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, 787 OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF 788 } OMX_VIDEO_AVCLOOPFILTERTYPE; 789 790 791 /** 792 * AVC params 793 * 794 * STRUCT MEMBERS: 795 * nSize : Size of the structure in bytes 796 * nVersion : OMX specification version information 797 * nPortIndex : Port that this structure applies to 798 * nSliceHeaderSpacing : Number of macroblocks between slice header, put 799 * zero if not used 800 * nPFrames : Number of P frames between each I frame 801 * nBFrames : Number of B frames between each I frame 802 * bUseHadamard : Enable/disable Hadamard transform 803 * nRefFrames : Max number of reference frames to use for inter 804 * motion search (1-16) 805 * nRefIdxTrailing : Pic param set ref frame index (index into ref 806 * frame buffer of trailing frames list), B frame 807 * support 808 * nRefIdxForward : Pic param set ref frame index (index into ref 809 * frame buffer of forward frames list), B frame 810 * support 811 * bEnableUEP : Enable/disable unequal error protection. This 812 * is only valid of data partitioning is enabled. 813 * bEnableFMO : Enable/disable flexible macroblock ordering 814 * bEnableASO : Enable/disable arbitrary slice ordering 815 * bEnableRS : Enable/disable sending of redundant slices 816 * eProfile : AVC profile(s) to use 817 * eLevel : AVC level(s) to use 818 * nAllowedPictureTypes : Specifies the picture types allowed in the 819 * bitstream 820 * bFrameMBsOnly : specifies that every coded picture of the 821 * coded video sequence is a coded frame 822 * containing only frame macroblocks 823 * bMBAFF : Enable/disable switching between frame and 824 * field macroblocks within a picture 825 * bEntropyCodingCABAC : Entropy decoding method to be applied for the 826 * syntax elements for which two descriptors appear 827 * in the syntax tables 828 * bWeightedPPrediction : Enable/disable weighted prediction shall not 829 * be applied to P and SP slices 830 * nWeightedBipredicitonMode : Default weighted prediction is applied to B 831 * slices 832 * bConstIpred : Enable/disable intra prediction 833 * bDirect8x8Inference : Specifies the method used in the derivation 834 * process for luma motion vectors for B_Skip, 835 * B_Direct_16x16 and B_Direct_8x8 as specified 836 * in subclause 8.4.1.2 of the AVC spec 837 * bDirectSpatialTemporal : Flag indicating spatial or temporal direct 838 * mode used in B slice coding (related to 839 * bDirect8x8Inference) . Spatial direct mode is 840 * more common and should be the default. 841 * nCabacInitIdx : Index used to init CABAC contexts 842 * eLoopFilterMode : Enable/disable loop filter 843 */ 844 typedef struct OMX_VIDEO_PARAM_AVCTYPE { 845 OMX_U32 nSize; 846 OMX_VERSIONTYPE nVersion; 847 OMX_U32 nPortIndex; 848 OMX_U32 nSliceHeaderSpacing; 849 OMX_U32 nPFrames; 850 OMX_U32 nBFrames; 851 OMX_BOOL bUseHadamard; 852 OMX_U32 nRefFrames; 853 OMX_U32 nRefIdx10ActiveMinus1; 854 OMX_U32 nRefIdx11ActiveMinus1; 855 OMX_BOOL bEnableUEP; 856 OMX_BOOL bEnableFMO; 857 OMX_BOOL bEnableASO; 858 OMX_BOOL bEnableRS; 859 OMX_VIDEO_AVCPROFILETYPE eProfile; 860 OMX_VIDEO_AVCLEVELTYPE eLevel; 861 OMX_U32 nAllowedPictureTypes; 862 OMX_BOOL bFrameMBsOnly; 863 OMX_BOOL bMBAFF; 864 OMX_BOOL bEntropyCodingCABAC; 865 OMX_BOOL bWeightedPPrediction; 866 OMX_U32 nWeightedBipredicitonMode; 867 OMX_BOOL bconstIpred ; 868 OMX_BOOL bDirect8x8Inference; 869 OMX_BOOL bDirectSpatialTemporal; 870 OMX_U32 nCabacInitIdc; 871 OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; 872 } OMX_VIDEO_PARAM_AVCTYPE; 873 874 typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { 875 OMX_U32 nSize; 876 OMX_VERSIONTYPE nVersion; 877 OMX_U32 nPortIndex; 878 OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, 879 or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ 880 OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, 881 or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ 882 OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, 883 This parameter is valid only for 884 OMX_IndexParamVideoProfileLevelQuerySupported index, 885 For all other indices this parameter is to be ignored. */ 886 } OMX_VIDEO_PARAM_PROFILELEVELTYPE; 887 888 /** 889 * Structure for dynamically configuring bitrate mode of a codec. 890 * 891 * STRUCT MEMBERS: 892 * nSize : Size of the struct in bytes 893 * nVersion : OMX spec version info 894 * nPortIndex : Port that this struct applies to 895 * nEncodeBitrate : Target average bitrate to be generated in bps 896 */ 897 typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { 898 OMX_U32 nSize; 899 OMX_VERSIONTYPE nVersion; 900 OMX_U32 nPortIndex; 901 OMX_U32 nEncodeBitrate; 902 } OMX_VIDEO_CONFIG_BITRATETYPE; 903 904 /** 905 * Defines Encoder Frame Rate setting 906 * 907 * STRUCT MEMBERS: 908 * nSize : Size of the structure in bytes 909 * nVersion : OMX specification version information 910 * nPortIndex : Port that this structure applies to 911 * xEncodeFramerate : Encoding framerate represented in Q16 format 912 */ 913 typedef struct OMX_CONFIG_FRAMERATETYPE { 914 OMX_U32 nSize; 915 OMX_VERSIONTYPE nVersion; 916 OMX_U32 nPortIndex; 917 OMX_U32 xEncodeFramerate; /* Q16 format */ 918 } OMX_CONFIG_FRAMERATETYPE; 919 920 typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { 921 OMX_U32 nSize; 922 OMX_VERSIONTYPE nVersion; 923 OMX_U32 nPortIndex; 924 OMX_BOOL IntraRefreshVOP; 925 } OMX_CONFIG_INTRAREFRESHVOPTYPE; 926 927 typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { 928 OMX_U32 nSize; 929 OMX_VERSIONTYPE nVersion; 930 OMX_U32 nPortIndex; 931 OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ 932 OMX_U8 ErrMap[1]; /* Error map hint */ 933 } OMX_CONFIG_MACROBLOCKERRORMAPTYPE; 934 935 typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { 936 OMX_U32 nSize; 937 OMX_VERSIONTYPE nVersion; 938 OMX_U32 nPortIndex; 939 OMX_BOOL bEnabled; 940 } OMX_CONFIG_MBERRORREPORTINGTYPE; 941 942 typedef struct OMX_PARAM_MACROBLOCKSTYPE { 943 OMX_U32 nSize; 944 OMX_VERSIONTYPE nVersion; 945 OMX_U32 nPortIndex; 946 OMX_U32 nMacroblocks; 947 } OMX_PARAM_MACROBLOCKSTYPE; 948 949 /** 950 * AVC Slice Mode modes 951 * 952 * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame 953 * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame 954 * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame 955 */ 956 typedef enum OMX_VIDEO_AVCSLICEMODETYPE { 957 OMX_VIDEO_SLICEMODE_AVCDefault = 0, 958 OMX_VIDEO_SLICEMODE_AVCMBSlice, 959 OMX_VIDEO_SLICEMODE_AVCByteSlice, 960 OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF 961 } OMX_VIDEO_AVCSLICEMODETYPE; 962 963 /** 964 * AVC FMO Slice Mode Params 965 * 966 * STRUCT MEMBERS: 967 * nSize : Size of the structure in bytes 968 * nVersion : OMX specification version information 969 * nPortIndex : Port that this structure applies to 970 * nNumSliceGroups : Specifies the number of slice groups 971 * nSliceGroupMapType : Specifies the type of slice groups 972 * eSliceMode : Specifies the type of slice 973 */ 974 typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { 975 OMX_U32 nSize; 976 OMX_VERSIONTYPE nVersion; 977 OMX_U32 nPortIndex; 978 OMX_U8 nNumSliceGroups; 979 OMX_U8 nSliceGroupMapType; 980 OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; 981 } OMX_VIDEO_PARAM_AVCSLICEFMO; 982 983 /** 984 * AVC IDR Period Configs 985 * 986 * STRUCT MEMBERS: 987 * nSize : Size of the structure in bytes 988 * nVersion : OMX specification version information 989 * nPortIndex : Port that this structure applies to 990 * nIDRPeriod : Specifies periodicity of IDR frames 991 * nPFrames : Specifies internal of coding Intra frames 992 */ 993 typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { 994 OMX_U32 nSize; 995 OMX_VERSIONTYPE nVersion; 996 OMX_U32 nPortIndex; 997 OMX_U32 nIDRPeriod; 998 OMX_U32 nPFrames; 999 } OMX_VIDEO_CONFIG_AVCINTRAPERIOD; 1000 1001 /** 1002 * AVC NAL Size Configs 1003 * 1004 * STRUCT MEMBERS: 1005 * nSize : Size of the structure in bytes 1006 * nVersion : OMX specification version information 1007 * nPortIndex : Port that this structure applies to 1008 * nNaluBytes : Specifies the NAL unit size 1009 */ 1010 typedef struct OMX_VIDEO_CONFIG_NALSIZE { 1011 OMX_U32 nSize; 1012 OMX_VERSIONTYPE nVersion; 1013 OMX_U32 nPortIndex; 1014 OMX_U32 nNaluBytes; 1015 } OMX_VIDEO_CONFIG_NALSIZE; 1016 1017 /** @} */ 1018 1019 #ifdef __cplusplus 1020 } 1021 #endif /* __cplusplus */ 1022 1023 #endif 1024 /* File EOF */ 1025 1026