Counter Strike : Global Offensive Source Code
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.

1429 lines
51 KiB

  1. //------------------------------------------------------------------------------
  2. // File: DXVA.h
  3. //
  4. // Desc: DirectX Video Acceleration header file.
  5. //
  6. // Copyright (c) 1999 - 2002, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. #ifndef __DIRECTX_VA__
  9. #define __DIRECTX_VA__
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #ifdef __DIRECTX_VA_COPP_ONLY
  14. #define __DIRECTX_VA_DECODER__
  15. #define __DIRECTX_VA_PROCAMPCONTROL__
  16. #define __DIRECTX_VA_DEINTERLACE__
  17. #endif
  18. #ifndef DXVABit
  19. #define DXVABit(__x) (1 << __x)
  20. #endif
  21. // -------------------------------------------------------------------------
  22. //
  23. // The definitions that follow describe the DirectX Video Acceleration
  24. // decoding interface.
  25. // This interface is accessable via the IAMVideoAccelerator interface.
  26. //
  27. // -------------------------------------------------------------------------
  28. //
  29. #ifndef __DIRECTX_VA_DECODER__
  30. #define __DIRECTX_VA_DECODER__
  31. DEFINE_GUID(DXVA_ModeNone, 0x1b81be00, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  32. DEFINE_GUID(DXVA_ModeH261_A, 0x1b81be01, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  33. DEFINE_GUID(DXVA_ModeH261_B, 0x1b81be02, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  34. DEFINE_GUID(DXVA_ModeH263_A, 0x1b81be03, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  35. DEFINE_GUID(DXVA_ModeH263_B, 0x1b81be04, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  36. DEFINE_GUID(DXVA_ModeH263_C, 0x1b81be05, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  37. DEFINE_GUID(DXVA_ModeH263_D, 0x1b81be06, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  38. DEFINE_GUID(DXVA_ModeH263_E, 0x1b81be07, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  39. DEFINE_GUID(DXVA_ModeH263_F, 0x1b81be08, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  40. DEFINE_GUID(DXVA_ModeMPEG1_A, 0x1b81be09, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  41. DEFINE_GUID(DXVA_ModeMPEG2_A, 0x1b81be0A, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  42. DEFINE_GUID(DXVA_ModeMPEG2_B, 0x1b81be0B, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  43. DEFINE_GUID(DXVA_ModeMPEG2_C, 0x1b81be0C, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  44. DEFINE_GUID(DXVA_ModeMPEG2_D, 0x1b81be0D, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  45. DEFINE_GUID(DXVA_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  46. DEFINE_GUID(DXVA_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  47. DEFINE_GUID(DXVA_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  48. DEFINE_GUID(DXVA_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  49. DEFINE_GUID(DXVA_ModeWMV9_Ai, 0x1b81be92, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  50. DEFINE_GUID(DXVA_ModeWMV9_Bi, 0x1b81be93, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  51. DEFINE_GUID(DXVA_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  52. DEFINE_GUID(DXVA_ModeWMVA_A, 0x1b81be96, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  53. DEFINE_GUID(DXVA_ModeWMVA_B, 0x1b81be97, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  54. DEFINE_GUID(DXVA_ModeWMVA_C, 0x1b81be98, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  55. DEFINE_GUID(DXVA_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  56. #define DXVA_RESTRICTED_MODE_UNRESTRICTED 0xFFFF
  57. #define DXVA_RESTRICTED_MODE_H261_A 1
  58. #define DXVA_RESTRICTED_MODE_H261_B 2
  59. #define DXVA_RESTRICTED_MODE_H263_A 3
  60. #define DXVA_RESTRICTED_MODE_H263_B 4
  61. #define DXVA_RESTRICTED_MODE_H263_C 5
  62. #define DXVA_RESTRICTED_MODE_H263_D 6
  63. #define DXVA_RESTRICTED_MODE_H263_E 7
  64. #define DXVA_RESTRICTED_MODE_H263_F 8
  65. #define DXVA_RESTRICTED_MODE_MPEG1_A 9
  66. #define DXVA_RESTRICTED_MODE_MPEG2_A 0xA
  67. #define DXVA_RESTRICTED_MODE_MPEG2_B 0xB
  68. #define DXVA_RESTRICTED_MODE_MPEG2_C 0xC
  69. #define DXVA_RESTRICTED_MODE_MPEG2_D 0xD
  70. #define DXVA_RESTRICTED_MODE_WMV8_A 0x80
  71. #define DXVA_RESTRICTED_MODE_WMV8_B 0x81
  72. #define DXVA_RESTRICTED_MODE_WMV9_A 0x90
  73. #define DXVA_RESTRICTED_MODE_WMV9_B 0x91
  74. #define DXVA_RESTRICTED_MODE_WMV9_Ai 0x92
  75. #define DXVA_RESTRICTED_MODE_WMV9_Bi 0x93
  76. #define DXVA_RESTRICTED_MODE_WMV9_C 0x94
  77. #define DXVA_RESTRICTED_MODE_WMVA_A 0x96
  78. #define DXVA_RESTRICTED_MODE_WMVA_B 0x97
  79. #define DXVA_RESTRICTED_MODE_WMVA_C 0x98
  80. #define DXVA_COMPBUFFER_TYPE_THAT_IS_NOT_USED 0
  81. #define DXVA_PICTURE_DECODE_BUFFER 1
  82. #define DXVA_MACROBLOCK_CONTROL_BUFFER 2
  83. #define DXVA_RESIDUAL_DIFFERENCE_BUFFER 3
  84. #define DXVA_DEBLOCKING_CONTROL_BUFFER 4
  85. #define DXVA_INVERSE_QUANTIZATION_MATRIX_BUFFER 5
  86. #define DXVA_SLICE_CONTROL_BUFFER 6
  87. #define DXVA_BITSTREAM_DATA_BUFFER 7
  88. #define DXVA_AYUV_BUFFER 8
  89. #define DXVA_IA44_SURFACE_BUFFER 9
  90. #define DXVA_DPXD_SURFACE_BUFFER 10
  91. #define DXVA_HIGHLIGHT_BUFFER 11
  92. #define DXVA_DCCMD_SURFACE_BUFFER 12
  93. #define DXVA_ALPHA_BLEND_COMBINATION_BUFFER 13
  94. #define DXVA_PICTURE_RESAMPLE_BUFFER 14
  95. #define DXVA_READ_BACK_BUFFER 15
  96. #define DXVA_NUM_TYPES_COMP_BUFFERS 16
  97. /* values for bDXVA_Func */
  98. #define DXVA_PICTURE_DECODING_FUNCTION 1
  99. #define DXVA_ALPHA_BLEND_DATA_LOAD_FUNCTION 2
  100. #define DXVA_ALPHA_BLEND_COMBINATION_FUNCTION 3
  101. #define DXVA_PICTURE_RESAMPLE_FUNCTION 4
  102. /* values returned from Execute command in absence of read-back */
  103. #define DXVA_EXECUTE_RETURN_OK 0
  104. #define DXVA_EXECUTE_RETURN_DATA_ERROR_MINOR 1
  105. #define DXVA_EXECUTE_RETURN_DATA_ERROR_SIGNIF 2
  106. #define DXVA_EXECUTE_RETURN_DATA_ERROR_SEVERE 3
  107. #define DXVA_EXECUTE_RETURN_OTHER_ERROR_SEVERE 4
  108. #pragma pack(push, BeforeDXVApacking, 1)
  109. typedef struct _DXVA_ConnectMode {
  110. GUID guidMode;
  111. WORD wRestrictedMode;
  112. } DXVA_ConnectMode, *LPDXVA_ConnectMode;
  113. typedef DWORD DXVA_ConfigQueryOrReplyFunc, *LPDXVA_ConfigQueryOrReplyFunc;
  114. #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY 0xFFFFF1
  115. #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY 0xFFFFF5
  116. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_COPY 0xFFFFF8
  117. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_PLUS 0xFFFFF9
  118. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_OK_COPY 0xFFFFFC
  119. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_FALSE_PLUS 0xFFFFFB
  120. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_FALSE_PLUS 0xFFFFFF
  121. #define readDXVA_QueryOrReplyFuncFlag(ptr) ((*(ptr)) >> 8)
  122. #define readDXVA_QueryOrReplyFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1)
  123. #define readDXVA_QueryOrReplyFuncFlag_LOCK(ptr) (((*(ptr)) >> 10) & 1)
  124. #define readDXVA_QueryOrReplyFuncFlag_BAD(ptr) (((*(ptr)) >> 9) & 1)
  125. #define readDXVA_QueryOrReplyFuncFlag_PLUS(ptr) (((*(ptr)) >> 8) & 1)
  126. #define readDXVA_QueryOrReplyFuncFunc(ptr) ((*(ptr)) & 0xFF)
  127. #define writeDXVA_QueryOrReplyFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
  128. #define setDXVA_QueryOrReplyFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
  129. #define setDXVA_QueryOrReplyFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
  130. typedef DWORD DXVA_EncryptProtocolFunc, *LPDXVA_EncryptProtocolFunc;
  131. #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_HOST 0xFFFF00
  132. #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_ACCEL 0xFFFF08
  133. #define readDXVA_EncryptProtocolFuncFlag(ptr) ((*(ptr)) >> 8)
  134. #define readDXVA_EncryptProtocolFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1)
  135. #define readDXVA_EncryptProtocolFuncFunc(ptr) ((*(ptr)) & 0xFF)
  136. #define writeDXVA_EncryptProtocolFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
  137. #define setDXVA_EncryptProtocolFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
  138. #define setDXVA_EncryptProtocolFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
  139. typedef struct _DXVA_EncryptProtocolHeader {
  140. DXVA_EncryptProtocolFunc dwFunction;
  141. DWORD ReservedBits[3];
  142. GUID guidEncryptProtocol;
  143. } DXVA_EncryptProtocolHeader, *LPDXVA_EncryptProtocolHeader;
  144. typedef struct _DXVA_ConfigPictureDecode {
  145. // Operation Indicated
  146. DXVA_ConfigQueryOrReplyFunc dwFunction;
  147. // Alignment
  148. DWORD dwReservedBits[3];
  149. // Encryption GUIDs
  150. GUID guidConfigBitstreamEncryption;
  151. GUID guidConfigMBcontrolEncryption;
  152. GUID guidConfigResidDiffEncryption;
  153. // Bitstream Processing Indicator
  154. BYTE bConfigBitstreamRaw;
  155. // Macroblock Control Config
  156. BYTE bConfigMBcontrolRasterOrder;
  157. // Host Resid Diff Config
  158. BYTE bConfigResidDiffHost;
  159. BYTE bConfigSpatialResid8;
  160. BYTE bConfigResid8Subtraction;
  161. BYTE bConfigSpatialHost8or9Clipping;
  162. BYTE bConfigSpatialResidInterleaved;
  163. BYTE bConfigIntraResidUnsigned;
  164. // Accelerator Resid Diff Config
  165. BYTE bConfigResidDiffAccelerator;
  166. BYTE bConfigHostInverseScan;
  167. BYTE bConfigSpecificIDCT;
  168. BYTE bConfig4GroupedCoefs;
  169. } DXVA_ConfigPictureDecode, *LPDXVA_ConfigPictureDecode;
  170. /* Picture Decoding Parameters */
  171. typedef struct _DXVA_PictureParameters {
  172. WORD wDecodedPictureIndex;
  173. WORD wDeblockedPictureIndex;
  174. WORD wForwardRefPictureIndex;
  175. WORD wBackwardRefPictureIndex;
  176. WORD wPicWidthInMBminus1;
  177. WORD wPicHeightInMBminus1;
  178. BYTE bMacroblockWidthMinus1;
  179. BYTE bMacroblockHeightMinus1;
  180. BYTE bBlockWidthMinus1;
  181. BYTE bBlockHeightMinus1;
  182. BYTE bBPPminus1;
  183. BYTE bPicStructure;
  184. BYTE bSecondField;
  185. BYTE bPicIntra;
  186. BYTE bPicBackwardPrediction;
  187. BYTE bBidirectionalAveragingMode;
  188. BYTE bMVprecisionAndChromaRelation;
  189. BYTE bChromaFormat;
  190. BYTE bPicScanFixed;
  191. BYTE bPicScanMethod;
  192. BYTE bPicReadbackRequests;
  193. BYTE bRcontrol;
  194. BYTE bPicSpatialResid8;
  195. BYTE bPicOverflowBlocks;
  196. BYTE bPicExtrapolation;
  197. BYTE bPicDeblocked;
  198. BYTE bPicDeblockConfined;
  199. BYTE bPic4MVallowed;
  200. BYTE bPicOBMC;
  201. BYTE bPicBinPB;
  202. BYTE bMV_RPS;
  203. BYTE bReservedBits;
  204. WORD wBitstreamFcodes;
  205. WORD wBitstreamPCEelements;
  206. BYTE bBitstreamConcealmentNeed;
  207. BYTE bBitstreamConcealmentMethod;
  208. } DXVA_PictureParameters, *LPDXVA_PictureParameters;
  209. /* Picture Resampling */
  210. typedef struct _DXVA_PicResample {
  211. WORD wPicResampleSourcePicIndex;
  212. WORD wPicResampleDestPicIndex;
  213. WORD wPicResampleRcontrol;
  214. BYTE bPicResampleExtrapWidth;
  215. BYTE bPicResampleExtrapHeight;
  216. DWORD dwPicResampleSourceWidth;
  217. DWORD dwPicResampleSourceHeight;
  218. DWORD dwPicResampleDestWidth;
  219. DWORD dwPicResampleDestHeight;
  220. DWORD dwPicResampleFullDestWidth;
  221. DWORD dwPicResampleFullDestHeight;
  222. } DXVA_PicResample, *LPDXVA_PicResample;
  223. #define DXVA_CHROMA_FORMAT_420 1
  224. #define DXVA_CHROMA_FORMAT_422 2
  225. #define DXVA_CHROMA_FORMAT_444 3
  226. #define DXVA_PICTURE_STRUCTURE_TOP_FIELD 1
  227. #define DXVA_PICTURE_STRUCTURE_BOTTOM_FIELD 2
  228. #define DXVA_PICTURE_STRUCTURE_FRAME 3
  229. #define DXVA_BIDIRECTIONAL_AVERAGING_MPEG2_ROUND 0
  230. #define DXVA_BIDIRECTIONAL_AVERAGING_H263_TRUNC 1
  231. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_MPEG2 0
  232. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H263 1
  233. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H261 2
  234. #define DXVA_SCAN_METHOD_ZIG_ZAG 0
  235. #define DXVA_SCAN_METHOD_ALTERNATE_VERTICAL 1
  236. #define DXVA_SCAN_METHOD_ALTERNATE_HORIZONTAL 2
  237. #define DXVA_SCAN_METHOD_ARBITRARY 3
  238. #define DXVA_BITSTREAM_CONCEALMENT_NEED_UNLIKELY 0
  239. #define DXVA_BITSTREAM_CONCEALMENT_NEED_MILD 1
  240. #define DXVA_BITSTREAM_CONCEALMENT_NEED_LIKELY 2
  241. #define DXVA_BITSTREAM_CONCEALMENT_NEED_SEVERE 3
  242. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_UNSPECIFIED 0
  243. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_INTRA 1
  244. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_FORWARD 2
  245. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_BACKWARD 3
  246. /* Buffer Description Data */
  247. typedef struct _DXVA_BufferDescription {
  248. DWORD dwTypeIndex;
  249. DWORD dwBufferIndex;
  250. DWORD dwDataOffset;
  251. DWORD dwDataSize;
  252. DWORD dwFirstMBaddress;
  253. DWORD dwNumMBsInBuffer;
  254. DWORD dwWidth;
  255. DWORD dwHeight;
  256. DWORD dwStride;
  257. DWORD dwReservedBits;
  258. } DXVA_BufferDescription, *LPDXVA_BufferDescription;
  259. /* Off-Host IDCT Coefficient Data Structures */
  260. typedef struct _DXVA_TCoef4Group {
  261. BYTE TCoefIDX[4];
  262. SHORT TCoefValue[4];
  263. } DXVA_TCoef4Group, *LPDXVA_TCoef4Group;
  264. typedef struct _DXVA_TCoefSingle {
  265. WORD wIndexWithEOB;
  266. SHORT TCoefValue;
  267. } DXVA_TCoefSingle, *LPDXVA_TCoefSingle;
  268. /* Macros for Reading EOB and Index Values */
  269. #define readDXVA_TCoefSingleIDX(ptr) ((ptr)->wIndexWithEOB >> 1)
  270. #define readDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB & 1)
  271. /* Macro for Writing EOB and Index Values */
  272. #define writeDXVA_TCoefSingleIndexWithEOB(ptr, idx, eob) ((ptr)->wIndexWithEOB = ((idx) << 1) | (eob))
  273. #define setDXVA_TCoefSingleIDX(ptr, idx) ((ptr)->wIndexWithEOB |= ((idx) << 1))
  274. #define setDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB |= 1)
  275. /* Spatial-Domain Residual Difference Blocks */
  276. #define DXVA_USUAL_BLOCK_WIDTH 8
  277. #define DXVA_USUAL_BLOCK_HEIGHT 8
  278. #define DXVA_USUAL_BLOCK_SIZE (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT)
  279. typedef SHORT DXVA_Sample16[DXVA_USUAL_BLOCK_SIZE];
  280. typedef signed char DXVA_Sample8 [DXVA_USUAL_BLOCK_SIZE];
  281. /* Deblocking Filter Control Structure */
  282. typedef BYTE DXVA_DeblockingEdgeControl;
  283. typedef DXVA_DeblockingEdgeControl * LPDXVA_DeblockingEdgeControl;
  284. /* Macros for Reading STRENGTH and FilterOn */
  285. #define readDXVA_EdgeFilterStrength(ptr) ((*(ptr)) >> 1)
  286. #define readDXVA_EdgeFilterOn(ptr) ((*(ptr)) & 1)
  287. /* Macro for Writing STRENGTH and FilterOn */
  288. #define writeDXVA_DeblockingEdgeControl(ptr, str, fon) ((*(ptr)) = ((str) << 1) | (fon))
  289. #define setDXVA_EdgeFilterStrength(ptr, str) ((*(ptr)) |= ((str) << 1))
  290. #define setDXVA_EdgeFilterOn(ptr) ((*(ptr)) |= 1)
  291. /* Macroblock Control Command Data Structures */
  292. typedef struct _DXVA_MVvalue {
  293. SHORT horz, vert;
  294. } DXVA_MVvalue, *LPDXVA_MVvalue;
  295. /* Inverse Quantization Matrices */
  296. typedef struct _DXVA_QmatrixData {
  297. BYTE bNewQmatrix[4]; /* intra Y, inter Y, intra chroma, inter chroma */
  298. WORD Qmatrix[4][DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT];
  299. } DXVA_QmatrixData, *LPDXVA_QmatrixData;
  300. /* Slice Control Buffer Data */
  301. typedef struct _DXVA_SliceInfo {
  302. WORD wHorizontalPosition;
  303. WORD wVerticalPosition;
  304. DWORD dwSliceBitsInBuffer;
  305. DWORD dwSliceDataLocation;
  306. BYTE bStartCodeBitOffset;
  307. BYTE bReservedBits;
  308. WORD wMBbitOffset;
  309. WORD wNumberMBsInSlice;
  310. WORD wQuantizerScaleCode;
  311. WORD wBadSliceChopping;
  312. } DXVA_SliceInfo, *LPDXVA_SliceInfo;
  313. #define DXVA_NumMV_OBMC_off_BinPBwith4MV_off 4
  314. #define DXVA_NumMV_OBMC_off_BinPBwith4MV_on (4+1)
  315. #define DXVA_NumMV_OBMC_on__BinPB_off (10)
  316. #define DXVA_NumMV_OBMC_on__BinPB_on (11) /* not current standards */
  317. #define DXVA_NumBlocksPerMB_420 (4+2+0)
  318. #define DXVA_NumBlocksPerMB_422 (4+2+2)
  319. #define DXVA_NumBlocksPerMB_444 (4+4+4)
  320. /* Basic form for I pictures */
  321. /* Host Residual Differences */
  322. typedef struct _DXVA_MBctrl_I_HostResidDiff_1 {
  323. WORD wMBaddress;
  324. WORD wMBtype;
  325. DWORD dwMB_SNL;
  326. WORD wPatternCode;
  327. WORD wPC_Overflow; /* zero if not overflow format */
  328. DWORD dwReservedBits2;
  329. } DXVA_MBctrl_I_HostResidDiff_1;
  330. /* Basic form for I pictures */
  331. /* Off-Host IDCT, 4:2:0 sampling */
  332. typedef struct _DXVA_MBctrl_I_OffHostIDCT_1 {
  333. WORD wMBaddress;
  334. WORD wMBtype;
  335. DWORD dwMB_SNL;
  336. WORD wPatternCode;
  337. BYTE bNumCoef[DXVA_NumBlocksPerMB_420];
  338. } DXVA_MBctrl_I_OffHostIDCT_1;
  339. /* Basic form for P and B pictures */
  340. /* Should also be used for concealment MVs in MPEG-2 I pictures */
  341. /* Without OBMC, without BinPB and 4MV together, without MV RPS */
  342. /* Host Residual Differences */
  343. typedef struct _DXVA_MBctrl_P_HostResidDiff_1 {
  344. WORD wMBaddress;
  345. WORD wMBtype;
  346. DWORD dwMB_SNL;
  347. WORD wPatternCode;
  348. WORD wPC_Overflow; /* zero if not overflow format */
  349. DWORD dwReservedBits2;
  350. DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
  351. } DXVA_MBctrl_P_HostResidDiff_1;
  352. /* Basic form for P and B pictures */
  353. /* Without OBMC, without BinPB and 4MV together, without MV RPS */
  354. /* Off-Host IDCT, 4:2:0 sampling */
  355. typedef struct _DXVA_MBctrl_P_OffHostIDCT_1 {
  356. WORD wMBaddress;
  357. WORD wMBtype;
  358. DWORD dwMB_SNL;
  359. WORD wPatternCode;
  360. BYTE bNumCoef[DXVA_NumBlocksPerMB_420];
  361. DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
  362. } DXVA_MBctrl_P_OffHostIDCT_1;
  363. /* How to load alpha blending graphic data */
  364. typedef struct _DXVA_ConfigAlphaLoad {
  365. // Operation Indicated
  366. DXVA_ConfigQueryOrReplyFunc dwFunction;
  367. // Alignment
  368. DWORD dwReservedBits[3];
  369. BYTE bConfigDataType;
  370. } DXVA_ConfigAlphaLoad, *LPDXVA_ConfigAlphaLoad;
  371. #define DXVA_CONFIG_DATA_TYPE_IA44 0
  372. #define DXVA_CONFIG_DATA_TYPE_AI44 1
  373. #define DXVA_CONFIG_DATA_TYPE_DPXD 2
  374. #define DXVA_CONFIG_DATA_TYPE_AYUV 3
  375. /* How to combine alpha blending graphic data */
  376. typedef struct _DXVA_ConfigAlphaCombine {
  377. // Operation Indicated
  378. DXVA_ConfigQueryOrReplyFunc dwFunction;
  379. // Alignment
  380. DWORD dwReservedBits[3];
  381. BYTE bConfigBlendType;
  382. BYTE bConfigPictureResizing;
  383. BYTE bConfigOnlyUsePicDestRectArea;
  384. BYTE bConfigGraphicResizing;
  385. BYTE bConfigWholePlaneAlpha;
  386. } DXVA_ConfigAlphaCombine, *LPDXVA_ConfigAlphaCombine;
  387. #define DXVA_CONFIG_BLEND_TYPE_FRONT_BUFFER 0
  388. #define DXVA_CONFIG_BLEND_TYPE_BACK_HARDWARE 1
  389. /* AYUV sample for 16-entry YUV palette or graphic surface */
  390. typedef struct _DXVA_AYUVsample2 {
  391. BYTE bCrValue;
  392. BYTE bCbValue;
  393. BYTE bY_Value;
  394. BYTE bSampleAlpha8;
  395. } DXVA_AYUVsample2, *LPDXVA_AYUVsample2;
  396. /* Macros for IA44 alpha blending surface samples */
  397. typedef BYTE DXVA_IA44sample, *LPDXVA_IA44sample;
  398. #define readDXVA_IA44index(ptr) (((*(ptr)) & 0xF0) >> 4)
  399. #define readDXVA_IA44alpha(ptr) ((*(ptr)) & 0x0F)
  400. #define writeDXVA_IA44(ptr, idx, alpha) ((*(ptr)) = (((idx) << 4) | (alpha)))
  401. #define setDXVA_IA44index(ptr, idx) ((*(ptr)) |= ((idx) << 4))
  402. #define setDXVA_IA44alpha(ptr, alpha) ((*(ptr)) |= (alpha))
  403. /* Macros for AI44 alpha blending surface samples */
  404. typedef BYTE DXVA_AI44sample, *LPDXVA_AI44sample;
  405. #define readDXVA_AI44index(ptr) ((*(ptr)) & 0x0F)
  406. #define readDXVA_AI44alpha(ptr) (((*(ptr)) & 0xF0) >> 4)
  407. #define writeDXVA_AI44(ptr, idx, alpha) ((*(ptr)) = (((alpha) << 4) | (idx)))
  408. #define setDXVA_AI44index(ptr, idx) ((*(ptr)) |= (idx))
  409. #define setDXVA_AI44alpha(ptr, alpha) ((*(ptr)) |= ((alpha) << 4))
  410. /* Highlight data structure */
  411. typedef struct _DXVA_Highlight {
  412. WORD wHighlightActive;
  413. WORD wHighlightIndices;
  414. WORD wHighlightAlphas;
  415. RECT HighlightRect;
  416. } DXVA_Highlight, *LPDXVA_Highlight;
  417. typedef BYTE DXVA_DPXD, *LPDXVA_DPXD;
  418. typedef WORD DXVA_DCCMD, *LPDXVA_DCCMD;
  419. /* Alpha blend combination */
  420. typedef struct _DXVA_BlendCombination {
  421. WORD wPictureSourceIndex;
  422. WORD wBlendedDestinationIndex;
  423. RECT PictureSourceRect16thPel;
  424. RECT PictureDestinationRect;
  425. RECT GraphicSourceRect;
  426. RECT GraphicDestinationRect;
  427. WORD wBlendDelay;
  428. BYTE bBlendOn;
  429. BYTE bWholePlaneAlpha;
  430. DXVA_AYUVsample2 OutsideYUVcolor;
  431. } DXVA_BlendCombination, *LPDXVA_BlendCombination;
  432. #pragma pack(push, 16)
  433. typedef DXVA_MBctrl_I_HostResidDiff_1 *
  434. LPDXVA_MBctrl_I_HostResidDiff_1;
  435. typedef DXVA_MBctrl_I_OffHostIDCT_1 *
  436. LPDXVA_MBctrl_I_OffHostIDCT_1;
  437. typedef DXVA_MBctrl_P_HostResidDiff_1 *
  438. LPDXVA_MBctrl_P_HostResidDiff_1;
  439. typedef DXVA_MBctrl_P_OffHostIDCT_1 *
  440. LPDXVA_MBctrl_P_OffHostIDCT_1;
  441. #pragma pack(pop)
  442. /*
  443. * Other forms of pictures are constructed in the obvious way
  444. * from the above by adjusting the number of residual difference
  445. * blocks, the number of motion vectors per macroblock, etc.
  446. */
  447. #define readDXVA_MBskipsFollowing(ptr) (((ptr)->dwMB_SNL & 0xFF000000) >> 24)
  448. #define readDXVA_MBdataLocation(ptr) (((ptr)->dwMB_SNL & 0x00FFFFFF))
  449. #define writeDXVA_MB_SNL(ptr, skips, dloc) ((ptr)->dwMB_SNL = (((skips) << 24) | (dloc)))
  450. #define setDXVA_MBskipsFollowing(ptr, skips) ((ptr)->dwMB_SNL |= ((skips) << 24))
  451. #define setDXVA_MBdataLocation(ptr, dloc) ((ptr)->dwMB_SNL |= (dloc))
  452. #define readDXVA_MvertFieldSel_3(ptr) (((ptr)->wMBtype & 0x8000) >> 15)
  453. #define readDXVA_MvertFieldSel_2(ptr) (((ptr)->wMBtype & 0x4000) >> 14)
  454. #define readDXVA_MvertFieldSel_1(ptr) (((ptr)->wMBtype & 0x2000) >> 13)
  455. #define readDXVA_MvertFieldSel_0(ptr) (((ptr)->wMBtype & 0x1000) >> 12)
  456. #define readDXVA_ReservedBits(ptr) (((ptr)->wMBtype & 0x0800) >> 11)
  457. #define readDXVA_HostResidDiff(ptr) (((ptr)->wMBtype & 0x0400) >> 10)
  458. #define readDXVA_MotionType(ptr) (((ptr)->wMBtype & 0x0300) >> 8)
  459. #define readDXVA_MBscanMethod(ptr) (((ptr)->wMBtype & 0x00C0) >> 6)
  460. #define readDXVA_FieldResidual(ptr) (((ptr)->wMBtype & 0x0020) >> 5)
  461. #define readDXVA_H261LoopFilter(ptr) (((ptr)->wMBtype & 0x0010) >> 4)
  462. #define readDXVA_Motion4MV(ptr) (((ptr)->wMBtype & 0x0008) >> 3)
  463. #define readDXVA_MotionBackward(ptr) (((ptr)->wMBtype & 0x0004) >> 2)
  464. #define readDXVA_MotionForward(ptr) (((ptr)->wMBtype & 0x0002) >> 1)
  465. #define readDXVA_IntraMacroblock(ptr) (((ptr)->wMBtype & 0x0001))
  466. #define setDXVA_MvertFieldSel_3(ptr) ((ptr)->wMBtype |= 0x8000)
  467. #define setDXVA_MvertFieldSel_2(ptr) ((ptr)->wMBtype |= 0x4000)
  468. #define setDXVA_MvertFieldSel_1(ptr) ((ptr)->wMBtype |= 0x2000)
  469. #define setDXVA_MvertFieldSel_0(ptr) ((ptr)->wMBtype |= 0x1000)
  470. #define setDXVA_ReservedBits(ptr) ((ptr)->wMBtype |= 0x0800)
  471. #define setDXVA_HostResidDiff(ptr) ((ptr)->wMBtype |= 0x0400)
  472. #define setDXVA_MotionType(ptr, value) ((ptr)->wMBtype |= ((value) << 8))
  473. #define setDXVA_MBscanMethod(ptr, value) ((ptr)->wMBtype |= ((value) << 6))
  474. #define setDXVA_FieldResidual(ptr) ((ptr)->wMBtype |= 0x0020)
  475. #define setDXVA_H261LoopFilter(ptr) ((ptr)->wMBtype |= 0x0010)
  476. #define setDXVA_Motion4MV(ptr) ((ptr)->wMBtype |= 0x0008)
  477. #define setDXVA_MotionBackward(ptr) ((ptr)->wMBtype |= 0x0004)
  478. #define setDXVA_MotionForward(ptr) ((ptr)->wMBtype |= 0x0002)
  479. #define setDXVA_IntraMacroblock(ptr) ((ptr)->wMBtype |= 0x0001)
  480. #define readDXVA_Y___0coded(ptr) (((ptr)->wPatternCode & 0x0800) >> 11)
  481. #define readDXVA_Y___1coded(ptr) (((ptr)->wPatternCode & 0x0400) >> 10)
  482. #define readDXVA_Y___2coded(ptr) (((ptr)->wPatternCode & 0x0200) >> 9)
  483. #define readDXVA_Y___3coded(ptr) (((ptr)->wPatternCode & 0x0100) >> 8)
  484. #define readDXVA_Cb__4coded(ptr) (((ptr)->wPatternCode & 0x0080) >> 7)
  485. #define readDXVA_Cr__5coded(ptr) (((ptr)->wPatternCode & 0x0040) >> 6)
  486. #define readDXVA_Cb__6coded(ptr) (((ptr)->wPatternCode & 0x0020) >> 5)
  487. #define readDXVA_Cr__7coded(ptr) (((ptr)->wPatternCode & 0x0010) >> 4)
  488. #define readDXVA_Cb__8coded(ptr) (((ptr)->wPatternCode & 0x0008) >> 3)
  489. #define readDXVA_Cb__9coded(ptr) (((ptr)->wPatternCode & 0x0004) >> 2)
  490. #define readDXVA_Cr_10coded(ptr) (((ptr)->wPatternCode & 0x0002) >> 1)
  491. #define readDXVA_Cr_11coded(ptr) (((ptr)->wPatternCode & 0x0001))
  492. #define readDXVA_Y___0oflow(ptr) (((ptr)->wPC_Overflow & 0x0800) >> 11)
  493. #define readDXVA_Y___1oflow(ptr) (((ptr)->wPC_Overflow & 0x0400) >> 10)
  494. #define readDXVA_Y___2oflow(ptr) (((ptr)->wPC_Overflow & 0x0200) >> 9)
  495. #define readDXVA_Y___3oflow(ptr) (((ptr)->wPC_Overflow & 0x0100) >> 8)
  496. #define readDXVA_Cb__4oflow(ptr) (((ptr)->wPC_Overflow & 0x0080) >> 7)
  497. #define readDXVA_Cr__5oflow(ptr) (((ptr)->wPC_Overflow & 0x0040) >> 6)
  498. #define readDXVA_Cb__6oflow(ptr) (((ptr)->wPC_Overflow & 0x0020) >> 5)
  499. #define readDXVA_Cr__7oflow(ptr) (((ptr)->wPC_Overflow & 0x0010) >> 4)
  500. #define readDXVA_Cb__8oflow(ptr) (((ptr)->wPC_Overflow & 0x0008) >> 3)
  501. #define readDXVA_Cb__9oflow(ptr) (((ptr)->wPC_Overflow & 0x0004) >> 2)
  502. #define readDXVA_Cr_10oflow(ptr) (((ptr)->wPC_Overflow & 0x0002) >> 1)
  503. #define readDXVA_Cr_11oflow(ptr) (((ptr)->wPC_Overflow & 0x0001))
  504. #pragma pack(pop, BeforeDXVApacking)
  505. #endif /* __DIRECTX_VA_DECODER__ */
  506. // -------------------------------------------------------------------------
  507. //
  508. // D3DFORMAT describes a pixel memory layout, DXVA sample format contains
  509. // additional information that describes how the pixels should be interpreted.
  510. //
  511. // DXVA Extended color data - occupies the SampleFormat DWORD
  512. // data fields.
  513. // -------------------------------------------------------------------------
  514. #ifndef __DIRECTX_VA_SAMPLEFORMAT__
  515. #define __DIRECTX_VA_SAMPLEFORMAT__
  516. typedef enum _DXVA_SampleFormat {
  517. DXVA_SampleFormatMask = 0xFF, // 8 bits used for DXVA Sample format
  518. DXVA_SampleUnknown = 0,
  519. DXVA_SamplePreviousFrame = 1,
  520. DXVA_SampleProgressiveFrame = 2,
  521. DXVA_SampleFieldInterleavedEvenFirst = 3,
  522. DXVA_SampleFieldInterleavedOddFirst = 4,
  523. DXVA_SampleFieldSingleEven = 5,
  524. DXVA_SampleFieldSingleOdd = 6,
  525. DXVA_SampleSubStream = 7
  526. } DXVA_SampleFormat;
  527. #define DXVA_ExtractSampleFormat(_sf) ((_sf) & (DXVA_SampleFormatMask))
  528. #define DXVA_ExtractExtColorData(_sf, _Mask, _Shift) \
  529. (((_sf) >> (_Shift)) & (_Mask))
  530. #define DXVABitMask(__n) (~((~0) << __n))
  531. #define DXVA_ExtColorData_ShiftBase 8
  532. #define DXVAColorMask(__bits,__base) (DXVABitMask(__bits) << ( __base - DXVA_ExtColorData_ShiftBase))
  533. typedef enum _DXVA_VideoTransferFunction
  534. {
  535. DXVA_VideoTransFuncShift = (DXVA_ExtColorData_ShiftBase + 19),
  536. DXVA_VideoTransFuncMask = DXVAColorMask(5, DXVA_VideoTransFuncShift),
  537. DXVA_VideoTransFunc_Unknown = 0,
  538. DXVA_VideoTransFunc_10 = 1,
  539. DXVA_VideoTransFunc_18 = 2,
  540. DXVA_VideoTransFunc_20 = 3,
  541. DXVA_VideoTransFunc_22 = 4,
  542. DXVA_VideoTransFunc_22_709 = 5,
  543. DXVA_VideoTransFunc_22_240M = 6,
  544. DXVA_VideoTransFunc_22_8bit_sRGB = 7,
  545. DXVA_VideoTransFunc_28 = 8
  546. } DXVA_VideoTransferFunction;
  547. typedef enum _DXVA_VideoPrimaries
  548. {
  549. DXVA_VideoPrimariesShift = (DXVA_ExtColorData_ShiftBase + 14),
  550. DXVA_VideoPrimariesMask = DXVAColorMask(5, DXVA_VideoPrimariesShift),
  551. DXVA_VideoPrimaries_Unknown = 0,
  552. DXVA_VideoPrimaries_reserved = 1,
  553. DXVA_VideoPrimaries_BT709 = 2,
  554. DXVA_VideoPrimaries_BT470_2_SysM = 3,
  555. DXVA_VideoPrimaries_BT470_2_SysBG = 4,
  556. DXVA_VideoPrimaries_SMPTE170M = 5,
  557. DXVA_VideoPrimaries_SMPTE240M = 6,
  558. DXVA_VideoPrimaries_EBU3213 = 7,
  559. DXVA_VideoPrimaries_SMPTE_C = 8
  560. } DXVA_VideoPrimaries;
  561. typedef enum _DXVA_VideoLighting
  562. {
  563. DXVA_VideoLightingShift = (DXVA_ExtColorData_ShiftBase + 10),
  564. DXVA_VideoLightingMask = DXVAColorMask(4, DXVA_VideoLightingShift),
  565. DXVA_VideoLighting_Unknown = 0,
  566. DXVA_VideoLighting_bright = 1,
  567. DXVA_VideoLighting_office = 2,
  568. DXVA_VideoLighting_dim = 3,
  569. DXVA_VideoLighting_dark = 4
  570. } DXVA_VideoLighting;
  571. typedef enum _DXVA_VideoTransferMatrix
  572. {
  573. DXVA_VideoTransferMatrixShift = (DXVA_ExtColorData_ShiftBase + 7),
  574. DXVA_VideoTransferMatrixMask = DXVAColorMask(3, DXVA_VideoTransferMatrixShift),
  575. DXVA_VideoTransferMatrix_Unknown = 0,
  576. DXVA_VideoTransferMatrix_BT709 = 1,
  577. DXVA_VideoTransferMatrix_BT601 = 2,
  578. DXVA_VideoTransferMatrix_SMPTE240M = 3
  579. } DXVA_VideoTransferMatrix;
  580. typedef enum _DXVA_NominalRange
  581. {
  582. DXVA_NominalRangeShift = (DXVA_ExtColorData_ShiftBase + 4),
  583. DXVA_NominalRangeMask = DXVAColorMask(3, DXVA_NominalRangeShift),
  584. DXVA_NominalRange_Unknown = 0,
  585. DXVA_NominalRange_Normal = 1,
  586. DXVA_NominalRange_Wide = 2
  587. } DXVA_NominalRange;
  588. typedef enum _DXVA_VideoChromaSubsampling
  589. {
  590. DXVA_VideoChromaSubsamplingShift = (DXVA_ExtColorData_ShiftBase + 0),
  591. DXVA_VideoChromaSubsamplingMask = DXVAColorMask(4, DXVA_VideoChromaSubsamplingShift),
  592. DXVA_VideoChromaSubsampling_Unknown = 0,
  593. DXVA_VideoChromaSubsampling_ProgressiveChroma = 0x8,
  594. DXVA_VideoChromaSubsampling_Horizontally_Cosited = 0x4,
  595. DXVA_VideoChromaSubsampling_Vertically_Cosited = 0x2,
  596. DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1,
  597. } DXVA_VideoChromaSubsampling;
  598. typedef struct _DXVA_ExtendedFormat
  599. {
  600. UINT SampleFormat : 8; // See DXVA_SampleFormat
  601. UINT VideoChromaSubsampling : 4; // See DXVA_VideoChromaSubSampling
  602. DXVA_NominalRange NominalRange : 3; // See DXVA_NominalRange
  603. DXVA_VideoTransferMatrix VideoTransferMatrix : 3; // See DXVA_VideoTransferMatrix
  604. DXVA_VideoLighting VideoLighting : 4; // See DXVA_VideoLighting
  605. DXVA_VideoPrimaries VideoPrimaries : 5; // See DXVA_VideoPrimaries
  606. DXVA_VideoTransferFunction VideoTransferFunction : 5; // See DXVA_VideoTransferFunction
  607. } DXVA_ExtendedFormat;
  608. #endif
  609. // -------------------------------------------------------------------------
  610. //
  611. // The definitions that follow describe the video de-interlace interface
  612. // between the VMR and the graphics device driver. This interface is not
  613. // accessable via the IAMVideoAccelerator interface.
  614. //
  615. // -------------------------------------------------------------------------
  616. //
  617. #ifndef __DIRECTX_VA_DEINTERLACE__
  618. #define __DIRECTX_VA_DEINTERLACE__
  619. typedef LONGLONG REFERENCE_TIME;
  620. DEFINE_GUID(DXVA_DeinterlaceBobDevice,
  621. 0x335aa36e,0x7884,0x43a4,0x9c,0x91,0x7f,0x87,0xfa,0xf3,0xe3,0x7e);
  622. DEFINE_GUID(DXVA_DeinterlaceContainerDevice,
  623. 0x0e85cb93,0x3046,0x4ff0,0xae,0xcc,0xd5,0x8c,0xb5,0xf0,0x35,0xfd);
  624. #if (DIRECT3D_VERSION < 0x0800) || !defined(DIRECT3D_VERSION)
  625. typedef DWORD D3DFORMAT;
  626. enum {
  627. D3DPOOL_DEFAULT = 0,
  628. D3DPOOL_MANAGED = 1,
  629. D3DPOOL_SYSTEMMEM = 2,
  630. D3DPOOL_SCRATCH = 3,
  631. D3DPOOL_LOCALVIDMEM = 4,
  632. D3DPOOL_NONLOCALVIDMEM = 5,
  633. D3DPOOL_FORCE_DWORD = 0x7fffffff
  634. };
  635. #endif
  636. // -------------------------------------------------------------------------
  637. // data structures shared by User mode and Kernel mode.
  638. // -------------------------------------------------------------------------
  639. //
  640. typedef struct _DXVA_Frequency {
  641. DWORD Numerator;
  642. DWORD Denominator;
  643. } DXVA_Frequency;
  644. typedef struct _DXVA_VideoDesc {
  645. DWORD Size;
  646. DWORD SampleWidth;
  647. DWORD SampleHeight;
  648. DWORD SampleFormat; // also contains extend color data
  649. D3DFORMAT d3dFormat;
  650. DXVA_Frequency InputSampleFreq;
  651. DXVA_Frequency OutputFrameFreq;
  652. } DXVA_VideoDesc, *LPDXVA_VideoDesc;
  653. typedef enum _DXVA_VideoProcessCaps {
  654. DXVA_VideoProcess_None = 0x0000,
  655. DXVA_VideoProcess_YUV2RGB = 0x0001,
  656. DXVA_VideoProcess_StretchX = 0x0002,
  657. DXVA_VideoProcess_StretchY = 0x0004,
  658. DXVA_VideoProcess_AlphaBlend = 0x0008,
  659. DXVA_VideoProcess_SubRects = 0x0010,
  660. DXVA_VideoProcess_SubStreams = 0x0020,
  661. DXVA_VideoProcess_SubStreamsExtended = 0x0040,
  662. DXVA_VideoProcess_YUV2RGBExtended = 0x0080,
  663. DXVA_VideoProcess_AlphaBlendExtended = 0x0100
  664. } DXVA_VideoProcessCaps;
  665. typedef enum _DXVA_DeinterlaceTech {
  666. // the algorithm is unknown or proprietary
  667. DXVA_DeinterlaceTech_Unknown = 0x0000,
  668. // the algorithm creates the missing lines by repeating
  669. // the line either above or below it - this method will look very jaggy and
  670. // isn't recommended
  671. DXVA_DeinterlaceTech_BOBLineReplicate = 0x0001,
  672. // The algorithm creates the missing lines by vertically stretching each
  673. // video field by a factor of two by averaging two lines
  674. DXVA_DeinterlaceTech_BOBVerticalStretch = 0x0002,
  675. // or using a [-1, 9, 9, -1]/16 filter across four lines.
  676. DXVA_DeinterlaceTech_BOBVerticalStretch4Tap = 0x0100,
  677. // the pixels in the missing line are recreated by a median filtering operation
  678. DXVA_DeinterlaceTech_MedianFiltering = 0x0004,
  679. // the pixels in the missing line are recreated by an edge filter.
  680. // In this process, spatial directional filters are applied to determine
  681. // the orientation of edges in the picture content, and missing
  682. // pixels are created by filtering along (rather than across) the
  683. // detected edges.
  684. DXVA_DeinterlaceTech_EdgeFiltering = 0x0010,
  685. // the pixels in the missing line are recreated by switching on a field by
  686. // field basis between using either spatial or temporal interpolation
  687. // depending on the amount of motion.
  688. DXVA_DeinterlaceTech_FieldAdaptive = 0x0020,
  689. // the pixels in the missing line are recreated by switching on a pixel by pixel
  690. // basis between using either spatial or temporal interpolation depending on
  691. // the amount of motion..
  692. DXVA_DeinterlaceTech_PixelAdaptive = 0x0040,
  693. // Motion Vector Steering identifies objects within a sequence of video
  694. // fields. The missing pixels are recreated after first aligning the
  695. // movement axes of the individual objects in the scene to make them
  696. // parallel with the time axis.
  697. DXVA_DeinterlaceTech_MotionVectorSteered = 0x0080
  698. } DXVA_DeinterlaceTech;
  699. typedef struct _DXVA_VideoSample {
  700. REFERENCE_TIME rtStart;
  701. REFERENCE_TIME rtEnd;
  702. DXVA_SampleFormat SampleFormat; // only lower 8 bits used
  703. VOID* lpDDSSrcSurface;
  704. } DXVA_VideoSample, *LPDXVA_VideoSample;
  705. // -------------------------------------------------------------------------
  706. // DeinterlaceBltEx declarations
  707. // -------------------------------------------------------------------------
  708. //
  709. typedef enum _DXVA_SampleFlags {
  710. DXVA_SampleFlagsMask = DXVABit(3)|DXVABit(2)|DXVABit(1)|DXVABit(0),
  711. DXVA_SampleFlag_Palette_Changed = 0x0001,
  712. DXVA_SampleFlag_SrcRect_Changed = 0x0002,
  713. DXVA_SampleFlag_DstRect_Changed = 0x0004,
  714. DXVA_SampleFlag_ColorData_Changed = 0x0008,
  715. } DXVA_SampleFlags;
  716. typedef enum _DXVA_DestinationFlags {
  717. DXVA_DestinationFlagMask = DXVABit(3)|DXVABit(2)|DXVABit(1)|DXVABit(0),
  718. DXVA_DestinationFlag_Background_Changed = 0x0001,
  719. DXVA_DestinationFlag_TargetRect_Changed = 0x0002,
  720. DXVA_DestinationFlag_ColorData_Changed = 0x0004,
  721. DXVA_DestinationFlag_Alpha_Changed = 0x0008
  722. } DXVA_DestinationFlags;
  723. typedef struct _DXVA_VideoSample2 {
  724. REFERENCE_TIME rtStart;
  725. REFERENCE_TIME rtEnd;
  726. DWORD SampleFormat; // cast to DXVA_ExtendedFormat, or use Extract macros
  727. DWORD SampleFlags;
  728. VOID* lpDDSSrcSurface;
  729. RECT rcSrc;
  730. RECT rcDst;
  731. DXVA_AYUVsample2 Palette[16];
  732. } DXVA_VideoSample2, *LPDXVA_VideoSample2;
  733. typedef struct _DXVA_DeinterlaceCaps {
  734. DWORD Size;
  735. DWORD NumPreviousOutputFrames;
  736. DWORD InputPool;
  737. DWORD NumForwardRefSamples;
  738. DWORD NumBackwardRefSamples;
  739. D3DFORMAT d3dOutputFormat;
  740. DXVA_VideoProcessCaps VideoProcessingCaps;
  741. DXVA_DeinterlaceTech DeinterlaceTechnology;
  742. } DXVA_DeinterlaceCaps, *LPDXVA_DeinterlaceCaps;
  743. // -------------------------------------------------------------------------
  744. // Data types used with RenderMoComp in kernel mode
  745. // -------------------------------------------------------------------------
  746. //
  747. // Function codes for RenderMoComp
  748. #define MAX_DEINTERLACE_SURFACES 32
  749. typedef struct _DXVA_DeinterlaceBlt {
  750. DWORD Size;
  751. DWORD Reserved;
  752. REFERENCE_TIME rtTarget;
  753. RECT DstRect;
  754. RECT SrcRect;
  755. DWORD NumSourceSurfaces;
  756. FLOAT Alpha;
  757. DXVA_VideoSample Source[MAX_DEINTERLACE_SURFACES];
  758. } DXVA_DeinterlaceBlt;
  759. #define DXVA_DeinterlaceBltFnCode 0x01
  760. // lpInput => DXVA_DeinterlaceBlt*
  761. // lpOuput => NULL /* not currently used */
  762. typedef struct _DXVA_DeinterlaceBltEx {
  763. DWORD Size;
  764. DXVA_AYUVsample2 BackgroundColor;
  765. RECT rcTarget;
  766. REFERENCE_TIME rtTarget;
  767. DWORD NumSourceSurfaces;
  768. FLOAT Alpha;
  769. DXVA_VideoSample2 Source[MAX_DEINTERLACE_SURFACES];
  770. DWORD DestinationFormat;
  771. DWORD DestinationFlags;
  772. } DXVA_DeinterlaceBltEx;
  773. #define DXVA_DeinterlaceBltExFnCode 0x02
  774. // lpInput => DXVA_DeinterlaceBltEx*
  775. // lpOuput => NULL /* not currently used */
  776. #define MAX_DEINTERLACE_DEVICE_GUIDS 32
  777. typedef struct _DXVA_DeinterlaceQueryAvailableModes {
  778. DWORD Size;
  779. DWORD NumGuids;
  780. GUID Guids[MAX_DEINTERLACE_DEVICE_GUIDS];
  781. } DXVA_DeinterlaceQueryAvailableModes;
  782. #define DXVA_DeinterlaceQueryAvailableModesFnCode 0x01
  783. // lpInput => DXVA_VideoDesc*
  784. // lpOuput => DXVA_DeinterlaceQueryAvailableModes*
  785. typedef struct _DXVA_DeinterlaceQueryModeCaps {
  786. DWORD Size;
  787. GUID Guid;
  788. DXVA_VideoDesc VideoDesc;
  789. } DXVA_DeinterlaceQueryModeCaps;
  790. #define DXVA_DeinterlaceQueryModeCapsFnCode 0x02
  791. // lpInput => DXVA_DeinterlaceQueryModeCaps*
  792. // lpOuput => DXVA_DeinterlaceCaps*
  793. #endif /* __DIRECTX_VA_DEINTERLACE__ */
  794. // -------------------------------------------------------------------------
  795. //
  796. // The definitions that follow describe the video ProcAmp interface
  797. // between the VMR and the graphics device driver. This interface is not
  798. // accessable via the IAMVideoAccelerator interface.
  799. //
  800. // -------------------------------------------------------------------------
  801. //
  802. #ifndef __DIRECTX_VA_PROCAMPCONTROL__
  803. #define __DIRECTX_VA_PROCAMPCONTROL__
  804. DEFINE_GUID(DXVA_ProcAmpControlDevice,
  805. 0x9f200913,0x2ffd,0x4056,0x9f,0x1e,0xe1,0xb5,0x08,0xf2,0x2d,0xcf);
  806. typedef enum _DXVA_ProcAmpControlProp {
  807. DXVA_ProcAmp_None = 0x0000,
  808. DXVA_ProcAmp_Brightness = 0x0001,
  809. DXVA_ProcAmp_Contrast = 0x0002,
  810. DXVA_ProcAmp_Hue = 0x0004,
  811. DXVA_ProcAmp_Saturation = 0x0008
  812. } DXVA_ProcAmpControlProp;
  813. typedef struct _DXVA_ProcAmpControlCaps {
  814. DWORD Size;
  815. DWORD InputPool;
  816. D3DFORMAT d3dOutputFormat;
  817. DWORD ProcAmpControlProps;// see DXVA_ProcAmpControlProp
  818. DWORD VideoProcessingCaps;// see DXVA_VideoProcessCaps
  819. } DXVA_ProcAmpControlCaps, *LPDXVA_ProcAmpControlCaps;
  820. #define DXVA_ProcAmpControlQueryCapsFnCode 0x03
  821. // lpInput => DXVA_VideoDesc*
  822. // lpOuput => DXVA_ProcAmpControlCaps*
  823. typedef struct _DXVA_ProcAmpControlQueryRange {
  824. DWORD Size;
  825. DXVA_ProcAmpControlProp ProcAmpControlProp;
  826. DXVA_VideoDesc VideoDesc;
  827. } DXVA_ProcAmpControlQueryRange, *LPDXVA_ProcAmpControlQueryRange;
  828. typedef struct _DXVA_VideoPropertyRange {
  829. FLOAT MinValue;
  830. FLOAT MaxValue;
  831. FLOAT DefaultValue;
  832. FLOAT StepSize;
  833. } DXVA_VideoPropertyRange, *LPDXVA_VideoPropertyRange;
  834. #define DXVA_ProcAmpControlQueryRangeFnCode 0x04
  835. // lpInput => DXVA_ProcAmpControlQueryRange*
  836. // lpOuput => DXVA_VideoPropertyRange*
  837. typedef struct _DXVA_ProcAmpControlBlt {
  838. DWORD Size;
  839. RECT DstRect;
  840. RECT SrcRect;
  841. FLOAT Alpha;
  842. FLOAT Brightness;
  843. FLOAT Contrast;
  844. FLOAT Hue;
  845. FLOAT Saturation;
  846. } DXVA_ProcAmpControlBlt;
  847. #define DXVA_ProcAmpControlBltFnCode 0x01
  848. // lpInput => DXVA_ProcAmpControlBlt*
  849. // lpOuput => NULL /* not currently used */
  850. #endif /* __DIRECTX_VA_PROCAMPCONTROL__ */
  851. // -------------------------------------------------------------------------
  852. //
  853. // The definitions that follow describe the Certified Output Protection
  854. // Protocol between the VMR and the graphics device driver. This interface
  855. // is not accessable via the IAMVideoAccelerator interface.
  856. //
  857. // -------------------------------------------------------------------------
  858. //
  859. #ifndef __DIRECTX_VA_CERTOUTPUTPROTECT__
  860. #define __DIRECTX_VA_CERTOUTPUTPROTECT__
  861. DEFINE_GUID(DXVA_COPPDevice,
  862. 0xd2457add,0x8999,0x45ed,0x8a,0x8a,0xd1,0xaa,0x04,0x7b,0xa4,0xd5);
  863. // -------------------------------------------------------------------------
  864. // COPPGetCertificateLength
  865. // -------------------------------------------------------------------------
  866. #define DXVA_COPPGetCertificateLengthFnCode 0x01
  867. // lpInput => NULL
  868. // lpOuput => DWORD*
  869. // -------------------------------------------------------------------------
  870. // COPPKeyExchange
  871. // -------------------------------------------------------------------------
  872. #define DXVA_COPPKeyExchangeFnCode 0x02
  873. // lpInputData => NULL
  874. // lpOuputData => GUID*
  875. // -------------------------------------------------------------------------
  876. // COPPSequenceStart
  877. // -------------------------------------------------------------------------
  878. typedef struct _DXVA_COPPSignature {
  879. UCHAR Signature[256];
  880. } DXVA_COPPSignature, *LPDXVA_COPPSignature;
  881. #define DXVA_COPPSequenceStartFnCode 0x03
  882. // lpInputData => DXVA_COPPSignature*
  883. // lpOuputData => NULL
  884. // -------------------------------------------------------------------------
  885. // COPPCommand
  886. // -------------------------------------------------------------------------
  887. typedef struct _DXVA_COPPCommand {
  888. GUID macKDI; // 16 bytes
  889. GUID guidCommandID; // 16 bytes
  890. ULONG dwSequence; // 4 bytes
  891. ULONG cbSizeData; // 4 bytes
  892. UCHAR CommandData[4056]; // 4056 bytes (4056+4+4+16+16 = 4096)
  893. } DXVA_COPPCommand, *LPDXVA_COPPCommand;
  894. #define DXVA_COPPCommandFnCode 0x04
  895. // lpInputData => DXVA_COPPCommand*
  896. // lpOuputData => NULL
  897. DEFINE_GUID(DXVA_COPPSetProtectionLevel,
  898. 0x9bb9327c,0x4eb5,0x4727,0x9f,0x00,0xb4,0x2b,0x09,0x19,0xc0,0xda);
  899. typedef struct _DXVA_COPPSetProtectionLevelCmdData {
  900. ULONG ProtType;
  901. ULONG ProtLevel;
  902. ULONG ExtendedInfoChangeMask;
  903. ULONG ExtendedInfoData;
  904. } DXVA_COPPSetProtectionLevelCmdData;
  905. // Set the HDCP protection level - (0 - 1 DWORD, 4 bytes)
  906. typedef enum _COPP_HDCP_Protection_Level {
  907. COPP_HDCP_Level0 = 0,
  908. COPP_HDCP_LevelMin = COPP_HDCP_Level0,
  909. COPP_HDCP_Level1 = 1,
  910. COPP_HDCP_LevelMax = COPP_HDCP_Level1,
  911. COPP_HDCP_ForceDWORD = 0x7fffffff
  912. } COPP_HDCP_Protection_Level;
  913. typedef enum _COPP_CGMSA_Protection_Level {
  914. COPP_CGMSA_Disabled = 0,
  915. COPP_CGMSA_LevelMin = COPP_CGMSA_Disabled,
  916. COPP_CGMSA_CopyFreely = 1,
  917. COPP_CGMSA_CopyNoMore = 2,
  918. COPP_CGMSA_CopyOneGeneration = 3,
  919. COPP_CGMSA_CopyNever = 4,
  920. COPP_CGMSA_RedistributionControlRequired = 0x08,
  921. COPP_CGMSA_LevelMax = (COPP_CGMSA_RedistributionControlRequired + COPP_CGMSA_CopyNever),
  922. COPP_CGMSA_ForceDWORD = 0x7fffffff
  923. } COPP_CGMSA_Protection_Level;
  924. typedef enum _COPP_ACP_Protection_Level {
  925. COPP_ACP_Level0 = 0,
  926. COPP_ACP_LevelMin = COPP_ACP_Level0,
  927. COPP_ACP_Level1 = 1,
  928. COPP_ACP_Level2 = 2,
  929. COPP_ACP_Level3 = 3,
  930. COPP_ACP_LevelMax = COPP_ACP_Level3,
  931. COPP_ACP_ForceDWORD = 0x7fffffff
  932. } COPP_ACP_Protection_Level;
  933. #define COPP_NoProtectionLevelAvailable -1
  934. #define COPP_DefaultProtectionLevel 0
  935. //
  936. // Bit flags of possible protection types. Note that it is possible to apply
  937. // different protection settings to a single connector.
  938. //
  939. enum {
  940. COPP_ProtectionType_Unknown = 0x80000000,
  941. COPP_ProtectionType_None = 0x00000000,
  942. COPP_ProtectionType_HDCP = 0x00000001,
  943. COPP_ProtectionType_ACP = 0x00000002,
  944. COPP_ProtectionType_CGMSA = 0x00000004,
  945. COPP_ProtectionType_Mask = 0x80000007,
  946. COPP_ProtectionType_Reserved = 0x7FFFFFF8
  947. };
  948. DEFINE_GUID(DXVA_COPPSetSignaling,
  949. 0x9a631a5, 0xd684, 0x4c60, 0x8e, 0x4d, 0xd3, 0xbb, 0xf, 0xb, 0xe3, 0xee);
  950. typedef struct _DXVA_COPPSetSignalingCmdData {
  951. ULONG ActiveTVProtectionStandard; // See COPP_TVProtectionStandard
  952. ULONG AspectRatioChangeMask1;
  953. ULONG AspectRatioData1; // See COPP_ImageAspectRatio_EN300294 for ETSI EN 300 294 values
  954. ULONG AspectRatioChangeMask2;
  955. ULONG AspectRatioData2;
  956. ULONG AspectRatioChangeMask3;
  957. ULONG AspectRatioData3;
  958. ULONG ExtendedInfoChangeMask[4];
  959. ULONG ExtendedInfoData[4];
  960. ULONG Reserved;
  961. } DXVA_COPPSetSignalingCmdData;
  962. // Add format enum and data enum
  963. typedef enum _COPP_TVProtectionStandard {
  964. COPP_ProtectionStandard_Unknown = 0x80000000,
  965. COPP_ProtectionStandard_None = 0x00000000,
  966. COPP_ProtectionStandard_IEC61880_525i = 0x00000001,
  967. COPP_ProtectionStandard_IEC61880_2_525i = 0x00000002,
  968. COPP_ProtectionStandard_IEC62375_625p = 0x00000004,
  969. COPP_ProtectionStandard_EIA608B_525 = 0x00000008,
  970. COPP_ProtectionStandard_EN300294_625i = 0x00000010,
  971. COPP_ProtectionStandard_CEA805A_TypeA_525p = 0x00000020,
  972. COPP_ProtectionStandard_CEA805A_TypeA_750p = 0x00000040,
  973. COPP_ProtectionStandard_CEA805A_TypeA_1125i = 0x00000080,
  974. COPP_ProtectionStandard_CEA805A_TypeB_525p = 0x00000100,
  975. COPP_ProtectionStandard_CEA805A_TypeB_750p = 0x00000200,
  976. COPP_ProtectionStandard_CEA805A_TypeB_1125i = 0x00000400,
  977. COPP_ProtectionStandard_ARIBTRB15_525i = 0x00000800,
  978. COPP_ProtectionStandard_ARIBTRB15_525p = 0x00001000,
  979. COPP_ProtectionStandard_ARIBTRB15_750p = 0x00002000,
  980. COPP_ProtectionStandard_ARIBTRB15_1125i = 0x00004000,
  981. COPP_ProtectionStandard_Mask = 0x80007FFF,
  982. COPP_ProtectionStandard_Reserved = 0x7FFF8000
  983. } COPP_TVProtectionStandard;
  984. #define COPP_ImageAspectRatio_EN300294_Mask 0x00000007
  985. typedef enum _COPP_ImageAspectRatio_EN300294 {
  986. COPP_AspectRatio_EN300294_FullFormat4by3 = 0,
  987. COPP_AspectRatio_EN300294_Box14by9Center = 1,
  988. COPP_AspectRatio_EN300294_Box14by9Top = 2,
  989. COPP_AspectRatio_EN300294_Box16by9Center = 3,
  990. COPP_AspectRatio_EN300294_Box16by9Top = 4,
  991. COPP_AspectRatio_EN300294_BoxGT16by9Center = 5,
  992. COPP_AspectRatio_EN300294_FullFormat4by3ProtectedCenter = 6,
  993. COPP_AspectRatio_EN300294_FullFormat16by9Anamorphic = 7,
  994. COPP_AspectRatio_ForceDWORD = 0x7fffffff
  995. } COPP_ImageAspectRatio_EN300294;
  996. // -------------------------------------------------------------------------
  997. // COPPQueryStatus
  998. // -------------------------------------------------------------------------
  999. typedef struct _DXVA_COPPStatusInput {
  1000. GUID rApp; // 16 bytes
  1001. GUID guidStatusRequestID;// 16 bytes
  1002. ULONG dwSequence; // 4 bytes
  1003. ULONG cbSizeData; // 4 bytes
  1004. UCHAR StatusData[4056]; // 4056 bytes (4056+4+4+16+16 = 4096)
  1005. } DXVA_COPPStatusInput, *LPDXVA_COPPStatusInput;
  1006. typedef struct _DXVA_COPPStatusOutput {
  1007. GUID macKDI; // 16 bytes
  1008. ULONG cbSizeData; // 4 bytes
  1009. UCHAR COPPStatus[4076]; // 4076 bytes (4076+16+4 = 4096)
  1010. } DXVA_COPPStatusOutput, *LPDXVA_COPPStatusOutput;
  1011. typedef enum _COPP_StatusFlags {
  1012. COPP_StatusNormal = 0x00,
  1013. COPP_LinkLost = 0x01,
  1014. COPP_RenegotiationRequired = 0x02,
  1015. COPP_StatusFlagsReserved = 0xFFFFFFFC
  1016. } COPP_StatusFlags;
  1017. typedef struct _DXVA_COPPStatusData {
  1018. GUID rApp;
  1019. ULONG dwFlags; // See COPP_StatusFlags above
  1020. ULONG dwData;
  1021. ULONG ExtendedInfoValidMask;
  1022. ULONG ExtendedInfoData;
  1023. } DXVA_COPPStatusData;
  1024. typedef struct _DXVA_COPPStatusDisplayData {
  1025. GUID rApp;
  1026. ULONG dwFlags; // See COPP_StatusFlags above
  1027. ULONG DisplayWidth;
  1028. ULONG DisplayHeight;
  1029. ULONG Format; // also contains extended color data
  1030. ULONG d3dFormat;
  1031. ULONG FreqNumerator;
  1032. ULONG FreqDenominator;
  1033. } DXVA_COPPStatusDisplayData;
  1034. typedef enum _COPP_StatusHDCPFlags {
  1035. COPP_HDCPRepeater = 0x01,
  1036. COPP_HDCPFlagsReserved = 0xFFFFFFFE
  1037. } COPP_StatusHDCPFlags;
  1038. typedef struct _DXVA_COPPStatusHDCPKeyData {
  1039. GUID rApp;
  1040. ULONG dwFlags; // See COPP_StatusFlags above
  1041. ULONG dwHDCPFlags; // See COPP_StatusHDCPFlags above
  1042. GUID BKey; // Lower 40 bits
  1043. GUID Reserved1;
  1044. GUID Reserved2;
  1045. } DXVA_COPPStatusHDCPKeyData;
  1046. #define DXVA_COPPQueryStatusFnCode 0x05
  1047. // lpInputData => DXVA_COPPStatusInput*
  1048. // lpOuputData => DXVA_COPPStatusOutput*
  1049. //
  1050. // Status GUID and enumerations
  1051. //
  1052. DEFINE_GUID(DXVA_COPPQueryConnectorType,
  1053. 0x81d0bfd5,0x6afe,0x48c2,0x99,0xc0,0x95,0xa0,0x8f,0x97,0xc5,0xda);
  1054. typedef enum _COPP_ConnectorType {
  1055. COPP_ConnectorType_Unknown = -1,
  1056. COPP_ConnectorType_VGA = 0,
  1057. COPP_ConnectorType_SVideo = 1,
  1058. COPP_ConnectorType_CompositeVideo = 2,
  1059. COPP_ConnectorType_ComponentVideo = 3,
  1060. COPP_ConnectorType_DVI = 4,
  1061. COPP_ConnectorType_HDMI = 5,
  1062. COPP_ConnectorType_LVDS = 6,
  1063. COPP_ConnectorType_TMDS = 7,
  1064. COPP_ConnectorType_D_JPN = 8,
  1065. COPP_ConnectorType_Internal = 0x80000000, // can be combined with the other connector types
  1066. COPP_ConnectorType_ForceDWORD = 0x7fffffff /* force 32-bit size enum */
  1067. } COPP_ConnectorType;
  1068. DEFINE_GUID(DXVA_COPPQueryProtectionType,
  1069. 0x38f2a801,0x9a6c,0x48bb,0x91,0x07,0xb6,0x69,0x6e,0x6f,0x17,0x97);
  1070. DEFINE_GUID(DXVA_COPPQueryLocalProtectionLevel,
  1071. 0xb2075857,0x3eda,0x4d5d,0x88,0xdb,0x74,0x8f,0x8c,0x1a,0x05,0x49);
  1072. DEFINE_GUID(DXVA_COPPQueryGlobalProtectionLevel,
  1073. 0x1957210a,0x7766,0x452a,0xb9,0x9a,0xd2,0x7a,0xed,0x54,0xf0,0x3a);
  1074. DEFINE_GUID(DXVA_COPPQueryDisplayData,
  1075. 0xd7bf1ba3,0xad13,0x4f8e,0xaf,0x98,0x0d,0xcb,0x3c,0xa2,0x04,0xcc);
  1076. DEFINE_GUID(DXVA_COPPQueryHDCPKeyData,
  1077. 0xdb59d74, 0xa992, 0x492e, 0xa0, 0xbd, 0xc2, 0x3f, 0xda, 0x56, 0x4e, 0x0);
  1078. DEFINE_GUID(DXVA_COPPQueryBusData,
  1079. 0xc6f4d673, 0x6174, 0x4184, 0x8e, 0x35, 0xf6, 0xdb, 0x52, 0x0, 0xbc, 0xba);
  1080. typedef enum _COPP_BusType {
  1081. COPP_BusType_Unknown = 0,
  1082. COPP_BusType_PCI = 1,
  1083. COPP_BusType_PCIX = 2,
  1084. COPP_BusType_PCIExpress = 3,
  1085. COPP_BusType_AGP = 4,
  1086. COPP_BusType_Integrated = 0x80000000, // can be combined with the other bus types
  1087. COPP_BusType_ForceDWORD = 0x7fffffff /* force 32-bit size enum */
  1088. } COPP_BusType;
  1089. DEFINE_GUID(DXVA_COPPQuerySignaling,
  1090. 0x6629a591, 0x3b79, 0x4cf3, 0x92, 0x4a, 0x11, 0xe8, 0xe7, 0x81, 0x16, 0x71);
  1091. typedef struct _DXVA_COPPStatusSignalingCmdData {
  1092. GUID rApp;
  1093. ULONG dwFlags; // See COPP_StatusFlags above
  1094. ULONG AvailableTVProtectionStandards; // See COPP_TVProtectionStandard
  1095. ULONG ActiveTVProtectionStandard; // See COPP_TVProtectionStandard
  1096. ULONG TVType;
  1097. ULONG AspectRatioValidMask1;
  1098. ULONG AspectRatioData1; // See COPP_AspectRatio_EN300294 for ETSI EN 300 294 values
  1099. ULONG AspectRatioValidMask2;
  1100. ULONG AspectRatioData2;
  1101. ULONG AspectRatioValidMask3;
  1102. ULONG AspectRatioData3;
  1103. ULONG ExtendedInfoValidMask[4];
  1104. ULONG ExtendedInfoData[4];
  1105. } DXVA_COPPStatusSignalingCmdData;
  1106. #endif /* __DIRECTX_VA_CERTOUTPUTPROTECT__ */
  1107. #ifdef __cplusplus
  1108. }
  1109. #endif
  1110. #endif /* __DIRECTX_VA__ */