Debian Codegraph @

media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_avp_hwcmd_g12_X.h

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