zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

dxva.h (38618B) - Raw


      1 /*
      2  * Copyright 2015 Michael Müller
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Lesser General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2.1 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Lesser General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Lesser General Public
     15  * License along with this library; if not, write to the Free Software
     16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
     17  */
     18 
     19 #ifndef __WINE_DXVA_H
     20 #define __WINE_DXVA_H
     21 
     22 #ifdef __cplusplus
     23 extern "C" {
     24 #endif
     25 
     26 DEFINE_GUID(DXVA_ModeNone, 0x1b81be00, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     27 DEFINE_GUID(DXVA_ModeH261_A, 0x1b81be01, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     28 DEFINE_GUID(DXVA_ModeH261_B, 0x1b81be02, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     29 
     30 DEFINE_GUID(DXVA_ModeH263_A, 0x1b81be03, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     31 DEFINE_GUID(DXVA_ModeH263_B, 0x1b81be04, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     32 DEFINE_GUID(DXVA_ModeH263_C, 0x1b81be05, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     33 DEFINE_GUID(DXVA_ModeH263_D, 0x1b81be06, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     34 DEFINE_GUID(DXVA_ModeH263_E, 0x1b81be07, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     35 DEFINE_GUID(DXVA_ModeH263_F, 0x1b81be08, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     36 
     37 DEFINE_GUID(DXVA_ModeMPEG1_A, 0x1b81be09, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     38 DEFINE_GUID(DXVA_ModeMPEG1_VLD, 0x6f3ec719, 0x3735, 0x42cc, 0x80, 0x63, 0x65, 0xcc, 0x3c, 0xb3, 0x66, 0x16);
     39 
     40 DEFINE_GUID(DXVA_ModeMPEG2_A, 0x1b81be0a, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     41 DEFINE_GUID(DXVA_ModeMPEG2_B, 0x1b81be0b, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     42 DEFINE_GUID(DXVA_ModeMPEG2_C, 0x1b81be0c, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     43 DEFINE_GUID(DXVA_ModeMPEG2_D, 0x1b81be0d, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     44 DEFINE_GUID(DXVA_ModeMPEG2and1_VLD, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);
     45 
     46 DEFINE_GUID(DXVA_ModeH264_A, 0x1b81be64, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     47 DEFINE_GUID(DXVA_ModeH264_B, 0x1b81be65, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     48 DEFINE_GUID(DXVA_ModeH264_C, 0x1b81be66, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     49 DEFINE_GUID(DXVA_ModeH264_D, 0x1b81be67, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     50 DEFINE_GUID(DXVA_ModeH264_E, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     51 DEFINE_GUID(DXVA_ModeH264_F, 0x1b81be69, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     52 DEFINE_GUID(DXVA_ModeH264_VLD_WithFMOASO_NoFGT, 0xd5f04ff9, 0x3418, 0x45d8, 0x95, 0x61, 0x32, 0xa7, 0x6a, 0xae, 0x2d, 0xdd);
     53 
     54 DEFINE_GUID(DXVA_ModeH264_VLD_Stereo_Progressive_NoFGT, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d);
     55 DEFINE_GUID(DXVA_ModeH264_VLD_Stereo_NoFGT, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52);
     56 DEFINE_GUID(DXVA_ModeH264_VLD_Multiview_NoFGT, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c);
     57 
     58 DEFINE_GUID(DXVA_ModeWMV8_A, 0x1b81be80, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     59 DEFINE_GUID(DXVA_ModeWMV8_B, 0x1b81be81, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     60 
     61 DEFINE_GUID(DXVA_ModeWMV9_A, 0x1b81be90, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     62 DEFINE_GUID(DXVA_ModeWMV9_B, 0x1b81be91, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     63 DEFINE_GUID(DXVA_ModeWMV9_C, 0x1b81be94, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     64 
     65 DEFINE_GUID(DXVA_ModeVC1_A, 0x1b81bea0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     66 DEFINE_GUID(DXVA_ModeVC1_B, 0x1b81bea1, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     67 DEFINE_GUID(DXVA_ModeVC1_C, 0x1b81bea2, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     68 DEFINE_GUID(DXVA_ModeVC1_D, 0x1b81bea3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     69 DEFINE_GUID(DXVA_ModeVC1_D2010, 0x1b81bea4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
     70 
     71 DEFINE_GUID(DXVA_ModeMPEG4pt2_VLD_Simple, 0xefd64d74, 0xc9e8, 0x41d7, 0xa5, 0xe9, 0xe9, 0xb0, 0xe3, 0x9f, 0xa3, 0x19);
     72 DEFINE_GUID(DXVA_ModeMPEG4pt2_VLD_AdvSimple_NoGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);
     73 DEFINE_GUID(DXVA_ModeMPEG4pt2_VLD_AdvSimple_GMC, 0xab998b5b, 0x4258, 0x44a9, 0x9f, 0xeb, 0x94, 0xe5, 0x97, 0xa6, 0xba, 0xae);
     74 
     75 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);
     76 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);
     77 DEFINE_GUID(DXVA_ModeHEVC_VLD_Monochrome, 0x0685b993, 0x3d8c, 0x43a0, 0x8b, 0x28, 0xd7, 0x4c, 0x2d, 0x68, 0x99, 0xa4);
     78 DEFINE_GUID(DXVA_ModeHEVC_VLD_Monochrome10, 0x142a1d0f, 0x69dd, 0x4ec9, 0x85, 0x91, 0xb1, 0x2f, 0xfc, 0xb9, 0x1a, 0x29);
     79 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main12, 0x1a72925f, 0x0c2c, 0x4f15, 0x96, 0xfb, 0xb1, 0x7d, 0x14, 0x73, 0x60, 0x3f);
     80 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main10_422, 0x0bac4fe5, 0x1532, 0x4429, 0xa8, 0x54, 0xf8, 0x4d, 0xe0, 0x49, 0x53, 0xdb);
     81 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main12_422, 0x55bcac81, 0xf311, 0x4093, 0xa7, 0xd0, 0x1c, 0xbc, 0x0b, 0x84, 0x9b, 0xee);
     82 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main_444, 0x4008018f, 0xf537, 0x4b36, 0x98, 0xcf, 0x61, 0xaf, 0x8a, 0x2c, 0x1a, 0x33);
     83 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main10_Ext, 0x9cc55490, 0xe37c, 0x4932, 0x86, 0x84, 0x49, 0x20, 0xf9, 0xf6, 0x40, 0x9c);
     84 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main10_444, 0x0dabeffa, 0x4458, 0x4602, 0xbc, 0x03, 0x07, 0x95, 0x65, 0x9d, 0x61, 0x7c);
     85 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main12_444, 0x9798634d, 0xfe9d, 0x48e5, 0xb4, 0xda, 0xdb, 0xec, 0x45, 0xb3, 0xdf, 0x01);
     86 DEFINE_GUID(DXVA_ModeHEVC_VLD_Main16, 0xa4fbdbb0, 0xa113, 0x482b, 0xa2, 0x32, 0x63, 0x5c, 0xc0, 0x69, 0x7f, 0x6d);
     87 
     88 DEFINE_GUID(DXVA_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);
     89 DEFINE_GUID(DXVA_ModeVP9_VLD_10bit_Profile2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
     90 DEFINE_GUID(DXVA_ModeVP8_VLD, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);
     91 
     92 DEFINE_GUID(DXVA_ModeMJPEG_VLD_420, 0x725cb506, 0x0c29, 0x43c4, 0x94, 0x40, 0x8e, 0x93, 0x97, 0x90, 0x3a, 0x04);
     93 DEFINE_GUID(DXVA_ModeMJPEG_VLD_422, 0x5b77b9cd, 0x1a35, 0x4c30, 0x9f, 0xd8, 0xef, 0x4b, 0x60, 0xc0, 0x35, 0xdd);
     94 DEFINE_GUID(DXVA_ModeMJPEG_VLD_444, 0xd95161f9, 0x0d44, 0x47e6, 0xbc, 0xf5, 0x1b, 0xfb, 0xfb, 0x26, 0x8f, 0x97);
     95 DEFINE_GUID(DXVA_ModeMJPEG_VLD_4444, 0xc91748d5, 0xfd18, 0x4aca, 0x9d, 0xb3, 0x3a, 0x66, 0x34, 0xab, 0x54, 0x7d);
     96 DEFINE_GUID(DXVA_ModeJPEG_VLD_420, 0xcf782c83, 0xbef5, 0x4a2c, 0x87, 0xcb, 0x60, 0x19, 0xe7, 0xb1, 0x75, 0xac);
     97 DEFINE_GUID(DXVA_ModeJPEG_VLD_422, 0xf04df417, 0xeee2, 0x4067, 0xa7, 0x78, 0xf3, 0x5c, 0x15, 0xab, 0x97, 0x21);
     98 DEFINE_GUID(DXVA_ModeJPEG_VLD_444, 0x4cd00e17, 0x89ba, 0x48ef, 0xb9, 0xf9, 0xed, 0xcb, 0x82, 0x71, 0x3f, 0x65);
     99 
    100 DEFINE_GUID(DXVA_NoEncrypt, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
    101 
    102 #define DXVA_ModeH264_MoComp_NoFGT  DXVA_ModeH264_A
    103 #define DXVA_ModeH264_MoComp_FGT    DXVA_ModeH264_B
    104 #define DXVA_ModeH264_IDCT_NoFGT    DXVA_ModeH264_C
    105 #define DXVA_ModeH264_IDCT_FGT      DXVA_ModeH264_D
    106 #define DXVA_ModeH264_VLD_NoFGT     DXVA_ModeH264_E
    107 #define DXVA_ModeH264_VLD_FGT       DXVA_ModeH264_F
    108 
    109 #define DXVA_USUAL_BLOCK_WIDTH   8
    110 #define DXVA_USUAL_BLOCK_HEIGHT  8
    111 #define DXVA_USUAL_BLOCK_SIZE   (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT)
    112 
    113 #define DXVA_PICTURE_DECODING_FUNCTION          1
    114 #define DXVA_ALPHA_BLEND_DATA_LOAD_FUNCTION     2
    115 #define DXVA_ALPHA_BLEND_COMBINATION_FUNCTION   3
    116 #define DXVA_PICTURE_RESAMPLE_FUNCTION          4
    117 #define DXVA_DEBLOCKING_FILTER_FUNCTION         5
    118 #define DXVA_FILM_GRAIN_SYNTHESIS_FUNCTION      6
    119 #define DXVA_STATUS_REPORTING_FUNCTION          7
    120 
    121 #pragma pack(push,1)
    122 
    123 typedef struct _DXVA_PicEntry_H264
    124 {
    125     union
    126     {
    127         struct
    128         {
    129             UCHAR Index7Bits     : 7;
    130             UCHAR AssociatedFlag : 1;
    131         } DUMMYSTRUCTNAME;
    132         UCHAR bPicEntry;
    133     } DUMMYUNIONNAME;
    134 } DXVA_PicEntry_H264, *LPDXVA_PicEntry_H264;
    135 
    136 typedef struct _DXVA_FilmGrainCharacteristics
    137 {
    138     USHORT  wFrameWidthInMbsMinus1;
    139     USHORT  wFrameHeightInMbsMinus1;
    140     DXVA_PicEntry_H264 InPic;
    141     DXVA_PicEntry_H264 OutPic;
    142     USHORT  PicOrderCnt_offset;
    143     INT     CurrPicOrderCnt;
    144     UINT    StatusReportFeedbackNumber;
    145     UCHAR   model_id;
    146     UCHAR   separate_colour_description_present_flag;
    147     UCHAR   film_grain_bit_depth_luma_minus8;
    148     UCHAR   film_grain_bit_depth_chroma_minus8;
    149     UCHAR   film_grain_full_range_flag;
    150     UCHAR   film_grain_colour_primaries;
    151     UCHAR   film_grain_transfer_characteristics;
    152     UCHAR   film_grain_matrix_coefficients;
    153     UCHAR   blending_mode_id;
    154     UCHAR   log2_scale_factor;
    155     UCHAR   comp_model_present_flag[4];
    156     UCHAR   num_intensity_intervals_minus1[4];
    157     UCHAR   num_model_values_minus1[4];
    158     UCHAR   intensity_interval_lower_bound[3][16];
    159     UCHAR   intensity_interval_upper_bound[3][16];
    160     SHORT   comp_model_value[3][16][8];
    161 } DXVA_FilmGrainChar_H264, *LPDXVA_FilmGrainChar_H264;
    162 
    163 typedef struct _DXVA_PictureParameters
    164 {
    165     WORD wDecodedPictureIndex;
    166     WORD wDeblockedPictureIndex;
    167     WORD wForwardRefPictureIndex;
    168     WORD wBackwardRefPictureIndex;
    169     WORD wPicWidthInMBminus1;
    170     WORD wPicHeightInMBminus1;
    171     BYTE bMacroblockWidthMinus1;
    172     BYTE bMacroblockHeightMinus1;
    173     BYTE bBlockWidthMinus1;
    174     BYTE bBlockHeightMinus1;
    175     BYTE bBPPminus1;
    176     BYTE bPicStructure;
    177     BYTE bSecondField;
    178     BYTE bPicIntra;
    179     BYTE bPicBackwardPrediction;
    180     BYTE bBidirectionalAveragingMode;
    181     BYTE bMVprecisionAndChromaRelation;
    182     BYTE bChromaFormat;
    183     BYTE bPicScanFixed;
    184     BYTE bPicScanMethod;
    185     BYTE bPicReadbackRequests;
    186     BYTE bRcontrol;
    187     BYTE bPicSpatialResid8;
    188     BYTE bPicOverflowBlocks;
    189     BYTE bPicExtrapolation;
    190     BYTE bPicDeblocked;
    191     BYTE bPicDeblockConfined;
    192     BYTE bPic4MVallowed;
    193     BYTE bPicOBMC;
    194     BYTE bPicBinPB;
    195     BYTE bMV_RPS;
    196     BYTE bReservedBits;
    197     WORD wBitstreamFcodes;
    198     WORD wBitstreamPCEelements;
    199     BYTE bBitstreamConcealmentNeed;
    200     BYTE bBitstreamConcealmentMethod;
    201 } DXVA_PictureParameters, *LPDXVA_PictureParameters;
    202 
    203 typedef struct _DXVA_SliceInfo
    204 {
    205     WORD wHorizontalPosition;
    206     WORD wVerticalPosition;
    207     DWORD dwSliceBitsInBuffer;
    208     DWORD dwSliceDataLocation;
    209     BYTE bStartCodeBitOffset;
    210     BYTE bReservedBits;
    211     WORD wMBbitOffset;
    212     WORD wNumberMBsInSlice;
    213     WORD wQuantizerScaleCode;
    214     WORD wBadSliceChopping;
    215 } DXVA_SliceInfo, *LPDXVA_SliceInfo;
    216 
    217 typedef struct _DXVA_QmatrixData
    218 {
    219     BYTE bNewQmatrix[4];
    220     WORD Qmatrix[4][DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT];
    221 } DXVA_QmatrixData, *LPDXVA_QmatrixData;
    222 
    223 typedef struct _DXVA_PicParams_H264
    224 {
    225     USHORT wFrameWidthInMbsMinus1;
    226     USHORT wFrameHeightInMbsMinus1;
    227     DXVA_PicEntry_H264 CurrPic;
    228     UCHAR num_ref_frames;
    229     union
    230     {
    231         struct
    232         {
    233             USHORT field_pic_flag                   : 1;
    234             USHORT MbaffFrameFlag                   : 1;
    235             USHORT residual_colour_transform_flag   : 1;
    236             USHORT sp_for_switch_flag               : 1;
    237             USHORT chroma_format_idc                : 2;
    238             USHORT RefPicFlag                       : 1;
    239             USHORT constrained_intra_pred_flag      : 1;
    240             USHORT weighted_pred_flag               : 1;
    241             USHORT weighted_bipred_idc              : 2;
    242             USHORT MbsConsecutiveFlag               : 1;
    243             USHORT frame_mbs_only_flag              : 1;
    244             USHORT transform_8x8_mode_flag          : 1;
    245             USHORT MinLumaBipredSize8x8Flag         : 1;
    246             USHORT IntraPicFlag                     : 1;
    247         } DUMMYSTRUCTNAME;
    248         USHORT wBitFields;
    249     } DUMMYUNIONNAME;
    250     UCHAR bit_depth_luma_minus8;
    251     UCHAR bit_depth_chroma_minus8;
    252     USHORT Reserved16Bits;
    253     UINT StatusReportFeedbackNumber;
    254     DXVA_PicEntry_H264 RefFrameList[16];
    255     INT CurrFieldOrderCnt[2];
    256     INT FieldOrderCntList[16][2];
    257     CHAR pic_init_qs_minus26;
    258     CHAR chroma_qp_index_offset;
    259     CHAR second_chroma_qp_index_offset;
    260     UCHAR ContinuationFlag;
    261     CHAR pic_init_qp_minus26;
    262     UCHAR num_ref_idx_l0_active_minus1;
    263     UCHAR num_ref_idx_l1_active_minus1;
    264     UCHAR Reserved8BitsA;
    265     USHORT FrameNumList[16];
    266 
    267     UINT UsedForReferenceFlags;
    268     USHORT NonExistingFrameFlags;
    269     USHORT frame_num;
    270     UCHAR log2_max_frame_num_minus4;
    271     UCHAR pic_order_cnt_type;
    272     UCHAR log2_max_pic_order_cnt_lsb_minus4;
    273     UCHAR delta_pic_order_always_zero_flag;
    274     UCHAR direct_8x8_inference_flag;
    275     UCHAR entropy_coding_mode_flag;
    276     UCHAR pic_order_present_flag;
    277     UCHAR num_slice_groups_minus1;
    278     UCHAR slice_group_map_type;
    279     UCHAR deblocking_filter_control_present_flag;
    280     UCHAR redundant_pic_cnt_present_flag;
    281     UCHAR Reserved8BitsB;
    282     USHORT slice_group_change_rate_minus1;
    283     UCHAR SliceGroupMap[810];
    284 } DXVA_PicParams_H264, *LPDXVA_PicParams_H264;
    285 
    286 typedef struct _DXVA_Qmatrix_H264
    287 {
    288     UCHAR bScalingLists4x4[6][16];
    289     UCHAR bScalingLists8x8[2][64];
    290 } DXVA_Qmatrix_H264, *LPDXVA_Qmatrix_H264;
    291 
    292 typedef struct _DXVA_Slice_H264_Long
    293 {
    294     UINT BSNALunitDataLocation;
    295     UINT SliceBytesInBuffer;
    296     USHORT wBadSliceChopping;
    297     USHORT first_mb_in_slice;
    298     USHORT NumMbsForSlice;
    299     USHORT BitOffsetToSliceData;
    300     UCHAR slice_type;
    301     UCHAR luma_log2_weight_denom;
    302     UCHAR chroma_log2_weight_denom;
    303 
    304     UCHAR num_ref_idx_l0_active_minus1;
    305     UCHAR num_ref_idx_l1_active_minus1;
    306     CHAR slice_alpha_c0_offset_div2;
    307     CHAR slice_beta_offset_div2;
    308     UCHAR Reserved8Bits;
    309     DXVA_PicEntry_H264 RefPicList[2][32];
    310     SHORT Weights[2][32][3][2];
    311     CHAR slice_qs_delta;
    312     CHAR slice_qp_delta;
    313     UCHAR redundant_pic_cnt;
    314     UCHAR direct_spatial_mv_pred_flag;
    315     UCHAR cabac_init_idc;
    316     UCHAR disable_deblocking_filter_idc;
    317     USHORT slice_id;
    318 } DXVA_Slice_H264_Long, *LPDXVA_Slice_H264_Long;
    319 
    320 typedef struct _DXVA_Slice_H264_Short
    321 {
    322     UINT BSNALunitDataLocation;
    323     UINT SliceBytesInBuffer;
    324     USHORT wBadSliceChopping;
    325 } DXVA_Slice_H264_Short, *LPDXVA_Slice_H264_Short;
    326 
    327 typedef struct _DXVA_Status_H264
    328 {
    329     UINT StatusReportFeedbackNumber;
    330     DXVA_PicEntry_H264 CurrPic;
    331     UCHAR field_pic_flag;
    332     UCHAR bDXVA_Func;
    333     UCHAR bBufType;
    334     UCHAR bStatus;
    335     UCHAR bReserved8Bits;
    336     USHORT wNumMbsAffected;
    337 } DXVA_Status_H264, *LPDXVA_Status_H264;
    338 
    339 typedef struct _DXVA_PicEntry_HEVC
    340 {
    341     union
    342     {
    343         struct
    344         {
    345             UCHAR Index7Bits : 7;
    346             UCHAR AssociatedFlag : 1;
    347         };
    348         UCHAR bPicEntry;
    349     };
    350 } DXVA_PicEntry_HEVC, *LPDXVA_PicEntry_HEVC;
    351 
    352 typedef struct _DXVA_PicParams_HEVC
    353 {
    354     USHORT      PicWidthInMinCbsY;
    355     USHORT      PicHeightInMinCbsY;
    356     union
    357     {
    358         struct
    359         {
    360             USHORT  chroma_format_idc                       : 2;
    361             USHORT  separate_colour_plane_flag              : 1;
    362             USHORT  bit_depth_luma_minus8                   : 3;
    363             USHORT  bit_depth_chroma_minus8                 : 3;
    364             USHORT  log2_max_pic_order_cnt_lsb_minus4       : 4;
    365             USHORT  NoPicReorderingFlag                     : 1;
    366             USHORT  NoBiPredFlag                            : 1;
    367             USHORT  ReservedBits1                            : 1;
    368         };
    369         USHORT wFormatAndSequenceInfoFlags;
    370     };
    371     DXVA_PicEntry_HEVC  CurrPic;
    372     UCHAR   sps_max_dec_pic_buffering_minus1;
    373     UCHAR   log2_min_luma_coding_block_size_minus3;
    374     UCHAR   log2_diff_max_min_luma_coding_block_size;
    375     UCHAR   log2_min_transform_block_size_minus2;
    376     UCHAR   log2_diff_max_min_transform_block_size;
    377     UCHAR   max_transform_hierarchy_depth_inter;
    378     UCHAR   max_transform_hierarchy_depth_intra;
    379     UCHAR   num_short_term_ref_pic_sets;
    380     UCHAR   num_long_term_ref_pics_sps;
    381     UCHAR   num_ref_idx_l0_default_active_minus1;
    382     UCHAR   num_ref_idx_l1_default_active_minus1;
    383     CHAR    init_qp_minus26;
    384     UCHAR   ucNumDeltaPocsOfRefRpsIdx;
    385     USHORT  wNumBitsForShortTermRPSInSlice;
    386     USHORT  ReservedBits2;
    387 
    388     union
    389     {
    390         struct
    391         {
    392             UINT32  scaling_list_enabled_flag                    : 1;
    393             UINT32  amp_enabled_flag                            : 1;
    394             UINT32  sample_adaptive_offset_enabled_flag         : 1;
    395             UINT32  pcm_enabled_flag                            : 1;
    396             UINT32  pcm_sample_bit_depth_luma_minus1            : 4;
    397             UINT32  pcm_sample_bit_depth_chroma_minus1          : 4;
    398             UINT32  log2_min_pcm_luma_coding_block_size_minus3  : 2;
    399             UINT32  log2_diff_max_min_pcm_luma_coding_block_size : 2;
    400             UINT32  pcm_loop_filter_disabled_flag                : 1;
    401             UINT32  long_term_ref_pics_present_flag             : 1;
    402             UINT32  sps_temporal_mvp_enabled_flag               : 1;
    403             UINT32  strong_intra_smoothing_enabled_flag         : 1;
    404             UINT32  dependent_slice_segments_enabled_flag       : 1;
    405             UINT32  output_flag_present_flag                    : 1;
    406             UINT32  num_extra_slice_header_bits                 : 3;
    407             UINT32  sign_data_hiding_enabled_flag               : 1;
    408             UINT32  cabac_init_present_flag                     : 1;
    409             UINT32  ReservedBits3                               : 5;
    410         };
    411         UINT32 dwCodingParamToolFlags;
    412     };
    413 
    414     union
    415     {
    416         struct
    417         {
    418             UINT32  constrained_intra_pred_flag                 : 1;
    419             UINT32  transform_skip_enabled_flag                 : 1;
    420             UINT32  cu_qp_delta_enabled_flag                    : 1;
    421             UINT32  pps_slice_chroma_qp_offsets_present_flag    : 1;
    422             UINT32  weighted_pred_flag                          : 1;
    423             UINT32  weighted_bipred_flag                        : 1;
    424             UINT32  transquant_bypass_enabled_flag              : 1;
    425             UINT32  tiles_enabled_flag                          : 1;
    426             UINT32  entropy_coding_sync_enabled_flag            : 1;
    427             UINT32  uniform_spacing_flag                        : 1;
    428             UINT32  loop_filter_across_tiles_enabled_flag       : 1;
    429             UINT32  pps_loop_filter_across_slices_enabled_flag  : 1;
    430             UINT32  deblocking_filter_override_enabled_flag     : 1;
    431             UINT32  pps_deblocking_filter_disabled_flag         : 1;
    432             UINT32  lists_modification_present_flag             : 1;
    433             UINT32  slice_segment_header_extension_present_flag : 1;
    434             UINT32  IrapPicFlag                                 : 1;
    435             UINT32  IdrPicFlag                                  : 1;
    436             UINT32  IntraPicFlag                                : 1;
    437             UINT32  ReservedBits4                               : 13;
    438         };
    439         UINT32 dwCodingSettingPicturePropertyFlags;
    440     };
    441     CHAR    pps_cb_qp_offset;
    442     CHAR    pps_cr_qp_offset;
    443     UCHAR   num_tile_columns_minus1;
    444     UCHAR   num_tile_rows_minus1;
    445     USHORT  column_width_minus1[19];
    446     USHORT  row_height_minus1[21];
    447     UCHAR   diff_cu_qp_delta_depth;
    448     CHAR    pps_beta_offset_div2;
    449     CHAR    pps_tc_offset_div2;
    450     UCHAR   log2_parallel_merge_level_minus2;
    451     INT     CurrPicOrderCntVal;
    452     DXVA_PicEntry_HEVC	RefPicList[15];
    453     UCHAR   ReservedBits5;
    454     INT     PicOrderCntValList[15];
    455     UCHAR   RefPicSetStCurrBefore[8];
    456     UCHAR   RefPicSetStCurrAfter[8];
    457     UCHAR   RefPicSetLtCurr[8];
    458     USHORT  ReservedBits6;
    459     USHORT  ReservedBits7;
    460     UINT    StatusReportFeedbackNumber;
    461 } DXVA_PicParams_HEVC, *LPDXVA_PicParams_HEVC;
    462 
    463 typedef struct _DXVA_PicParams_HEVC_RangeExt
    464 {
    465     DXVA_PicParams_HEVC params;
    466     union
    467     {
    468         struct
    469         {
    470             USHORT transform_skip_rotation_enabled_flag    : 1;
    471             USHORT transform_skip_context_enabled_flag     : 1;
    472             USHORT implicit_rdpcm_enabled_flag             : 1;
    473             USHORT explicit_rdpcm_enabled_flag             : 1;
    474             USHORT extended_precision_processing_flag      : 1;
    475             USHORT intra_smoothing_disabled_flag           : 1;
    476             USHORT persistent_rice_adaptation_enabled_flag : 1;
    477             USHORT high_precision_offsets_enabled_flag     : 1;
    478             USHORT cabac_bypass_alignment_enabled_flag     : 1;
    479             USHORT cross_component_prediction_enabled_flag : 1;
    480             USHORT chroma_qp_offset_list_enabled_flag      : 1;
    481             USHORT ReservedBits8                           : 5;
    482         };
    483         USHORT dwRangeExtensionFlags;
    484     };
    485     UCHAR diff_cu_chroma_qp_offset_depth;
    486     UCHAR log2_sao_offset_scale_luma;
    487     UCHAR log2_sao_offset_scale_chroma;
    488     UCHAR log2_max_transform_skip_block_size_minus2;
    489     CHAR cb_qp_offset_list[6];
    490     CHAR cr_qp_offset_list[6];
    491     UCHAR chroma_qp_offset_list_len_minus1;
    492     USHORT ReservedBits9;
    493 } DXVA_PicParams_HEVC_RangeExt, *LPDXVA_PicParams_HEVC_RangeExt;
    494 
    495 typedef struct _DXVA_Qmatrix_HEVC
    496 {
    497     UCHAR ucScalingLists0[6][16];
    498     UCHAR ucScalingLists1[6][64];
    499     UCHAR ucScalingLists2[6][64];
    500     UCHAR ucScalingLists3[2][64];
    501     UCHAR ucScalingListDCCoefSizeID2[6];
    502     UCHAR ucScalingListDCCoefSizeID3[2];
    503 } DXVA_Qmatrix_HEVC, *LPDXVA_Qmatrix_HEVC;
    504 
    505 typedef struct _DXVA_Slice_HEVC_Short
    506 {
    507     UINT    BSNALunitDataLocation;
    508     UINT    SliceBytesInBuffer;
    509     USHORT  wBadSliceChopping;
    510 } DXVA_Slice_HEVC_Short, *LPDXVA_Slice_HEVC_Short;
    511 
    512 typedef struct _DXVA_PicEntry_VPx
    513 {
    514     union
    515     {
    516         struct
    517         {
    518             UCHAR Index7Bits     : 7;
    519             UCHAR AssociatedFlag : 1;
    520         };
    521         UCHAR bPicEntry;
    522     };
    523 } DXVA_PicEntry_VPx, *LPDXVA_PicEntry_VPx;
    524 
    525 typedef struct _segmentation_VP9
    526 {
    527     union
    528     {
    529         struct
    530         {
    531             UCHAR enabled                   : 1;
    532             UCHAR update_map                : 1;
    533             UCHAR temporal_update           : 1;
    534             UCHAR abs_delta                 : 1;
    535             UCHAR ReservedSegmentFlags4Bits : 4;
    536         };
    537         UCHAR wSegmentInfoFlags;
    538     };
    539     UCHAR tree_probs[7];
    540     UCHAR pred_probs[3];
    541     SHORT feature_data[8][4];
    542     UCHAR feature_mask[8];
    543 } DXVA_segmentation_VP9;
    544 
    545 typedef struct _DXVA_PicParams_VP9
    546 {
    547     DXVA_PicEntry_VPx    CurrPic;
    548     UCHAR                profile;
    549     union
    550     {
    551         struct
    552         {
    553             USHORT frame_type                   : 1;
    554             USHORT show_frame                   : 1;
    555             USHORT error_resilient_mode         : 1;
    556             USHORT subsampling_x                : 1;
    557             USHORT subsampling_y                : 1;
    558             USHORT extra_plane                  : 1;
    559             USHORT refresh_frame_context        : 1;
    560             USHORT frame_parallel_decoding_mode : 1;
    561             USHORT intra_only                   : 1;
    562             USHORT frame_context_idx            : 2;
    563             USHORT reset_frame_context          : 2;
    564             USHORT allow_high_precision_mv      : 1;
    565             USHORT ReservedFormatInfo2Bits      : 2;
    566         };
    567         USHORT wFormatAndPictureInfoFlags;
    568     };
    569     UINT  width;
    570     UINT  height;
    571     UCHAR BitDepthMinus8Luma;
    572     UCHAR BitDepthMinus8Chroma;
    573     UCHAR interp_filter;
    574     UCHAR Reserved8Bits;
    575     DXVA_PicEntry_VPx  ref_frame_map[8];
    576     UINT  ref_frame_coded_width[8];
    577     UINT  ref_frame_coded_height[8];
    578     DXVA_PicEntry_VPx  frame_refs[3];
    579     CHAR  ref_frame_sign_bias[4];
    580     CHAR  filter_level;
    581     CHAR  sharpness_level;
    582     union
    583     {
    584         struct
    585         {
    586             UCHAR mode_ref_delta_enabled   : 1;
    587             UCHAR mode_ref_delta_update    : 1;
    588             UCHAR use_prev_in_find_mv_refs : 1;
    589             UCHAR ReservedControlInfo5Bits : 5;
    590         };
    591         UCHAR wControlInfoFlags;
    592     };
    593     CHAR   ref_deltas[4];
    594     CHAR   mode_deltas[2];
    595     SHORT  base_qindex;
    596     CHAR   y_dc_delta_q;
    597     CHAR   uv_dc_delta_q;
    598     CHAR   uv_ac_delta_q;
    599     DXVA_segmentation_VP9 stVP9Segments;
    600     UCHAR  log2_tile_cols;
    601     UCHAR  log2_tile_rows;
    602     USHORT uncompressed_header_size_byte_aligned;
    603     USHORT first_partition_size;
    604     USHORT Reserved16Bits;
    605     UINT   Reserved32Bits;
    606     UINT   StatusReportFeedbackNumber;
    607 } DXVA_PicParams_VP9, *LPDXVA_PicParams_VP9;
    608 
    609 typedef struct _segmentation_VP8
    610 {
    611     union
    612     {
    613         struct
    614         {
    615             UCHAR segmentation_enabled        : 1;
    616             UCHAR update_mb_segmentation_map  : 1;
    617             UCHAR update_mb_segmentation_data : 1;
    618             UCHAR mb_segement_abs_delta       : 1;
    619             UCHAR ReservedSegmentFlags4Bits   : 4;
    620         };
    621         UCHAR wSegmentFlags;
    622     };
    623     CHAR  segment_feature_data[2][4];
    624     UCHAR mb_segment_tree_probs[3];
    625 } DXVA_segmentation_VP8;
    626 
    627 typedef struct _DXVA_PicParams_VP8
    628 {
    629     UINT first_part_size;
    630     UINT width;
    631     UINT height;
    632     DXVA_PicEntry_VPx  CurrPic;
    633     union
    634     {
    635         struct
    636         {
    637             UCHAR frame_type            : 1;
    638             UCHAR version               : 3;
    639             UCHAR show_frame            : 1;
    640             UCHAR clamp_type            : 1;
    641             UCHAR ReservedFrameTag3Bits : 2;
    642         };
    643         UCHAR wFrameTagFlags;
    644     };
    645     DXVA_segmentation_VP8  stVP8Segments;
    646     UCHAR  filter_type;
    647     UCHAR  filter_level;
    648     UCHAR  sharpness_level;
    649     UCHAR  mode_ref_lf_delta_enabled;
    650     UCHAR  mode_ref_lf_delta_update;
    651     CHAR   ref_lf_deltas[4];
    652     CHAR   mode_lf_deltas[4];
    653     UCHAR  log2_nbr_of_dct_partitions;
    654     UCHAR  base_qindex;
    655     CHAR   y1dc_delta_q;
    656     CHAR   y2dc_delta_q;
    657     CHAR   y2ac_delta_q;
    658     CHAR   uvdc_delta_q;
    659     CHAR   uvac_delta_q;
    660     DXVA_PicEntry_VPx alt_fb_idx;
    661     DXVA_PicEntry_VPx gld_fb_idx;
    662     DXVA_PicEntry_VPx lst_fb_idx;
    663     UCHAR  ref_frame_sign_bias_golden;
    664     UCHAR  ref_frame_sign_bias_altref;
    665     UCHAR  refresh_entropy_probs;
    666     UCHAR  vp8_coef_update_probs[4][8][3][11];
    667     UCHAR  mb_no_coeff_skip;
    668     UCHAR  prob_skip_false;
    669     UCHAR  prob_intra;
    670     UCHAR  prob_last;
    671     UCHAR  prob_golden;
    672     UCHAR  intra_16x16_prob[4];
    673     UCHAR  intra_chroma_prob[3];
    674     UCHAR  vp8_mv_update_probs[2][19];
    675     USHORT ReservedBits1;
    676     USHORT ReservedBits2;
    677     USHORT ReservedBits3;
    678     UINT   StatusReportFeedbackNumber;
    679 } DXVA_PicParams_VP8, *LPDXVA_PicParams_VP8;
    680 
    681 typedef struct _DXVA_Slice_VPx_Short
    682 {
    683     UINT   BSNALunitDataLocation;
    684     UINT   SliceBytesInBuffer;
    685     USHORT wBadSliceChopping;
    686 } DXVA_Slice_VPx_Short, *LPDXVA_Slice_VPx_Short;
    687 
    688 typedef struct _DXVA_Status_VPx
    689 {
    690     UINT   StatusReportFeedbackNumber;
    691     DXVA_PicEntry_VPx CurrPic;
    692     UCHAR  bBufType;
    693     UCHAR  bStatus;
    694     UCHAR  bReserved8Bits;
    695     USHORT wNumMbsAffected;
    696 } DXVA_Status_VPx, *LPDXVA_Status_VPx;
    697 
    698 
    699 #define _DIRECTX_AV1_VA_
    700 
    701 /* AV1 decoder GUIDs */
    702 DEFINE_GUID(DXVA_ModeAV1_VLD_Profile0,           0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a);
    703 DEFINE_GUID(DXVA_ModeAV1_VLD_Profile1,           0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08);
    704 DEFINE_GUID(DXVA_ModeAV1_VLD_Profile2,           0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);
    705 DEFINE_GUID(DXVA_ModeAV1_VLD_12bit_Profile2,     0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);
    706 DEFINE_GUID(DXVA_ModeAV1_VLD_12bit_Profile2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);
    707 
    708 /* AV1 picture entry data structure */
    709 typedef struct _DXVA_PicEntry_AV1 {
    710     UINT width;
    711     UINT height;
    712 
    713     INT wmmat[6];
    714     __C89_NAMELESS union {
    715         __C89_NAMELESS struct {
    716             UCHAR wminvalid : 1;
    717             UCHAR wmtype : 2;
    718             UCHAR Reserved : 5;
    719         } __C89_NAMELESSSTRUCTNAME;
    720         UCHAR GlobalMotionFlags;
    721     } __C89_NAMELESSUNIONNAME;
    722     UCHAR Index;
    723     UINT16 Reserved16Bits;
    724 } DXVA_PicEntry_AV1, *LPDXVA_PicEntry_AV1;
    725 
    726 /* AV1 picture parameters data structure */
    727 typedef struct _DXVA_PicParams_AV1 {
    728     UINT width;
    729     UINT height;
    730 
    731     UINT max_width;
    732     UINT max_height;
    733 
    734     UCHAR CurrPicTextureIndex;
    735     UCHAR superres_denom;
    736     UCHAR bitdepth;
    737     UCHAR seq_profile;
    738 
    739     struct {
    740         UCHAR cols;
    741         UCHAR rows;
    742         USHORT context_update_id;
    743         USHORT widths[64];
    744         USHORT heights[64];
    745     } tiles;
    746 
    747     union {
    748         __C89_NAMELESS struct {
    749             UINT use_128x128_superblock : 1;
    750             UINT intra_edge_filter : 1;
    751             UINT interintra_compound : 1;
    752             UINT masked_compound : 1;
    753             UINT warped_motion : 1;
    754             UINT dual_filter : 1;
    755             UINT jnt_comp : 1;
    756             UINT screen_content_tools : 1;
    757             UINT integer_mv : 1;
    758             UINT cdef : 1;
    759             UINT restoration : 1;
    760             UINT film_grain : 1;
    761             UINT intrabc : 1;
    762             UINT high_precision_mv : 1;
    763             UINT switchable_motion_mode : 1;
    764             UINT filter_intra : 1;
    765             UINT disable_frame_end_update_cdf : 1;
    766             UINT disable_cdf_update : 1;
    767             UINT reference_mode : 1;
    768             UINT skip_mode : 1;
    769             UINT reduced_tx_set : 1;
    770             UINT superres : 1;
    771             UINT tx_mode : 2;
    772             UINT use_ref_frame_mvs : 1;
    773             UINT enable_ref_frame_mvs : 1;
    774             UINT reference_frame_update : 1;
    775             UINT Reserved : 5;
    776         } __C89_NAMELESSSTRUCTNAME;
    777         UINT32 CodingParamToolFlags;
    778     } coding;
    779 
    780     union {
    781         __C89_NAMELESS struct {
    782             UCHAR frame_type : 2;
    783             UCHAR show_frame : 1;
    784             UCHAR showable_frame : 1;
    785             UCHAR subsampling_x : 1;
    786             UCHAR subsampling_y : 1;
    787             UCHAR mono_chrome : 1;
    788             UCHAR Reserved : 1;
    789         } __C89_NAMELESSSTRUCTNAME;
    790         UCHAR FormatAndPictureInfoFlags;
    791     } format;
    792 
    793     UCHAR primary_ref_frame;
    794     UCHAR order_hint;
    795     UCHAR order_hint_bits;
    796 
    797     DXVA_PicEntry_AV1 frame_refs[7];
    798     UCHAR RefFrameMapTextureIndex[8];
    799 
    800     struct {
    801         UCHAR filter_level[2];
    802         UCHAR filter_level_u;
    803         UCHAR filter_level_v;
    804 
    805         UCHAR sharpness_level;
    806         __C89_NAMELESS union {
    807             __C89_NAMELESS struct {
    808                 UCHAR mode_ref_delta_enabled : 1;
    809                 UCHAR mode_ref_delta_update : 1;
    810                 UCHAR delta_lf_multi : 1;
    811                 UCHAR delta_lf_present : 1;
    812                 UCHAR Reserved : 4;
    813             } __C89_NAMELESSSTRUCTNAME;
    814             UCHAR ControlFlags;
    815         } __C89_NAMELESSUNIONNAME;
    816         CHAR ref_deltas[8];
    817         CHAR mode_deltas[2];
    818         UCHAR delta_lf_res;
    819         UCHAR frame_restoration_type[3];
    820         USHORT log2_restoration_unit_size[3];
    821         UINT16 Reserved16Bits;
    822     } loop_filter;
    823 
    824     struct {
    825         __C89_NAMELESS union {
    826             __C89_NAMELESS struct {
    827                 UCHAR delta_q_present : 1;
    828                 UCHAR delta_q_res : 2;
    829                 UCHAR Reserved : 5;
    830             } __C89_NAMELESSSTRUCTNAME;
    831             UCHAR ControlFlags;
    832         } __C89_NAMELESSUNIONNAME;
    833 
    834         UCHAR base_qindex;
    835         CHAR y_dc_delta_q;
    836         CHAR u_dc_delta_q;
    837         CHAR v_dc_delta_q;
    838         CHAR u_ac_delta_q;
    839         CHAR v_ac_delta_q;
    840         UCHAR qm_y;
    841         UCHAR qm_u;
    842         UCHAR qm_v;
    843         UINT16 Reserved16Bits;
    844     } quantization;
    845 
    846     struct {
    847         __C89_NAMELESS union {
    848             __C89_NAMELESS struct {
    849                 UCHAR damping : 2;
    850                 UCHAR bits : 2;
    851                 UCHAR Reserved : 4;
    852             } __C89_NAMELESSSTRUCTNAME;
    853             UCHAR ControlFlags;
    854         } __C89_NAMELESSUNIONNAME;
    855 
    856         union {
    857             __C89_NAMELESS struct {
    858                 UCHAR primary : 6;
    859                 UCHAR secondary : 2;
    860             } __C89_NAMELESSSTRUCTNAME;
    861             UCHAR combined;
    862         } y_strengths[8];
    863 
    864         union {
    865             __C89_NAMELESS struct {
    866                 UCHAR primary : 6;
    867                 UCHAR secondary : 2;
    868             } __C89_NAMELESSSTRUCTNAME;
    869             UCHAR combined;
    870         } uv_strengths[8];
    871 
    872     } cdef;
    873 
    874     UCHAR interp_filter;
    875 
    876     struct {
    877         __C89_NAMELESS union {
    878             __C89_NAMELESS struct {
    879                 UCHAR enabled : 1;
    880                 UCHAR update_map : 1;
    881                 UCHAR update_data : 1;
    882                 UCHAR temporal_update : 1;
    883                 UCHAR Reserved : 4;
    884             } __C89_NAMELESSSTRUCTNAME;
    885             UCHAR ControlFlags;
    886         } __C89_NAMELESSUNIONNAME;
    887         UCHAR Reserved24Bits[3];
    888 
    889         union {
    890             __C89_NAMELESS struct {
    891                 UCHAR alt_q : 1;
    892                 UCHAR alt_lf_y_v : 1;
    893                 UCHAR alt_lf_y_h : 1;
    894                 UCHAR alt_lf_u : 1;
    895                 UCHAR alt_lf_v : 1;
    896                 UCHAR ref_frame : 1;
    897                 UCHAR skip : 1;
    898                 UCHAR globalmv : 1;
    899             } __C89_NAMELESSSTRUCTNAME;
    900             UCHAR mask;
    901         } feature_mask[8];
    902 
    903         SHORT feature_data[8][8];
    904 
    905     } segmentation;
    906 
    907     struct {
    908         __C89_NAMELESS union {
    909             __C89_NAMELESS struct {
    910                 USHORT apply_grain : 1;
    911                 USHORT scaling_shift_minus8 : 2;
    912                 USHORT chroma_scaling_from_luma : 1;
    913                 USHORT ar_coeff_lag : 2;
    914                 USHORT ar_coeff_shift_minus6 : 2;
    915                 USHORT grain_scale_shift : 2;
    916                 USHORT overlap_flag : 1;
    917                 USHORT clip_to_restricted_range : 1;
    918                 USHORT matrix_coeff_is_identity : 1;
    919                 USHORT Reserved : 3;
    920             } __C89_NAMELESSSTRUCTNAME;
    921             USHORT ControlFlags;
    922         } __C89_NAMELESSUNIONNAME;
    923 
    924         USHORT grain_seed;
    925         UCHAR scaling_points_y[14][2];
    926         UCHAR num_y_points;
    927         UCHAR scaling_points_cb[10][2];
    928         UCHAR num_cb_points;
    929         UCHAR scaling_points_cr[10][2];
    930         UCHAR num_cr_points;
    931         UCHAR ar_coeffs_y[24];
    932         UCHAR ar_coeffs_cb[25];
    933         UCHAR ar_coeffs_cr[25];
    934         UCHAR cb_mult;
    935         UCHAR cb_luma_mult;
    936         UCHAR cr_mult;
    937         UCHAR cr_luma_mult;
    938         UCHAR Reserved8Bits;
    939         SHORT cb_offset;
    940         SHORT cr_offset;
    941     } film_grain;
    942 
    943     UINT   Reserved32Bits;
    944     UINT   StatusReportFeedbackNumber;
    945 } DXVA_PicParams_AV1, *LPDXVA_PicParams_AV1;
    946 
    947 /* AV1 tile data structure */
    948 typedef struct _DXVA_Tile_AV1 {
    949     UINT   DataOffset;
    950     UINT   DataSize;
    951     USHORT row;
    952     USHORT column;
    953     UINT16 Reserved16Bits;
    954     UCHAR  anchor_frame;
    955     UCHAR  Reserved8Bits;
    956 } DXVA_Tile_AV1, *LPDXVA_Tile_AV1;
    957 
    958 typedef struct _DXVA_Status_AV1 {
    959     UINT  StatusReportFeedbackNumber;
    960     DXVA_PicEntry_AV1 CurrPic;
    961     UCHAR  BufType;
    962     UCHAR  Status;
    963     UCHAR  Reserved8Bits;
    964     USHORT NumMbsAffected;
    965 } DXVA_Status_AV1, *LPDXVA_Status_AV1;
    966 
    967 #pragma pack(pop)
    968 
    969 typedef enum _DXVA_VideoChromaSubsampling
    970 {
    971     DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes  = 0x1,
    972     DXVA_VideoChromaSubsampling_Vertically_Cosited              = 0x2,
    973     DXVA_VideoChromaSubsampling_Horizontally_Cosited            = 0x4,
    974     DXVA_VideoChromaSubsampling_ProgressiveChroma               = 0x8,
    975 
    976     DXVA_VideoChromaSubsampling_Unknown = 0,
    977     DXVA_VideoChromaSubsampling_Cosited = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
    978             | DXVA_VideoChromaSubsampling_Vertically_Cosited
    979             | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
    980     DXVA_VideoChromaSubsampling_DV_PAL = DXVA_VideoChromaSubsampling_Vertically_Cosited
    981             | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
    982     DXVA_VideoChromaSubsampling_MPEG1 = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
    983     DXVA_VideoChromaSubsampling_MPEG2 = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
    984             | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
    985 } DXVA_VideoChromaSubsampling;
    986 
    987 typedef enum _DXVA_NominalRange
    988 {
    989     DXVA_NominalRange_Unknown = 0,
    990     DXVA_NominalRange_0_255 = 1,
    991     DXVA_NominalRange_16_235 = 2,
    992     DXVA_NominalRange_48_208 = 3,
    993     DXVA_NominalRange_Normal = DXVA_NominalRange_0_255,
    994     DXVA_NominalRange_Wide = DXVA_NominalRange_16_235,
    995 } DXVA_NominalRange;
    996 
    997 typedef enum _DXVA_VideoTransferMatrix
    998 {
    999     DXVA_VideoTransferMatrix_Unknown = 0,
   1000     DXVA_VideoTransferMatrix_BT709 = 1,
   1001     DXVA_VideoTransferMatrix_BT601 = 2,
   1002     DXVA_VideoTransferMatrix_SMPTE240M = 3,
   1003 } DXVA_VideoTransferMatrix;
   1004 
   1005 typedef enum _DXVA_VideoLighting
   1006 {
   1007     DXVA_VideoLighting_Unknown = 0,
   1008     DXVA_VideoLighting_bright = 1,
   1009     DXVA_VideoLighting_office = 2,
   1010     DXVA_VideoLighting_dim = 3,
   1011     DXVA_VideoLighting_dark = 4,
   1012 } DXVA_VideoLighting;
   1013 
   1014 typedef enum _DXVA_VideoPrimaries
   1015 {
   1016     DXVA_VideoPrimaries_Unknown = 0,
   1017     DXVA_VideoPrimaries_reserved = 1,
   1018     DXVA_VideoPrimaries_BT709 = 2,
   1019     DXVA_VideoPrimaries_BT470_2_SysM = 3,
   1020     DXVA_VideoPrimaries_BT470_2_SysBG = 4,
   1021     DXVA_VideoPrimaries_SMPTE170M = 5,
   1022     DXVA_VideoPrimaries_SMPTE420M = 6,
   1023     DXVA_VideoPrimaries_EBU3213 = 7,
   1024     DXVA_VideoPrimaries_SMPTE_C = 8,
   1025 } DXVA_VideoPrimaries;
   1026 
   1027 typedef enum _DXVA_VideoTransferFunction
   1028 {
   1029     DXVA_VideoTransFunc_Unknown = 0,
   1030     DXVA_VideoTransFunc_10 = 1,
   1031     DXVA_VideoTransFunc_18 = 2,
   1032     DXVA_VideoTransFunc_20 = 3,
   1033     DXVA_VideoTransFunc_22 = 4,
   1034     DXVA_VideoTransFunc_22_709 = 5,
   1035     DXVA_VideoTransFunc_22_240M = 6,
   1036     DXVA_VideoTransFunc_22_8bit_sRGB = 7,
   1037     DXVA_VideoTransFunc_28 = 8,
   1038 } DXVA_VideoTransferFunction;
   1039 
   1040 typedef struct _DXVA_ExtendedFormat
   1041 {
   1042     UINT SampleFormat : 8;
   1043     UINT VideoChromaSubsampling : 4;
   1044     DXVA_NominalRange NominalRange : 3;
   1045     DXVA_VideoTransferMatrix VideoTransferMatrix : 3;
   1046     DXVA_VideoLighting VideoLighting : 4;
   1047     DXVA_VideoPrimaries VideoPrimaries : 5;
   1048     DXVA_VideoTransferFunction VideoTransferFunction : 5;
   1049 } DXVA_ExtendedFormat;
   1050 
   1051 #ifdef __cplusplus
   1052 }
   1053 #endif
   1054 
   1055 #endif /* __WINE_DXVA_H */