Debian Codegraph @

media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_mfx_cmdpar.h

raw
1 /*
2 * Copyright (c) 2021-2023 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_mfx_cmdpar.h
24 //! \brief MHW command parameters
25 //! \details
26 //!
27
28 #ifndef __MHW_VDBOX_MFX_CMDPAR_H__
29 #define __MHW_VDBOX_MFX_CMDPAR_H__
30
31 #include "mhw_vdbox_cmdpar.h"
32 #include "codec_def_common_jpeg.h"
33 #include "codec_def_common_mpeg2.h"
34
35 #ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
36 #include "mhw_vdbox_mfx_cmdpar_ext.h"
37 #define __MHW_VDBOX_MFX_WRAPPER_EXT(STUFF) STUFF
38 #else
39 #define __MHW_VDBOX_MFX_WRAPPER_EXT(STUFF)
40 #endif
41
42 namespace mhw
43 {
44 namespace vdbox
45 {
46 namespace mfx
47 {
48
49 enum SURFACE_FORMAT
50 {
51 SURFACE_FORMAT_YCRCBNORMAL = 0, //!< No additional details
52 SURFACE_FORMAT_YCRCBSWAPUVY = 1, //!< No additional details
53 SURFACE_FORMAT_YCRCBSWAPUV = 2, //!< No additional details
54 SURFACE_FORMAT_YCRCBSWAPY = 3, //!< No additional details
55 SURFACE_FORMAT_PLANAR4208 = 4, //!< (NV12, IMC1,2,3,4, YV12)
56 SURFACE_FORMAT_PLANAR4118 = 5, //!< Deinterlace Only
57 SURFACE_FORMAT_PLANAR4228 = 6, //!< Deinterlace Only
58 SURFACE_FORMAT_STMMDNSTATISTICS = 7, //!< Deinterlace Only
59 SURFACE_FORMAT_R10G10B10A2UNORM = 8, //!< Sample_8x8 Only
60 SURFACE_FORMAT_R8G8B8A8UNORM = 9, //!< Sample_8x8 Only
61 SURFACE_FORMAT_R8B8UNORM_CRCB = 10, //!< Sample_8x8 Only
62 SURFACE_FORMAT_R8UNORM_CRCB = 11, //!< Sample_8x8 Only
63 SURFACE_FORMAT_Y8UNORM = 12, //!< Sample_8x8 Only
64 };
65
66 //!
67 //! \enum MfxDecoderModeSelect
68 //! \brief MFX decoder mode select
69 //!
70 enum MfxDecoderModeSelect
71 {
72 mfxDecoderModeVld = 0,
73 mfxDecoderModeIt = 1
74 };
75
76 enum CommandsNumberOfAddresses
77 {
78 // MFX Engine Commands
79 MI_BATCH_BUFFER_START_CMD_NUMBER_OF_ADDRESSES = 1, // 2 DW for 1 address field
80 MI_STORE_DATA_IMM_CMD_NUMBER_OF_ADDRESSES = 1, // 2 DW for 1 address field
81 MI_FLUSH_DW_CMD_NUMBER_OF_ADDRESSES = 1, // 2 DW for 1 address field
82 MI_CONDITIONAL_BATCH_BUFFER_END_CMD_NUMBER_OF_ADDRESSES = 1, // 2 DW for 1 address field
83 MI_STORE_REGISTER_MEM_CMD_NUMBER_OF_ADDRESSES = 1, // 2 DW for 1 address field
84 MFX_PIPE_MODE_SELECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
85 MFX_SURFACE_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
86 MFX_PIPE_BUF_ADDR_STATE_CMD_NUMBER_OF_ADDRESSES = 27, // 50 DW for 25 address fields, added 2 for DownScaledReconPicAddr
87 MFX_IND_OBJ_BASE_ADDR_STATE_CMD_NUMBER_OF_ADDRESSES = 5, // 10 DW for 5 address fields
88 MFX_WAIT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
89 MFX_BSP_BUF_BASE_ADDR_STATE_CMD_NUMBER_OF_ADDRESSES = 3, // 2 DW for 3 address fields
90 MFD_AVC_PICID_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
91 MFX_AVC_DIRECTMODE_STATE_CMD_NUMBER_OF_ADDRESSES = 17, // 50 DW for 17 address fields
92 MFX_AVC_IMG_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
93 MFX_QM_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
94 MFX_FQM_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
95 MFX_MPEG2_PIC_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
96 MFX_DBK_OBJECT_CMD_NUMBER_OF_ADDRESSES = 4, // 2 DW for 4 address fields
97 MFX_VP8_PIC_STATE_CMD_NUMBER_OF_ADDRESSES = 2, // 2 DW for 2 address fields
98 MFX_AVC_SLICE_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
99 MFD_AVC_BSD_OBJECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
100 MFD_AVC_DPB_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
101 MFD_AVC_SLICEADDR_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
102 MFX_AVC_REF_IDX_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
103 MFX_AVC_WEIGHTOFFSET_STATE_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
104 MFC_AVC_PAK_INSERT_OBJECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
105 MFD_MPEG2_BSD_OBJECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
106 MFD_MPEG2_IT_OBJECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
107 MFD_VP8_BSD_OBJECT_CMD_NUMBER_OF_ADDRESSES = 0, // 0 DW for address fields
108 };
109
110 /*MFX COMMON CMDS BELOW*/
111 struct _MHW_PAR_T(MFX_QM_STATE)
112 {
113 uint32_t qmType = 0;
114 uint32_t quantizermatrix[16] = {};
115 };
116
117 struct _MHW_PAR_T(MFX_FQM_STATE)
118 {
119 uint8_t qmType = 0;
120 uint32_t quantizermatrix[32] = {};
121 };
122
123 struct _MHW_PAR_T(MFX_PIPE_MODE_SELECT)
124 {
125 uint32_t Mode = 0;
126 uint32_t standardSelect = 0;
127 uint8_t codecSelect = 0;
128 bool frameStatisticsStreamoutEnable = false;
129 bool scaledSurfaceEnable = false;
130 bool preDeblockingOutputEnablePredeblockoutenable = false;
131 bool postDeblockingOutputEnablePostdeblockoutenable = false;
132 bool streamOutEnable = false;
133 bool deblockerStreamOutEnable = false;
134 uint8_t vdencMode = 0;
135 uint8_t decoderModeSelect = 0;
136 uint8_t decoderShortFormatMode = 0;
137 bool extendedStreamOutEnable = false;
138 uint8_t vlf720IOddHeightInVc1Mode = 0;
139 bool shortFormatInUse = false;
140 bool vc1OddFrameHeight = false;
141 uint32_t mediaSoftResetCounterPer1000Clocks = 0;
142 bool sliceSizeStreamout32bit = false;
143 };
144
145 struct _MHW_PAR_T(MFX_SURFACE_STATE)
146 {
147 uint8_t surfaceId = 0;
148 uint32_t width = 0;
149 uint32_t height = 0;
150 uint32_t tilemode = 0;
151 uint32_t surfacePitch = 0;
152 uint32_t compressionFormat = 0;
153 uint8_t interleaveChroma = 0;
154 uint32_t surfaceFormat = 0;
155 uint32_t yOffsetForUCb = 0;
156 uint32_t yOffsetForVCr = 0;
157 PMOS_SURFACE psSurface = nullptr;
158 uint32_t uvPlaneAlignment = 0;
159 MOS_MEMCOMP_STATE mmcState = MOS_MEMCOMP_DISABLED;
160
161 __MHW_VDBOX_MFX_WRAPPER_EXT(MFX_SURFACE_STATE_EXT);
162 };
163
164 struct _MHW_PAR_T(MFX_PIPE_BUF_ADDR_STATE)
165 {
166 uint32_t Mode = 0;
167 bool decodeInUse = false;
168 bool oneOnOneMapping = false; // Flag for indicating using 1:1 ref index mapping for vdenc
169 PMOS_SURFACE psPreDeblockSurface = nullptr; // Pointer to MOS_SURFACE of render surface
170 MOS_MEMCOMP_STATE PreDeblockSurfMmcState = MOS_MEMCOMP_DISABLED;
171 PMOS_SURFACE psPostDeblockSurface = nullptr; // Pointer to MOS_SURFACE of render surface
172 MOS_MEMCOMP_STATE PostDeblockSurfMmcState = MOS_MEMCOMP_DISABLED;
173 PMOS_SURFACE psRawSurface = nullptr; // Pointer to MOS_SURFACE of raw surface
174 MOS_MEMCOMP_STATE RawSurfMmcState = MOS_MEMCOMP_DISABLED;
175 PMOS_RESOURCE presStreamOutBuffer = nullptr;
176 PMOS_RESOURCE presMfdIntraRowStoreScratchBuffer = nullptr; // Handle of MFD Intra Row Store Scratch data surface
177 PMOS_RESOURCE presMfdDeblockingFilterRowStoreScratchBuffer = nullptr; // Handle of MFD Deblocking Filter Row Store Scratch data surface
178 PMOS_RESOURCE presReferences[CODEC_MAX_NUM_REF_FRAME] = {};
179 PMOS_RESOURCE presVdencReferences[CODEC_MAX_NUM_REF_FRAME] = {};
180 PMOS_RESOURCE presSliceSizeStreamOutBuffer = nullptr;
181 PMOS_SURFACE ps4xDsSurface = nullptr;
182 PMOS_RESOURCE presMacroblockIldbStreamOutBuffer1 = nullptr;
183 PMOS_RESOURCE presMacroblockIldbStreamOutBuffer2 = nullptr;
184 PMOS_RESOURCE * references = nullptr;
185 MOS_MEMCOMP_STATE Ps4xDsSurfMmcState = MOS_MEMCOMP_DISABLED;
186
187 __MHW_VDBOX_MFX_WRAPPER_EXT(MFX_PIPE_BUF_ADDR_STATE_EXT);
188 };
189
190 struct _MHW_PAR_T(MFX_IND_OBJ_BASE_ADDR_STATE)
191 {
192 uint32_t Mode = 0;
193 PMOS_RESOURCE presDataBuffer = nullptr;
194 uint32_t dwDataSize = 0;
195 uint32_t dwDataOffset = 0;
196 PMOS_RESOURCE presMvObjectBuffer = nullptr;
197 uint32_t dwMvObjectSize = 0;
198 uint32_t dwMvObjectOffset = 0;
199 PMOS_RESOURCE presPakBaseObjectBuffer = nullptr;
200 uint32_t dwPakBaseObjectSize = 0;
201 };
202
203 struct _MHW_PAR_T(MFX_BSP_BUF_BASE_ADDR_STATE)
204 {
205 PMOS_RESOURCE presBsdMpcRowStoreScratchBuffer = nullptr;
206 PMOS_RESOURCE presMprRowStoreScratchBuffer = nullptr;
207 PMOS_RESOURCE presBitplaneBuffer = nullptr;
208 };
209
210 struct _MHW_PAR_T(MFX_PAK_INSERT_OBJECT)
211 {
212 uint32_t dwPadding = 0;
213 bool bitstreamstartresetResetbitstreamstartingpos = false;
214 bool endofsliceflagLastdstdatainsertcommandflag = false;
215 bool lastheaderflagLastsrcheaderdatainsertcommandflag = false;
216 bool emulationflagEmulationbytebitsinsertenable = false;
217 uint32_t skipemulbytecntSkipEmulationByteCount = 0;
218 uint32_t databitsinlastdwSrcdataendingbitinclusion50 = 0;
219 bool sliceHeaderIndicator = false;
220 bool headerlengthexcludefrmsize = false;
221 };
222
223 /*AVC CMDS BELOW*/
224 struct _MHW_PAR_T(MFX_AVC_IMG_STATE)
225 {
226 uint32_t frameSize = 0;
227 uint16_t frameWidth = 0;
228 uint16_t frameHeight = 0;
229 uint8_t imgstructImageStructureImgStructure10 = 0;
230 uint16_t weightedBipredIdc = 0;
231 uint16_t weightedPredFlag = 0;
232 char firstChromaQpOffset = 0;
233 char secondChromaQpOffset = 0;
234 bool fieldpicflag = false;
235 bool mbaffflameflag = false;
236 bool vdencEnabled = true;
237 uint16_t framembonlyflag = 0;
238 uint16_t transform8X8Flag = 0;
239 uint16_t direct8X8Infflag = 0;
240 uint16_t constrainedipredflag = 0;
241 uint32_t imgdisposableflag = 0;
242 uint16_t entropycodingflag = 0;
243 uint8_t mbmvformatflag = 0;
244 uint8_t chromaformatidc = 0;
245 uint8_t mvunpackedflag = 0;
246 bool mbstatenabled = false;
247 uint8_t intrambmaxbitflagIntrambmaxsizereportmask = 0;
248 uint8_t intermbmaxbitflagIntermbmaxsizereportmask = 0;
249 uint8_t frameszoverflagFramebitratemaxreportmask = 0;
250 uint8_t frameszunderflagFramebitrateminreportmask = 0;
251 uint8_t intraIntermbipcmflagForceipcmcontrolmask = 0;
252 uint8_t mbratectrlflagMbLevelRateControlEnablingFlag = 0;
253 uint32_t trellisQuantizationRoundingTqr = 0;
254 uint32_t trellisQuantizationEnabledTqenb = 0;
255 uint32_t intrambmaxsz = 0;
256 uint32_t intermbmaxsz = 0;
257 uint32_t framebitratemin = 0;
258 uint32_t framebitrateminunitmode = 0;
259 uint32_t framebitrateminunit = 0;
260 uint32_t framebitratemax = 0;
261 uint32_t framebitratemaxunitmode = 0;
262 uint32_t framebitratemaxunit = 0;
263 uint32_t framebitratemindelta = 0;
264 uint32_t framebitratemaxdelta = 0;
265 bool sliceStatsStreamoutEnable = false;
266 char initialQpValue = 0;
267 uint8_t numberOfActiveReferencePicturesFromL0 = 0;
268 uint8_t numberOfActiveReferencePicturesFromL1 = 0;
269 uint8_t numberOfReferenceFrames = 0;
270 bool picOrderPresentFlag = false;
271 bool deltaPicOrderAlwaysZeroFlag = false;
272 uint32_t picOrderCntType = 0;
273 uint8_t sliceGroupMapType = 0;
274 bool redundantPicCntPresentFlag = false;
275 uint8_t numSliceGroupsMinus1 = 0;
276 bool deblockingFilterControlPresentFlag = false;
277 uint32_t log2MaxFrameNumMinus4 = 0;
278 uint32_t log2MaxPicOrderCntLsbMinus4 = 0;
279 uint16_t sliceGroupChangeRate = 0;
280 uint16_t currPicFrameNum = 0;
281 uint16_t currentFrameViewId = 0;
282 uint8_t maxViewIdxl0 = 0;
283 uint8_t maxViewIdxl1 = 0;
284 bool extendedRhodomainStatisticsEnable = false;
285 uint32_t thresholdSizeInBytes = 0;
286 uint32_t targetSliceSizeInBytes = 0;
287 PCODEC_AVC_PIC_PARAMS avcPicParams = nullptr;
288 PCODEC_MVC_EXT_PIC_PARAMS mvcExtPicParams = nullptr;
289 uint8_t activeFrameCnt = 0;
290 bool decodeInUse = false;
291 uint32_t numMBs = 0;
292 uint32_t imgStructImageStructureImgStructure10 = 0;
293 uint32_t interViewOrderDisable = 0;
294 bool vdaqmEnable = false;
295 uint8_t bitDepthLumaMinus8 = 0;
296 uint8_t bitDepthChromaMinus8 = 0;
297
298 __MHW_VDBOX_MFX_WRAPPER_EXT(MFX_AVC_IMG_STATE_EXT);
299 };
300
301 struct _MHW_PAR_T(MFX_AVC_REF_IDX_STATE)
302 {
303 uint32_t uiList = 0;
304 uint32_t referenceListEntry[8] = {};
305 CODEC_PICTURE CurrPic = {};
306 uint32_t numRefForList[2] = {};
307 PCODEC_PIC_ID pAvcPicIdx = nullptr;
308 void ** avcRefList = nullptr;
309 bool intelEntrypointInUse = false;
310 bool picIdRemappingInUse = false;
311 CODEC_PICTURE refPicList[2][32] = {};
312 bool dummyReference = false;
313 bool oneOnOneMapping = false;
314 };
315
316 struct _MHW_PAR_T(MFX_AVC_WEIGHTOFFSET_STATE)
317 {
318 uint32_t uiList = 0;
319 int16_t Weights[2][32][3][2] = {};
320 bool decodeInUse = false;
321 uint32_t weightoffset[96] = {};
322 };
323
324 struct _MHW_PAR_T(MFX_AVC_SLICE_STATE)
325 {
326 uint8_t sliceType = 0;
327 uint8_t log2WeightDenomLuma = 0;
328 uint8_t log2WeightDenomChroma = 0;
329 uint8_t numberOfReferencePicturesInInterPredictionList0 = 0;
330 uint8_t numberOfReferencePicturesInInterPredictionList1 = 0;
331 uint8_t sliceAlphaC0OffsetDiv2 = 0;
332 uint8_t sliceBetaOffsetDiv2 = 0;
333 int8_t sliceQuantizationParameter = 0;
334 uint8_t cabacInitIdc10 = 0;
335 uint8_t disableDeblockingFilterIndicator = 0;
336 uint8_t directPredictionType = 0;
337 uint8_t weightedPredictionIndicator = 0;
338 uint16_t sliceStartMbNum = 0;
339 uint32_t sliceHorizontalPosition = 0;
340 uint32_t sliceVerticalPosition = 0;
341 uint32_t nextSliceHorizontalPosition = 0;
342 uint32_t nextSliceVerticalPosition = 0;
343 uint8_t sliceId30 = 0;
344 bool cabaczerowordinsertionenable = false;
345 bool emulationbytesliceinsertenable = false;
346 bool tailInsertionPresentInBitstream = false;
347 bool slicedataInsertionPresentInBitstream = false;
348 bool headerInsertionPresentInBitstream = false;
349 bool isLastSlice = false;
350 uint8_t roundintra = 0;
351 uint8_t roundinter = 0;
352 bool roundinterenable = false;
353 bool intelEntrypointInUse = false;
354 bool picIdRemappingInUse = false;
355 bool shortFormatInUse = false;
356 PMOS_RESOURCE presDataBuffer = nullptr;
357 PCODEC_AVC_PIC_PARAMS avcPicParams = nullptr;
358 PCODEC_MVC_EXT_PIC_PARAMS mvcExtPicParams = nullptr;
359 PCODEC_PIC_ID avcPicIdx = {};
360 bool phantomSlice = false;
361 PCODEC_AVC_SLICE_PARAMS avcSliceParams = nullptr;
362 uint32_t Offset = 0;
363 uint32_t Length = 0;
364 uint32_t nextOffset = 0;
365 uint32_t nextLength = 0;
366 uint32_t sliceIndex = 0;
367 bool fullFrameData = 0;
368 uint32_t totalBytesConsumed = 0;
369 bool decodeInUse = false;
370
371 __MHW_VDBOX_MFX_WRAPPER_EXT(MFX_AVC_SLICE_STATE_EXT);
372 };
373
374 struct _MHW_PAR_T(MFX_AVC_DIRECTMODE_STATE)
375 {
376 CODEC_PICTURE CurrPic = {};
377 uint32_t uiUsedForReferenceFlags = 0;
378 PMOS_RESOURCE presAvcDmvBuffers = nullptr;
379 uint8_t ucAvcDmvIdx = 0;
380 PCODEC_PIC_ID pAvcPicIdx = nullptr;
381 void** avcRefList = nullptr;
382 bool bPicIdRemappingInUse = false;
383 bool bDisableDmvBuffers = false;
384 MOS_RESOURCE resAvcDmvBuffers[18] = {};
385 };
386
387 struct _MHW_PAR_T(MFD_AVC_SLICEADDR)
388 {
389 bool decodeInUse = false;
390 uint32_t IndirectBsdDataLength = 0;
391 uint32_t IndirectBsdDataStartAddress = 0;
392 PMOS_RESOURCE presDataBuffer = nullptr;
393 uint32_t dwSliceIndex = 0;
394 uint32_t dwTotalBytesConsumed = 0;
395 PCODEC_AVC_SLICE_PARAMS avcSliceParams = nullptr;
396 };
397
398 struct _MHW_PAR_T(MFD_AVC_BSD_OBJECT)
399 {
400 bool LastsliceFlag = false;
401 uint32_t IntraPredmode4X48X8LumaErrorControlBit = 0;
402
403 uint32_t IntraPredictionErrorControlBitAppliedToIntra16X16Intra8X8Intra4X4LumaAndChroma = 0;
404 uint32_t Intra8X84X4PredictionErrorConcealmentControlBit = 0;
405 uint32_t ISliceConcealmentMode = 0;
406 uint32_t IndirectBsdDataLength = 0;
407 uint32_t IndirectBsdDataStartAddress = 0;
408 uint32_t FirstMbByteOffsetOfSliceDataOrSliceHeader = 0;
409 uint32_t FirstMacroblockMbBitOffset = 0;
410 uint32_t FixPrevMbSkipped = 0;
411 PMOS_RESOURCE presDataBuffer = nullptr;
412 uint32_t dwSliceIndex = 0;
413 uint32_t dwTotalBytesConsumed = 0;
414 bool decodeInUse = false;
415 PCODEC_AVC_SLICE_PARAMS pAvcSliceParams = nullptr;
416 };
417
418 struct _MHW_PAR_T(MFD_AVC_PICID_STATE)
419 {
420 bool bPicIdRemappingInUse = false;
421 PCODEC_PIC_ID pAvcPicIdx = nullptr;
422 uint32_t Pictureidlist1616Bits[8] = {};
423 uint32_t PictureidRemappingDisable = 0;
424 };
425
426 struct _MHW_PAR_T(MFD_AVC_DPB_STATE)
427 {
428 PCODEC_AVC_PIC_PARAMS pAvcPicParams = nullptr;
429 PCODEC_MVC_EXT_PIC_PARAMS pMvcExtPicParams = nullptr;
430 PCODEC_REF_LIST * ppAvcRefList = nullptr;
431 bool bPicIdRemappingInUse = false;
432 uint32_t NonExistingframeFlag161Bit = 0;
433 uint32_t LongtermframeFlag161Bit = 0;
434 uint32_t usedForRef = 0;
435 int16_t refFrameOrder[CODEC_MAX_NUM_REF_FRAME] = {0};
436 PCODEC_PIC_ID pAvcPicIdx = nullptr;
437 };
438
439 struct _MHW_PAR_T(MFX_JPEG_PIC_STATE)
440 {
441 bool decodeInUse = false;
442
443 uint8_t inputFormatYuv = 0;
444 uint8_t rotation = 0;
445 uint8_t outputFormatYuv = 0;
446 bool verticalDownSamplingEnable = false;
447 bool horizontalDownSamplingEnable = false;
448 bool verticalUpSamplingEnable = false;
449
450 uint8_t outputMcuStructure = 0;
451 uint8_t inputSurfaceFormatYuv = 0;
452 uint8_t pixelsInVerticalLastMcu = 0;
453 uint8_t pixelsInHorizontalLastMcu = 0;
454 uint32_t frameWidthInBlocksMinus1 = 0;
455 uint32_t frameHeightInBlocksMinus1 = 0;
456
457 uint32_t Mode = 0;
458 CodecDecodeJpegPicParams *pJpegPicParams = nullptr;
459 uint32_t dwOutputFormat = 0;
460 uint32_t dwWidthInBlocks = 0;
461 uint32_t dwHeightInBlocks = 0;
462 };
463
464 struct _MHW_PAR_T(MFC_JPEG_HUFF_TABLE_STATE)
465 {
466 uint8_t huffTableId = 0;
467 uint32_t dcTable[12] = {};
468 uint32_t acTable[162] = {};
469 };
470
471 struct _MHW_PAR_T(MFC_JPEG_SCAN_OBJECT)
472 {
473 uint32_t mcuCount = 0;
474 uint16_t restartInterval = 0;
475 uint8_t huffmanDcTable = 0;
476 uint8_t huffmanAcTable = 0;
477 };
478
479 struct _MHW_PAR_T(MFX_JPEG_HUFF_TABLE_STATE)
480 {
481 uint32_t huffTableID = 0;
482 void * pDCBits = nullptr;
483 void * pDCValues = nullptr;
484 void * pACBits = nullptr;
485 void * pACValues = nullptr;
486 };
487
488 struct _MHW_PAR_T(MFD_JPEG_BSD_OBJECT)
489 {
490 uint32_t indirectDataLength = 0;
491 uint32_t dataStartAddress = 0;
492 uint32_t scanHorizontalPosition = 0;
493 uint32_t scanVerticalPosition = 0;
494 bool interleaved = false;
495 int16_t scanComponent = 0;
496 uint32_t mcuCount = 0;
497 uint32_t restartInterval = 0;
498 };
499
500 /*MPEG2 CMDS BELOW*/
501 struct _MHW_PAR_T(MFX_MPEG2_PIC_STATE)
502 {
503 uint16_t ScanOrder = 0;
504 uint16_t IntraVlcFormat = 0;
505 uint16_t QuantizerScaleType = 0;
506 uint16_t ConcealmentMotionVectorFlag = 0;
507 uint16_t FramePredictionFrameDct = 0;
508 uint16_t TffTopFieldFirst = 0;
509 uint16_t PictureStructure = 0;
510 uint16_t IntraDcPrecision = 0;
511 uint16_t FCode00 = 0;
512 uint16_t FCode01 = 0;
513 uint16_t FCode10 = 0;
514 uint16_t FCode11 = 0;
515
516 int32_t PictureCodingType = 0;
517 uint32_t ISliceConcealmentMode = 0;
518 uint32_t PBSliceConcealmentMode = 0;
519 uint32_t PBSlicePredictedBidirMotionTypeOverrideBiDirectionMvTypeOverride = 0;
520 uint32_t PBSlicePredictedMotionVectorOverrideFinalMvValueOverride = 0;
521 uint32_t SliceConcealmentDisableBit = 0;
522
523 uint16_t Framewidthinmbsminus170PictureWidthInMacroblocks = 0;
524 uint16_t Frameheightinmbsminus170PictureHeightInMacroblocks = 0;
525
526 uint16_t mfxMpeg2PicStatePar0 = 0;
527
528 uint32_t Roundintradc = 0;
529 uint32_t Roundinterdc = 0;
530 uint32_t Roundintraac = 0;
531 uint32_t Roundinterac = 0;
532 };
533
534 struct _MHW_PAR_T(MFD_MPEG2_BSD_OBJECT)
535 {
536 bool decodeInUse = false;
537 PMOS_RESOURCE presDataBuffer = nullptr;
538 uint32_t dwDataStartOffset = 0;
539
540 uint32_t IndirectBsdDataLength = 0;
541 uint32_t IndirectDataStartAddress = 0;
542
543 uint32_t FirstMacroblockBitOffset = 0;
544 bool IsLastMb = false;
545 bool LastPicSlice = false;
546 bool MbRowLastSlice = false;
547 uint32_t MacroblockCount = 0;
548 uint32_t SliceHorizontalPosition = 0;
549 uint32_t SliceVerticalPosition = 0;
550
551 int32_t QuantizerScaleCode = 0;
552 uint16_t NextSliceHorizontalPosition = 0;
553 uint16_t NextSliceVerticalPosition = 0;
554 };
555
556 /*VP8 CMDS BELOW*/
557 struct _MHW_PAR_T(MFX_VP8_PIC_STATE)
558 {
559 uint32_t dwCoefProbTableOffset = 0;
560 PMOS_RESOURCE presCoefProbBuffer = nullptr;
561 PMOS_RESOURCE presSegmentationIdStreamBuffer = nullptr;
562 // DW1
563 uint32_t FrameWidthMinus1 = 0;
564 uint32_t FrameHeightMinus1 = 0;
565 // DW2
566 uint32_t McFilterSelect = 0;
567 uint32_t ChromaFullPixelMcFilterMode = 0;
568 uint32_t Dblkfiltertype = 0;
569 uint32_t Skeyframeflag = 0;
570 uint32_t SegmentationIdStreamoutEnable = 0;
571 uint32_t SegmentationIdStreaminEnable = 0;
572 uint32_t SegmentEnableFlag = 0;
573 uint32_t UpdateMbsegmentMapFlag = 0;
574 uint32_t MbNocoeffSkipflag = 0;
575 uint32_t ModeReferenceLoopFilterDeltaEnabled = 0;
576 uint32_t GoldenRefPictureMvSignbiasFlag = 0;
577 uint32_t AlternateRefPicMvSignbiasFlag = 0;
578 uint32_t DeblockSharpnessLevel = 0;
579 // DW3
580 uint32_t DblkfilterlevelForSegment3 = 0;
581 uint32_t DblkfilterlevelForSegment2 = 0;
582 uint32_t DblkfilterlevelForSegment1 = 0;
583 uint32_t DblkfilterlevelForSegment0 = 0;
584 // DW4
585 uint32_t QuantizerValue0Blocktype0Y1Dc = 0;
586 uint32_t QuantizerValue0Blocktype1Y1Ac = 0;
587 // DW5
588 uint32_t QuantizerValue0Blocktype2Uvdc = 0;
589 uint32_t QuantizerValue0Blocktype3Uvac = 0;
590 // DW6
591 uint32_t QuantizerValue0Blocktype4Y2Dc = 0;
592 uint32_t QuantizerValue0Blocktype5Y2Ac = 0;
593 // DW7
594 uint32_t QuantizerValue1Blocktype0Y1Dc = 0;
595 uint32_t QuantizerValue1Blocktype1Y1Ac = 0;
596 // DW8
597 uint32_t QuantizerValue1Blocktype2Uvdc = 0;
598 uint32_t QuantizerValue1Blocktype3Uvac = 0;
599 // DW9
600 uint32_t QuantizerValue1Blocktype4Y2Dc = 0;
601 uint32_t QuantizerValue1Blocktype5Y2Ac = 0;
602 // DW10
603 uint32_t QuantizerValue2Blocktype0Y1Dc = 0;
604 uint32_t QuantizerValue2Blocktype1Y1Ac = 0;
605 // DW11
606 uint32_t QuantizerValue2Blocktype2Uvdc = 0;
607 uint32_t QuantizerValue2Blocktype3Uvac = 0;
608 // DW12
609 uint32_t QuantizerValue2Blocktype4Y2Dc = 0;
610 uint32_t QuantizerValue2Blocktype5Y2Ac = 0;
611 // DW13
612 uint32_t QuantizerValue3Blocktype0Y1Dc = 0;
613 uint32_t QuantizerValue3Blocktype1Y1Ac = 0;
614 // DW14
615 uint32_t QuantizerValue3Blocktype2Uvdc = 0;
616 uint32_t QuantizerValue3Blocktype3Uvac = 0;
617 // DW15
618 uint32_t QuantizerValue3Blocktype4Y2Dc = 0;
619 uint32_t QuantizerValue3Blocktype5Y2Ac = 0;
620 // DW19
621 uint32_t Mbsegmentidtreeprobs0 = 0;
622 uint32_t Mbsegmentidtreeprobs1 = 0;
623 uint32_t Mbsegmentidtreeprobs2 = 0;
624 // DW20
625 uint32_t Mbnocoeffskipfalseprob = 0;
626 uint32_t Intrambprob = 0;
627 uint32_t Interpredfromlastrefprob = 0;
628 uint32_t Interpredfromgrefrefprob = 0;
629 // DW21
630 uint32_t Ymodeprob3 = 0;
631 uint32_t Ymodeprob2 = 0;
632 uint32_t Ymodeprob1 = 0;
633 uint32_t Ymodeprob0 = 0;
634 // DW22
635 uint32_t Uvmodeprob2 = 0;
636 uint32_t Uvmodeprob1 = 0;
637 uint32_t Uvmodeprob0 = 0;
638 // DW23
639 uint32_t Mvupdateprobs00 = 0;
640 uint32_t Mvupdateprobs01 = 0;
641 uint32_t Mvupdateprobs02 = 0;
642 uint32_t Mvupdateprobs03 = 0;
643 // DW24
644 uint32_t Mvupdateprobs04 = 0;
645 uint32_t Mvupdateprobs05 = 0;
646 uint32_t Mvupdateprobs06 = 0;
647 uint32_t Mvupdateprobs07 = 0;
648 // DW25
649 uint32_t Mvupdateprobs08 = 0;
650 uint32_t Mvupdateprobs09 = 0;
651 uint32_t Mvupdateprobs010 = 0;
652 uint32_t Mvupdateprobs011 = 0;
653 // DW26
654 uint32_t Mvupdateprobs012 = 0;
655 uint32_t Mvupdateprobs013 = 0;
656 uint32_t Mvupdateprobs014 = 0;
657 uint32_t Mvupdateprobs015 = 0;
658 // DW27
659 uint32_t Mvupdateprobs016 = 0;
660 uint32_t Mvupdateprobs017 = 0;
661 uint32_t Mvupdateprobs018 = 0;
662 // DW28
663 uint32_t Mvupdateprobs10 = 0;
664 uint32_t Mvupdateprobs11 = 0;
665 uint32_t Mvupdateprobs12 = 0;
666 uint32_t Mvupdateprobs13 = 0;
667 // DW29
668 uint32_t Mvupdateprobs14 = 0;
669 uint32_t Mvupdateprobs15 = 0;
670 uint32_t Mvupdateprobs16 = 0;
671 uint32_t Mvupdateprobs17 = 0;
672 // DW30
673 uint32_t Mvupdateprobs18 = 0;
674 uint32_t Mvupdateprobs19 = 0;
675 uint32_t Mvupdateprobs110 = 0;
676 uint32_t Mvupdateprobs111 = 0;
677 // DW31
678 uint32_t Mvupdateprobs112 = 0;
679 uint32_t Mvupdateprobs113 = 0;
680 uint32_t Mvupdateprobs114 = 0;
681 uint32_t Mvupdateprobs115 = 0;
682 // DW32
683 uint32_t Mvupdateprobs116 = 0;
684 uint32_t Mvupdateprobs117 = 0;
685 uint32_t Mvupdateprobs118 = 0;
686 // DW33
687 uint32_t Reflfdelta0ForIntraFrame = 0;
688 uint32_t Reflfdelta1ForLastFrame = 0;
689 uint32_t Reflfdelta2ForGoldenFrame = 0;
690 uint32_t Reflfdelta3ForAltrefFrame = 0;
691 // DW34
692 uint32_t Modelfdelta0ForBPredMode = 0;
693 uint32_t Modelfdelta1ForZeromvMode = 0;
694 uint32_t Modelfdelta2ForNearestNearAndNewMode = 0;
695 uint32_t Modelfdelta3ForSplitmvMode = 0;
696 };
697
698 struct _MHW_PAR_T(MFD_VP8_BSD_OBJECT)
699 {
700 // DW1
701 uint32_t CodedNumOfCoeffTokenPartitions = 0;
702 uint32_t Partition0CpbacEntropyRange = 0;
703 uint32_t Partition0CpbacEntropyCount = 0;
704 // DW2
705 uint32_t Partition0CpbacEntropyValue = 0;
706 // DW3
707 uint32_t IndirectPartition0DataLength = 0;
708 // DW4
709 uint32_t IndirectPartition0DataStartOffset = 0;
710 // DW5
711 uint32_t IndirectPartition1DataLength = 0;
712 // DW6
713 uint32_t IndirectPartition1DataStartOffset = 0;
714 // DW7-8
715 uint32_t IndirectPartition2DataLength = 0;
716 uint32_t IndirectPartition2DataStartOffset = 0;
717 // DW9-10
718 uint32_t IndirectPartition3DataLength = 0;
719 uint32_t IndirectPartition3DataStartOffset = 0;
720 // DW11-12
721 uint32_t IndirectPartition4DataLength = 0;
722 uint32_t IndirectPartition4DataStartOffset = 0;
723 // DW13-14
724 uint32_t IndirectPartition5DataLength = 0;
725 uint32_t IndirectPartition5DataStartOffset = 0;
726 // DW15-16
727 uint32_t IndirectPartition6DataLength = 0;
728 uint32_t IndirectPartition6DataStartOffset = 0;
729 // DW17-18
730 uint32_t IndirectPartition7DataLength = 0;
731 uint32_t IndirectPartition7DataStartOffset = 0;
732 // DW19-20
733 uint32_t IndirectPartition8DataLength = 0;
734 uint32_t IndirectPartition8DataStartOffset = 0;
735 };
736
737 struct _MHW_PAR_T(MFD_IT_OBJECT)
738 {
739 uint32_t dwDCTLength = 0;
740 uint32_t DwordLength = 0;
741 uint32_t IndirectItCoeffDataStartAddressOffset = 0;
742 };
743
744 struct _MHW_PAR_T(MFD_IT_OBJECT_MPEG2_INLINE_DATA)
745 {
746 CodecDecodeMpeg2MbParams *pMBParams = nullptr;
747
748 int32_t CodingType = 0;
749 int16_t sPackedMVs0[4] = {};
750 int16_t sPackedMVs1[4] = {};
751
752 uint16_t CodedBlockPattern = 0;
753 bool Lastmbinrow = false;
754
755 uint32_t Horzorigin = 0;
756 uint32_t Vertorigin = 0;
757 };
758
759 } // namespace mfx
760 } // namespace vdbox
761 } // namespace mhw
762
763 #endif //__MHW_VDBOX_MFX_CMDPAR_H__
764