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/>
18 #define MINGW_DXVA2API_H_VERSION (2)
21 #pragma GCC system_header
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******************/
34 #define DXVA2API_USE_BITFIELDS
36 typedef struct _DXVA2_ExtendedFormat
{
37 #ifdef DXVA2API_USE_BITFIELDS
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;
53 } DXVA2_ExtendedFormat
;
55 typedef struct _DXVA2_Frequency
{
60 typedef struct _DXVA2_VideoDesc
{
63 DXVA2_ExtendedFormat SampleFormat
;
65 DXVA2_Frequency InputSampleFreq
;
66 DXVA2_Frequency OutputFrameFreq
;
67 UINT UABProtectionLevel
;
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
;
103 } DXVA2_DecodeBufferDesc
;
105 typedef struct _DXVA2_DecodeExtensionData
{
107 PVOID pPrivateInputData
;
108 UINT PrivateInputDataSize
;
109 PVOID pPrivateOutputData
;
110 UINT PrivateOutputDataSize
;
111 } DXVA2_DecodeExtensionData
;
113 typedef struct _DXVA2_DecodeExecuteParams
{
115 DXVA2_DecodeBufferDesc
*pCompressedBuffers
;
116 DXVA2_DecodeExtensionData
*pExtensionData
;
117 } DXVA2_DecodeExecuteParams
;
120 DXVA2_VideoDecoderRenderTarget
= 0,
121 DXVA2_VideoProcessorRenderTarget
= 1,
122 DXVA2_VideoSoftwareRenderTarget
= 2
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
;
153 UCHAR bPicBackwardPrediction
;
154 UCHAR bBidirectionalAveragingMode
;
155 UCHAR bMVprecisionAndChromaRelation
;
158 UCHAR bPicScanMethod
;
159 UCHAR bPicReadbackRequests
;
161 UCHAR bPicSpatialResid8
;
162 UCHAR bPicOverflowBlocks
;
163 UCHAR bPicExtrapolation
;
165 UCHAR bPicDeblockConfined
;
166 UCHAR bPic4MVallowed
;
171 USHORT wBitstreamFcodes
;
172 USHORT wBitstreamPCEelements
;
173 UCHAR bBitstreamConcealmentNeed
;
174 UCHAR bBitstreamConcealmentMethod
;
175 } DXVA_PictureParameters
, *LPDXVA_PictureParameters
;
177 typedef struct _DXVA_QmatrixData
{
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
;
190 USHORT wNumberMBsInSlice
;
191 USHORT wQuantizerScaleCode
;
192 USHORT wBadSliceChopping
;
193 } DXVA_SliceInfo
, *LPDXVA_SliceInfo
;
197 #ifdef DXVA2API_USE_BITFIELDS
200 UCHAR Index7Bits
: 7;
201 UCHAR AssociatedFlag
: 1;
208 } DXVA_PicEntry_H264
;
212 USHORT wFrameWidthInMbsMinus1
;
213 USHORT wFrameHeightInMbsMinus1
;
214 DXVA_PicEntry_H264 CurrPic
;
215 UCHAR num_ref_frames
;
216 #ifdef DXVA2API_USE_BITFIELDS
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;
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
;
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
;
276 UCHAR bScalingLists4x4
[6][16];
277 UCHAR bScalingLists8x8
[2][64];
282 UINT BSNALunitDataLocation
;
283 UINT SliceBytesInBuffer
;
284 USHORT wBadSliceChopping
;
285 USHORT first_mb_in_slice
;
286 USHORT NumMbsForSlice
;
287 USHORT BitOffsetToSliceData
;
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
;
297 DXVA_PicEntry_H264 RefPicList
[2][32];
298 SHORT Weights
[2][32][3][2];
301 UCHAR redundant_pic_cnt
;
302 UCHAR direct_spatial_mv_pred_flag
;
303 UCHAR cabac_init_idc
;
304 UCHAR disable_deblocking_filter_idc
;
306 } DXVA_Slice_H264_Long
;
309 UINT BSNALunitDataLocation
;
310 UINT SliceBytesInBuffer
;
311 USHORT wBadSliceChopping
;
312 } DXVA_Slice_H264_Short
;
315 USHORT wFrameWidthInMbsMinus1
;
316 USHORT wFrameHeightInMbsMinus1
;
317 DXVA_PicEntry_H264 InPic
;
318 DXVA_PicEntry_H264 OutPic
;
319 USHORT PicOrderCnt_offset
;
321 UINT StatusReportFeedbackNumber
;
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
;
365 DXVA2_Fixed32 MinValue
;
366 DXVA2_Fixed32 MaxValue
;
367 DXVA2_Fixed32 DefaultValue
;
368 DXVA2_Fixed32 StepSize
;
372 DXVA2_Fixed32 Brightness
;
373 DXVA2_Fixed32 Contrast
;
375 DXVA2_Fixed32 Saturation
;
376 }DXVA2_ProcAmpValues
;
380 DXVA2_Fixed32 Threshold
;
381 DXVA2_Fixed32 Radius
;
387 UINT NumForwardRefSamples
;
388 UINT NumBackwardRefSamples
;
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
;
404 REFERENCE_TIME Start
;
406 DXVA2_ExtendedFormat SampleFormat
;
407 IDirect3DSurface9
*SrcSurface
;
410 DXVA2_AYUVSample8 Pal
[16];
411 DXVA2_Fixed32 PlanarAlpha
;
417 REFERENCE_TIME TargetFrame
;
419 SIZE ConstrictionSize
;
421 DXVA2_AYUVSample16 BackgroundColor
;
422 DXVA2_ExtendedFormat DestFormat
;
423 DXVA2_ProcAmpValues ProcAmpValues
;
425 DXVA2_FilterValues NoiseFilterLuma
;
426 DXVA2_FilterValues NoiseFilterChroma
;
427 DXVA2_FilterValues DetailFilterLuma
;
428 DXVA2_FilterValues DetailFilterChroma
;
430 } DXVA2_VideoProcessBltParams
;
434 /*************INTERFACES************/
438 #define _COM_interface struct
439 typedef _COM_interface IDirectXVideoDecoderService IDirectXVideoDecoderService
;
440 typedef _COM_interface IDirectXVideoDecoder IDirectXVideoDecoder
;
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 )
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 )
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 )
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 )
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 )
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 )
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 )
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 )
581 typedef _COM_interface IDirectXVideoProcessorService IDirectXVideoProcessorService
;
582 typedef _COM_interface IDirectXVideoProcessor IDirectXVideoProcessor
;
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 )
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 )
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 )
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 )
669 /*****************************************************************************************************
670 ************************DXVA Video Processor********************************************************
671 *******************************************************************************************************/
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)
685 #define IDirectXVideoService_DXVA2CreateVideoService(a,b,c) DXVA2CreateVideoService(a,b,c)
694 extern "C" HRESULT WINAPI
DXVA2CreateVideoService( IDirect3DDevice9
*,
698 extern HRESULT WINAPI
DXVA2CreateVideoService( IDirect3DDevice9
*,
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
;
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
;
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
;
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
;
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
;
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
;
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_
);