1 
2 /*===================== begin_copyright_notice ==================================
3 
4 # Copyright (c) 2021, Intel Corporation
5 
6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the "Software"),
8 # to deal in the Software without restriction, including without limitation
9 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 # and/or sell copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following conditions:
12 
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 # OTHER DEALINGS IN THE SOFTWARE.
23 
24 ======================= end_copyright_notice ==================================*/
25 //!
26 //! \file     mhw_vdbox_avp_hwcmd_xe_hpm.h
27 //! \brief    Auto-generated constructors for MHW and states.
28 //! \details  This file may not be included outside of g12_X as other components
29 //!           should use MHW interface to interact with MHW commands and states.
30 //!
31 
32 // DO NOT EDIT
33 
34 #ifndef __MHW_VDBOX_AVP_HWCMD_XE_HPM_H__
35 #define __MHW_VDBOX_AVP_HWCMD_XE_HPM_H__
36 
37 #include "mhw_hwcmd.h"
38 
39 #ifdef IGFX_AVP_INTERFACE_EXT_SUPPORT
40 #include "mhw_vdbox_avp_cmdpar_ext.h"
41 #endif
42 
43 #pragma once
44 #pragma pack(1)
45 
46 #include <cstdint>
47 #include <cstddef>
48 
49 namespace mhw
50 {
51 namespace vdbox
52 {
53 namespace avp
54 {
55 namespace xe_hpm
56 {
57 class Cmd
58 {
59 public:
60     virtual ~Cmd() = default;
61 
GetOpLength(uint32_t uiLength)62     static uint32_t GetOpLength(uint32_t uiLength) { return __CODEGEN_OP_LENGTH(uiLength); }
63 
64     //!
65     //! \brief MEMORYADDRESSATTRIBUTES
66     //! \details
67     //!     This field controls the priority of arbitration used in the GAC/GAM
68     //!     pipeline for this surface. It defines the attributes for VDBOX addresses
69     //!     on BDW+.
70     //!
71     struct MEMORYADDRESSATTRIBUTES_CMD
72     {
73         union
74         {
75             struct
76             {
77                 uint32_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0,  0)    ; //!< Reserved
78                 uint32_t                 BaseAddressIndexToMemoryObjectControlStateMocsTables : __CODEGEN_BITFIELD( 1,  6)    ; //!< Base Address - Index to Memory Object Control State (MOCS) Tables
79                 uint32_t                 BaseAddressArbitrationPriorityControl            : __CODEGEN_BITFIELD( 7,  8)    ; //!< Base Address - Arbitration Priority Control
80                 uint32_t                 BaseAddressMemoryCompressionEnable               : __CODEGEN_BITFIELD( 9,  9)    ; //!< Base Address - Memory Compression Enable
81                 uint32_t                 CompressionType                                  : __CODEGEN_BITFIELD(10, 10)    ; //!< COMPRESSION_TYPE
82                 uint32_t                 Reserved11                                       : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved
83                 uint32_t                 BaseAddressRowStoreScratchBufferCacheSelect      : __CODEGEN_BITFIELD(12, 12)    ; //!< BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
84                 uint32_t                 TileMode                                         : __CODEGEN_BITFIELD(13, 14)    ; //!< TILEMODE
85                 uint32_t                 Reserved15                                       : __CODEGEN_BITFIELD(15, 31)    ; //!< Reserved
86             };
87             uint32_t                     Value;
88         } DW0;
89 
90         //! \name Local enumerations
91 
92         //! \brief COMPRESSION_TYPE
93         //! \details
94         //!     Indicates if buffer is render/media compressed.
95         enum COMPRESSION_TYPE
96         {
97             COMPRESSION_TYPE_MEDIACOMPRESSIONENABLE                          = 0, //!< No additional details
98             COMPRESSION_TYPE_RENDERCOMPRESSIONENABLE                         = 1, //!< No additional details
99         };
100 
101         //! \brief BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
102         //! \details
103         //!     This field controls if the Row Store is going to store inside Media
104         //!     Cache (rowstore cache) or to LLC.
105         enum BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
106         {
107             BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED0      = 0, //!< Buffer going to LLC.
108             BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED1      = 1, //!< Buffer going to Internal Media Storage.
109         };
110 
111         enum TILEMODE
112         {
113             TILEMODE_LINEAR                                                  = 0, //!< No additional details
114             TILEMODE_TILES_64K                                               = 1, //!< No additional details
115             TILEMODE_TILEX                                                   = 2, //!< No additional details
116             TILEMODE_TILEF                                                   = 3, //!< No additional details
117         };
118 
119         //! \name Initializations
120 
121         //! \brief Explicit member initialization function
MEMORYADDRESSATTRIBUTES_CMDMEMORYADDRESSATTRIBUTES_CMD122         MEMORYADDRESSATTRIBUTES_CMD()
123         {
124             DW0.Value                                        = 0x00000000;
125             //DW0.CompressionType                              = COMPRESSION_TYPE_MEDIACOMPRESSIONENABLE;
126             //DW0.BaseAddressRowStoreScratchBufferCacheSelect  = BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED0;
127             //DW0.Tilemode                                     = TILEMODE_LINEAR;
128         }
129 
130         static const size_t dwSize = 1;
131         static const size_t byteSize = 4;
132     };
133 
134     //!
135     //! \brief SPLITBASEADDRESS4KBYTEALIGNED
136     //! \details
137     //!     Specifies a 64-bit (48-bit canonical) 4K-byte aligned memory base
138     //!     address. GraphicsAddress is a 64-bit value [63:0], but only a portion of
139     //!     it is used by hardware. The upper reserved bits are ignored and MBZ.
140     //!
141     struct SPLITBASEADDRESS4KBYTEALIGNED_CMD
142     {
143         union
144         {
145             struct
146             {
147                 uint64_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0, 11)    ; //!< Reserved
148                 uint64_t                 Graphicsaddress4712                              : __CODEGEN_BITFIELD(12, 47)    ; //!< GraphicsAddress47-12
149                 uint64_t                 Reserved48                                       : __CODEGEN_BITFIELD(48, 63)    ; //!< Reserved
150             };
151             uint32_t                     Value[2];
152         } DW0_1;
153 
154         //! \name Local enumerations
155 
156         //! \name Initializations
157 
158         //! \brief Explicit member initialization function
SPLITBASEADDRESS4KBYTEALIGNED_CMDSPLITBASEADDRESS4KBYTEALIGNED_CMD159         SPLITBASEADDRESS4KBYTEALIGNED_CMD()
160         {
161             DW0_1.Value[0] = DW0_1.Value[1]                  = 0x00000000;
162 
163         }
164 
165         static const size_t dwSize = 2;
166         static const size_t byteSize = 8;
167     };
168 
169     //!
170     //! \brief SPLITBASEADDRESS64BYTEALIGNED
171     //! \details
172     //!     Specifies a 64-bit (48-bit canonical) 64-byte aligned memory base
173     //!     address.
174     //!
175     struct SPLITBASEADDRESS64BYTEALIGNED_CMD
176     {
177         union
178         {
179             struct
180             {
181                 uint64_t                 Reserved0                                        : __CODEGEN_BITFIELD( 0,  5)    ; //!< Reserved
182                 uint64_t                 BaseAddress                                      : __CODEGEN_BITFIELD( 6, 47)    ; //!< GraphicsAddress47-6
183                 uint64_t                 Reserved48                                       : __CODEGEN_BITFIELD(48, 63)    ; //!< Reserved
184             };
185             uint32_t                     Value[2];
186         } DW0_1;
187 
188         //! \name Local enumerations
189 
190         //! \name Initializations
191 
192         //! \brief Explicit member initialization function
SPLITBASEADDRESS64BYTEALIGNED_CMDSPLITBASEADDRESS64BYTEALIGNED_CMD193         SPLITBASEADDRESS64BYTEALIGNED_CMD()
194         {
195             DW0_1.Value[0] = DW0_1.Value[1]                  = 0x00000000;
196 
197         }
198 
199         static const size_t dwSize = 2;
200         static const size_t byteSize = 8;
201     };
202 
203     //!
204     //! \brief AVP_BSD_OBJECT
205     //! \details
206     //!      The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
207     //!     all AVP Commands. Each AVP command has assigned a media instruction
208     //!     command as defined in DWord 0, BitField 22:16.
209     //!
210     //!     style="margin:0in 0in 7.5pt">The AVP_BSD_OBJECT command sends to HW a
211     //!     tile at a time from an AV1 bitstream, starting with the first coded byte
212     //!     of the tile, not including the prefixed tile byte size. The bit stream
213     //!     of a tile, tile group, and of a frame may end with trailing bits and
214     //!     extra padding zero bytes. The prefixed tile byte size includes all the
215     //!     trailing bits and padding zero bytes at the end of a tile.
216     //!     style="margin:0in 0in 7.5pt">Each tile's coded/compressed bitstream is
217     //!     started and ended at a byte boundary.
218     //!     style="margin:0in 0in 7.5pt">HW is not required to parse the trailing
219     //!     bits and padding zero bytes. HW can stop processing right after it has
220     //!     completed the decoding of the last block in the tile. Potentially, error
221     //!     checkng can be implemented to detect the trailing bits and padding
222     //!     zeros, but is not implemented in this generation of AVP Pipeline.
223     //!     style="margin:0in 0in 7.5pt">here can be multiple tiles in an AV1 frame
224     //!     and thus this command can be issued multiple times per frame. A coded
225     //!     frame minumum has at least 1 tile definition, i.e a tile can cover the
226     //!     entire frame, unless the frame size exceeds the max allowed tile size
227     //!     limits in pixels, then the frame must contain more than 1 tile.There is
228     //!     no compressed header in AV1, hence AVP_BSD_OBJECT command is only used
229     //!     to process the bitstream of each individual tile of a frame.
230     //!     style="margin:0in 0in 7.5pt; text-align:start;
231     //!     -webkit-text-stroke-width:0px">The AVP_BSD_OBJECT command must be the
232     //!     last command issued in the sequence of batch commands before the AVP
233     //!     Pipeline starts decoding. Prior to issuing this command, it is assumed
234     //!     that all configuration parameters needed by the AVP Pipeline have been
235     //!     loaded in a specific order,including workload configuration registers
236     //!     and configuration tables. When this command is issued, the AVP Pipeline
237     //!     is waiting for bitstream data to be presented to its bitstream input
238     //!     shift register.
239     //!
240     struct AVP_BSD_OBJECT_CMD
241     {
242         union
243         {
244             struct
245             {
246                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
247                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
248                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
249                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
250                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
251                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
252             };
253             uint32_t                     Value;
254         } DW0;
255         union
256         {
257             struct
258             {
259                 uint32_t                 TileIndirectBsdDataLength                                                        ; //!< Tile Indirect BSD Data Length
260             };
261             uint32_t                     Value;
262         } DW1;
263         union
264         {
265             struct
266             {
267                 uint32_t                 TileIndirectDataStartAddress                                                     ; //!< Tile Indirect Data Start Address
268             };
269             uint32_t                     Value;
270         } DW2;
271 
272         //! \name Local enumerations
273 
274         enum MEDIA_INSTRUCTION_COMMAND
275         {
276             MEDIA_INSTRUCTION_COMMAND_AVPBSDOBJECTSTATE                      = 32, //!< No additional details
277         };
278 
279         //! \brief MEDIA_INSTRUCTION_OPCODE
280         //! \details
281         //!     Codec/Engine Name = AV1 = 3h
282         enum MEDIA_INSTRUCTION_OPCODE
283         {
284             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
285         };
286 
287         enum PIPELINE_TYPE
288         {
289             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
290         };
291 
292         enum COMMAND_TYPE
293         {
294             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
295         };
296 
297         //! \name Initializations
298 
299         //! \brief Explicit member initialization function
AVP_BSD_OBJECT_CMDAVP_BSD_OBJECT_CMD300         AVP_BSD_OBJECT_CMD()
301         {
302             DW0.Value                                        = 0x71a00001;
303             //DW0.DwordLength                                  = GetOpLength(dwSize);
304             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPBSDOBJECTSTATE;
305             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
306             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
307             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
308 
309             DW1.Value                                        = 0x00000000;
310 
311             DW2.Value                                        = 0x00000000;
312 
313         }
314 
315         static const size_t dwSize = 3;
316         static const size_t byteSize = 12;
317     };
318 
319     //!
320     //! \brief AVP_PIC_STATE
321     //! \details
322     //!     All AVP_PIC_STATE should stay the same for the whole frame even if
323     //!     AVP_PIC_STATE is re-programmed for every tiles.
324     //!     The bitfields of AVP_PIC_STATE are defined either from
325     //!     1) syntax elements of the uncompressed sequence header (received from
326     //!     sequence_header_obu) and of the uncompressed frame header (received from
327     //!     frame_header_obu),
328     //!     2) or, parameters derived from 1).
329     //!     Note : Bitstreams may contain several copies of the frame header (there
330     //!     can only be one frame_header_obu, but multiple
331     //!     redundant_frame_header_obu)interspersed with tile_group_obu to allow for
332     //!     greater error resilience. However, the copies must contain identical
333     //!     contents to the original frame_header_obu.
334     //!     Note : there should be only one sequence_header_obu per video sequence.
335     //!     Note : AVP pipeline is invoked to decode a frame from the bitstream,
336     //!     only if that frame has show_existing_frame flag (syntax element in the
337     //!     frame header) set to 0. For the case thatshow_existing_frame flag is set
338     //!     to 1, application and driver process the frame instead, no block level
339     //!     decoding is needed.
340     //!     Note : Unlike VP9, AV1 does not have a compressed header. All the syntax
341     //!     elements defined in the AV1 sequence and frame level headers are not
342     //!     arithmetic coded, hence application and driver can directly read them
343     //!     off from the bitstream. If encryption is ON, then only application can
344     //!     parse the sequence and frame headers.
345     //!     Note : the values of the sequence header/level syntax elements and their
346     //!     derived parameters are to last throughout all frames in the video
347     //!     sequence, until the next Sequence Header OBU is received that may change
348     //!     them. But some sequence header/level syntax elements or their derived
349     //!     parameters may further qualified by frame header/level syntax elements
350     //!     and their derived parameters, then these type of syntax elements and
351     //!     their derived parameters can be changed frame to frame.
352     //!     Note : the values of the frame header/level syntax elements and their
353     //!     derived parameters can be changed from frame to frame.
354     //!     Note : there are some syntax elements and their derived parameters can
355     //!     be changed only at KEY FRAME. Hence, the values of these type of syntax
356     //!     elements and their derived parameters can last for the entire GOP, i.e.
357     //!     until the next KEY FRAME that may change them.
358     //!     Note : there is no separate profile for Still Picture. Still Picture is
359     //!     coded and decoded as a KEY FRAME, with all coding tools supported
360     //!     (tiling, all post in-loop filters, film grain injection, monochrome,
361     //!     intraBC, palette prediction mode, etc.). There is no restriction in
362     //!     coding Still Picture as a KEY FRAME.
363     //!
364     struct AVP_PIC_STATE_CMD
365     {
366         union
367         {
368             struct
369             {
370                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
371                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
372                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
373                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
374                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
375                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
376             };
377             uint32_t                     Value;
378         } DW0;
379         union
380         {
381             struct
382             {
383                 uint32_t                 FrameWidthInPixelMinus1                          : __CODEGEN_BITFIELD( 0, 15)    ; //!< Frame Width In Pixel Minus 1
384                 uint32_t                 FrameHeightInPixelMinus1                         : __CODEGEN_BITFIELD(16, 31)    ; //!< Frame Height In Pixel Minus 1
385             };
386             uint32_t                     Value;
387         } DW1;
388         union
389         {
390             struct
391             {
392                 uint32_t                 SequenceChromaSubsamplingFormat                  : __CODEGEN_BITFIELD( 0,  1)    ; //!< SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
393                 uint32_t                 Reserved66                                       : __CODEGEN_BITFIELD( 2,  2)    ; //!< Reserved (for expansion of Chroma SubSampling Format)
394                 uint32_t                 SequencePixelBitDepthIdc                         : __CODEGEN_BITFIELD( 3,  4)    ; //!< Sequence Pixel Bit-Depth Idc
395                 uint32_t                 Reserved69                                       : __CODEGEN_BITFIELD( 5,  6)    ; //!< Reserved (for expansion of Sequence Pixel Bit-Depth Idc)
396                 uint32_t                 SequenceSuperblockSizeUsed                       : __CODEGEN_BITFIELD( 7,  8)    ; //!< Sequence Superblock Size Used
397                 uint32_t                 SequenceEnableOrderHintFlag                      : __CODEGEN_BITFIELD( 9,  9)    ; //!< Sequence Enable Order Hint Flag
398                 uint32_t                 SequenceOrderHintBitsMinus1                      : __CODEGEN_BITFIELD(10, 12)    ; //!< Sequence Order Hint Bits Minus1
399                 uint32_t                 Reserved77                                       : __CODEGEN_BITFIELD(13, 15)    ; //!< Reserved (for the expansion of Sequence Order Hint Bits Minus1)
400                 uint32_t                 SequenceEnableFilterIntraFlag                    : __CODEGEN_BITFIELD(16, 16)    ; //!< Sequence Enable Filter_Intra Flag
401                 uint32_t                 SequenceEnableIntraEdgeFilterFlag                : __CODEGEN_BITFIELD(17, 17)    ; //!< Sequence Enable Intra Edge Filter Flag
402                 uint32_t                 SequenceEnableDualFilterFlag                     : __CODEGEN_BITFIELD(18, 18)    ; //!< Sequence Enable Dual_Filter Flag
403                 uint32_t                 SequenceEnableInterIntraCompoundFlag             : __CODEGEN_BITFIELD(19, 19)    ; //!< Sequence Enable Inter-Intra Compound Flag
404                 uint32_t                 SequenceEnableMaskedCompoundFlag                 : __CODEGEN_BITFIELD(20, 20)    ; //!< Sequence Enable Masked Compound Flag
405                 uint32_t                 SequenceEnableJointCompoundFlag                  : __CODEGEN_BITFIELD(21, 21)    ; //!< Sequence Enable Joint Compound Flag
406                 uint32_t                 TailPresentFlag                                  : __CODEGEN_BITFIELD(22, 22)    ; //!< Tail Present Flag
407                 uint32_t                 HeaderPresentFlag                                : __CODEGEN_BITFIELD(23, 23)    ; //!< Header Present Flag
408                 uint32_t                 EnableBistreamStitchingInHardware                : __CODEGEN_BITFIELD(24, 24)    ; //!< Enable Bistream Stitching in hardware
409                 uint32_t                 Reserved89                                       : __CODEGEN_BITFIELD(25, 31)    ; //!< Reserved
410             };
411             uint32_t                     Value;
412         } DW2;
413         union
414         {
415             struct
416             {
417                 uint32_t                 AllowScreenContentToolsFlag                      : __CODEGEN_BITFIELD( 0,  0)    ; //!< Allow Screen Content Tools Flag
418                 uint32_t                 ForceIntegerMvFlag                               : __CODEGEN_BITFIELD( 1,  1)    ; //!< Force Integer MV Flag
419                 uint32_t                 AllowWarpedMotionFlag                            : __CODEGEN_BITFIELD( 2,  2)    ; //!< Allow Warped Motion Flag
420                 uint32_t                 Reserved99                                       : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved
421                 uint32_t                 UseCdefFilterFlag                                : __CODEGEN_BITFIELD( 4,  4)    ; //!< Use CDEF Filter Flag
422                 uint32_t                 UseSuperResFlag                                  : __CODEGEN_BITFIELD( 5,  5)    ; //!< Use Super-Res Flag
423                 uint32_t                 FrameLevelLoopRestorationFilterEnableFlag        : __CODEGEN_BITFIELD( 6,  6)    ; //!< Frame Level Loop Restoration Filter Enable Flag
424                 uint32_t                 ApplyFilmGrainFlag                               : __CODEGEN_BITFIELD( 7,  7)    ; //!< Apply Film Grain Flag
425                 uint32_t                 LargeScaleTileEnableFlag                         : __CODEGEN_BITFIELD( 8,  8)    ; //!< Large Scale Tile Enable Flag
426                 uint32_t                 Reserved105                                      : __CODEGEN_BITFIELD( 9, 13)    ; //!< Reserved
427                 uint32_t                 PostCdefFilteredReconPixelsWriteoutEn            : __CODEGEN_BITFIELD(14, 14)    ; //!< Post CDEF Filtered Recon Pixels Writeout En
428                 uint32_t                 PostWienerFilteredPixelStreamoutEn               : __CODEGEN_BITFIELD(15, 15)    ; //!< Post Wiener Filtered Pixel Streamout En
429                 uint32_t                 FrameType                                        : __CODEGEN_BITFIELD(16, 17)    ; //!< Frame Type
430                 uint32_t                 Reserved114                                      : __CODEGEN_BITFIELD(18, 18)    ; //!< Reserved (for the expansion of Frame Type)
431                 uint32_t                 IntraonlyFlag                                    : __CODEGEN_BITFIELD(19, 19)    ; //!< IntraOnly Flag
432                 uint32_t                 Reserved116                                      : __CODEGEN_BITFIELD(20, 21)    ; //!< Reserved
433                 uint32_t                 ErrorResilientModeFlag                           : __CODEGEN_BITFIELD(22, 22)    ; //!< ERROR_RESILIENT_MODE_FLAG
434                 uint32_t                 AllowIntrabcFlag                                 : __CODEGEN_BITFIELD(23, 23)    ; //!< Allow IntraBC Flag
435                 uint32_t                 Reserved120                                      : __CODEGEN_BITFIELD(24, 27)    ; //!< Reserved
436                 uint32_t                 PrimaryReferenceFrameIdx                         : __CODEGEN_BITFIELD(28, 30)    ; //!< Primary Reference Frame Idx
437                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved (for future expansion of Primary Reference Frame Idx)
438             };
439             uint32_t                     Value;
440         } DW3;
441         union
442         {
443             struct
444             {
445                 uint32_t                 SegmentationEnableFlag                           : __CODEGEN_BITFIELD( 0,  0)    ; //!< SEGMENTATION_ENABLE_FLAG
446                 uint32_t                 SegmentationUpdateMapFlag                        : __CODEGEN_BITFIELD( 1,  1)    ; //!< Segmentation Update Map Flag
447                 uint32_t                 SegmentationTemporalUpdateFlag                   : __CODEGEN_BITFIELD( 2,  2)    ; //!< SEGMENTATION_TEMPORAL_UPDATE_FLAG
448                 uint32_t                 PreSkipSegmentIdFlag                             : __CODEGEN_BITFIELD( 3,  3)    ; //!< Pre-Skip Segment ID Flag
449                 uint32_t                 LastActiveSegmentId                              : __CODEGEN_BITFIELD( 4,  6)    ; //!< Last Active Segment ID
450                 uint32_t                 DeltaQPresentFlag                                : __CODEGEN_BITFIELD( 7,  7)    ; //!< Delta Q Present Flag
451                 uint32_t                 DeltaQRes                                        : __CODEGEN_BITFIELD( 8,  9)    ; //!< Delta Q RES
452                 uint32_t                 FrameCodedLosslessMode                           : __CODEGEN_BITFIELD(10, 10)    ; //!< FRAME_CODED_LOSSLESS_MODE
453                 uint32_t                 SegmentMapIsZeroFlag                             : __CODEGEN_BITFIELD(11, 11)    ; //!< Segment Map Is Zero Flag
454                 uint32_t                 SegmentIdBufferStreamInEnableFlag                : __CODEGEN_BITFIELD(12, 12)    ; //!< Segment ID Buffer Stream-In Enable Flag
455                 uint32_t                 SegmentIdBufferStreamOutEnableFlag               : __CODEGEN_BITFIELD(13, 13)    ; //!< Segment ID Buffer Stream-Out Enable Flag
456                 uint32_t                 Reserved142                                      : __CODEGEN_BITFIELD(14, 15)    ; //!< Reserved
457                 uint32_t                 BaseQindex                                       : __CODEGEN_BITFIELD(16, 23)    ; //!< Base Qindex
458                 uint32_t                 YDcDeltaQ                                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Y_dc_delta_q
459                 uint32_t                 Reserved159                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
460             };
461             uint32_t                     Value;
462         } DW4;
463         union
464         {
465             struct
466             {
467                 uint32_t                 UDcDeltaQ                                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< U_dc_delta_q
468                 uint32_t                 Reserved167                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
469                 uint32_t                 UAcDeltaQ                                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< U_ac_delta_q
470                 uint32_t                 Reserved175                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
471                 uint32_t                 VDcDeltaQ                                        : __CODEGEN_BITFIELD(16, 22)    ; //!< V_dc_delta_q
472                 uint32_t                 Reserved183                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
473                 uint32_t                 VAcDeltaQ                                        : __CODEGEN_BITFIELD(24, 30)    ; //!< V_ac_delta_q
474                 uint32_t                 Reserved191                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
475             };
476             uint32_t                     Value;
477         } DW5;
478         union
479         {
480             struct
481             {
482                 uint32_t                 AllowHighPrecisionMv                             : __CODEGEN_BITFIELD( 0,  0)    ; //!< Allow High Precision MV
483                 uint32_t                 FrameLevelReferenceModeSelect                    : __CODEGEN_BITFIELD( 1,  1)    ; //!< Frame Level Reference Mode Select
484                 uint32_t                 McompFilterType                                  : __CODEGEN_BITFIELD( 2,  4)    ; //!< MCOMP_FILTER_TYPE
485                 uint32_t                 Reserved197                                      : __CODEGEN_BITFIELD( 5,  5)    ; //!< Reserved (for future expansion of Mcomp Filter Type)
486                 uint32_t                 MotionModeSwitchableFlag                         : __CODEGEN_BITFIELD( 6,  6)    ; //!< Motion Mode Switchable Flag
487                 uint32_t                 UseReferenceFrameMvSetFlag                       : __CODEGEN_BITFIELD( 7,  7)    ; //!< Use Reference Frame MV Set Flag
488                 uint32_t                 ReferenceFrameSignBiasI0To7                      : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Sign Bias [i=0 to 7]
489                 uint32_t                 CurrentFrameOrderHint                            : __CODEGEN_BITFIELD(16, 23)    ; //!< Current Frame Order Hint
490                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved (for future expansion of Frame Order Hint)
491             };
492             uint32_t                     Value;
493         } DW6;
494         union
495         {
496             struct
497             {
498                 uint32_t                 ReducedTxSetUsed                                 : __CODEGEN_BITFIELD( 0,  0)    ; //!< Reduced Tx Set Used
499                 uint32_t                 FrameTransformMode                               : __CODEGEN_BITFIELD( 1,  2)    ; //!< Frame Transform Mode
500                 uint32_t                 Reserved227                                      : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved
501                 uint32_t                 SkipModePresentFlag                              : __CODEGEN_BITFIELD( 4,  4)    ; //!< Skip Mode Present Flag
502                 uint32_t                 SkipModeFrame0                                   : __CODEGEN_BITFIELD( 5,  7)    ; //!< Skip Mode Frame [0]
503                 uint32_t                 Reserved232                                      : __CODEGEN_BITFIELD( 8,  8)    ; //!< Reserved (for future expansion of Skip Mode Frame[0])
504                 uint32_t                 SkipModeFrame1                                   : __CODEGEN_BITFIELD( 9, 11)    ; //!< Skip Mode Frame [1]
505                 uint32_t                 Reserved236                                      : __CODEGEN_BITFIELD(12, 23)    ; //!< Reserved (for future expansion of Skip Mode Frame[1])
506                 uint32_t                 ReferenceFrameSideI0To7                          : __CODEGEN_BITFIELD(24, 31)    ; //!< ref_frame_side for the 8 reference frames INTRA...ALTREF
507             };
508             uint32_t                     Value;
509         } DW7;
510         union
511         {
512             struct
513             {
514                 uint32_t                 Reserved256                                      : __CODEGEN_BITFIELD( 0,  2)    ; //!< Reserved (for future expansion of Global Motion Type[0])
515                 uint32_t                 GlobalMotionType1                                : __CODEGEN_BITFIELD( 3,  4)    ; //!< Global Motion Type[1]
516                 uint32_t                 Reserved261                                      : __CODEGEN_BITFIELD( 5,  5)    ; //!< Reserved (for future expansion of Global Motion Type[1]
517                 uint32_t                 GlobalMotionType2                                : __CODEGEN_BITFIELD( 6,  7)    ; //!< Global Motion Type[2]
518                 uint32_t                 Reserved264                                      : __CODEGEN_BITFIELD( 8,  8)    ; //!< Reserved (for future expansion of Global Motion Type[2]
519                 uint32_t                 GlobalMotionType3                                : __CODEGEN_BITFIELD( 9, 10)    ; //!< Global Motion Type[3]
520                 uint32_t                 Reserved267                                      : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved (for future expansion of Global Motion Type[3]
521                 uint32_t                 GlobalMotionType4                                : __CODEGEN_BITFIELD(12, 13)    ; //!< Global Motion Type[4]
522                 uint32_t                 Reserved270                                      : __CODEGEN_BITFIELD(14, 14)    ; //!< Reserved (for future expansion of Global Motion Type[4]
523                 uint32_t                 GlobalMotionType5                                : __CODEGEN_BITFIELD(15, 16)    ; //!< Global Motion Type[5]
524                 uint32_t                 Reserved273                                      : __CODEGEN_BITFIELD(17, 17)    ; //!< Reserved (for future expansion of Global Motion Type[5]
525                 uint32_t                 GlobalMotionType6                                : __CODEGEN_BITFIELD(18, 19)    ; //!< Global Motion Type[6]
526                 uint32_t                 Reserved276                                      : __CODEGEN_BITFIELD(20, 20)    ; //!< Reserved (for future expansion of Global Motion Type[6]
527                 uint32_t                 GlobalMotionType7                                : __CODEGEN_BITFIELD(21, 22)    ; //!< Global Motion Type[7]
528                 uint32_t                 Reserved279                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved (for future expansion of Global Motion Type[7]
529                 uint32_t                 FrameLevelGlobalMotionInvalidFlags               : __CODEGEN_BITFIELD(24, 31)    ; //!< Frame Level Global Motion Invalid Flags
530             };
531             uint32_t                     Value;
532         } DW8;
533         uint32_t                                 WarpParametersArrayReference1To7Projectioncoeff0To5[21];                 //!< Warp Parameters Array [Reference=1 to 7][ProjectionCoeff=0 to 5]
534         union
535         {
536             struct
537             {
538                 uint32_t                 ReferenceFrameIdx0                               : __CODEGEN_BITFIELD( 0,  2)    ; //!< Reference Frame Idx[0]
539                 uint32_t                 Reserved963                                      : __CODEGEN_BITFIELD( 3,  3)    ; //!< Reserved (for future expansion of reference frame idx0)
540                 uint32_t                 ReferenceFrameIdx1                               : __CODEGEN_BITFIELD( 4,  6)    ; //!< Reference Frame Idx[1]
541                 uint32_t                 Reserved967                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved (for future expansion of reference frame idx1)
542                 uint32_t                 ReferenceFrameIdx2                               : __CODEGEN_BITFIELD( 8, 10)    ; //!< Reference Frame Idx[2]
543                 uint32_t                 Reserved971                                      : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved (for future expansion of reference frame idx2)
544                 uint32_t                 ReferenceFrameIdx3                               : __CODEGEN_BITFIELD(12, 14)    ; //!< Reference Frame Idx[3]
545                 uint32_t                 Reserved975                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved (for future expansion of reference frame idx3)
546                 uint32_t                 ReferenceFrameIdx4                               : __CODEGEN_BITFIELD(16, 18)    ; //!< Reference Frame Idx[4]
547                 uint32_t                 Reserved979                                      : __CODEGEN_BITFIELD(19, 19)    ; //!< Reserved (for future expansion of reference frame idx4)
548                 uint32_t                 ReferenceFrameIdx5                               : __CODEGEN_BITFIELD(20, 22)    ; //!< Reference Frame Idx[5]
549                 uint32_t                 Reserved983                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved (for future expansion of reference frame idx5)
550                 uint32_t                 ReferenceFrameIdx6                               : __CODEGEN_BITFIELD(24, 26)    ; //!< Reference Frame Idx[6]
551                 uint32_t                 Reserved987                                      : __CODEGEN_BITFIELD(27, 27)    ; //!< Reserved (for future expansion of reference frame idx6)
552                 uint32_t                 ReferenceFrameIdx7                               : __CODEGEN_BITFIELD(28, 30)    ; //!< Reference Frame Idx[7]
553                 uint32_t                 Reserved991                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved (for future expansion of reference frame idx7)
554             };
555             uint32_t                     Value;
556         } DW30;
557         union
558         {
559             struct
560             {
561                 uint32_t                 IntraFrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Intra Frame Width In Pixel Minus 1
562                 uint32_t                 IntraFrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Intra Frame Height In Pixel Minus 1
563             };
564             uint32_t                     Value;
565         } DW31;
566         union
567         {
568             struct
569             {
570                 uint32_t                 LastFrameWidthInPixelMinus1                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last Frame Width In Pixel Minus 1
571                 uint32_t                 LastFrameHeightInPixelMinus1                     : __CODEGEN_BITFIELD(16, 31)    ; //!< Last Frame Height In Pixel Minus 1
572             };
573             uint32_t                     Value;
574         } DW32;
575         union
576         {
577             struct
578             {
579                 uint32_t                 Last2FrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last2 Frame Width In Pixel Minus 1
580                 uint32_t                 Last2FrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Last2 Frame Height In Pixel Minus 1
581             };
582             uint32_t                     Value;
583         } DW33;
584         union
585         {
586             struct
587             {
588                 uint32_t                 Last3FrameWidthInPixelMinus1                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Last3 Frame Width In Pixel Minus 1
589                 uint32_t                 Last3FrameHeightInPixelMinus1                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Last3 Frame Height In Pixel Minus 1
590             };
591             uint32_t                     Value;
592         } DW34;
593         union
594         {
595             struct
596             {
597                 uint32_t                 GoldenFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< Golden Frame Width In Pixel Minus 1
598                 uint32_t                 GoldenFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Golden Frame Height In Pixel Minus 1
599             };
600             uint32_t                     Value;
601         } DW35;
602         union
603         {
604             struct
605             {
606                 uint32_t                 BwdrefFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< BWDREF Frame Width In Pixel Minus 1
607                 uint32_t                 BwdrefFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< BWDREF Frame Height In Pixel Minus 1
608             };
609             uint32_t                     Value;
610         } DW36;
611         union
612         {
613             struct
614             {
615                 uint32_t                 Altref2FrameWidthInPixelMinus1                   : __CODEGEN_BITFIELD( 0, 15)    ; //!< ALTREF2 Frame Width In Pixel Minus 1
616                 uint32_t                 Altref2FrameHeightInPixelMinus1                  : __CODEGEN_BITFIELD(16, 31)    ; //!< ALTREF2 Frame Height In Pixel Minus 1
617             };
618             uint32_t                     Value;
619         } DW37;
620         union
621         {
622             struct
623             {
624                 uint32_t                 AltrefFrameWidthInPixelMinus1                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< ALTREF Frame Width In Pixel Minus 1
625                 uint32_t                 AltrefFrameHeightInPixelMinus1                   : __CODEGEN_BITFIELD(16, 31)    ; //!< ALTREF Frame Height In Pixel Minus 1
626             };
627             uint32_t                     Value;
628         } DW38;
629         union
630         {
631             struct
632             {
633                 uint32_t                 VerticalScaleFactorForIntra                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for INTRA
634                 uint32_t                 HorizontalScaleFactorForIntra                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for INTRA
635             };
636             uint32_t                     Value;
637         } DW39;
638         union
639         {
640             struct
641             {
642                 uint32_t                 VerticalScaleFactorForLast                       : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST
643                 uint32_t                 HorizontalScaleFactorForLast                     : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST
644             };
645             uint32_t                     Value;
646         } DW40;
647         union
648         {
649             struct
650             {
651                 uint32_t                 VerticalScaleFactorForLast2                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST2
652                 uint32_t                 HorizontalScaleFactorForLast2                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST2
653             };
654             uint32_t                     Value;
655         } DW41;
656         union
657         {
658             struct
659             {
660                 uint32_t                 VerticalScaleFactorForLast3                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for LAST3
661                 uint32_t                 HorizontalScaleFactorForLast3                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for LAST3
662             };
663             uint32_t                     Value;
664         } DW42;
665         union
666         {
667             struct
668             {
669                 uint32_t                 VerticalScaleFactorForGolden                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for GOLDEN
670                 uint32_t                 HorizontalScaleFactorForGolden                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for GOLDEN
671             };
672             uint32_t                     Value;
673         } DW43;
674         union
675         {
676             struct
677             {
678                 uint32_t                 VerticalScaleFactorForBwdrefFrame                : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for BWDREF_FRAME
679                 uint32_t                 HorizontalScaleFactorForBwdrefFrame              : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for BWDREF_FRAME
680             };
681             uint32_t                     Value;
682         } DW44;
683         union
684         {
685             struct
686             {
687                 uint32_t                 VerticalScaleFactorForAltref2                    : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for ALTREF2
688                 uint32_t                 HorizontalScaleFactorForAltref2                  : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for ALTREF2
689             };
690             uint32_t                     Value;
691         } DW45;
692         union
693         {
694             struct
695             {
696                 uint32_t                 VerticalScaleFactorForAltref                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Vertical Scale Factor for ALTREF
697                 uint32_t                 HorizontalScaleFactorForAltref                   : __CODEGEN_BITFIELD(16, 31)    ; //!< Horizontal Scale Factor for ALTREF
698             };
699             uint32_t                     Value;
700         } DW46;
701         union
702         {
703             struct
704             {
705                 uint32_t                 ReferenceFrameOrderHint0ForIntraFrame            : __CODEGEN_BITFIELD( 0,  7)    ; //!< Reference Frame Order Hint [0] for Intra Frame
706                 uint32_t                 ReferenceFrameOrderHint1ForLastFrame             : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Order Hint [1] for Last Frame
707                 uint32_t                 ReferenceFrameOrderHint2ForLast2Frame            : __CODEGEN_BITFIELD(16, 23)    ; //!< Reference Frame Order Hint [2] for Last2 Frame
708                 uint32_t                 ReferenceFrameOrderHint3ForLast3Frame            : __CODEGEN_BITFIELD(24, 31)    ; //!< Reference Frame Order Hint [3] for Last3 Frame
709             };
710             uint32_t                     Value;
711         } DW47;
712         union
713         {
714             struct
715             {
716                 uint32_t                 ReferenceFrameOrderHint4ForGoldenFrame           : __CODEGEN_BITFIELD( 0,  7)    ; //!< Reference Frame Order Hint [4] for Golden Frame
717                 uint32_t                 ReferenceFrameOrderHint5ForBwdrefFrame           : __CODEGEN_BITFIELD( 8, 15)    ; //!< Reference Frame Order Hint [5] for BWDREF Frame
718                 uint32_t                 ReferenceFrameOrderHint6ForAltref2Frame          : __CODEGEN_BITFIELD(16, 23)    ; //!< Reference Frame Order Hint [6] for ALTREF2 Frame
719                 uint32_t                 ReferenceFrameOrderHint7ForAltrefFrame           : __CODEGEN_BITFIELD(24, 31)    ; //!< Reference Frame Order Hint [7] for ALTREF Frame
720             };
721             uint32_t                     Value;
722         } DW48;
723         union
724         {
725             struct
726             {
727                 uint32_t                 Reserved1568                                                                     ; //!< Reserved
728             };
729             uint32_t                     Value;
730         } DW49;
731         union
732         {
733             struct
734             {
735                 uint32_t                 Reserved1600                                                                     ; //!< Reserved
736             };
737             uint32_t                     Value;
738         } DW50;
739         union
740         {
741             struct
742             {
743                 uint32_t                 Reserved1632                                     : __CODEGEN_BITFIELD( 0, 15)    ; //!< Reserved
744                 uint32_t                 Nonfirstpassflag                                 : __CODEGEN_BITFIELD(16, 16)    ; //!< NONFIRSTPASSFLAG
745                 uint32_t                 VdencPakOnlyPass                                 : __CODEGEN_BITFIELD(17, 17)    ; //!< VDENC PAK_ONLY  PASS
746                 uint32_t                 Reserved1650                                     : __CODEGEN_BITFIELD(18, 24)    ; //!< Reserved
747                 uint32_t                 FrameszoverstatusenFramebitratemaxreportmask     : __CODEGEN_BITFIELD(25, 25)    ; //!< FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK
748                 uint32_t                 FrameszunderstatusenFramebitrateminreportmask    : __CODEGEN_BITFIELD(26, 26)    ; //!< FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK
749                 uint32_t                 Reserved1659                                     : __CODEGEN_BITFIELD(27, 31)    ; //!< Reserved
750             };
751             uint32_t                     Value;
752         } DW51;
753         union
754         {
755             struct
756             {
757                 uint32_t                 Framebitratemax                                  : __CODEGEN_BITFIELD( 0, 13)    ; //!< FrameBitRateMax
758                 uint32_t                 Reserved1678                                     : __CODEGEN_BITFIELD(14, 30)    ; //!< Reserved
759                 uint32_t                 Framebitratemaxunit                              : __CODEGEN_BITFIELD(31, 31)    ; //!< FRAMEBITRATEMAXUNIT
760             };
761             uint32_t                     Value;
762         } DW52;
763         union
764         {
765             struct
766             {
767                 uint32_t                 Framebitratemin                                  : __CODEGEN_BITFIELD( 0, 13)    ; //!< FrameBitRateMin
768                 uint32_t                 Reserved1710                                     : __CODEGEN_BITFIELD(14, 30)    ; //!< Reserved
769                 uint32_t                 Framebitrateminunit                              : __CODEGEN_BITFIELD(31, 31)    ; //!< FRAMEBITRATEMINUNIT
770             };
771             uint32_t                     Value;
772         } DW53;
773         union
774         {
775             struct
776             {
777                 uint64_t                 Framedeltaqindexmax                                                              ; //!< FrameDeltaQindexMax
778             };
779             uint32_t                     Value[2];
780         } DW54_55;
781         union
782         {
783             struct
784             {
785                 uint32_t                 Framedeltaqindexmin                                                              ; //!< FrameDeltaQindexMin
786             };
787             uint32_t                     Value;
788         } DW56;
789         union
790         {
791             struct
792             {
793                 uint64_t                 Framedeltalfmax                                                                  ; //!< FrameDeltaLFMax
794             };
795             uint32_t                     Value[2];
796         } DW57_58;
797         union
798         {
799             struct
800             {
801                 uint32_t                 Framedeltalfmin                                                                  ; //!< FrameDeltaLFMin
802             };
803             uint32_t                     Value;
804         } DW59;
805         union
806         {
807             struct
808             {
809                 uint64_t                 Framedeltaqindexlfmaxrange                                                       ; //!< FrameDeltaQindexLFMaxRange
810             };
811             uint32_t                     Value[2];
812         } DW60_61;
813         union
814         {
815             struct
816             {
817                 uint32_t                 Framedeltaqindexlfminrange                                                       ; //!< FrameDeltaQindexLFMinRange
818             };
819             uint32_t                     Value;
820         } DW62;
821         union
822         {
823             struct
824             {
825                 uint32_t                 Minframsize                                      : __CODEGEN_BITFIELD( 0, 15)    ; //!< MinFramSize
826                 uint32_t                 Reserved2032                                     : __CODEGEN_BITFIELD(16, 29)    ; //!< Reserved
827                 uint32_t                 Minframesizeunits                                : __CODEGEN_BITFIELD(30, 31)    ; //!< MINFRAMESIZEUNITS
828             };
829             uint32_t                     Value;
830         } DW63;
831         union
832         {
833             struct
834             {
835                 uint32_t                 Bitoffsetforfirstpartitionsize                   : __CODEGEN_BITFIELD( 0, 15)    ; //!< BitOffsetForFirstPartitionSize
836                 uint32_t                 Reserved2064                                     : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved
837             };
838             uint32_t                     Value;
839         } DW64;
840         union
841         {
842             struct
843             {
844                 uint32_t                 Class0SseThreshold0                              : __CODEGEN_BITFIELD( 0, 15)    ; //!< Class0_SSE_Threshold0
845                 uint32_t                 Class0SseThreshold1                              : __CODEGEN_BITFIELD(16, 31)    ; //!< Class0_SSE_Threshold1
846             };
847             uint32_t                     Value;
848         } DW65;
849         uint32_t                                 SseThresholdsForClass18[8];                                              //!< SSE thresholds for Class1-8
850         union
851         {
852             struct
853             {
854                 uint32_t                 Rdmult                                                                           ; //!< rdmult
855             };
856             uint32_t                     Value;
857         } DW74;
858         union
859         {
860             struct
861             {
862                 uint32_t                 SbMaxBitsizeallowed                              : __CODEGEN_BITFIELD( 0, 17)    ; //!< SB Max BitSizeAllowed
863                 uint32_t                 Reserved2418                                     : __CODEGEN_BITFIELD(18, 19)    ; //!< Reserved
864                 uint32_t                 SbmaxbitstatusenSbmaxsizereportmask              : __CODEGEN_BITFIELD(20, 20)    ; //!< SBMaxBitStatusEn - SBMaxSizeReportMask
865                 uint32_t                 Reserved2421                                     : __CODEGEN_BITFIELD(21, 31)    ; //!< Reserved
866             };
867             uint32_t                     Value;
868         } DW75;
869 
870         //! \name Local enumerations
871 
872         enum MEDIA_INSTRUCTION_COMMAND
873         {
874             MEDIA_INSTRUCTION_COMMAND_AVPPICSTATE                            = 48, //!< No additional details
875         };
876 
877         //! \brief MEDIA_INSTRUCTION_OPCODE
878         //! \details
879         //!     Codec/Engine Name = AVP = 3h
880         enum MEDIA_INSTRUCTION_OPCODE
881         {
882             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
883         };
884 
885         enum PIPELINE_TYPE
886         {
887             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
888         };
889 
890         enum COMMAND_TYPE
891         {
892             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
893         };
894 
895         //! \brief SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
896         //! \details
897         //!     It specifies the chroma subsampling format for all frames in the
898         //!     video sequence being decoded.
899         //!     [1:0] = 00 ; stands for Monochrome 4:0:0, no Chroma planes at all,
900         //!     but [subsampling_x and subsampling_y] is defaulted to [1, 1], as only
901         //!     Profile 0 can support monochrome video coding.
902         //!     [1:0] = 01 ; stands for 4:2:0, with[subsampling_x and subsampling_y]
903         //!     defining as[1, 1]. It is supported in all profiles (seq_profile=0, 1, 2
904         //!     - syntax element in the sequence header)
905         //!     [1:0] = 10 ; stands for 4:2:2, with[subsampling_x and subsampling_y]
906         //!     defining as[1, 0]. It is supported only in seq_profile=2.
907         //!     [1:0] = 11 ; stands for 4:4:4 with[subsampling_x and subsampling_y]
908         //!     defining as[0, 0]. It is supported in both seq_profile=1 and 2.
909         //!     It is a sequence-level parameter derived from the sequence header
910         //!     syntax elements: seq_profile, subsampling_x, subsampling_y, monochome,
911         //!     high_bitdepth and twelve_bit. Default is 1, i.e. 4:2:0..
912         //!     Note : AV1 supports 3 profiles:
913         //!     seq_profile Bit_depth Chroma Subsampling
914         //!     0 (Main Profile) 8 / 10 YUV 4:2:0 and 4:0:0
915         //!     1 (High Profile) 8 / 10 YUV 4:4:4 (4:0:0 is not allowed)
916         //!     2 (Pro Profile) 8 / 10 /12 YUV 4:2:2 AND
917         //!     12 YUV 4:2:0/4:4:4/4:0:0
918         //!     Note : for AV1 decoder:
919         //!     type="disc" style="margin-top:0in; margin-bottom:0in">
920         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
921         //!     font-family:Calibri, sans-serif">A profile 0 compliant decoder must be
922         //!     able to decode all bitstreams labeled profile 0
923 
924         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
925         //!     font-family:Calibri, sans-serif">A profile 1 compliant decoder must be
926         //!     able to decode all bitstreams labeled profile 0 or 1
927 
928         //!     style="margin:0in 0in 0.0001pt; font-size:11pt;
929         //!     font-family:Calibri, sans-serif">A profile 2 compliant decoder must be
930         //!     able to decode all bitstreams labeled profile 0, 1, or 2
931 
932         //!
933         enum SEQUENCE_CHROMA_SUBSAMPLING_FORMAT
934         {
935             SEQUENCE_CHROMA_SUBSAMPLING_FORMAT_400MONOCHROME                 = 0, //!< Chroma Sampling 4:0:0 Monochrome
936             SEQUENCE_CHROMA_SUBSAMPLING_FORMAT_420                           = 1, //!< Chroma Sampling 4:2:0
937         };
938 
939         //! \brief ERROR_RESILIENT_MODE_FLAG
940         //! \details
941         //!     It specifies whether all syntax decoding of the current frame is
942         //!     independent of the previous frames, or not.
943         //!     Set to 0 to disable error resilient mode
944         //!     Set to 1 to enable error resilient mode (for independent syntax
945         //!     decoding)
946         //!     It is the frame-level syntax element, error_resilient_mode. Default
947         //!     is 0.
948         //!     It is read from the bitstream for all frame types (KEY Frame,
949         //!     INTRA-ONLY Frame and INTER Frame), except when frame_type is set to
950         //!     SWITCH_FRAME, in which it is forced to 1 instead of reading from the
951         //!     bitstream.
952         //!     When error resilient mode is set to 1 (active), Refresh Frame Context
953         //!     is set to0. When error resilient is set to 0,Refresh Frame Context is
954         //!     read from the bit stream.
955         //!
956         //!     Valid only in Decoder Mode
957         //!
958         //!
959         enum ERROR_RESILIENT_MODE_FLAG
960         {
961             ERROR_RESILIENT_MODE_FLAG_DISABLE                                = 0, //!< No additional details
962             ERROR_RESILIENT_MODE_FLAG_ENABLE                                 = 1, //!< No additional details
963         };
964 
965         //! \brief SEGMENTATION_ENABLE_FLAG
966         //! \details
967         //!     Indicate if segementation is enabled or not
968         enum SEGMENTATION_ENABLE_FLAG
969         {
970             SEGMENTATION_ENABLE_FLAG_ALLBLOCKSAREIMPLIEDTOBELONGTOSEGMENT0   = 0, //!< No additional details
971             SEGMENTATION_ENABLE_FLAG_SEGIDDETERMINATIONDEPENDSONSEGMENTATIONUPDATEMAPSETTING = 1, //!< No additional details
972         };
973 
974         //! \brief SEGMENTATION_TEMPORAL_UPDATE_FLAG
975         //! \details
976         //!     Indicates whether segID is decoding from bitstream or predicted from
977         //!     previous frame.
978         enum SEGMENTATION_TEMPORAL_UPDATE_FLAG
979         {
980             SEGMENTATION_TEMPORAL_UPDATE_FLAG_DECODESEGIDFROMBITSTREAM       = 0, //!< No additional details
981             SEGMENTATION_TEMPORAL_UPDATE_FLAG_GETSEGIDEITHERFROMBITSTREAMORFROMPREVIOUSFRAME = 1, //!< No additional details
982         };
983 
984         //! \brief FRAME_CODED_LOSSLESS_MODE
985         //! \details
986         //!     This bit is set to indicate lossless coding mode at frame level.
987         //!     Frame Coded Lossless Mode is set to 1, if all active segment's
988         //!     segment lossless flag are set to 1.
989         //!     The equation for deriving coded lossless mode is presented in the
990         //!     AVP_SEGMENT_STATE Command.
991         //!     AllLossless = CodedLossless &amp;&amp; ( FrameWidth == UpscaledWidth
992         //!     ). The second condition in this equation is equivalent to having
993         //!     Super-res NOT enabled.
994         //!     Only CodedLossless flag is sent to HW. AllLossless flag is not.
995         //!     CodedLossless directly control the enabling/disabling of deblocker,
996         //!     CDEF in-loop filters.
997         //!     But AllLossless is used to control the enabling/disabling of Loop
998         //!     Restoration filteras well. When AllLossless = = 1, super-res must be OFF
999         //!     and Loop Restoration Filter must be disabled. Hence, when super-res is
1000         //!     ON, Loop Restoration filter can still be ON/OFF, regardless of
1001         //!     CodedLossless.
1002         enum FRAME_CODED_LOSSLESS_MODE
1003         {
1004             FRAME_CODED_LOSSLESS_MODE_NORMALMODE                             = 0, //!< No additional details
1005             FRAME_CODED_LOSSLESS_MODE_CODEDLOSSLESSMODE                      = 1, //!< No additional details
1006         };
1007 
1008         //! \brief MCOMP_FILTER_TYPE
1009         //! \details
1010         //!     It specifies which Motion Compensation Filter type is to be used for
1011         //!     the current frame.
1012         //!     It is a frame-level derived parameters. It is derived from the frame
1013         //!     level syntax elements (is_filter_switchable flag and the 2-bits
1014         //!     interpolation_filter).
1015         //!     Default is 0 (i.e. use the eight-tap basic filter).
1016         enum MCOMP_FILTER_TYPE
1017         {
1018             MCOMP_FILTER_TYPE_EIGHT_TAP                                      = 0, //!< No additional details
1019             MCOMP_FILTER_TYPE_EIGHT_TAP_SMOOTH                               = 1, //!< No additional details
1020             MCOMP_FILTER_TYPE_EIGHT_TAP_SHARP                                = 2, //!< No additional details
1021             MCOMP_FILTER_TYPE_BILINEAR                                       = 3, //!< No additional details
1022             MCOMP_FILTER_TYPE_SWITCHABLE                                     = 4, //!< No additional details
1023         };
1024 
1025         //! \brief NONFIRSTPASSFLAG
1026         //! \details
1027         //!     This signals the current pass is not the first pass. It will imply
1028         //!     designate HW behavior.
1029         enum NONFIRSTPASSFLAG
1030         {
1031             NONFIRSTPASSFLAG_DISABLE                                         = 0, //!< If it is initial-Pass, this bit is set to 0.
1032             NONFIRSTPASSFLAG_ENABLE                                          = 1, //!< For subsequent passes, this bit is set to 1.
1033         };
1034 
1035         //! \brief FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK
1036         //! \details
1037         //!     This is a mask bit controlling if the condition of frame level bit count
1038         //!     exceeds FrameBitRateMax.
1039         enum FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK
1040         {
1041             FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK_DISABLE            = 0, //!< Do not update bit 1 of HCP_VP9_IMAGE_STATUS control register.
1042             FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK_ENABLE             = 1, //!< Set bit 1 of HCP_VP9_IMAGE_STATUS control register if the total frame level bit counter is greater than or equal to Frame Bit Rate Maximum limit.
1043         };
1044 
1045         //! \brief FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK
1046         //! \details
1047         //!     This is a mask bit controlling if the condition of frame level bit count
1048         //!     is less than FrameBitRateMin.
1049         enum FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK
1050         {
1051             FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK_DISABLE           = 0, //!< Do not update bit 2 (Frame Bit Count Violate -- under run) of HCP_VP9_IMAGE_STATUS control register.
1052             FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK_ENABLE            = 1, //!< Set bit 2 (Frame Bit Count Violate -- under run) of HCP_VP9_IMAGE_STATUS control register if the total frame level bit counter is less than or equal to Frame Bit Rate Minimum limit.
1053         };
1054 
1055         //! \brief FRAMEBITRATEMAXUNIT
1056         //! \details
1057         //!     This field is the Frame Bitrate Maximum Limit Units.
1058         enum FRAMEBITRATEMAXUNIT
1059         {
1060             FRAMEBITRATEMAXUNIT_BYTE                                         = 0, //!< 32byte unit
1061             FRAMEBITRATEMAXUNIT_KILOBYTE                                     = 1, //!< 4Kbyte unit
1062         };
1063 
1064         //! \brief FRAMEBITRATEMINUNIT
1065         //! \details
1066         //!     This field is the Frame Bitrate Maximum Limit Units.
1067         enum FRAMEBITRATEMINUNIT
1068         {
1069             FRAMEBITRATEMINUNIT_BYTE                                         = 0, //!< 32byte unit
1070             FRAMEBITRATEMINUNIT_KILOBYTE                                     = 1, //!< 4Kbyte unit
1071         };
1072 
1073         //! \brief MINFRAMESIZEUNITS
1074         //! \details
1075         //!     This field is the Minimum Frame Size Units
1076         enum MINFRAMESIZEUNITS
1077         {
1078             MINFRAMESIZEUNITS_4KB                                            = 0, //!< Minimum Frame Size is in 4Kbytes.
1079             MINFRAMESIZEUNITS_16KB                                           = 1, //!< Minimum Frame Size is in 4Kbytes.
1080         };
1081 
1082         //! \name Initializations
1083 
1084         //! \brief Explicit member initialization function
AVP_PIC_STATE_CMDAVP_PIC_STATE_CMD1085         AVP_PIC_STATE_CMD()
1086         {
1087             DW0.Value                                        = 0x71b00031;
1088             DW0.DwordLength                                  = GetOpLength(dwSize);
1089             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPPICSTATE;
1090             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
1091             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
1092             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
1093 
1094             DW1.Value                                        = 0x00000000;
1095 
1096             DW2.Value                                        = 0x00000000;
1097             //DW2.SequenceChromaSubsamplingFormat              = 0;
1098 
1099             DW3.Value                                        = 0x00000000;
1100             //DW3.ErrorResilientModeFlag                       = ERROR_RESILIENT_MODE_FLAG_DISABLE;
1101 
1102             DW4.Value                                        = 0x00000000;
1103             //DW4.SegmentationEnableFlag                       = SEGMENTATION_ENABLE_FLAG_ALLBLOCKSAREIMPLIEDTOBELONGTOSEGMENT0;
1104             //DW4.SegmentationTemporalUpdateFlag               = SEGMENTATION_TEMPORAL_UPDATE_FLAG_DECODESEGIDFROMBITSTREAM;
1105             //DW4.FrameCodedLosslessMode                       = FRAME_CODED_LOSSLESS_MODE_NORMALMODE;
1106 
1107             DW5.Value                                        = 0x00000000;
1108 
1109             DW6.Value                                        = 0x00000000;
1110             //DW6.McompFilterType                              = MCOMP_FILTER_TYPE_EIGHT_TAP;
1111 
1112             DW7.Value                                        = 0x00000000;
1113 
1114             DW8.Value                                        = 0x00000000;
1115 
1116             memset(&WarpParametersArrayReference1To7Projectioncoeff0To5, 0, sizeof(WarpParametersArrayReference1To7Projectioncoeff0To5));
1117 
1118             DW30.Value                                       = 0x00000000;
1119 
1120             DW31.Value                                       = 0x00000000;
1121 
1122             DW32.Value                                       = 0x00000000;
1123 
1124             DW33.Value                                       = 0x00000000;
1125 
1126             DW34.Value                                       = 0x00000000;
1127 
1128             DW35.Value                                       = 0x00000000;
1129 
1130             DW36.Value                                       = 0x00000000;
1131 
1132             DW37.Value                                       = 0x00000000;
1133 
1134             DW38.Value                                       = 0x00000000;
1135 
1136             DW39.Value                                       = 0x00000000;
1137 
1138             DW40.Value                                       = 0x00000000;
1139 
1140             DW41.Value                                       = 0x00000000;
1141 
1142             DW42.Value                                       = 0x00000000;
1143 
1144             DW43.Value                                       = 0x00000000;
1145 
1146             DW44.Value                                       = 0x00000000;
1147 
1148             DW45.Value                                       = 0x00000000;
1149 
1150             DW46.Value                                       = 0x00000000;
1151 
1152             DW47.Value                                       = 0x00000000;
1153 
1154             DW48.Value                                       = 0x00000000;
1155 
1156             DW49.Value                                       = 0x00000000;
1157 
1158             DW50.Value                                       = 0x00000000;
1159 
1160             DW51.Value                                       = 0x00000000;
1161             //DW51.Nonfirstpassflag                            = NONFIRSTPASSFLAG_DISABLE;
1162             //DW51.FrameszoverstatusenFramebitratemaxreportmask = FRAMESZOVERSTATUSEN_FRAMEBITRATEMAXREPORTMASK_DISABLE;
1163             //DW51.FrameszunderstatusenFramebitrateminreportmask = FRAMESZUNDERSTATUSEN_FRAMEBITRATEMINREPORTMASK_DISABLE;
1164 
1165             DW52.Value                                       = 0x00000000;
1166             //DW52.Framebitratemaxunit                         = FRAMEBITRATEMAXUNIT_BYTE;
1167 
1168             DW53.Value                                       = 0x00000000;
1169             //DW53.Framebitrateminunit                         = FRAMEBITRATEMINUNIT_BYTE;
1170 
1171             DW54_55.Value[0] = DW54_55.Value[1]              = 0x00000000;
1172 
1173             DW56.Value                                       = 0x00000000;
1174 
1175             DW57_58.Value[0] = DW57_58.Value[1]              = 0x00000000;
1176 
1177             DW59.Value                                       = 0x00000000;
1178 
1179             DW60_61.Value[0] = DW60_61.Value[1]              = 0x00000000;
1180 
1181             DW62.Value                                       = 0x00000000;
1182 
1183             DW63.Value                                       = 0x00000000;
1184             //DW63.Minframesizeunits                           = MINFRAMESIZEUNITS_4KB;
1185 
1186             DW64.Value                                       = 0x00000000;
1187 
1188             DW65.Value                                       = 0x00000000;
1189 
1190             memset(&SseThresholdsForClass18, 0, sizeof(SseThresholdsForClass18));
1191 
1192             DW74.Value                                       = 0x00000000;
1193 
1194             DW75.Value                                       = 0x00000000;
1195 
1196         }
1197 
1198         static const size_t dwSize = 76;
1199         static const size_t byteSize = 304;
1200     };
1201 
1202     //!
1203     //! \brief AVP_PIPE_MODE_SELECT
1204     //! \details
1205     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1206     //!     all AVP Commands. Each AVP command has assigned a media instruction
1207     //!     command as defined in DWord 0, BitField 22:16.
1208     //!
1209     //!     The workload for the AVP pipeline is tile based. Once the bit stream DMA
1210     //!     is configured with the AVP_BSD_OBJECT command for a tile in a frame, and
1211     //!     the tile's bitstream is presented to the AVP, the tile decoding will
1212     //!     begin.
1213     //!     AVP pipeline is stateless, i.e. there is no states saved between the
1214     //!     decoding of each tile. Hence all sequence, frame and segment state
1215     //!     commands have to be resent before the tile coding command and the BSD
1216     //!     object command.
1217     //!     The AVP_PIPE_MODE_SELECT command is responsible for general pipeline
1218     //!     level configuration that would normally be set once for a single stream
1219     //!     encode or decode and would not be modified on a frame workload basis.
1220     //!     This is a frame level state command and is shared by both encoding and
1221     //!     decoding processes.
1222     //!
1223     struct AVP_PIPE_MODE_SELECT_CMD
1224     {
1225         union
1226         {
1227             struct
1228             {
1229                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1230                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1231                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1232                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1233                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1234                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1235             };
1236             uint32_t                     Value;
1237         } DW0;
1238         union
1239         {
1240             struct
1241             {
1242                 uint32_t                 CodecSelect                                      : __CODEGEN_BITFIELD( 0,  0)    ; //!< CODEC_SELECT
1243                 uint32_t                 CdefOutputStreamoutEnableFlag                    : __CODEGEN_BITFIELD( 1,  1)    ; //!< CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
1244                 uint32_t                 LoopRestorationOutputStreamoutEnableFlag         : __CODEGEN_BITFIELD( 2,  2)    ; //!< LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
1245                 uint32_t                 PicStatusErrorReportEnable                       : __CODEGEN_BITFIELD( 3,  3)    ; //!< PIC_STATUSERROR_REPORT_ENABLE
1246                 uint32_t                 FrameReconstructionDisable                       : __CODEGEN_BITFIELD( 4,  4)    ; //!< Frame reconstruction disable
1247                 uint32_t                 CodecStandardSelect                              : __CODEGEN_BITFIELD( 5,  7)    ; //!< CODEC_STANDARD_SELECT
1248                 uint32_t                 Reserved40                                       : __CODEGEN_BITFIELD( 8,  9)    ; //!< Reserved
1249                 uint32_t                 VdencMode                                        : __CODEGEN_BITFIELD(10, 10)    ; //!< VDENC Mode
1250                 uint32_t                 Reserved43                                       : __CODEGEN_BITFIELD(11, 11)    ; //!< Reserved
1251                 uint32_t                 TileStatsStreamoutEnable                         : __CODEGEN_BITFIELD(12, 12)    ; //!< Tile Statistics Streamout Enable
1252                 uint32_t                 MultiEngineMode                                  : __CODEGEN_BITFIELD(13, 14)    ; //!< MULTI_ENGINE_MODE
1253                 uint32_t                 PipeWorkingMode                                  : __CODEGEN_BITFIELD(15, 16)    ; //!< PIPE_WORKING_MODE
1254                 uint32_t                 TileBasedEngine                                  : __CODEGEN_BITFIELD(17, 17)    ; //!< Tile Based Engine
1255                 uint32_t                 Reserved50                                       : __CODEGEN_BITFIELD(18, 22)    ; //!< Reserved
1256                 uint32_t                 MotionCompMemTrackerCounterEnable                : __CODEGEN_BITFIELD(23, 23)    ; //!< Motion Comp Memory Tracker Counter Enable
1257                 uint32_t                 Reserved56                                       : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved56
1258             };
1259             uint32_t                     Value;
1260         } DW1;
1261         union
1262         {
1263             struct
1264             {
1265                 uint32_t                 MediaSoftResetCounterPer1000Clocks                                               ; //!< MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
1266             };
1267             uint32_t                     Value;
1268         } DW2;
1269         union
1270         {
1271             struct
1272             {
1273                 uint32_t                 PicStatusErrorReportId                                                           ; //!< PIC_STATUSERROR_REPORT_ID
1274             };
1275             uint32_t                     Value;
1276         } DW3;
1277         union
1278         {
1279             struct
1280             {
1281                 uint32_t                 Reserved128                                                                      ; //!< Reserved
1282             };
1283             uint32_t                     Value;
1284         } DW4;
1285         union
1286         {
1287             struct
1288             {
1289                 uint32_t                 PhaseIndicator                                   : __CODEGEN_BITFIELD( 0,  1)    ; //!< PHASE_INDICATOR
1290                 uint32_t                 Reserved162                                      : __CODEGEN_BITFIELD( 2, 31)    ; //!< Reserved
1291             };
1292             uint32_t                     Value;
1293         } DW5;
1294         union
1295         {
1296             struct
1297             {
1298                 uint32_t                 PAKFrameLevelStreamOutEnable                     : __CODEGEN_BITFIELD(0, 0); //!< PAK Frame Level StreamOut enable
1299                 uint32_t                 MotionCompMemoryTrackerCntEnable                 : __CODEGEN_BITFIELD(1, 1); //!< Motion Comp Memory Tracker Counter Enable
1300                 uint32_t                 SourcePixelPrefetchLen                           : __CODEGEN_BITFIELD(2, 4); //!< Source Pixel Prefetch Length
1301                 uint32_t                 SourcePixelPrefetchEnable                        : __CODEGEN_BITFIELD(5, 5); //!< Source Pixel Prefetch Enable
1302                 uint32_t                 SSEEnable                                        : __CODEGEN_BITFIELD(6, 6); //!< SSE Enable
1303                 uint32_t                 Reserved164                                      : __CODEGEN_BITFIELD(7, 31); //!< Reserved
1304             };
1305             uint32_t                     Value;
1306         } DW6;
1307 
1308         //! \name Local enumerations
1309 
1310         enum MEDIA_INSTRUCTION_COMMAND
1311         {
1312             MEDIA_INSTRUCTION_COMMAND_AVPPIPEMODESELECT                      = 0, //!< No additional details
1313         };
1314 
1315         //! \brief MEDIA_INSTRUCTION_OPCODE
1316         //! \details
1317         //!     Codec/Engine Name = AVP = 3h
1318         enum MEDIA_INSTRUCTION_OPCODE
1319         {
1320             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1321         };
1322 
1323         enum PIPELINE_TYPE
1324         {
1325             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1326         };
1327 
1328         enum COMMAND_TYPE
1329         {
1330             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1331         };
1332 
1333         enum CODEC_SELECT
1334         {
1335             CODEC_SELECT_DECODE                                              = 0, //!< No additional details
1336             CODEC_SELECT_ENCODE                                              = 1, //!< No additional details
1337         };
1338 
1339         //! \brief CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
1340         //! \details
1341         //!     It allows the Super-Resolution, Loop Restoration Filtering, and Out
1342         //!     of Loop Film Graim Synthesisto be done in a separate pass with SW
1343         //!     instead.
1344         //!     Since these are in-loop filtering, the results are provided back to
1345         //!     the HW AV1 pipeline.
1346         //!     This feature is currently not being implemented in HW.
1347         enum CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG
1348         {
1349             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.
1350             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.
1351         };
1352 
1353         //! \brief LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
1354         //! \details
1355         //!     It allows the Film Grain Synthesisto be done in a separate pass with
1356         //!     SW instead.
1357         //!     All the Post In-Loop Filters, if any enabled, (Deblocker, CDEF,
1358         //!     Super-Resolution and Loop Restoration) are still be done in AV1 HW
1359         //!     pipeline.
1360         //!     This feature is currently not being implemented in HW.
1361         enum LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG
1362         {
1363             LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE            = 0, //!< Film Grain Synthesis, if enabled, is performed in HW AVP Pipeline.
1364             LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_ENABLE             = 1, //!< Film Grain Synthesis, if enabled, is NOT performed in HW AVP Pipeline.
1365         };
1366 
1367         enum PIC_STATUSERROR_REPORT_ENABLE
1368         {
1369             PIC_STATUSERROR_REPORT_ENABLE_DISABLE                            = 0, //!< Disable status/error reporting
1370             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.
1371         };
1372 
1373         enum CODEC_STANDARD_SELECT
1374         {
1375             CODEC_STANDARD_SELECT_HEVC                                       = 0, //!< No additional details
1376             CODEC_STANDARD_SELECT_VP9                                        = 1, //!< No additional details
1377             CODEC_STANDARD_SELECT_AV1                                        = 2, //!< No additional details
1378         };
1379 
1380         //! \brief MULTI_ENGINE_MODE
1381         //! \details
1382         //!     This indicates the current pipe is in single pipe mode or if in
1383         //!     scalable mode is in left/right/middle pipe in multi-engine mode.
1384         enum MULTI_ENGINE_MODE
1385         {
1386             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.
1387             MULTI_ENGINE_MODE_PIPEISTHELEFTENGINEINAMULTI_ENGINEMODE         = 1, //!< Current pipe is the most left engine while running in scalable multi-engine mode
1388             MULTI_ENGINE_MODE_PIPEISTHERIGHTENGINEINAMULTI_ENGINEMODE        = 2, //!< Current pipe is the most right engine while running in scalable multi-engine mode
1389             MULTI_ENGINE_MODE_PIPEISONEOFTHEMIDDLEENGINEINAMULTI_ENGINEMODE  = 3, //!< Current pipe is in one of the middle engine while running in scalable multi-engine mode
1390         };
1391 
1392         //! \brief PIPE_WORKING_MODE
1393         //! \details
1394         //!     This programs the working mode for AVP pipe.
1395         enum PIPE_WORKING_MODE
1396         {
1397             PIPE_WORKING_MODE_LEGACYDECODERENCODERMODE_SINGLEPIPE            = 0, //!< This is for single pipe mode non-scalable mode. It is used by both decoder and encoder.
1398             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.
1399             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.
1400             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.
1401         };
1402 
1403         //! \brief MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
1404         //! \details
1405         //!     In decoder modes, this counter value specifies the number of clocks (per
1406         //!     1000) of GAC inactivity before a media soft-reset is applied to the AVP
1407         //!     and HuC. If counter value is set to 0, the media soft-reset feature is
1408         //!     disabled and no reset will occur.
1409         //!     In encoder modes, this counter must be set to 0 to disable media soft
1410         //!     reset. This feature is not supported for the encoder.
1411         enum MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
1412         {
1413             MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS_DISABLE                 = 0, //!< No additional details
1414         };
1415 
1416         //! \brief PIC_STATUSERROR_REPORT_ID
1417         //! \details
1418         //!     The Pic Status/Error Report ID is a unique 32-bit unsigned integer
1419         //!     assigned to each picture
1420         //!     status/error output. Must be zero for encoder mode.
1421         enum PIC_STATUSERROR_REPORT_ID
1422         {
1423             PIC_STATUSERROR_REPORT_ID_32_BITUNSIGNED                         = 0, //!< Unique ID Number
1424         };
1425 
1426         //! \brief PHASE_INDICATOR
1427         //! \details
1428         //!     This is used to indicate whether this is first, middle or last phase
1429         //!     of programming during Real-Tile Decoder Mode. This is used by hardware
1430         //!     to know if the current programming is first or last phases.
1431         //!     This field is ignored (programmed to 0) for other modes other than
1432         //!     AV1 Real-Tile Decoder Mode.
1433         enum PHASE_INDICATOR
1434         {
1435             PHASE_INDICATOR_FIRSTPHASE                                       = 0, //!< No additional details
1436             PHASE_INDICATOR_MIDDLEPHASE                                      = 1, //!< No additional details
1437             PHASE_INDICATOR_LASTPHASE                                        = 2, //!< No additional details
1438         };
1439 
1440         //! \name Initializations
1441 
1442         //! \brief Explicit member initialization function
AVP_PIPE_MODE_SELECT_CMDAVP_PIPE_MODE_SELECT_CMD1443         AVP_PIPE_MODE_SELECT_CMD()
1444         {
1445 
1446             DW0.Value                                        = 0x71800005;
1447             //DW0.DwordLength                                  = GetOpLength(dwSize);
1448             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPPIPEMODESELECT;
1449             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
1450             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
1451             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
1452 
1453             DW1.Value                                        = 0x00000000;
1454             //DW1.CodecSelect                                  = CODEC_SELECT_DECODE;
1455             //DW1.CdefOutputStreamoutEnableFlag                = CDEF_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE;
1456             //DW1.LoopRestorationOutputStreamoutEnableFlag     = LOOP_RESTORATION_OUTPUT_STREAMOUT_ENABLE_FLAG_DISABLE;
1457             //DW1.PicStatusErrorReportEnable                   = PIC_STATUSERROR_REPORT_ENABLE_DISABLE;
1458             //DW1.CodecStandardSelect                          = CODEC_STANDARD_SELECT_HEVC;
1459             //DW1.MultiEngineMode                              = MULTI_ENGINE_MODE_SINGLEENGINEMODEORMSACFEONLYDECODEMODE;
1460             //DW1.PipeWorkingMode                              = PIPE_WORKING_MODE_LEGACYDECODERENCODERMODE_SINGLEPIPE;
1461 
1462             DW2.Value                                        = 0x00000000;
1463             //DW2.MediaSoftResetCounterPer1000Clocks           = MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS_DISABLE;
1464 
1465             DW3.Value                                        = 0x00000000;
1466             //DW3.PicStatusErrorReportId                       = PIC_STATUSERROR_REPORT_ID_32_BITUNSIGNED;
1467 
1468             DW4.Value                                        = 0x00000000;
1469 
1470             DW5.Value                                        = 0x00000000;
1471             //DW5.PhaseIndicator                               = PHASE_INDICATOR_FIRSTPHASE;
1472             DW6.Value                                        = 0x00000000;
1473 
1474         }
1475 
1476         static const size_t dwSize = 7;
1477         static const size_t byteSize = 28;
1478     };
1479 
1480     //!
1481     //! \brief AVP_IND_OBJ_BASE_ADDR_STATE
1482     //! \details
1483     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1484     //!     all AVP Commands. Each AVP command has assigned a media instruction
1485     //!     command as defined in DWord 0, BitField 22:16.
1486     //!
1487     //!     The AVP_IND_OBJ_BASE_ADDR_STATE command is used to define the indirect
1488     //!     object base address of the AV1 compressed bitstream in graphics memory.
1489     //!     This is a frame level command issued in both encoding and decoding
1490     //!     processes.
1491     //!     Although a frame is coded as separate tiles, all tiles' compressed
1492     //!     bitstream are still required to line up sequentially as one AV1
1493     //!     bitstream. Hence, there is only one Indirect Object Base Address for the
1494     //!     entire AV1 codedframe. If the frame contains more than 1 tiles, the BSD
1495     //!     Object Command will be issued multiple times, once for each tile and
1496     //!     with its own tile bitstream starting memory address.
1497     //!
1498     struct AVP_IND_OBJ_BASE_ADDR_STATE_CMD
1499     {
1500         union
1501         {
1502             struct
1503             {
1504                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1505                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1506                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1507                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1508                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1509                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1510             };
1511             uint32_t                     Value;
1512         } DW0;
1513         SPLITBASEADDRESS4KBYTEALIGNED_CMD        AvpIndirectBitstreamObjectBaseAddress;                                   //!< DW1..2, AVP Indirect Bitstream Object Base Address
1514         MEMORYADDRESSATTRIBUTES_CMD              AvpIndirectBitstreamObjectMemoryAddressAttributes;                       //!< DW3, AVP Indirect Bitstream Object Memory Address Attributes
1515         SPLITBASEADDRESS4KBYTEALIGNED_CMD        AvpIndirectBitstreamObjectAccessUpperBound;                              //!< DW4..5, AVP Indirect Bitstream Object Access Upper Bound
1516         SPLITBASEADDRESS4KBYTEALIGNED_CMD        AvpIndirectCuObjectBaseAddress;                                          //!< DW6..7, AVP Indirect CU Object Base Address
1517         MEMORYADDRESSATTRIBUTES_CMD              AvpIndirectCuObjectMemoryAddressAttributes;                              //!< DW8, AVP Indirect CU Object Object Memory Address Attributes
1518 
1519         //! \name Local enumerations
1520 
1521         enum MEDIA_INSTRUCTION_COMMAND
1522         {
1523             MEDIA_INSTRUCTION_COMMAND_AVPINDOBJBASEADDRSTATE                 = 3, //!< No additional details
1524         };
1525 
1526         //! \brief MEDIA_INSTRUCTION_OPCODE
1527         //! \details
1528         //!     Codec/Engine Name = AVP = 3h
1529         enum MEDIA_INSTRUCTION_OPCODE
1530         {
1531             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1532         };
1533 
1534         enum PIPELINE_TYPE
1535         {
1536             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1537         };
1538 
1539         enum COMMAND_TYPE
1540         {
1541             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1542         };
1543 
1544         //! \name Initializations
1545 
1546         //! \brief Explicit member initialization function
AVP_IND_OBJ_BASE_ADDR_STATE_CMDAVP_IND_OBJ_BASE_ADDR_STATE_CMD1547         AVP_IND_OBJ_BASE_ADDR_STATE_CMD()
1548         {
1549             DW0.Value                                        = 0x71830007;
1550             //DW0.DwordLength                                  = GetOpLength(dwSize);
1551             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPINDOBJBASEADDRSTATE;
1552             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
1553             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
1554             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
1555 
1556         }
1557 
1558         static const size_t dwSize = 9;
1559         static const size_t byteSize = 36;
1560     };
1561 
1562     //!
1563     //! \brief AVP_TILE_CODING
1564     //! \details
1565     //!     This command is used only for AV1codec. It is issued for every tile of a
1566     //!     frame. If a frame is composed of only 1 tile, it is still being issued.
1567     //!     Tiling and Tile Group organization in AV1 cannot be disabled, a frame
1568     //!     minimum must have 1 tile. Currently, each batch buffer can contain only
1569     //!     1 tile to be processed, it cannot contain more than 1 tile or the entire
1570     //!     tile group of tiles.
1571     //!     When the tile width exceeds 4096 pixels or the tile area exceeds
1572     //!     4096x2304 pixels, tiling must be performed and number of tiles in such
1573     //!     frame must be >1. There is no mandatory tiling driven by tile height.
1574     //!     The frame height in pixels will limit the allowed tile height in extreme
1575     //!     situation. Hence, the AVP_TILE_CODING can be issued multiple times for
1576     //!     decoding a frame.
1577     //!     Since AVP HW pipeline is stateless, all sequence, frame and segment
1578     //!     level states (coding parameters in all Frame Level State Commands) must
1579     //!     be resent before sending each TILE_CODING_STATE command.
1580     //!     Although tile size is specified in SuperBlock unit, the minimum tile
1581     //!     size is actually set to be 8x8 pixels (which is the same as the minimum
1582     //!     frame size in pixels). It can also happen to the rightmost tile column
1583     //!     and bottommost tile row of a frame which is not divisible by the
1584     //!     SuperBlock size - this leads to the presence of partial tile and partial
1585     //!     SuperBlock handling.
1586     //!     AV1 supports both
1587     //!     1) a uniform-spacing tiling scheme (as in VP9, which is always in the
1588     //!     form of 2^N x 2^M number of tiles, for the entire frame), and
1589     //!     2) a non-uniform-spacing tiling scheme. Bitstream syntax will specify
1590     //!     the width and height of each tile size in the frame.
1591     //!     AVP HW pipeline is a tile-based codec engine, it does not need to
1592     //!     distinguish between these two tiling schemes. Driver will take care of
1593     //!     the difference and details of these tiling schemes. At the end, Driver
1594     //!     will send out one tile at a time with all the related tile information
1595     //!     to the HW through this TILE_CODING State Command.
1596     //!     In AV1, a frame is partitioned by tile row and tile column. That is, a
1597     //!     tile boundary must go across the full frame width or the full frame
1598     //!     height only. There is no tiling within a tile.
1599     //!     For AV1, the max number of tiles per frame is set to 256 in the LEVEL
1600     //!     definition for regular video decoding. The ext-tile (Virtual Reality
1601     //!     mode, currently not supported) has a different tiling configuration,
1602     //!     constraints and definition.
1603     //!
1604     struct AVP_TILE_CODING_CMD
1605     {
1606         union
1607         {
1608             struct
1609             {
1610                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1611                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1612                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1613                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1614                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1615                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1616             };
1617             uint32_t                     Value;
1618         } DW0;
1619         union
1620         {
1621             struct
1622             {
1623                 uint32_t                 FrameTileId                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< Frame Tile ID
1624                 uint32_t                 TgTileNum                                        : __CODEGEN_BITFIELD(12, 23)    ; //!< TG Tile Num
1625                 uint32_t                 TileGroupId                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Tile Group ID
1626             };
1627             uint32_t                     Value;
1628         } DW1;
1629         union
1630         {
1631             struct
1632             {
1633                 uint32_t                 TileColumnPositionInSbUnit                       : __CODEGEN_BITFIELD( 0,  9)    ; //!< Tile Column Position in SB Unit
1634                 uint32_t                 Reserved74                                       : __CODEGEN_BITFIELD(10, 15)    ; //!< Reserved
1635                 uint32_t                 TileRowPositionInSbUnit                          : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Row Position in SB Unit
1636                 uint32_t                 Reserved90                                       : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1637             };
1638             uint32_t                     Value;
1639         } DW2;
1640         union
1641         {
1642             struct
1643             {
1644                 uint32_t                 TileWidthInSuperblockUnitMinus1                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< Tile Width in SuperBlock Unit Minus1
1645                 uint32_t                 Reserved102                                      : __CODEGEN_BITFIELD( 6, 15)    ; //!< Reserved
1646                 uint32_t                 TileHeightInSuperblockUnitMinus1                 : __CODEGEN_BITFIELD(16, 25)    ; //!< Tile Height in SuperBlock Unit Minus1
1647                 uint32_t                 Reserved122                                      : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1648             };
1649             uint32_t                     Value;
1650         } DW3;
1651         union
1652         {
1653             struct
1654             {
1655                 uint32_t                 FilmGrainSampleTemplateWriteReadControl          : __CODEGEN_BITFIELD( 0,  0)    ; //!< FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1656                 uint32_t                 Reserved22                                       : __CODEGEN_BITFIELD( 1, 22)    ; //!< Reserved
1657                 uint32_t                 FirstTileInAFrame                                : __CODEGEN_BITFIELD(23, 23)    ; //!< First Tile in a Frame
1658                 uint32_t                 Reserved24                                       : __CODEGEN_BITFIELD(24, 24)    ; //!< Reserved
1659                 uint32_t                 IslasttileofcolumnFlag                           : __CODEGEN_BITFIELD(25, 25)    ; //!< IsLastTileOfColumn Flag
1660                 uint32_t                 IslasttileofrowFlag                              : __CODEGEN_BITFIELD(26, 26)    ; //!< IsLastTileOfRow Flag
1661                 uint32_t                 IsstarttileoftilegroupFlag                       : __CODEGEN_BITFIELD(27, 27)    ; //!< IsStartTileOfTileGroup Flag
1662                 uint32_t                 IsendtileoftilegroupFlag                         : __CODEGEN_BITFIELD(28, 28)    ; //!< IsEndTileOfTileGroup Flag
1663                 uint32_t                 IslasttileofframeFlag                            : __CODEGEN_BITFIELD(29, 29)    ; //!< IsLastTileOfFrame Flag
1664                 uint32_t                 DisableCdfUpdateFlag                             : __CODEGEN_BITFIELD(30, 30)    ; //!< Disable CDF Update Flag
1665                 uint32_t                 DisableFrameContextUpdateFlag                    : __CODEGEN_BITFIELD(31, 31)    ; //!< Disable Frame Context Update Flag
1666             };
1667             uint32_t                     Value;
1668         } DW4;
1669         union
1670         {
1671             struct
1672             {
1673                 uint32_t                 NumberOfActiveBePipes                            : __CODEGEN_BITFIELD( 0,  7)    ; //!< Number of Active BE Pipes
1674                 uint32_t                 Reserved168                                      : __CODEGEN_BITFIELD( 8, 11)    ; //!< Reserved MBZ
1675                 uint32_t                 NumOfTileColumnsMinus1InAFrame                   : __CODEGEN_BITFIELD(12, 21)    ; //!< Num of Tile Columns Minus1 in a Frame
1676                 uint32_t                 NumOfTileRowsMinus1InAFrame                      : __CODEGEN_BITFIELD(22, 31)    ; //!< Num of Tile Rows Minus1 in a Frame
1677             };
1678             uint32_t                     Value;
1679         } DW5;
1680         union
1681         {
1682             struct
1683             {
1684                 uint32_t                 OutputDecodedTileColumnPositionInSbUnit          : __CODEGEN_BITFIELD( 0,  9)    ; //!< Output Decoded Tile Column Position in SB Unit
1685                 uint32_t                 Reserved202                                      : __CODEGEN_BITFIELD(10, 15)    ; //!< Reserved
1686                 uint32_t                 OutputDecodedTileRowPositionInSbUnit             : __CODEGEN_BITFIELD(16, 25)    ; //!< Output Decoded Tile Row Position in SB Unit
1687                 uint32_t                 Reserved218                                      : __CODEGEN_BITFIELD(26, 31)    ; //!< Reserved
1688             };
1689             uint32_t                     Value;
1690         } DW6;
1691 
1692         //! \name Local enumerations
1693 
1694         enum MEDIA_INSTRUCTION_COMMAND
1695         {
1696             MEDIA_INSTRUCTION_COMMAND_AVPTILECODING                          = 21, //!< No additional details
1697         };
1698 
1699         enum MEDIA_INSTRUCTION_OPCODE
1700         {
1701             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1702         };
1703 
1704         enum PIPELINE_TYPE
1705         {
1706             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1707         };
1708 
1709         enum COMMAND_TYPE
1710         {
1711             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1712         };
1713 
1714         //! \brief FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1715         //! \details
1716         //!     This should only be set to write on the first tile of the frame in
1717         //!     single pipe mode (when film grain is enabled) and read for the remaining
1718         //!     tiles. In scalable mode, this should be set to writeon the first phase
1719         //!     and top tile of the frame and read for the remaining frames.
1720         enum FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL
1721         {
1722             FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_READ                = 0, //!< No additional details
1723             FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_WRITE               = 1, //!< No additional details
1724         };
1725 
1726         //! \name Initializations
1727 
1728         //! \brief Explicit member initialization function
AVP_TILE_CODING_CMDAVP_TILE_CODING_CMD1729         AVP_TILE_CODING_CMD()
1730         {
1731             DW0.Value                                        = 0x71950005;
1732             //DW0.DwordLength                                  = GetOpLength(dwSize);
1733             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPTILECODING;
1734             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
1735             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
1736             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
1737 
1738             DW1.Value                                        = 0x00000000;
1739 
1740             DW2.Value                                        = 0x00000000;
1741 
1742             DW3.Value                                        = 0x00000000;
1743 
1744             DW4.Value                                        = 0x00000000;
1745             //DW4.FilmGrainSampleTemplateWriteReadControl      = FILM_GRAIN_SAMPLE_TEMPLATE_WRITEREAD_CONTROL_READ;
1746 
1747             DW5.Value                                        = 0x00000000;
1748 
1749             DW6.Value                                        = 0x00000000;
1750         }
1751 
1752         static const size_t dwSize = 6;
1753         static const size_t byteSize = 24;
1754     };
1755 
1756     //!
1757     //! \brief AVP_SURFACE_STATE
1758     //! \details
1759     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
1760     //!     all AVP Commands. Each AVP command has assigned a media instruction
1761     //!     command as defined in DWord 0, BitField 22:16.
1762     //!
1763     //!     The AVP_SURFACE_STATE command is responsible for defining the frame
1764     //!     buffer pitch and the offset of the chroma component.
1765     //!     This is a picture level state command and is shared by both encoding and
1766     //!     decoding processes.
1767     //!     For Decoder, this command is issued once per surface type. There is one
1768     //!     reconstructed surface, 8 reference pictures surfaces and one optional
1769     //!     IntraBC Decoded Surface (only if IBC is ON).
1770     //!     For Encoder, this command is issued once per surface type. There are 3
1771     //!     surface types :source, reference and dst. Hence, all reference frames
1772     //!     are defined with the same surface command.
1773     //!     Tile-Yf and Tile-Ys are not supported in Gen12, but HW interface still
1774     //!     need to keep these bits as reserved bits.
1775     //!     Note : When NV12 and Tile Y are being used, full pitch and interleaved
1776     //!     UV is always in use. U and V Xoffset must be set to 0; U and V Yoffset
1777     //!     must be 16-pixel aligned. This Surface State is not the same as that of
1778     //!     the 3D engine and of the MFX pipeline. For 10-bit pixel, P010 surface
1779     //!     definition is being used.
1780     //!
1781     struct AVP_SURFACE_STATE_CMD
1782     {
1783         union
1784         {
1785             struct
1786             {
1787                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
1788                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
1789                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
1790                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
1791                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
1792                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
1793             };
1794             uint32_t                     Value;
1795         } DW0;
1796         union
1797         {
1798             struct
1799             {
1800                 uint32_t                 SurfacePitchMinus1                               : __CODEGEN_BITFIELD( 0, 16)    ; //!< Surface Pitch Minus1
1801                 uint32_t                 Reserved49                                       : __CODEGEN_BITFIELD(17, 27)    ; //!< Reserved
1802                 uint32_t                 SurfaceId                                        : __CODEGEN_BITFIELD(28, 31)    ; //!< SURFACE_ID
1803             };
1804             uint32_t                     Value;
1805         } DW1;
1806         union
1807         {
1808             struct
1809             {
1810                 uint32_t                 YOffsetForUCbInPixel                             : __CODEGEN_BITFIELD( 0, 14)    ; //!< Y Offset for U(Cb) in pixel
1811                 uint32_t                 Reserved79                                       : __CODEGEN_BITFIELD(15, 26)    ; //!< Reserved
1812                 uint32_t                 SurfaceFormat                                    : __CODEGEN_BITFIELD(27, 31)    ; //!< SURFACE_FORMAT
1813             };
1814             uint32_t                     Value;
1815         } DW2;
1816         union
1817         {
1818             struct
1819             {
1820                 uint32_t                 DefaultAlphaValue                                : __CODEGEN_BITFIELD( 0, 15)    ; //!< Default Alpha Value
1821                 uint32_t                 YOffsetForVCr                                    : __CODEGEN_BITFIELD(16, 31)    ; //!< Y Offset for V(Cr)
1822             };
1823             uint32_t                     Value;
1824         } DW3;
1825         union
1826         {
1827             struct
1828             {
1829                 uint32_t                 MemoryCompressionEnableForAv1IntraFrame          : __CODEGEN_BITFIELD( 0,  0)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1830                 uint32_t                 MemoryCompressionEnableForAv1LastFrame           : __CODEGEN_BITFIELD( 1,  1)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1831                 uint32_t                 MemoryCompressionEnableForAv1Last2Frame          : __CODEGEN_BITFIELD( 2,  2)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1832                 uint32_t                 MemoryCompressionEnableForAv1Last3Frame          : __CODEGEN_BITFIELD( 3,  3)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1833                 uint32_t                 MemoryCompressionEnableForAv1GoldenFrame         : __CODEGEN_BITFIELD( 4,  4)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1834                 uint32_t                 MemoryCompressionEnableForAv1BwdrefFrame         : __CODEGEN_BITFIELD( 5,  5)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1835                 uint32_t                 MemoryCompressionEnableForAv1Altref2Frame        : __CODEGEN_BITFIELD( 6,  6)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1836                 uint32_t                 MemoryCompressionEnableForAv1AltrefFrame         : __CODEGEN_BITFIELD( 7,  7)    ; //!< MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1837                 uint32_t                 CompressionTypeForIntraFrame                     : __CODEGEN_BITFIELD( 8,  8)    ; //!< COMPRESSION_TYPE_FOR_INTRA_FRAME
1838                 uint32_t                 CompressionTypeForLastFrame                      : __CODEGEN_BITFIELD( 9,  9)    ; //!< COMPRESSION_TYPE_FOR_LAST_FRAME
1839                 uint32_t                 CompressionTypeForLast2Frame                     : __CODEGEN_BITFIELD(10, 10)    ; //!< COMPRESSION_TYPE_FOR_LAST2_FRAME
1840                 uint32_t                 CompressionTypeForLast3Frame                     : __CODEGEN_BITFIELD(11, 11)    ; //!< COMPRESSION_TYPE_FOR_LAST3_FRAME
1841                 uint32_t                 CompressionTypeForGoldenFrame                    : __CODEGEN_BITFIELD(12, 12)    ; //!< COMPRESSION_TYPE_FOR_GOLDEN_FRAME
1842                 uint32_t                 CompressionTypeForBwdrefFrame                    : __CODEGEN_BITFIELD(13, 13)    ; //!< COMPRESSION_TYPE_FOR_BWDREF_FRAME
1843                 uint32_t                 CompressionTypeForAltref2Frame                   : __CODEGEN_BITFIELD(14, 14)    ; //!< COMPRESSION_TYPE_FOR_ALTREF2_FRAME
1844                 uint32_t                 CompressionTypeForAltrefFrame                    : __CODEGEN_BITFIELD(15, 15)    ; //!< COMPRESSION_TYPE_FOR_ALTREF_FRAME
1845                 uint32_t                 CompressionFormat                                : __CODEGEN_BITFIELD(16, 20)    ; //!< COMPRESSION_FORMAT
1846                 uint32_t                 Reserved149                                      : __CODEGEN_BITFIELD(21, 31)    ; //!< Reserved
1847             };
1848             uint32_t                     Value;
1849         } DW4;
1850 
1851         //! \name Local enumerations
1852 
1853         enum MEDIA_INSTRUCTION_COMMAND
1854         {
1855             MEDIA_INSTRUCTION_COMMAND_SURFACESTATE                           = 1, //!< No additional details
1856         };
1857 
1858         //! \brief MEDIA_INSTRUCTION_OPCODE
1859         //! \details
1860         //!     Codec/Engine Name = AVP = 3h
1861         enum MEDIA_INSTRUCTION_OPCODE
1862         {
1863             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
1864         };
1865 
1866         enum PIPELINE_TYPE
1867         {
1868             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
1869         };
1870 
1871         enum COMMAND_TYPE
1872         {
1873             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
1874         };
1875 
1876         enum SURFACE_ID
1877         {
1878             SURFACE_ID_RECONSTRUCTEDPICTURE                                  = 0, //!< This is for the reconstructed picture surface state
1879             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.
1880             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.
1881             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.
1882             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.
1883             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.
1884             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.
1885             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.
1886             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.
1887             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.
1888         };
1889 
1890         //! \brief SURFACE_FORMAT
1891         //! \details
1892         //!     Specifies the format of the surface. This field should be ignored for
1893         //!     now. HW should use the definition in AVP_PIC_STATE instead. (HW team
1894         //!     needs to double check on this ???)
1895         enum SURFACE_FORMAT
1896         {
1897             SURFACE_FORMAT_P010VARIANT                                       = 3, //!< No additional details
1898             SURFACE_FORMAT_PLANAR4208                                        = 4, //!< No additional details
1899             SURFACE_FORMAT_P010                                              = 13, //!< No additional details
1900         };
1901 
1902         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1903         //! \details
1904         //!     This bit is for AV1 Intra Frame (Reference Picture 0).
1905         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME
1906         {
1907             MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1908             MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1909         };
1910 
1911         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1912         //! \details
1913         //!     This bit is for AV1 Last Frame (Reference Picture 1).
1914         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME
1915         {
1916             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1917             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1918         };
1919 
1920         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1921         //! \details
1922         //!     This bit is for AV1 Last2 Frame (Reference Picture 2).
1923         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME
1924         {
1925             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1926             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1927         };
1928 
1929         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1930         //! \details
1931         //!     This bit is for AV1 Last3 Frame (Reference Picture 3).
1932         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME
1933         {
1934             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1935             MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1936         };
1937 
1938         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1939         //! \details
1940         //!     This bit is for AV1 Golden Frame (Reference Picture 4).
1941         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME
1942         {
1943             MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1944             MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1945         };
1946 
1947         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1948         //! \details
1949         //!     This bit is for AV1 Bwdref Frame (Reference Picture 5).
1950         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME
1951         {
1952             MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1953             MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1954         };
1955 
1956         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1957         //! \details
1958         //!     This bit is for AV1Altref2 Frame (Reference Picture 6).
1959         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME
1960         {
1961             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1962             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1963         };
1964 
1965         //! \brief MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1966         //! \details
1967         //!     This bit is for AV1Altref Frame (Reference Picture 7).
1968         enum MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME
1969         {
1970             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONDISABLE = 0, //!< No additional details
1971             MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONENABLE = 1, //!< No additional details
1972         };
1973 
1974         //! \brief COMPRESSION_TYPE_FOR_INTRA_FRAME
1975         //! \details
1976         //!     This bit is for Intra Frame (Reference Picture 0). Valid only when
1977         //!     Memory Compression for Intra Frame is enabled.
1978         enum COMPRESSION_TYPE_FOR_INTRA_FRAME
1979         {
1980             COMPRESSION_TYPE_FOR_INTRA_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
1981             COMPRESSION_TYPE_FOR_INTRA_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
1982         };
1983 
1984         //! \brief COMPRESSION_TYPE_FOR_LAST_FRAME
1985         //! \details
1986         //!     This bit is for AV1 Last Frame (Reference Picture 1). Valid only when
1987         //!     Memory Compression for Last Frameis enabled.
1988         enum COMPRESSION_TYPE_FOR_LAST_FRAME
1989         {
1990             COMPRESSION_TYPE_FOR_LAST_FRAME_MEDIACOMPRESSIONENABLED          = 0, //!< No additional details
1991             COMPRESSION_TYPE_FOR_LAST_FRAME_RENDERCOMPRESSIONENABLED         = 1, //!< No additional details
1992         };
1993 
1994         //! \brief COMPRESSION_TYPE_FOR_LAST2_FRAME
1995         //! \details
1996         //!     This bit is for AV1 Last2 Frame (Reference Picture 2). Valid only when
1997         //!     Memory Compression for Last2 Frame is enabled.
1998         enum COMPRESSION_TYPE_FOR_LAST2_FRAME
1999         {
2000             COMPRESSION_TYPE_FOR_LAST2_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
2001             COMPRESSION_TYPE_FOR_LAST2_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
2002         };
2003 
2004         //! \brief COMPRESSION_TYPE_FOR_LAST3_FRAME
2005         //! \details
2006         //!     This bit is for AV1 Last3 Frame (Reference Picture 3). Valid only when
2007         //!     Memory Compression for Last3 Frameis enabled.
2008         enum COMPRESSION_TYPE_FOR_LAST3_FRAME
2009         {
2010             COMPRESSION_TYPE_FOR_LAST3_FRAME_MEDIACOMPRESSIONENABLED         = 0, //!< No additional details
2011             COMPRESSION_TYPE_FOR_LAST3_FRAME_RENDERCOMPRESSIONENABLED        = 1, //!< No additional details
2012         };
2013 
2014         //! \brief COMPRESSION_TYPE_FOR_GOLDEN_FRAME
2015         //! \details
2016         //!     This bit is for AV1 Golden Frame (Reference Picture 4). Valid only when
2017         //!     Memory Compression for Golden Frame is enabled.
2018         enum COMPRESSION_TYPE_FOR_GOLDEN_FRAME
2019         {
2020             COMPRESSION_TYPE_FOR_GOLDEN_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
2021             COMPRESSION_TYPE_FOR_GOLDEN_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
2022         };
2023 
2024         //! \brief COMPRESSION_TYPE_FOR_BWDREF_FRAME
2025         //! \details
2026         //!     This bit is for AV1 Bwdref Frame (Reference Picture 5). Valid only when
2027         //!     Memory Compression for Bwdref Frame is enabled.
2028         enum COMPRESSION_TYPE_FOR_BWDREF_FRAME
2029         {
2030             COMPRESSION_TYPE_FOR_BWDREF_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
2031             COMPRESSION_TYPE_FOR_BWDREF_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
2032         };
2033 
2034         //! \brief COMPRESSION_TYPE_FOR_ALTREF2_FRAME
2035         //! \details
2036         //!     This bit is for AV1 Altref2 Frame (Reference Picture 6). Valid only when
2037         //!     Memory Compression for Altref2 Frame is enabled.
2038         enum COMPRESSION_TYPE_FOR_ALTREF2_FRAME
2039         {
2040             COMPRESSION_TYPE_FOR_ALTREF2_FRAME_MEDIACOMPRESSIONENABLED       = 0, //!< No additional details
2041             COMPRESSION_TYPE_FOR_ALTREF2_FRAME_RENDERCOMPRESSIONENABLED      = 1, //!< No additional details
2042         };
2043 
2044         //! \brief COMPRESSION_TYPE_FOR_ALTREF_FRAME
2045         //! \details
2046         //!     This bit is for AV1 Altref Frame (Reference Picture 7). Valid only when
2047         //!     Memory Compression for Altref Frame is enabled.
2048         enum COMPRESSION_TYPE_FOR_ALTREF_FRAME
2049         {
2050             COMPRESSION_TYPE_FOR_ALTREF_FRAME_MEDIACOMPRESSIONENABLED        = 0, //!< No additional details
2051             COMPRESSION_TYPE_FOR_ALTREF_FRAME_RENDERCOMPRESSIONENABLED       = 1, //!< No additional details
2052         };
2053 
2054         //! \brief COMPRESSION_FORMAT
2055         //! \details
2056         //!     Specifies the Compression Format.
2057         enum COMPRESSION_FORMAT
2058         {
2059             COMPRESSION_FORMAT_RGBA16FLOAT                                   = 1, //!< No additional details
2060             COMPRESSION_FORMAT_Y210                                          = 2, //!< No additional details
2061             COMPRESSION_FORMAT_YUY2                                          = 3, //!< No additional details
2062             COMPRESSION_FORMAT_Y410_1010102                                  = 4, //!< No additional details
2063             COMPRESSION_FORMAT_Y216                                          = 5, //!< No additional details
2064             COMPRESSION_FORMAT_Y416                                          = 6, //!< No additional details
2065             COMPRESSION_FORMAT_P010                                          = 7, //!< No additional details
2066             COMPRESSION_FORMAT_P016                                          = 8, //!< No additional details
2067             COMPRESSION_FORMAT_AYUV                                          = 9, //!< No additional details
2068             COMPRESSION_FORMAT_ARGB8B                                        = 10, //!< No additional details
2069             COMPRESSION_FORMAT_YCRCBSWAPY                                    = 11, //!< No additional details
2070             COMPRESSION_FORMAT_YCRCBSWAPUV                                   = 12, //!< No additional details
2071             COMPRESSION_FORMAT_YCRCBSWAPUVY                                  = 13, //!< No additional details
2072             COMPRESSION_FORMAT_RGB10B                                        = 14, //!< No additional details
2073             COMPRESSION_FORMAT_NV21NV12                                      = 15, //!< No additional details
2074         };
2075 
2076         //! \name Initializations
2077 
2078         //! \brief Explicit member initialization function
AVP_SURFACE_STATE_CMDAVP_SURFACE_STATE_CMD2079         AVP_SURFACE_STATE_CMD()
2080         {
2081             DW0.Value                                        = 0x71810003;
2082             //DW0.DwordLength                                  = GetOpLength(dwSize);
2083             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_SURFACESTATE;
2084             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
2085             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
2086             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
2087 
2088             DW1.Value                                        = 0x00000000;
2089             //DW1.SurfaceId                                    = SURFACE_ID_RECONSTRUCTEDPICTURE;
2090 
2091             DW2.Value                                        = 0x00000000;
2092             //DW2.SurfaceFormat                                = 0;
2093 
2094             DW3.Value                                        = 0x00000000;
2095 
2096             DW4.Value                                        = 0x00000000;
2097             //DW4.MemoryCompressionEnableForAv1IntraFrame      = MEMORY_COMPRESSION_ENABLE_FOR_AV1_INTRA_FRAME_MEMORYCOMPRESSIONDISABLE;
2098             //DW4.MemoryCompressionEnableForAv1LastFrame       = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST_FRAME_MEMORYCOMPRESSIONDISABLE;
2099             //DW4.MemoryCompressionEnableForAv1Last2Frame      = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST2_FRAME_MEMORYCOMPRESSIONDISABLE;
2100             //DW4.MemoryCompressionEnableForAv1Last3Frame      = MEMORY_COMPRESSION_ENABLE_FOR_AV1_LAST3_FRAME_MEMORYCOMPRESSIONDISABLE;
2101             //DW4.MemoryCompressionEnableForAv1GoldenFrame     = MEMORY_COMPRESSION_ENABLE_FOR_AV1_GOLDEN_FRAME_MEMORYCOMPRESSIONDISABLE;
2102             //DW4.MemoryCompressionEnableForAv1BwdrefFrame     = MEMORY_COMPRESSION_ENABLE_FOR_AV1_BWDREF_FRAME_MEMORYCOMPRESSIONDISABLE;
2103             //DW4.MemoryCompressionEnableForAv1Altref2Frame    = MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF2_FRAME_MEMORYCOMPRESSIONDISABLE;
2104             //DW4.MemoryCompressionEnableForAv1AltrefFrame     = MEMORY_COMPRESSION_ENABLE_FOR_AV1_ALTREF_FRAME_MEMORYCOMPRESSIONDISABLE;
2105             //DW4.CompressionTypeForIntraFrame                 = COMPRESSION_TYPE_FOR_INTRA_FRAME_MEDIACOMPRESSIONENABLED;
2106             //DW4.CompressionTypeForLastFrame                  = COMPRESSION_TYPE_FOR_LAST_FRAME_MEDIACOMPRESSIONENABLED;
2107             //DW4.CompressionTypeForLast2Frame                 = COMPRESSION_TYPE_FOR_LAST2_FRAME_MEDIACOMPRESSIONENABLED;
2108             //DW4.CompressionTypeForLast3Frame                 = COMPRESSION_TYPE_FOR_LAST3_FRAME_MEDIACOMPRESSIONENABLED;
2109             //DW4.CompressionTypeForGoldenFrame                = COMPRESSION_TYPE_FOR_GOLDEN_FRAME_MEDIACOMPRESSIONENABLED;
2110             //DW4.CompressionTypeForBwdrefFrame                = COMPRESSION_TYPE_FOR_BWDREF_FRAME_MEDIACOMPRESSIONENABLED;
2111             //DW4.CompressionTypeForAltref2Frame               = COMPRESSION_TYPE_FOR_ALTREF2_FRAME_MEDIACOMPRESSIONENABLED;
2112             //DW4.CompressionTypeForAltrefFrame                = COMPRESSION_TYPE_FOR_ALTREF_FRAME_MEDIACOMPRESSIONENABLED;
2113             //DW4.CompressionFormat                            = 0;
2114 
2115         }
2116 
2117         static const size_t dwSize = 5;
2118         static const size_t byteSize = 20;
2119     };
2120 
2121     //!
2122     //! \brief AVP_SEGMENT_STATE
2123     //! \details
2124     //!     When segmentation is enabled, this Segment State command is issued
2125     //!     onceper segment. There can be maximum 8 segments specified to decode a
2126     //!     given frame, so this Segment State Command can be issued maximum 8
2127     //!     times. It is assumed that there is no gap in segment IDs. So, when the
2128     //!     AVP PIC States specified that the number of active
2129     //!     When segmentation is disabled, driver still sends out this command once
2130     //!     for segment id = 0. HW needs to check the segmentation enable flag from
2131     //!     AVP_PIC_STATE Command as well to distinguish from the case when
2132     //!     segmentation is enabled for segment id = 0.
2133     //!     Each segment can have its own specification of enabling any one of the 8
2134     //!     features defined in AV1 and their corresponding feature data. When a
2135     //!     feature is not enabled, its feature data is defaulted to 0. When
2136     //!     segmentation is not enabled, all the features are disabled and their
2137     //!     corresponding feature data are set to 0.
2138     //!     style="margin:0in 0in 8pt">Segment State Command also provides other
2139     //!     segement related parameters.
2140     //!     style="margin:0in 0in 8pt">It is assumed that HW is keeping a copy of
2141     //!     the complete AV1 QM Matrix Tablefor all color components inside its
2142     //!     internal memory, and Driver only needs to send the qm_level as index
2143     //!     into this Table.
2144     //!
2145     struct AVP_SEGMENT_STATE_CMD
2146     {
2147         union
2148         {
2149             struct
2150             {
2151                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2152                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2153                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2154                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2155                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2156                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2157             };
2158             uint32_t                     Value;
2159         } DW0;
2160         union
2161         {
2162             struct
2163             {
2164                 uint32_t                 SegmentId                                        : __CODEGEN_BITFIELD( 0,  2)    ; //!< Segment ID
2165                 uint32_t                 Reserved35                                       : __CODEGEN_BITFIELD( 3, 31)    ; //!< Reserved
2166             };
2167             uint32_t                     Value;
2168         } DW1;
2169         union
2170         {
2171             struct
2172             {
2173                 uint32_t                 SegmentFeatureMask                               : __CODEGEN_BITFIELD( 0,  7)    ; //!< Segment Feature Mask
2174                 uint32_t                 SegmentDeltaQindex                               : __CODEGEN_BITFIELD( 8, 16)    ; //!< Segment Delta Qindex
2175                 uint32_t                 SegmentBlockSkipFlag                             : __CODEGEN_BITFIELD(17, 17)    ; //!< Segment Block Skip Flag
2176                 uint32_t                 SegmentBlockGlobalmvFlag                         : __CODEGEN_BITFIELD(18, 18)    ; //!< Segment Block GlobalMV Flag
2177                 uint32_t                 SegmentLosslessFlag                              : __CODEGEN_BITFIELD(19, 19)    ; //!< Segment Lossless Flag
2178                 uint32_t                 SegmentLumaYQmLevel                              : __CODEGEN_BITFIELD(20, 23)    ; //!< Segment Luma Y QM Level
2179                 uint32_t                 SegmentChromaUQmLevel                            : __CODEGEN_BITFIELD(24, 27)    ; //!< Segment Chroma U QM Level
2180                 uint32_t                 SegmentChromaVQmLevel                            : __CODEGEN_BITFIELD(28, 31)    ; //!< Segment Chroma V QM Level
2181             };
2182             uint32_t                     Value;
2183         } DW2;
2184         union
2185         {
2186             struct
2187             {
2188                 uint32_t                 SegmentDeltaLoopFilterLevelLumaVertical          : __CODEGEN_BITFIELD( 0,  6)    ; //!< Segment Delta Loop Filter Level Luma Vertical
2189                 uint32_t                 SegmentDeltaLoopFilterLevelLumaHorizontal        : __CODEGEN_BITFIELD( 7, 13)    ; //!< Segment Delta Loop Filter Level Luma Horizontal
2190                 uint32_t                 SegmentDeltaLoopFilterLevelChromaU               : __CODEGEN_BITFIELD(14, 20)    ; //!< Segment Delta Loop Filter Level Chroma U
2191                 uint32_t                 SegmentDeltaLoopFilterLevelChromaV               : __CODEGEN_BITFIELD(21, 27)    ; //!< Segment Delta Loop Filter Level Chroma V
2192                 uint32_t                 SegmentReferenceFrame                            : __CODEGEN_BITFIELD(28, 30)    ; //!< Segment Reference Frame
2193                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
2194             };
2195             uint32_t                     Value;
2196         } DW3;
2197 
2198         //! \name Local enumerations
2199 
2200         enum MEDIA_INSTRUCTION_COMMAND
2201         {
2202             MEDIA_INSTRUCTION_COMMAND_AVPSEGMENTSTATE                        = 50, //!< No additional details
2203         };
2204 
2205         //! \brief MEDIA_INSTRUCTION_OPCODE
2206         //! \details
2207         //!     Codec/Engine Name = AVP = 3h
2208         enum MEDIA_INSTRUCTION_OPCODE
2209         {
2210             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2211         };
2212 
2213         enum PIPELINE_TYPE
2214         {
2215             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2216         };
2217 
2218         enum COMMAND_TYPE
2219         {
2220             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2221         };
2222 
2223         //! \name Initializations
2224 
2225         //! \brief Explicit member initialization function
AVP_SEGMENT_STATE_CMDAVP_SEGMENT_STATE_CMD2226         AVP_SEGMENT_STATE_CMD()
2227         {
2228             DW0.Value                                        = 0x71b20002;
2229             //DW0.DwordLength                                  = GetOpLength(dwSize);
2230             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPSEGMENTSTATE;
2231             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
2232             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
2233             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
2234 
2235             DW1.Value                                        = 0x00000000;
2236 
2237             DW2.Value                                        = 0x00000000;
2238 
2239             DW3.Value                                        = 0x00000000;
2240 
2241         }
2242 
2243         static const size_t dwSize = 4;
2244         static const size_t byteSize = 16;
2245     };
2246 
2247     //!
2248     //! \brief AVP_PIPE_BUF_ADDR_STATE
2249     //! \details
2250     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
2251     //!     all AVP Commands. Each AVP command has assigned a media instruction
2252     //!     command as defined in DWord 0, BitField 22:16.
2253     //!
2254     //!     This state command provides the physical memory base addresses for all
2255     //!     row store buffers, column store buffers (for tile column and in
2256     //!     scalability mode), reconstructed output and reference frame buffers, and
2257     //!     auxiliary data buffers (MV, segment map, etc.) that are required by the
2258     //!     AV1 decoding and encoding process.
2259     //!     This is a frame level state command and is shared by both encoding and
2260     //!     decoding processes.
2261     //!     AVP is a tile based pipeline and is a stateless pipeline, hence all
2262     //!     sequence level, frame level, and segment level state commands must be
2263     //!     resent to process each tile.
2264     //!     Memory compression may be applicable to some of these buffers for BW
2265     //!     saving.
2266     //!     Note : there is no buffer to store the 16 QM table sets, they are
2267     //!     implemented directly inside the HW pipeline.
2268     //!
2269     struct AVP_PIPE_BUF_ADDR_STATE_CMD
2270     {
2271         union
2272         {
2273             struct
2274             {
2275                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2276                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2277                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2278                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2279                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2280                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2281             };
2282             uint32_t                     Value;
2283         } DW0;
2284         SPLITBASEADDRESS64BYTEALIGNED_CMD        ReferenceFrameBufferBaseAddressRefaddr07[8];                             //!< DW1..16, Reference Frame Buffer Base Address (RefAddr[0-7])
2285         MEMORYADDRESSATTRIBUTES_CMD              ReferenceFrameBufferBaseAddressAttributes;                               //!< DW17, Reference Frame Buffer Base Address Attributes
2286         SPLITBASEADDRESS4KBYTEALIGNED_CMD        DecodedOutputFrameBufferAddress;                                         //!< DW18..19, Decoded Output Frame Buffer Address
2287         MEMORYADDRESSATTRIBUTES_CMD              DecodedOutputFrameBufferAddressAttributes;                               //!< DW20, Decoded Output Frame Buffer Address Attributes
2288         uint32_t                                 Reserved672[3];                                                          //!< Reserved
2289         SPLITBASEADDRESS4KBYTEALIGNED_CMD        IntrabcDecodedOutputFrameBufferAddress;                                  //!< DW24..25, IntraBC Decoded Output Frame Buffer Address
2290         MEMORYADDRESSATTRIBUTES_CMD              IntrabcDecodedOutputFrameBufferAddressAttributes;                        //!< DW26, IntraBC Decoded Output Frame Buffer Address Attributes
2291         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdfTablesInitializationBufferAddress;                                    //!< DW27..28, CDF Tables Initialization Buffer Address
2292         MEMORYADDRESSATTRIBUTES_CMD              CdfTablesInitializationBufferAddressAttributes;                          //!< DW29, CDF Tables Initialization Buffer Address Attributes
2293         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdfTablesBackwardAdaptationBufferAddress;                                //!< DW30..31, CDF Tables Backward Adaptation Buffer Address
2294         MEMORYADDRESSATTRIBUTES_CMD              CdfTablesBackwardAdaptationBufferAddressAttributes;                      //!< DW32, CDF Tables Backward Adaptation Buffer Address Attributes
2295         SPLITBASEADDRESS64BYTEALIGNED_CMD        Av1SegmentIdReadBufferAddress;                                           //!< DW33..34, AV1 Segment ID Read Buffer Address
2296         MEMORYADDRESSATTRIBUTES_CMD              Av1SegmentIdReadBufferAddressAttributes;                                 //!< DW35, AV1 Segment ID Read Buffer Address Attributes
2297         SPLITBASEADDRESS64BYTEALIGNED_CMD        Av1SegmentIdWriteBufferAddress;                                          //!< DW36..37, AV1 Segment ID Write Buffer Address
2298         MEMORYADDRESSATTRIBUTES_CMD              Av1SegmentIdWriteBufferAddressAttributes;                                //!< DW38, AV1 Segment ID Write Buffer Address Attributes
2299         SPLITBASEADDRESS64BYTEALIGNED_CMD        CollocatedMotionVectorTemporalBufferBaseAddressTmvaddr07[8];             //!< DW39..54, Collocated Motion Vector Temporal Buffer Base Address (TmvAddr[0-7])
2300         MEMORYADDRESSATTRIBUTES_CMD              CollocatedMotionVectorTemporalBufferBaseAddressAttributes;               //!< DW55, Collocated Motion Vector Temporal Buffer Base Address Attributes
2301         SPLITBASEADDRESS64BYTEALIGNED_CMD        CurrentFrameMotionVectorWriteBufferAddress;                              //!< DW56..57, Current Frame Motion Vector Write Buffer Address
2302         MEMORYADDRESSATTRIBUTES_CMD              CurrentFrameMotionVectorWriteBufferAddressAttributes;                    //!< DW58, Current Frame Motion Vector Write Buffer Address Attributes
2303         uint32_t                                 Reserved1888[3];                                                         //!< Reserved
2304         SPLITBASEADDRESS64BYTEALIGNED_CMD        BitstreamDecoderEncoderLineRowstoreReadWriteBufferAddress;               //!< DW62..63, Bitstream Decoder/Encoder Line Rowstore Read/Write Buffer Address
2305         MEMORYADDRESSATTRIBUTES_CMD              BitstreamDecoderEncoderLineRowstoreReadWriteBufferAddressAttributes;     //!< DW64, Bitstream Decoder/Encoder Line Rowstore Read/Write Buffer Address Attributes
2306         SPLITBASEADDRESS64BYTEALIGNED_CMD        BitstreamDecoderEncoderTileLineRowstoreReadWriteBufferAddress;           //!< DW65..66, Bitstream Decoder/Encoder Tile Line Rowstore Read/Write Buffer Address
2307         MEMORYADDRESSATTRIBUTES_CMD              BitstreamDecoderEncoderTileLineRowstoreReadWriteBufferAddressAttributes; //!< DW67, Bitstream Decoder/Encoder Tile Line Rowstore Read/Write Buffer Address Attributes
2308         SPLITBASEADDRESS64BYTEALIGNED_CMD        IntraPredictionLineRowstoreReadWriteBufferAddress;                       //!< DW68..69, Intra Prediction Line Rowstore Read/Write Buffer Address
2309         MEMORYADDRESSATTRIBUTES_CMD              IntraPredictionLineRowstoreReadWriteBufferAddressAttributes;             //!< DW70, Intra Prediction Line Rowstore Read/Write Buffer Address Attributes
2310         SPLITBASEADDRESS64BYTEALIGNED_CMD        IntraPredictionTileLineRowstoreReadWriteBufferAddress;                   //!< DW71..72, Intra Prediction Tile Line Rowstore Read/Write Buffer Address
2311         MEMORYADDRESSATTRIBUTES_CMD              IntraPredictionTileLineRowstoreReadWriteBufferAddressAttributes;         //!< DW73, Intra Prediction Tile Line Rowstore Read/Write Buffer Address Attributes
2312         SPLITBASEADDRESS64BYTEALIGNED_CMD        SpatialMotionVectorLineReadWriteBufferAddress;                           //!< DW74..75, Spatial Motion Vector Line Read/Write Buffer Address
2313         MEMORYADDRESSATTRIBUTES_CMD              SpatialMotionVectorLineReadWriteBufferAddressAttributes;                 //!< DW76, Spatial Motion Vector Line Read/Write Buffer Address Attributes
2314         SPLITBASEADDRESS64BYTEALIGNED_CMD        SpatialMotionVectorCodingTileLineReadWriteBufferAddress;                 //!< DW77..78, Spatial Motion Vector Coding Tile Line Read/Write Buffer Address
2315         MEMORYADDRESSATTRIBUTES_CMD              SpatialMotionVectorTileLineReadWriteBufferAddressAttributes;             //!< DW79, Spatial Motion Vector Tile Line Read/Write Buffer Address Attributes
2316         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationMetaTileColumnReadWriteBufferAddress;                     //!< DW80..81, Loop Restoration Meta Tile Column Read/Write Buffer Address
2317         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationMetaTileColumnReadWriteBufferAddressAttributes;           //!< DW82, Loop Restoration Meta Tile Column Read/Write Buffer Address Attributes
2318         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineYBufferAddress;                    //!< DW83..84, Loop Restoration Filter Tile Read/Write Line Y Buffer Address
2319         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineYBufferAddressAttributes;          //!< DW85, Loop Restoration Filter Tile Read/Write Line Y Buffer Address Attributes
2320         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineUBufferAddress;                    //!< DW86..87, Loop Restoration Filter Tile Read/Write Line U Buffer Address
2321         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineUBufferAddressAttributes;          //!< DW88, Loop Restoration Filter Tile Read/Write Line U Buffer Address Attributes
2322         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileReadWriteLineVBufferAddress;                    //!< DW89..90, Loop Restoration Filter Tile Read/Write Line V Buffer Address
2323         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileReadWriteLineVBufferAddressAttributes;          //!< DW91, Loop Restoration Filter Tile Read/Write Line V Buffer Address Attributes
2324         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteYBufferAddress;                              //!< DW92..93, Deblocker Filter Line Read/Write Y Buffer Address
2325         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteYBufferAddressAttributes;                    //!< DW94, Deblocker Filter Line Read/Write Y Buffer Address Attributes
2326         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteUBufferAddress;                              //!< DW95..96, Deblocker Filter Line Read/Write U Buffer Address
2327         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteUBufferAddressAttributes;                    //!< DW97, Deblocker Filter Line Read/Write U Buffer Address Attributes
2328         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterLineReadWriteVBufferAddress;                              //!< DW98..99, Deblocker Filter Line Read/Write V Buffer Address
2329         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterLineReadWriteVBufferAddressAttributes;                    //!< DW100, Deblocker Filter Line Read/Write V Buffer Address Attributes
2330         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteYBufferAddress;                          //!< DW101..102, Deblocker Filter Tile Line Read/Write Y Buffer Address
2331         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteYBufferAddressAttributes;                //!< DW103, Deblocker Filter Tile Line Read/Write Y Buffer Address Attributes
2332         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteVBufferAddress;                          //!< DW104..105, Deblocker Filter Tile Line Read/Write V Buffer Address
2333         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteVBufferAddressAttributes;                //!< DW106, Deblocker Filter Tile Line Read/Write V Buffer Address Attributes
2334         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileLineReadWriteUBufferAddress;                          //!< DW107..108, Deblocker Filter Tile Line Read/Write U Buffer Address
2335         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileLineReadWriteUBufferAddressAttributes;                //!< DW109, Deblocker Filter Tile Line Read/Write U Buffer Address Attributes
2336         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteYBufferAddress;                        //!< DW110..111, Deblocker Filter Tile Column Read/Write Y Buffer Address
2337         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteYBufferAddressAttributes;              //!< DW112, Deblocker Filter Tile Column Read/Write Y Buffer Address Attributes
2338         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteUBufferAddress;                        //!< DW113..114, Deblocker Filter Tile Column Read/Write U Buffer Address
2339         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteUBufferAddressAttributes;              //!< DW115, Deblocker Filter Tile Column Read/Write U Buffer Address Attributes
2340         SPLITBASEADDRESS64BYTEALIGNED_CMD        DeblockerFilterTileColumnReadWriteVBufferAddress;                        //!< DW116..117, Deblocker Filter Tile Column Read/Write V Buffer Address
2341         MEMORYADDRESSATTRIBUTES_CMD              DeblockerFilterTileColumnReadWriteVBufferAddressAttributes;              //!< DW118, Deblocker Filter Tile Column Read/Write V Buffer Address Attributes
2342         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterLineReadWriteBufferAddress;                                    //!< DW119..120, CDEF Filter Line Read/Write Buffer Address
2343         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterLineReadWriteBufferAddressAttributes;                          //!< DW121, CDEF Filter Line Read/Write Buffer Address Attributes
2344         uint32_t                                 Reserved3904[6];                                                         //!< Reserved
2345         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTileLineReadWriteBufferAddress;                                //!< DW128..129, CDEF Filter Tile Line Read/Write Buffer Address
2346         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTileLineReadWriteBufferAddressAttributes;                      //!< DW130, CDEF Filter Tile Line Read/Write Buffer Address Attributes
2347         uint32_t                                 Reserved4192[6];                                                         //!< Reserved
2348         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTileColumnReadWriteBufferAddress;                              //!< DW137..138, CDEF Filter Tile Column Read/Write Buffer Address
2349         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTileColumnReadWriteBufferAddressAttributes;                    //!< DW139, CDEF Filter Tile Column Read/Write Buffer Address Attributes
2350         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterMetaTileLineReadWriteBufferAddress;                            //!< DW140..141, CDEF Filter Meta Tile Line Read/Write Buffer Address
2351         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterMetaTileLineReadWriteBufferAddressAttributes;                  //!< DW142, CDEF Filter Meta Tile Line Read/Write Buffer Address Attributes
2352         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterMetaTileColumnReadWriteBufferAddress;                          //!< DW143..144, CDEF Filter Meta Tile Column Read/Write Buffer Address
2353         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterMetaTileColumnReadWriteBufferAddressAttributes;                //!< DW145, CDEF Filter Meta Tile Column Read/Write Buffer Address Attributes
2354         SPLITBASEADDRESS64BYTEALIGNED_CMD        CdefFilterTopLeftCornerReadWriteBufferAddress;                           //!< DW146..147, CDEF Filter Top-Left Corner Read/Write Buffer Address
2355         MEMORYADDRESSATTRIBUTES_CMD              CdefFilterTopLeftCornerReadWriteBufferAddressAttributes;                 //!< DW148, CDEF Filter Top-Left Corner Read/Write Buffer Address Attributes
2356         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteYBufferAddress;                               //!< DW149..150, Super-Res Tile Column Read/Write Y Buffer Address
2357         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteYBufferAddressAttributes;                     //!< DW151, Super-Res Tile Column Read/Write Y Buffer Address Attributes
2358         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteUBufferAddress;                               //!< DW152..153, Super-Res Tile Column Read/Write U Buffer Address
2359         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteUBufferAddressAttributes;                     //!< DW154, Super-Res Tile Column Read/Write U Buffer Address Attributes
2360         SPLITBASEADDRESS64BYTEALIGNED_CMD        SuperResTileColumnReadWriteVBufferAddress;                               //!< DW155..156, Super-Res Tile Column Read/Write V Buffer Address
2361         MEMORYADDRESSATTRIBUTES_CMD              SuperResTileColumnReadWriteVBufferAddressAttributes;                     //!< DW157, Super-Res Tile Column Read/Write V Buffer Address Attributes
2362         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteYBufferAddress;                  //!< DW158..159, Loop Restoration Filter Tile Column Read/Write Y Buffer Address
2363         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteYBufferAddressAttributes;        //!< DW160, Loop Restoration Filter Tile Column Read/Write Y Buffer Address Attributes
2364         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteUBufferAddress;                  //!< DW161..162, Loop Restoration Filter Tile Column Read/Write U Buffer Address
2365         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteUBufferAddressAttributes;        //!< DW163, Loop Restoration Filter Tile Column Read/Write U Buffer Address Attributes
2366         SPLITBASEADDRESS64BYTEALIGNED_CMD        LoopRestorationFilterTileColumnReadWriteVBufferAddress;                  //!< DW164..165, Loop Restoration Filter Tile Column Read/Write V Buffer Address
2367         MEMORYADDRESSATTRIBUTES_CMD              LoopRestorationFilterTileColumnReadWriteVBufferAddressAttributes;        //!< DW166, Loop Restoration Filter Tile Column Read/Write V Buffer Address Attributes
2368         uint32_t                                 Reserved5344[9];                                                         //!< Reserved
2369         SPLITBASEADDRESS64BYTEALIGNED_CMD        DecodedFrameStatusErrorBufferBaseAddress;                                //!< DW176..177, Decoded Frame Status/Error Buffer Base Address
2370         MEMORYADDRESSATTRIBUTES_CMD              DecodedFrameStatusErrorBufferBaseAddressAttributes;                      //!< DW178, Decoded Frame Status/Error Buffer Base Address Attributes
2371         SPLITBASEADDRESS64BYTEALIGNED_CMD        DecodedBlockDataStreamoutBufferAddress;                                  //!< DW179..180, Decoded Block Data Streamout Buffer Address
2372         MEMORYADDRESSATTRIBUTES_CMD              DecodedBlockDataStreamoutBufferAddressAttributes;                        //!< DW181, Decoded Block Data Streamout Buffer Address Attributes
2373         uint32_t                                 Reserved5824[3];                                                         //!< Reserved
2374         uint32_t                                 Reserved5920[3];                                                         //!< Reserved
2375         SPLITBASEADDRESS64BYTEALIGNED_CMD        OriginalUncompressedPictureSourceBufferAddress;                          //!< DW188, Original Uncompressed Picture Source Buffer Address
2376         MEMORYADDRESSATTRIBUTES_CMD              OriginalUncompressedPictureSourceBufferAddressAttributes;                //!< DW190, Original Uncompressed Picture Source Buffer Address Attributes
2377         SPLITBASEADDRESS64BYTEALIGNED_CMD        DownscaledUncompressedPictureSourceBufferAddress;                        //!< DW191, Downscaled Uncompressed Picture Source Buffer Address
2378         MEMORYADDRESSATTRIBUTES_CMD              DownscaledUncompressedPictureSourceBufferAddressAttributes;              //!< DW193, Downscaled Uncompressed Picture Source Buffer Address Attributes
2379         SPLITBASEADDRESS64BYTEALIGNED_CMD        TileSizeStreamoutBufferAddress;                                          //!< DW194, Tile Size Streamout Buffer Address
2380         MEMORYADDRESSATTRIBUTES_CMD              TileSizeStreamoutBufferAddressAttributes;                                //!< DW196, Tile Size Streamout Buffer Address Attributes
2381         SPLITBASEADDRESS64BYTEALIGNED_CMD        TileStatisticsStreamoutBufferAddress;                                    //!< DW197, Tile Statistics Streamout Buffer Address
2382         MEMORYADDRESSATTRIBUTES_CMD              TileStatisticsStreamoutBufferAddressAttributes;                          //!< DW199, Tile Statistics Streamout Buffer Address Attributes
2383         SPLITBASEADDRESS64BYTEALIGNED_CMD        CUStreamoutBufferAddress;                                                //!< DW200, CU Streamout Buffer Address
2384         MEMORYADDRESSATTRIBUTES_CMD              CUStreamoutBufferAddressAttributes;                                      //!< DW202, CU Streamout Buffer Address Attributes
2385         SPLITBASEADDRESS64BYTEALIGNED_CMD        SSELineReadWriteBufferAddress;                                           //!< DW203, SSE Line Read/Write Buffer Address
2386         MEMORYADDRESSATTRIBUTES_CMD              SSELineReadWriteBufferAddressAttributes;                                 //!< DW205, SSE Line Read/Write Buffer Address Attributes
2387         SPLITBASEADDRESS64BYTEALIGNED_CMD        SSETileLineReadWriteBufferAddress;                                       //!< DW206, SSE Tile Line Read/Write Buffer Address
2388         MEMORYADDRESSATTRIBUTES_CMD              SSETileLineReadWriteBufferAddressAttributes;                             //!< DW208, SSE Tile Line Read/Write Buffer Address Attributes
2389         SPLITBASEADDRESS64BYTEALIGNED_CMD        PostCDEFpixelsBufferAddress;                                             //!< DW209, PostCDEF pixels Buffer Address
2390         MEMORYADDRESSATTRIBUTES_CMD              PostCDEFpixelsBufferAddressAttributes;                                   //!< DW211, PostCDEF pixels Buffer Address Attributes
2391 
2392         //! \name Local enumerations
2393         enum MEDIA_INSTRUCTION_COMMAND
2394         {
2395             MEDIA_INSTRUCTION_COMMAND_AVPPIPEBUFADDRSTATE                    = 2, //!< No additional details
2396         };
2397 
2398         //! \brief MEDIA_INSTRUCTION_OPCODE
2399         //! \details
2400         //!     Codec/Engine Name = AVP = 3h
2401         enum MEDIA_INSTRUCTION_OPCODE
2402         {
2403             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2404         };
2405 
2406         enum PIPELINE_TYPE
2407         {
2408             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2409         };
2410 
2411         enum COMMAND_TYPE
2412         {
2413             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2414         };
2415 
2416         //! \name Initializations
2417 
2418         //! \brief Explicit member initialization function
AVP_PIPE_BUF_ADDR_STATE_CMDAVP_PIPE_BUF_ADDR_STATE_CMD2419         AVP_PIPE_BUF_ADDR_STATE_CMD()
2420         {
2421             DW0.Value                                        = 0x718200ba;
2422             DW0.DwordLength                                  = GetOpLength(dwSize);
2423             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPPIPEBUFADDRSTATE;
2424             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
2425             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
2426             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
2427 
2428             memset(&Reserved672, 0, sizeof(Reserved672));
2429 
2430             memset(&Reserved1888, 0, sizeof(Reserved1888));
2431 
2432             memset(&Reserved3904, 0, sizeof(Reserved3904));
2433 
2434             memset(&Reserved4192, 0, sizeof(Reserved4192));
2435 
2436             memset(&Reserved5344, 0, sizeof(Reserved5344));
2437 
2438             memset(&Reserved5824, 0, sizeof(Reserved5824));
2439 
2440             memset(&Reserved5920, 0, sizeof(Reserved5920));
2441 
2442         }
2443 
2444         static const size_t dwSize = 212;
2445         static const size_t byteSize = 848;
2446     };
2447 
2448     //!
2449     //! \brief AVP_INLOOP_FILTER_STATE
2450     //! \details
2451     //!     The AVP_INLOOP_FILTER_STATE command provides all the frame level syntax
2452     //!     elements and derived parameters that are needed for the processing of
2453     //!     all the post in-loop filters present in the AV1 codec. This includes the
2454     //!     Deblocker, the CDEF (Constrained Directional Enhancement Filter), the
2455     //!     HSRF (Horizontal-only Super-Resolution Filter), and the LRF (Loop
2456     //!     Restoration Filter). These syntax elements can be changed in the
2457     //!     bitstream from frame to frame.
2458     //!     All Post In-Loop Filters are inherently frame-based filtering, but when
2459     //!     implemented in a HW pipeline, the filtering process is performed in a
2460     //!     block by block fashion. In the addition to these frame level states,
2461     //!     there are additional syntax elements and derived parameters that are
2462     //!     generated at SuperBlock level, and are not described here.
2463     //!     Each of these 4 Post In-Loop Filters can be controlled independently and
2464     //!     each can be enabled or disabled independently. Except the HSRF, all the
2465     //!     other 3 filters have separate controls for each color plane as well. To
2466     //!     disable a Post In-Loop Filter, its control parameter(s) are set to 0 -
2467     //!     the default state.
2468     //!     This command should be issued once per tile, even if no post in-loop
2469     //!     filter is enabled for decoding the current frame. When in frame lossless
2470     //!     mode or when IntraBC is enabled, all the Post In-Loop Filters are
2471     //!     disabled for all color planes, this command will provide the default
2472     //!     values for all parameters. All syntax elements are then assumed a value
2473     //!     of 0, except otherwise specified in each field of this State Command.
2474     //!     When it is in monochrome video, no filter parameter for the two chroma
2475     //!     planes is present in the bitstream.
2476     //!
2477     struct AVP_INLOOP_FILTER_STATE_CMD
2478     {
2479         union
2480         {
2481             struct
2482             {
2483                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2484                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2485                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2486                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2487                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2488                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2489             };
2490             uint32_t                     Value;
2491         } DW0;
2492         union
2493         {
2494             struct
2495             {
2496                 uint32_t                 LumaYDeblockerFilterLevelVertical                : __CODEGEN_BITFIELD( 0,  5)    ; //!< Luma Y Deblocker Filter Level Vertical
2497                 uint32_t                 LumaYDeblockerFilterLevelHorizontal              : __CODEGEN_BITFIELD( 6, 11)    ; //!< Luma Y Deblocker Filter Level Horizontal
2498                 uint32_t                 ChromaUDeblockerFilterLevel                      : __CODEGEN_BITFIELD(12, 17)    ; //!< Chroma U Deblocker Filter Level
2499                 uint32_t                 ChromaVDeblockerFilterLevel                      : __CODEGEN_BITFIELD(18, 23)    ; //!< Chroma V Deblocker Filter Level
2500                 uint32_t                 DeblockerFilterSharpnessLevel                    : __CODEGEN_BITFIELD(24, 26)    ; //!< Deblocker Filter Sharpness Level
2501                 uint32_t                 DeblockerFilterModeRefDeltaEnableFlag            : __CODEGEN_BITFIELD(27, 27)    ; //!< Deblocker Filter Mode Ref Delta Enable Flag
2502                 uint32_t                 DeblockerDeltaLfResolution                       : __CODEGEN_BITFIELD(28, 29)    ; //!< Deblocker Delta LF Resolution
2503                 uint32_t                 DeblockerFilterDeltaLfMultiFlag                  : __CODEGEN_BITFIELD(30, 30)    ; //!< Deblocker Filter Delta LF Multi Flag
2504                 uint32_t                 DeblockerFilterDeltaLfPresentFlag                : __CODEGEN_BITFIELD(31, 31)    ; //!< Deblocker Filter Delta LF Present Flag
2505             };
2506             uint32_t                     Value;
2507         } DW1;
2508         union
2509         {
2510             struct
2511             {
2512                 uint32_t                 DeblockerFilterRefDeltas0                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Ref Deltas[0]
2513                 uint32_t                 Reserved71                                       : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2514                 uint32_t                 DeblockerFilterRefDeltas1                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Ref Deltas[1]
2515                 uint32_t                 Reserved79                                       : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
2516                 uint32_t                 DeblockerFilterRefDeltas2                        : __CODEGEN_BITFIELD(16, 22)    ; //!< Deblocker Filter Ref Deltas[2]
2517                 uint32_t                 Reserved87                                       : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
2518                 uint32_t                 DeblockerFilterRefDeltas3                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Deblocker Filter Ref Deltas[3]
2519                 uint32_t                 Reserved95                                       : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
2520             };
2521             uint32_t                     Value;
2522         } DW2;
2523         union
2524         {
2525             struct
2526             {
2527                 uint32_t                 DeblockerFilterRefDeltas4                        : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Ref Deltas[4]
2528                 uint32_t                 Reserved103                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2529                 uint32_t                 DeblockerFilterRefDeltas5                        : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Ref Deltas[5]
2530                 uint32_t                 Reserved111                                      : __CODEGEN_BITFIELD(15, 15)    ; //!< Reserved
2531                 uint32_t                 DeblockerFilterRefDeltas6                        : __CODEGEN_BITFIELD(16, 22)    ; //!< Deblocker Filter Ref Deltas[6]
2532                 uint32_t                 Reserved119                                      : __CODEGEN_BITFIELD(23, 23)    ; //!< Reserved
2533                 uint32_t                 DeblockerFilterRefDeltas7                        : __CODEGEN_BITFIELD(24, 30)    ; //!< Deblocker Filter Ref Deltas[7]
2534                 uint32_t                 Reserved127                                      : __CODEGEN_BITFIELD(31, 31)    ; //!< Reserved
2535             };
2536             uint32_t                     Value;
2537         } DW3;
2538         union
2539         {
2540             struct
2541             {
2542                 uint32_t                 DeblockerFilterModeDeltas0                       : __CODEGEN_BITFIELD( 0,  6)    ; //!< Deblocker Filter Mode Deltas[0]
2543                 uint32_t                 Reserved135                                      : __CODEGEN_BITFIELD( 7,  7)    ; //!< Reserved
2544                 uint32_t                 DeblockerFilterModeDeltas1                       : __CODEGEN_BITFIELD( 8, 14)    ; //!< Deblocker Filter Mode Deltas[1]
2545                 uint32_t                 Reserved143                                      : __CODEGEN_BITFIELD(15, 31)    ; //!< Reserved
2546             };
2547             uint32_t                     Value;
2548         } DW4;
2549         union
2550         {
2551             struct
2552             {
2553                 uint32_t                 CdefYStrength0                                   : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF Y Strength[0]
2554                 uint32_t                 CdefYStrength1                                   : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF Y Strength[1]
2555                 uint32_t                 CdefYStrength2                                   : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF Y Strength[2]
2556                 uint32_t                 CdefYStrength3                                   : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF Y Strength[3]
2557                 uint32_t                 Reserved184                                      : __CODEGEN_BITFIELD(24, 27)    ; //!< Reserved
2558                 uint32_t                 CdefBits                                         : __CODEGEN_BITFIELD(28, 29)    ; //!< CDEF Bits
2559                 uint32_t                 CdefFilterDampingFactorMinus3                    : __CODEGEN_BITFIELD(30, 31)    ; //!< CDEF Filter Damping Factor Minus3
2560             };
2561             uint32_t                     Value;
2562         } DW5;
2563         union
2564         {
2565             struct
2566             {
2567                 uint32_t                 CdefYStrength4                                   : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF Y Strength[4]
2568                 uint32_t                 CdefYStrength5                                   : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF Y Strength[5]
2569                 uint32_t                 CdefYStrength6                                   : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF Y Strength[6]
2570                 uint32_t                 CdefYStrength7                                   : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF Y Strength[7]
2571                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2572             };
2573             uint32_t                     Value;
2574         } DW6;
2575         union
2576         {
2577             struct
2578             {
2579                 uint32_t                 CdefUvStrength0                                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF UV Strength[0]
2580                 uint32_t                 CdefUvStrength1                                  : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF UV Strength[1]
2581                 uint32_t                 CdefUvStrength2                                  : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF UV Strength[2]
2582                 uint32_t                 CdefUvStrength3                                  : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF UV Strength[3]
2583                 uint32_t                 Reserved248                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2584             };
2585             uint32_t                     Value;
2586         } DW7;
2587         union
2588         {
2589             struct
2590             {
2591                 uint32_t                 CdefUvStrength4                                  : __CODEGEN_BITFIELD( 0,  5)    ; //!< CDEF UV Strength[4]
2592                 uint32_t                 CdefUvStrength5                                  : __CODEGEN_BITFIELD( 6, 11)    ; //!< CDEF UV Strength[5]
2593                 uint32_t                 CdefUvStrength6                                  : __CODEGEN_BITFIELD(12, 17)    ; //!< CDEF UV Strength[6]
2594                 uint32_t                 CdefUvStrength7                                  : __CODEGEN_BITFIELD(18, 23)    ; //!< CDEF UV Strength[7]
2595                 uint32_t                 Reserved280                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2596             };
2597             uint32_t                     Value;
2598         } DW8;
2599         union
2600         {
2601             struct
2602             {
2603                 uint32_t                 SuperResUpscaledFrameWidthMinus1                 : __CODEGEN_BITFIELD( 0, 15)    ; //!< Super-Res Upscaled Frame Width Minus1
2604                 uint32_t                 SuperResDenom                                    : __CODEGEN_BITFIELD(16, 20)    ; //!< Super-Res Denom
2605                 uint32_t                 Reserved309                                      : __CODEGEN_BITFIELD(21, 31)    ; //!< Reserved
2606             };
2607             uint32_t                     Value;
2608         } DW9;
2609         union
2610         {
2611             struct
2612             {
2613                 uint32_t                 FrameLoopRestorationFilterTypeForLumaY           : __CODEGEN_BITFIELD( 0,  1)    ; //!< Frame Loop Restoration Filter Type for Luma Y
2614                 uint32_t                 FrameLoopRestorationFilterTypeForChromaU         : __CODEGEN_BITFIELD( 2,  3)    ; //!< Frame Loop Restoration Filter Type for Chroma U
2615                 uint32_t                 FrameLoopRestorationFilterTypeForChromaV         : __CODEGEN_BITFIELD( 4,  5)    ; //!< Frame Loop Restoration Filter Type for Chroma V
2616                 uint32_t                 Reserved326                                      : __CODEGEN_BITFIELD( 6,  7)    ; //!< Reserved
2617                 uint32_t                 LoopRestorationUnitSizeForLumaY                  : __CODEGEN_BITFIELD( 8,  9)    ; //!< Loop Restoration Unit Size for Luma Y
2618                 uint32_t                 UseSameLoopRestorationUnitSizeForChromasUvFlag   : __CODEGEN_BITFIELD(10, 10)    ; //!< Use Same Loop Restoration Unit Size for Chromas UV Flag
2619                 uint32_t                 Reserved331                                      : __CODEGEN_BITFIELD(11, 31)    ; //!< Reserved
2620             };
2621             uint32_t                     Value;
2622         } DW10;
2623         union
2624         {
2625             struct
2626             {
2627                 uint32_t                 LumaPlaneXStepQn                                 : __CODEGEN_BITFIELD( 0, 15)    ; //!< Luma Plane x_step_qn
2628                 uint32_t                 Reserved368                                      : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved (for higher precision of x_step_qn)
2629             };
2630             uint32_t                     Value;
2631         } DW11;
2632         union
2633         {
2634             struct
2635             {
2636                 uint32_t                 LumaPlaneX0Qn                                    : __CODEGEN_BITFIELD( 0, 13)    ; //!< Luma Plane x0_qn
2637                 uint32_t                 Reserved398                                      : __CODEGEN_BITFIELD(14, 31)    ; //!< Reserved
2638             };
2639             uint32_t                     Value;
2640         } DW12;
2641         union
2642         {
2643             struct
2644             {
2645                 uint32_t                 ChromaPlaneXStepQn                               : __CODEGEN_BITFIELD( 0, 15)    ; //!< Chroma Plane x_step_qn
2646                 uint32_t                 Reserved432                                      : __CODEGEN_BITFIELD(16, 31)    ; //!< Reserved
2647             };
2648             uint32_t                     Value;
2649         } DW13;
2650         union
2651         {
2652             struct
2653             {
2654                 uint32_t                 ChromaPlaneX0Qn                                  : __CODEGEN_BITFIELD( 0, 13)    ; //!< Chroma Plane x0_qn
2655                 uint32_t                 Reserved462                                      : __CODEGEN_BITFIELD(14, 31)    ; //!< Reserved
2656             };
2657             uint32_t                     Value;
2658         } DW14;
2659 
2660         //! \name Local enumerations
2661 
2662         enum MEDIA_INSTRUCTION_COMMAND
2663         {
2664             MEDIA_INSTRUCTION_COMMAND_AVPINLOOPFILTERSTATE                   = 51, //!< No additional details
2665         };
2666 
2667         //! \brief MEDIA_INSTRUCTION_OPCODE
2668         //! \details
2669         //!     Codec/Engine Name = AV1 = 3h
2670         enum MEDIA_INSTRUCTION_OPCODE
2671         {
2672             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2673         };
2674 
2675         enum PIPELINE_TYPE
2676         {
2677             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2678         };
2679 
2680         enum COMMAND_TYPE
2681         {
2682             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2683         };
2684 
2685         //! \name Initializations
2686 
2687         //! \brief Explicit member initialization function
AVP_INLOOP_FILTER_STATE_CMDAVP_INLOOP_FILTER_STATE_CMD2688         AVP_INLOOP_FILTER_STATE_CMD()
2689         {
2690             DW0.Value                                        = 0x71b3000d;
2691             //DW0.DwordLength                                  = GetOpLength(dwSize);
2692             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPINLOOPFILTERSTATE;
2693             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
2694             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
2695             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
2696 
2697             DW1.Value                                        = 0x00000000;
2698 
2699             DW2.Value                                        = 0x00000000;
2700 
2701             DW3.Value                                        = 0x00000000;
2702 
2703             DW4.Value                                        = 0x00000000;
2704 
2705             DW5.Value                                        = 0x00000000;
2706 
2707             DW6.Value                                        = 0x00000000;
2708 
2709             DW7.Value                                        = 0x00000000;
2710 
2711             DW8.Value                                        = 0x00000000;
2712 
2713             DW9.Value                                        = 0x00000000;
2714 
2715             DW10.Value                                       = 0x00000000;
2716 
2717             DW11.Value                                       = 0x00000000;
2718 
2719             DW12.Value                                       = 0x00000000;
2720 
2721             DW13.Value                                       = 0x00000000;
2722 
2723             DW14.Value                                       = 0x00000000;
2724 
2725         }
2726 
2727         static const size_t dwSize = 15;
2728         static const size_t byteSize = 60;
2729     };
2730 
2731     //!
2732     //! \brief AVP_INTER_PRED_STATE
2733     //! \details
2734     //!     The AVP Pipeline is selected with the Media Instruction Opcode "8h" for
2735     //!     all AVP Commands. Each AVP command has assigned a media instruction
2736     //!     command as defined in DWord 0, BitField 22:16.
2737     //!     AVP supports a 8-reference frames display buffer. But at any given frame
2738     //!     being decoded, only up to 7reference frames out of the 8 can be active.
2739     //!     There are also further constraints on which of these 7frames can be used
2740     //!     for forward and backward reference in the compound mode.
2741     //!     For each inter-codedtile, this command is issued only once.
2742     //!
2743     struct AVP_INTER_PRED_STATE_CMD
2744     {
2745         union
2746         {
2747             struct
2748             {
2749                 uint32_t                 DwordLength                                      : __CODEGEN_BITFIELD( 0, 11)    ; //!< DWORD_LENGTH
2750                 uint32_t                 Reserved12                                       : __CODEGEN_BITFIELD(12, 15)    ; //!< Reserved
2751                 uint32_t                 MediaInstructionCommand                          : __CODEGEN_BITFIELD(16, 22)    ; //!< MEDIA_INSTRUCTION_COMMAND
2752                 uint32_t                 MediaInstructionOpcode                           : __CODEGEN_BITFIELD(23, 26)    ; //!< MEDIA_INSTRUCTION_OPCODE
2753                 uint32_t                 PipelineType                                     : __CODEGEN_BITFIELD(27, 28)    ; //!< PIPELINE_TYPE
2754                 uint32_t                 CommandType                                      : __CODEGEN_BITFIELD(29, 31)    ; //!< COMMAND_TYPE
2755             };
2756             uint32_t                     Value;
2757         } DW0;
2758         union
2759         {
2760             struct
2761             {
2762                 uint32_t                 SavedOrderHintsForAllReferences00                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[0][0]
2763                 uint32_t                 SavedOrderHintsForAllReferences01                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[0][1]
2764                 uint32_t                 SavedOrderHintsForAllReferences02                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[0][2]
2765                 uint32_t                 SavedOrderHintsForAllReferences03                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[0][3]
2766             };
2767             uint32_t                     Value;
2768         } DW1;
2769         union
2770         {
2771             struct
2772             {
2773                 uint32_t                 SavedOrderHintsForAllReferences04                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[0][4]
2774                 uint32_t                 SavedOrderHintsForAllReferences05                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[0][5]
2775                 uint32_t                 SavedOrderHintsForAllReferences06                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[0][6]
2776                 uint32_t                 ActiveReferenceBitmaskForMotionFieldProjection   : __CODEGEN_BITFIELD(24, 31)    ; //!< Active Reference Bitmask for Motion Field Projection
2777             };
2778             uint32_t                     Value;
2779         } DW2;
2780         union
2781         {
2782             struct
2783             {
2784                 uint32_t                 SavedOrderHintsForAllReferences10                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[1][0]
2785                 uint32_t                 SavedOrderHintsForAllReferences11                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[1][1]
2786                 uint32_t                 SavedOrderHintsForAllReferences12                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[1][2]
2787                 uint32_t                 SavedOrderHintsForAllReferences13                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[1][3]
2788             };
2789             uint32_t                     Value;
2790         } DW3;
2791         union
2792         {
2793             struct
2794             {
2795                 uint32_t                 SavedOrderHintsForAllReferences14                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[1][4]
2796                 uint32_t                 SavedOrderHintsForAllReferences15                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[1][5]
2797                 uint32_t                 SavedOrderHintsForAllReferences16                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[1][6]
2798                 uint32_t                 Reserved152                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2799             };
2800             uint32_t                     Value;
2801         } DW4;
2802         union
2803         {
2804             struct
2805             {
2806                 uint32_t                 SavedOrderHintsForAllReferences20                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[2][0]
2807                 uint32_t                 SavedOrderHintsForAllReferences21                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[2][1]
2808                 uint32_t                 SavedOrderHintsForAllReferences22                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[2][2]
2809                 uint32_t                 SavedOrderHintsForAllReferences23                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[2][3]
2810             };
2811             uint32_t                     Value;
2812         } DW5;
2813         union
2814         {
2815             struct
2816             {
2817                 uint32_t                 SavedOrderHintsForAllReferences24                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[2][4]
2818                 uint32_t                 SavedOrderHintsForAllReferences25                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[2][5]
2819                 uint32_t                 SavedOrderHintsForAllReferences26                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[2][6]
2820                 uint32_t                 Reserved216                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2821             };
2822             uint32_t                     Value;
2823         } DW6;
2824         union
2825         {
2826             struct
2827             {
2828                 uint32_t                 SavedOrderHintsForAllReferences30                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[3][0]
2829                 uint32_t                 SavedOrderHintsForAllReferences31                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[3][1]
2830                 uint32_t                 SavedOrderHintsForAllReferences32                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[3][2]
2831                 uint32_t                 SavedOrderHintsForAllReferences33                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[3][3]
2832             };
2833             uint32_t                     Value;
2834         } DW7;
2835         union
2836         {
2837             struct
2838             {
2839                 uint32_t                 SavedOrderHintsForAllReferences34                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[3][4]
2840                 uint32_t                 SavedOrderHintsForAllReferences35                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[3][5]
2841                 uint32_t                 SavedOrderHintsForAllReferences36                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[3][6]
2842                 uint32_t                 Reserved280                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2843             };
2844             uint32_t                     Value;
2845         } DW8;
2846         union
2847         {
2848             struct
2849             {
2850                 uint32_t                 SavedOrderHintsForAllReferences40                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[4][0]
2851                 uint32_t                 SavedOrderHintsForAllReferences41                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[4][1]
2852                 uint32_t                 SavedOrderHintsForAllReferences42                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[4][2]
2853                 uint32_t                 SavedOrderHintsForAllReferences43                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[4][3]
2854             };
2855             uint32_t                     Value;
2856         } DW9;
2857         union
2858         {
2859             struct
2860             {
2861                 uint32_t                 SavedOrderHintsForAllReferences44                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[4][4]
2862                 uint32_t                 SavedOrderHintsForAllReferences45                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[4][5]
2863                 uint32_t                 SavedOrderHintsForAllReferences46                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[4][6]
2864                 uint32_t                 Reserved344                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2865             };
2866             uint32_t                     Value;
2867         } DW10;
2868         union
2869         {
2870             struct
2871             {
2872                 uint32_t                 SavedOrderHintsForAllReferences50                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[5][0]
2873                 uint32_t                 SavedOrderHintsForAllReferences51                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[5][1]
2874                 uint32_t                 SavedOrderHintsForAllReferences52                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[5][2]
2875                 uint32_t                 SavedOrderHintsForAllReferences53                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[5][3]
2876             };
2877             uint32_t                     Value;
2878         } DW11;
2879         union
2880         {
2881             struct
2882             {
2883                 uint32_t                 SavedOrderHintsForAllReferences54                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[5][4]
2884                 uint32_t                 SavedOrderHintsForAllReferences55                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[5][5]
2885                 uint32_t                 SavedOrderHintsForAllReferences56                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[5][6]
2886                 uint32_t                 Reserved408                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2887             };
2888             uint32_t                     Value;
2889         } DW12;
2890         union
2891         {
2892             struct
2893             {
2894                 uint32_t                 SavedOrderHintsForAllReferences60                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[6][0]
2895                 uint32_t                 SavedOrderHintsForAllReferences61                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[6][1]
2896                 uint32_t                 SavedOrderHintsForAllReferences62                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[6][2]
2897                 uint32_t                 SavedOrderHintsForAllReferences63                : __CODEGEN_BITFIELD(24, 31)    ; //!< Saved Order Hints for All References[6][3]
2898             };
2899             uint32_t                     Value;
2900         } DW13;
2901         union
2902         {
2903             struct
2904             {
2905                 uint32_t                 SavedOrderHintsForAllReferences64                : __CODEGEN_BITFIELD( 0,  7)    ; //!< Saved Order Hints for All References[6][4]
2906                 uint32_t                 SavedOrderHintsForAllReferences65                : __CODEGEN_BITFIELD( 8, 15)    ; //!< Saved Order Hints for All References[6][5]
2907                 uint32_t                 SavedOrderHintsForAllReferences66                : __CODEGEN_BITFIELD(16, 23)    ; //!< Saved Order Hints for All References[6][6]
2908                 uint32_t                 Reserved472                                      : __CODEGEN_BITFIELD(24, 31)    ; //!< Reserved
2909             };
2910             uint32_t                     Value;
2911         } DW14;
2912 
2913         //! \name Local enumerations
2914 
2915         enum MEDIA_INSTRUCTION_COMMAND
2916         {
2917             MEDIA_INSTRUCTION_COMMAND_AVPINTERPREDSTATE                      = 18, //!< No additional details
2918         };
2919 
2920         //! \brief MEDIA_INSTRUCTION_OPCODE
2921         //! \details
2922         //!     Codec/Engine Name = AVP = 3h
2923         enum MEDIA_INSTRUCTION_OPCODE
2924         {
2925             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME                         = 3, //!< No additional details
2926         };
2927 
2928         enum PIPELINE_TYPE
2929         {
2930             PIPELINE_TYPE_UNNAMED2                                           = 2, //!< No additional details
2931         };
2932 
2933         enum COMMAND_TYPE
2934         {
2935             COMMAND_TYPE_PARALLELVIDEOPIPE                                   = 3, //!< No additional details
2936         };
2937 
2938         //! \name Initializations
2939 
2940         //! \brief Explicit member initialization function
AVP_INTER_PRED_STATE_CMDAVP_INTER_PRED_STATE_CMD2941         AVP_INTER_PRED_STATE_CMD()
2942         {
2943             DW0.Value                                        = 0x7192000d;
2944             //DW0.DwordLength                                  = GetOpLength(dwSize);
2945             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_AVPINTERPREDSTATE;
2946             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
2947             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
2948             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
2949 
2950             DW1.Value                                        = 0x00000000;
2951 
2952             DW2.Value                                        = 0x00000000;
2953 
2954             DW3.Value                                        = 0x00000000;
2955 
2956             DW4.Value                                        = 0x00000000;
2957 
2958             DW5.Value                                        = 0x00000000;
2959 
2960             DW6.Value                                        = 0x00000000;
2961 
2962             DW7.Value                                        = 0x00000000;
2963 
2964             DW8.Value                                        = 0x00000000;
2965 
2966             DW9.Value                                        = 0x00000000;
2967 
2968             DW10.Value                                       = 0x00000000;
2969 
2970             DW11.Value                                       = 0x00000000;
2971 
2972             DW12.Value                                       = 0x00000000;
2973 
2974             DW13.Value                                       = 0x00000000;
2975 
2976             DW14.Value                                       = 0x00000000;
2977 
2978         }
2979 
2980         static const size_t dwSize = 15;
2981         static const size_t byteSize = 60;
2982     };
2983 
2984 
2985     //!
2986     //! \brief AVP_PAK_INSERT_OBJECT
2987     //! \details
2988     //!     It is an encoder only command, operating at bitstream level, before and
2989     //!     after SliceData compressed bitstream. It is setup by the header and tail
2990     //!     present flags in the Slice State command. If these flags are set and no
2991     //!     subsequent PAK_INSERT_OBJECT commands are issued, the pipeline will
2992     //!     hang.
2993     //!
2994     //!     The AVP_ PAK_ INSERT _OBJECT command supports both inline and indirect
2995     //!     data payload, but only one can be active at any time. It is issued to
2996     //!     insert a chunk of bits (payload) into the current compressed bitstream
2997     //!     output buffer (specified in the HCP_PAK-BSE Object Base Address field of
2998     //!     the HCP_IND_OBJ_BASE_ADDR_STATE command) starting at its current write
2999     //!     pointer bit position. Hardware will keep track of this write pointer's
3000     //!     byte position and the associated next bit insertion position index.
3001     //!
3002     //!     It is a variable length command when the payload (data to be inserted)
3003     //!     is presented as inline data within the command itself. The inline
3004     //!     payload is a multiple of 32-bit (1 DW), as the data bus to the
3005     //!     compressed bitstream output buffer is 32-bit wide.
3006     //!
3007     //!     The payload data is required to be byte aligned on the left (first
3008     //!     transmitted bit order) and may or may not be byte aligned on the right
3009     //!     (last transmitted bits). The command will specify the bit offset of the
3010     //!     last valid DW. Note that : Stitch Command is used if the beginning
3011     //!     position of data is in bit position. When PAK Insert Command is used the
3012     //!     beginning position must be in byte position.
3013     //!
3014     //!     Multiple insertion commands can be issued back to back in a series. It
3015     //!     is host software's responsibility to make sure their corresponding data
3016     //!     will properly stitch together to form a valid bitstream.
3017     //!
3018     //!     Internally, HCP hardware will keep track of the very last two bytes'
3019     //!     (the very last byte can be a partial byte) values of the previous
3020     //!     insertion. It is required that the next Insertion Object Command or the
3021     //!     next PAK Object Command to perform the start code emulation sequence
3022     //!     check and prevention 0x03 byte insertion with this end condition of the
3023     //!     previous insertion.
3024     //!
3025     //!     The payload data may have already been processed for start code
3026     //!     emulation byte insertion, except the possibility of the last 2 bytes
3027     //!     plus the very last partial byte (if any). Hence, when hardware
3028     //!     performing the concatenation of multiple consecutive insertion commands,
3029     //!     or concatenation of an insertion command and a PAK object command, it
3030     //!     must check and perform the necessary start code emulation byte insert at
3031     //!     the junction.
3032     //!
3033     //!     Data to be inserted can be a valid NAL units or a partial NAL unit. It
3034     //!     can be any encoded syntax elements bit data before the encoded Slice
3035     //!     Data (PAK Object Command) of the current Slice - SPS NAL, PPS NAL, SEI
3036     //!     NAL and Other Non-Slice NAL, Leading_Zero_8_bits (as many bytes as there
3037     //!     is), Start Code , Slice Header. Any encoded syntax elements bit data
3038     //!     after the encoded Slice Data (PAK Object Command) of the current Slice
3039     //!     and prior to  the next encoded Slice Data of the next Slice or prior to
3040     //!     the end of the bitstream, whichever comes first Cabac_Zero_Word or
3041     //!     Trailing_Zero_8bits (as many bytes as there is).
3042     //!
3043     //!     Certain NAL unit has a minimum byte size requirement. As such the
3044     //!     hardware will optionally (enabled by SLICE STATE Command) determines the
3045     //!     number of CABAC_ZERO_WORD to be inserted to the end of the current NAL,
3046     //!     based on the minimum byte size of a NAL and the actual bin count of the
3047     //!     encoded Slice. Since prior to the CABAC_ZERO_WORD insertion, the RBSP or
3048     //!     EBSP is already byte-aligned, so each CABAC_ZERO_WORD insertion is
3049     //!     actually a 3-byte sequence 0x00 00 03.
3050     //!
3051     //!     Context switch interrupt is not supported by this command.
3052     //!
3053     struct AVP_PAK_INSERT_OBJECT_CMD
3054     {
3055         union
3056         {
3057             struct
3058             {
3059                 uint32_t DwordLength : __CODEGEN_BITFIELD(0, 11);               //!< Dword Length
3060                 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15);               //!< Reserved
3061                 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22);  //!< MEDIA_INSTRUCTION_COMMAND
3062                 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26);   //!< MEDIA_INSTRUCTION_OPCODE
3063                 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28);             //!< PIPELINE_TYPE
3064                 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31);              //!< COMMAND_TYPE
3065             };
3066             uint32_t Value;
3067         } DW0;
3068         union
3069         {
3070             struct
3071             {
3072                 uint32_t Reserved0 : __CODEGEN_BITFIELD(0, 0);                                         //!< Reserved
3073                 uint32_t EndofsliceflagLastdstdatainsertcommandflag : __CODEGEN_BITFIELD(1, 1);        //!< EndOfSliceFlag - LastDstDataInsertCommandFlag
3074                 uint32_t LastheaderflagLastsrcheaderdatainsertcommandflag : __CODEGEN_BITFIELD(2, 2);  //!< LastHeaderFlag - LastSrcHeaderDataInsertCommandFlag
3075                 uint32_t Reserved3 : __CODEGEN_BITFIELD(3, 7);                                         //!< EMULATIONFLAG_EMULATIONBYTEBITSINSERTENABLE
3076                 uint32_t DatabitsinlastdwSrcdataendingbitinclusion50 : __CODEGEN_BITFIELD(8, 13);      //!< DataBitsInLastDW - SrCDataEndingBitInclusion[5:0]
3077                 uint32_t Reserved14 : __CODEGEN_BITFIELD(14, 15);                                      //!< Slice Header Indicator
3078                 uint32_t DatabyteoffsetSrcdatastartingbyteoffset10 : __CODEGEN_BITFIELD(16, 17);       //!< DataByteOffset - SrcDataStartingByteOffset[1:0]
3079                 uint32_t Reserved50 : __CODEGEN_BITFIELD(18, 30);                                      //!< Reserved
3080                 uint32_t IndirectPayloadEnable : __CODEGEN_BITFIELD(31, 31);                           //!< INDIRECT_PAYLOAD_ENABLE
3081             };
3082             uint32_t Value;
3083         } DW1;
3084 
3085         //! \name Local enumerations
3086 
3087         enum MEDIA_INSTRUCTION_COMMAND
3088         {
3089             MEDIA_INSTRUCTION_COMMAND_AVPPAKINSERTOBJECT = 34,  //!< No additional details
3090         };
3091 
3092         //! \brief MEDIA_INSTRUCTION_OPCODE
3093         //! \details
3094         //!     Codec/Engine Name = HCP = 3h
3095         enum MEDIA_INSTRUCTION_OPCODE
3096         {
3097             MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 3,  //!< No additional details
3098         };
3099 
3100         enum PIPELINE_TYPE
3101         {
3102             PIPELINE_TYPE_UNNAMED2 = 2,  //!< No additional details
3103         };
3104 
3105         enum COMMAND_TYPE
3106         {
3107             COMMAND_TYPE_PARALLELVIDEOPIPE = 3,  //!< No additional details
3108         };
3109 
3110         //! \brief INDIRECT_PAYLOAD_ENABLE
3111         //! \details
3112         //!     <p>Only one of these two payload modes can be active at any time.</p>
3113         //!     <p>When Slice Size Conformance is enable the Payload(header) must be
3114         //!     inline only so this bit set to MBZ.</p>
3115         enum INDIRECT_PAYLOAD_ENABLE
3116         {
3117             INDIRECT_PAYLOAD_ENABLE_INLINEPAYLOADISUSED   = 0,  //!< No additional details
3118             INDIRECT_PAYLOAD_ENABLE_INDIRECTPAYLOADISUSED = 1,  //!< No additional details
3119         };
3120 
3121         //! \name Initializations
3122 
3123         //! \brief Explicit member initialization function
AVP_PAK_INSERT_OBJECT_CMDAVP_PAK_INSERT_OBJECT_CMD3124         AVP_PAK_INSERT_OBJECT_CMD()
3125         {
3126             DW0.Value = 0x71a20000;
3127             //DW0.MediaInstructionCommand                      = MEDIA_INSTRUCTION_COMMAND_HCPPAKINSERTOBJECT;
3128             //DW0.MediaInstructionOpcode                       = MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME;
3129             //DW0.PipelineType                                 = PIPELINE_TYPE_UNNAMED2;
3130             //DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
3131 
3132             DW1.Value = 0x00000000;
3133             //DW1.IndirectPayloadEnable                        = INDIRECT_PAYLOAD_ENABLE_INLINEPAYLOADISUSED;
3134         }
3135 
3136         static const size_t dwSize   = 2;
3137         static const size_t byteSize = 8;
3138     };
3139 
3140     struct AVP_FILM_GRAIN_STATE_CMD
3141     {
3142     };
3143 };
3144 } // namespace xe_hpm
3145 } // namespace avp
3146 } // namespace vdbox
3147 } // namespace mhw
3148 
3149 #pragma pack()
3150 
3151 #endif  // __MHW_VDBOX_AVP_HWCMD_XE_HPM_H__
3152