/[cvs]/api/include/dxva.h
ViewVC logotype

Contents of /api/include/dxva.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Sun Jul 1 20:47:59 2001 UTC (23 years, 4 months ago) by bearsoft
Branch: lazy, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
Error occurred while calculating annotation data.
First import

1 //------------------------------------------------------------------------------
2 // File: DXVA.h
3 //
4 // Desc: DirectX Video Acceleration header file.
5 //
6 // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
8
9
10 #ifndef __DIRECTX_VA__
11 #define __DIRECTX_VA__
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 DEFINE_GUID(DXVA_ModeNone, 0x1b81be00, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
18 DEFINE_GUID(DXVA_ModeH261_A, 0x1b81be01, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
19 DEFINE_GUID(DXVA_ModeH261_B, 0x1b81be02, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
20 DEFINE_GUID(DXVA_ModeH263_A, 0x1b81be03, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
21 DEFINE_GUID(DXVA_ModeH263_B, 0x1b81be04, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
22 DEFINE_GUID(DXVA_ModeH263_C, 0x1b81be05, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
23 DEFINE_GUID(DXVA_ModeH263_D, 0x1b81be06, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
24 DEFINE_GUID(DXVA_ModeH263_E, 0x1b81be07, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
25 DEFINE_GUID(DXVA_ModeH263_F, 0x1b81be08, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
26 DEFINE_GUID(DXVA_ModeMPEG1_A, 0x1b81be09, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
27 DEFINE_GUID(DXVA_ModeMPEG2_A, 0x1b81be0A, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
28 DEFINE_GUID(DXVA_ModeMPEG2_B, 0x1b81be0B, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
29 DEFINE_GUID(DXVA_ModeMPEG2_C, 0x1b81be0C, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
30 DEFINE_GUID(DXVA_ModeMPEG2_D, 0x1b81be0D, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
31
32 DEFINE_GUID(DXVA_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
33 DEFINE_GUID(DXVA_EncryptProt1, 0x1b81beD1, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
34
35 #define DXVA_RESTRICTED_MODE_UNRESTRICTED 0xFFFF
36 #define DXVA_RESTRICTED_MODE_H261_A 1
37 #define DXVA_RESTRICTED_MODE_H261_B 2
38 #define DXVA_RESTRICTED_MODE_H263_A 3
39 #define DXVA_RESTRICTED_MODE_H263_B 4
40 #define DXVA_RESTRICTED_MODE_H263_C 5
41 #define DXVA_RESTRICTED_MODE_H263_D 6
42 #define DXVA_RESTRICTED_MODE_H263_E 7
43 #define DXVA_RESTRICTED_MODE_H263_F 8
44 #define DXVA_RESTRICTED_MODE_MPEG1_A 9
45 #define DXVA_RESTRICTED_MODE_MPEG2_A 0xA
46 #define DXVA_RESTRICTED_MODE_MPEG2_B 0xB
47 #define DXVA_RESTRICTED_MODE_MPEG2_C 0xC
48 #define DXVA_RESTRICTED_MODE_MPEG2_D 0xD
49
50 #define DXVA_COMPBUFFER_TYPE_THAT_IS_NOT_USED 0
51 #define DXVA_PICTURE_DECODE_BUFFER 1
52 #define DXVA_MACROBLOCK_CONTROL_BUFFER 2
53 #define DXVA_RESIDUAL_DIFFERENCE_BUFFER 3
54 #define DXVA_DEBLOCKING_CONTROL_BUFFER 4
55 #define DXVA_INVERSE_QUANTIZATION_MATRIX_BUFFER 5
56 #define DXVA_SLICE_CONTROL_BUFFER 6
57 #define DXVA_BITSTREAM_DATA_BUFFER 7
58 #define DXVA_AYUV_BUFFER 8
59 #define DXVA_IA44_SURFACE_BUFFER 9
60 #define DXVA_DPXD_SURFACE_BUFFER 10
61 #define DXVA_HIGHLIGHT_BUFFER 11
62 #define DXVA_DCCMD_SURFACE_BUFFER 12
63 #define DXVA_ALPHA_BLEND_COMBINATION_BUFFER 13
64 #define DXVA_PICTURE_RESAMPLE_BUFFER 14
65 #define DXVA_READ_BACK_BUFFER 15
66
67 #define DXVA_NUM_TYPES_COMP_BUFFERS 16
68
69 /* values for bDXVA_Func */
70 #define DXVA_PICTURE_DECODING_FUNCTION 1
71 #define DXVA_ALPHA_BLEND_DATA_LOAD_FUNCTION 2
72 #define DXVA_ALPHA_BLEND_COMBINATION_FUNCTION 3
73 #define DXVA_PICTURE_RESAMPLE_FUNCTION 4
74
75 /* values returned from Execute command in absence of read-back */
76 #define DXVA_EXECUTE_RETURN_OK 0
77 #define DXVA_EXECUTE_RETURN_DATA_ERROR_MINOR 1
78 #define DXVA_EXECUTE_RETURN_DATA_ERROR_SIGNIF 2
79 #define DXVA_EXECUTE_RETURN_DATA_ERROR_SEVERE 3
80 #define DXVA_EXECUTE_RETURN_OTHER_ERROR_SEVERE 4
81
82
83 #pragma pack(push, BeforeDXVApacking, 1)
84
85
86 typedef struct _DXVA_ConnectMode {
87 GUID guidMode;
88 WORD wRestrictedMode;
89 } DXVA_ConnectMode, *LPDXVA_ConnectMode;
90
91
92 typedef DWORD DXVA_ConfigQueryOrReplyFunc, *LPDXVA_ConfigQueryOrReplyFunc;
93
94 #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY 0xFFFFF1
95 #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY 0xFFFFF5
96 #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_COPY 0xFFFFF8
97 #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_PLUS 0xFFFFF9
98 #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_OK_COPY 0xFFFFFC
99 #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_FALSE_PLUS 0xFFFFFB
100 #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_FALSE_PLUS 0xFFFFFF
101
102 #define readDXVA_QueryOrReplyFuncFlag(ptr) ((*(ptr)) >> 8)
103
104 #define readDXVA_QueryOrReplyFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1)
105 #define readDXVA_QueryOrReplyFuncFlag_LOCK(ptr) (((*(ptr)) >> 10) & 1)
106 #define readDXVA_QueryOrReplyFuncFlag_BAD(ptr) (((*(ptr)) >> 9) & 1)
107 #define readDXVA_QueryOrReplyFuncFlag_PLUS(ptr) (((*(ptr)) >> 8) & 1)
108
109 #define readDXVA_QueryOrReplyFuncFunc(ptr) ((*(ptr)) & 0xFF)
110
111 #define writeDXVA_QueryOrReplyFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
112
113 #define setDXVA_QueryOrReplyFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
114 #define setDXVA_QueryOrReplyFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
115
116 typedef DWORD DXVA_EncryptProtocolFunc, *LPDXVA_EncryptProtocolFunc;
117
118 #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_HOST 0xFFFF00
119 #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_ACCEL 0xFFFF08
120
121 #define readDXVA_EncryptProtocolFuncFlag(ptr) ((*(ptr)) >> 8)
122 #define readDXVA_EncryptProtocolFuncFlag_ACCEL(ptr) (((*(ptr)) >> 11) & 1)
123
124 #define readDXVA_EncryptProtocolFuncFunc(ptr) ((*(ptr)) & 0xFF)
125
126 #define writeDXVA_EncryptProtocolFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
127
128 #define setDXVA_EncryptProtocolFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
129 #define setDXVA_EncryptProtocolFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
130
131 typedef struct _DXVA_EncryptProtocolHeader {
132 DXVA_EncryptProtocolFunc dwFunction;
133 DWORD ReservedBits[3];
134 GUID guidEncryptProtocol;
135 } DXVA_EncryptProtocolHeader, *LPDXVA_EncryptProtocolHeader;
136
137 typedef struct _DXVA_ConfigPictureDecode {
138
139 // Operation Indicated
140 DXVA_ConfigQueryOrReplyFunc dwFunction;
141
142 // Alignment
143 DWORD dwReservedBits[3];
144
145 // Encryption GUIDs
146 GUID guidConfigBitstreamEncryption;
147 GUID guidConfigMBcontrolEncryption;
148 GUID guidConfigResidDiffEncryption;
149
150 // Bitstream Processing Indicator
151 BYTE bConfigBitstreamRaw;
152
153 // Macroblock Control Config
154 BYTE bConfigMBcontrolRasterOrder;
155
156 // Host Resid Diff Config
157 BYTE bConfigResidDiffHost;
158 BYTE bConfigSpatialResid8;
159 BYTE bConfigResid8Subtraction;
160 BYTE bConfigSpatialHost8or9Clipping;
161 BYTE bConfigSpatialResidInterleaved;
162 BYTE bConfigIntraResidUnsigned;
163
164 // Accelerator Resid Diff Config
165 BYTE bConfigResidDiffAccelerator;
166 BYTE bConfigHostInverseScan;
167 BYTE bConfigSpecificIDCT;
168 BYTE bConfig4GroupedCoefs;
169 } DXVA_ConfigPictureDecode, *LPDXVA_ConfigPictureDecode;
170
171
172 /* Picture Decoding Parameters */
173
174 typedef struct _DXVA_PictureParameters {
175
176 WORD wDecodedPictureIndex;
177 WORD wDeblockedPictureIndex;
178
179 WORD wForwardRefPictureIndex;
180 WORD wBackwardRefPictureIndex;
181
182 WORD wPicWidthInMBminus1;
183 WORD wPicHeightInMBminus1;
184
185 BYTE bMacroblockWidthMinus1;
186 BYTE bMacroblockHeightMinus1;
187
188 BYTE bBlockWidthMinus1;
189 BYTE bBlockHeightMinus1;
190
191 BYTE bBPPminus1;
192
193 BYTE bPicStructure;
194 BYTE bSecondField;
195 BYTE bPicIntra;
196 BYTE bPicBackwardPrediction;
197
198 BYTE bBidirectionalAveragingMode;
199 BYTE bMVprecisionAndChromaRelation;
200 BYTE bChromaFormat;
201
202 BYTE bPicScanFixed;
203 BYTE bPicScanMethod;
204 BYTE bPicReadbackRequests;
205
206 BYTE bRcontrol;
207 BYTE bPicSpatialResid8;
208 BYTE bPicOverflowBlocks;
209 BYTE bPicExtrapolation;
210
211 BYTE bPicDeblocked;
212 BYTE bPicDeblockConfined;
213 BYTE bPic4MVallowed;
214 BYTE bPicOBMC;
215 BYTE bPicBinPB;
216 BYTE bMV_RPS;
217
218 BYTE bReservedBits;
219
220 WORD wBitstreamFcodes;
221 WORD wBitstreamPCEelements;
222 BYTE bBitstreamConcealmentNeed;
223 BYTE bBitstreamConcealmentMethod;
224
225 } DXVA_PictureParameters, *LPDXVA_PictureParameters;
226
227
228 /* Picture Resampling */
229
230 typedef struct _DXVA_PicResample {
231
232 WORD wPicResampleSourcePicIndex;
233 WORD wPicResampleDestPicIndex;
234
235 WORD wPicResampleRcontrol;
236 BYTE bPicResampleExtrapWidth;
237 BYTE bPicResampleExtrapHeight;
238
239 DWORD dwPicResampleSourceWidth;
240 DWORD dwPicResampleSourceHeight;
241
242 DWORD dwPicResampleDestWidth;
243 DWORD dwPicResampleDestHeight;
244
245 DWORD dwPicResampleFullDestWidth;
246 DWORD dwPicResampleFullDestHeight;
247
248 } DXVA_PicResample, *LPDXVA_PicResample;
249
250
251 #define DXVA_CHROMA_FORMAT_420 1
252 #define DXVA_CHROMA_FORMAT_422 2
253 #define DXVA_CHROMA_FORMAT_444 3
254
255 #define DXVA_PICTURE_STRUCTURE_TOP_FIELD 1
256 #define DXVA_PICTURE_STRUCTURE_BOTTOM_FIELD 2
257 #define DXVA_PICTURE_STRUCTURE_FRAME 3
258
259 #define DXVA_BIDIRECTIONAL_AVERAGING_MPEG2_ROUND 0
260 #define DXVA_BIDIRECTIONAL_AVERAGING_H263_TRUNC 1
261
262 #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_MPEG2 0
263 #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H263 1
264 #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H261 2
265
266 #define DXVA_SCAN_METHOD_ZIG_ZAG 0
267 #define DXVA_SCAN_METHOD_ALTERNATE_VERTICAL 1
268 #define DXVA_SCAN_METHOD_ALTERNATE_HORIZONTAL 2
269 #define DXVA_SCAN_METHOD_ARBITRARY 3
270
271 #define DXVA_BITSTREAM_CONCEALMENT_NEED_UNLIKELY 0
272 #define DXVA_BITSTREAM_CONCEALMENT_NEED_MILD 1
273 #define DXVA_BITSTREAM_CONCEALMENT_NEED_LIKELY 2
274 #define DXVA_BITSTREAM_CONCEALMENT_NEED_SEVERE 3
275
276 #define DXVA_BITSTREAM_CONCEALMENT_METHOD_UNSPECIFIED 0
277 #define DXVA_BITSTREAM_CONCEALMENT_METHOD_INTRA 1
278 #define DXVA_BITSTREAM_CONCEALMENT_METHOD_FORWARD 2
279 #define DXVA_BITSTREAM_CONCEALMENT_METHOD_BACKWARD 3
280
281
282 /* Buffer Description Data */
283
284 typedef struct _DXVA_BufferDescription {
285 DWORD dwTypeIndex;
286 DWORD dwBufferIndex;
287 DWORD dwDataOffset;
288 DWORD dwDataSize;
289 DWORD dwFirstMBaddress;
290 DWORD dwNumMBsInBuffer;
291 DWORD dwWidth;
292 DWORD dwHeight;
293 DWORD dwStride;
294 DWORD dwReservedBits;
295 } DXVA_BufferDescription, *LPDXVA_BufferDescription;
296
297
298 /* Off-Host IDCT Coefficient Data Structures */
299
300 typedef struct _DXVA_TCoef4Group {
301 BYTE TCoefIDX[4];
302 SHORT TCoefValue[4];
303 } DXVA_TCoef4Group, *LPDXVA_TCoef4Group;
304
305 typedef struct _DXVA_TCoefSingle {
306 WORD wIndexWithEOB;
307 SHORT TCoefValue;
308 } DXVA_TCoefSingle, *LPDXVA_TCoefSingle;
309
310 /* Macros for Reading EOB and Index Values */
311
312 #define readDXVA_TCoefSingleIDX(ptr) ((ptr)->wIndexWithEOB >> 1)
313 #define readDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB & 1)
314
315 /* Macro for Writing EOB and Index Values */
316
317 #define writeDXVA_TCoefSingleIndexWithEOB(ptr, idx, eob) ((ptr)->wIndexWithEOB = ((idx) << 1) | (eob))
318 #define setDXVA_TCoefSingleIDX(ptr, idx) ((ptr)->wIndexWithEOB |= ((idx) << 1))
319 #define setDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB |= 1)
320
321 /* Spatial-Domain Residual Difference Blocks */
322
323 #define DXVA_USUAL_BLOCK_WIDTH 8
324 #define DXVA_USUAL_BLOCK_HEIGHT 8
325 #define DXVA_USUAL_BLOCK_SIZE (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT)
326
327 typedef SHORT DXVA_Sample16[DXVA_USUAL_BLOCK_SIZE];
328 typedef signed char DXVA_Sample8 [DXVA_USUAL_BLOCK_SIZE];
329
330 /* Deblocking Filter Control Structure */
331
332 typedef BYTE DXVA_DeblockingEdgeControl;
333
334 typedef DXVA_DeblockingEdgeControl * LPDXVA_DeblockingEdgeControl;
335
336 /* Macros for Reading STRENGTH and FilterOn */
337
338 #define readDXVA_EdgeFilterStrength(ptr) ((*(ptr)) >> 1)
339 #define readDXVA_EdgeFilterOn(ptr) ((*(ptr)) & 1)
340
341 /* Macro for Writing STRENGTH and FilterOn */
342
343 #define writeDXVA_DeblockingEdgeControl(ptr, str, fon) ((*(ptr)) = ((str) << 1) | (fon))
344 #define setDXVA_EdgeFilterStrength(ptr, str) ((*(ptr)) |= ((str) << 1))
345 #define setDXVA_EdgeFilterOn(ptr) ((*(ptr)) |= 1)
346
347
348 /* Macroblock Control Command Data Structures */
349
350 typedef struct _DXVA_MVvalue {
351 SHORT horz, vert;
352 } DXVA_MVvalue, *LPDXVA_MVvalue;
353
354
355 /* Inverse Quantization Matrices */
356
357 typedef struct _DXVA_QmatrixData {
358 BYTE bNewQmatrix[4]; /* intra Y, inter Y, intra chroma, inter chroma */
359 WORD Qmatrix[4][DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT];
360 } DXVA_QmatrixData, *LPDXVA_QmatrixData;
361
362
363 /* Slice Control Buffer Data */
364
365 typedef struct _DXVA_SliceInfo {
366 WORD wHorizontalPosition;
367 WORD wVerticalPosition;
368 DWORD dwSliceBitsInBuffer;
369 DWORD dwSliceDataLocation;
370 BYTE bStartCodeBitOffset;
371 BYTE bReservedBits;
372 WORD wMBbitOffset;
373 WORD wNumberMBsInSlice;
374 WORD wQuantizerScaleCode;
375 WORD wBadSliceChopping;
376 } DXVA_SliceInfo, *LPDXVA_SliceInfo;
377
378
379 #define DXVA_NumMV_OBMC_off_BinPBwith4MV_off 4
380 #define DXVA_NumMV_OBMC_off_BinPBwith4MV_on (4+1)
381 #define DXVA_NumMV_OBMC_on__BinPB_off (10)
382 #define DXVA_NumMV_OBMC_on__BinPB_on (11) /* not current standards */
383
384 #define DXVA_NumBlocksPerMB_420 (4+2+0)
385 #define DXVA_NumBlocksPerMB_422 (4+2+2)
386 #define DXVA_NumBlocksPerMB_444 (4+4+4)
387
388 /* Basic form for I pictures */
389 /* Host Residual Differences */
390 typedef struct _DXVA_MBctrl_I_HostResidDiff_1 {
391 WORD wMBaddress;
392 WORD wMBtype;
393 DWORD dwMB_SNL;
394 WORD wPatternCode;
395 WORD wPC_Overflow; /* zero if not overflow format */
396 DWORD dwReservedBits2;
397 } DXVA_MBctrl_I_HostResidDiff_1;
398
399 /* Basic form for I pictures */
400 /* Off-Host IDCT, 4:2:0 sampling */
401 typedef struct _DXVA_MBctrl_I_OffHostIDCT_1 {
402 WORD wMBaddress;
403 WORD wMBtype;
404 DWORD dwMB_SNL;
405 WORD wPatternCode;
406 BYTE bNumCoef[DXVA_NumBlocksPerMB_420];
407 } DXVA_MBctrl_I_OffHostIDCT_1;
408
409 /* Basic form for P and B pictures */
410 /* Should also be used for concealment MVs in MPEG-2 I pictures */
411 /* Without OBMC, without BinPB and 4MV together, without MV RPS */
412 /* Host Residual Differences */
413 typedef struct _DXVA_MBctrl_P_HostResidDiff_1 {
414 WORD wMBaddress;
415 WORD wMBtype;
416 DWORD dwMB_SNL;
417 WORD wPatternCode;
418 WORD wPC_Overflow; /* zero if not overflow format */
419 DWORD dwReservedBits2;
420 DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
421 } DXVA_MBctrl_P_HostResidDiff_1;
422
423 /* Basic form for P and B pictures */
424 /* Without OBMC, without BinPB and 4MV together, without MV RPS */
425 /* Off-Host IDCT, 4:2:0 sampling */
426 typedef struct _DXVA_MBctrl_P_OffHostIDCT_1 {
427 WORD wMBaddress;
428 WORD wMBtype;
429 DWORD dwMB_SNL;
430 WORD wPatternCode;
431 BYTE bNumCoef[DXVA_NumBlocksPerMB_420];
432 DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
433 } DXVA_MBctrl_P_OffHostIDCT_1;
434
435 /* How to load alpha blending graphic data */
436 typedef struct _DXVA_ConfigAlphaLoad {
437
438 // Operation Indicated
439 DXVA_ConfigQueryOrReplyFunc dwFunction;
440
441 // Alignment
442 DWORD dwReservedBits[3];
443
444 BYTE bConfigDataType;
445 } DXVA_ConfigAlphaLoad, *LPDXVA_ConfigAlphaLoad;
446
447 #define DXVA_CONFIG_DATA_TYPE_IA44 0
448 #define DXVA_CONFIG_DATA_TYPE_AI44 1
449 #define DXVA_CONFIG_DATA_TYPE_DPXD 2
450 #define DXVA_CONFIG_DATA_TYPE_AYUV 3
451
452
453 /* How to combine alpha blending graphic data */
454 typedef struct _DXVA_ConfigAlphaCombine {
455
456 // Operation Indicated
457 DXVA_ConfigQueryOrReplyFunc dwFunction;
458
459 // Alignment
460 DWORD dwReservedBits[3];
461
462 BYTE bConfigBlendType;
463 BYTE bConfigPictureResizing;
464 BYTE bConfigOnlyUsePicDestRectArea;
465 BYTE bConfigGraphicResizing;
466 BYTE bConfigWholePlaneAlpha;
467
468 } DXVA_ConfigAlphaCombine, *LPDXVA_ConfigAlphaCombine;
469
470 #define DXVA_CONFIG_BLEND_TYPE_FRONT_BUFFER 0
471 #define DXVA_CONFIG_BLEND_TYPE_BACK_HARDWARE 1
472
473
474 /* AYUV sample for 16-entry YUV palette or graphic surface */
475
476 typedef struct _DXVA_AYUVsample {
477 BYTE bSampleAlpha8, bY_Value, bCbValue, bCrValue;
478 } DXVA_AYUVsample, *LPDXVA_AYUVsample;
479
480 /* Macros for IA44 alpha blending surface samples */
481
482 typedef BYTE DXVA_IA44sample, *LPDXVA_IA44sample;
483
484 #define readDXVA_IA44index(ptr) (((*(ptr)) & 0xF0) >> 4)
485 #define readDXVA_IA44alpha(ptr) ((*(ptr)) & 0x0F)
486
487 #define writeDXVA_IA44(ptr, idx, alpha) ((*(ptr)) = (((idx) << 4) | (alpha)))
488
489 #define setDXVA_IA44index(ptr, idx) ((*(ptr)) |= ((idx) << 4))
490 #define setDXVA_IA44alpha(ptr, alpha) ((*(ptr)) |= (alpha))
491
492 /* Macros for AI44 alpha blending surface samples */
493
494 typedef BYTE DXVA_AI44sample, *LPDXVA_AI44sample;
495
496 #define readDXVA_AI44index(ptr) ((*(ptr)) & 0x0F)
497 #define readDXVA_AI44alpha(ptr) (((*(ptr)) & 0xF0) >> 4)
498
499 #define writeDXVA_AI44(ptr, idx, alpha) ((*(ptr)) = (((alpha) << 4) | (idx)))
500
501 #define setDXVA_AI44index(ptr, idx) ((*(ptr)) |= (idx))
502 #define setDXVA_AI44alpha(ptr, alpha) ((*(ptr)) |= ((alpha) << 4))
503
504
505 /* Highlight data structure */
506
507 typedef struct _DXVA_Highlight {
508 WORD wHighlightActive;
509 WORD wHighlightIndices;
510 WORD wHighlightAlphas;
511 RECT HighlightRect;
512 } DXVA_Highlight, *LPDXVA_Highlight;
513
514 typedef BYTE DXVA_DPXD, *LPDXVA_DPXD;
515 typedef WORD DXVA_DCCMD, *LPDXVA_DCCMD;
516
517 /* Alpha blend combination */
518
519 typedef struct _DXVA_BlendCombination {
520 WORD wPictureSourceIndex;
521 WORD wBlendedDestinationIndex;
522 RECT PictureSourceRect16thPel;
523 RECT PictureDestinationRect;
524 RECT GraphicSourceRect;
525 RECT GraphicDestinationRect;
526 WORD wBlendDelay;
527 BYTE bBlendOn;
528 BYTE bWholePlaneAlpha;
529 DXVA_AYUVsample OutsideYUVcolor;
530 } DXVA_BlendCombination, *LPDXVA_BlendCombination;
531
532
533 /* Encryption Protocol #1 Data Structure */
534
535 #define DXVA_MAX_URIsize 1024
536
537 typedef struct _DXVA_EncryptProt1Data_Sign512_Accel512 {
538 DXVA_EncryptProtocolHeader header;
539
540 DWORD dwSigningModulusSize; /* equal to 64 */
541 BYTE SigningModulusValue[64];
542 DWORD dwSigningExponentSize; /* equal to 64 */
543 BYTE SigningExponentValue[64];
544
545 DWORD dwAccelModulusSize; /* equal to 64 */
546 BYTE AccelModulusValue[64];
547 DWORD dwAccelExponentSize; /* equal to 64 */
548 BYTE AccelExponentValue[64];
549
550 DWORD dwEncryptionFrequency;
551
552 DWORD dwURIsize;
553 WCHAR URIstring[DXVA_MAX_URIsize];
554
555 BYTE Signature[64];
556 } DXVA_EncryptProt1Data_Sign512_Accel512,
557 *LPDXVA_EncryptProt1Data_Sign512_Accel512;
558
559
560 #pragma pack(push, 16)
561
562
563 typedef DXVA_MBctrl_I_HostResidDiff_1 *
564 LPDXVA_MBctrl_I_HostResidDiff_1;
565
566 typedef DXVA_MBctrl_I_OffHostIDCT_1 *
567 LPDXVA_MBctrl_I_OffHostIDCT_1;
568
569 typedef DXVA_MBctrl_P_HostResidDiff_1 *
570 LPDXVA_MBctrl_P_HostResidDiff_1;
571
572 typedef DXVA_MBctrl_P_OffHostIDCT_1 *
573 LPDXVA_MBctrl_P_OffHostIDCT_1;
574
575
576 #pragma pack(pop)
577
578 /*
579 * Other forms of pictures are constructed in the obvious way
580 * from the above by adjusting the number of residual difference
581 * blocks, the number of motion vectors per macroblock, etc.
582 */
583
584 #define readDXVA_MBskipsFollowing(ptr) (((ptr)->dwMB_SNL & 0xFF000000) >> 24)
585 #define readDXVA_MBdataLocation(ptr) (((ptr)->dwMB_SNL & 0x00FFFFFF))
586
587 #define writeDXVA_MB_SNL(ptr, skips, dloc) ((ptr)->dwMB_SNL = (((skips) << 24) | (dloc)))
588 #define setDXVA_MBskipsFollowing(ptr, skips) ((ptr)->dwMB_SNL |= ((skips) << 24))
589 #define setDXVA_MBdataLocation(ptr, dloc) ((ptr)->dwMB_SNL |= (dloc))
590
591 #define readDXVA_MvertFieldSel_3(ptr) (((ptr)->wMBtype & 0x8000) >> 15)
592 #define readDXVA_MvertFieldSel_2(ptr) (((ptr)->wMBtype & 0x4000) >> 14)
593 #define readDXVA_MvertFieldSel_1(ptr) (((ptr)->wMBtype & 0x2000) >> 13)
594 #define readDXVA_MvertFieldSel_0(ptr) (((ptr)->wMBtype & 0x1000) >> 12)
595 #define readDXVA_ReservedBits(ptr) (((ptr)->wMBtype & 0x0800) >> 11)
596 #define readDXVA_HostResidDiff(ptr) (((ptr)->wMBtype & 0x0400) >> 10)
597 #define readDXVA_MotionType(ptr) (((ptr)->wMBtype & 0x0300) >> 8)
598 #define readDXVA_MBscanMethod(ptr) (((ptr)->wMBtype & 0x00C0) >> 6)
599 #define readDXVA_FieldResidual(ptr) (((ptr)->wMBtype & 0x0020) >> 5)
600 #define readDXVA_H261LoopFilter(ptr) (((ptr)->wMBtype & 0x0010) >> 4)
601 #define readDXVA_Motion4MV(ptr) (((ptr)->wMBtype & 0x0008) >> 3)
602 #define readDXVA_MotionBackward(ptr) (((ptr)->wMBtype & 0x0004) >> 2)
603 #define readDXVA_MotionForward(ptr) (((ptr)->wMBtype & 0x0002) >> 1)
604 #define readDXVA_IntraMacroblock(ptr) (((ptr)->wMBtype & 0x0001))
605
606 #define setDXVA_MvertFieldSel_3(ptr) ((ptr)->wMBtype |= 0x8000)
607 #define setDXVA_MvertFieldSel_2(ptr) ((ptr)->wMBtype |= 0x4000)
608 #define setDXVA_MvertFieldSel_1(ptr) ((ptr)->wMBtype |= 0x2000)
609 #define setDXVA_MvertFieldSel_0(ptr) ((ptr)->wMBtype |= 0x1000)
610 #define setDXVA_ReservedBits(ptr) ((ptr)->wMBtype |= 0x0800)
611 #define setDXVA_HostResidDiff(ptr) ((ptr)->wMBtype |= 0x0400)
612 #define setDXVA_MotionType(ptr, value) ((ptr)->wMBtype |= ((value) << 8))
613 #define setDXVA_MBscanMethod(ptr, value) ((ptr)->wMBtype |= ((value) << 6))
614 #define setDXVA_FieldResidual(ptr) ((ptr)->wMBtype |= 0x0020)
615 #define setDXVA_H261LoopFilter(ptr) ((ptr)->wMBtype |= 0x0010)
616 #define setDXVA_Motion4MV(ptr) ((ptr)->wMBtype |= 0x0008)
617 #define setDXVA_MotionBackward(ptr) ((ptr)->wMBtype |= 0x0004)
618 #define setDXVA_MotionForward(ptr) ((ptr)->wMBtype |= 0x0002)
619 #define setDXVA_IntraMacroblock(ptr) ((ptr)->wMBtype |= 0x0001)
620
621 #define readDXVA_Y___0coded(ptr) (((ptr)->wPatternCode & 0x0800) >> 11)
622 #define readDXVA_Y___1coded(ptr) (((ptr)->wPatternCode & 0x0400) >> 10)
623 #define readDXVA_Y___2coded(ptr) (((ptr)->wPatternCode & 0x0200) >> 9)
624 #define readDXVA_Y___3coded(ptr) (((ptr)->wPatternCode & 0x0100) >> 8)
625 #define readDXVA_Cb__4coded(ptr) (((ptr)->wPatternCode & 0x0080) >> 7)
626 #define readDXVA_Cr__5coded(ptr) (((ptr)->wPatternCode & 0x0040) >> 6)
627 #define readDXVA_Cb__6coded(ptr) (((ptr)->wPatternCode & 0x0020) >> 5)
628 #define readDXVA_Cr__7coded(ptr) (((ptr)->wPatternCode & 0x0010) >> 4)
629 #define readDXVA_Cb__8coded(ptr) (((ptr)->wPatternCode & 0x0008) >> 3)
630 #define readDXVA_Cb__9coded(ptr) (((ptr)->wPatternCode & 0x0004) >> 2)
631 #define readDXVA_Cr_10coded(ptr) (((ptr)->wPatternCode & 0x0002) >> 1)
632 #define readDXVA_Cr_11coded(ptr) (((ptr)->wPatternCode & 0x0001))
633
634 #define readDXVA_Y___0oflow(ptr) (((ptr)->wPC_Overflow & 0x0800) >> 11)
635 #define readDXVA_Y___1oflow(ptr) (((ptr)->wPC_Overflow & 0x0400) >> 10)
636 #define readDXVA_Y___2oflow(ptr) (((ptr)->wPC_Overflow & 0x0200) >> 9)
637 #define readDXVA_Y___3oflow(ptr) (((ptr)->wPC_Overflow & 0x0100) >> 8)
638 #define readDXVA_Cb__4oflow(ptr) (((ptr)->wPC_Overflow & 0x0080) >> 7)
639 #define readDXVA_Cr__5oflow(ptr) (((ptr)->wPC_Overflow & 0x0040) >> 6)
640 #define readDXVA_Cb__6oflow(ptr) (((ptr)->wPC_Overflow & 0x0020) >> 5)
641 #define readDXVA_Cr__7oflow(ptr) (((ptr)->wPC_Overflow & 0x0010) >> 4)
642 #define readDXVA_Cb__8oflow(ptr) (((ptr)->wPC_Overflow & 0x0008) >> 3)
643 #define readDXVA_Cb__9oflow(ptr) (((ptr)->wPC_Overflow & 0x0004) >> 2)
644 #define readDXVA_Cr_10oflow(ptr) (((ptr)->wPC_Overflow & 0x0002) >> 1)
645 #define readDXVA_Cr_11oflow(ptr) (((ptr)->wPC_Overflow & 0x0001))
646
647 #pragma pack(pop, BeforeDXVApacking)
648
649 #ifdef __cplusplus
650 }
651 #endif
652
653 #endif /* __DIRECTX_VA__ */

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26