WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / libhb / dxva2api.h
blob14ea80ad2e5efc7f78d9c8717810d1efd6aafb67
1 /* dxva2api.h
3 Copyright (c) 2003-2015 HandBrake Team
4 This file is part of the HandBrake source code
5 Homepage: <http://handbrake.fr/>.
6 It may be used under the terms of the GNU General Public License v2.
7 For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
9 Authors: Peng Gao <peng@multicorewareinc.com> <http://www.multicorewareinc.com/>
10 Li Cao <li@multicorewareinc.com> <http://www.multicorewareinc.com/>
15 #ifndef _DXVA2API_H
16 #define _DXVA2API_H
17 #ifdef USE_HWD
18 #define MINGW_DXVA2API_H_VERSION (2)
20 #if __GNUC__ >= 3
21 #pragma GCC system_header
22 #endif
24 #include <objbase.h>
25 #include <d3d9.h>
27 /* Define it to allow using nameless struct/union (non C99 compliant) to match
28 * the official documentation. */
29 //#define DXVA2API_USE_BITFIELDS
31 /****************STRUCTURES******************/
32 #pragma pack(push, 1)
34 #define DXVA2API_USE_BITFIELDS
36 typedef struct _DXVA2_ExtendedFormat {
37 #ifdef DXVA2API_USE_BITFIELDS
38 union {
39 struct {
40 UINT SampleFormat : 8;
41 UINT VideoChromaSubsampling : 4;
42 UINT NominalRange : 3;
43 UINT VideoTransferMatrix : 3;
44 UINT VideoLighting : 4;
45 UINT VideoPrimaries : 5;
46 UINT VideoTransferFunction : 5;
48 UINT value;
50 #else
51 UINT value;
52 #endif
53 } DXVA2_ExtendedFormat;
55 typedef struct _DXVA2_Frequency {
56 UINT Numerator;
57 UINT Denominator;
58 } DXVA2_Frequency;
60 typedef struct _DXVA2_VideoDesc {
61 UINT SampleWidth;
62 UINT SampleHeight;
63 DXVA2_ExtendedFormat SampleFormat;
64 D3DFORMAT Format;
65 DXVA2_Frequency InputSampleFreq;
66 DXVA2_Frequency OutputFrameFreq;
67 UINT UABProtectionLevel;
68 UINT Reserved;
69 } DXVA2_VideoDesc;
71 typedef struct _DXVA2_ConfigPictureDecode {
72 GUID guidConfigBitstreamEncryption;
73 GUID guidConfigMBcontrolEncryption;
74 GUID guidConfigResidDiffEncryption;
75 UINT ConfigBitstreamRaw;
76 UINT ConfigMBcontrolRasterOrder;
77 UINT ConfigResidDiffHost;
78 UINT ConfigSpatialResid8;
79 UINT ConfigResid8Subtraction;
80 UINT ConfigSpatialHost8or9Clipping;
81 UINT ConfigSpatialResidInterleaved;
82 UINT ConfigIntraResidUnsigned;
83 UINT ConfigResidDiffAccelerator;
84 UINT ConfigHostInverseScan;
85 UINT ConfigSpecificIDCT;
86 UINT Config4GroupedCoefs;
87 USHORT ConfigMinRenderTargetBuffCount;
88 USHORT ConfigDecoderSpecific;
89 } DXVA2_ConfigPictureDecode;
91 typedef struct _DXVA2_DecodeBufferDesc {
92 DWORD CompressedBufferType;
93 UINT BufferIndex;
94 UINT DataOffset;
95 UINT DataSize;
96 UINT FirstMBaddress;
97 UINT NumMBsInBuffer;
98 UINT Width;
99 UINT Height;
100 UINT Stride;
101 UINT ReservedBits;
102 PVOID pvPVPState;
103 } DXVA2_DecodeBufferDesc;
105 typedef struct _DXVA2_DecodeExtensionData {
106 UINT Function;
107 PVOID pPrivateInputData;
108 UINT PrivateInputDataSize;
109 PVOID pPrivateOutputData;
110 UINT PrivateOutputDataSize;
111 } DXVA2_DecodeExtensionData;
113 typedef struct _DXVA2_DecodeExecuteParams {
114 UINT NumCompBuffers;
115 DXVA2_DecodeBufferDesc *pCompressedBuffers;
116 DXVA2_DecodeExtensionData *pExtensionData;
117 } DXVA2_DecodeExecuteParams;
119 enum {
120 DXVA2_VideoDecoderRenderTarget = 0,
121 DXVA2_VideoProcessorRenderTarget= 1,
122 DXVA2_VideoSoftwareRenderTarget = 2
125 enum {
126 DXVA2_PictureParametersBufferType = 0,
127 DXVA2_MacroBlockControlBufferType = 1,
128 DXVA2_ResidualDifferenceBufferType = 2,
129 DXVA2_DeblockingControlBufferType = 3,
130 DXVA2_InverseQuantizationMatrixBufferType = 4,
131 DXVA2_SliceControlBufferType = 5,
132 DXVA2_BitStreamDateBufferType = 6,
133 DXVA2_MotionVectorBuffer = 7,
134 DXVA2_FilmGrainBuffer = 8
137 /* DXVA MPEG-I/II and VC-1 */
138 typedef struct _DXVA_PictureParameters {
139 USHORT wDecodedPictureIndex;
140 USHORT wDeblockedPictureIndex;
141 USHORT wForwardRefPictureIndex;
142 USHORT wBackwardRefPictureIndex;
143 USHORT wPicWidthInMBminus1;
144 USHORT wPicHeightInMBminus1;
145 UCHAR bMacroblockWidthMinus1;
146 UCHAR bMacroblockHeightMinus1;
147 UCHAR bBlockWidthMinus1;
148 UCHAR bBlockHeightMinus1;
149 UCHAR bBPPminus1;
150 UCHAR bPicStructure;
151 UCHAR bSecondField;
152 UCHAR bPicIntra;
153 UCHAR bPicBackwardPrediction;
154 UCHAR bBidirectionalAveragingMode;
155 UCHAR bMVprecisionAndChromaRelation;
156 UCHAR bChromaFormat;
157 UCHAR bPicScanFixed;
158 UCHAR bPicScanMethod;
159 UCHAR bPicReadbackRequests;
160 UCHAR bRcontrol;
161 UCHAR bPicSpatialResid8;
162 UCHAR bPicOverflowBlocks;
163 UCHAR bPicExtrapolation;
164 UCHAR bPicDeblocked;
165 UCHAR bPicDeblockConfined;
166 UCHAR bPic4MVallowed;
167 UCHAR bPicOBMC;
168 UCHAR bPicBinPB;
169 UCHAR bMV_RPS;
170 UCHAR bReservedBits;
171 USHORT wBitstreamFcodes;
172 USHORT wBitstreamPCEelements;
173 UCHAR bBitstreamConcealmentNeed;
174 UCHAR bBitstreamConcealmentMethod;
175 } DXVA_PictureParameters, *LPDXVA_PictureParameters;
177 typedef struct _DXVA_QmatrixData {
178 BYTE bNewQmatrix[4];
179 WORD Qmatrix[4][8 * 8];
180 } DXVA_QmatrixData, *LPDXVA_QmatrixData;
182 typedef struct _DXVA_SliceInfo {
183 USHORT wHorizontalPosition;
184 USHORT wVerticalPosition;
185 UINT dwSliceBitsInBuffer;
186 UINT dwSliceDataLocation;
187 UCHAR bStartCodeBitOffset;
188 UCHAR bReservedBits;
189 USHORT wMBbitOffset;
190 USHORT wNumberMBsInSlice;
191 USHORT wQuantizerScaleCode;
192 USHORT wBadSliceChopping;
193 } DXVA_SliceInfo, *LPDXVA_SliceInfo;
195 /* DXVA H264 */
196 typedef struct {
197 #ifdef DXVA2API_USE_BITFIELDS
198 union {
199 struct {
200 UCHAR Index7Bits : 7;
201 UCHAR AssociatedFlag : 1;
203 UCHAR bPicEntry;
205 #else
206 UCHAR bPicEntry;
207 #endif
208 } DXVA_PicEntry_H264;
211 typedef struct {
212 USHORT wFrameWidthInMbsMinus1;
213 USHORT wFrameHeightInMbsMinus1;
214 DXVA_PicEntry_H264 CurrPic;
215 UCHAR num_ref_frames;
216 #ifdef DXVA2API_USE_BITFIELDS
217 union {
218 struct {
219 USHORT field_pic_flag : 1;
220 USHORT MbaffFrameFlag : 1;
221 USHORT residual_colour_transform_flag : 1;
222 USHORT sp_for_switch_flag : 1;
223 USHORT chroma_format_idc : 2;
224 USHORT RefPicFlag : 1;
225 USHORT constrained_intra_pred_flag : 1;
226 USHORT weighted_pred_flag : 1;
227 USHORT weighted_bipred_idc : 2;
228 USHORT MbsConsecutiveFlag : 1;
229 USHORT frame_mbs_only_flag : 1;
230 USHORT transform_8x8_mode_flag : 1;
231 USHORT MinLumaBipredSize8x8Flag : 1;
232 USHORT IntraPicFlag : 1;
234 USHORT wBitFields;
236 #else
237 USHORT wBitFields;
238 #endif
239 UCHAR bit_depth_luma_minus8;
240 UCHAR bit_depth_chroma_minus8;
241 USHORT Reserved16Bits;
242 UINT StatusReportFeedbackNumber;
243 DXVA_PicEntry_H264 RefFrameList[16];
244 INT CurrFieldOrderCnt[2];
245 INT FieldOrderCntList[16][2];
246 CHAR pic_init_qs_minus26;
247 CHAR chroma_qp_index_offset;
248 CHAR second_chroma_qp_index_offset;
249 UCHAR ContinuationFlag;
250 CHAR pic_init_qp_minus26;
251 UCHAR num_ref_idx_l0_active_minus1;
252 UCHAR num_ref_idx_l1_active_minus1;
253 UCHAR Reserved8BitsA;
254 USHORT FrameNumList[16];
256 UINT UsedForReferenceFlags;
257 USHORT NonExistingFrameFlags;
258 USHORT frame_num;
259 UCHAR log2_max_frame_num_minus4;
260 UCHAR pic_order_cnt_type;
261 UCHAR log2_max_pic_order_cnt_lsb_minus4;
262 UCHAR delta_pic_order_always_zero_flag;
263 UCHAR direct_8x8_inference_flag;
264 UCHAR entropy_coding_mode_flag;
265 UCHAR pic_order_present_flag;
266 UCHAR num_slice_groups_minus1;
267 UCHAR slice_group_map_type;
268 UCHAR deblocking_filter_control_present_flag;
269 UCHAR redundant_pic_cnt_present_flag;
270 UCHAR Reserved8BitsB;
271 USHORT slice_group_change_rate_minus1;
272 UCHAR SliceGroupMap[810];
273 } DXVA_PicParams_H264;
275 typedef struct {
276 UCHAR bScalingLists4x4[6][16];
277 UCHAR bScalingLists8x8[2][64];
278 } DXVA_Qmatrix_H264;
281 typedef struct {
282 UINT BSNALunitDataLocation;
283 UINT SliceBytesInBuffer;
284 USHORT wBadSliceChopping;
285 USHORT first_mb_in_slice;
286 USHORT NumMbsForSlice;
287 USHORT BitOffsetToSliceData;
288 UCHAR slice_type;
289 UCHAR luma_log2_weight_denom;
290 UCHAR chroma_log2_weight_denom;
292 UCHAR num_ref_idx_l0_active_minus1;
293 UCHAR num_ref_idx_l1_active_minus1;
294 CHAR slice_alpha_c0_offset_div2;
295 CHAR slice_beta_offset_div2;
296 UCHAR Reserved8Bits;
297 DXVA_PicEntry_H264 RefPicList[2][32];
298 SHORT Weights[2][32][3][2];
299 CHAR slice_qs_delta;
300 CHAR slice_qp_delta;
301 UCHAR redundant_pic_cnt;
302 UCHAR direct_spatial_mv_pred_flag;
303 UCHAR cabac_init_idc;
304 UCHAR disable_deblocking_filter_idc;
305 USHORT slice_id;
306 } DXVA_Slice_H264_Long;
308 typedef struct {
309 UINT BSNALunitDataLocation;
310 UINT SliceBytesInBuffer;
311 USHORT wBadSliceChopping;
312 } DXVA_Slice_H264_Short;
314 typedef struct {
315 USHORT wFrameWidthInMbsMinus1;
316 USHORT wFrameHeightInMbsMinus1;
317 DXVA_PicEntry_H264 InPic;
318 DXVA_PicEntry_H264 OutPic;
319 USHORT PicOrderCnt_offset;
320 INT CurrPicOrderCnt;
321 UINT StatusReportFeedbackNumber;
322 UCHAR model_id;
323 UCHAR separate_colour_description_present_flag;
324 UCHAR film_grain_bit_depth_luma_minus8;
325 UCHAR film_grain_bit_depth_chroma_minus8;
326 UCHAR film_grain_full_range_flag;
327 UCHAR film_grain_colour_primaries;
328 UCHAR film_grain_transfer_characteristics;
329 UCHAR film_grain_matrix_coefficients;
330 UCHAR blending_mode_id;
331 UCHAR log2_scale_factor;
332 UCHAR comp_model_present_flag[4];
333 UCHAR num_intensity_intervals_minus1[4];
334 UCHAR num_model_values_minus1[4];
335 UCHAR intensity_interval_lower_bound[3][16];
336 UCHAR intensity_interval_upper_bound[3][16];
337 SHORT comp_model_value[3][16][8];
338 } DXVA_FilmGrainChar_H264;
340 typedef struct {
341 union {
342 struct {
343 USHORT Fraction;
344 SHORT Value;
346 LONG ll;
348 }DXVA2_Fixed32;
350 typedef struct {
351 UCHAR Cr;
352 UCHAR Cb;
353 UCHAR Y;
354 UCHAR Alpha;
355 }DXVA2_AYUVSample8;
357 typedef struct {
358 USHORT Cr;
359 USHORT Cb;
360 USHORT Y;
361 USHORT Alpha;
362 }DXVA2_AYUVSample16;
364 typedef struct {
365 DXVA2_Fixed32 MinValue;
366 DXVA2_Fixed32 MaxValue;
367 DXVA2_Fixed32 DefaultValue;
368 DXVA2_Fixed32 StepSize;
369 }DXVA2_ValueRange;
371 typedef struct {
372 DXVA2_Fixed32 Brightness;
373 DXVA2_Fixed32 Contrast;
374 DXVA2_Fixed32 Hue;
375 DXVA2_Fixed32 Saturation;
376 }DXVA2_ProcAmpValues;
378 typedef struct {
379 DXVA2_Fixed32 Level;
380 DXVA2_Fixed32 Threshold;
381 DXVA2_Fixed32 Radius;
382 }DXVA2_FilterValues;
384 typedef struct {
385 UINT DeviceCaps;
386 D3DPOOL InputPool;
387 UINT NumForwardRefSamples;
388 UINT NumBackwardRefSamples;
389 UINT Reserved;
390 UINT DeinterlaceTechnology;
391 UINT ProcAmpControlCaps;
392 UINT VideoProcessorOperations;
393 UINT NoiseFilterTechnology;
394 UINT DetailFilterTechnology;
395 }DXVA2_VideoProcessorCaps;
397 #ifndef _REFERENCE_TIME_
398 #define _REFERENCE_TIME_
399 typedef long long int64_t;
400 typedef int64_t REFERENCE_TIME;
401 #endif
403 typedef struct {
404 REFERENCE_TIME Start;
405 REFERENCE_TIME End;
406 DXVA2_ExtendedFormat SampleFormat;
407 IDirect3DSurface9 *SrcSurface;
408 RECT SrcRect;
409 RECT DstRect;
410 DXVA2_AYUVSample8 Pal[16];
411 DXVA2_Fixed32 PlanarAlpha;
412 DWORD SampleData;
413 }DXVA2_VideoSample;
416 typedef struct {
417 REFERENCE_TIME TargetFrame;
418 RECT TargetRect;
419 SIZE ConstrictionSize;
420 UINT StreamingFlags;
421 DXVA2_AYUVSample16 BackgroundColor;
422 DXVA2_ExtendedFormat DestFormat;
423 DXVA2_ProcAmpValues ProcAmpValues;
424 DXVA2_Fixed32 Alpha;
425 DXVA2_FilterValues NoiseFilterLuma;
426 DXVA2_FilterValues NoiseFilterChroma;
427 DXVA2_FilterValues DetailFilterLuma;
428 DXVA2_FilterValues DetailFilterChroma;
429 DWORD DestData;
430 } DXVA2_VideoProcessBltParams;
432 #pragma pack(pop)
434 /*************INTERFACES************/
435 #ifdef __cplusplus
436 extern "C" {
437 #endif
438 #define _COM_interface struct
439 typedef _COM_interface IDirectXVideoDecoderService IDirectXVideoDecoderService;
440 typedef _COM_interface IDirectXVideoDecoder IDirectXVideoDecoder;
442 #undef INTERFACE
443 #define INTERFACE IDirectXVideoDecoder
444 DECLARE_INTERFACE_( IDirectXVideoDecoder, IUnknown )
446 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
447 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
448 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
449 STDMETHOD( GetVideoDecoderService ) ( THIS_ IDirectXVideoDecoderService** ) PURE;
450 STDMETHOD( GetCreationParameters ) ( THIS_ GUID*, DXVA2_VideoDesc*, DXVA2_ConfigPictureDecode*, IDirect3DSurface9***, UINT* ) PURE;
451 STDMETHOD( GetBuffer ) ( THIS_ UINT, void**, UINT* ) PURE;
452 STDMETHOD( ReleaseBuffer ) ( THIS_ UINT ) PURE;
453 STDMETHOD( BeginFrame ) ( THIS_ IDirect3DSurface9 *, void* ) PURE;
454 STDMETHOD( EndFrame ) ( THIS_ HANDLE * ) PURE;
455 STDMETHOD( Execute ) ( THIS_ const DXVA2_DecodeExecuteParams* ) PURE;
460 #if !defined(__cplusplus) || defined(CINTERFACE)
461 #define IDirectXVideoDecoder_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
462 #define IDirectXVideoDecoder_AddRef( p ) (p)->lpVtbl->AddRef( p )
463 #define IDirectXVideoDecoder_Release( p ) (p)->lpVtbl->Release( p )
464 #define IDirectXVideoDecoder_BeginFrame( p, a, b ) (p)->lpVtbl->BeginFrame( p, a, b )
465 #define IDirectXVideoDecoder_EndFrame( p, a ) (p)->lpVtbl->EndFrame( p, a )
466 #define IDirectXVideoDecoder_Execute( p, a ) (p)->lpVtbl->Execute( p, a )
467 #define IDirectXVideoDecoder_GetBuffer( p, a, b, c ) (p)->lpVtbl->GetBuffer( p, a, b, c )
468 #define IDirectXVideoDecoder_GetCreationParameters( p, a, b, c, d, e ) (p)->lpVtbl->GetCreationParameters( p, a, b, c, d, e )
469 #define IDirectXVideoDecoder_GetVideoDecoderService( p, a ) (p)->lpVtbl->GetVideoDecoderService( p, a )
470 #define IDirectXVideoDecoder_ReleaseBuffer( p, a ) (p)->lpVtbl->ReleaseBuffer( p, a )
471 #else
472 #define IDirectXVideoDecoder_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
473 #define IDirectXVideoDecoder_AddRef( p ) (p)->AddRef()
474 #define IDirectXVideoDecoder_Release( p ) (p)->Release()
475 #define IDirectXVideoDecoder_BeginFrame( p, a, b ) (p)->BeginFrame( a, b )
476 #define IDirectXVideoDecoder_EndFrame( p, a ) (p)->EndFrame( a )
477 #define IDirectXVideoDecoder_Execute( p, a ) (p)->Execute( a )
478 #define IDirectXVideoDecoder_GetBuffer( p, a, b, c ) (p)->GetBuffer( a, b, c )
479 #define IDirectXVideoDecoder_GetCreationParameters( p, a, b, c, d, e ) (p)->GetCreationParameters( a, b, c, d, e )
480 #define IDirectXVideoDecoder_GetVideoDecoderService( p, a ) (p)->GetVideoDecoderService( a )
481 #define IDirectXVideoDecoder_ReleaseBuffer( p, a ) (p)->ReleaseBuffer( a )
482 #endif
484 #undef INTERFACE
485 #define INTERFACE IDirectXVideoAccelerationService
486 DECLARE_INTERFACE_( IDirectXVideoAccelerationService, IUnknown )
488 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
489 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
490 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
491 STDMETHOD( CreateSurface ) ( THIS_ UINT, UINT, UINT, D3DFORMAT, D3DPOOL, DWORD, DWORD, IDirect3DSurface9**, HANDLE* ) PURE;
495 #if !defined(__cplusplus) || defined(CINTERFACE)
496 #define IDirectXVideoAccelerationService_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
497 #define IDirectXVideoAccelerationService_AddRef( p ) (p)->lpVtbl->AddRef( p )
498 #define IDirectXVideoAccelerationService_Release( p ) (p)->lpVtbl->Release( p )
499 #define IDirectXVideoAccelerationService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->lpVtbl->CreateSurface( p, a, b, c, d, e, f, g, h, i )
500 #else
501 #define IDirectXVideoAccelerationService_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
502 #define IDirectXVideoAccelerationService_AddRef( p ) (p)->AddRef()
503 #define IDirectXVideoAccelerationService_Release( p ) (p)->Release()
504 #define IDirectXVideoAccelerationService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->CreateSurface( a, b, c, d, e, f, g, h, i )
505 #endif
507 #undef INTERFACE
508 #define INTERFACE IDirectXVideoDecoderService
509 DECLARE_INTERFACE_( IDirectXVideoDecoderService, IDirectXVideoAccelerationService )
511 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
512 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
513 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
514 STDMETHOD( CreateSurface ) ( THIS_ UINT, UINT, UINT, D3DFORMAT, D3DPOOL, DWORD, DWORD, IDirect3DSurface9**, HANDLE* ) PURE;
515 STDMETHOD( GetDecoderDeviceGuids ) ( THIS_ UINT*, GUID ** ) PURE;
516 STDMETHOD( GetDecoderRenderTargets ) ( THIS_ REFGUID, UINT*, D3DFORMAT** ) PURE;
517 STDMETHOD( GetDecoderConfigurations ) ( THIS_ REFGUID, const DXVA2_VideoDesc*, IUnknown*, UINT*, DXVA2_ConfigPictureDecode** ) PURE;
518 STDMETHOD( CreateVideoDecoder ) ( THIS_ REFGUID, const DXVA2_VideoDesc*, DXVA2_ConfigPictureDecode*, IDirect3DSurface9**, UINT, IDirectXVideoDecoder** ) PURE;
521 #if !defined(__cplusplus) || defined(CINTERFACE)
522 #define IDirectXVideoDecoderService_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
523 #define IDirectXVideoDecoderService_AddRef( p ) (p)->lpVtbl->AddRef( p )
524 #define IDirectXVideoDecoderService_Release( p ) (p)->lpVtbl->Release( p )
525 #define IDirectXVideoDecoderService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->lpVtbl->CreateSurface( p, a, b, c, d, e, f, g, h, i )
526 #define IDirectXVideoDecoderService_CreateVideoDecoder( p, a, b, c, d, e, f ) (p)->lpVtbl->CreateVideoDecoder( p, a, b, c, d, e, f )
527 #define IDirectXVideoDecoderService_GetDecoderConfigurations( p, a, b, c, d, e ) (p)->lpVtbl->GetDecoderConfigurations( p, a, b, c, d, e )
528 #define IDirectXVideoDecoderService_GetDecoderDeviceGuids( p, a, b ) (p)->lpVtbl->GetDecoderDeviceGuids( p, a, b )
529 #define IDirectXVideoDecoderService_GetDecoderRenderTargets( p, a, b, c ) (p)->lpVtbl->GetDecoderRenderTargets( p, a, b, c )
530 #else
531 #define IDirectXVideoDecoderService_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
532 #define IDirectXVideoDecoderService_AddRef( p ) (p)->AddRef()
533 #define IDirectXVideoDecoderService_Release( p ) (p)->Release()
534 #define IDirectXVideoDecoderService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->CreateSurface( a, b, c, d, e, f, g, h, i )
535 #define IDirectXVideoDecoderService_CreateVideoDecoder( p, a, b, c, d, e, f ) (p)->CreateVideoDecoder( a, b, c, d, e, f )
536 #define IDirectXVideoDecoderService_GetDecoderConfigurations( p, a, b, c, d, e ) (p)->GetDecoderConfigurations( a, b, c, d, e )
537 #define IDirectXVideoDecoderService_GetDecoderDeviceGuids( p, a, b ) (p)->GetDecoderDeviceGuids( a, b )
538 #define IDirectXVideoDecoderService_GetDecoderRenderTargets( p, a, b, c ) (p)->GetDecoderRenderTargets( a, b, c )
539 #endif
541 #undef INTERFACE
542 #define INTERFACE IDirect3DDeviceManager9
543 DECLARE_INTERFACE_( IDirect3DDeviceManager9, IUnknown )
545 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
546 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
547 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
548 STDMETHOD( ResetDevice ) ( THIS_ IDirect3DDevice9*, UINT ) PURE;
549 STDMETHOD( OpenDeviceHandle ) ( THIS_ HANDLE* ) PURE;
550 STDMETHOD( CloseDeviceHandle ) ( THIS_ HANDLE ) PURE;
551 STDMETHOD( TestDevice ) ( THIS_ HANDLE ) PURE;
552 STDMETHOD( LockDevice ) ( THIS_ HANDLE, IDirect3DDevice9**, BOOL ) PURE;
553 STDMETHOD( UnlockDevice ) ( THIS_ HANDLE, BOOL ) PURE;
554 STDMETHOD( GetVideoService ) ( THIS_ HANDLE, REFIID, void** ) PURE;
557 #if !defined(__cplusplus) || defined(CINTERFACE)
558 #define IDirect3DDeviceManager9_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
559 #define IDirect3DDeviceManager9_AddRef( p ) (p)->lpVtbl->AddRef( p )
560 #define IDirect3DDeviceManager9_Release( p ) (p)->lpVtbl->Release( p )
561 #define IDirect3DDeviceManager9_ResetDevice( p, a, b ) (p)->lpVtbl->ResetDevice( p, a, b )
562 #define IDirect3DDeviceManager9_OpenDeviceHandle( p, a ) (p)->lpVtbl->OpenDeviceHandle( p, a )
563 #define IDirect3DDeviceManager9_CloseDeviceHandle( p, a ) (p)->lpVtbl->CloseDeviceHandle( p, a )
564 #define IDirect3DDeviceManager9_TestDevice( p, a ) (p)->lpVtbl->TestDevice( p, a )
565 #define IDirect3DDeviceManager9_LockDevice( p, a, b, c ) (p)->lpVtbl->LockDevice( p, a, b, c )
566 #define IDirect3DDeviceManager9_UnlockDevice( p, a, b ) (p)->lpVtbl->UnlockDevice( p, a, b )
567 #define IDirect3DDeviceManager9_GetVideoService( p, a, b, c ) (p)->lpVtbl->GetVideoService( p, a, b, c )
568 #else
569 #define IDirect3DDeviceManager9_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
570 #define IDirect3DDeviceManager9_AddRef( p ) (p)->AddRef()
571 #define IDirect3DDeviceManager9_Release( p ) (p)->Release()
572 #define IDirect3DDeviceManager9_ResetDevice( p, a, b ) (p)->ResetDevice( a, b )
573 #define IDirect3DDeviceManager9_OpenDeviceHandle( p, a ) (p)->OpenDeviceHandle( a )
574 #define IDirect3DDeviceManager9_CloseDeviceHandle( p, a ) (p)->CloseDeviceHandle( a )
575 #define IDirect3DDeviceManager9_TestDevice( p, a ) (p)->TestDevice( a )
576 #define IDirect3DDeviceManager9_LockDevice( p, a, b, c ) (p)->LockDevice( a, b, c )
577 #define IDirect3DDeviceManager9_UnlockDevice( p, a, b ) (p)->UnlockDevice( a, b )
578 #define IDirect3DDeviceManager9_GetVideoService( p, a, b, c ) (p)->GetVideoService( a, b, c )
579 #endif
581 typedef _COM_interface IDirectXVideoProcessorService IDirectXVideoProcessorService;
582 typedef _COM_interface IDirectXVideoProcessor IDirectXVideoProcessor;
584 #undef INTERFACE
585 #define INTERFACE IDirectXVideoProcessor
586 DECLARE_INTERFACE_( IDirectXVideoProcessor, IUnknown )
588 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
589 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
590 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
591 STDMETHOD( GetVideoProcessorService ) ( THIS_ IDirectXVideoProcessorService** ) PURE;
592 STDMETHOD( GetCreationParameters ) ( THIS_ GUID*, DXVA2_VideoDesc*, D3DFORMAT*, UINT* ) PURE;
593 STDMETHOD( GetVideoProcessorCaps ) ( THIS_ DXVA2_VideoProcessorCaps* ) PURE;
594 STDMETHOD( GetProcAmpRange ) ( THIS_ UINT, DXVA2_ValueRange* ) PURE;
595 STDMETHOD( GetFilterPropertyRange ) ( THIS_ UINT, DXVA2_ValueRange* ) PURE;
596 STDMETHOD( VideoProcessBlt ) ( THIS_ IDirect3DSurface9*, DXVA2_VideoProcessBltParams*, DXVA2_VideoSample*, UINT, HANDLE* ) PURE;
599 #if !defined(__cplusplus) || defined(CINTERFACE)
600 #define IDirectXVideoProcessor_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
601 #define IDirectXVideoProcessor_AddRef( p ) (p)->lpVtbl->AddRef( p )
602 #define IDirectXVideoProcessor_Release( p ) (p)->lpVtbl->Release( p )
603 #define IDirectXVideoProcessor_GetVideoProcessorService( p, a ) (p)->lpVtbl->GetVideoProcessorService( p, a )
604 #define IDirectXVideoProcessor_GetCreationParameters( p, a, b, c, d ) (p)->lpVtbl->GetCreationParameters( p, a, b, c, d )
605 #define IDirectXVideoProcessor_GetVideoProcessorCaps( p, a ) (p)->lpVtbl->GetVideoProcessorCaps( p, a )
606 #define IDirectXVideoProcessor_GetProcAmpRange( p, a, b ) (p)->lpVtbl->GetProcAmpRange( p, a, b )
607 #define IDirectXVideoProcessor_GetFilterPropertyRange( p, a, b ) (p)->lpVtbl->GetFilterPropertyRange( p, a, b )
608 #define IDirectXVideoProcessor_VideoProcessBlt( p, a, b, c, d, e ) (p)->lpVtbl->VideoProcessBlt( p, a, b, c, d, e )
609 #else
610 #define IDirectXVideoProcessor_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
611 #define IDirectXVideoProcessor_AddRef( p ) (p)->AddRef()
612 #define IDirectXVideoProcessor_Release( p ) (p)->Release()
613 #define IDirectXVideoProcessor_GetVideoProcessorService( p, a ) (p)->GetVideoProcessorService( a )
614 #define IDirectXVideoProcessor_GetCreationParameters( p, a, b, c, d ) (p)->GetCreationParameters( a, b, c, d )
615 #define IDirectXVideoProcessor_GetVideoProcessorCaps( p, a ) (p)->GetVideoProcessorCaps( a )
616 #define IDirectXVideoProcessor_GetProcAmpRange( p, a, b ) (p)->GetProcAmpRange( a, b )
617 #define IDirectXVideoProcessor_GetFilterPropertyRange( p, a, b ) (p)->GetFilterPropertyRange( a, b )
618 #define IDirectXVideoProcessor_VideoProcessBlt( p, a, b, c, d, e ) (p)->VideoProcessBlt( a, b, c, d, e )
619 #endif
622 #undef INTERFACE
623 #define INTERFACE IDirectXVideoProcessorService
624 DECLARE_INTERFACE_( IDirectXVideoProcessorService, IDirectXVideoAccelerationService )
626 STDMETHOD( QueryInterface ) ( THIS_ REFIID, PVOID* ) PURE;
627 STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
628 STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
629 STDMETHOD( CreateSurface ) ( THIS_ UINT, UINT, UINT, D3DFORMAT, D3DPOOL, DWORD, DWORD, IDirect3DSurface9**, HANDLE* ) PURE;
630 STDMETHOD( RegisterVideoProcessorSoftwareDevice ) ( THIS_ void* ) PURE;
631 STDMETHOD( GetVideoProcessorDeviceGuids ) ( THIS_ DXVA2_VideoDesc*, UINT, GUID** ) PURE;
632 STDMETHOD( GetVideoProcessorRenderTargets ) ( THIS_ REFGUID, DXVA2_VideoDesc*, UINT*, D3DFORMAT** ) PURE;
633 STDMETHOD( GetVideoProcessorSubStreamFormats ) ( THIS_ REFGUID, DXVA2_VideoDesc*, D3DFORMAT, UINT*, D3DFORMAT** ) PURE;
634 STDMETHOD( GetVideoProcessorCaps ) ( THIS_ REFGUID, DXVA2_VideoDesc*, D3DFORMAT, DXVA2_VideoProcessorCaps* ) PURE;
635 STDMETHOD( GetProcAmpRange ) ( THIS_ REFGUID, DXVA2_VideoDesc*, D3DFORMAT, UINT, DXVA2_ValueRange* ) PURE;
636 STDMETHOD( GetFilterPropertyRange ) ( THIS_ REFGUID, DXVA2_VideoDesc*, D3DFORMAT, UINT, DXVA2_ValueRange* ) PURE;
637 STDMETHOD( CreateVideoProcessor ) ( THIS_ REFGUID, DXVA2_VideoDesc*, D3DFORMAT, UINT, IDirectXVideoProcessor** ) PURE;
640 #if !defined(__cplusplus) || defined(CINTERFACE)
641 #define IDirectXVideoProcessorService_QueryInterface( p, a, b ) (p)->lpVtbl->QueryInterface( p, a, b )
642 #define IDirectXVideoProcessorService_AddRef( p ) (p)->lpVtbl->AddRef( p )
643 #define IDirectXVideoProcessorService_Release( p ) (p)->lpVtbl->Release( p )
644 #define IDirectXVideoProcessorService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->lpVtbl->CreateSurface( p, a, b, c, d, e, f, g, h, i )
645 #define IDirectXVideoProcessorService_RegisterVideoProcessorSoftwareDevice( p, a ) (p)->lpVtbl->RegisterVideoProcessorSoftwareDevice( p, a )
646 #define IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids( p, a, b, c ) (p)->lpVtbl->GetVideoProcessorDeviceGuids( p, a, b, c )
647 #define IDirectXVideoProcessorService_GetVideoProcessorRenderTargets( p, a, b, c, d ) (p)->lpVtbl->GetVideoProcessorRenderTargets( p, a, b, c, d )
648 #define IDirectXVideoProcessorService_GetVideoProcessorSubStreamFormats( p, a, b, c, d, e ) (p)->lpVtbl->GetVideoProcessorSubStreamFormats( p, a, b, c, d, e )
649 #define IDirectXVideoProcessorService_GetVideoProcessorCaps( p, a, b, c, d ) (p)->lpVtbl->GetVideoProcessorCaps( p, a, b, c, d )
650 #define IDirectXVideoProcessorService_GetProcAmpRange( p, a, b, c, d, e ) (p)->lpVtbl->GetProcAmpRange( p, a, b, c, d, e )
651 #define IDirectXVideoProcessorService_GetFilterPropertyRange( p, a, b, c, d, e ) (p)->lpVtbl->GetFilterPropertyRange( p, a, b, c, d, e )
652 #define IDirectXVideoProcessorService_CreateVideoProcessor( p, a, b, c, d, e ) (p)->lpVtbl->CreateVideoProcessor( p, a, b, c, d, e )
653 #else
654 #define IDirectXVideoProcessorService_QueryInterface( p, a, b ) (p)->QueryInterface( a, b )
655 #define IDirectXVideoProcessorService_AddRef( p ) (p)->AddRef()
656 #define IDirectXVideoProcessorService_Release( p ) (p)->Release()
657 #define IDirectXVideoProcessorService_CreateSurface( p, a, b, c, d, e, f, g, h, i ) (p)->CreateSurface( a, b, c, d, e, f, g, h, i )
658 #define IDirectXVideoProcessorService_RegisterVideoProcessorSoftwareDevice( p, a ) (p)->RegisterVideoProcessorSoftwareDevice( a )
659 #define IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids( p, a, b, c ) (p)->GetVideoProcessorDeviceGuids( a, b, c )
660 #define IDirectXVideoProcessorService_GetVideoProcessorRenderTargets( p, a, b, c, d ) (p)->GetVideoProcessorRenderTargets( a, b, c, d )
661 #define IDirectXVideoProcessorService_GetVideoProcessorSubStreamFormats( p, a, b, c, d, e ) (p)->GetVideoProcessorSubStreamFormats( a, b, c, d, e )
662 #define IDirectXVideoProcessorService_GetVideoProcessorCaps( p, a, b, c, d ) (p)->GetVideoProcessorCaps( a, b, c, d )
663 #define IDirectXVideoProcessorService_GetProcAmpRange( p, a, b, c, d, e ) (p)->GetProcAmpRange( a, b, c, d, e )
664 #define IDirectXVideoProcessorService_GetFilterPropertyRange( p, a, b, c, d, e ) (p)->GetFilterPropertyRange( a, b, c, d, e )
665 #define IDirectXVideoProcessorService_CreateVideoProcessor( p, a, b, c, d, e ) (p)->CreateVideoProcessor( a, b, c, d, e )
666 #endif
669 /*****************************************************************************************************
670 ************************DXVA Video Processor********************************************************
671 *******************************************************************************************************/
675 /*#undef INTERFACE
676 #define INTERFACE IDirectXVideoService
677 DECLARE_INTERFACE_(IDirectXVideoService,IUnknown)
679 STDMETHOD(DXVA2CreateVideoService)(IDirect3DDevice9*, REFIID, void**) PURE;
682 #if !defined(__cplusplus) || defined(CINTERFACE)
683 #define IDirectXVideoService_DXVA2CreateVideoService(a,b,c) DXVA2CreateVideoService(a,b,c)
684 #else
685 #define IDirectXVideoService_DXVA2CreateVideoService(a,b,c) DXVA2CreateVideoService(a,b,c)
686 #endif*/
689 #ifdef __cplusplus
691 #endif
693 #ifdef __cplusplus
694 extern "C" HRESULT WINAPI DXVA2CreateVideoService( IDirect3DDevice9 *,
695 REFIID riid,
696 void **ppService );
697 #else
698 extern HRESULT WINAPI DXVA2CreateVideoService( IDirect3DDevice9 *,
699 REFIID riid,
700 void **ppService );
701 #endif
703 typedef
704 enum _DXVA2_VideoChromaSubSampling
705 { DXVA2_VideoChromaSubsamplingMask = 0xf,
706 DXVA2_VideoChromaSubsampling_Unknown = 0,
707 DXVA2_VideoChromaSubsampling_ProgressiveChroma = 0x8,
708 DXVA2_VideoChromaSubsampling_Horizontally_Cosited = 0x4,
709 DXVA2_VideoChromaSubsampling_Vertically_Cosited = 0x2,
710 DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1,
711 DXVA2_VideoChromaSubsampling_MPEG2 = ( DXVA2_VideoChromaSubsampling_Horizontally_Cosited | DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes ),
712 DXVA2_VideoChromaSubsampling_MPEG1 = DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
713 DXVA2_VideoChromaSubsampling_DV_PAL = ( DXVA2_VideoChromaSubsampling_Horizontally_Cosited | DXVA2_VideoChromaSubsampling_Vertically_Cosited ),
714 DXVA2_VideoChromaSubsampling_Cosited = ( ( DXVA2_VideoChromaSubsampling_Horizontally_Cosited | DXVA2_VideoChromaSubsampling_Vertically_Cosited ) | DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes )} DXVA2_VideoChromaSubSampling;
716 typedef
717 enum _DXVA2_NominalRange
718 { DXVA2_NominalRangeMask = 0x7,
719 DXVA2_NominalRange_Unknown = 0,
720 DXVA2_NominalRange_Normal = 1,
721 DXVA2_NominalRange_Wide = 2,
722 DXVA2_NominalRange_0_255 = 1,
723 DXVA2_NominalRange_16_235 = 2,
724 DXVA2_NominalRange_48_208 = 3} DXVA2_NominalRange;
726 typedef
727 enum _DXVA2_VideoLighting
728 { DXVA2_VideoLightingMask = 0xf,
729 DXVA2_VideoLighting_Unknown = 0,
730 DXVA2_VideoLighting_bright = 1,
731 DXVA2_VideoLighting_office = 2,
732 DXVA2_VideoLighting_dim = 3,
733 DXVA2_VideoLighting_dark = 4} DXVA2_VideoLighting;
735 typedef
736 enum _DXVA2_VideoPrimaries
737 { DXVA2_VideoPrimariesMask = 0x1f,
738 DXVA2_VideoPrimaries_Unknown = 0,
739 DXVA2_VideoPrimaries_reserved = 1,
740 DXVA2_VideoPrimaries_BT709 = 2,
741 DXVA2_VideoPrimaries_BT470_2_SysM = 3,
742 DXVA2_VideoPrimaries_BT470_2_SysBG = 4,
743 DXVA2_VideoPrimaries_SMPTE170M = 5,
744 DXVA2_VideoPrimaries_SMPTE240M = 6,
745 DXVA2_VideoPrimaries_EBU3213 = 7,
746 DXVA2_VideoPrimaries_SMPTE_C = 8} DXVA2_VideoPrimaries;
748 typedef
749 enum _DXVA2_VideoTransferFunction
750 { DXVA2_VideoTransFuncMask = 0x1f,
751 DXVA2_VideoTransFunc_Unknown = 0,
752 DXVA2_VideoTransFunc_10 = 1,
753 DXVA2_VideoTransFunc_18 = 2,
754 DXVA2_VideoTransFunc_20 = 3,
755 DXVA2_VideoTransFunc_22 = 4,
756 DXVA2_VideoTransFunc_709 = 5,
757 DXVA2_VideoTransFunc_240M = 6,
758 DXVA2_VideoTransFunc_sRGB = 7,
759 DXVA2_VideoTransFunc_28 = 8} DXVA2_VideoTransferFunction;
761 typedef
762 enum _DXVA2_SampleFormat
763 { DXVA2_SampleFormatMask = 0xff,
764 DXVA2_SampleUnknown = 0,
765 DXVA2_SampleProgressiveFrame = 2,
766 DXVA2_SampleFieldInterleavedEvenFirst = 3,
767 DXVA2_SampleFieldInterleavedOddFirst = 4,
768 DXVA2_SampleFieldSingleEven = 5,
769 DXVA2_SampleFieldSingleOdd = 6,
770 DXVA2_SampleSubStream = 7} DXVA2_SampleFormat;
772 typedef
773 enum _DXVA2_VideoTransferMatrix
774 { DXVA2_VideoTransferMatrixMask = 0x7,
775 DXVA2_VideoTransferMatrix_Unknown = 0,
776 DXVA2_VideoTransferMatrix_BT709 = 1,
777 DXVA2_VideoTransferMatrix_BT601 = 2,
778 DXVA2_VideoTransferMatrix_SMPTE240M = 3} DXVA2_VideoTransferMatrix;
780 enum __MIDL___MIDL_itf_dxva2api_0000_0000_0004
781 { DXVA2_NoiseFilterLumaLevel = 1,
782 DXVA2_NoiseFilterLumaThreshold = 2,
783 DXVA2_NoiseFilterLumaRadius = 3,
784 DXVA2_NoiseFilterChromaLevel = 4,
785 DXVA2_NoiseFilterChromaThreshold = 5,
786 DXVA2_NoiseFilterChromaRadius = 6,
787 DXVA2_DetailFilterLumaLevel = 7,
788 DXVA2_DetailFilterLumaThreshold = 8,
789 DXVA2_DetailFilterLumaRadius = 9,
790 DXVA2_DetailFilterChromaLevel = 10,
791 DXVA2_DetailFilterChromaThreshold = 11,
792 DXVA2_DetailFilterChromaRadius = 12};
794 enum __MIDL___MIDL_itf_dxva2api_0000_0000_0008
795 { DXVA2_VideoProcess_None = 0,
796 DXVA2_VideoProcess_YUV2RGB = 0x1,
797 DXVA2_VideoProcess_StretchX = 0x2,
798 DXVA2_VideoProcess_StretchY = 0x4,
799 DXVA2_VideoProcess_AlphaBlend = 0x8,
800 DXVA2_VideoProcess_SubRects = 0x10,
801 DXVA2_VideoProcess_SubStreams = 0x20,
802 DXVA2_VideoProcess_SubStreamsExtended = 0x40,
803 DXVA2_VideoProcess_YUV2RGBExtended = 0x80,
804 DXVA2_VideoProcess_AlphaBlendExtended = 0x100,
805 DXVA2_VideoProcess_Constriction = 0x200,
806 DXVA2_VideoProcess_NoiseFilter = 0x400,
807 DXVA2_VideoProcess_DetailFilter = 0x800,
808 DXVA2_VideoProcess_PlanarAlpha = 0x1000,
809 DXVA2_VideoProcess_LinearScaling = 0x2000,
810 DXVA2_VideoProcess_GammaCompensated = 0x4000,
811 DXVA2_VideoProcess_MaintainsOriginalFieldData = 0x8000,
812 DXVA2_VideoProcess_Mask = 0xffff};
816 __inline float hb_dx_fixedtofloat( const DXVA2_Fixed32 _fixed_ );
818 __inline const DXVA2_Fixed32 hb_dx_fixed32_opaque_alpha();
820 __inline DXVA2_Fixed32 hb_dx_floattofixed( const float _float_ );
821 #endif
822 #endif //_DXVA2API_H