| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved. | 2 * Copyright (c) 2007-2009 Intel Corporation. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Permission is hereby granted, free of charge, to any person obtaining a | 4 * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 * copy of this software and associated documentation files (the | 5 * copy of this software and associated documentation files (the |
| 6 * "Software"), to deal in the Software without restriction, including | 6 * "Software"), to deal in the Software without restriction, including |
| 7 * without limitation the rights to use, copy, modify, merge, publish, | 7 * without limitation the rights to use, copy, modify, merge, publish, |
| 8 * distribute, sub license, and/or sell copies of the Software, and to | 8 * distribute, sub license, and/or sell copies of the Software, and to |
| 9 * permit persons to whom the Software is furnished to do so, subject to | 9 * permit persons to whom the Software is furnished to do so, subject to |
| 10 * the following conditions: | 10 * the following conditions: |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 #define VA_FILTER_SCALING_FAST 0x00000100 | 215 #define VA_FILTER_SCALING_FAST 0x00000100 |
| 216 #define VA_FILTER_SCALING_HQ 0x00000200 | 216 #define VA_FILTER_SCALING_HQ 0x00000200 |
| 217 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300 | 217 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300 |
| 218 #define VA_FILTER_SCALING_MASK 0x00000f00 | 218 #define VA_FILTER_SCALING_MASK 0x00000f00 |
| 219 | 219 |
| 220 /** | 220 /** |
| 221 * Returns a short english description of error_status | 221 * Returns a short english description of error_status |
| 222 */ | 222 */ |
| 223 const char *vaErrorStr(VAStatus error_status); | 223 const char *vaErrorStr(VAStatus error_status); |
| 224 | 224 |
| 225 typedef struct _VARectangle { |
| 226 short x; |
| 227 short y; |
| 228 unsigned short width; |
| 229 unsigned short height; |
| 230 } VARectangle; |
| 231 |
| 225 /** | 232 /** |
| 226 * Initialization: | 233 * Initialization: |
| 227 * A display must be obtained by calling vaGetDisplay() before calling | 234 * A display must be obtained by calling vaGetDisplay() before calling |
| 228 * vaInitialize() and other functions. This connects the API to the | 235 * vaInitialize() and other functions. This connects the API to the |
| 229 * native window system. | 236 * native window system. |
| 230 * For X Windows, native_dpy would be from XOpenDisplay() | 237 * For X Windows, native_dpy would be from XOpenDisplay() |
| 231 */ | 238 */ |
| 232 typedef void* VANativeDisplay; /* window system dependent */ | 239 typedef void* VANativeDisplay; /* window system dependent */ |
| 233 | 240 |
| 234 int vaDisplayIsValid(VADisplay dpy); | 241 int vaDisplayIsValid(VADisplay dpy); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 /** | 280 /** |
| 274 * Return a function pointer given a function name in the library. | 281 * Return a function pointer given a function name in the library. |
| 275 * This allows private interfaces into the library | 282 * This allows private interfaces into the library |
| 276 */ | 283 */ |
| 277 VAPrivFunc vaGetLibFunc ( | 284 VAPrivFunc vaGetLibFunc ( |
| 278 VADisplay dpy, | 285 VADisplay dpy, |
| 279 const char *func | 286 const char *func |
| 280 ); | 287 ); |
| 281 | 288 |
| 282 /** Currently defined profiles */ | 289 /** Currently defined profiles */ |
| 283 typedef enum | 290 typedef enum { |
| 284 { | 291 /** \brief Profile ID used for video processing. */ |
| 285 /** \brief Profile ID used for video processing. */ | 292 VAProfileNone = -1, |
| 286 VAProfileNone = -1, | 293 VAProfileMPEG2Simple = 0, |
| 287 VAProfileMPEG2Simple» » = 0, | 294 VAProfileMPEG2Main = 1, |
| 288 VAProfileMPEG2Main» » » = 1, | 295 VAProfileMPEG4Simple = 2, |
| 289 VAProfileMPEG4Simple» » = 2, | 296 VAProfileMPEG4AdvancedSimple = 3, |
| 290 VAProfileMPEG4AdvancedSimple» = 3, | 297 VAProfileMPEG4Main = 4, |
| 291 VAProfileMPEG4Main» » » = 4, | 298 VAProfileH264Baseline = 5, |
| 292 VAProfileH264Baseline» » = 5, | 299 VAProfileH264Main = 6, |
| 293 VAProfileH264Main» » » = 6, | 300 VAProfileH264High = 7, |
| 294 VAProfileH264High» » » = 7, | 301 VAProfileVC1Simple = 8, |
| 295 VAProfileVC1Simple» » » = 8, | 302 VAProfileVC1Main = 9, |
| 296 VAProfileVC1Main» » » = 9, | 303 VAProfileVC1Advanced = 10, |
| 297 VAProfileVC1Advanced» » = 10, | 304 VAProfileH263Baseline = 11, |
| 298 VAProfileH263Baseline» » = 11, | 305 VAProfileJPEGBaseline = 12, |
| 299 VAProfileJPEGBaseline = 12, | 306 VAProfileH264ConstrainedBaseline = 13, |
| 300 VAProfileH264ConstrainedBaseline = 13, | 307 VAProfileVP8Version0_3 = 14, |
| 301 VAProfileVP8Version0_3 = 14, | 308 VAProfileH264MultiviewHigh = 15, |
| 302 VAProfileH264MultiviewHigh = 15, | 309 VAProfileH264StereoHigh = 16, |
| 303 VAProfileH264StereoHigh = 16, | 310 VAProfileHEVCMain = 17, |
| 304 VAProfileHEVCMain = 17, | 311 VAProfileHEVCMain10 = 18, |
| 305 VAProfileHEVCMain10 = 18, | 312 VAProfileVP9Profile0 = 19, |
| 306 VAProfileVP9Profile0 = 19 | 313 VAProfileVP9Profile1 = 20, |
| 314 VAProfileVP9Profile2 = 21, |
| 315 VAProfileVP9Profile3 = 22 |
| 307 } VAProfile; | 316 } VAProfile; |
| 308 | 317 |
| 309 /** | 318 /** |
| 310 * Currently defined entrypoints | 319 * Currently defined entrypoints |
| 311 */ | 320 */ |
| 312 typedef enum | 321 typedef enum { |
| 313 { | 322 VAEntrypointVLD = 1, |
| 314 VAEntrypointVLD» » = 1, | 323 VAEntrypointIZZ = 2, |
| 315 VAEntrypointIZZ» » = 2, | 324 VAEntrypointIDCT = 3, |
| 316 VAEntrypointIDCT» » = 3, | 325 VAEntrypointMoComp = 4, |
| 317 VAEntrypointMoComp» » = 4, | 326 VAEntrypointDeblocking = 5, |
| 318 VAEntrypointDeblocking» = 5, | 327 VAEntrypointEncSlice = 6, /* slice level encode */ |
| 319 VAEntrypointEncSlice» = 6,» /* slice level encode */ | 328 VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */ |
| 320 VAEntrypointEncPicture » = 7,» /* pictuer encode, JPEG, etc */ | 329 /* |
| 321 VAEntrypointVideoProc = 10, /**< Video pre/post-processing. */ | 330 * For an implementation that supports a low power/high performance variant |
| 331 * for slice level encode, it can choose to expose the |
| 332 * VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be |
| 333 * available with this entrypoint (e.g. interlace, MBAFF) and the |
| 334 * application can query the encoding configuration attributes to find |
| 335 * out more details if this entrypoint is supported. |
| 336 */ |
| 337 VAEntrypointEncSliceLP = 8, |
| 338 VAEntrypointVideoProc = 10, /**< Video pre/post-processing. */ |
| 322 } VAEntrypoint; | 339 } VAEntrypoint; |
| 323 | 340 |
| 324 /** Currently defined configuration attribute types */ | 341 /** Currently defined configuration attribute types */ |
| 325 typedef enum | 342 typedef enum { |
| 326 { | 343 VAConfigAttribRTFormat = 0, |
| 327 VAConfigAttribRTFormat» » = 0, | 344 VAConfigAttribSpatialResidual = 1, |
| 328 VAConfigAttribSpatialResidual» = 1, | 345 VAConfigAttribSpatialClipping = 2, |
| 329 VAConfigAttribSpatialClipping» = 2, | 346 VAConfigAttribIntraResidual = 3, |
| 330 VAConfigAttribIntraResidual»» = 3, | 347 VAConfigAttribEncryption = 4, |
| 331 VAConfigAttribEncryption» » = 4, | 348 VAConfigAttribRateControl = 5, |
| 332 VAConfigAttribRateControl» » = 5, | |
| 333 | 349 |
| 334 /** @name Attributes for decoding */ | 350 /** @name Attributes for decoding */ |
| 335 /**@{*/ | 351 /**@{*/ |
| 336 /** | 352 /** |
| 337 * \brief Slice Decoding mode. Read/write. | 353 * \brief Slice Decoding mode. Read/write. |
| 338 * | 354 * |
| 339 * This attribute determines what mode the driver supports for slice | 355 * This attribute determines what mode the driver supports for slice |
| 340 * decoding, through vaGetConfigAttributes(); and what mode the user | 356 * decoding, through vaGetConfigAttributes(); and what mode the user |
| 341 * will be providing to the driver, through vaCreateConfig(), if the | 357 * will be providing to the driver, through vaCreateConfig(), if the |
| 342 * driver supports those. If this attribute is not set by the user then | 358 * driver supports those. If this attribute is not set by the user then |
| 343 * it is assumed that VA_DEC_SLICE_MODE_NORMAL mode is used. | 359 * it is assumed that VA_DEC_SLICE_MODE_NORMAL mode is used. |
| 344 * | 360 * |
| 345 * See \c VA_DEC_SLICE_MODE_xxx for the list of slice decoding modes. | 361 * See \c VA_DEC_SLICE_MODE_xxx for the list of slice decoding modes. |
| 346 */ | 362 */ |
| 347 VAConfigAttribDecSliceMode» » = 6, | 363 VAConfigAttribDecSliceMode = 6, |
| 348 | 364 |
| 349 /** @name Attributes for encoding */ | 365 /** @name Attributes for encoding */ |
| 350 /**@{*/ | 366 /**@{*/ |
| 351 /** | 367 /** |
| 352 * \brief Packed headers mode. Read/write. | 368 * \brief Packed headers mode. Read/write. |
| 353 * | 369 * |
| 354 * This attribute determines what packed headers the driver supports, | 370 * This attribute determines what packed headers the driver supports, |
| 355 * through vaGetConfigAttributes(); and what packed headers the user | 371 * through vaGetConfigAttributes(); and what packed headers the user |
| 356 * will be providing to the driver, through vaCreateConfig(), if the | 372 * will be providing to the driver, through vaCreateConfig(), if the |
| 357 * driver supports those. | 373 * driver supports those. |
| 358 * | 374 * |
| 359 * See \c VA_ENC_PACKED_HEADER_xxx for the list of packed headers. | 375 * See \c VA_ENC_PACKED_HEADER_xxx for the list of packed headers. |
| 360 */ | 376 */ |
| 361 VAConfigAttribEncPackedHeaders = 10, | 377 VAConfigAttribEncPackedHeaders = 10, |
| 362 /** | 378 /** |
| 363 * \brief Interlaced mode. Read/write. | 379 * \brief Interlaced mode. Read/write. |
| 364 * | 380 * |
| 365 * This attribute determines what kind of interlaced encoding mode | 381 * This attribute determines what kind of interlaced encoding mode |
| 366 * the driver supports. | 382 * the driver supports. |
| 367 * | 383 * |
| 368 * See \c VA_ENC_INTERLACED_xxx for the list of interlaced modes. | 384 * See \c VA_ENC_INTERLACED_xxx for the list of interlaced modes. |
| 369 */ | 385 */ |
| 370 VAConfigAttribEncInterlaced = 11, | 386 VAConfigAttribEncInterlaced = 11, |
| 371 /** | 387 /** |
| 372 * \brief Maximum number of reference frames. Read-only. | 388 * \brief Maximum number of reference frames. Read-only. |
| 373 * | 389 * |
| 374 * This attribute determines the maximum number of reference | 390 * This attribute determines the maximum number of reference |
| 375 * frames supported for encoding. | 391 * frames supported for encoding. |
| 376 * | 392 * |
| 377 * Note: for H.264 encoding, the value represents the maximum number | 393 * Note: for H.264 encoding, the value represents the maximum number |
| 378 * of reference frames for both the reference picture list 0 (bottom | 394 * of reference frames for both the reference picture list 0 (bottom |
| 379 * 16 bits) and the reference picture list 1 (top 16 bits). | 395 * 16 bits) and the reference picture list 1 (top 16 bits). |
| 380 */ | 396 */ |
| 381 VAConfigAttribEncMaxRefFrames = 13, | 397 VAConfigAttribEncMaxRefFrames = 13, |
| 382 /** | 398 /** |
| 383 * \brief Maximum number of slices per frame. Read-only. | 399 * \brief Maximum number of slices per frame. Read-only. |
| 384 * | 400 * |
| 385 * This attribute determines the maximum number of slices the | 401 * This attribute determines the maximum number of slices the |
| 386 * driver can support to encode a single frame. | 402 * driver can support to encode a single frame. |
| 387 */ | 403 */ |
| 388 VAConfigAttribEncMaxSlices = 14, | 404 VAConfigAttribEncMaxSlices = 14, |
| 389 /** | 405 /** |
| 390 * \brief Slice structure. Read-only. | 406 * \brief Slice structure. Read-only. |
| 391 * | 407 * |
| 392 * This attribute determines slice structures supported by the | 408 * This attribute determines slice structures supported by the |
| 393 * driver for encoding. This attribute is a hint to the user so | 409 * driver for encoding. This attribute is a hint to the user so |
| 394 * that he can choose a suitable surface size and how to arrange | 410 * that he can choose a suitable surface size and how to arrange |
| 395 * the encoding process of multiple slices per frame. | 411 * the encoding process of multiple slices per frame. |
| 396 * | 412 * |
| 397 * More specifically, for H.264 encoding, this attribute | 413 * More specifically, for H.264 encoding, this attribute |
| 398 * determines the range of accepted values to | 414 * determines the range of accepted values to |
| 399 * VAEncSliceParameterBufferH264::macroblock_address and | 415 * VAEncSliceParameterBufferH264::macroblock_address and |
| 400 * VAEncSliceParameterBufferH264::num_macroblocks. | 416 * VAEncSliceParameterBufferH264::num_macroblocks. |
| 401 * | 417 * |
| 402 * See \c VA_ENC_SLICE_STRUCTURE_xxx for the supported slice | 418 * See \c VA_ENC_SLICE_STRUCTURE_xxx for the supported slice |
| 403 * structure types. | 419 * structure types. |
| 404 */ | 420 */ |
| 405 VAConfigAttribEncSliceStructure = 15, | 421 VAConfigAttribEncSliceStructure = 15, |
| 406 /** | 422 /** |
| 407 * \brief Macroblock information. Read-only. | 423 * \brief Macroblock information. Read-only. |
| 408 * | 424 * |
| 409 * This attribute determines whether the driver supports extra | 425 * This attribute determines whether the driver supports extra |
| 410 * encoding information per-macroblock. e.g. QP. | 426 * encoding information per-macroblock. e.g. QP. |
| 411 * | 427 * |
| 412 * More specifically, for H.264 encoding, if the driver returns a non-zero | 428 * More specifically, for H.264 encoding, if the driver returns a non-zero |
| 413 * value for this attribute, this means the application can create | 429 * value for this attribute, this means the application can create |
| 414 * additional #VAEncMacroblockParameterBufferH264 buffers referenced | 430 * additional #VAEncMacroblockParameterBufferH264 buffers referenced |
| 415 * through VAEncSliceParameterBufferH264::macroblock_info. | 431 * through VAEncSliceParameterBufferH264::macroblock_info. |
| 416 */ | 432 */ |
| 417 VAConfigAttribEncMacroblockInfo = 16, | 433 VAConfigAttribEncMacroblockInfo = 16, |
| 418 /** | 434 /** |
| 419 * \brief JPEG encoding attribute. Read-only. | 435 * \brief JPEG encoding attribute. Read-only. |
| 420 * | 436 * |
| 421 * This attribute exposes a number of capabilities of the underlying | 437 * This attribute exposes a number of capabilities of the underlying |
| 422 * JPEG implementation. The attribute value is partitioned into fields as de
fined in the | 438 * JPEG implementation. The attribute value is partitioned into fields as |
| 423 * VAConfigAttribValEncJPEG union. | 439 * defined in the VAConfigAttribValEncJPEG union. |
| 424 */ | 440 */ |
| 425 VAConfigAttribEncJPEG = 20, | 441 VAConfigAttribEncJPEG = 20, |
| 426 /** | 442 /** |
| 427 * \brief Encoding quality range attribute. Read-only. | 443 * \brief Encoding quality range attribute. Read-only. |
| 428 * | 444 * |
| 429 * This attribute conveys whether the driver supports different quality leve
l settings | 445 * This attribute conveys whether the driver supports different quality level |
| 430 * for encoding. A value less than or equal to 1 means that the encoder only
has a single | 446 * settings for encoding. A value less than or equal to 1 means that the |
| 431 * quality setting, and a value greater than 1 represents the number of qual
ity levels | 447 * encoder only has a single quality setting, and a value greater than 1 |
| 432 * that can be configured. e.g. a value of 2 means there are two distinct qu
ality levels. | 448 * represents the number of quality levels that can be configured. e.g. a |
| 433 */ | 449 * value of 2 means there are two distinct quality levels. |
| 434 VAConfigAttribEncQualityRange = 21, | 450 */ |
| 435 /** | 451 VAConfigAttribEncQualityRange = 21, |
| 436 * \brief Encoding skip frame attribute. Read-only. | 452 /** |
| 437 * | 453 * \brief Encoding skip frame attribute. Read-only. |
| 438 * This attribute conveys whether the driver supports sending skip frame par
ameters | 454 * |
| 439 * (VAEncMiscParameterTypeSkipFrame) to the encoder's rate control, when the
user has | 455 * This attribute conveys whether the driver supports sending skip frame |
| 440 * externally skipped frames. | 456 * parameters (VAEncMiscParameterTypeSkipFrame) to the encoder's rate control, |
| 441 */ | 457 * when the user has externally skipped frames. |
| 442 VAConfigAttribEncSkipFrame = 24, | 458 */ |
| 443 /**@}*/ | 459 VAConfigAttribEncSkipFrame = 24, |
| 444 VAConfigAttribTypeMax | 460 /** |
| 461 * \brief Encoding region-of-interest (ROI) attribute. Read-only. |
| 462 * |
| 463 * This attribute conveys whether the driver supports region-of-interest (ROI) |
| 464 * encoding, based on user provided ROI rectangles. The attribute value is |
| 465 * partitioned into fields as defined in the VAConfigAttribValEncROI union. |
| 466 * |
| 467 * If ROI encoding is supported, the ROI information is passed to the driver |
| 468 * using VAEncMiscParameterTypeROI. |
| 469 */ |
| 470 VAConfigAttribEncROI = 25, |
| 471 /**@}*/ |
| 472 VAConfigAttribTypeMax |
| 445 } VAConfigAttribType; | 473 } VAConfigAttribType; |
| 446 | 474 |
| 447 /** | 475 /** |
| 448 * Configuration attributes | 476 * Configuration attributes |
| 449 * If there is more than one value for an attribute, a default | 477 * If there is more than one value for an attribute, a default |
| 450 * value will be assigned to the attribute if the client does not | 478 * value will be assigned to the attribute if the client does not |
| 451 * specify the attribute when creating a configuration | 479 * specify the attribute when creating a configuration |
| 452 */ | 480 */ |
| 453 typedef struct _VAConfigAttrib { | 481 typedef struct _VAConfigAttrib { |
| 454 VAConfigAttribType type; | 482 VAConfigAttribType type; |
| 455 unsigned int value; /* OR'd flags (bits) for this attribute */ | 483 unsigned int value; /* OR'd flags (bits) for this attribute */ |
| 456 } VAConfigAttrib; | 484 } VAConfigAttrib; |
| 457 | 485 |
| 458 /** attribute value for VAConfigAttribRTFormat */ | 486 /** attribute value for VAConfigAttribRTFormat */ |
| 459 #define VA_RT_FORMAT_YUV420 0x00000001 | 487 #define VA_RT_FORMAT_YUV420 0x00000001 |
| 460 #define VA_RT_FORMAT_YUV422 0x00000002 | 488 #define VA_RT_FORMAT_YUV422 0x00000002 |
| 461 #define VA_RT_FORMAT_YUV444 0x00000004 | 489 #define VA_RT_FORMAT_YUV444 0x00000004 |
| 462 #define VA_RT_FORMAT_YUV411 0x00000008 | 490 #define VA_RT_FORMAT_YUV411 0x00000008 |
| 463 #define VA_RT_FORMAT_YUV400 0x00000010 | 491 #define VA_RT_FORMAT_YUV400 0x00000010 |
| 492 /** YUV formats with more than 8 bpp */ |
| 493 #define VA_RT_FORMAT_YUV420_10BPP 0x00000100 |
| 494 /** RGB formats */ |
| 464 #define VA_RT_FORMAT_RGB16 0x00010000 | 495 #define VA_RT_FORMAT_RGB16 0x00010000 |
| 465 #define VA_RT_FORMAT_RGB32 0x00020000 | 496 #define VA_RT_FORMAT_RGB32 0x00020000 |
| 466 /* RGBP covers RGBP and BGRP fourcc */ | 497 /* RGBP covers RGBP and BGRP fourcc */ |
| 467 #define VA_RT_FORMAT_RGBP 0x00100000 | 498 #define VA_RT_FORMAT_RGBP 0x00100000 |
| 468 #define VA_RT_FORMAT_PROTECTED 0x80000000 | 499 #define VA_RT_FORMAT_PROTECTED 0x80000000 |
| 469 | 500 |
| 470 /** @name Attribute values for VAConfigAttribRateControl */ | 501 /** @name Attribute values for VAConfigAttribRateControl */ |
| 471 /**@{*/ | 502 /**@{*/ |
| 472 /** \brief Driver does not support any form of rate control. */ | 503 /** \brief Driver does not support any form of rate control. */ |
| 473 #define VA_RC_NONE 0x00000001 | 504 #define VA_RC_NONE 0x00000001 |
| 474 /** \brief Constant bitrate. */ | 505 /** \brief Constant bitrate. */ |
| 475 #define VA_RC_CBR 0x00000002 | 506 #define VA_RC_CBR 0x00000002 |
| 476 /** \brief Variable bitrate. */ | 507 /** \brief Variable bitrate. */ |
| 477 #define VA_RC_VBR 0x00000004 | 508 #define VA_RC_VBR 0x00000004 |
| 478 /** \brief Video conference mode. */ | 509 /** \brief Video conference mode. */ |
| 479 #define VA_RC_VCM 0x00000008 | 510 #define VA_RC_VCM 0x00000008 |
| 480 /** \brief Constant QP. */ | 511 /** \brief Constant QP. */ |
| 481 #define VA_RC_CQP 0x00000010 | 512 #define VA_RC_CQP 0x00000010 |
| 482 /** \brief Variable bitrate with peak rate higher than average bitrate. */ | 513 /** \brief Variable bitrate with peak rate higher than average bitrate. */ |
| 483 #define VA_RC_VBR_CONSTRAINED 0x00000020 | 514 #define VA_RC_VBR_CONSTRAINED 0x00000020 |
| 515 /** \brief Macroblock based rate control. Per MB control is decided |
| 516 * internally in the encoder. It may be combined with other RC modes, except |
| 517 * CQP. */ |
| 518 #define VA_RC_MB 0x00000080 |
| 519 |
| 484 /**@}*/ | 520 /**@}*/ |
| 485 | 521 |
| 486 /** @name Attribute values for VAConfigAttribDecSliceMode */ | 522 /** @name Attribute values for VAConfigAttribDecSliceMode */ |
| 487 /**@{*/ | 523 /**@{*/ |
| 488 /** \brief Driver supports normal mode for slice decoding */ | 524 /** \brief Driver supports normal mode for slice decoding */ |
| 489 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001 | 525 #define VA_DEC_SLICE_MODE_NORMAL 0x00000001 |
| 490 /** \brief Driver supports base mode for slice decoding */ | 526 /** \brief Driver supports base mode for slice decoding */ |
| 491 #define VA_DEC_SLICE_MODE_BASE 0x00000002 | 527 #define VA_DEC_SLICE_MODE_BASE 0x00000002 |
| 492 /**@}*/ | 528 /**@}*/ |
| 493 | 529 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 /** \brief set to 1 for differential. */ | 579 /** \brief set to 1 for differential. */ |
| 544 unsigned int differential_mode : 1; | 580 unsigned int differential_mode : 1; |
| 545 unsigned int max_num_components : 3; | 581 unsigned int max_num_components : 3; |
| 546 unsigned int max_num_scans : 4; | 582 unsigned int max_num_scans : 4; |
| 547 unsigned int max_num_huffman_tables : 3; | 583 unsigned int max_num_huffman_tables : 3; |
| 548 unsigned int max_num_quantization_tables : 3; | 584 unsigned int max_num_quantization_tables : 3; |
| 549 } bits; | 585 } bits; |
| 550 unsigned int value; | 586 unsigned int value; |
| 551 } VAConfigAttribValEncJPEG; | 587 } VAConfigAttribValEncJPEG; |
| 552 | 588 |
| 589 /** \brief Attribute value for VAConfigAttribEncROI */ |
| 590 typedef union _VAConfigAttribValEncROI { |
| 591 struct { |
| 592 /** \brief The number of ROI regions supported, 0 if ROI is not supported. |
| 593 */ |
| 594 unsigned int num_roi_regions : 8; |
| 595 /** \brief Indicates if ROI priority indication is supported when |
| 596 * VAConfigAttribRateControl != VA_RC_CQP, else only ROI delta QP added on |
| 597 * top of the frame level QP is supported when VAConfigAttribRateControl == |
| 598 * VA_RC_CQP. |
| 599 */ |
| 600 unsigned int roi_rc_priority_support : 1; |
| 601 unsigned int reserved : 23; |
| 602 } bits; |
| 603 unsigned int value; |
| 604 } VAConfigAttribValEncROI; |
| 605 |
| 553 /** | 606 /** |
| 554 * if an attribute is not applicable for a given | 607 * if an attribute is not applicable for a given |
| 555 * profile/entrypoint pair, then set the value to the following | 608 * profile/entrypoint pair, then set the value to the following |
| 556 */ | 609 */ |
| 557 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000 | 610 #define VA_ATTRIB_NOT_SUPPORTED 0x80000000 |
| 558 | 611 |
| 559 /** Get maximum number of profiles supported by the implementation */ | 612 /** Get maximum number of profiles supported by the implementation */ |
| 560 int vaMaxNumProfiles ( | 613 int vaMaxNumProfiles ( |
| 561 VADisplay dpy | 614 VADisplay dpy |
| 562 ); | 615 ); |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 * | 1056 * |
| 1004 * The default buffer used by most filters is #VAProcFilterParameterBuffer. | 1057 * The default buffer used by most filters is #VAProcFilterParameterBuffer. |
| 1005 * Filters requiring advanced parameters include, but are not limited to, | 1058 * Filters requiring advanced parameters include, but are not limited to, |
| 1006 * deinterlacing (#VAProcFilterParameterBufferDeinterlacing), | 1059 * deinterlacing (#VAProcFilterParameterBufferDeinterlacing), |
| 1007 * color balance (#VAProcFilterParameterBufferColorBalance), etc. | 1060 * color balance (#VAProcFilterParameterBufferColorBalance), etc. |
| 1008 */ | 1061 */ |
| 1009 VAProcFilterParameterBufferType = 42, | 1062 VAProcFilterParameterBufferType = 42, |
| 1010 VABufferTypeMax | 1063 VABufferTypeMax |
| 1011 } VABufferType; | 1064 } VABufferType; |
| 1012 | 1065 |
| 1013 typedef enum | 1066 typedef enum { |
| 1014 { | 1067 VAEncMiscParameterTypeFrameRate = 0, |
| 1015 VAEncMiscParameterTypeFrameRate » = 0, | 1068 VAEncMiscParameterTypeRateControl = 1, |
| 1016 VAEncMiscParameterTypeRateControl »= 1, | 1069 VAEncMiscParameterTypeMaxSliceSize = 2, |
| 1017 VAEncMiscParameterTypeMaxSliceSize» = 2, | 1070 VAEncMiscParameterTypeAIR = 3, |
| 1018 VAEncMiscParameterTypeAIR » = 3, | 1071 /** \brief Buffer type used to express a maximum frame size (in bits). */ |
| 1019 /** \brief Buffer type used to express a maximum frame size (in bits). */ | 1072 VAEncMiscParameterTypeMaxFrameSize = 4, |
| 1020 VAEncMiscParameterTypeMaxFrameSize = 4, | 1073 /** \brief Buffer type used for HRD parameters. */ |
| 1021 /** \brief Buffer type used for HRD parameters. */ | 1074 VAEncMiscParameterTypeHRD = 5, |
| 1022 VAEncMiscParameterTypeHRD = 5, | 1075 VAEncMiscParameterTypeQualityLevel = 6, |
| 1023 VAEncMiscParameterTypeQualityLevel = 6, | 1076 /** \brief Buffer type used for sending skip frame parameters to the encoder's |
| 1024 /** \brief Buffer type used for sending skip frame parameters to the encoder
's | 1077 * rate control, when the user has externally skipped frames. */ |
| 1025 * rate control, when the user has externally skipped frames. */ | 1078 VAEncMiscParameterTypeSkipFrame = 9, |
| 1026 VAEncMiscParameterTypeSkipFrame = 9 | 1079 /** \brief Buffer type used for region-of-interest (ROI) parameters. */ |
| 1080 VAEncMiscParameterTypeROI = 10 |
| 1027 } VAEncMiscParameterType; | 1081 } VAEncMiscParameterType; |
| 1028 | 1082 |
| 1029 /** \brief Packed header type. */ | 1083 /** \brief Packed header type. */ |
| 1030 typedef enum { | 1084 typedef enum { |
| 1031 /** \brief Packed sequence header. */ | 1085 /** \brief Packed sequence header. */ |
| 1032 VAEncPackedHeaderSequence = 1, | 1086 VAEncPackedHeaderSequence = 1, |
| 1033 /** \brief Packed picture header. */ | 1087 /** \brief Packed picture header. */ |
| 1034 VAEncPackedHeaderPicture = 2, | 1088 VAEncPackedHeaderPicture = 2, |
| 1035 /** \brief Packed slice header. */ | 1089 /** \brief Packed slice header. */ |
| 1036 VAEncPackedHeaderSlice = 3, | 1090 VAEncPackedHeaderSlice = 3, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 unsigned int initial_qp; | 1153 unsigned int initial_qp; |
| 1100 unsigned int min_qp; | 1154 unsigned int min_qp; |
| 1101 unsigned int basic_unit_size; | 1155 unsigned int basic_unit_size; |
| 1102 union | 1156 union |
| 1103 { | 1157 { |
| 1104 struct | 1158 struct |
| 1105 { | 1159 { |
| 1106 unsigned int reset : 1; | 1160 unsigned int reset : 1; |
| 1107 unsigned int disable_frame_skip : 1; /* Disable frame skip in rate c
ontrol mode */ | 1161 unsigned int disable_frame_skip : 1; /* Disable frame skip in rate c
ontrol mode */ |
| 1108 unsigned int disable_bit_stuffing : 1; /* Disable bit stuffing in ra
te control mode */ | 1162 unsigned int disable_bit_stuffing : 1; /* Disable bit stuffing in ra
te control mode */ |
| 1163 unsigned int |
| 1164 mb_rate_control : 4; /* Control VA_RC_MB 0: default, 1: enable, |
| 1165 2: disable, other: reserved*/ |
| 1109 } bits; | 1166 } bits; |
| 1110 unsigned int value; | 1167 unsigned int value; |
| 1111 } rc_flags; | 1168 } rc_flags; |
| 1112 } VAEncMiscParameterRateControl; | 1169 } VAEncMiscParameterRateControl; |
| 1113 | 1170 |
| 1114 typedef struct _VAEncMiscParameterFrameRate | 1171 typedef struct _VAEncMiscParameterFrameRate |
| 1115 { | 1172 { |
| 1116 unsigned int framerate; | 1173 unsigned int framerate; |
| 1117 } VAEncMiscParameterFrameRate; | 1174 } VAEncMiscParameterFrameRate; |
| 1118 | 1175 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 * (all except VAEncPackedHeaderSlice) which could contain actual frame
contents (e.g. pack the frame | 1247 * (all except VAEncPackedHeaderSlice) which could contain actual frame
contents (e.g. pack the frame |
| 1191 * in VAEncPackedHeaderPicture). */ | 1248 * in VAEncPackedHeaderPicture). */ |
| 1192 unsigned char skip_frame_flag; | 1249 unsigned char skip_frame_flag; |
| 1193 /** \brief The number of frames skipped prior to the current frame. Valid w
hen skip_frame_flag = 1. */ | 1250 /** \brief The number of frames skipped prior to the current frame. Valid w
hen skip_frame_flag = 1. */ |
| 1194 unsigned char num_skip_frames; | 1251 unsigned char num_skip_frames; |
| 1195 /** \brief When skip_frame_flag = 1, the size of the skipped frames in bits.
When skip_frame_flag = 2, | 1252 /** \brief When skip_frame_flag = 1, the size of the skipped frames in bits.
When skip_frame_flag = 2, |
| 1196 * the size of the current skipped frame that is to be packed/encrypted in
bits. */ | 1253 * the size of the current skipped frame that is to be packed/encrypted in
bits. */ |
| 1197 unsigned int size_skip_frames; | 1254 unsigned int size_skip_frames; |
| 1198 } VAEncMiscParameterSkipFrame; | 1255 } VAEncMiscParameterSkipFrame; |
| 1199 | 1256 |
| 1200 /* | 1257 /** |
| 1201 * There will be cases where the bitstream buffer will not have enough room to h
old | 1258 * \brief Encoding region-of-interest (ROI). |
| 1202 * the data for the entire slice, and the following flags will be used in the sl
ice | 1259 * |
| 1203 * parameter to signal to the server for the possible cases. | 1260 * The encoding ROI can be set through VAEncMiscParameterBufferROI, if the |
| 1204 * If a slice parameter buffer and slice data buffer pair is sent to the server
with | 1261 * implementation supports ROI input. The ROI set through this structure is |
| 1205 * the slice data partially in the slice data buffer (BEGIN and MIDDLE cases bel
ow), | 1262 * applicable only to the current frame or field, so must be sent every frame or |
| 1206 * then a slice parameter and data buffer needs to be sent again to complete thi
s slice. | 1263 * field to be applied. The number of supported ROIs can be queried through the |
| 1264 * VAConfigAttribEncROI. The encoder will use the ROI information to adjust the |
| 1265 * QP values of the MB's that fall within the ROIs. |
| 1266 */ |
| 1267 typedef struct _VAEncROI { |
| 1268 /** \brief Defines the ROI boundary in pixels, the driver will map it to |
| 1269 * appropriate codec coding units. It is relative to frame coordinates for |
| 1270 * the frame case and to field coordinates for the field case. */ |
| 1271 VARectangle roi_rectangle; |
| 1272 /** \brief When VAConfigAttribRateControl == VA_RC_CQP then roi_value specifes |
| 1273 * the delta QP that will be added on top of the frame level QP. For other |
| 1274 * rate control modes, roi_value specifies the priority of the ROI region |
| 1275 * relative to the non-ROI region. It can be positive (more important) or |
| 1276 * negative (less important) values and is compared with non-ROI region |
| 1277 * (taken as value 0). E.g. ROI region with roi_value -3 is less important |
| 1278 * than the non-ROI region (roi_value implied to be 0) which is less |
| 1279 * important than ROI region with roi_value +2. For overlapping regions, the |
| 1280 * roi_value that is first in the ROI array will have priority. */ |
| 1281 char roi_value; |
| 1282 } VAEncROI; |
| 1283 |
| 1284 typedef struct _VAEncMiscParameterBufferROI { |
| 1285 /** \brief Number of ROIs being sent.*/ |
| 1286 unsigned int num_roi; |
| 1287 |
| 1288 /** \brief Valid when VAConfigAttribRateControl != VA_RC_CQP, then the |
| 1289 * encoder's rate control will determine actual delta QPs. Specifies the |
| 1290 * max/min allowed delta QPs. */ |
| 1291 char max_delta_qp; |
| 1292 char min_delta_qp; |
| 1293 |
| 1294 /** \brief Pointer to a VAEncROI array with num_roi elements. It is relative |
| 1295 * to frame coordinates for the frame case and to field coordinates for the |
| 1296 * field case.*/ |
| 1297 VAEncROI* roi; |
| 1298 } VAEncMiscParameterBufferROI; |
| 1299 |
| 1300 /** |
| 1301 * There will be cases where the bitstream buffer will not have enough room to |
| 1302 * hold the data for the entire slice, and the following flags will be used in |
| 1303 * the slice parameter to signal to the server for the possible cases. If a |
| 1304 * slice parameter buffer and slice data buffer pair is sent to the server with |
| 1305 * the slice data partially in the slice data buffer (BEGIN and MIDDLE cases |
| 1306 * below), then a slice parameter and data buffer needs to be sent again to |
| 1307 * complete this slice. |
| 1207 */ | 1308 */ |
| 1208 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer
*/ | 1309 #define VA_SLICE_DATA_FLAG_ALL 0x00 /* whole slice is in the buffer
*/ |
| 1209 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is
in the buffer but the end if not */ | 1310 #define VA_SLICE_DATA_FLAG_BEGIN 0x01 /* The beginning of the slice is
in the buffer but the end if not */ |
| 1210 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of
the slice is in the buffer */ | 1311 #define VA_SLICE_DATA_FLAG_MIDDLE 0x02 /* Neither beginning nor end of
the slice is in the buffer */ |
| 1211 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the bu
ffer */ | 1312 #define VA_SLICE_DATA_FLAG_END 0x04 /* end of the slice is in the bu
ffer */ |
| 1212 | 1313 |
| 1213 /* Codec-independent Slice Parameter Buffer base */ | 1314 /* Codec-independent Slice Parameter Buffer base */ |
| 1214 typedef struct _VASliceParameterBufferBase | 1315 typedef struct _VASliceParameterBufferBase |
| 1215 { | 1316 { |
| 1216 unsigned int slice_data_size; /* number of bytes in the slice data buf
fer for this slice */ | 1317 unsigned int slice_data_size; /* number of bytes in the slice data buf
fer for this slice */ |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 #define VA_FOURCC_YV32 0x32335659 | 2375 #define VA_FOURCC_YV32 0x32335659 |
| 2275 #define VA_FOURCC_Y800 0x30303859 | 2376 #define VA_FOURCC_Y800 0x30303859 |
| 2276 #define VA_FOURCC_IMC3 0x33434D49 | 2377 #define VA_FOURCC_IMC3 0x33434D49 |
| 2277 #define VA_FOURCC_411P 0x50313134 | 2378 #define VA_FOURCC_411P 0x50313134 |
| 2278 #define VA_FOURCC_422H 0x48323234 | 2379 #define VA_FOURCC_422H 0x48323234 |
| 2279 #define VA_FOURCC_422V 0x56323234 | 2380 #define VA_FOURCC_422V 0x56323234 |
| 2280 #define VA_FOURCC_444P 0x50343434 | 2381 #define VA_FOURCC_444P 0x50343434 |
| 2281 #define VA_FOURCC_RGBP 0x50424752 | 2382 #define VA_FOURCC_RGBP 0x50424752 |
| 2282 #define VA_FOURCC_BGRP 0x50524742 | 2383 #define VA_FOURCC_BGRP 0x50524742 |
| 2283 #define VA_FOURCC_411R 0x52313134 /* rotated 411P */ | 2384 #define VA_FOURCC_411R 0x52313134 /* rotated 411P */ |
| 2385 /** |
| 2386 * Planar YUV 4:2:2. |
| 2387 * 8-bit Y plane, followed by 8-bit 2x1 subsampled V and U planes |
| 2388 */ |
| 2389 #define VA_FOURCC_YV16 0x36315659 |
| 2390 /** |
| 2391 * 10-bit and 16-bit Planar YUV 4:2:0. |
| 2392 */ |
| 2393 #define VA_FOURCC_P010 0x30313050 |
| 2394 #define VA_FOURCC_P016 0x36313050 |
| 2284 | 2395 |
| 2285 /* byte order */ | 2396 /* byte order */ |
| 2286 #define VA_LSB_FIRST 1 | 2397 #define VA_LSB_FIRST 1 |
| 2287 #define VA_MSB_FIRST 2 | 2398 #define VA_MSB_FIRST 2 |
| 2288 | 2399 |
| 2289 typedef struct _VAImageFormat | 2400 typedef struct _VAImageFormat |
| 2290 { | 2401 { |
| 2291 unsigned int fourcc; | 2402 unsigned int fourcc; |
| 2292 unsigned int byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */ | 2403 unsigned int byte_order; /* VA_LSB_FIRST, VA_MSB_FIRST */ |
| 2293 unsigned int bits_per_pixel; | 2404 unsigned int bits_per_pixel; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 /** | 2697 /** |
| 2587 * vaDeassociateSubpicture removes the association of the subpicture with target
_surfaces. | 2698 * vaDeassociateSubpicture removes the association of the subpicture with target
_surfaces. |
| 2588 */ | 2699 */ |
| 2589 VAStatus vaDeassociateSubpicture ( | 2700 VAStatus vaDeassociateSubpicture ( |
| 2590 VADisplay dpy, | 2701 VADisplay dpy, |
| 2591 VASubpictureID subpicture, | 2702 VASubpictureID subpicture, |
| 2592 VASurfaceID *target_surfaces, | 2703 VASurfaceID *target_surfaces, |
| 2593 int num_surfaces | 2704 int num_surfaces |
| 2594 ); | 2705 ); |
| 2595 | 2706 |
| 2596 typedef struct _VARectangle | |
| 2597 { | |
| 2598 short x; | |
| 2599 short y; | |
| 2600 unsigned short width; | |
| 2601 unsigned short height; | |
| 2602 } VARectangle; | |
| 2603 | |
| 2604 /** | 2707 /** |
| 2605 * Display attributes | 2708 * Display attributes |
| 2606 * Display attributes are used to control things such as contrast, hue, saturati
on, | 2709 * Display attributes are used to control things such as contrast, hue, saturati
on, |
| 2607 * brightness etc. in the rendering process. The application can query what | 2710 * brightness etc. in the rendering process. The application can query what |
| 2608 * attributes are supported by the driver, and then set the appropriate attribut
es | 2711 * attributes are supported by the driver, and then set the appropriate attribut
es |
| 2609 * before calling vaPutSurface() | 2712 * before calling vaPutSurface() |
| 2610 */ | 2713 */ |
| 2611 /* PowerVR IEP Lite attributes */ | 2714 /* PowerVR IEP Lite attributes */ |
| 2612 typedef enum | 2715 typedef enum |
| 2613 { | 2716 { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2833 /** \brief RefPicSetLtCurr of HEVC spec variable | 2936 /** \brief RefPicSetLtCurr of HEVC spec variable |
| 2834 * Number of ReferenceFrames[] entries with this bit set equals | 2937 * Number of ReferenceFrames[] entries with this bit set equals |
| 2835 * NumPocLtCurr. | 2938 * NumPocLtCurr. |
| 2836 */ | 2939 */ |
| 2837 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040 | 2940 #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040 |
| 2838 | 2941 |
| 2839 #include <va/va_dec_hevc.h> | 2942 #include <va/va_dec_hevc.h> |
| 2840 #include <va/va_dec_jpeg.h> | 2943 #include <va/va_dec_jpeg.h> |
| 2841 #include <va/va_dec_vp8.h> | 2944 #include <va/va_dec_vp8.h> |
| 2842 #include <va/va_dec_vp9.h> | 2945 #include <va/va_dec_vp9.h> |
| 2946 #include <va/va_enc_h264.h> |
| 2843 #include <va/va_enc_hevc.h> | 2947 #include <va/va_enc_hevc.h> |
| 2844 #include <va/va_enc_h264.h> | |
| 2845 #include <va/va_enc_jpeg.h> | 2948 #include <va/va_enc_jpeg.h> |
| 2846 #include <va/va_enc_mpeg2.h> | 2949 #include <va/va_enc_mpeg2.h> |
| 2847 #include <va/va_enc_vp8.h> | 2950 #include <va/va_enc_vp8.h> |
| 2951 #include <va/va_enc_vp9.h> |
| 2848 #include <va/va_vpp.h> | 2952 #include <va/va_vpp.h> |
| 2849 | 2953 |
| 2850 /**@}*/ | 2954 /**@}*/ |
| 2851 | 2955 |
| 2852 #ifdef __cplusplus | 2956 #ifdef __cplusplus |
| 2853 } | 2957 } |
| 2854 #endif | 2958 #endif |
| 2855 | 2959 |
| 2856 #endif /* _VA_H_ */ | 2960 #endif /* _VA_H_ */ |
| OLD | NEW |