1 /*
2 * Copyright (c) 2017-2020, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file     mhw_vdbox_avp_hwcmd_g12_X.h
24 //! \brief    Auto-generated constructors for MHW and states.
25 //! \details  This file may not be included outside of g12_X as other components
26 //!           should use MHW interface to interact with MHW commands and states.
27 //!
28 
29 // DO NOT EDIT
30 
31 #ifndef __MHW_AVP_HWCMD_G12_H__
32 #define __MHW_AVP_HWCMD_G12_H__
33 
34 #pragma once
35 #pragma pack(1)
36 
37 #include <cstdint>
38 #include <cstddef>
39 
40 class mhw_vdbox_avp_g12_X
41 {
42 public:
43     // Internal Macros
44     #define __CODEGEN_MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
45     #define __CODEGEN_BITFIELD(l, h) (h) - (l) + 1
46     #define __CODEGEN_OP_LENGTH_BIAS 2
47     #define __CODEGEN_OP_LENGTH(x) (uint32_t)((__CODEGEN_MAX(x, __CODEGEN_OP_LENGTH_BIAS)) - __CODEGEN_OP_LENGTH_BIAS)
48 
GetOpLength(uint32_t uiLength)49     static uint32_t GetOpLength(uint32_t uiLength) { return __CODEGEN_OP_LENGTH(uiLength); }
50 
51     //!
52     //! \brief MEMORYADDRESSATTRIBUTES
53     //! \details
54     //!     This field controls the priority of arbitration used in the GAC/GAM
55     //!     pipeline for this surface. It defines the attributes for VDBOX addresses
56     //!     on BDW+.
57     //!
58     struct MEMORYADDRESSATTRIBUTES_CMD
59     {
60         union
61         {
62             struct
63             {
64                 uint32_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0,  0)    ; //!< Reserved
65                 uint32_t                 BaseAddressIndexToMemoryObjectControlStateMocsTables : __CODEGEN_BITFIELD( 1,  6)    ; //!< Base Address - Index to Memory Object Control State (MOCS) Tables
66                 uint32_t                 BaseAddressArbitrationPriorityControl            : __CODEGEN_BITFIELD( 7,  8)    ; //!< Base Address - Arbitration Priority Control
67                 uint32_t                 BaseAddressMemoryCompressionEnable               : __CODEGEN_BITFIELD( 9,  9)    ; //!< Base Address - Memory Compression Enable
68                 uint32_t                 CompressionType                                  : __CODEGEN_BITFIELD(10, 10)    ; //!< COMPRESSION_TYPE
69                 uint32_t                 Reserved11                                       : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved
70                 uint32_t                 BaseAddressRowStoreScratchBufferCacheSelect      : __CODEGEN_BITFIELD(12, 12)    ; //!< BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
71                 uint32_t                 BaseAddressTiledResourceMode                     : __CODEGEN_BITFIELD(13, 14)    ; //!< BASE_ADDRESS_TILED_RESOURCE_MODE
72                 uint32_t                 Reserved15                                       : __CODEGEN_BITFIELD(15, 31)    ; //!< Reserved
73             };
74             uint32_t                     Value;
75         } DW0;
76 
77         //! \name Local enumerations
78 
79         //! \brief COMPRESSION_TYPE
80         //! \details
81         //!     Indicates if buffer is render/media compressed.
82         enum COMPRESSION_TYPE
83         {
84             COMPRESSION_TYPE_MEDIACOMPRESSIONENABLE                          = 0, //!< No additional details
85             COMPRESSION_TYPE_RENDERCOMPRESSIONENABLE                         = 1, //!< No additional details
86         };
87 
88         //! \brief BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
89         //! \details
90         //!     This field controls if the Row Store is going to store inside Media
91         //!     Cache (rowstore cache) or to LLC.
92         enum BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
93         {
94             BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED0      = 0, //!< Buffer going to LLC.
95             BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED1      = 1, //!< Buffer going to Internal Media Storage.
96         };
97 
98         //! \brief BASE_ADDRESS_TILED_RESOURCE_MODE
99         //! \details
100         //!     For Media Surfaces: This field specifies the tiled resource mode.
101         enum BASE_ADDRESS_TILED_RESOURCE_MODE
102         {
103             BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODENONE                      = 0, //!< TileY resources
104             BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODETILEYF                    = 1, //!< 4KB tiled resources
105             BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODETILEYS                    = 2, //!< 64KB tiled resources
106         };
107 
108         //! \name Initializations
109 
110         //! \brief Explicit member initialization function
111         MEMORYADDRESSATTRIBUTES_CMD();
112 
113         static const size_t dwSize = 1;
114         static const size_t byteSize = 4;
115     };
116 
117     //!
118     //! \brief SPLITBASEADDRESS4KBYTEALIGNED
119     //! \details
120     //!     Specifies a 64-bit (48-bit canonical) 4K-byte aligned memory base
121     //!     address. GraphicsAddress is a 64-bit value [63:0], but only a portion of
122     //!     it is used by hardware. The upper reserved bits are ignored and MBZ.
123     //!
124     struct SPLITBASEADDRESS4KBYTEALIGNED_CMD
125     {
126         union
127         {
128             struct
129             {
130                 uint64_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0, 11)    ; //!< Reserved
131                 uint64_t                 BaseAddress                                      : __CODEGEN_BITFIELD(12, 63)    ; //!< Base Address
132             };
133             uint32_t                     Value[2];
134         } DW0_1;
135 
136         //! \name Local enumerations
137 
138         //! \name Initializations
139 
140         //! \brief Explicit member initialization function
141         SPLITBASEADDRESS4KBYTEALIGNED_CMD();
142 
143         static const size_t dwSize = 2;
144         static const size_t byteSize = 8;
145     };
146 
147     //!
148     //! \brief SPLITBASEADDRESS64BYTEALIGNED
149     //! \details
150     //!     Specifies a 64-bit (48-bit canonical) 64-byte aligned memory base
151     //!     address.
152     //!
153     struct SPLITBASEADDRESS64BYTEALIGNED_CMD
154     {
155         union
156         {
157             struct
158             {
159                 uint64_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0,  5)    ; //!< Reserved
160                 uint64_t                 BaseAddress                                      : __CODEGEN_BITFIELD( 6, 63)    ; //!< Base Address
161             };
162             uint32_t                     Value[2];
163         } DW0_1;
164 
165         //! \name Local enumerations
166 
167         //! \name Initializations
168 
169         //! \brief Explicit member initialization function
170         SPLITBASEADDRESS64BYTEALIGNED_CMD();
171 
172         static const size_t dwSize = 2;
173         static const size_t byteSize = 8;
174     };
175 
176     //!
177     //! \brief AVP_BSD_OBJECT
178     //! \details
179     //!      The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
180     //!     all AVP Commands. Each AVP command has assigned a media instruction
181     //!     command as defined in DWord 0, BitField 22:16.
182     //!
183     //!     style="margin:0in 0in 7.5pt">The AVP_BSD_OBJECT command sends to HW a
184     //!     tile at a time from an AV1 bitstream, starting with the first coded byte
185     //!     of the tile, not including the prefixed tile byte size. The bit stream
186     //!     of a tile, tile group, and of a frame may end with trailing bits and
187     //!     extra padding zero bytes. The prefixed tile byte size includes all the
188     //!     trailing bits and padding zero bytes at the end of a tile.
189     //!     style="margin:0in 0in 7.5pt">Each tile's coded/compressed bitstream is
190     //!     started and ended at a byte boundary.
191     //!     style="margin:0in 0in 7.5pt">HW is not required to parse the trailing
192     //!     bits and padding zero bytes. HW can stop processing right after it has
193     //!     completed the decoding of the last block in the tile. Potentially, error
194     //!     checkng can be implemented to detect the trailing bits and padding
195     //!     zeros, but is not implemented in this generation of AVP Pipeline.
196     //!     style="margin:0in 0in 7.5pt">here can be multiple tiles in an AV1 frame
197     //!     and thus this command can be issued multiple times per frame. A coded
198     //!     frame minumum has at least 1 tile definition, i.e a tile can cover the
199     //!     entire frame, unless the frame size exceeds the max allowed tile size
200     //!     limits in pixels, then the frame must contain more than 1 tile.There is
201     //!     no compressed header in AV1, hence AVP_BSD_OBJECT command is only used
202     //!     to process the bitstream of each individual tile of a frame.
203     //!     style="margin:0in 0in 7.5pt; text-align:start;
204     //!     -webkit-text-stroke-width:0px">The AVP_BSD_OBJECT command must be the
205     //!     last command issued in the sequence of batch commands before the AVP
206     //!     Pipeline starts decoding. Prior to issuing this command, it is assumed
207     //!     that all configuration parameters needed by the AVP Pipeline have been
208     //!     loaded in a specific order,including workload configuration registers
209     //!     and configuration tables. When this command is issued, the AVP Pipeline
210     //!     is waiting for bitstream data to be presented to its bitstream input
211     //!     shift register.
212     //!
213     struct AVP_BSD_OBJECT_CMD
214     {
215         union
216         {
217             struct
218             {
219                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
220                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
221                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
222                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
223                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
224                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
225             };
226             uint32_t                     Value;
227         } DW0;
228         union
229         {
230             struct
231             {
232                 uint32_t                 TileIndirectBsdDataLength                                                        ; //!< Tile Indirect BSD Data Length
233             };
234             uint32_t                     Value;
235         } DW1;
236         union
237         {
238             struct
239             {
240                 uint32_t                 TileIndirectDataStartAddress                                                     ; //!< Tile Indirect Data Start Address
241             };
242             uint32_t                     Value;
243         } DW2;
244 
245         //! \name Local enumerations
246 
247         enum MEDIA_INSTRUCTION_COMMAND
248         {
249             MEDIA_INSTRUCTION_COMMAND_AVPBSDOBJECTSTATE                      = 32, //!< No additional details
250         };
251 
252         //! \brief MEDIA_INSTRUCTION_OPCODE
253         //! \details
254         //!     Codec/Engine Name = AV1 = 3h
255         enum MEDIA_INSTRUCTION_OPCODE
256         {
257             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
258         };
259 
260         enum PIPELINE_TYPE
261         {
262             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
263         };
264 
265         enum COMMAND_TYPE
266         {
267             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
268         };
269 
270         //! \name Initializations
271 
272         //! \brief Explicit member initialization function
273         AVP_BSD_OBJECT_CMD();
274 
275         static const size_t dwSize = 3;
276         static const size_t byteSize = 12;
277 
278     };
279 
280     //!
281     //! \brief AVP_PIC_STATE
282     //! \details
283     //!     All AVP_PIC_STATE should stay the same for the whole frame even if
284     //!     AVP_PIC_STATE is re-programmed for every tiles.
285     //!     The bitfields of AVP_PIC_STATE are defined either from
286     //!     1) syntax elements of the uncompressed sequence header (received from
287     //!     sequence_header_obu) and of the uncompressed frame header (received from
288     //!     frame_header_obu),
289     //!     2) or, parameters derived from 1).
290     //!     Note : Bitstreams may contain several copies of the frame header (there
291     //!     can only be one frame_header_obu, but multiple
292     //!     redundant_frame_header_obu)interspersed with tile_group_obu to allow for
293     //!     greater error resilience. However, the copies must contain identical
294     //!     contents to the original frame_header_obu.
295     //!     Note : there should be only one sequence_header_obu per video sequence.
296     //!     Note : AVP pipeline is invoked to decode a frame from the bitstream,
297     //!     only if that frame has show_existing_frame flag (syntax element in the
298     //!     frame header) set to 0. For the case that show_existing_frame flag is set
299     //!     to 1, application and driver process the frame instead, no block level
300     //!     decoding is needed.
301     //!     Note : Unlike VP9, AV1 does not have a compressed header. All the syntax
302     //!     elements defined in the AV1 sequence and frame level headers are not
303     //!     arithmetic coded, hence application and driver can directly read them
304     //!     off from the bitstream. If encryption is ON, then only application can
305     //!     parse the sequence and frame headers.
306     //!     Note : the values of the sequence header/level syntax elements and their
307     //!     derived parameters are to last throughout all frames in the video
308     //!     sequence, until the next Sequence Header OBU is received that may change
309     //!     them. But some sequence header/level syntax elements or their derived
310     //!     parameters may further qualified by frame header/level syntax elements
311     //!     and their derived parameters, then these type of syntax elements and
312     //!     their derived parameters can be changed frame to frame.
313     //!     Note : the values of the frame header/level syntax elements and their
314     //!     derived parameters can be changed from frame to frame.
315     //!     Note : there are some syntax elements and their derived parameters can
316     //!     be changed only at KEY FRAME. Hence, the values of these type of syntax
317     //!     elements and their derived parameters can last for the entire GOP, i.e.
318     //!     until the next KEY FRAME that may change them.
319     //!     Note : there is no separate profile for Still Picture. Still Picture is
320     //!     coded and decoded as a KEY FRAME, with all coding tools supported
321     //!     (tiling, all post in-loop filters, film grain injection, monochrome,
322     //!     intraBC, palette prediction mode, etc.). There is no restriction in
323     //!     coding Still Picture as a KEY FRAME.
324     //!
325     struct AVP_PIC_STATE_CMD
326     {
327         union
328         {
329             struct
330             {
331                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
332                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
333                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
334                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
335                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
336                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
337             };
338             uint32_t                     Value;
339         } DW0;
340         union
341         {
342             struct
343             {
344                 uint32_t                 FrameWidthInPixelMinus1                          : __CODEGEN_BITFIELD( 0, 15)    ; //!< Frame Width In Pixel Minus 1
345                 uint32_t                 FrameHeightInPixelMinus1                         : __CODEGEN_BITFIELD(16, 31)    ; //!< Frame Height In Pixel Minus 1
346             };
347             uint32_t                     Value;
348         } DW1;
349         union
350         {
351             struct
352             {
353                 uint32_t                 SequenceChromaSubsamplingFormat                  : __CODEGEN_BITFIELD( 0,  1)    ; //!< SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
354                 uint32_t                 Reserved66                                       : __CODEGEN_BITFIELD( 2,  2)    ; //!< Reserved (for expansion of Chroma SubSampling Format)
355                 uint32_t                 SequencePixelBitDepthIdc                         : __CODEGEN_BITFIELD( 3,  4)    ; //!< Sequence Pixel Bit-Depth Idc
356                 uint32_t                 Reserved69                                       : __CODEGEN_BITFIELD( 5,  5)    ; //!< Reserved (for expansion of Sequence Pixel Bit-Depth Idc)
357                 uint32_t                 SequenceFullColorRangeFlag                       : __CODEGEN_BITFIELD( 6,  6)    ; //!< Sequence Full Color Range Flag
358                 uint32_t                 SequenceSuperblockSizeUsed                       : __CODEGEN_BITFIELD( 7,  8)    ; //!< Sequence Superblock Size Used
359                 uint32_t                 SequenceEnableOrderHintFlag                      : __CODEGEN_BITFIELD( 9,  9)    ; //!< Sequence Enable Order Hint Flag
360                 uint32_t                 SequenceOrderHintBitsMinus1                      : __CODEGEN_BITFIELD(10, 12)    ; //!< Sequence Order Hint Bits Minus1
361                 uint32_t                 Reserved77                                       : __CODEGEN_BITFIELD(13, 15)    ; //!< Reserved (for the expansion of Sequence Order Hint Bits Minus1)
362                 uint32_t                 SequenceEnableFilterIntraFlag                    : __CODEGEN_BITFIELD(16, 16)    ; //!< Sequence Enable Filter_Intra Flag
363                 uint32_t                 SequenceEnableIntraEdgeFilterFlag                : __CODEGEN_BITFIELD(17, 17)    ; //!< Sequence Enable Intra Edge Filter Flag
364                 uint32_t                 SequenceEnableDualFilterFlag                     : __CODEGEN_BITFIELD(18, 18)    ; //!< Sequence Enable Dual_Filter Flag
365                 uint32_t                 SequenceEnableInterIntraCompoundFlag             : __CODEGEN_BITFIELD(19, 19)    ; //!< Sequence Enable Inter-Intra Compound Flag
366                 uint32_t                 SequenceEnableMaskedCompoundFlag                 : __CODEGEN_BITFIELD(20, 20)    ; //!< Sequence Enable Masked Compound Flag
367                 uint32_t                 SequenceEnableJointCompoundFlag                  : __CODEGEN_BITFIELD(21, 21)    ; //!< Sequence Enable Joint Compound Flag
368                 uint32_t                 Reserved86                                       : __CODEGEN_BITFIELD(22, 31)    ; //!< Reserved
369             };
370             uint32_t                     Value;
371         } DW2;
372         union
373         {
374             struct
375             {
376                 uint32_t                 AllowScreenContentToolsFlag                      : __CODEGEN_BITFIELD( 0,  0)    ; //!< Allow Screen Content Tools Flag
377                 uint32_t                 ForceIntegerMvFlag                               : __CODEGEN_BITFIELD( 1,  1)    ; //!< Force Integer MV Flag
378                 uint32_t                 AllowWarpedMotionFlag                            : __CODEGEN_BITFIELD( 2,  2)    ; //!< Allow Warped Motion Flag
379                 uint32_t                 Reserved99                                       : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved
380                 uint32_t                 UseCdefFilterFlag                                : __CODEGEN_BITFIELD( 4,  4)    ; //!< Use CDEF Filter Flag
381                 uint32_t                 UseSuperResFlag                                  : __CODEGEN_BITFIELD( 5,  5)    ; //!< Use Super-Res Flag
382                 uint32_t                 FrameLevelLoopRestorationFilterEnableFlag        : __CODEGEN_BITFIELD( 6,  6)    ; //!< Frame Level Loop Restoration Filter Enable Flag
383                 uint32_t                 Reserved103                                      : __CODEGEN_BITFIELD( 7, 7)     ; //!< Reserved
384                 uint32_t                 LargeScaleTileEnableFlag                         : __CODEGEN_BITFIELD( 8,  8)    ; //!< Large Scale Tile Enable Flag
385                 uint32_t                 Reserved104                                      : __CODEGEN_BITFIELD( 9, 15)    ; //!< Reserved
386                 uint32_t                 FrameType                                        : __CODEGEN_BITFIELD(16, 17)    ; //!< Frame Type
387                 uint32_t                 Reserved114                                      : __CODEGEN_BITFIELD(18, 18)    ; //!< Reserved (for the expansion of Frame Type)
388                 uint32_t                 IntraonlyFlag                                    : __CODEGEN_BITFIELD(19, 19)    ; //!< IntraOnly Flag
389                 uint32_t                 ShowFrameFlag                                    : __CODEGEN_BITFIELD(20, 20)    ; //!< Show Frame Flag
390                 uint32_t                 ShowableFrameFlag                                : __CODEGEN_BITFIELD(21, 21)    ; //!< Showable Frame Flag
391                 uint32_t                 ErrorResilientModeFlag                           : __CODEGEN_BITFIELD(22, 22)    ; //!< ERROR_RESILIENT_MODE_FLAG
392                 uint32_t                 AllowIntrabcFlag                                 : __CODEGEN_BITFIELD(23, 23)    ; //!< Allow IntraBC Flag
393                 uint32_t                 Reserved120                                      : __CODEGEN_BITFIELD(24, 27)    ; //!< Reserved
394                 uint32_t                 PrimaryReferenceFrameIdx                         : __CODEGEN_BITFIELD(28, 30)    ; //!< Primary Reference Frame Idx
395                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved (for future expansion of Primary Reference Frame Idx)
396             };
397             uint32_t                     Value;
398         } DW3;
399         union
400         {
401             struct
402             {
403                 uint32_t                 SegmentationEnableFlag                           : __CODEGEN_BITFIELD( 0,  0)    ; //!< SEGMENTATION_ENABLE_FLAG
404                 uint32_t                 SegmentationUpdateMapFlag                        : __CODEGEN_BITFIELD( 1,  1)    ; //!< Segmentation Update Map Flag
405                 uint32_t                 SegmentationTemporalUpdateFlag                   : __CODEGEN_BITFIELD( 2,  2)    ; //!< SEGMENTATION_TEMPORAL_UPDATE_FLAG
406                 uint32_t                 PreSkipSegmentIdFlag                             : __CODEGEN_BITFIELD( 3,  3)    ; //!< Pre-Skip Segment ID Flag
407                 uint32_t                 LastActiveSegmentId                              : __CODEGEN_BITFIELD( 4,  6)    ; //!< Last Active Segment ID
408                 uint32_t                 DeltaQPresentFlag                                : __CODEGEN_BITFIELD( 7,  7)    ; //!< Delta Q Present Flag
409                 uint32_t                 DeltaQRes                                        : __CODEGEN_BITFIELD( 8,  9)    ; //!< Delta Q RES
410                 uint32_t                 FrameCodedLosslessMode                           : __CODEGEN_BITFIELD(10, 10)    ; //!< FRAME_CODED_LOSSLESS_MODE
411                 uint32_t                 SegmentMapIsZeroFlag                             : __CODEGEN_BITFIELD(11, 11)    ; //!< Segment Map Is Zero Flag
412                 uint32_t                 SegmentIdBufferStreamInEnableFlag                : __CODEGEN_BITFIELD(12, 12)    ; //!< Reserved
413                 uint32_t                 SegmentIdBufferStreamOutEnableFlag               : __CODEGEN_BITFIELD(13, 13)    ; //!< Reserved
414                 uint32_t                 Reserved140                                      : __CODEGEN_BITFIELD(14, 15)    ; //!< Reserved
415                 uint32_t                 BaseQindex                                       : __CODEGEN_BITFIELD(16, 23)    ; //!< Base Qindex
416                 uint32_t                 YDcDeltaQ                                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Y_dc_delta_q
417                 uint32_t                 Reserved159                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
418             };
419             uint32_t                     Value;
420         } DW4;
421         union
422         {
423             struct
424             {
425                 uint32_t                 UDcDeltaQ                                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< U_dc_delta_q
426                 uint32_t                 Reserved167                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
427                 uint32_t                 UAcDeltaQ                                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< U_ac_delta_q
428                 uint32_t                 Reserved175                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
429                 uint32_t                 VDcDeltaQ                                        : __CODEGEN_BITFIELD(16, 22)    ; //!< V_dc_delta_q
430                 uint32_t                 Reserved183                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
431                 uint32_t                 VAcDeltaQ                                        : __CODEGEN_BITFIELD(24, 30)    ; //!< V_ac_delta_q
432                 uint32_t                 Reserved191                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
433             };
434             uint32_t                     Value;
435         } DW5;
436         union
437         {
438             struct
439             {
440                 uint32_t                 AllowHighPrecisionMv                             : __CODEGEN_BITFIELD( 0,  0)    ; //!< Allow High Precision MV
441                 uint32_t                 FrameLevelReferenceModeSelect                    : __CODEGEN_BITFIELD( 1,  1)    ; //!< Frame Level Reference Mode Select
442                 uint32_t                 McompFilterType                                  : __CODEGEN_BITFIELD( 2,  4)    ; //!< MCOMP_FILTER_TYPE
443                 uint32_t                 Reserved197                                      : __CODEGEN_BITFIELD( 5,  5)    ; //!< Reserved (for future expansion of Mcomp Filter Type)
444                 uint32_t                 MotionModeSwitchableFlag                         : __CODEGEN_BITFIELD( 6,  6)    ; //!< Motion Mode Switchable Flag
445                 uint32_t                 UseReferenceFrameMvSetFlag                       : __CODEGEN_BITFIELD( 7,  7)    ; //!< Use Reference Frame MV Set Flag
446                 uint32_t                 ReferenceFrameSignBiasI0To7                      : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Sign Bias [i=0 to 7]
447                 uint32_t                 CurrentFrameOrderHint                            : __CODEGEN_BITFIELD(16, 23)    ; //!< Current Frame Order Hint
448                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved (for future expansion of Frame Order Hint)
449             };
450             uint32_t                     Value;
451         } DW6;
452         union
453         {
454             struct
455             {
456                 uint32_t                 ReducedTxSetUsed                                 : __CODEGEN_BITFIELD( 0,  0)    ; //!< Reduced Tx Set Used
457                 uint32_t                 FrameTransformMode                               : __CODEGEN_BITFIELD( 1,  2)    ; //!< Frame Transform Mode
458                 uint32_t                 Reserved227                                      : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved
459                 uint32_t                 SkipModePresentFlag                              : __CODEGEN_BITFIELD( 4,  4)    ; //!< Skip Mode Present Flag
460                 uint32_t                 SkipModeFrame0                                   : __CODEGEN_BITFIELD( 5,  7)    ; //!< Skip Mode Frame [0]
461                 uint32_t                 Reserved232                                      : __CODEGEN_BITFIELD( 8,  8)    ; //!< Reserved (for future expansion of Skip Mode Frame[0])
462                 uint32_t                 SkipModeFrame1                                   : __CODEGEN_BITFIELD( 9, 11)    ; //!< Skip Mode Frame [1]
463                 uint32_t                 Reserved236                                      : __CODEGEN_BITFIELD(12, 23)    ; //!< Reserved (for future expansion of Skip Mode Frame[1])
464                 uint32_t                 RefFrameSide                                     : __CODEGEN_BITFIELD(24, 31)    ; //!< ref_frame_side for the 8 reference frames INTRA...ALTREF
465             };
466             uint32_t                     Value;
467         } DW7;
468         union
469         {
470             struct
471             {
472                 uint32_t                 Reserved256                                      : __CODEGEN_BITFIELD( 0,  2)    ; //!< Reserved (for future expansion of Global Motion Type[0])
473                 uint32_t                 GlobalMotionType1                                : __CODEGEN_BITFIELD( 3,  4)    ; //!< Global Motion Type[1]
474                 uint32_t                 Reserved261                                      : __CODEGEN_BITFIELD( 5,  5)    ; //!< Reserved (for future expansion of Global Motion Type[1]
475                 uint32_t                 GlobalMotionType2                                : __CODEGEN_BITFIELD( 6,  7)    ; //!< Global Motion Type[2]
476                 uint32_t                 Reserved264                                      : __CODEGEN_BITFIELD( 8,  8)    ; //!< Reserved (for future expansion of Global Motion Type[2]
477                 uint32_t                 GlobalMotionType3                                : __CODEGEN_BITFIELD( 9, 10)    ; //!< Global Motion Type[3]
478                 uint32_t                 Reserved267                                      : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved (for future expansion of Global Motion Type[3]
479                 uint32_t                 GlobalMotionType4                                : __CODEGEN_BITFIELD(12, 13)    ; //!< Global Motion Type[4]
480                 uint32_t                 Reserved270                                      : __CODEGEN_BITFIELD(14, 14)    ; //!< Reserved (for future expansion of Global Motion Type[4]
481                 uint32_t                 GlobalMotionType5                                : __CODEGEN_BITFIELD(15, 16)    ; //!< Global Motion Type[5]
482                 uint32_t                 Reserved273                                      : __CODEGEN_BITFIELD(17, 17)    ; //!< Reserved (for future expansion of Global Motion Type[5]
483                 uint32_t                 GlobalMotionType6                                : __CODEGEN_BITFIELD(18, 19)    ; //!< Global Motion Type[6]
484                 uint32_t                 Reserved276                                      : __CODEGEN_BITFIELD(20, 20)    ; //!< Reserved (for future expansion of Global Motion Type[6]
485                 uint32_t                 GlobalMotionType7                                : __CODEGEN_BITFIELD(21, 22)    ; //!< Global Motion Type[7]
486                 uint32_t                 Reserved279                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved (for future expansion of Global Motion Type[7]
487                 uint32_t                 FrameLevelGlobalMotionInvalidFlags               : __CODEGEN_BITFIELD(24, 31)    ; //!< Frame Level Global Motion Invalid Flags
488             };
489             uint32_t                     Value;
490         } DW8;
491         uint32_t                                 WarpParametersArrayReference1To7Projectioncoeff0To5[21];                 //!< Warp Parameters Array [Reference=1 to 7][ProjectionCoeff=0 to 5]
492         union
493         {
494             struct
495             {
496                 uint32_t                 ReferenceFrameIdx0                               : __CODEGEN_BITFIELD( 0,  2)    ; //!< Reference Frame Idx[0]
497                 uint32_t                 Reserved963                                      : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved (for future expansion of reference frame idx0)
498                 uint32_t                 ReferenceFrameIdx1                               : __CODEGEN_BITFIELD( 4,  6)    ; //!< Reference Frame Idx[1]
499                 uint32_t                 Reserved967                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved (for future expansion of reference frame idx1)
500                 uint32_t                 ReferenceFrameIdx2                               : __CODEGEN_BITFIELD( 8, 10)    ; //!< Reference Frame Idx[2]
501                 uint32_t                 Reserved971                                      : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved (for future expansion of reference frame idx2)
502                 uint32_t                 ReferenceFrameIdx3                               : __CODEGEN_BITFIELD(12, 14)    ; //!< Reference Frame Idx[3]
503                 uint32_t                 Reserved975                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved (for future expansion of reference frame idx3)
504                 uint32_t                 ReferenceFrameIdx4                               : __CODEGEN_BITFIELD(16, 18)    ; //!< Reference Frame Idx[4]
505                 uint32_t                 Reserved979                                      : __CODEGEN_BITFIELD(19, 19)    ; //!< Reserved (for future expansion of reference frame idx4)
506                 uint32_t                 ReferenceFrameIdx5                               : __CODEGEN_BITFIELD(20, 22)    ; //!< Reference Frame Idx[5]
507                 uint32_t                 Reserved983                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved (for future expansion of reference frame idx5)
508                 uint32_t                 ReferenceFrameIdx6                               : __CODEGEN_BITFIELD(24, 26)    ; //!< Reference Frame Idx[6]
509                 uint32_t                 Reserved987                                      : __CODEGEN_BITFIELD(27, 27)    ; //!< Reserved (for future expansion of reference frame idx6)
510                 uint32_t                 ReferenceFrameIdx7                               : __CODEGEN_BITFIELD(28, 30)    ; //!< Reference Frame Idx[7]
511                 uint32_t                 Reserved991                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved (for future expansion of reference frame idx7)
512             };
513             uint32_t                     Value;
514         } DW30;
515         union
516         {
517             struct
518             {
519                 uint32_t                 IntraFrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Intra Frame Width In Pixel Minus 1
520                 uint32_t                 IntraFrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Intra Frame Height In Pixel Minus 1
521             };
522             uint32_t                     Value;
523         } DW31;
524         union
525         {
526             struct
527             {
528                 uint32_t                 LastFrameWidthInPixelMinus1                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last Frame Width In Pixel Minus 1
529                 uint32_t                 LastFrameHeightInPixelMinus1                     : __CODEGEN_BITFIELD(16, 31)    ; //!< Last Frame Height In Pixel Minus 1
530             };
531             uint32_t                     Value;
532         } DW32;
533         union
534         {
535             struct
536             {
537                 uint32_t                 Last2FrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last2 Frame Width In Pixel Minus 1
538                 uint32_t                 Last2FrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Last2 Frame Height In Pixel Minus 1
539             };
540             uint32_t                     Value;
541         } DW33;
542         union
543         {
544             struct
545             {
546                 uint32_t                 Last3FrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last3 Frame Width In Pixel Minus 1
547                 uint32_t                 Last3FrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Last3 Frame Height In Pixel Minus 1
548             };
549             uint32_t                     Value;
550         } DW34;
551         union
552         {
553             struct
554             {
555                 uint32_t                 GoldenFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< Golden Frame Width In Pixel Minus 1
556                 uint32_t                 GoldenFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Golden Frame Height In Pixel Minus 1
557             };
558             uint32_t                     Value;
559         } DW35;
560         union
561         {
562             struct
563             {
564                 uint32_t                 BwdrefFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< BWDREF Frame Width In Pixel Minus 1
565                 uint32_t                 BwdrefFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< BWDREF Frame Height In Pixel Minus 1
566             };
567             uint32_t                     Value;
568         } DW36;
569         union
570         {
571             struct
572             {
573                 uint32_t                 Altref2FrameWidthInPixelMinus1                   : __CODEGEN_BITFIELD( 0, 15)    ; //!< ALTREF2 Frame Width In Pixel Minus 1
574                 uint32_t                 Altref2FrameHeightInPixelMinus1                  : __CODEGEN_BITFIELD(16, 31)    ; //!< ALTREF2 Frame Height In Pixel Minus 1
575             };
576             uint32_t                     Value;
577         } DW37;
578         union
579         {
580             struct
581             {
582                 uint32_t                 AltrefFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< ALTREF Frame Width In Pixel Minus 1
583                 uint32_t                 AltrefFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< ALTREF Frame Height In Pixel Minus 1
584             };
585             uint32_t                     Value;
586         } DW38;
587         union
588         {
589             struct
590             {
591                 uint32_t                 VerticalScaleFactorForIntra                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for INTRA
592                 uint32_t                 HorizontalScaleFactorForIntra                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for INTRA
593             };
594             uint32_t                     Value;
595         } DW39;
596         union
597         {
598             struct
599             {
600                 uint32_t                 VerticalScaleFactorForLast                       : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST
601                 uint32_t                 HorizontalScaleFactorForLast                     : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST
602             };
603             uint32_t                     Value;
604         } DW40;
605         union
606         {
607             struct
608             {
609                 uint32_t                 VerticalScaleFactorForLast2                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST2
610                 uint32_t                 HorizontalScaleFactorForLast2                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST2
611             };
612             uint32_t                     Value;
613         } DW41;
614         union
615         {
616             struct
617             {
618                 uint32_t                 VerticalScaleFactorForLast3                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST3
619                 uint32_t                 HorizontalScaleFactorForLast3                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST3
620             };
621             uint32_t                     Value;
622         } DW42;
623         union
624         {
625             struct
626             {
627                 uint32_t                 VerticalScaleFactorForGolden                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for GOLDEN
628                 uint32_t                 HorizontalScaleFactorForGolden                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for GOLDEN
629             };
630             uint32_t                     Value;
631         } DW43;
632         union
633         {
634             struct
635             {
636                 uint32_t                 VerticalScaleFactorForBwdrefFrame                : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for BWDREF_FRAME
637                 uint32_t                 HorizontalScaleFactorForBwdrefFrame              : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for BWDREF_FRAME
638             };
639             uint32_t                     Value;
640         } DW44;
641         union
642         {
643             struct
644             {
645                 uint32_t                 VerticalScaleFactorForAltref2                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for ALTREF2
646                 uint32_t                 HorizontalScaleFactorForAltref2                  : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for ALTREF2
647             };
648             uint32_t                     Value;
649         } DW45;
650         union
651         {
652             struct
653             {
654                 uint32_t                 VerticalScaleFactorForAltref                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for ALTREF
655                 uint32_t                 HorizontalScaleFactorForAltref                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for ALTREF
656             };
657             uint32_t                     Value;
658         } DW46;
659         union
660         {
661             struct
662             {
663                 uint32_t                 ReferenceFrameOrderHint0ForIntraFrame            : __CODEGEN_BITFIELD( 0,  7)    ; //!< Reference Frame Order Hint [0] for Intra Frame
664                 uint32_t                 ReferenceFrameOrderHint1ForLastFrame             : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Order Hint [1] for Last Frame
665                 uint32_t                 ReferenceFrameOrderHint2ForLast2Frame            : __CODEGEN_BITFIELD(16, 23)    ; //!< Reference Frame Order Hint [2] for Last2 Frame
666                 uint32_t                 ReferenceFrameOrderHint3ForLast3Frame            : __CODEGEN_BITFIELD(24, 31)    ; //!< Reference Frame Order Hint [3] for Last3 Frame
667             };
668             uint32_t                     Value;
669         } DW47;
670         union
671         {
672             struct
673             {
674                 uint32_t                 ReferenceFrameOrderHint4ForGoldenFrame           : __CODEGEN_BITFIELD( 0,  7)    ; //!< Reference Frame Order Hint [4] for Golden Frame
675                 uint32_t                 ReferenceFrameOrderHint5ForBwdrefFrame           : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Order Hint [5] for BWDREF Frame
676                 uint32_t                 ReferenceFrameOrderHint6ForAltref2Frame          : __CODEGEN_BITFIELD(16, 23)    ; //!< Reference Frame Order Hint [6] for ALTREF2 Frame
677                 uint32_t                 ReferenceFrameOrderHint7ForAltrefFrame           : __CODEGEN_BITFIELD(24, 31)    ; //!< Reference Frame Order Hint [7] for ALTREF Frame
678             };
679             uint32_t                     Value;
680         } DW48;
681         union
682         {
683             struct
684             {
685                 uint32_t                 Reserved1568                                                                     ; //!< Reserved
686             };
687             uint32_t                     Value;
688         } DW49;
689         union
690         {
691             struct
692             {
693                 uint32_t                 Reserved1600                                                                     ; //!< Reserved
694             };
695             uint32_t                     Value;
696         } DW50;
697 
698         //! \name Local enumerations
699 
700         enum MEDIA_INSTRUCTION_COMMAND
701         {
702             MEDIA_INSTRUCTION_COMMAND_AVPPICSTATE                            = 48, //!< No additional details
703         };
704 
705         //! \brief MEDIA_INSTRUCTION_OPCODE
706         //! \details
707         //!     Codec/Engine Name = AVP = 3h
708         enum MEDIA_INSTRUCTION_OPCODE
709         {
710             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
711         };
712 
713         enum PIPELINE_TYPE
714         {
715             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
716         };
717 
718         enum COMMAND_TYPE
719         {
720             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
721         };
722 
723         //! \brief SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
724         //! \details
725         //!     It specifies the chroma subsampling format for all frames in the
726         //!     video sequencebeing decoded.
727         //!     [1:0] = 00 ; stands for Monochrome 4:0:0, no Chroma planes at all,
728         //!     but [subsampling_x and subsampling_y] is defaulted to [1, 1], as only
729         //!     Profile 0 can support monochrome video coding.
730         //!     [1:0] = 01 ; stands for 4:2:0, with[subsampling_x and subsampling_y]
731         //!     defining as[1, 1]. It is supported in all profiles (seq_profile=0, 1, 2
732         //!     - syntax element in the sequence header)
733         //!     [1:0] = 10 ; stands for 4:2:2, with[subsampling_x and subsampling_y]
734         //!     defining as[1, 0]. It is supported only in seq_profile=2.
735         //!     [1:0] = 11 ; stands for 4:4:4 with[subsampling_x and subsampling_y]
736         //!     defining as[0, 0]. It is supported in both seq_profile=1 and 2.
737         //!     It is a sequence-level parameter derived from the sequence header
738         //!     syntax elements: seq_profile, subsampling_x, subsampling_y, monochome,
739         //!     high_bitdepth and twelve_bit. Default is 1, i.e. 4:2:0..
740         //!     Note : AV1 supports 3 profiles:
741         //!     seq_profile Bit_depth Chroma Subsampling
742         //!     0 (Main Profile) 8 / 10 YUV 4:2:0 and 4:0:0
743         //!     1 (High Profile) 8 / 10 YUV 4:4:4 (4:0:0 is not allowed)
744         //!     2 (Pro Profile) 8 / 10 /12 YUV 4:2:2 AND
745         //!     12 YUV 4:2:0/4:4:4/4:0:0
746         //!     Note : for AV1 decoder:
747         //!     type="disc" style="margin-top:0in; margin-bottom:0in">
748         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
749         //!     font-family:Calibri, sans-serif">A profile 0 compliant decoder must be
750         //!     able to decode all bitstreams labeled profile 0
751 
752         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
753         //!     font-family:Calibri, sans-serif">A profile 1 compliant decoder must be
754         //!     able to decode all bitstreams labeled profile 0 or 1
755 
756         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
757         //!     font-family:Calibri, sans-serif">A profile 2 compliant decoder must be
758         //!     able to decode all bitstreams labeled profile 0, 1, or 2
759 
760         //!
761         enum SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
762         {
763             SEQUENCE_CHROMA_SUBSAMPLING_FORMAT_420                           = 1, //!< Chroma Sampling 4:2:0
764         };
765 
766         //! \brief ERROR_RESILIENT_MODE_FLAG
767         //! \details
768         //!     It specifies whether all syntax decoding of the current frame is
769         //!     independent of the previous frames, or not.
770         //!     Set to 0 to disable error resilient mode
771         //!     Set to 1 to enable error resilient mode (for independent syntax
772         //!     decoding)
773         //!     It is the frame-level syntax element, error_resilient_mode. Default
774         //!     is 0.
775         //!     It is read from the bitstream for all frame types (KEY Frame,
776         //!     INTRA-ONLY Frame and INTER Frame), except when frame_type is set to
777         //!     SWITCH_FRAME, in which it is forced to 1 instead of reading from the
778         //!     bitstream.
779         //!     When error resilient mode is set to 1 (active), Refresh Frame Context
780         //!     is set to0. When error resilient is set to 0,Refresh Frame Context is
781         //!     read from the bit stream.
782         //!
783         //!     Valid only in Decoder Mode
784         //!
785         //!
786         enum ERROR_RESILIENT_MODE_FLAG
787         {
788             ERROR_RESILIENT_MODE_FLAG_DISABLE                                = 0, //!< No additional details
789             ERROR_RESILIENT_MODE_FLAG_ENABLE                                 = 1, //!< No additional details
790         };
791 
792         //! \brief SEGMENTATION_ENABLE_FLAG
793         //! \details
794         //!     Indicate if segementation is enabled or not
795         enum SEGMENTATION_ENABLE_FLAG
796         {
797             SEGMENTATION_ENABLE_FLAG_ALLBLOCKSAREIMPLIEDTOBELONGTOSEGMENT0   = 0, //!< No additional details
798             SEGMENTATION_ENABLE_FLAG_SEGIDDETERMINATIONDEPENDSONSEGMENTATIONUPDATEMAPSETTING = 1, //!< No additional details
799         };
800 
801         //! \brief SEGMENTATION_TEMPORAL_UPDATE_FLAG
802         //! \details
803         //!     Indicates whether segID is decoding from bitstream or predicted from
804         //!     previous frame.
805         enum SEGMENTATION_TEMPORAL_UPDATE_FLAG
806         {
807             SEGMENTATION_TEMPORAL_UPDATE_FLAG_DECODESEGIDFROMBITSTREAM       = 0, //!< No additional details
808             SEGMENTATION_TEMPORAL_UPDATE_FLAG_GETSEGIDEITHERFROMBITSTREAMORFROMPREVIOUSFRAME = 1, //!< No additional details
809         };
810 
811         //! \brief FRAME_CODED_LOSSLESS_MODE
812         //! \details
813         //!     This bitSet to indicate lossless coding mode at frame level.
814         //!     Frame Coded Lossless Mode is set to 1, if all active segment's
815         //!     segment lossless flag are set to 1.
816         //!     The equation for deriving coded lossless mode is presented in the
817         //!     AVP_SEGMENT_STATE Command.
818         //!     AllLossless = CodedLossless &amp;&amp; ( FrameWidth == UpscaledWidth
819         //!     ). The second condition in this equation is equivalent tohaving
820         //!     Super-res NOT enabled.
821         //!     Only CodedLossless flag is sent to HW. AllLossless flag is not.
822         //!     CodedLossless directly control the enabling/disabling of deblocker,
823         //!     CDEF in-loop filters.
824         //!     But AllLossless is used to control the enabling/disabling of Loop
825         //!     Restoration filter. Hence, when super-res is ON, Loop Restoration filter
826         //!     can still be ON/OFF, regardless of CodedLossless.
827         enum FRAME_CODED_LOSSLESS_MODE
828         {
829             FRAME_CODED_LOSSLESS_MODE_NORMALMODE                             = 0, //!< No additional details
830             FRAME_CODED_LOSSLESS_MODE_CODEDLOSSLESSMODE                      = 1, //!< No additional details
831         };
832 
833         //! \brief MCOMP_FILTER_TYPE
834         //! \details
835         //!     It specifies which Motion Compensation Filter type is to be used for
836         //!     the current frame.
837         //!     It is a frame-level derived parameters. It is derived from the frame
838         //!     level syntax elements (is_filter_switchable flag and the 2-bits
839         //!     interpolation_filter).
840         //!     Default is 0 (i.e. use the eight-tap basic filter).
841         enum MCOMP_FILTER_TYPE
842         {
843             MCOMP_FILTER_TYPE_EIGHT_TAP                                      = 0, //!< No additional details
844             MCOMP_FILTER_TYPE_EIGHT_TAP_SMOOTH                               = 1, //!< No additional details
845             MCOMP_FILTER_TYPE_EIGHT_TAP_SHARP                                = 2, //!< No additional details
846             MCOMP_FILTER_TYPE_BILINEAR                                       = 3, //!< No additional details
847             MCOMP_FILTER_TYPE_SWITCHABLE                                     = 4, //!< No additional details
848         };
849 
850         //! \name Initializations
851 
852         //! \brief Explicit member initialization function
853         AVP_PIC_STATE_CMD();
854 
855         static const size_t dwSize = 51;
856         static const size_t byteSize = 204;
857 
858     };
859 
860     //!
861     //! \brief AVP_PIPE_MODE_SELECT
862     //! \details
863     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
864     //!     all AVP Commands. Each AVP command has assigned a media instruction
865     //!     command as defined in DWord 0, BitField 22:16.
866     //!
867     //!     The workload for the AVP pipeline is tile based. Once the bit stream DMA
868     //!     is configured with the AVP_BSD_OBJECT command for a tile in a frame, and
869     //!     the tile's bitstream is presented to the AVP, the tile decoding will
870     //!     begin.
871     //!     AVP pipeline is stateless, i.e. there is no states saved between the
872     //!     decoding of each tile. Hence all sequence, frame and segment state
873     //!     commands have to be resent before the tile coding command and the BSD
874     //!     object command.
875     //!     The AVP_PIPE_MODE_SELECT command is responsible for general pipeline
876     //!     level configuration that would normally be set once for a single stream
877     //!     encode or decode and would not be modified on a frame workload basis.
878     //!     This is a frame level state command and is shared by both encoding and
879     //!     decoding processes.
880     //!
881     struct AVP_PIPE_MODE_SELECT_CMD
882     {
883         union
884         {
885             struct
886             {
887                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
888                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
889                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
890                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
891                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
892                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
893             };
894             uint32_t                     Value;
895         } DW0;
896         union
897         {
898             struct
899             {
900                 uint32_t                 CodecSelect                                      : __CODEGEN_BITFIELD( 0,  0)    ; //!< CODEC_SELECT
901                 uint32_t                 CdefOutputStreamoutEnableFlag                    : __CODEGEN_BITFIELD( 1,  1)    ; //!< CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
902                 uint32_t                 LoopRestorationOutputStreamoutEnableFlag         : __CODEGEN_BITFIELD( 2,  2)    ; //!< LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
903                 uint32_t                 PicStatusErrorReportEnable                       : __CODEGEN_BITFIELD( 3,  3)    ; //!< PIC_STATUSERROR_REPORT_ENABLE
904                 uint32_t                 Reserved36                                       : __CODEGEN_BITFIELD( 4,  4)    ; //!< Reserved
905                 uint32_t                 CodecStandardSelect                              : __CODEGEN_BITFIELD( 5,  7)    ; //!< CODEC_STANDARD_SELECT
906                 uint32_t                 Reserved40                                       : __CODEGEN_BITFIELD( 8, 12)    ; //!< Reserved
907                 uint32_t                 MultiEngineMode                                  : __CODEGEN_BITFIELD(13, 14)    ; //!< MULTI_ENGINE_MODE
908                 uint32_t                 PipeWorkingMode                                  : __CODEGEN_BITFIELD(15, 16)    ; //!< PIPE_WORKING_MODE
909                 uint32_t                 TileBasedEngine                                  : __CODEGEN_BITFIELD(17, 17)    ; //!< Tile Based Engine
910                 uint32_t                 Reserved50                                       : __CODEGEN_BITFIELD(18, 31)    ; //!< Reserved
911             };
912             uint32_t                     Value;
913         } DW1;
914         union
915         {
916             struct
917             {
918                 uint32_t                 MediaSoftResetCounterPer1000Clocks                                               ; //!< MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
919             };
920             uint32_t                     Value;
921         } DW2;
922         union
923         {
924             struct
925             {
926                 uint32_t                 PicStatusErrorReportId                                                           ; //!< PIC_STATUSERROR_REPORT_ID
927             };
928             uint32_t                     Value;
929         } DW3;
930         union
931         {
932             struct
933             {
934                 uint32_t                 Reserved128                                                                      ; //!< Reserved
935             };
936             uint32_t                     Value;
937         } DW4;
938         union
939         {
940             struct
941             {
942                 uint32_t                 PhaseIndicator                                   : __CODEGEN_BITFIELD( 0,  1)    ; //!< PHASE_INDICATOR
943                 uint32_t                 Reserved162                                      : __CODEGEN_BITFIELD( 2, 31)    ; //!< Reserved
944             };
945             uint32_t                     Value;
946         } DW5;
947 
948         //! \name Local enumerations
949 
950         enum MEDIA_INSTRUCTION_COMMAND
951         {
952             MEDIA_INSTRUCTION_COMMAND_AVPPIPEMODESELECT                      = 0, //!< No additional details
953         };
954 
955         //! \brief MEDIA_INSTRUCTION_OPCODE
956         //! \details
957         //!     Codec/Engine Name = AVP = 3h
958         enum MEDIA_INSTRUCTION_OPCODE
959         {
960             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
961         };
962 
963         enum PIPELINE_TYPE
964         {
965             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
966         };
967 
968         enum COMMAND_TYPE
969         {
970             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
971         };
972 
973         enum CODEC_SELECT
974         {
975             CODEC_SELECT_DECODE                                              = 0, //!< No additional details
976             CODEC_SELECT_ENCODE                                              = 1, //!< No additional details
977         };
978 
979         //! \brief CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
980         //! \details
981         //!     It allows the Super-Resolution, Loop Restoration Filtering, and Out
982         //!     of Loop Film Graim Synthesisto be done in a separate pass with SW
983         //!     instead.
984         //!     Since these are in-loop filtering, the results are provided back to
985         //!     the HW AV1 pipeline.
986         //!     This feature is currently not being implemented in HW.
987         enum CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
988         {
989             CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE                        = 0, //!< Super-Resolution, Loop Restoration Filtering, and Out of Loop Film Graim Synthesis, if enabled, are performed in HW AVP pipeline.
990             CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG_ENABLE                         = 1, //!< Super-Resolution, Loop Restoration Filtering, and Out of Loop Film Graim Synthesis, if enabled, are NOT performed in HW AVP pipeline.
991         };
992 
993         //! \brief LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
994         //! \details
995         //!     It allows the Film Grain Synthesisto be done in a separate pass with
996         //!     SW instead.
997         //!     All the Post In-Loop Filters, if any enabled, (Deblocker, CDEF,
998         //!     Super-Resolution and Loop Restoration) are still be done in AV1 HW
999         //!     pipeline.
1000         //!     This feature is currently not being implemented in HW.
1001         enum LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
1002         {
1003             LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE            = 0, //!< Film Grain Synthesis, if enabled, is performed in HW AVP Pipeline.
1004             LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_ENABLE             = 1, //!< Film Grain Synthesis, if enabled, is NOT performed in HW AVP Pipeline.
1005         };
1006 
1007         enum PIC_STATUSERROR_REPORT_ENABLE
1008         {
1009             PIC_STATUSERROR_REPORT_ENABLE_DISABLE                            = 0, //!< Disable status/error reporting
1010             PIC_STATUSERROR_REPORT_ENABLE_ENABLE                             = 1, //!< Status/Error reporting is written out once per picture. The Pic Status/Error Report ID in DWord3 along with the status/error status bits are packed into one cache line and written to the Status/Error Buffer address in the AVP_PIPE_BUF_ADDR_STATE command. Must be zero for encoder mode.
1011         };
1012 
1013         enum CODEC_STANDARD_SELECT
1014         {
1015             CODEC_STANDARD_SELECT_HEVC                                       = 0, //!< No additional details
1016             CODEC_STANDARD_SELECT_VP9                                        = 1, //!< No additional details
1017             CODEC_STANDARD_SELECT_AV1                                        = 2, //!< No additional details
1018         };
1019 
1020         //! \brief MULTI_ENGINE_MODE
1021         //! \details
1022         //!     This indicates the current pipe is in single pipe mode or if in
1023         //!     scalable mode is in left/right/middle pipe in multi-engine mode.
1024         enum MULTI_ENGINE_MODE
1025         {
1026             MULTI_ENGINE_MODE_SINGLEENGINEMODEORMSACFEONLYDECODEMODE         = 0, //!< This is for single engine mode (legacy) OR MSAC FE only decode mode During AV1Decoder Scalability Real Tile Mode, for the last phase, it is possible to have single tile column left. In this case, it should be programmed with pipe as a single engine mode (using this value).For example, for 9 tile column running on 4 pipes. The first two phases will use all 4 pipes and finish 8 tile column. The remaining one column will be processed as last third phase as single tile column.
1027             MULTI_ENGINE_MODE_PIPEISTHELEFTENGINEINAMULTI_ENGINEMODE         = 1, //!< Current pipe is the most left engine while running in scalable multi-engine mode
1028             MULTI_ENGINE_MODE_PIPEISTHERIGHTENGINEINAMULTI_ENGINEMODE        = 2, //!< Current pipe is the most right engine while running in scalable multi-engine mode
1029             MULTI_ENGINE_MODE_PIPEISONEOFTHEMIDDLEENGINEINAMULTI_ENGINEMODE  = 3, //!< Current pipe is in one of the middle engine while running in scalable multi-engine mode
1030         };
1031 
1032         //! \brief PIPE_WORKING_MODE
1033         //! \details
1034         //!     This programs the working mode for AVP pipe.
1035         enum PIPE_WORKING_MODE
1036         {
1037             PIPE_WORKING_MODE_LEGACYDECODERENCODERMODE_SINGLEPIPE            = 0, //!< This is for single pipe mode non-scalable mode. It is used by both decoder and encoder.
1038             PIPE_WORKING_MODE_MSACFEONLYDECODEMODE_SINGLEMSACPIPE            = 1, //!< This is for the single MSAC FE only in decoder mode. This will be only run MSAC and streamout syntax element.
1039             PIPE_WORKING_MODE_DECODERBEONLYORENCODERMODE_SCALABLEMULTI_PIPE  = 2, //!< This is for multiple-pipe scalable mode. In decoder, it is only on BE reconstruction. In encoder, it is for PAK.
1040             PIPE_WORKING_MODE_DECODERSCALABLEMODEWITHMSACINREALTILES_SCALABLEMULTI_PIPE = 3, //!< This is for multiple-pipe scalable mode decoder mode in real tiles. MSAC and reconstruction will run together. Each pipes will run in real tiles vertically.
1041         };
1042 
1043         //! \brief MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
1044         //! \details
1045         //!     In decoder modes, this counter value specifies the number of clocks (per
1046         //!     1000) of GAC inactivity before a media soft-reset is applied to the AVP
1047         //!     and HuC. If counter value is set to 0, the media soft-reset feature is
1048         //!     disabled and no reset will occur.
1049         //!     In encoder modes, this counter must be set to 0 to disable media soft
1050         //!     reset. This feature is not supported for the encoder.
1051         enum MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
1052         {
1053             MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS_DISABLE                 = 0, //!< No additional details
1054         };
1055 
1056         //! \brief PIC_STATUSERROR_REPORT_ID
1057         //! \details
1058         //!     The Pic Status/Error Report ID is a unique 32-bit unsigned integer
1059         //!     assigned to each picture
1060         //!     status/error output. Must be zero for encoder mode.
1061         enum PIC_STATUSERROR_REPORT_ID
1062         {
1063             PIC_STATUSERROR_REPORT_ID_32_BITUNSIGNED                         = 0, //!< Unique ID Number
1064         };
1065 
1066         //! \brief PHASE_INDICATOR
1067         //! \details
1068         //!     This is used to indicate whether this is first, middle or last phase
1069         //!     of programming during Real-Tile Decoder Mode. This is used by hardware
1070         //!     to know if the current programming is first or last phases.
1071         //!     This field is ignored (programmed to 0) for other modes other than
1072         //!     AV1 Real-Tile Decoder Mode.
1073         enum PHASE_INDICATOR
1074         {
1075             PHASE_INDICATOR_FIRSTPHASE                                       = 0, //!< No additional details
1076             PHASE_INDICATOR_MIDDLEPHASE                                      = 1, //!< No additional details
1077             PHASE_INDICATOR_LASTPHASE                                        = 2, //!< No additional details
1078         };
1079 
1080         //! \name Initializations
1081 
1082         //! \brief Explicit member initialization function
1083         AVP_PIPE_MODE_SELECT_CMD();
1084 
1085         static const size_t dwSize = 6;
1086         static const size_t byteSize = 24;
1087     };
1088 
1089     //!
1090     //! \brief AVP_IND_OBJ_BASE_ADDR_STATE
1091     //! \details
1092     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1093     //!     all AVP Commands. Each AVP command has assigned a media instruction
1094     //!     command as defined in DWord 0, BitField 22:16.
1095     //!
1096     //!     The AVP_IND_OBJ_BASE_ADDR_STATE command is used to define the indirect
1097     //!     object base address of the AV1 compressed bitstream in graphics memory.
1098     //!     This is a frame level command issued in both encoding and decoding
1099     //!     processes.
1100     //!     Although a frame is coded as separate tiles, all tiles' compressed
1101     //!     bitstream are still required to line up sequentially as one AV1
1102     //!     bitstream. Hence, there is only one Indirect Object Base Address for the
1103     //!     entire AV1 codedframe. If the frame contains more than 1 tiles, the BSD
1104     //!     Object Command will be issued multiple times, once for each tile and
1105     //!     with its own tile bitstream starting memory address.
1106     //!
1107     struct AVP_IND_OBJ_BASE_ADDR_STATE_CMD
1108     {
1109         union
1110         {
1111             struct
1112             {
1113                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1114                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1115                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1116                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1117                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1118                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1119             };
1120             uint32_t                     Value;
1121         } DW0;
1122         SPLITBASEADDRESS4KBYTEALIGNED_CMD        AvpIndirectBitstreamObjectBaseAddress;                                   //!< DW1..2, AVP Indirect Bitstream Object Base Address
1123         MEMORYADDRESSATTRIBUTES_CMD              AvpIndirectBitstreamObjectMemoryAddressAttributes;                       //!< DW3, AVP Indirect Bitstream Object Memory Address Attributes
1124         SPLITBASEADDRESS4KBYTEALIGNED_CMD        AvpIndirectBitstreamObjectAccessUpperBound;                              //!< DW4..5, AVP Indirect Bitstream Object Access Upper Bound
1125 
1126         //! \name Local enumerations
1127 
1128         enum MEDIA_INSTRUCTION_COMMAND
1129         {
1130             MEDIA_INSTRUCTION_COMMAND_AVPINDOBJBASEADDRSTATE                 = 3, //!< No additional details
1131         };
1132 
1133         //! \brief MEDIA_INSTRUCTION_OPCODE
1134         //! \details
1135         //!     Codec/Engine Name = AVP = 3h
1136         enum MEDIA_INSTRUCTION_OPCODE
1137         {
1138             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1139         };
1140 
1141         enum PIPELINE_TYPE
1142         {
1143             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1144         };
1145 
1146         enum COMMAND_TYPE
1147         {
1148             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1149         };
1150 
1151         //! \name Initializations
1152 
1153         //! \brief Explicit member initialization function
1154         AVP_IND_OBJ_BASE_ADDR_STATE_CMD();
1155 
1156         static const size_t dwSize = 6;
1157         static const size_t byteSize = 24;
1158     };
1159 
1160     //!
1161     //! \brief AVP_TILE_CODING
1162     //! \details
1163     //!     This command is used only for AV1codec. It is issued for every tile of a
1164     //!     frame. If a frame is composed of only 1 tile, it is still being issued.
1165     //!     Tiling and Tile Group organization in AV1 cannot be disabled, a frame
1166     //!     minimum must have 1 tile. Currently, each batch buffer can contain only
1167     //!     1 tile to be processed, it cannot contain more than 1 tile or the entire
1168     //!     tile group of tiles.
1169     //!     When the tile width exceeds 4096 pixels or the tile area exceeds
1170     //!     4096x2304 pixels, tiling must be performed and number of tiles in such
1171     //!     frame must be >1. There is no mandatory tiling driven by tile height.
1172     //!     The frame height in pixels will limit the allowed tile height in extreme
1173     //!     situation. Hence, the AVP_TILE_CODING can be issued multiple times for
1174     //!     decoding a frame.
1175     //!     Since AVP HW pipeline is stateless, all sequence, frame and segment
1176     //!     level states (coding parameters in all Frame Level State Commands) must
1177     //!     be resent before sending each TILE_CODING_STATE command.
1178     //!     Although tile size is specified in SuperBlock unit, the minimum tile
1179     //!     size is actually set to be 8x8 pixels (which is the same as the minimum
1180     //!     frame size in pixels). It can also happen to the rightmost tile column
1181     //!     and bottommost tile row of a frame which is not divisible by the
1182     //!     SuperBlock size - this leads to the presence of partial tile and partial
1183     //!     SuperBlock handling.
1184     //!     AV1 supports both
1185     //!     1) a uniform-spacing tiling scheme (as in VP9, which is always in the
1186     //!     form of 2^N x 2^M number of tiles, for the entire frame), and
1187     //!     2) a non-uniform-spacing tiling scheme. Bitstream syntax will specify
1188     //!     the width and height of each tile size in the frame.
1189     //!     AVP HW pipeline is a tile-based codec engine, it does not need to
1190     //!     distinguish between these two tiling schemes. Driver will take care of
1191     //!     the difference and details of these tiling schemes. At the end, Driver
1192     //!     will send out one tile at a time with all the related tile information
1193     //!     to the HW through this TILE_CODING State Command.
1194     //!     In AV1, a frame is partitioned by tile row and tile column. That is, a
1195     //!     tile boundary must go across the full frame width or the full frame
1196     //!     height only. There is no tiling within a tile.
1197     //!     For AV1, the max number of tiles per frame is set to 256 in the LEVEL
1198     //!     definition for regular video decoding. The ext-tile (Virtual Reality
1199     //!     mode, currently not supported) has a different tiling configuration,
1200     //!     constraints and definition.
1201     //!
1202     struct AVP_TILE_CODING_CMD
1203     {
1204         union
1205         {
1206             struct
1207             {
1208                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1209                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1210                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1211                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1212                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1213                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1214             };
1215             uint32_t                     Value;
1216         } DW0;
1217         union
1218         {
1219             struct
1220             {
1221                 uint32_t                 FrameTileId                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< Frame Tile ID
1222                 uint32_t                 TgTileNum                                        : __CODEGEN_BITFIELD(12, 23)    ; //!< TG Tile Num
1223                 uint32_t                 TileGroupId                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Tile Group ID
1224             };
1225             uint32_t                     Value;
1226         } DW1;
1227         union
1228         {
1229             struct
1230             {
1231                 uint32_t                 TileColumnPositionInSbUnit                       : __CODEGEN_BITFIELD( 0,  9)    ; //!< Tile Column Position in SB Unit
1232                 uint32_t                 Reserved74                                       : __CODEGEN_BITFIELD(10, 15)    ; //!< Reserved
1233                 uint32_t                 TileRowPositionInSbUnit                          : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Row Position in SB Unit
1234                 uint32_t                 Reserved90                                       : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1235             };
1236             uint32_t                     Value;
1237         } DW2;
1238         union
1239         {
1240             struct
1241             {
1242                 uint32_t                 TileWidthInSuperblockUnitMinus1                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< Tile Width in SuperBlock Unit Minus1
1243                 uint32_t                 Reserved102                                      : __CODEGEN_BITFIELD( 6, 15)    ; //!< Reserved
1244                 uint32_t                 TileHeightInSuperblockUnitMinus1                 : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Height in SuperBlock Unit Minus1
1245                 uint32_t                 Reserved122                                      : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1246             };
1247             uint32_t                     Value;
1248         } DW3;
1249         union
1250         {
1251             struct
1252             {
1253                 uint32_t                 FilmGrainSampleTemplateWriteReadControl          : __CODEGEN_BITFIELD( 0,  0)    ; //!< FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1254                 uint32_t                 Reserved129                                      : __CODEGEN_BITFIELD( 1, 24)    ; //!< Reserved
1255                 uint32_t                 IslasttileofcolumnFlag                           : __CODEGEN_BITFIELD(25, 25)    ; //!< IsLastTileOfColumn Flag
1256                 uint32_t                 IslasttileofrowFlag                              : __CODEGEN_BITFIELD(26, 26)    ; //!< IsLastTileOfRow Flag
1257                 uint32_t                 IsstarttileoftilegroupFlag                       : __CODEGEN_BITFIELD(27, 27)    ; //!< IsStartTileOfTileGroup Flag
1258                 uint32_t                 IsendtileoftilegroupFlag                         : __CODEGEN_BITFIELD(28, 28)    ; //!< IsEndTileOfTileGroup Flag
1259                 uint32_t                 IslasttileofframeFlag                            : __CODEGEN_BITFIELD(29, 29)    ; //!< IsLastTileOfFrame Flag
1260                 uint32_t                 DisableCdfUpdateFlag                             : __CODEGEN_BITFIELD(30, 30)    ; //!< Disable CDF Update Flag
1261                 uint32_t                 DisableFrameContextUpdateFlag                    : __CODEGEN_BITFIELD(31, 31)    ; //!< Disable Frame Context Update Flag
1262             };
1263             uint32_t                     Value;
1264         } DW4;
1265         union
1266         {
1267             struct
1268             {
1269                 uint32_t                 NumberOfActiveBePipes                            : __CODEGEN_BITFIELD( 0,  7)    ; //!< Number of Active BE Pipes
1270                 uint32_t                 Reserved168                                      : __CODEGEN_BITFIELD( 8, 11)    ; //!< Reserved MBZ
1271                 uint32_t                 NumOfTileColumnsMinus1InAFrame                   : __CODEGEN_BITFIELD(12, 21)    ; //!< Num of Tile Columns Minus1 in a Frame
1272                 uint32_t                 NumOfTileRowsMinus1InAFrame                      : __CODEGEN_BITFIELD(22, 31)    ; //!< Num of Tile Rows Minus1 in a Frame
1273             };
1274             uint32_t                     Value;
1275         } DW5;
1276 
1277         //! \name Local enumerations
1278 
1279         enum MEDIA_INSTRUCTION_COMMAND
1280         {
1281             MEDIA_INSTRUCTION_COMMAND_AVPTILECODING                          = 21, //!< No additional details
1282         };
1283 
1284         enum MEDIA_INSTRUCTION_OPCODE
1285         {
1286             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1287         };
1288 
1289         enum PIPELINE_TYPE
1290         {
1291             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1292         };
1293 
1294         enum COMMAND_TYPE
1295         {
1296             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1297         };
1298 
1299         //! \brief FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1300         //! \details
1301         //!     This should only be set to write on the first tile of the frame in
1302         //!     single pipe mode (when film grain is enabled) and read for the remaining
1303         //!     tiles. In scalable mode, this should be set to writeon the first phase
1304         //!     and top tile of the frame and read for the remaining frames.
1305         enum FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1306         {
1307             FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_READ                = 0, //!< No additional details
1308             FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_WRITE               = 1, //!< No additional details
1309         };
1310 
1311         //! \name Initializations
1312 
1313         //! \brief Explicit member initialization function
1314         AVP_TILE_CODING_CMD();
1315         static const size_t dwSize = 6;
1316         static const size_t byteSize = 24;
1317     };
1318 
1319     //!
1320     //! \brief AVP_TILE_CODING_CMD for LST
1321     //! \details
1322     //!     This command is used when Large Scale Tile decoding is supported
1323     //!
1324     struct AVP_TILE_CODING_CMD_LST
1325     {
1326         union
1327         {
1328             struct
1329             {
1330                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1331                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1332                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1333                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1334                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1335                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1336             };
1337             uint32_t                     Value;
1338         } DW0;
1339         union
1340         {
1341             struct
1342             {
1343                 uint32_t                 FrameTileId                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< Frame Tile ID
1344                 uint32_t                 TgTileNum                                        : __CODEGEN_BITFIELD(12, 23)    ; //!< TG Tile Num
1345                 uint32_t                 TileGroupId                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Tile Group ID
1346             };
1347             uint32_t                     Value;
1348         } DW1;
1349         union
1350         {
1351             struct
1352             {
1353                 uint32_t                 TileColumnPositionInSbUnit                       : __CODEGEN_BITFIELD( 0,  9)    ; //!< Tile Column Position in SB Unit
1354                 uint32_t                 Reserved74                                       : __CODEGEN_BITFIELD(10, 15)    ; //!< Reserved
1355                 uint32_t                 TileRowPositionInSbUnit                          : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Row Position in SB Unit
1356                 uint32_t                 Reserved90                                       : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1357             };
1358             uint32_t                     Value;
1359         } DW2;
1360         union
1361         {
1362             struct
1363             {
1364                 uint32_t                 TileWidthInSuperblockUnitMinus1                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< Tile Width in SuperBlock Unit Minus1
1365                 uint32_t                 Reserved102                                      : __CODEGEN_BITFIELD( 6, 15)    ; //!< Reserved
1366                 uint32_t                 TileHeightInSuperblockUnitMinus1                 : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Height in SuperBlock Unit Minus1
1367                 uint32_t                 Reserved122                                      : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1368             };
1369             uint32_t                     Value;
1370         } DW3;
1371         union
1372         {
1373             struct
1374             {
1375                 uint32_t                 Reserved128                                      : __CODEGEN_BITFIELD( 0, 24)    ; //!< Reserved
1376                 uint32_t                 IslasttileofcolumnFlag                           : __CODEGEN_BITFIELD(25, 25)    ; //!< IsLastTileOfColumn Flag
1377                 uint32_t                 IslasttileofrowFlag                              : __CODEGEN_BITFIELD(26, 26)    ; //!< IsLastTileOfRow Flag
1378                 uint32_t                 IsstarttileoftilegroupFlag                       : __CODEGEN_BITFIELD(27, 27)    ; //!< IsStartTileOfTileGroup Flag
1379                 uint32_t                 IsendtileoftilegroupFlag                         : __CODEGEN_BITFIELD(28, 28)    ; //!< IsEndTileOfTileGroup Flag
1380                 uint32_t                 IslasttileofframeFlag                            : __CODEGEN_BITFIELD(29, 29)    ; //!< IsLastTileOfFrame Flag
1381                 uint32_t                 DisableCdfUpdateFlag                             : __CODEGEN_BITFIELD(30, 30)    ; //!< Disable CDF Update Flag
1382                 uint32_t                 DisableFrameContextUpdateFlag                    : __CODEGEN_BITFIELD(31, 31)    ; //!< Disable Frame Context Update Flag
1383             };
1384             uint32_t                     Value;
1385         } DW4;
1386         union
1387         {
1388             struct
1389             {
1390                 uint32_t                 NumberOfActiveBePipes                            : __CODEGEN_BITFIELD( 0,  7)    ; //!< Number of Active BE Pipes
1391                 uint32_t                 Reserved168                                      : __CODEGEN_BITFIELD( 8, 11)    ; //!< Reserved MBZ
1392                 uint32_t                 NumOfTileColumnsMinus1InAFrame                   : __CODEGEN_BITFIELD(12, 21)    ; //!< Num of Tile Columns Minus1 in a Frame
1393                 uint32_t                 NumOfTileRowsMinus1InAFrame                      : __CODEGEN_BITFIELD(22, 31)    ; //!< Num of Tile Rows Minus1 in a Frame
1394             };
1395             uint32_t                     Value;
1396         } DW5;
1397         union
1398         {
1399             struct
1400             {
1401                 uint32_t                 OutputDecodedTileColumnPositionInSbUnit          : __CODEGEN_BITFIELD( 0,  9)    ; //!< Output Decoded Tile Column Position in SB Unit
1402                 uint32_t                 Reserved202                                      : __CODEGEN_BITFIELD(10, 15)    ; //!< Reserved
1403                 uint32_t                 OutputDecodedTileRowPositionInSbUnit             : __CODEGEN_BITFIELD(16, 25)    ; //!< Output Decoded Tile Row Position in SB Unit
1404                 uint32_t                 Reserved218                                      : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1405             };
1406             uint32_t                     Value;
1407         } DW6;
1408 
1409         //! \name Local enumerations
1410 
1411         enum MEDIA_INSTRUCTION_COMMAND
1412         {
1413             MEDIA_INSTRUCTION_COMMAND_AVPTILECODING                          = 21, //!< No additional details
1414         };
1415 
1416         enum MEDIA_INSTRUCTION_OPCODE
1417         {
1418             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1419         };
1420 
1421         enum PIPELINE_TYPE
1422         {
1423             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1424         };
1425 
1426         enum COMMAND_TYPE
1427         {
1428             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1429         };
1430 
1431         //! \name Initializations
1432 
1433         //! \brief Explicit member initialization function
1434         AVP_TILE_CODING_CMD_LST();
1435 
1436         static const size_t dwSize = 7;
1437         static const size_t byteSize = 28;
1438     };
1439 
1440     //!
1441     //! \brief AVP_SURFACE_STATE
1442     //! \details
1443     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1444     //!     all AVP Commands. Each AVP command has assigned a media instruction
1445     //!     command as defined in DWord 0, BitField 22:16.
1446     //!
1447     //!     The AVP_SURFACE_STATE command is responsible for defining the frame
1448     //!     buffer pitch and the offset of the chroma component.
1449     //!     This is a picture level state command and is shared by both encoding and
1450     //!     decoding processes.
1451     //!     For Decoder, this command is issued once per frame. That is, all pixel
1452     //!     buffers within the current decoding session using the same surface
1453     //!     definition.
1454     //!     For Encoder, this command is issued once per surface type. There are 3
1455     //!     surface types :source, reference and dst. Hence, all reference frames
1456     //!     are defined with the same surface command.
1457     //!     Tile-Yf and Tile-Ys are not supported in Gen12, but HW interface still
1458     //!     need to keep these bits as reserved bits.
1459     //!     Note : When NV12 and Tile Y are being used, full pitch and interleaved
1460     //!     UV is always in use. U and V Xoffset must be set to 0; U and V Yoffset
1461     //!     must be 16-pixel aligned. This Surface State is not the same as that of
1462     //!     the 3D engine and of the MFX pipeline. For 10-bit pixel, P010 surface
1463     //!     definition is being used.
1464     //!
1465     struct AVP_SURFACE_STATE_CMD
1466     {
1467         union
1468         {
1469             struct
1470             {
1471                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1472                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1473                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1474                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1475                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1476                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1477             };
1478             uint32_t                     Value;
1479         } DW0;
1480         union
1481         {
1482             struct
1483             {
1484                 uint32_t                 SurfacePitchMinus1                               : __CODEGEN_BITFIELD( 0, 16)    ; //!< Surface Pitch Minus1
1485                 uint32_t                 Reserved49                                       : __CODEGEN_BITFIELD(17, 27)    ; //!< Reserved
1486                 uint32_t                 SurfaceId                                        : __CODEGEN_BITFIELD(28, 31)    ; //!< SURFACE_ID
1487             };
1488             uint32_t                     Value;
1489         } DW1;
1490         union
1491         {
1492             struct
1493             {
1494                 uint32_t                 YOffsetForUCbInPixel                             : __CODEGEN_BITFIELD( 0, 14)    ; //!< Y Offset for U(Cb) in pixel
1495                 uint32_t                 Reserved79                                       : __CODEGEN_BITFIELD(15, 26)    ; //!< Reserved
1496                 uint32_t                 SurfaceFormat                                    : __CODEGEN_BITFIELD(27, 31)    ; //!< SURFACE_FORMAT
1497             };
1498             uint32_t                     Value;
1499         } DW2;
1500         union
1501         {
1502             struct
1503             {
1504                 uint32_t                 DefaultAlphaValue                                : __CODEGEN_BITFIELD( 0, 15)    ; //!< Default Alpha Value
1505                 uint32_t                 YOffsetForVCr                                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Y Offset for V(Cr)
1506             };
1507             uint32_t                     Value;
1508         } DW3;
1509         union
1510         {
1511             struct
1512             {
1513                 uint32_t                 MemoryCompressionEnableForAv1IntraFrame          : __CODEGEN_BITFIELD( 0,  0)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1514                 uint32_t                 MemoryCompressionEnableForAv1LastFrame           : __CODEGEN_BITFIELD( 1,  1)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1515                 uint32_t                 MemoryCompressionEnableForAv1Last2Frame          : __CODEGEN_BITFIELD( 2,  2)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1516                 uint32_t                 MemoryCompressionEnableForAv1Last3Frame          : __CODEGEN_BITFIELD( 3,  3)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1517                 uint32_t                 MemoryCompressionEnableForAv1GoldenFrame         : __CODEGEN_BITFIELD( 4,  4)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1518                 uint32_t                 MemoryCompressionEnableForAv1BwdrefFrame         : __CODEGEN_BITFIELD( 5,  5)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1519                 uint32_t                 MemoryCompressionEnableForAv1Altref2Frame        : __CODEGEN_BITFIELD( 6,  6)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1520                 uint32_t                 MemoryCompressionEnableForAv1AltrefFrame         : __CODEGEN_BITFIELD( 7,  7)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1521                 uint32_t                 CompressionTypeForIntraFrame                     : __CODEGEN_BITFIELD( 8,  8)    ; //!< COMPRESSION_TYPE_FOR_INTRA_FRAME
1522                 uint32_t                 CompressionTypeForLastFrame                      : __CODEGEN_BITFIELD( 9,  9)    ; //!< COMPRESSION_TYPE_FOR_LAST_FRAME
1523                 uint32_t                 CompressionTypeForLast2Frame                     : __CODEGEN_BITFIELD(10, 10)    ; //!< COMPRESSION_TYPE_FOR_LAST2_FRAME
1524                 uint32_t                 CompressionTypeForLast3Frame                     : __CODEGEN_BITFIELD(11, 11)    ; //!< COMPRESSION_TYPE_FOR_LAST3_FRAME
1525                 uint32_t                 CompressionTypeForGoldenFrame                    : __CODEGEN_BITFIELD(12, 12)    ; //!< COMPRESSION_TYPE_FOR_GOLDEN_FRAME
1526                 uint32_t                 CompressionTypeForBwdrefFrame                    : __CODEGEN_BITFIELD(13, 13)    ; //!< COMPRESSION_TYPE_FOR_BWDREF_FRAME
1527                 uint32_t                 CompressionTypeForAltref2Frame                   : __CODEGEN_BITFIELD(14, 14)    ; //!< COMPRESSION_TYPE_FOR_ALTREF2_FRAME
1528                 uint32_t                 CompressionTypeForAltrefFrame                    : __CODEGEN_BITFIELD(15, 15)    ; //!< COMPRESSION_TYPE_FOR_ALTREF_FRAME
1529                 uint32_t                 Reserved144                                      : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved
1530             };
1531             uint32_t                     Value;
1532         } DW4;
1533 
1534         //! \name Local enumerations
1535 
1536         enum MEDIA_INSTRUCTION_COMMAND
1537         {
1538             MEDIA_INSTRUCTION_COMMAND_SURFACESTATE                           = 1, //!< No additional details
1539         };
1540 
1541         //! \brief MEDIA_INSTRUCTION_OPCODE
1542         //! \details
1543         //!     Codec/Engine Name = AVP = 3h
1544         enum MEDIA_INSTRUCTION_OPCODE
1545         {
1546             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1547         };
1548 
1549         enum PIPELINE_TYPE
1550         {
1551             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1552         };
1553 
1554         enum COMMAND_TYPE
1555         {
1556             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1557         };
1558 
1559         enum SURFACE_ID
1560         {
1561             SURFACE_ID_RECONSTRUCTEDPICTURE                                  = 0, //!< This is for the reconstructed picture surface state
1562             SURFACE_ID_AV1INTRAFRAME                                         = 6, //!< This is for AV1 Intra Frame (Reference Picture 0). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1563             SURFACE_ID_AV1LASTFRAME                                          = 7, //!< This is for AV1Last Frame (Reference Picture 1). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1564             SURFACE_ID_AV1LAST2FRAME                                         = 8, //!< This is for AV1 Last2 Frame (Reference Picture 2). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1565             SURFACE_ID_AV1LAST3FRAME                                         = 9, //!< This is for AV1 Last3 Frame (Reference Picture 3). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1566             SURFACE_ID_AV1GOLDENFRAME                                        = 10, //!< This is for AV1 Golden Frame (Reference Picture 4). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1567             SURFACE_ID_AV1BWDREFFRAME                                        = 11, //!< This is for AV1 Bwdref Frame (Reference Picture 5). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1568             SURFACE_ID_AV1ALTREF2FRAME                                       = 12, //!< This is for AV1 Altref2 Frame (Reference Picture 6). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1569             SURFACE_ID_AV1ALTREFFRAME                                        = 13, //!< This is for AV1 Altref Frame (Reference Picture 7). Each AV1 Reference Pictures can have different size so a separate ID is needed.
1570             SURFACE_ID_INTRABCDECODEDFRAME                                   = 14, //!< This is for AV1 IntraBC Decoded Frame. It will be used both Read/Write at the same time. This surface requires multiple of 8 pixels on both width and height.
1571         };
1572 
1573         //! \brief SURFACE_FORMAT
1574         //! \details
1575         //!     Specifies the format of the surface. This field should be ignored for
1576         //!     now. HW should use the definition in AVP_PIC_STATE instead. (HW team
1577         //!     needs to double check on this ???)
1578         enum SURFACE_FORMAT
1579         {
1580             SURFACE_FORMAT_P010VARIANT                                       = 3,  //!< No additional details
1581             SURFACE_FORMAT_PLANAR4208                                        = 4,  //!< No additional details
1582             SURFACE_FORMAT_P010                                              = 13, //!< No additional details
1583         };
1584 
1585         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1586         //! \details
1587         //!     This bit is for AV1 Intra Frame (Reference Picture 0).
1588         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1589         {
1590             MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1591             MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1592         };
1593 
1594         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1595         //! \details
1596         //!     This bit is for AV1 Last Frame (Reference Picture 1).
1597         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1598         {
1599             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1600             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1601         };
1602 
1603         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1604         //! \details
1605         //!     This bit is for AV1 Last2 Frame (Reference Picture 2).
1606         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1607         {
1608             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1609             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1610         };
1611 
1612         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1613         //! \details
1614         //!     This bit is for AV1 Last3 Frame (Reference Picture 3).
1615         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1616         {
1617             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1618             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1619         };
1620 
1621         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1622         //! \details
1623         //!     This bit is for AV1 Golden Frame (Reference Picture 4).
1624         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1625         {
1626             MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1627             MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1628         };
1629 
1630         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1631         //! \details
1632         //!     This bit is for AV1 Bwdref Frame (Reference Picture 5).
1633         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1634         {
1635             MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1636             MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1637         };
1638 
1639         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1640         //! \details
1641         //!     This bit is for AV1Altref2 Frame (Reference Picture 6).
1642         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1643         {
1644             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1645             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1646         };
1647 
1648         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1649         //! \details
1650         //!     This bit is for AV1Altref Frame (Reference Picture 7).
1651         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1652         {
1653             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1654             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1655         };
1656 
1657         //! \brief COMPRESSION_TYPE_FOR_INTRA_FRAME
1658         //! \details
1659         //!     This bit is for Intra Frame (Reference Picture 0). Valid only when
1660         //!     Memory Compression for Intra Frame is enabled.
1661         enum COMPRESSION_TYPE_FOR_INTRA_FRAME
1662         {
1663             COMPRESSION_TYPE_FOR_INTRA_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
1664             COMPRESSION_TYPE_FOR_INTRA_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
1665         };
1666 
1667         //! \brief COMPRESSION_TYPE_FOR_LAST_FRAME
1668         //! \details
1669         //!     This bit is for AV1 Last Frame (Reference Picture 1). Valid only when
1670         //!     Memory Compression for Last Frameis enabled.
1671         enum COMPRESSION_TYPE_FOR_LAST_FRAME
1672         {
1673             COMPRESSION_TYPE_FOR_LAST_FRAME_MEDIACOMPRESSIONENABLED          = 0, //!< No additional details
1674             COMPRESSION_TYPE_FOR_LAST_FRAME_RENDERCOMPRESSIONENABLED         = 1, //!< No additional details
1675         };
1676 
1677         //! \brief COMPRESSION_TYPE_FOR_LAST2_FRAME
1678         //! \details
1679         //!     This bit is for AV1 Last2 Frame (Reference Picture 2). Valid only when
1680         //!     Memory Compression for Last2 Frame is enabled.
1681         enum COMPRESSION_TYPE_FOR_LAST2_FRAME
1682         {
1683             COMPRESSION_TYPE_FOR_LAST2_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
1684             COMPRESSION_TYPE_FOR_LAST2_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
1685         };
1686 
1687         //! \brief COMPRESSION_TYPE_FOR_LAST3_FRAME
1688         //! \details
1689         //!     This bit is for AV1 Last3 Frame (Reference Picture 3). Valid only when
1690         //!     Memory Compression for Last3 Frameis enabled.
1691         enum COMPRESSION_TYPE_FOR_LAST3_FRAME
1692         {
1693             COMPRESSION_TYPE_FOR_LAST3_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
1694             COMPRESSION_TYPE_FOR_LAST3_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
1695         };
1696 
1697         //! \brief COMPRESSION_TYPE_FOR_GOLDEN_FRAME
1698         //! \details
1699         //!     This bit is for AV1 Golden Frame (Reference Picture 4). Valid only when
1700         //!     Memory Compression for Golden Frame is enabled.
1701         enum COMPRESSION_TYPE_FOR_GOLDEN_FRAME
1702         {
1703             COMPRESSION_TYPE_FOR_GOLDEN_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
1704             COMPRESSION_TYPE_FOR_GOLDEN_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
1705         };
1706 
1707         //! \brief COMPRESSION_TYPE_FOR_BWDREF_FRAME
1708         //! \details
1709         //!     This bit is for AV1 Bwdref Frame (Reference Picture 5). Valid only when
1710         //!     Memory Compression for Bwdref Frame is enabled.
1711         enum COMPRESSION_TYPE_FOR_BWDREF_FRAME
1712         {
1713             COMPRESSION_TYPE_FOR_BWDREF_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
1714             COMPRESSION_TYPE_FOR_BWDREF_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
1715         };
1716 
1717         //! \brief COMPRESSION_TYPE_FOR_ALTREF2_FRAME
1718         //! \details
1719         //!     This bit is for AV1 Altref2 Frame (Reference Picture 6). Valid only when
1720         //!     Memory Compression for Altref2 Frame is enabled.
1721         enum COMPRESSION_TYPE_FOR_ALTREF2_FRAME
1722         {
1723             COMPRESSION_TYPE_FOR_ALTREF2_FRAME_MEDIACOMPRESSIONENABLED       = 0, //!< No additional details
1724             COMPRESSION_TYPE_FOR_ALTREF2_FRAME_RENDERCOMPRESSIONENABLED      = 1, //!< No additional details
1725         };
1726 
1727         //! \brief COMPRESSION_TYPE_FOR_ALTREF_FRAME
1728         //! \details
1729         //!     This bit is for AV1 Altref Frame (Reference Picture 7). Valid only when
1730         //!     Memory Compression for Altref Frame is enabled.
1731         enum COMPRESSION_TYPE_FOR_ALTREF_FRAME
1732         {
1733             COMPRESSION_TYPE_FOR_ALTREF_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
1734             COMPRESSION_TYPE_FOR_ALTREF_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
1735         };
1736 
1737         //! \name Initializations
1738 
1739         //! \brief Explicit member initialization function
1740         AVP_SURFACE_STATE_CMD();
1741 
1742         static const size_t dwSize = 5;
1743         static const size_t byteSize = 20;
1744     };
1745 
1746     //!
1747     //! \brief AVP_SEGMENT_STATE
1748     //! \details
1749     //!     When segmentation is enabled, this Segment State command is issued
1750     //!     onceper segment. There can be maximum 8 segments specified to decode a
1751     //!     given frame, so this Segment State Command can be issued maximum 8
1752     //!     times. It is assumed that there is no gap in segment IDs. So, when the
1753     //!     AVP PIC States specified that the number of active
1754     //!     When segmentation is disabled, driver still sends out this command once
1755     //!     for segment id = 0. HW needs to check the segmentation enable flag from
1756     //!     AVP_PIC_STATE Command as well to distinguish from the case when
1757     //!     segmentation is enabled for segment id = 0.
1758     //!     Each segment can have its own specification of enabling any one of the 8
1759     //!     features defined in AV1 and their corresponding feature data. When a
1760     //!     feature is not enabled, its feature data is defaulted to 0. When
1761     //!     segmentation is not enabled, all the features are disabled and their
1762     //!     corresponding feature data are set to 0.
1763     //!     style="margin:0in 0in 8pt">Segment State Command also provides other
1764     //!     segement related parameters.
1765     //!     style="margin:0in 0in 8pt">It is assumed that HW is keeping a copy of
1766     //!     the complete AV1 QM Matrix Tablefor all color components inside its
1767     //!     internal memory, and Driver only needs to send the qm_level as index
1768     //!     into this Table.
1769     //!
1770     struct AVP_SEGMENT_STATE_CMD
1771     {
1772         union
1773         {
1774             struct
1775             {
1776                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1777                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1778                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1779                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1780                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1781                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1782             };
1783             uint32_t                     Value;
1784         } DW0;
1785         union
1786         {
1787             struct
1788             {
1789                 uint32_t                 SegmentId                                        : __CODEGEN_BITFIELD( 0,  2)    ; //!< Segment ID
1790                 uint32_t                 Reserved35                                       : __CODEGEN_BITFIELD( 3, 31)    ; //!< Reserved
1791             };
1792             uint32_t                     Value;
1793         } DW1;
1794         union
1795         {
1796             struct
1797             {
1798                 uint32_t                 SegmentFeatureMask                               : __CODEGEN_BITFIELD( 0,  7)    ; //!< Segment Feature Mask
1799                 uint32_t                 SegmentDeltaQindex                               : __CODEGEN_BITFIELD( 8, 16)    ; //!< Segment Delta Qindex
1800                 uint32_t                 SegmentBlockSkipFlag                             : __CODEGEN_BITFIELD(17, 17)    ; //!< Segment Block Skip Flag
1801                 uint32_t                 SegmentBlockGlobalmvFlag                         : __CODEGEN_BITFIELD(18, 18)    ; //!< Segment Block GlobalMV Flag
1802                 uint32_t                 SegmentLosslessFlag                              : __CODEGEN_BITFIELD(19, 19)    ; //!< Segment Lossless Flag
1803                 uint32_t                 SegmentLumaYQmLevel                              : __CODEGEN_BITFIELD(20, 23)    ; //!< Segment Luma Y QM Level
1804                 uint32_t                 SegmentChromaUQmLevel                            : __CODEGEN_BITFIELD(24, 27)    ; //!< Segment Chroma U QM Level
1805                 uint32_t                 SegmentChromaVQmLevel                            : __CODEGEN_BITFIELD(28, 31)    ; //!< Segment Chroma V QM Level
1806             };
1807             uint32_t                     Value;
1808         } DW2;
1809         union
1810         {
1811             struct
1812             {
1813                 uint32_t                 SegmentDeltaLoopFilterLevelLumaVertical          : __CODEGEN_BITFIELD( 0,  6)    ; //!< Segment Delta Loop Filter Level Luma Vertical
1814                 uint32_t                 SegmentDeltaLoopFilterLevelLumaHorizontal        : __CODEGEN_BITFIELD( 7, 13)    ; //!< Segment Delta Loop Filter Level Luma Horizontal
1815                 uint32_t                 SegmentDeltaLoopFilterLevelChromaU               : __CODEGEN_BITFIELD(14, 20)    ; //!< Segment Delta Loop Filter Level Chroma U
1816                 uint32_t                 SegmentDeltaLoopFilterLevelChromaV               : __CODEGEN_BITFIELD(21, 27)    ; //!< Segment Delta Loop Filter Level Chroma V
1817                 uint32_t                 SegmentReferenceFrame                            : __CODEGEN_BITFIELD(28, 30)    ; //!< Segment Reference Frame
1818                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
1819             };
1820             uint32_t                     Value;
1821         } DW3;
1822 
1823         //! \name Local enumerations
1824 
1825         enum MEDIA_INSTRUCTION_COMMAND
1826         {
1827             MEDIA_INSTRUCTION_COMMAND_AVPSEGMENTSTATE                        = 50, //!< No additional details
1828         };
1829 
1830         //! \brief MEDIA_INSTRUCTION_OPCODE
1831         //! \details
1832         //!     Codec/Engine Name = AVP = 3h
1833         enum MEDIA_INSTRUCTION_OPCODE
1834         {
1835             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1836         };
1837 
1838         enum PIPELINE_TYPE
1839         {
1840             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1841         };
1842 
1843         enum COMMAND_TYPE
1844         {
1845             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1846         };
1847 
1848         //! \name Initializations
1849 
1850         //! \brief Explicit member initialization function
1851         AVP_SEGMENT_STATE_CMD();
1852 
1853         static const size_t dwSize = 4;
1854         static const size_t byteSize = 16;
1855     };
1856 
1857     //!
1858     //! \brief AVP_PIPE_BUF_ADDR_STATE
1859     //! \details
1860     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1861     //!     all AVP Commands. Each AVP command has assigned a media instruction
1862     //!     command as defined in DWord 0, BitField 22:16.
1863     //!
1864     //!     This state command provides the physical memory base addresses for all
1865     //!     row store buffers, column store buffers (for tile column and in
1866     //!     scalability mode), reconstructed output and reference frame buffers, and
1867     //!     auxiliary data buffers (MV, segment map, etc.) that are required by the
1868     //!     AV1 decoding and encoding process.
1869     //!     This is a frame level state command and is shared by both encoding and
1870     //!     decoding processes.
1871     //!     AVP is a tile based pipeline and is a stateless pipeline, hence all
1872     //!     sequence level, frame level, and segment level state commands must be
1873     //!     resent to process each tile.
1874     //!     Memory compression may be applicable to some of these buffers for BW
1875     //!     saving.
1876     //!     Note : there is no buffer to store the 16 QM table sets, they are
1877     //!     implemented directly inside the HW pipeline.
1878     //!
1879     struct AVP_PIPE_BUF_ADDR_STATE_CMD
1880     {
1881         union
1882         {
1883             struct
1884             {
1885                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1886                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1887                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1888                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1889                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1890                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1891             };
1892             uint32_t                     Value;
1893         } DW0;
1894         SPLITBASEADDRESS64BYTEALIGNED_CMD        ReferenceFrameBufferBaseAddressRefaddr07[8];                             //!< DW1..16, Reference Frame Buffer Base Address (RefAddr[0-7])
1895         MEMORYADDRESSATTRIBUTES_CMD              ReferenceFrameBufferBaseAddressAttributes;                               //!< DW17, Reference Frame Buffer Base Address Attributes
1896         SPLITBASEADDRESS4KBYTEALIGNED_CMD        DecodedOutputFrameBufferAddress;                                         //!< DW18..19, Decoded Output Frame Buffer Address
1897         MEMORYADDRESSATTRIBUTES_CMD              DecodedOutputFrameBufferAddressAttributes;                               //!< DW20, Decoded Output Frame Buffer Address Attributes
1898         uint32_t                                 Reserved672[3];                                                          //!< Reserved
1899         SPLITBASEADDRESS4KBYTEALIGNED_CMD        IntrabcDecodedOutputFrameBufferAddress;                                  //!< DW24..25, IntraBC Decoded Output Frame Buffer Address
1900         MEMORYADDRESSATTRIBUTES_CMD              IntrabcDecodedOutputFrameBufferAddressAttributes;                        //!< DW26, IntraBC Decoded Output Frame Buffer Address Attributes
1901         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdfTablesInitializationBufferAddress;                                    //!< DW27..28, CDF Tables Initialization Buffer Address
1902         MEMORYADDRESSATTRIBUTES_CMD              CdfTablesInitializationBufferAddressAttributes;                          //!< DW29, CDF Tables Initialization Buffer Address Attributes
1903         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdfTablesBackwardAdaptationBufferAddress;                                //!< DW30..31, CDF Tables Backward Adaptation Buffer Address
1904         MEMORYADDRESSATTRIBUTES_CMD              CdfTablesBackwardAdaptationBufferAddressAttributes;                      //!< DW32, CDF Tables Backward Adaptation Buffer Address Attributes
1905         SPLITBASEADDRESS64BYTEALIGNED_CMD        Av1SegmentIdReadBufferAddress;                                           //!< DW33..34, AV1 Segment ID Read Buffer Address
1906         MEMORYADDRESSATTRIBUTES_CMD              Av1SegmentIdReadBufferAddressAttributes;                                 //!< DW35, AV1 Segment ID Read Buffer Address Attributes
1907         SPLITBASEADDRESS64BYTEALIGNED_CMD        Av1SegmentIdWriteBufferAddress;                                          //!< DW36..37, AV1 Segment ID Write Buffer Address
1908         MEMORYADDRESSATTRIBUTES_CMD              Av1SegmentIdWriteBufferAddressAttributes;                                //!< DW38, AV1 Segment ID Write Buffer Address Attributes
1909         SPLITBASEADDRESS64BYTEALIGNED_CMD        CollocatedMotionVectorTemporalBufferBaseAddressTmvaddr07[8];             //!< DW39..54, Collocated Motion Vector Temporal Buffer Base Address (TmvAddr[0-7])
1910         MEMORYADDRESSATTRIBUTES_CMD              CollocatedMotionVectorTemporalBufferBaseAddressAttributes;               //!< DW55, Collocated Motion Vector Temporal Buffer Base Address Attributes
1911         SPLITBASEADDRESS64BYTEALIGNED_CMD        CurrentFrameMotionVectorWriteBufferAddress;                              //!< DW56..57, Current Frame Motion Vector Write Buffer Address
1912         MEMORYADDRESSATTRIBUTES_CMD              CurrentFrameMotionVectorWriteBufferAddressAttributes;                    //!< DW58, Current Frame Motion Vector Write Buffer Address Attributes
1913         uint32_t                                 Reserved1888[3];                                                         //!< Reserved
1914         SPLITBASEADDRESS64BYTEALIGNED_CMD        BitstreamDecoderEncoderLineRowstoreReadWriteBufferAddress;               //!< DW62..63, Bitstream Decoder/Encoder Line Rowstore Read/Write Buffer Address
1915         MEMORYADDRESSATTRIBUTES_CMD              BitstreamDecoderEncoderLineRowstoreReadWriteBufferAddressAttributes;     //!< DW64, Bitstream Decoder/Encoder Line Rowstore Read/Write Buffer Address Attributes
1916         SPLITBASEADDRESS64BYTEALIGNED_CMD        BitstreamDecoderEncoderTileLineRowstoreReadWriteBufferAddress;           //!< DW65..66, Bitstream Decoder/Encoder Tile Line Rowstore Read/Write Buffer Address
1917         MEMORYADDRESSATTRIBUTES_CMD              BitstreamDecoderEncoderTileLineRowstoreReadWriteBufferAddressAttributes; //!< DW67, Bitstream Decoder/Encoder Tile Line Rowstore Read/Write Buffer Address Attributes
1918         SPLITBASEADDRESS64BYTEALIGNED_CMD        IntraPredictionLineRowstoreReadWriteBufferAddress;                       //!< DW68..69, Intra Prediction Line Rowstore Read/Write Buffer Address
1919         MEMORYADDRESSATTRIBUTES_CMD              IntraPredictionLineRowstoreReadWriteBufferAddressAttributes;             //!< DW70, Intra Prediction Line Rowstore Read/Write Buffer Address Attributes
1920         SPLITBASEADDRESS64BYTEALIGNED_CMD        IntraPredictionTileLineRowstoreReadWriteBufferAddress;                   //!< DW71..72, Intra Prediction Tile Line Rowstore Read/Write Buffer Address
1921         MEMORYADDRESSATTRIBUTES_CMD              IntraPredictionTileLineRowstoreReadWriteBufferAddressAttributes;         //!< DW73, Intra Prediction Tile Line Rowstore Read/Write Buffer Address Attributes
1922         SPLITBASEADDRESS64BYTEALIGNED_CMD        SpatialMotionVectorLineReadWriteBufferAddress;                           //!< DW74..75, Spatial Motion Vector Line Read/Write Buffer Address
1923         MEMORYADDRESSATTRIBUTES_CMD              SpatialMotionVectorLineReadWriteBufferAddressAttributes;                 //!< DW76, Spatial Motion Vector Line Read/Write Buffer Address Attributes
1924         SPLITBASEADDRESS64BYTEALIGNED_CMD        SpatialMotionVectorCodingTileLineReadWriteBufferAddress;                 //!< DW77..78, Spatial Motion Vector Coding Tile Line Read/Write Buffer Address
1925         MEMORYADDRESSATTRIBUTES_CMD              SpatialMotionVectorTileLineReadWriteBufferAddressAttributes;             //!< DW79, Spatial Motion Vector Tile Line Read/Write Buffer Address Attributes
1926         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationMetaTileColumnReadWriteBufferAddress;                     //!< DW80..81, Loop Restoration Meta Tile Column Read/Write Buffer Address
1927         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationMetaTileColumnReadWriteBufferAddressAttributes;           //!< DW82, Loop Restoration Meta Tile Column Read/Write Buffer Address Attributes
1928         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineYBufferAddress;                    //!< DW83..84, Loop Restoration Filter Tile Read/Write Line Y Buffer Address
1929         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineYBufferAddressAttributes;          //!< DW85, Loop Restoration Filter Tile Read/Write Line Y Buffer Address Attributes
1930         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineUBufferAddress;                    //!< DW86..87, Loop Restoration Filter Tile Read/Write Line U Buffer Address
1931         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineUBufferAddressAttributes;          //!< DW88, Loop Restoration Filter Tile Read/Write Line U Buffer Address Attributes
1932         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineVBufferAddress;                    //!< DW89..90, Loop Restoration Filter Tile Read/Write Line V Buffer Address
1933         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineVBufferAddressAttributes;          //!< DW91, Loop Restoration Filter Tile Read/Write Line V Buffer Address Attributes
1934         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteYBufferAddress;                              //!< DW92..93, Deblocker Filter Line Read/Write Y Buffer Address
1935         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteYBufferAddressAttributes;                    //!< DW94, Deblocker Filter Line Read/Write Y Buffer Address Attributes
1936         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteUBufferAddress;                              //!< DW95..96, Deblocker Filter Line Read/Write U Buffer Address
1937         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteUBufferAddressAttributes;                    //!< DW97, Deblocker Filter Line Read/Write U Buffer Address Attributes
1938         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteVBufferAddress;                              //!< DW98..99, Deblocker Filter Line Read/Write V Buffer Address
1939         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteVBufferAddressAttributes;                    //!< DW100, Deblocker Filter Line Read/Write V Buffer Address Attributes
1940         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteYBufferAddress;                          //!< DW101..102, Deblocker Filter Tile Line Read/Write Y Buffer Address
1941         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteYBufferAddressAttributes;                //!< DW103, Deblocker Filter Tile Line Read/Write Y Buffer Address Attributes
1942         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteVBufferAddress;                          //!< DW104..105, Deblocker Filter Tile Line Read/Write V Buffer Address
1943         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteVBufferAddressAttributes;                //!< DW106, Deblocker Filter Tile Line Read/Write V Buffer Address Attributes
1944         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteUBufferAddress;                          //!< DW107..108, Deblocker Filter Tile Line Read/Write U Buffer Address
1945         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteUBufferAddressAttributes;                //!< DW109, Deblocker Filter Tile Line Read/Write U Buffer Address Attributes
1946         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteYBufferAddress;                        //!< DW110..111, Deblocker Filter Tile Column Read/Write Y Buffer Address
1947         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteYBufferAddressAttributes;              //!< DW112, Deblocker Filter Tile Column Read/Write Y Buffer Address Attributes
1948         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteUBufferAddress;                        //!< DW113..114, Deblocker Filter Tile Column Read/Write U Buffer Address
1949         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteUBufferAddressAttributes;              //!< DW115, Deblocker Filter Tile Column Read/Write U Buffer Address Attributes
1950         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteVBufferAddress;                        //!< DW116..117, Deblocker Filter Tile Column Read/Write V Buffer Address
1951         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteVBufferAddressAttributes;              //!< DW118, Deblocker Filter Tile Column Read/Write V Buffer Address Attributes
1952         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterLineReadWriteBufferAddress;                                    //!< DW119..120, CDEF Filter Line Read/Write Buffer Address
1953         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterLineReadWriteBufferAddressAttributes;                          //!< DW121, CDEF Filter Line Read/Write Buffer Address Attributes
1954         uint32_t                                 Reserved3904[6];                                                         //!< Reserved
1955         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTileLineReadWriteBufferAddress;                                //!< DW128..129, CDEF Filter Tile Line Read/Write Buffer Address
1956         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTileLineReadWriteBufferAddressAttributes;                      //!< DW130, CDEF Filter Tile Line Read/Write Buffer Address Attributes
1957         uint32_t                                 Reserved4192[6];                                                         //!< Reserved
1958         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTileColumnReadWriteBufferAddress;                              //!< DW137..138, CDEF Filter Tile Column Read/Write Buffer Address
1959         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTileColumnReadWriteBufferAddressAttributes;                    //!< DW139, CDEF Filter Tile Column Read/Write Buffer Address Attributes
1960         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterMetaTileLineReadWriteBufferAddress;                            //!< DW140..141, CDEF Filter Meta Tile Line Read/Write Buffer Address
1961         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterMetaTileLineReadWriteBufferAddressAttributes;                  //!< DW142, CDEF Filter Meta Tile Line Read/Write Buffer Address Attributes
1962         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterMetaTileColumnReadWriteBufferAddress;                          //!< DW143..144, CDEF Filter Meta Tile Column Read/Write Buffer Address
1963         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterMetaTileColumnReadWriteBufferAddressAttributes;                //!< DW145, CDEF Filter Meta Tile Column Read/Write Buffer Address Attributes
1964         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTopLeftCornerReadWriteBufferAddress;                           //!< DW146..147, CDEF Filter Top-Left Corner Read/Write Buffer Address
1965         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTopLeftCornerReadWriteBufferAddressAttributes;                 //!< DW148, CDEF Filter Top-Left Corner Read/Write Buffer Address Attributes
1966         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteYBufferAddress;                               //!< DW149..150, Super-Res Tile Column Read/Write Y Buffer Address
1967         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteYBufferAddressAttributes;                     //!< DW151, Super-Res Tile Column Read/Write Y Buffer Address Attributes
1968         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteUBufferAddress;                               //!< DW152..153, Super-Res Tile Column Read/Write U Buffer Address
1969         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteUBufferAddressAttributes;                     //!< DW154, Super-Res Tile Column Read/Write U Buffer Address Attributes
1970         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteVBufferAddress;                               //!< DW155..156, Super-Res Tile Column Read/Write V Buffer Address
1971         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteVBufferAddressAttributes;                     //!< DW157, Super-Res Tile Column Read/Write V Buffer Address Attributes
1972         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteYBufferAddress;                  //!< DW158..159, Loop Restoration Filter Tile Column Read/Write Y Buffer Address
1973         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteYBufferAddressAttributes;        //!< DW160, Loop Restoration Filter Tile Column Read/Write Y Buffer Address Attributes
1974         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteUBufferAddress;                  //!< DW161..162, Loop Restoration Filter Tile Column Read/Write U Buffer Address
1975         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteUBufferAddressAttributes;        //!< DW163, Loop Restoration Filter Tile Column Read/Write U Buffer Address Attributes
1976         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteVBufferAddress;                  //!< DW164..165, Loop Restoration Filter Tile Column Read/Write V Buffer Address
1977         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteVBufferAddressAttributes;        //!< DW166, Loop Restoration Filter Tile Column Read/Write V Buffer Address Attributes
1978         uint32_t                                 Reserved5344[9];                                                         //!< Reserved
1979         SPLITBASEADDRESS64BYTEALIGNED_CMD        DecodedFrameStatusErrorBufferBaseAddress;                                //!< DW176..177, Decoded Frame Status/Error Buffer Base Address
1980         MEMORYADDRESSATTRIBUTES_CMD              DecodedFrameStatusErrorBufferBaseAddressAttributes;                      //!< DW178, Decoded Frame Status/Error Buffer Base Address Attributes
1981         SPLITBASEADDRESS64BYTEALIGNED_CMD        DecodedBlockDataStreamoutBufferAddress;                                  //!< DW179..180, Decoded Block Data Streamout Buffer Address
1982         MEMORYADDRESSATTRIBUTES_CMD              DecodedBlockDataStreamoutBufferAddressAttributes;                        //!< DW181, Decoded Block Data Streamout Buffer Address Attributes
1983         uint32_t                                 Reserved5824[3];                                                         //!< Reserved
1984         uint32_t                                 Reserved5920[3];                                                         //!< Reserved
1985 
1986         //! \name Local enumerations
1987 
1988         enum MEDIA_INSTRUCTION_COMMAND
1989         {
1990             MEDIA_INSTRUCTION_COMMAND_AVPPIPEBUFADDRSTATE                    = 2, //!< No additional details
1991         };
1992 
1993         //! \brief MEDIA_INSTRUCTION_OPCODE
1994         //! \details
1995         //!     Codec/Engine Name = AVP = 3h
1996         enum MEDIA_INSTRUCTION_OPCODE
1997         {
1998             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1999         };
2000 
2001         enum PIPELINE_TYPE
2002         {
2003             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2004         };
2005 
2006         enum COMMAND_TYPE
2007         {
2008             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2009         };
2010 
2011         //! \name Initializations
2012 
2013         //! \brief Explicit member initialization function
2014         AVP_PIPE_BUF_ADDR_STATE_CMD();
2015 
2016         static const size_t dwSize = 188;
2017         static const size_t byteSize = 752;
2018     };
2019 
2020     //!
2021     //! \brief AVP_INLOOP_FILTER_STATE
2022     //! \details
2023     //!     The AVP_INLOOP_FILTER_STATE command provides all the frame level syntax
2024     //!     elements and derived parameters that are needed for the processing of
2025     //!     all the post in-loop filters present in the AV1 codec. This includes the
2026     //!     Deblocker, the CDEF (Constrained Directional Enhancement Filter), the
2027     //!     HSRF (Horizontal-only Super-Resolution Filter), and the LRF (Loop
2028     //!     Restoration Filter). These syntax elements can be changed in the
2029     //!     bitstream from frame to frame.
2030     //!     All Post In-Loop Filters are inherently frame-based filtering, but when
2031     //!     implemented in a HW pipeline, the filtering process is performed in a
2032     //!     block by block fashion. In the addition to these frame level states,
2033     //!     there are additional syntax elements and derived parameters that are
2034     //!     generated at SuperBlock level, and are not described here.
2035     //!     Each of these 4 Post In-Loop Filters can be controlled independently and
2036     //!     each can be enabled or disabled independently. Except the HSRF, all the
2037     //!     other 3 filters have separate controls for each color plane as well. To
2038     //!     disable a Post In-Loop Filter, its control parameter(s) are set to 0 -
2039     //!     the default state.
2040     //!     This command should be issued once per tile, even if no post in-loop
2041     //!     filter is enabled for decoding the current frame. When in frame lossless
2042     //!     mode or when IntraBC is enabled, all the Post In-Loop Filters are
2043     //!     disabled for all color planes, this command will provide the default
2044     //!     values for all parameters. All syntax elements are then assumed a value
2045     //!     of 0, except otherwise specified in each field of this State Command.
2046     //!     When it is in monochrome video, no filter parameter for the two chroma
2047     //!     planes is present in the bitstream.
2048     //!
2049     struct AVP_INLOOP_FILTER_STATE_CMD
2050     {
2051         union
2052         {
2053             struct
2054             {
2055                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2056                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2057                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2058                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2059                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2060                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2061             };
2062             uint32_t                     Value;
2063         } DW0;
2064         union
2065         {
2066             struct
2067             {
2068                 uint32_t                 LumaYDeblockerFilterLevelVertical                : __CODEGEN_BITFIELD( 0,  5)    ; //!< Luma Y Deblocker Filter Level Vertical
2069                 uint32_t                 LumaYDeblockerFilterLevelHorizontal              : __CODEGEN_BITFIELD( 6, 11)    ; //!< Luma Y Deblocker Filter Level Horizontal
2070                 uint32_t                 ChromaUDeblockerFilterLevel                      : __CODEGEN_BITFIELD(12, 17)    ; //!< Chroma U Deblocker Filter Level
2071                 uint32_t                 ChromaVDeblockerFilterLevel                      : __CODEGEN_BITFIELD(18, 23)    ; //!< Chroma V Deblocker Filter Level
2072                 uint32_t                 DeblockerFilterSharpnessLevel                    : __CODEGEN_BITFIELD(24, 26)    ; //!< Deblocker Filter Sharpness Level
2073                 uint32_t                 DeblockerFilterModeRefDeltaEnableFlag            : __CODEGEN_BITFIELD(27, 27)    ; //!< Deblocker Filter Mode Ref Delta Enable Flag
2074                 uint32_t                 DeblockerDeltaLfResolution                       : __CODEGEN_BITFIELD(28, 29)    ; //!< Deblocker Delta LF Resolution
2075                 uint32_t                 DeblockerFilterDeltaLfMultiFlag                  : __CODEGEN_BITFIELD(30, 30)    ; //!< Deblocker Filter Delta LF Multi Flag
2076                 uint32_t                 DeblockerFilterDeltaLfPresentFlag                : __CODEGEN_BITFIELD(31, 31)    ; //!< Deblocker Filter Delta LF Present Flag
2077             };
2078             uint32_t                     Value;
2079         } DW1;
2080         union
2081         {
2082             struct
2083             {
2084                 uint32_t                 DeblockerFilterRefDeltas0                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Ref Deltas[0]
2085                 uint32_t                 Reserved71                                       : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2086                 uint32_t                 DeblockerFilterRefDeltas1                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Ref Deltas[1]
2087                 uint32_t                 Reserved79                                       : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
2088                 uint32_t                 DeblockerFilterRefDeltas2                        : __CODEGEN_BITFIELD(16, 22)    ; //!< Deblocker Filter Ref Deltas[2]
2089                 uint32_t                 Reserved87                                       : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
2090                 uint32_t                 DeblockerFilterRefDeltas3                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Deblocker Filter Ref Deltas[3]
2091                 uint32_t                 Reserved95                                       : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
2092             };
2093             uint32_t                     Value;
2094         } DW2;
2095         union
2096         {
2097             struct
2098             {
2099                 uint32_t                 DeblockerFilterRefDeltas4                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Ref Deltas[4]
2100                 uint32_t                 Reserved103                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2101                 uint32_t                 DeblockerFilterRefDeltas5                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Ref Deltas[5]
2102                 uint32_t                 Reserved111                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
2103                 uint32_t                 DeblockerFilterRefDeltas6                        : __CODEGEN_BITFIELD(16, 22)    ; //!< Deblocker Filter Ref Deltas[6]
2104                 uint32_t                 Reserved119                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
2105                 uint32_t                 DeblockerFilterRefDeltas7                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Deblocker Filter Ref Deltas[7]
2106                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
2107             };
2108             uint32_t                     Value;
2109         } DW3;
2110         union
2111         {
2112             struct
2113             {
2114                 uint32_t                 DeblockerFilterModeDeltas0                       : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Mode Deltas[0]
2115                 uint32_t                 Reserved135                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2116                 uint32_t                 DeblockerFilterModeDeltas1                       : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Mode Deltas[1]
2117                 uint32_t                 Reserved143                                      : __CODEGEN_BITFIELD(15, 31)    ; //!< Reserved
2118             };
2119             uint32_t                     Value;
2120         } DW4;
2121         union
2122         {
2123             struct
2124             {
2125                 uint32_t                 CdefYStrength0                                   : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF Y Strength[0]
2126                 uint32_t                 CdefYStrength1                                   : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF Y Strength[1]
2127                 uint32_t                 CdefYStrength2                                   : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF Y Strength[2]
2128                 uint32_t                 CdefYStrength3                                   : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF Y Strength[3]
2129                 uint32_t                 Reserved184                                      : __CODEGEN_BITFIELD(24, 27)    ; //!< Reserved
2130                 uint32_t                 CdefBits                                         : __CODEGEN_BITFIELD(28, 29)    ; //!< CDEF Bits
2131                 uint32_t                 CdefFilterDampingFactorMinus3                    : __CODEGEN_BITFIELD(30, 31)    ; //!< CDEF Filter Damping Factor Minus3
2132             };
2133             uint32_t                     Value;
2134         } DW5;
2135         union
2136         {
2137             struct
2138             {
2139                 uint32_t                 CdefYStrength4                                   : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF Y Strength[4]
2140                 uint32_t                 CdefYStrength5                                   : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF Y Strength[5]
2141                 uint32_t                 CdefYStrength6                                   : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF Y Strength[6]
2142                 uint32_t                 CdefYStrength7                                   : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF Y Strength[7]
2143                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2144             };
2145             uint32_t                     Value;
2146         } DW6;
2147         union
2148         {
2149             struct
2150             {
2151                 uint32_t                 CdefUvStrength0                                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF UV Strength[0]
2152                 uint32_t                 CdefUvStrength1                                  : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF UV Strength[1]
2153                 uint32_t                 CdefUvStrength2                                  : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF UV Strength[2]
2154                 uint32_t                 CdefUvStrength3                                  : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF UV Strength[3]
2155                 uint32_t                 Reserved248                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2156             };
2157             uint32_t                     Value;
2158         } DW7;
2159         union
2160         {
2161             struct
2162             {
2163                 uint32_t                 CdefUvStrength4                                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF UV Strength[4]
2164                 uint32_t                 CdefUvStrength5                                  : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF UV Strength[5]
2165                 uint32_t                 CdefUvStrength6                                  : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF UV Strength[6]
2166                 uint32_t                 CdefUvStrength7                                  : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF UV Strength[7]
2167                 uint32_t                 Reserved280                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2168             };
2169             uint32_t                     Value;
2170         } DW8;
2171         union
2172         {
2173             struct
2174             {
2175                 uint32_t                 SuperResUpscaledFrameWidthMinus1                 : __CODEGEN_BITFIELD( 0, 15)    ; //!< Super-Res Upscaled Frame Width Minus1
2176                 uint32_t                 SuperResDenom                                    : __CODEGEN_BITFIELD(16, 20)    ; //!< Super-Res Denom
2177                 uint32_t                 HorzSuperResEnableFlag                           : __CODEGEN_BITFIELD(21, 21)    ; //!< Horz Super-Res Enable Flag
2178                 uint32_t                 Reserved310                                      : __CODEGEN_BITFIELD(22, 31)    ; //!< Reserved
2179             };
2180             uint32_t                     Value;
2181         } DW9;
2182         union
2183         {
2184             struct
2185             {
2186                 uint32_t                 FrameLoopRestorationFilterTypeForLumaY           : __CODEGEN_BITFIELD( 0,  1)    ; //!< Frame Loop Restoration Filter Type for Luma Y
2187                 uint32_t                 FrameLoopRestorationFilterTypeForChromaU         : __CODEGEN_BITFIELD( 2,  3)    ; //!< Frame Loop Restoration Filter Type for Chroma U
2188                 uint32_t                 FrameLoopRestorationFilterTypeForChromaV         : __CODEGEN_BITFIELD( 4,  5)    ; //!< Frame Loop Restoration Filter Type for Chroma V
2189                 uint32_t                 Reserved326                                      : __CODEGEN_BITFIELD( 6,  7)    ; //!< Reserved
2190                 uint32_t                 LoopRestorationUnitSizeForLumaY                  : __CODEGEN_BITFIELD( 8,  9)    ; //!< Loop Restoration Unit Size for Luma Y
2191                 uint32_t                 UseSameLoopRestorationUnitSizeForChromasUvFlag   : __CODEGEN_BITFIELD(10, 10)    ; //!< Use Same Loop Restoration Unit Size for Chromas UV Flag
2192                 uint32_t                 Reserved331                                      : __CODEGEN_BITFIELD(11, 31)    ; //!< Reserved
2193             };
2194             uint32_t                     Value;
2195         } DW10;
2196 
2197         union
2198         {
2199             struct
2200             {
2201                 uint32_t                 LumaPlaneXStepQn                                 : __CODEGEN_BITFIELD( 0, 15)    ; //!< Luma Plane x_step_qn
2202                 uint32_t                 Reserved368                                      : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved (for higher precision of x_step_qn)
2203             };
2204             uint32_t                     Value;
2205         } DW11;
2206         union
2207         {
2208             struct
2209             {
2210                 uint32_t                 LumaPlaneX0Qn                                    : __CODEGEN_BITFIELD( 0, 31)    ; //!< Luma Plane x0_qn
2211             };
2212             uint32_t                     Value;
2213         } DW12;
2214         union
2215         {
2216             struct
2217             {
2218                 uint32_t                 ChromaPlaneXStepQn                               : __CODEGEN_BITFIELD( 0, 15)    ; //!< Chroma Plane x_step_qn
2219                 uint32_t                 Reserved368                                      : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved (for higher precision of x_step_qn)
2220             };
2221             uint32_t                     Value;
2222         } DW13;
2223         union
2224         {
2225             struct
2226             {
2227                 uint32_t                 ChromaPlaneX0Qn                                  : __CODEGEN_BITFIELD( 0, 31)    ; //!< Chroma Plane x0_qn
2228             };
2229             uint32_t                     Value;
2230         } DW14;
2231 
2232         //! \name Local enumerations
2233 
2234         enum MEDIA_INSTRUCTION_COMMAND
2235         {
2236             MEDIA_INSTRUCTION_COMMAND_AVPINLOOPFILTERSTATE                   = 51, //!< No additional details
2237         };
2238 
2239         //! \brief MEDIA_INSTRUCTION_OPCODE
2240         //! \details
2241         //!     Codec/Engine Name = AV1 = 3h
2242         enum MEDIA_INSTRUCTION_OPCODE
2243         {
2244             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2245         };
2246 
2247         enum PIPELINE_TYPE
2248         {
2249             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2250         };
2251 
2252         enum COMMAND_TYPE
2253         {
2254             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2255         };
2256 
2257         //! \name Initializations
2258 
2259         //! \brief Explicit member initialization function
2260         AVP_INLOOP_FILTER_STATE_CMD();
2261 
2262         static const size_t dwSize = 15;
2263         static const size_t byteSize = 60;
2264     };
2265 
2266     //!
2267     //! \brief AVP_INTER_PRED_STATE
2268     //! \details
2269     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
2270     //!     all AVP Commands. Each AVP command has assigned a media instruction
2271     //!     command as defined in DWord 0, BitField 22:16.
2272     //!     AVP supports a 8-reference frames display buffer. But at any given frame
2273     //!     being decoded, only up to 7reference frames out of the 8 can be active.
2274     //!     There are also further constraints on which of these 7frames can be used
2275     //!     for forward and backward reference in the compound mode.
2276     //!     For each inter-codedtile, this command is issued only once.
2277     //!
2278     struct AVP_INTER_PRED_STATE_CMD
2279     {
2280         union
2281         {
2282             struct
2283             {
2284                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2285                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2286                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2287                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2288                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2289                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2290             };
2291             uint32_t                     Value;
2292         } DW0;
2293         union
2294         {
2295             struct
2296             {
2297                 uint32_t                 SavedOrderHintsForAllReferences00                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[0][0]
2298                 uint32_t                 SavedOrderHintsForAllReferences01                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[0][1]
2299                 uint32_t                 SavedOrderHintsForAllReferences02                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[0][2]
2300                 uint32_t                 SavedOrderHintsForAllReferences03                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[0][3]
2301             };
2302             uint32_t                     Value;
2303         } DW1;
2304         union
2305         {
2306             struct
2307             {
2308                 uint32_t                 SavedOrderHintsForAllReferences04                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[0][4]
2309                 uint32_t                 SavedOrderHintsForAllReferences05                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[0][5]
2310                 uint32_t                 SavedOrderHintsForAllReferences06                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[0][6]
2311                 uint32_t                 ActiveReferenceBitmaskForMotionFieldProjection   : __CODEGEN_BITFIELD(24, 31)    ; //!< Active Reference Bitmask for Motion Field Projection
2312             };
2313             uint32_t                     Value;
2314         } DW2;
2315         union
2316         {
2317             struct
2318             {
2319                 uint32_t                 SavedOrderHintsForAllReferences10                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[1][0]
2320                 uint32_t                 SavedOrderHintsForAllReferences11                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[1][1]
2321                 uint32_t                 SavedOrderHintsForAllReferences12                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[1][2]
2322                 uint32_t                 SavedOrderHintsForAllReferences13                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[1][3]
2323             };
2324             uint32_t                     Value;
2325         } DW3;
2326         union
2327         {
2328             struct
2329             {
2330                 uint32_t                 SavedOrderHintsForAllReferences14                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[1][4]
2331                 uint32_t                 SavedOrderHintsForAllReferences15                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[1][5]
2332                 uint32_t                 SavedOrderHintsForAllReferences16                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[1][6]
2333                 uint32_t                 Reserved152                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2334             };
2335             uint32_t                     Value;
2336         } DW4;
2337         union
2338         {
2339             struct
2340             {
2341                 uint32_t                 SavedOrderHintsForAllReferences20                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[2][0]
2342                 uint32_t                 SavedOrderHintsForAllReferences21                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[2][1]
2343                 uint32_t                 SavedOrderHintsForAllReferences22                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[2][2]
2344                 uint32_t                 SavedOrderHintsForAllReferences23                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[2][3]
2345             };
2346             uint32_t                     Value;
2347         } DW5;
2348         union
2349         {
2350             struct
2351             {
2352                 uint32_t                 SavedOrderHintsForAllReferences24                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[2][4]
2353                 uint32_t                 SavedOrderHintsForAllReferences25                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[2][5]
2354                 uint32_t                 SavedOrderHintsForAllReferences26                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[2][6]
2355                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2356             };
2357             uint32_t                     Value;
2358         } DW6;
2359         union
2360         {
2361             struct
2362             {
2363                 uint32_t                 SavedOrderHintsForAllReferences30                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[3][0]
2364                 uint32_t                 SavedOrderHintsForAllReferences31                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[3][1]
2365                 uint32_t                 SavedOrderHintsForAllReferences32                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[3][2]
2366                 uint32_t                 SavedOrderHintsForAllReferences33                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[3][3]
2367             };
2368             uint32_t                     Value;
2369         } DW7;
2370         union
2371         {
2372             struct
2373             {
2374                 uint32_t                 SavedOrderHintsForAllReferences34                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[3][4]
2375                 uint32_t                 SavedOrderHintsForAllReferences35                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[3][5]
2376                 uint32_t                 SavedOrderHintsForAllReferences36                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[3][6]
2377                 uint32_t                 Reserved280                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2378             };
2379             uint32_t                     Value;
2380         } DW8;
2381         union
2382         {
2383             struct
2384             {
2385                 uint32_t                 SavedOrderHintsForAllReferences40                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[4][0]
2386                 uint32_t                 SavedOrderHintsForAllReferences41                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[4][1]
2387                 uint32_t                 SavedOrderHintsForAllReferences42                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[4][2]
2388                 uint32_t                 SavedOrderHintsForAllReferences43                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[4][3]
2389             };
2390             uint32_t                     Value;
2391         } DW9;
2392         union
2393         {
2394             struct
2395             {
2396                 uint32_t                 SavedOrderHintsForAllReferences44                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[4][4]
2397                 uint32_t                 SavedOrderHintsForAllReferences45                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[4][5]
2398                 uint32_t                 SavedOrderHintsForAllReferences46                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[4][6]
2399                 uint32_t                 Reserved344                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2400             };
2401             uint32_t                     Value;
2402         } DW10;
2403         union
2404         {
2405             struct
2406             {
2407                 uint32_t                 SavedOrderHintsForAllReferences50                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[5][0]
2408                 uint32_t                 SavedOrderHintsForAllReferences51                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[5][1]
2409                 uint32_t                 SavedOrderHintsForAllReferences52                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[5][2]
2410                 uint32_t                 SavedOrderHintsForAllReferences53                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[5][3]
2411             };
2412             uint32_t                     Value;
2413         } DW11;
2414         union
2415         {
2416             struct
2417             {
2418                 uint32_t                 SavedOrderHintsForAllReferences54                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[5][4]
2419                 uint32_t                 SavedOrderHintsForAllReferences55                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[5][5]
2420                 uint32_t                 SavedOrderHintsForAllReferences56                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[5][6]
2421                 uint32_t                 Reserved408                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2422             };
2423             uint32_t                     Value;
2424         } DW12;
2425         union
2426         {
2427             struct
2428             {
2429                 uint32_t                 SavedOrderHintsForAllReferences60                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[6][0]
2430                 uint32_t                 SavedOrderHintsForAllReferences61                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[6][1]
2431                 uint32_t                 SavedOrderHintsForAllReferences62                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[6][2]
2432                 uint32_t                 SavedOrderHintsForAllReferences63                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[6][3]
2433             };
2434             uint32_t                     Value;
2435         } DW13;
2436         union
2437         {
2438             struct
2439             {
2440                 uint32_t                 SavedOrderHintsForAllReferences64                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[6][4]
2441                 uint32_t                 SavedOrderHintsForAllReferences65                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[6][5]
2442                 uint32_t                 SavedOrderHintsForAllReferences66                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[6][6]
2443                 uint32_t                 Reserved472                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2444             };
2445             uint32_t                     Value;
2446         } DW14;
2447 
2448         //! \name Local enumerations
2449 
2450         enum MEDIA_INSTRUCTION_COMMAND
2451         {
2452             MEDIA_INSTRUCTION_COMMAND_AVPINTERPREDSTATE                      = 18, //!< No additional details
2453         };
2454 
2455         //! \brief MEDIA_INSTRUCTION_OPCODE
2456         //! \details
2457         //!     Codec/Engine Name = AVP = 3h
2458         enum MEDIA_INSTRUCTION_OPCODE
2459         {
2460             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2461         };
2462 
2463         enum PIPELINE_TYPE
2464         {
2465             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2466         };
2467 
2468         enum COMMAND_TYPE
2469         {
2470             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2471         };
2472 
2473         //! \name Initializations
2474 
2475         //! \brief Explicit member initialization function
2476         AVP_INTER_PRED_STATE_CMD();
2477 
2478         static const size_t dwSize = 15;
2479         static const size_t byteSize = 60;
2480     };
2481 };
2482 
2483 #pragma pack()
2484 
2485 #endif  // __MHW_AVP_HWCMD_G12_H__