OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

845 lines
26 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../fglrx/install/usr_include_amd_amdxvba.h.txt
  5. # Copyright (C) 2012 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. /*******************************************************************************
  15. *
  16. * Copyright (c) 2011, Advanced Micro Devices, Inc.
  17. * All rights reserved.
  18. *
  19. * Redistribution and use in source and binary forms, with or without
  20. * modification, are permitted provided that the following are met:
  21. *
  22. * Neither the name of the copyright holder nor the names of its
  23. * contributors may be used to endorse or promote products derived from
  24. * this software without specific, prior, written permission.
  25. *
  26. * You must reproduce the above copyright notice.
  27. *
  28. * You must include the following terms in your license and/or other
  29. * materials provided with the software.
  30. *
  31. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  32. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  33. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  34. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  35. * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  37. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  38. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  39. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  40. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  41. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. * Without limiting the foregoing, the software may implement third
  44. * party technologies (e.g. third party libraries) for which you must
  45. * obtain licenses from parties other than AMD. You agree that AMD has
  46. * not obtained or conveyed to you, and that you shall be responsible for
  47. * obtaining the rights to use and/or distribute the applicable underlying
  48. * intellectual property rights related to the third party technologies.
  49. * These third party technologies are not licensed hereunder.
  50. *
  51. * Without limiting the foregoing, for MPEG-2 products, the following
  52. * additional notices are provided: For MPEG-2 Encoding Products (those
  53. * that are "Sold" to end-users, directly or indirectly):
  54. *
  55. * NO LICENSE IS GRANTED HEREIN, BY IMPLICATION OR OTHERWISE,
  56. * TO YOU OR YOUR CUSTOMERS TO USE MPEG-2 ENCODING PRODUCTS,
  57. * MPEG-2 DISTRIBUTION ENCODING PRODUCTS, MPEG-2 ENCODING SOFTWARE,
  58. * AND/OR MPEG-2 BUNDLED ENCODING SOFTWARE FOR ENCODING OR HAVING
  59. * ENCODED ONE OR MORE MPEG-2 VIDEO EVENTS FOR RECORDING ON AN
  60. * MPEG-2 PACKAGED MEDIUM FOR ANY USE OR DISTRIBUTION OTHER THAN
  61. * PERSONAL USE OF LICENSEE'S CUSTOMER.
  62. *
  63. * For MPEG-2 Intermediate Products (those that are NOT "Sold" to
  64. * end-users, directly or indirectly):
  65. *
  66. * NO LICENSE IS GRANTED HEREIN, BY IMPLICATION OR OTHERWISE,
  67. * TO YOU OR YOUR CUSTOMERS TO USE MPEG-2 INTERMEDIATE PRODUCTS
  68. * MANUFACTURED OR SOLD BY YOU.
  69. *
  70. * If you use the software (in whole or in part), you shall adhere to
  71. * all applicable U.S., European, and other export laws, including but
  72. * not limited to the U.S. Export Administration Regulations ("EAR"),
  73. * (15 C.F.R. Sections 730 through 774), and E.U. Council Regulation (EC)
  74. * No 1334/2000 of 22 June 2000. Further, pursuant to Section 740.6 of
  75. * the EAR, you hereby certify that, except pursuant to a license granted
  76. * by the United States Department of Commerce Bureau of Industry and
  77. * Security or as otherwise permitted pursuant to a License Exception
  78. * under the U.S. Export Administration Regulations ("EAR"), you will
  79. * not (1) export, re-export or release to a national of a country in
  80. * Country Groups D:1, E:1 or E:2 any restricted technology, software,
  81. * or source code you receive hereunder, or (2) export to Country Groups
  82. * D:1, E:1 or E:2 the direct product of such technology or software, if
  83. * such foreign produced direct product is subject to national security
  84. * controls as identified on the Commerce Control List (currently found
  85. * in Supplement 1 to Part 774 of EAR). For the most current Country
  86. * Group listings, or for additional information about the EAR or your
  87. * obligations under those regulations, please refer to the U.S. Bureau
  88. * of Industry and Security's website at http://www.bis.doc.gov/.
  89. *
  90. *******************************************************************************/
  91. #ifndef _XVBA_H
  92. #define _XVBA_H
  93. // A minor revision change indicates a backward-compatible change; a major revision change indicates a backward-incompatible
  94. #define XVBA_VERSION_MAJOR 0
  95. #define XVBA_VERSION_MINOR 74
  96. #define XVBA_VERSION ((XVBA_VERSION_MAJOR << 16) | XVBA_VERSION_MINOR)
  97. #define NUM_OF_XVBA_DECODE_CAP 3
  98. #define NUM_OF_XVBA_GET_SURFACE_TARGET 3
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102. typedef enum _XVBA_SURFACE_FLAG
  103. {
  104. XVBA_FRAME = 0,
  105. XVBA_TOP_FIELD,
  106. XVBA_BOTTOM_FIELD,
  107. } XVBA_SURFACE_FLAG;
  108. /* Four-character-code (FOURCC) */
  109. #define XVBA_FOURCC(a,b,c,d)\
  110. (((unsigned int)(a)<<0) |\
  111. ((unsigned int)(b)<<8) |\
  112. ((unsigned int)(c)<<16)|\
  113. ((unsigned int)(d)<<24))
  114. typedef enum _XVBA_SURFACE_FORMAT
  115. {
  116. XVBA_NV12 = XVBA_FOURCC('N','V','1','2'), /* 12bit Y/CbCr 4:2:0 planar */
  117. XVBA_YUY2 = XVBA_FOURCC('Y','U','Y','2'), /* 16bit YUV 4:2:2 */
  118. XVBA_ARGB = XVBA_FOURCC('A','R','G','B'), /* 32bit ARGB-8-8-8-8 */
  119. XVBA_AYUV = XVBA_FOURCC('A','Y','U','V'), /* 32bit AYUV-8-8-8-8 */
  120. XVBA_YV12 = XVBA_FOURCC('Y','V','1','2'), /* 12bit Y/V/U 4:2:0 planar */
  121. } XVBA_SURFACE_FORMAT;
  122. typedef struct _XVBA_GetSurface_Target
  123. {
  124. unsigned int size; ///< structure size
  125. XVBA_SURFACE_FORMAT surfaceType;
  126. XVBA_SURFACE_FLAG flag;
  127. } XVBA_GetSurface_Target;
  128. /**
  129. * XVBA Query Extension
  130. */
  131. Bool
  132. XVBAQueryExtension
  133. (
  134. Display *display,
  135. int *version
  136. );
  137. /******************************************************************/
  138. /* XVBA Context */
  139. /******************************************************************/
  140. /**
  141. * XVBA Context Create
  142. */
  143. typedef struct
  144. {
  145. unsigned int size; ///< structure size
  146. Display *display;
  147. Drawable draw;
  148. } XVBA_Create_Context_Input;
  149. typedef struct
  150. {
  151. unsigned int size; ///< structure size
  152. void *context;
  153. } XVBA_Create_Context_Output;
  154. Status
  155. XVBACreateContext
  156. (
  157. XVBA_Create_Context_Input *create_context_input,
  158. XVBA_Create_Context_Output *create_context_output
  159. );
  160. /**
  161. * XVBA Context Destroy
  162. */
  163. Status
  164. XVBADestroyContext
  165. (
  166. void *context
  167. );
  168. /******************************************************************/
  169. /* XVBA Sessions */
  170. /******************************************************************/
  171. /**
  172. * XVBA Context Query Session Info
  173. */
  174. typedef struct
  175. {
  176. unsigned int size; ///< structure size
  177. void *context;
  178. } XVBA_GetSessionInfo_Input;
  179. typedef struct
  180. {
  181. unsigned int size; ///< structure size
  182. unsigned int getcapdecode_output_size; ///< 0 = Decode not supported, NZ = Decode session is supported and the value is used for XVBAGetCapDecode output struct size
  183. unsigned int xvba_gsio_reserved_0;
  184. unsigned int xvba_gsio_reserved_1;
  185. } XVBA_GetSessionInfo_Output;
  186. Status
  187. XVBAGetSessionInfo
  188. (
  189. XVBA_GetSessionInfo_Input *get_session_info_input,
  190. XVBA_GetSessionInfo_Output *get_session_info_output
  191. );
  192. /******************************************************************/
  193. /* XVBA decode errors */
  194. /******************************************************************/
  195. typedef enum
  196. {
  197. XVBA_DECODE_NO_ERROR = 0,
  198. XVBA_DECODE_BAD_PICTURE, ///< the entire picture is corrupted . All MBs are invalid
  199. XVBA_DECODE_BAD_SLICE, ///< part of the picture, slice, wasn.t decoded properly . all MBs in this slice are bad
  200. XVBA_DECODE_BAD_MB ///< some MBs are not decoded properly
  201. } XVBA_DECODE_ERROR;
  202. typedef struct
  203. {
  204. unsigned int size; ///< structure size
  205. XVBA_DECODE_ERROR type;
  206. unsigned int num_of_bad_mbs; ///< number of marcoblocks that were not properly decoded
  207. } XVBADecodeError;
  208. /******************************************************************/
  209. /* XVBA Surface */
  210. /******************************************************************/
  211. /**
  212. * XVBA Surface create
  213. */
  214. typedef struct
  215. {
  216. unsigned int size;
  217. void *session;
  218. unsigned int width;
  219. unsigned int height;
  220. XVBA_SURFACE_FORMAT surface_type;
  221. } XVBA_Create_Surface_Input;
  222. typedef struct
  223. {
  224. unsigned int size;
  225. void *surface; ///< Pointer to XVBASurface
  226. } XVBA_Create_Surface_Output;
  227. Status
  228. XVBACreateSurface(
  229. XVBA_Create_Surface_Input *create_surface_input,
  230. XVBA_Create_Surface_Output *create_surface_output
  231. );
  232. /**
  233. * XVBA Surface destroy
  234. */
  235. Status
  236. XVBADestroySurface(
  237. void *surface
  238. );
  239. /**
  240. * Synchronization query_status_flags
  241. */
  242. typedef enum
  243. {
  244. XVBA_GET_SURFACE_STATUS = 1, ///< get surface status; is surface still used by GPU
  245. XVBA_GET_DECODE_ERRORS ///< get decode errors for target surface
  246. } XVBA_QUERY_STATUS;
  247. /**
  248. * Synchronization status flags
  249. */
  250. #define XVBA_STILL_PENDING 0x00000001 ///< surface is still used by HW
  251. #define XVBA_COMPLETED 0x00000002 ///< HW completed job on this surface
  252. #define XVBA_NO_ERROR_DECODE 0x00000004 ///< no decode errors
  253. #define XVBA_ERROR_DECODE 0x00000008 ///< decode errors for queried surface
  254. /**
  255. * XVBA Surface synchronization
  256. */
  257. typedef struct
  258. {
  259. unsigned int size;
  260. void *session;
  261. void *surface;
  262. XVBA_QUERY_STATUS query_status;
  263. } XVBA_Surface_Sync_Input;
  264. typedef struct
  265. {
  266. unsigned int size;
  267. unsigned int status_flags;
  268. XVBADecodeError decode_error;
  269. } XVBA_Surface_Sync_Output;
  270. Status
  271. XVBASyncSurface (
  272. XVBA_Surface_Sync_Input *surface_sync_input,
  273. XVBA_Surface_Sync_Output *surface_sync_output
  274. );
  275. // Conversion from OGL to XVBA surface
  276. typedef struct
  277. {
  278. unsigned int size;
  279. void *session;
  280. void *glcontext;
  281. unsigned int gltexture;
  282. } XVBA_Create_GLShared_Surface_Input;
  283. typedef struct
  284. {
  285. unsigned int size;
  286. void *surface; // Pointer to XVBASurface
  287. } XVBA_Create_GLShared_Surface_Output;
  288. Status
  289. XVBACreateGLSharedSurface (
  290. XVBA_Create_GLShared_Surface_Input *create_glshared_surface_input,
  291. XVBA_Create_GLShared_Surface_Output *create_glshared_surface_output
  292. );
  293. /**
  294. * XVBA Get Surface
  295. */
  296. typedef struct {
  297. unsigned int size; ///< structure size
  298. void *session; // XVBA session
  299. void *src_surface; // source XVBA surface
  300. void *target_buffer; // application supplied system memory buffer
  301. unsigned int target_pitch; // pitch of the destination buffer
  302. unsigned int target_width; // width of the destination buffer
  303. unsigned int target_height; // height of the destination buffer
  304. XVBA_GetSurface_Target target_parameter; // destination buffer format and flag
  305. unsigned int reserved [4]; // reserved
  306. } XVBA_Get_Surface_Input;
  307. Status
  308. XVBAGetSurface (
  309. XVBA_Get_Surface_Input *get_surface_input
  310. );
  311. /**
  312. * XVBA Transfer Surface
  313. */
  314. typedef struct {
  315. unsigned int size; ///< structure size
  316. void *session; // XVBA session
  317. void *src_surface; // source XVBA surface
  318. void *target_surface; // destination XVBA surface
  319. XVBA_SURFACE_FLAG flag; // top, bottom or frame
  320. unsigned int reserved [4]; // reserved
  321. } XVBA_Transfer_Surface_Input;
  322. Status
  323. XVBATransferSurface (
  324. XVBA_Transfer_Surface_Input *transfer_surface_input
  325. );
  326. /******************************************************************/
  327. /* XVBA Buffers */
  328. /******************************************************************/
  329. typedef enum
  330. {
  331. XVBA_NONE = 0,
  332. XVBA_PICTURE_DESCRIPTION_BUFFER,
  333. XVBA_DATA_BUFFER,
  334. XVBA_DATA_CTRL_BUFFER,
  335. XVBA_QM_BUFFER
  336. } XVBA_BUFFER;
  337. typedef struct
  338. {
  339. unsigned int size; ///< structure size
  340. XVBA_BUFFER buffer_type;
  341. unsigned int buffer_size; ///< allocated size of data in bytes
  342. void *bufferXVBA; ///< pointer to XVBA decode data buffer
  343. unsigned int data_size_in_buffer;///< Used in Decode call only
  344. int data_offset; ///< Used in Decode call only
  345. void *appPrivate; ///< used only by application to store pointer to its private data.
  346. } XVBABufferDescriptor;
  347. /**
  348. * XVBA Decode buffers create
  349. */
  350. typedef struct
  351. {
  352. unsigned int size; ///< structure size
  353. void *session;
  354. XVBA_BUFFER buffer_type;
  355. unsigned int num_of_buffers;
  356. } XVBA_Create_DecodeBuff_Input;
  357. typedef struct
  358. {
  359. unsigned int size; ///< structure size
  360. unsigned int num_of_buffers_in_list;
  361. XVBABufferDescriptor *buffer_list;
  362. } XVBA_Create_DecodeBuff_Output;
  363. Status
  364. XVBACreateDecodeBuffers (
  365. XVBA_Create_DecodeBuff_Input *create_decodebuff_input,
  366. XVBA_Create_DecodeBuff_Output *create_decodebuff_output
  367. );
  368. /**
  369. * XVBA Decode buffers destroy
  370. */
  371. typedef struct
  372. {
  373. unsigned int size;
  374. void *session;
  375. unsigned int num_of_buffers_in_list;
  376. XVBABufferDescriptor *buffer_list;
  377. } XVBA_Destroy_Decode_Buffers_Input;
  378. Status
  379. XVBADestroyDecodeBuffers (
  380. XVBA_Destroy_Decode_Buffers_Input *buffer_list
  381. );
  382. /******************************************************************/
  383. /* XVBA Decode session (XVBADecodeCap) */
  384. /******************************************************************/
  385. /**
  386. * XVBADecodeCap flags
  387. */
  388. typedef enum
  389. {
  390. XVBA_NOFLAG = 0,
  391. XVBA_H264_BASELINE,
  392. XVBA_H264_MAIN,
  393. XVBA_H264_HIGH,
  394. XVBA_VC1_SIMPLE,
  395. XVBA_VC1_MAIN,
  396. XVBA_VC1_ADVANCED,
  397. } XVBA_DECODE_FLAGS;
  398. /**
  399. * XVBADecodeCap capability_id
  400. */
  401. typedef enum
  402. {
  403. XVBA_H264 = 0x100,///< bitstream level of acceleration
  404. XVBA_VC1, ///< bitstream level of acceleration
  405. XVBA_MPEG2_IDCT, ///< iDCT and motion compensation level of acceleration
  406. XVBA_MPEG2_VLD ///< bitstream level of acceleration
  407. } XVBA_CAPABILITY_ID;
  408. typedef struct {
  409. unsigned int size; ///< structure size
  410. XVBA_CAPABILITY_ID capability_id; ///< Unique descriptor for decode capability
  411. XVBA_DECODE_FLAGS flags; ///< defines for additional information about capability
  412. XVBA_SURFACE_FORMAT surface_type; ///< Surface type: fourcc YUV or RGB supported with this capability.
  413. } XVBADecodeCap;
  414. /**
  415. * XVBADecodeCap Query Info
  416. */
  417. typedef struct {
  418. unsigned int size; ///< structure size
  419. void *context;
  420. } XVBA_GetCapDecode_Input;
  421. typedef struct {
  422. unsigned int size; ///< structure size
  423. unsigned int num_of_decodecaps;
  424. XVBADecodeCap decode_caps_list[NUM_OF_XVBA_DECODE_CAP];
  425. unsigned int num_of_getsurface_target;
  426. XVBA_GetSurface_Target getsurface_target_list[NUM_OF_XVBA_GET_SURFACE_TARGET];
  427. } XVBA_GetCapDecode_Output;
  428. Status
  429. XVBAGetCapDecode (
  430. XVBA_GetCapDecode_Input *decodecap_list_input,
  431. XVBA_GetCapDecode_Output *decodecap_list_output
  432. );
  433. /**
  434. * XVBADecodeCap create
  435. */
  436. typedef struct {
  437. unsigned int size; ///< structure size
  438. unsigned int width; ///< decoded video width
  439. unsigned int height; ///< decoded video height
  440. void *context;
  441. XVBADecodeCap *decode_cap; ///< capability from the driver reported list
  442. } XVBA_Create_Decode_Session_Input;
  443. typedef struct {
  444. unsigned int size; ///< structure size
  445. void *session; ///< Pointer to the created decode session
  446. } XVBA_Create_Decode_Session_Output;
  447. Status
  448. XVBACreateDecode (
  449. XVBA_Create_Decode_Session_Input *create_decode_session_input,
  450. XVBA_Create_Decode_Session_Output *create_decode_session_output
  451. );
  452. /**
  453. * XVBADecodeCap destroy
  454. */
  455. Status
  456. XVBADestroyDecode (
  457. void *session
  458. );
  459. /******************************************************************/
  460. /* XVBA Decode API */
  461. /******************************************************************/
  462. #define XVBA_PREDICTION_FIELD 0x01
  463. #define XVBA_PREDICTION_FRAME 0x02
  464. #define XVBA_PREDICTION_DUAL_PRIME 0x03
  465. #define XVBA_PREDICTION_16x8 0x02
  466. #define XVBA_SECOND_FIELD 0x00000004
  467. /**
  468. * XVBA inits picture decoding
  469. */
  470. typedef struct
  471. {
  472. unsigned int size; ///< structure size
  473. void *session; ///< pointer to decode session
  474. void *target_surface; ///< decode target
  475. } XVBA_Decode_Picture_Start_Input;
  476. Status
  477. XVBAStartDecodePicture (
  478. XVBA_Decode_Picture_Start_Input *decode_picture_start
  479. );
  480. /**
  481. * XVBA picture decode
  482. */
  483. typedef struct
  484. {
  485. unsigned int size; ///< structure size
  486. void *session; ///< pointer to decode session
  487. unsigned int num_of_buffers_in_list; ///< number of decode compressed data buffers
  488. XVBABufferDescriptor **buffer_list; ///< array of XVBABufferDescriptor structures
  489. } XVBA_Decode_Picture_Input;
  490. Status
  491. XVBADecodePicture (
  492. XVBA_Decode_Picture_Input *decode_picture_input
  493. );
  494. /**
  495. * XVBA end picture decode
  496. */
  497. typedef struct
  498. {
  499. unsigned int size;
  500. void *session;
  501. } XVBA_Decode_Picture_End_Input;
  502. Status
  503. XVBAEndDecodePicture (
  504. XVBA_Decode_Picture_End_Input *decode_picture_end_input
  505. );
  506. /******************************************************************/
  507. /* XVBA Decode Data buffers */
  508. /******************************************************************/
  509. /*
  510. * XVBA compressed data type: XVBA_PICTURE_DESCRIPTOR_BUFFER
  511. */
  512. typedef struct
  513. {
  514. //VC-1, MPEG2 bitstream references
  515. void *past_surface;
  516. void *future_surface;
  517. unsigned int profile;
  518. unsigned int level;
  519. unsigned int width_in_mb;
  520. unsigned int height_in_mb;
  521. unsigned int picture_structure;
  522. union {
  523. struct {
  524. unsigned int residual_colour_transform_flag : 1;
  525. unsigned int delta_pic_always_zero_flag : 1;
  526. unsigned int gaps_in_frame_num_value_allowed_flag: 1;
  527. unsigned int frame_mbs_only_flag : 1;
  528. unsigned int mb_adaptive_frame_field_flag : 1;
  529. unsigned int direct_8x8_inference_flag : 1;
  530. unsigned int xvba_avc_sps_reserved : 26;
  531. } avc;
  532. struct {
  533. unsigned int postprocflag : 1;
  534. unsigned int pulldown : 1;
  535. unsigned int interlace : 1;
  536. unsigned int tfcntrflag : 1;
  537. unsigned int finterpflag : 1;
  538. unsigned int reserved : 1;
  539. unsigned int psf : 1;
  540. unsigned int second_field : 1;
  541. unsigned int xvba_vc1_sps_reserved : 24;
  542. } vc1;
  543. unsigned int flags;
  544. } sps_info;
  545. unsigned char chroma_format;
  546. unsigned char avc_bit_depth_luma_minus8;
  547. unsigned char avc_bit_depth_chroma_minus8;
  548. unsigned char avc_log2_max_frame_num_minus4;
  549. unsigned char avc_pic_order_cnt_type;
  550. unsigned char avc_log2_max_pic_order_cnt_lsb_minus4;
  551. unsigned char avc_num_ref_frames;
  552. unsigned char avc_reserved_8bit;
  553. union {
  554. struct {
  555. unsigned int entropy_coding_mode_flag : 1;
  556. unsigned int pic_order_present_flag : 1;
  557. unsigned int weighted_pred_flag : 1;
  558. unsigned int weighted_bipred_idc : 2;
  559. unsigned int deblocking_filter_control_present_flag : 1;
  560. unsigned int constrained_intra_pred_flag : 1;
  561. unsigned int redundant_pic_cnt_present_flag : 1;
  562. unsigned int transform_8x8_mode_flag : 1;
  563. unsigned int xvba_avc_pps_reserved : 23;
  564. } avc;
  565. struct {
  566. unsigned int panscan_flag : 1;
  567. unsigned int refdist_flag : 1;
  568. unsigned int loopfilter : 1;
  569. unsigned int fastuvmc : 1;
  570. unsigned int extended_mv : 1;
  571. unsigned int dquant : 2;
  572. unsigned int vstransform : 1;
  573. unsigned int overlap : 1;
  574. unsigned int quantizer : 2;
  575. unsigned int extended_dmv : 1;
  576. unsigned int maxbframes : 3;
  577. unsigned int rangered : 1;
  578. unsigned int syncmarker : 1;
  579. unsigned int multires : 1;
  580. unsigned int reserved : 2;
  581. unsigned int range_mapy_flag : 1;
  582. unsigned int range_mapy : 3;
  583. unsigned int range_mapuv_flag : 1;
  584. unsigned int range_mapuv : 3;
  585. unsigned int xvba_vc1_pps_reserved: 4;
  586. } vc1;
  587. unsigned int flags;
  588. } pps_info;
  589. unsigned char avc_num_slice_groups_minus1;
  590. unsigned char avc_slice_group_map_type;
  591. unsigned char avc_num_ref_idx_l0_active_minus1;
  592. unsigned char avc_num_ref_idx_l1_active_minus1;
  593. char avc_pic_init_qp_minus26;
  594. char avc_pic_init_qs_minus26;
  595. char avc_chroma_qp_index_offset;
  596. char avc_second_chroma_qp_index_offset;
  597. unsigned short avc_slice_group_change_rate_minus1;
  598. unsigned short avc_reserved_16bit;
  599. unsigned int avc_frame_num;
  600. unsigned int avc_frame_num_list[16]; ///< bit 31 is used to indicate long/short term
  601. int avc_curr_field_order_cnt_list[2];
  602. int avc_field_order_cnt_list[16][2];
  603. unsigned char avc_slice_group_map[810];
  604. int avc_intra_flag;
  605. int avc_reference;
  606. int xvba_reserved[14];
  607. } XVBAPictureDescriptor;
  608. /**
  609. * XVBA Compressed data type: XVBA_DATA_CTRL_BUFFER
  610. * (H264 and VC1 only)
  611. */
  612. typedef struct
  613. {
  614. unsigned int SliceBitsInBuffer;
  615. unsigned int SliceDataLocation;
  616. unsigned int SliceBytesInBuffer;
  617. unsigned int reserved[5];
  618. } XVBADataCtrl;
  619. /**
  620. * XVBA Compressed data type: XVBA_DATA_BUFFER
  621. * (MPEG2 iDCT level decode only)
  622. */
  623. typedef struct
  624. {
  625. struct
  626. {
  627. unsigned short index: 15; ///< contains rates scan index of the coefficient within the block.
  628. ///< cannot be greater or equal to (block width * block height)
  629. unsigned short endofblock: 1;
  630. } idx;
  631. short coeff; ///< value of the coefficient in the block; mismatch control and
  632. ///< clipping is host.s responsibility
  633. } XVBAMpeg2Residual;
  634. typedef struct
  635. {
  636. short horizontal;
  637. short vertical;
  638. } XVBAMpeg2MV;
  639. typedef struct
  640. {
  641. unsigned short mb_address;
  642. struct
  643. {
  644. unsigned short mb_intra : 1;
  645. unsigned short motion_fw : 1;
  646. unsigned short motion_back : 1;
  647. unsigned short reserved2 : 2;
  648. unsigned short field_residual : 1;
  649. unsigned short mb_scan_mode : 2;
  650. unsigned short motion_type : 2;
  651. unsigned short reserved1 : 2;
  652. unsigned short motion_vector_sel0 : 1;
  653. unsigned short motion_vector_sel1 : 1;
  654. unsigned short motion_vector_sel2 : 1;
  655. unsigned short motion_vector_sel3 : 1;
  656. } mpeg2data1;
  657. struct
  658. {
  659. unsigned int mb_data_resid_location : 24;
  660. unsigned int skipped_mb : 8;
  661. } mpeg2data2;
  662. unsigned short pattern_code;
  663. unsigned char numcoeff[6];
  664. } XVBAMpeg2IntraMB;
  665. typedef struct
  666. {
  667. unsigned short mb_address;
  668. struct
  669. {
  670. unsigned short mb_intra : 1;
  671. unsigned short motion_fw : 1;
  672. unsigned short motion_back : 1;
  673. unsigned short reserved2 : 2;
  674. unsigned short field_residual : 1;
  675. unsigned short mb_scan_mode : 2;
  676. unsigned short motion_type : 2;
  677. unsigned short reserved1 : 2;
  678. unsigned short motion_vector_sel0 : 1;
  679. unsigned short motion_vector_sel1 : 1;
  680. unsigned short motion_vector_sel2 : 1;
  681. unsigned short motion_vector_sel3 : 1;
  682. } mpeg2data1;
  683. struct
  684. {
  685. unsigned int mb_data_resid_location : 24;
  686. unsigned int skipped_mb : 8;
  687. } mpeg2data2;
  688. unsigned short pattern_code;
  689. unsigned char numcoeff[6];
  690. XVBAMpeg2MV motion_vector[4];
  691. } XVBAMpeg2NonIntraMB;
  692. /**
  693. * XVBA compressed data type: XVBA_QM_BUFFER
  694. * (H264 and VC1 only)
  695. */
  696. typedef struct
  697. {
  698. unsigned char bScalingLists4x4[6][16];
  699. unsigned char bScalingLists8x8[2][64];
  700. } XVBAQuantMatrixAvc;
  701. #ifdef __cplusplus
  702. }
  703. #endif
  704. #endif //_XVBA_H