dxva2api.idl 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. /*
  2. * Copyright 2014 Michael Müller for Pipelight
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "unknwn.idl";
  19. cpp_quote("#if 0")
  20. typedef DWORD IDirect3DDevice9;
  21. typedef DWORD IDirect3DSurface9;
  22. typedef DWORD D3DFORMAT;
  23. typedef DWORD D3DPOOL;
  24. cpp_quote("#endif")
  25. /* MPEG2 */
  26. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_MoComp, 0xe6a9f44b, 0x61b0,0x4563, 0x9e,0xa4,0x63,0xd2,0xa3,0xc6,0xfe,0x66);")
  27. cpp_quote("#define DXVA2_ModeMPEG2_MOCOMP DXVA2_ModeMPEG2_MoComp")
  28. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_IDCT, 0xbf22ad00, 0x03ea,0x4690, 0x80,0x77,0x47,0x33,0x46,0x20,0x9b,0x7e);")
  29. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28,0x4e65, 0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);")
  30. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG1_VLD, 0x6f3ec719, 0x3735,0x42cc, 0x80,0x63,0x65,0xcc,0x3c,0xb3,0x66,0x16);")
  31. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD, 0x86695f12, 0x340e,0x4f04, 0x9f,0xd3,0x92,0x53,0xdd,0x32,0x74,0x60);")
  32. /* H264 */
  33. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_A, 0x1b81be64, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  34. cpp_quote("#define DXVA2_ModeH264_MoComp_NoFGT DXVA2_ModeH264_A")
  35. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_B, 0x1b81be65, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  36. cpp_quote("#define DXVA2_ModeH264_MoComp_FGT DXVA2_ModeH264_B")
  37. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_C, 0x1b81be66, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  38. cpp_quote("#define DXVA2_ModeH264_IDCT_NoFGT DXVA2_ModeH264_C")
  39. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_D, 0x1b81be67, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  40. cpp_quote("#define DXVA2_ModeH264_IDCT_FGT DXVA2_ModeH264_D")
  41. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  42. cpp_quote("#define DXVA2_ModeH264_VLD_NoFGT DXVA2_ModeH264_E")
  43. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  44. cpp_quote("#define DXVA2_ModeH264_VLD_FGT DXVA2_ModeH264_F")
  45. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_WithFMOASO_NoFGT, 0xd5f04ff9, 0x3418,0x45d8, 0x95,0x61,0x32,0xa7,0x6a,0xae,0x2d,0xdd);")
  46. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Stereo_Progressive_NoFGT, 0xd79be8da, 0x0cf1,0x4c81, 0xb8,0x2a,0x69,0xa4,0xe2,0x36,0xf4,0x3d);")
  47. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Stereo_NoFGT, 0xf9aaccbb, 0xc2b6,0x4cfc, 0x87,0x79,0x57,0x07,0xb1,0x76,0x05,0x52);")
  48. cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Multiview_NoFGT, 0x705b9d82, 0x76cf,0x49d6, 0xb7,0xe6,0xac,0x88,0x72,0xdb,0x01,0x3c);")
  49. /* WMV8 */
  50. cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  51. cpp_quote("#define DXVA2_ModeWMV8_PostProc DXVA2_ModeWMV8_A")
  52. cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  53. cpp_quote("#define DXVA2_ModeWMV8_MoComp DXVA2_ModeWMV8_B")
  54. /* WMV9 */
  55. cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  56. cpp_quote("#define DXVA2_ModeWMV9_PostProc DXVA2_ModeWMV9_A")
  57. cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  58. cpp_quote("#define DXVA2_ModeWMV9_MoComp DXVA2_ModeWMV9_B")
  59. cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  60. cpp_quote("#define DXVA2_ModeWMV9_IDCT DXVA2_ModeWMV9_C")
  61. /* VC1 */
  62. cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_A, 0x1b81beA0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  63. cpp_quote("#define DXVA2_ModeVC1_PostProc DXVA2_ModeVC1_A")
  64. cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_B, 0x1b81beA1, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  65. cpp_quote("#define DXVA2_ModeVC1_MoComp DXVA2_ModeVC1_B")
  66. cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_C, 0x1b81beA2, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  67. cpp_quote("#define DXVA2_ModeVC1_IDCT DXVA2_ModeVC1_C")
  68. cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  69. cpp_quote("#define DXVA2_ModeVC1_VLD DXVA2_ModeVC1_D")
  70. cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D2010, 0x1b81bea4, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  71. /* Encryption */
  72. cpp_quote("DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
  73. cpp_quote("DEFINE_GUID(DXVA2_VideoProcProgressiveDevice, 0x5a54a0c9, 0xc7ec,0x4bd9, 0x8e,0xde,0xf3,0xc7,0x5d,0xc4,0x39,0x3b);")
  74. cpp_quote("DEFINE_GUID(DXVA2_VideoProcBobDevice, 0x335aa36e, 0x7884,0x43a4, 0x9c,0x91,0x7f,0x87,0xfa,0xf3,0xe3,0x7e);")
  75. cpp_quote("DEFINE_GUID(DXVA2_VideoProcSoftwareDevice, 0x4553d47f, 0xee7e,0x4e3f, 0x94,0x75,0xdb,0xf1,0x37,0x6c,0x48,0x10);")
  76. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_Simple, 0xefd64d74, 0xc9e8,0x41d7, 0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);")
  77. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_AdvSimple_NoGMC, 0xed418a9f, 0x010d,0x4eda, 0x9a,0xe3,0x9a,0x65,0x35,0x8d,0x8d,0x2e);")
  78. cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_AdvSimple_GMC, 0xab998b5b, 0x4258,0x44a9, 0x9f,0xeb,0x94,0xe5,0x97,0xa6,0xba,0xae);")
  79. cpp_quote("DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main, 0x5b11d51b, 0x2f4c,0x4452, 0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);")
  80. cpp_quote("DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main10, 0x107af0e0, 0xef1a,0x4d19, 0xab,0xa8,0x67,0xa1,0x63,0x07,0x3d,0x13);")
  81. cpp_quote("DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0,0x4585, 0x87,0x6d,0x83,0xaa,0x6d,0x60,0xb8,0x9e);")
  82. cpp_quote("DEFINE_GUID(DXVA2_ModeVP9_VLD_10bit_Profile2, 0xa4c749ef, 0x6ecf,0x48aa, 0x84,0x48,0x50,0xa7,0xa1,0x16,0x5f,0xf7);")
  83. cpp_quote("DEFINE_GUID(DXVA2_ModeVP8_VLD, 0x90b899ea, 0x3a62,0x4705, 0x88,0xb3,0x8d,0xf0,0x4b,0x27,0x44,0xe7);")
  84. cpp_quote("#ifndef REFERENCE_TIME_DEFINED")
  85. cpp_quote("#define REFERENCE_TIME_DEFINED")
  86. typedef LONGLONG REFERENCE_TIME;
  87. cpp_quote("#endif")
  88. /* DXVA2-specific error codes */
  89. cpp_quote("#define DXVA2_E_NOT_INITIALIZED ((HRESULT)0x80041000)")
  90. cpp_quote("#define DXVA2_E_NEW_VIDEO_DEVICE ((HRESULT)0x80041001)")
  91. cpp_quote("#define DXVA2_E_VIDEO_DEVICE_LOCKED ((HRESULT)0x80041002)")
  92. cpp_quote("#define DXVA2_E_NOT_AVAILABLE ((HRESULT)0x80041003)")
  93. enum
  94. {
  95. DXVA2_PictureParametersBufferType,
  96. DXVA2_MacroBlockControlBufferType,
  97. DXVA2_ResidualDifferenceBufferType,
  98. DXVA2_DeblockingControlBufferType,
  99. DXVA2_InverseQuantizationMatrixBufferType,
  100. DXVA2_SliceControlBufferType,
  101. DXVA2_BitStreamDateBufferType,
  102. DXVA2_MotionVectorBuffer,
  103. DXVA2_FilmGrainBuffer
  104. };
  105. enum
  106. {
  107. DXVA2_VideoDecoderRenderTarget,
  108. DXVA2_VideoProcessorRenderTarget,
  109. DXVA2_VideoSoftwareRenderTarget
  110. };
  111. typedef struct _DXVA2_ExtendedFormat
  112. {
  113. union
  114. {
  115. struct
  116. {
  117. UINT SampleFormat :8;
  118. UINT VideoChromaSubsampling :4;
  119. UINT NominalRange :3;
  120. UINT VideoTransferMatrix :3;
  121. UINT VideoLighting :4;
  122. UINT VideoPrimaries :5;
  123. UINT VideoTransferFunction :5;
  124. };
  125. UINT value;
  126. };
  127. } DXVA2_ExtendedFormat;
  128. typedef enum _DXVA2_SampleFormat
  129. {
  130. DXVA2_SampleFormatMask = 0x00FF,
  131. DXVA2_SampleUnknown = 0,
  132. DXVA2_SampleProgressiveFrame = 2,
  133. DXVA2_SampleFieldInterleavedEvenFirst = 3,
  134. DXVA2_SampleFieldInterleavedOddFirst = 4,
  135. DXVA2_SampleFieldSingleEven = 5,
  136. DXVA2_SampleFieldSingleOdd = 6,
  137. DXVA2_SampleSubStream = 7
  138. } DXVA2_SampleFormat;
  139. typedef enum _DXVA2_VideoChromaSubSampling
  140. {
  141. DXVA2_VideoChromaSubsamplingMask = 0x0F,
  142. DXVA2_VideoChromaSubsampling_Unknown = 0,
  143. DXVA2_VideoChromaSubsampling_ProgressiveChroma = 0x8,
  144. DXVA2_VideoChromaSubsampling_Horizontally_Cosited = 0x4,
  145. DXVA2_VideoChromaSubsampling_Vertically_Cosited = 0x2,
  146. DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1,
  147. DXVA2_VideoChromaSubsampling_MPEG2 = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
  148. DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
  149. DXVA2_VideoChromaSubsampling_MPEG1 = DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
  150. DXVA2_VideoChromaSubsampling_DV_PAL = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
  151. DXVA2_VideoChromaSubsampling_Vertically_Cosited,
  152. DXVA2_VideoChromaSubsampling_Cosited = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
  153. DXVA2_VideoChromaSubsampling_Vertically_Cosited |
  154. DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
  155. } DXVA2_VideoChromaSubSampling;
  156. typedef enum _DXVA2_NominalRange
  157. {
  158. DXVA2_NominalRangeMask = 0x07,
  159. DXVA2_NominalRange_Unknown = 0,
  160. DXVA2_NominalRange_Normal = 1,
  161. DXVA2_NominalRange_Wide = 2,
  162. DXVA2_NominalRange_0_255 = 1,
  163. DXVA2_NominalRange_16_235 = 2,
  164. DXVA2_NominalRange_48_208 = 3
  165. } DXVA2_NominalRange;
  166. typedef enum _DXVA2_VideoTransferMatrix
  167. {
  168. DXVA2_VideoTransferMatrixMask = 0x07,
  169. DXVA2_VideoTransferMatrix_Unknown = 0,
  170. DXVA2_VideoTransferMatrix_BT709 = 1,
  171. DXVA2_VideoTransferMatrix_BT601 = 2,
  172. DXVA2_VideoTransferMatrix_SMPTE240M = 3
  173. } DXVA2_VideoTransferMatrix;
  174. typedef enum _DXVA2_VideoLighting
  175. {
  176. DXVA2_VideoLightingMask = 0x0F,
  177. DXVA2_VideoLighting_Unknown = 0,
  178. DXVA2_VideoLighting_bright = 1,
  179. DXVA2_VideoLighting_office = 2,
  180. DXVA2_VideoLighting_dim = 3,
  181. DXVA2_VideoLighting_dark = 4
  182. } DXVA2_VideoLighting;
  183. typedef enum _DXVA2_VideoPrimaries
  184. {
  185. DXVA2_VideoPrimariesMask = 0x001f,
  186. DXVA2_VideoPrimaries_Unknown = 0,
  187. DXVA2_VideoPrimaries_reserved = 1,
  188. DXVA2_VideoPrimaries_BT709 = 2,
  189. DXVA2_VideoPrimaries_BT470_2_SysM = 3,
  190. DXVA2_VideoPrimaries_BT470_2_SysBG = 4,
  191. DXVA2_VideoPrimaries_SMPTE170M = 5,
  192. DXVA2_VideoPrimaries_SMPTE240M = 6,
  193. DXVA2_VideoPrimaries_EBU3213 = 7,
  194. DXVA2_VideoPrimaries_SMPTE_C = 8
  195. } DXVA2_VideoPrimaries;
  196. typedef enum _DXVA2_VideoTransferFunction
  197. {
  198. DXVA2_VideoTransFuncMask = 0x001f,
  199. DXVA2_VideoTransFunc_Unknown = 0,
  200. DXVA2_VideoTransFunc_10 = 1,
  201. DXVA2_VideoTransFunc_18 = 2,
  202. DXVA2_VideoTransFunc_20 = 3,
  203. DXVA2_VideoTransFunc_22 = 4,
  204. DXVA2_VideoTransFunc_709 = 5,
  205. DXVA2_VideoTransFunc_240M = 6,
  206. DXVA2_VideoTransFunc_sRGB = 7,
  207. DXVA2_VideoTransFunc_28 = 8
  208. } DXVA2_VideoTransferFunction;
  209. cpp_quote("#define DXVA2_VideoTransFunc_22_709 DXVA2_VideoTransFunc_709")
  210. cpp_quote("#define DXVA2_VideoTransFunc_22_240M DXVA2_VideoTransFunc_240M")
  211. cpp_quote("#define DXVA2_VideoTransFunc_22_8bit_sRGB DXVA2_VideoTransFunc_sRGB")
  212. typedef struct _DXVA2_Frequency
  213. {
  214. UINT Numerator;
  215. UINT Denominator;
  216. } DXVA2_Frequency;
  217. typedef struct _DXVA2_ConfigPictureDecode
  218. {
  219. GUID guidConfigBitstreamEncryption;
  220. GUID guidConfigMBcontrolEncryption;
  221. GUID guidConfigResidDiffEncryption;
  222. UINT ConfigBitstreamRaw;
  223. UINT ConfigMBcontrolRasterOrder;
  224. UINT ConfigResidDiffHost;
  225. UINT ConfigSpatialResid8;
  226. UINT ConfigResid8Subtraction;
  227. UINT ConfigSpatialHost8or9Clipping;
  228. UINT ConfigSpatialResidInterleaved;
  229. UINT ConfigIntraResidUnsigned;
  230. UINT ConfigResidDiffAccelerator;
  231. UINT ConfigHostInverseScan;
  232. UINT ConfigSpecificIDCT;
  233. UINT Config4GroupedCoefs;
  234. UINT ConfigMinRenderTargetBuffCount;
  235. USHORT ConfigDecoderSpecific;
  236. } DXVA2_ConfigPictureDecode;
  237. typedef struct _DXVA2_VideoDesc
  238. {
  239. UINT SampleWidth;
  240. UINT SampleHeight;
  241. DXVA2_ExtendedFormat SampleFormat;
  242. D3DFORMAT Format;
  243. DXVA2_Frequency InputSampleFreq;
  244. DXVA2_Frequency OutputFrameFreq;
  245. UINT UABProtectionLevel;
  246. UINT Reserved;
  247. } DXVA2_VideoDesc;
  248. enum
  249. {
  250. DXVA2_DeinterlaceTech_Unknown = 0x0000,
  251. DXVA2_DeinterlaceTech_BOBLineReplicate = 0x0001,
  252. DXVA2_DeinterlaceTech_BOBVerticalStretch = 0x0002,
  253. DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap = 0x0004,
  254. DXVA2_DeinterlaceTech_MedianFiltering = 0x0008,
  255. DXVA2_DeinterlaceTech_EdgeFiltering = 0x0010,
  256. DXVA2_DeinterlaceTech_FieldAdaptive = 0x0020,
  257. DXVA2_DeinterlaceTech_PixelAdaptive = 0x0040,
  258. DXVA2_DeinterlaceTech_MotionVectorSteered = 0x0080,
  259. DXVA2_DeinterlaceTech_InverseTelecine = 0x0100,
  260. DXVA2_DeinterlaceTech_Mask = 0x01ff
  261. };
  262. enum
  263. {
  264. DXVA2_NoiseFilterLumaLevel = 1,
  265. DXVA2_NoiseFilterLumaThreshold = 2,
  266. DXVA2_NoiseFilterLumaRadius = 3,
  267. DXVA2_NoiseFilterChromaLevel = 4,
  268. DXVA2_NoiseFilterChromaThreshold = 5,
  269. DXVA2_NoiseFilterChromaRadius = 6,
  270. DXVA2_DetailFilterLumaLevel = 7,
  271. DXVA2_DetailFilterLumaThreshold = 8,
  272. DXVA2_DetailFilterLumaRadius = 9,
  273. DXVA2_DetailFilterChromaLevel = 10,
  274. DXVA2_DetailFilterChromaThreshold = 11,
  275. DXVA2_DetailFilterChromaRadius = 12
  276. };
  277. enum
  278. {
  279. DXVA2_NoiseFilterTech_Unsupported = 0,
  280. DXVA2_NoiseFilterTech_Unknown = 0x0001,
  281. DXVA2_NoiseFilterTech_Median = 0x0002,
  282. DXVA2_NoiseFilterTech_Temporal = 0x0004,
  283. DXVA2_NoiseFilterTech_BlockNoise = 0x0008,
  284. DXVA2_NoiseFilterTech_MosquitoNoise = 0x0010,
  285. DXVA2_NoiseFilterTech_Mask = 0x001f
  286. };
  287. enum
  288. {
  289. DXVA2_DetailFilterTech_Unsupported = 0,
  290. DXVA2_DetailFilterTech_Unknown = 0x0001,
  291. DXVA2_DetailFilterTech_Edge = 0x0002,
  292. DXVA2_DetailFilterTech_Sharpening = 0x0004,
  293. DXVA2_DetailFilterTech_Mask = 0x0007
  294. };
  295. enum
  296. {
  297. DXVA2_ProcAmp_None = 0x0000,
  298. DXVA2_ProcAmp_Brightness = 0x0001,
  299. DXVA2_ProcAmp_Contrast = 0x0002,
  300. DXVA2_ProcAmp_Hue = 0x0004,
  301. DXVA2_ProcAmp_Saturation = 0x0008,
  302. DXVA2_ProcAmp_Mask = 0x000f
  303. };
  304. enum
  305. {
  306. DXVA2_VideoProcess_None = 0x0000,
  307. DXVA2_VideoProcess_YUV2RGB = 0x0001,
  308. DXVA2_VideoProcess_StretchX = 0x0002,
  309. DXVA2_VideoProcess_StretchY = 0x0004,
  310. DXVA2_VideoProcess_AlphaBlend = 0x0008,
  311. DXVA2_VideoProcess_SubRects = 0x0010,
  312. DXVA2_VideoProcess_SubStreams = 0x0020,
  313. DXVA2_VideoProcess_SubStreamsExtended = 0x0040,
  314. DXVA2_VideoProcess_YUV2RGBExtended = 0x0080,
  315. DXVA2_VideoProcess_AlphaBlendExtended = 0x0100,
  316. DXVA2_VideoProcess_Constriction = 0x0200,
  317. DXVA2_VideoProcess_NoiseFilter = 0x0400,
  318. DXVA2_VideoProcess_DetailFilter = 0x0800,
  319. DXVA2_VideoProcess_PlanarAlpha = 0x1000,
  320. DXVA2_VideoProcess_LinearScaling = 0x2000,
  321. DXVA2_VideoProcess_GammaCompensated = 0x4000,
  322. DXVA2_VideoProcess_MaintainsOriginalFieldData = 0x8000,
  323. DXVA2_VideoProcess_Mask = 0xffff
  324. };
  325. enum
  326. {
  327. DXVA2_VPDev_HardwareDevice = 0x0001,
  328. DXVA2_VPDev_EmulatedDXVA1 = 0x0002,
  329. DXVA2_VPDev_SoftwareDevice = 0x0004,
  330. DXVA2_VPDev_Mask = 0x0007
  331. };
  332. enum
  333. {
  334. DXVA2_SampleData_RFF = 0x0001,
  335. DXVA2_SampleData_TFF = 0x0002,
  336. DXVA2_SampleData_RFF_TFF_Present = 0x0004,
  337. DXVA2_SampleData_Mask = 0xffff
  338. };
  339. enum
  340. {
  341. DXVA2_DestData_RFF = 0x0001,
  342. DXVA2_DestData_TFF = 0x0002,
  343. DXVA2_DestData_RFF_TFF_Present = 0x0004,
  344. DXVA2_DestData_Mask = 0xffff
  345. };
  346. typedef struct _DXVA2_DecodeBufferDesc
  347. {
  348. DWORD CompressedBufferType;
  349. UINT BufferIndex;
  350. UINT DataOffset;
  351. UINT DataSize;
  352. UINT FirstMBaddress;
  353. UINT NumMBsInBuffer;
  354. UINT Width;
  355. UINT Height;
  356. UINT Stride;
  357. UINT ReservedBits;
  358. PVOID pvPVPState;
  359. } DXVA2_DecodeBufferDesc;
  360. typedef struct _DXVA2_AES_CTR_IV
  361. {
  362. UINT64 IV;
  363. UINT64 Count;
  364. } DXVA2_AES_CTR_IV;
  365. typedef struct _DXVA2_DecodeExtensionData
  366. {
  367. UINT Function;
  368. PVOID pPrivateInputData;
  369. UINT PrivateInputDataSize;
  370. PVOID pPrivateOutputData;
  371. UINT PrivateOutputDataSize;
  372. } DXVA2_DecodeExtensionData;
  373. typedef struct _DXVA2_DecodeExecuteParams
  374. {
  375. UINT NumCompBuffers;
  376. DXVA2_DecodeBufferDesc* pCompressedBuffers;
  377. DXVA2_DecodeExtensionData* pExtensionData;
  378. } DXVA2_DecodeExecuteParams;
  379. typedef struct _DXVA2_VideoProcessorCaps
  380. {
  381. UINT DeviceCaps;
  382. D3DPOOL InputPool;
  383. UINT NumForwardRefSamples;
  384. UINT NumBackwardRefSamples;
  385. UINT Reserved;
  386. UINT DeinterlaceTechnology;
  387. UINT ProcAmpControlCaps;
  388. UINT VideoProcessorOperations;
  389. UINT NoiseFilterTechnology;
  390. UINT DetailFilterTechnology;
  391. } DXVA2_VideoProcessorCaps;
  392. typedef struct _DXVA2_Fixed32
  393. {
  394. union
  395. {
  396. struct
  397. {
  398. USHORT Fraction;
  399. SHORT Value;
  400. };
  401. LONG ll;
  402. };
  403. } DXVA2_Fixed32;
  404. typedef struct _DXVA2_ValueRange
  405. {
  406. DXVA2_Fixed32 MinValue;
  407. DXVA2_Fixed32 MaxValue;
  408. DXVA2_Fixed32 DefaultValue;
  409. DXVA2_Fixed32 StepSize;
  410. } DXVA2_ValueRange;
  411. typedef struct _DXVA2_AYUVSample8
  412. {
  413. UCHAR Cr;
  414. UCHAR Cb;
  415. UCHAR Y;
  416. UCHAR Alpha;
  417. } DXVA2_AYUVSample8;
  418. typedef struct _DXVA2_AYUVSample16
  419. {
  420. USHORT Cr;
  421. USHORT Cb;
  422. USHORT Y;
  423. USHORT Alpha;
  424. } DXVA2_AYUVSample16;
  425. typedef struct _DXVA2_ProcAmpValues
  426. {
  427. DXVA2_Fixed32 Brightness;
  428. DXVA2_Fixed32 Contrast;
  429. DXVA2_Fixed32 Hue;
  430. DXVA2_Fixed32 Saturation;
  431. } DXVA2_ProcAmpValues;
  432. typedef struct _DXVA2_FilterValues
  433. {
  434. DXVA2_Fixed32 Level;
  435. DXVA2_Fixed32 Threshold;
  436. DXVA2_Fixed32 Radius;
  437. } DXVA2_FilterValues;
  438. typedef struct _DXVA2_VideoProcessBltParams
  439. {
  440. REFERENCE_TIME TargetFrame;
  441. RECT TargetRect;
  442. SIZE ConstrictionSize;
  443. UINT StreamingFlags;
  444. DXVA2_AYUVSample16 BackgroundColor;
  445. DXVA2_ExtendedFormat DestFormat;
  446. DXVA2_ProcAmpValues ProcAmpValues;
  447. DXVA2_Fixed32 Alpha;
  448. DXVA2_FilterValues NoiseFilterLuma;
  449. DXVA2_FilterValues NoiseFilterChroma;
  450. DXVA2_FilterValues DetailFilterLuma;
  451. DXVA2_FilterValues DetailFilterChroma;
  452. DWORD DestData;
  453. } DXVA2_VideoProcessBltParams;
  454. cpp_quote("#ifdef _D3D9_H_")
  455. typedef struct _DXVA2_VideoSample
  456. {
  457. REFERENCE_TIME Start;
  458. REFERENCE_TIME End;
  459. DXVA2_ExtendedFormat SampleFormat;
  460. IDirect3DSurface9* SrcSurface;
  461. RECT SrcRect;
  462. RECT DstRect;
  463. DXVA2_AYUVSample8 Pal[16];
  464. DXVA2_Fixed32 PlanarAlpha;
  465. DWORD SampleData;
  466. } DXVA2_VideoSample;
  467. typedef enum
  468. {
  469. DXVA2_SurfaceType_DecoderRenderTarget,
  470. DXVA2_SurfaceType_ProcessorRenderTarget,
  471. DXVA2_SurfaceType_D3DRenderTargetTexture,
  472. } DXVA2_SurfaceType;
  473. interface IDirect3DDeviceManager9;
  474. interface IDirectXVideoAccelerationService;
  475. interface IDirectXVideoDecoderService;
  476. interface IDirectXVideoProcessorService;
  477. interface IDirectXVideoDecoder;
  478. interface IDirectXVideoProcessor;
  479. /*****************************************************************************
  480. * IDirect3DDeviceManager9 interface
  481. */
  482. [
  483. object,
  484. uuid(a0cade0f-06d5-4cf4-a1c7-f3cdd725aa75),
  485. local
  486. ]
  487. interface IDirect3DDeviceManager9 : IUnknown
  488. {
  489. HRESULT ResetDevice(
  490. [in] IDirect3DDevice9* pDevice,
  491. [in] UINT resetToken);
  492. HRESULT OpenDeviceHandle(
  493. [out] HANDLE* phDevice);
  494. HRESULT CloseDeviceHandle(
  495. [in] HANDLE hDevice);
  496. HRESULT TestDevice(
  497. [in] HANDLE hDevice);
  498. HRESULT LockDevice(
  499. [in] HANDLE hDevice,
  500. [out] IDirect3DDevice9** ppDevice,
  501. [in] BOOL fBlock);
  502. HRESULT UnlockDevice(
  503. [in] HANDLE hDevice,
  504. [in] BOOL fSaveState);
  505. HRESULT GetVideoService(
  506. [in] HANDLE hDevice,
  507. [in] REFIID riid,
  508. [out] void** ppService);
  509. }
  510. /*****************************************************************************
  511. * IDirectXVideoAccelerationService interface
  512. */
  513. [
  514. object,
  515. uuid(fc51a550-d5e7-11d9-af55-00054e43ff02),
  516. local
  517. ]
  518. interface IDirectXVideoAccelerationService : IUnknown
  519. {
  520. HRESULT CreateSurface(
  521. [in] UINT width,
  522. [in] UINT height,
  523. [in] UINT backBuffers,
  524. [in] D3DFORMAT format,
  525. [in] D3DPOOL pool,
  526. [in] DWORD usage,
  527. [in] DWORD dxvaType,
  528. [out] IDirect3DSurface9 **ppSurface,
  529. [in, out] HANDLE *pSharedHandle);
  530. }
  531. /*****************************************************************************
  532. * IDirectXVideoDecoderService interface
  533. */
  534. [
  535. object,
  536. uuid(fc51a551-d5e7-11d9-af55-00054e43ff02),
  537. local
  538. ]
  539. interface IDirectXVideoDecoderService : IDirectXVideoAccelerationService
  540. {
  541. HRESULT GetDecoderDeviceGuids(
  542. [out] UINT *count,
  543. [out] GUID **pGuids);
  544. HRESULT GetDecoderRenderTargets(
  545. [in] REFGUID guid,
  546. [out] UINT *pCount,
  547. [out] D3DFORMAT **pFormats);
  548. HRESULT GetDecoderConfigurations(
  549. [in] REFGUID guid,
  550. [in] const DXVA2_VideoDesc *pVideoDesc,
  551. [in] void *pReserved,
  552. [out] UINT *pCount,
  553. [out] DXVA2_ConfigPictureDecode **ppConfigs);
  554. HRESULT CreateVideoDecoder(
  555. [in] REFGUID guid,
  556. [in] const DXVA2_VideoDesc *pVideoDesc,
  557. [in] const DXVA2_ConfigPictureDecode *pConfig,
  558. [in] IDirect3DSurface9 **ppDecoderRenderTargets,
  559. [in] UINT NumSurfaces,
  560. [out] IDirectXVideoDecoder **ppDecode);
  561. }
  562. /*****************************************************************************
  563. * IDirectXVideoDecoder interface
  564. */
  565. [
  566. object,
  567. uuid(f2b0810a-fd00-43c9-918c-df94e2d8ef7d),
  568. local
  569. ]
  570. interface IDirectXVideoDecoder : IUnknown
  571. {
  572. HRESULT GetVideoDecoderService(
  573. [out] IDirectXVideoDecoderService** ppService);
  574. HRESULT GetCreationParameters(
  575. [out] GUID* pDeviceGuid,
  576. [out] DXVA2_VideoDesc* pVideoDesc,
  577. [out] DXVA2_ConfigPictureDecode* pConfig,
  578. [out] IDirect3DSurface9*** pDecoderRenderTargets,
  579. [out] UINT* pNumSurfaces);
  580. HRESULT GetBuffer(
  581. [in] UINT BufferType,
  582. [out] void** ppBuffer,
  583. [out] UINT* pBufferSize);
  584. HRESULT ReleaseBuffer(
  585. [in] UINT BufferType);
  586. HRESULT BeginFrame(
  587. [in] IDirect3DSurface9* pRenderTarget,
  588. [in] void* pvPVPData);
  589. HRESULT EndFrame(
  590. [out] HANDLE* pHandleComplete);
  591. HRESULT Execute(
  592. [in] const DXVA2_DecodeExecuteParams* pExecuteParams);
  593. }
  594. /*****************************************************************************
  595. * IDirectXVideoProcessorService interface
  596. */
  597. [
  598. object,
  599. uuid(fc51a552-d5e7-11d9-af55-00054e43ff02),
  600. local
  601. ]
  602. interface IDirectXVideoProcessorService : IDirectXVideoAccelerationService
  603. {
  604. HRESULT RegisterVideoProcessorSoftwareDevice(
  605. [in] void* pCallbacks);
  606. HRESULT GetVideoProcessorDeviceGuids(
  607. [in] const DXVA2_VideoDesc* pVideoDesc,
  608. [out] UINT* pCount,
  609. [out] GUID** pGuids);
  610. HRESULT GetVideoProcessorRenderTargets(
  611. [in] REFGUID VideoProcDeviceGuid,
  612. [in] const DXVA2_VideoDesc* pVideoDesc,
  613. [out] UINT* pCount,
  614. [out] D3DFORMAT** pFormats);
  615. HRESULT GetVideoProcessorSubStreamFormats(
  616. [in] REFGUID VideoProcDeviceGuid,
  617. [in] const DXVA2_VideoDesc* pVideoDesc,
  618. [in] D3DFORMAT RenderTargetFormat,
  619. [out] UINT* pCount,
  620. [out] D3DFORMAT** pFormats);
  621. HRESULT GetVideoProcessorCaps(
  622. [in] REFGUID VideoProcDeviceGuid,
  623. [in] const DXVA2_VideoDesc* pVideoDesc,
  624. [in] D3DFORMAT RenderTargetFormat,
  625. [out] DXVA2_VideoProcessorCaps* pCaps);
  626. HRESULT GetProcAmpRange(
  627. [in] REFGUID VideoProcDeviceGuid,
  628. [in] const DXVA2_VideoDesc* pVideoDesc,
  629. [in] D3DFORMAT RenderTargetFormat,
  630. [in] UINT ProcAmpCap,
  631. [out] DXVA2_ValueRange* pRange);
  632. HRESULT GetFilterPropertyRange(
  633. [in] REFGUID VideoProcDeviceGuid,
  634. [in] const DXVA2_VideoDesc* pVideoDesc,
  635. [in] D3DFORMAT renderTargetFormat,
  636. [in] UINT FilterSetting,
  637. [out] DXVA2_ValueRange* pRange);
  638. HRESULT CreateVideoProcessor(
  639. [in] REFGUID VideoProcDeviceGuid,
  640. [in] const DXVA2_VideoDesc* pVideoDesc,
  641. [in] D3DFORMAT RenderTargetFormat,
  642. [in] UINT MaxNumSubStreams,
  643. [out] IDirectXVideoProcessor** ppVidProcess);
  644. }
  645. /*****************************************************************************
  646. * IDirectXVideoProcessor interface
  647. */
  648. [
  649. object,
  650. uuid(8c3a39f0-916e-4690-804f-4c8001355d25),
  651. local
  652. ]
  653. interface IDirectXVideoProcessor : IUnknown
  654. {
  655. HRESULT GetVideoProcessorService(
  656. [out] IDirectXVideoProcessorService** ppService);
  657. HRESULT GetCreationParameters(
  658. [out] GUID* pDeviceGuid,
  659. [out] DXVA2_VideoDesc* pVideoDesc,
  660. [out] D3DFORMAT* pRenderTargetFormat,
  661. [out] UINT* pMaxNumSubStreams);
  662. HRESULT GetVideoProcessorCaps(
  663. [out] DXVA2_VideoProcessorCaps* pCaps);
  664. HRESULT GetProcAmpRange(
  665. [in] UINT ProcAmpCap,
  666. [out] DXVA2_ValueRange* pRange);
  667. HRESULT GetFilterPropertyRange(
  668. [in] UINT FilterSetting,
  669. [out] DXVA2_ValueRange* pRange);
  670. HRESULT VideoProcessBlt(
  671. [in] IDirect3DSurface9* pRenderTarget,
  672. [in] const DXVA2_VideoProcessBltParams* pBltParams,
  673. [in] const DXVA2_VideoSample* pSamples,
  674. [in] UINT NumSamples,
  675. [out] HANDLE* pHandleComplete);
  676. }
  677. /*****************************************************************************
  678. * IDirectXVideoMemoryConfiguration interface
  679. */
  680. [
  681. object,
  682. uuid(b7f916dd-db3b-49c1-84d7-e45ef99ec726),
  683. local
  684. ]
  685. interface IDirectXVideoMemoryConfiguration : IUnknown
  686. {
  687. HRESULT GetAvailableSurfaceTypeByIndex(
  688. [in] DWORD wTypeIndex,
  689. [out] DXVA2_SurfaceType *pdwType);
  690. HRESULT SetSurfaceType(
  691. [in] DXVA2_SurfaceType dwType);
  692. }
  693. cpp_quote("HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *pResetToken,IDirect3DDeviceManager9 **ppDXVAManager);")
  694. cpp_quote("HRESULT WINAPI DXVA2CreateVideoService(IDirect3DDevice9 *pDD,REFIID riid,void **ppService);")
  695. cpp_quote("#endif")
  696. cpp_quote("static inline DXVA2_Fixed32 DXVA2_Fixed32OpaqueAlpha(void) {")
  697. cpp_quote(" DXVA2_Fixed32 f32;")
  698. cpp_quote(" f32.ll = 0 + (1 << 16);")
  699. cpp_quote(" return f32;")
  700. cpp_quote("}")
  701. cpp_quote("")
  702. cpp_quote("static inline DXVA2_Fixed32 DXVA2_Fixed32TransparentAlpha(void) {")
  703. cpp_quote(" DXVA2_Fixed32 f32;")
  704. cpp_quote(" f32.ll = 0;")
  705. cpp_quote(" return f32;")
  706. cpp_quote("}")
  707. cpp_quote("")
  708. cpp_quote("static inline float DXVA2FixedToFloat(DXVA2_Fixed32 f32) {")
  709. cpp_quote(" return (float)f32.Value + (float)f32.Fraction / (1 << 16);")
  710. cpp_quote("}")
  711. cpp_quote("")
  712. cpp_quote("static inline DXVA2_Fixed32 DXVA2FloatToFixed(float f) {")
  713. cpp_quote(" DXVA2_Fixed32 f32;")
  714. cpp_quote(" f32.Value = ((ULONG) (f * (1 << 16))) >> 16;")
  715. cpp_quote(" f32.Fraction = ((ULONG) (f * (1 << 16))) & 0xFFFF;")
  716. cpp_quote(" return f32;")
  717. cpp_quote("}")