2 * Copyright 2015 Michael Müller
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.
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.
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
26 DEFINE_GUID(DXVA_NoEncrypt
, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
28 #define DXVA_USUAL_BLOCK_WIDTH 8
29 #define DXVA_USUAL_BLOCK_HEIGHT 8
30 #define DXVA_USUAL_BLOCK_SIZE (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT)
34 typedef struct _DXVA_PicEntry_H264
41 UCHAR AssociatedFlag
: 1;
45 } DXVA_PicEntry_H264
, *LPDXVA_PicEntry_H264
;
47 typedef struct _DXVA_FilmGrainCharacteristics
49 USHORT wFrameWidthInMbsMinus1
;
50 USHORT wFrameHeightInMbsMinus1
;
51 DXVA_PicEntry_H264 InPic
;
52 DXVA_PicEntry_H264 OutPic
;
53 USHORT PicOrderCnt_offset
;
55 UINT StatusReportFeedbackNumber
;
57 UCHAR separate_colour_description_present_flag
;
58 UCHAR film_grain_bit_depth_luma_minus8
;
59 UCHAR film_grain_bit_depth_chroma_minus8
;
60 UCHAR film_grain_full_range_flag
;
61 UCHAR film_grain_colour_primaries
;
62 UCHAR film_grain_transfer_characteristics
;
63 UCHAR film_grain_matrix_coefficients
;
64 UCHAR blending_mode_id
;
65 UCHAR log2_scale_factor
;
66 UCHAR comp_model_present_flag
[4];
67 UCHAR num_intensity_intervals_minus1
[4];
68 UCHAR num_model_values_minus1
[4];
69 UCHAR intensity_interval_lower_bound
[3][16];
70 UCHAR intensity_interval_upper_bound
[3][16];
71 SHORT comp_model_value
[3][16][8];
72 } DXVA_FilmGrainChar_H264
, *LPDXVA_FilmGrainChar_H264
;
74 typedef struct _DXVA_PictureParameters
76 WORD wDecodedPictureIndex
;
77 WORD wDeblockedPictureIndex
;
78 WORD wForwardRefPictureIndex
;
79 WORD wBackwardRefPictureIndex
;
80 WORD wPicWidthInMBminus1
;
81 WORD wPicHeightInMBminus1
;
82 BYTE bMacroblockWidthMinus1
;
83 BYTE bMacroblockHeightMinus1
;
84 BYTE bBlockWidthMinus1
;
85 BYTE bBlockHeightMinus1
;
90 BYTE bPicBackwardPrediction
;
91 BYTE bBidirectionalAveragingMode
;
92 BYTE bMVprecisionAndChromaRelation
;
96 BYTE bPicReadbackRequests
;
98 BYTE bPicSpatialResid8
;
99 BYTE bPicOverflowBlocks
;
100 BYTE bPicExtrapolation
;
102 BYTE bPicDeblockConfined
;
108 WORD wBitstreamFcodes
;
109 WORD wBitstreamPCEelements
;
110 BYTE bBitstreamConcealmentNeed
;
111 BYTE bBitstreamConcealmentMethod
;
112 } DXVA_PictureParameters
, *LPDXVA_PictureParameters
;
114 typedef struct _DXVA_SliceInfo
116 WORD wHorizontalPosition
;
117 WORD wVerticalPosition
;
118 DWORD dwSliceBitsInBuffer
;
119 DWORD dwSliceDataLocation
;
120 BYTE bStartCodeBitOffset
;
123 WORD wNumberMBsInSlice
;
124 WORD wQuantizerScaleCode
;
125 WORD wBadSliceChopping
;
126 } DXVA_SliceInfo
, *LPDXVA_SliceInfo
;
128 typedef struct _DXVA_QmatrixData
131 WORD Qmatrix
[4][DXVA_USUAL_BLOCK_WIDTH
* DXVA_USUAL_BLOCK_HEIGHT
];
132 } DXVA_QmatrixData
, *LPDXVA_QmatrixData
;
134 typedef struct _DXVA_PicParams_H264
136 USHORT wFrameWidthInMbsMinus1
;
137 USHORT wFrameHeightInMbsMinus1
;
138 DXVA_PicEntry_H264 CurrPic
;
139 UCHAR num_ref_frames
;
144 USHORT field_pic_flag
: 1;
145 USHORT MbaffFrameFlag
: 1;
146 USHORT residual_colour_transform_flag
: 1;
147 USHORT sp_for_switch_flag
: 1;
148 USHORT chroma_format_idc
: 2;
149 USHORT RefPicFlag
: 1;
150 USHORT constrained_intra_pred_flag
: 1;
151 USHORT weighted_pred_flag
: 1;
152 USHORT weighted_bipred_idc
: 2;
153 USHORT MbsConsecutiveFlag
: 1;
154 USHORT frame_mbs_only_flag
: 1;
155 USHORT transform_8x8_mode_flag
: 1;
156 USHORT MinLumaBipredSize8x8Flag
: 1;
157 USHORT IntraPicFlag
: 1;
161 UCHAR bit_depth_luma_minus8
;
162 UCHAR bit_depth_chroma_minus8
;
163 USHORT Reserved16Bits
;
164 UINT StatusReportFeedbackNumber
;
165 DXVA_PicEntry_H264 RefFrameList
[16];
166 INT CurrFieldOrderCnt
[2];
167 INT FieldOrderCntList
[16][2];
168 CHAR pic_init_qs_minus26
;
169 CHAR chroma_qp_index_offset
;
170 CHAR second_chroma_qp_index_offset
;
171 UCHAR ContinuationFlag
;
172 CHAR pic_init_qp_minus26
;
173 UCHAR num_ref_idx_l0_active_minus1
;
174 UCHAR num_ref_idx_l1_active_minus1
;
175 UCHAR Reserved8BitsA
;
176 USHORT FrameNumList
[16];
178 UINT UsedForReferenceFlags
;
179 USHORT NonExistingFrameFlags
;
181 UCHAR log2_max_frame_num_minus4
;
182 UCHAR pic_order_cnt_type
;
183 UCHAR log2_max_pic_order_cnt_lsb_minus4
;
184 UCHAR delta_pic_order_always_zero_flag
;
185 UCHAR direct_8x8_inference_flag
;
186 UCHAR entropy_coding_mode_flag
;
187 UCHAR pic_order_present_flag
;
188 UCHAR num_slice_groups_minus1
;
189 UCHAR slice_group_map_type
;
190 UCHAR deblocking_filter_control_present_flag
;
191 UCHAR redundant_pic_cnt_present_flag
;
192 UCHAR Reserved8BitsB
;
193 USHORT slice_group_change_rate_minus1
;
194 UCHAR SliceGroupMap
[810];
195 } DXVA_PicParams_H264
, *LPDXVA_PicParams_H264
;
197 typedef struct _DXVA_Qmatrix_H264
199 UCHAR bScalingLists4x4
[6][16];
200 UCHAR bScalingLists8x8
[2][64];
201 } DXVA_Qmatrix_H264
, *LPDXVA_Qmatrix_H264
;
203 typedef struct _DXVA_Slice_H264_Long
205 UINT BSNALunitDataLocation
;
206 UINT SliceBytesInBuffer
;
207 USHORT wBadSliceChopping
;
208 USHORT first_mb_in_slice
;
209 USHORT NumMbsForSlice
;
210 USHORT BitOffsetToSliceData
;
212 UCHAR luma_log2_weight_denom
;
213 UCHAR chroma_log2_weight_denom
;
215 UCHAR num_ref_idx_l0_active_minus1
;
216 UCHAR num_ref_idx_l1_active_minus1
;
217 CHAR slice_alpha_c0_offset_div2
;
218 CHAR slice_beta_offset_div2
;
220 DXVA_PicEntry_H264 RefPicList
[2][32];
221 SHORT Weights
[2][32][3][2];
224 UCHAR redundant_pic_cnt
;
225 UCHAR direct_spatial_mv_pred_flag
;
226 UCHAR cabac_init_idc
;
227 UCHAR disable_deblocking_filter_idc
;
229 } DXVA_Slice_H264_Long
, *LPDXVA_Slice_H264_Long
;
231 typedef struct _DXVA_Slice_H264_Short
233 UINT BSNALunitDataLocation
;
234 UINT SliceBytesInBuffer
;
235 USHORT wBadSliceChopping
;
236 } DXVA_Slice_H264_Short
, *LPDXVA_Slice_H264_Short
;
239 typedef struct _DXVA_PicEntry_HEVC
245 UCHAR Index7Bits
: 7;
246 UCHAR AssociatedFlag
: 1;
250 } DXVA_PicEntry_HEVC
, *LPDXVA_PicEntry_HEVC
;
252 typedef struct _DXVA_PicParams_HEVC
254 USHORT PicWidthInMinCbsY
;
255 USHORT PicHeightInMinCbsY
;
260 USHORT chroma_format_idc
: 2;
261 USHORT separate_colour_plane_flag
: 1;
262 USHORT bit_depth_luma_minus8
: 3;
263 USHORT bit_depth_chroma_minus8
: 3;
264 USHORT log2_max_pic_order_cnt_lsb_minus4
: 4;
265 USHORT NoPicReorderingFlag
: 1;
266 USHORT NoBiPredFlag
: 1;
267 USHORT ReservedBits1
: 1;
269 USHORT wFormatAndSequenceInfoFlags
;
271 DXVA_PicEntry_HEVC CurrPic
;
272 UCHAR sps_max_dec_pic_buffering_minus1
;
273 UCHAR log2_min_luma_coding_block_size_minus3
;
274 UCHAR log2_diff_max_min_luma_coding_block_size
;
275 UCHAR log2_min_transform_block_size_minus2
;
276 UCHAR log2_diff_max_min_transform_block_size
;
277 UCHAR max_transform_hierarchy_depth_inter
;
278 UCHAR max_transform_hierarchy_depth_intra
;
279 UCHAR num_short_term_ref_pic_sets
;
280 UCHAR num_long_term_ref_pics_sps
;
281 UCHAR num_ref_idx_l0_default_active_minus1
;
282 UCHAR num_ref_idx_l1_default_active_minus1
;
283 CHAR init_qp_minus26
;
284 UCHAR ucNumDeltaPocsOfRefRpsIdx
;
285 USHORT wNumBitsForShortTermRPSInSlice
;
286 USHORT ReservedBits2
;
292 UINT32 scaling_list_enabled_flag
: 1;
293 UINT32 amp_enabled_flag
: 1;
294 UINT32 sample_adaptive_offset_enabled_flag
: 1;
295 UINT32 pcm_enabled_flag
: 1;
296 UINT32 pcm_sample_bit_depth_luma_minus1
: 4;
297 UINT32 pcm_sample_bit_depth_chroma_minus1
: 4;
298 UINT32 log2_min_pcm_luma_coding_block_size_minus3
: 2;
299 UINT32 log2_diff_max_min_pcm_luma_coding_block_size
: 2;
300 UINT32 pcm_loop_filter_disabled_flag
: 1;
301 UINT32 long_term_ref_pics_present_flag
: 1;
302 UINT32 sps_temporal_mvp_enabled_flag
: 1;
303 UINT32 strong_intra_smoothing_enabled_flag
: 1;
304 UINT32 dependent_slice_segments_enabled_flag
: 1;
305 UINT32 output_flag_present_flag
: 1;
306 UINT32 num_extra_slice_header_bits
: 3;
307 UINT32 sign_data_hiding_enabled_flag
: 1;
308 UINT32 cabac_init_present_flag
: 1;
309 UINT32 ReservedBits3
: 5;
311 UINT32 dwCodingParamToolFlags
;
318 UINT32 constrained_intra_pred_flag
: 1;
319 UINT32 transform_skip_enabled_flag
: 1;
320 UINT32 cu_qp_delta_enabled_flag
: 1;
321 UINT32 pps_slice_chroma_qp_offsets_present_flag
: 1;
322 UINT32 weighted_pred_flag
: 1;
323 UINT32 weighted_bipred_flag
: 1;
324 UINT32 transquant_bypass_enabled_flag
: 1;
325 UINT32 tiles_enabled_flag
: 1;
326 UINT32 entropy_coding_sync_enabled_flag
: 1;
327 UINT32 uniform_spacing_flag
: 1;
328 UINT32 loop_filter_across_tiles_enabled_flag
: 1;
329 UINT32 pps_loop_filter_across_slices_enabled_flag
: 1;
330 UINT32 deblocking_filter_override_enabled_flag
: 1;
331 UINT32 pps_deblocking_filter_disabled_flag
: 1;
332 UINT32 lists_modification_present_flag
: 1;
333 UINT32 slice_segment_header_extension_present_flag
: 1;
334 UINT32 IrapPicFlag
: 1;
335 UINT32 IdrPicFlag
: 1;
336 UINT32 IntraPicFlag
: 1;
337 UINT32 ReservedBits4
: 13;
339 UINT32 dwCodingSettingPicturePropertyFlags
;
341 CHAR pps_cb_qp_offset
;
342 CHAR pps_cr_qp_offset
;
343 UCHAR num_tile_columns_minus1
;
344 UCHAR num_tile_rows_minus1
;
345 USHORT column_width_minus1
[19];
346 USHORT row_height_minus1
[21];
347 UCHAR diff_cu_qp_delta_depth
;
348 CHAR pps_beta_offset_div2
;
349 CHAR pps_tc_offset_div2
;
350 UCHAR log2_parallel_merge_level_minus2
;
351 INT CurrPicOrderCntVal
;
352 DXVA_PicEntry_HEVC RefPicList
[15];
354 INT PicOrderCntValList
[15];
355 UCHAR RefPicSetStCurrBefore
[8];
356 UCHAR RefPicSetStCurrAfter
[8];
357 UCHAR RefPicSetLtCurr
[8];
358 USHORT ReservedBits6
;
359 USHORT ReservedBits7
;
360 UINT StatusReportFeedbackNumber
;
361 } DXVA_PicParams_HEVC
, *LPDXVA_PicParams_HEVC
;
363 typedef struct _DXVA_Qmatrix_HEVC
365 UCHAR ucScalingLists0
[6][16];
366 UCHAR ucScalingLists1
[6][64];
367 UCHAR ucScalingLists2
[6][64];
368 UCHAR ucScalingLists3
[2][64];
369 UCHAR ucScalingListDCCoefSizeID2
[6];
370 UCHAR ucScalingListDCCoefSizeID3
[2];
371 } DXVA_Qmatrix_HEVC
, *LPDXVA_Qmatrix_HEVC
;
373 typedef struct _DXVA_Slice_HEVC_Short
375 UINT BSNALunitDataLocation
;
376 UINT SliceBytesInBuffer
;
377 USHORT wBadSliceChopping
;
378 } DXVA_Slice_HEVC_Short
, *LPDXVA_Slice_HEVC_Short
;
380 typedef struct _DXVA_PicEntry_VPx
386 UCHAR Index7Bits
: 7;
387 UCHAR AssociatedFlag
: 1;
391 } DXVA_PicEntry_VPx
, *LPDXVA_PicEntry_VPx
;
393 typedef struct _segmentation_VP9
400 UCHAR update_map
: 1;
401 UCHAR temporal_update
: 1;
403 UCHAR ReservedSegmentFlags4Bits
: 4;
405 UCHAR wSegmentInfoFlags
;
409 SHORT feature_data
[8][4];
410 UCHAR feature_mask
[8];
411 } DXVA_segmentation_VP9
;
413 typedef struct _DXVA_PicParams_VP9
415 DXVA_PicEntry_VPx CurrPic
;
421 USHORT frame_type
: 1;
422 USHORT show_frame
: 1;
423 USHORT error_resilient_mode
: 1;
424 USHORT subsampling_x
: 1;
425 USHORT subsampling_y
: 1;
426 USHORT extra_plane
: 1;
427 USHORT refresh_frame_context
: 1;
428 USHORT frame_parallel_decoding_mode
: 1;
429 USHORT intra_only
: 1;
430 USHORT frame_context_idx
: 2;
431 USHORT reset_frame_context
: 2;
432 USHORT allow_high_precision_mv
: 1;
433 USHORT ReservedFormatInfo2Bits
: 2;
435 USHORT wFormatAndPictureInfoFlags
;
439 UCHAR BitDepthMinus8Luma
;
440 UCHAR BitDepthMinus8Chroma
;
443 DXVA_PicEntry_VPx ref_frame_map
[8];
444 UINT ref_frame_coded_width
[8];
445 UINT ref_frame_coded_height
[8];
446 DXVA_PicEntry_VPx frame_refs
[3];
447 CHAR ref_frame_sign_bias
[4];
449 CHAR sharpness_level
;
454 UCHAR mode_ref_delta_enabled
: 1;
455 UCHAR mode_ref_delta_update
: 1;
456 UCHAR use_prev_in_find_mv_refs
: 1;
457 UCHAR ReservedControlInfo5Bits
: 5;
459 UCHAR wControlInfoFlags
;
467 DXVA_segmentation_VP9 stVP9Segments
;
468 UCHAR log2_tile_cols
;
469 UCHAR log2_tile_rows
;
470 USHORT uncompressed_header_size_byte_aligned
;
471 USHORT first_partition_size
;
472 USHORT Reserved16Bits
;
474 UINT StatusReportFeedbackNumber
;
475 } DXVA_PicParams_VP9
, *LPDXVA_PicParams_VP9
;
477 typedef struct _segmentation_VP8
483 UCHAR segmentation_enabled
: 1;
484 UCHAR update_mb_segmentation_map
: 1;
485 UCHAR update_mb_segmentation_data
: 1;
486 UCHAR mb_segement_abs_delta
: 1;
487 UCHAR ReservedSegmentFlags4Bits
: 4;
491 CHAR segment_feature_data
[2][4];
492 UCHAR mb_segment_tree_probs
[3];
493 } DXVA_segmentation_VP8
;
495 typedef struct _DXVA_PicParams_VP8
497 UINT first_part_size
;
500 DXVA_PicEntry_VPx CurrPic
;
505 UCHAR frame_type
: 1;
507 UCHAR show_frame
: 1;
508 UCHAR clamp_type
: 1;
509 UCHAR ReservedFrameTag3Bits
: 2;
511 UCHAR wFrameTagFlags
;
513 DXVA_segmentation_VP8 stVP8Segments
;
516 UCHAR sharpness_level
;
517 UCHAR mode_ref_lf_delta_enabled
;
518 UCHAR mode_ref_lf_delta_update
;
519 CHAR ref_lf_deltas
[4];
520 CHAR mode_lf_deltas
[4];
521 UCHAR log2_nbr_of_dct_partitions
;
528 DXVA_PicEntry_VPx alt_fb_idx
;
529 DXVA_PicEntry_VPx gld_fb_idx
;
530 DXVA_PicEntry_VPx lst_fb_idx
;
531 UCHAR ref_frame_sign_bias_golden
;
532 UCHAR ref_frame_sign_bias_altref
;
533 UCHAR refresh_entropy_probs
;
534 UCHAR vp8_coef_update_probs
[4][8][3][11];
535 UCHAR mb_no_coeff_skip
;
536 UCHAR prob_skip_false
;
540 UCHAR intra_16x16_prob
[4];
541 UCHAR intra_chroma_prob
[3];
542 UCHAR vp8_mv_update_probs
[2][19];
543 USHORT ReservedBits1
;
544 USHORT ReservedBits2
;
545 USHORT ReservedBits3
;
546 UINT StatusReportFeedbackNumber
;
547 } DXVA_PicParams_VP8
, *LPDXVA_PicParams_VP8
;
549 typedef struct _DXVA_Slice_VPx_Short
551 UINT BSNALunitDataLocation
;
552 UINT SliceBytesInBuffer
;
553 USHORT wBadSliceChopping
;
554 } DXVA_Slice_VPx_Short
, *LPDXVA_Slice_VPx_Short
;
556 typedef struct _DXVA_Status_VPx
558 UINT StatusReportFeedbackNumber
;
559 DXVA_PicEntry_VPx CurrPic
;
562 UCHAR bReserved8Bits
;
563 USHORT wNumMbsAffected
;
564 } DXVA_Status_VPx
, *LPDXVA_Status_VPx
;
572 #endif /* __WINE_DXVA_H */