| 1 |
/* |
| 2 |
* Copyright (c) 2020-2025, 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_vdenc_cmdpar.h |
| 24 |
//! \brief MHW command parameters |
| 25 |
//! \details |
| 26 |
//! |
| 27 |
|
| 28 |
#ifndef __MHW_VDBOX_VDENC_CMDPAR_H__ |
| 29 |
#define __MHW_VDBOX_VDENC_CMDPAR_H__ |
| 30 |
|
| 31 |
#include <functional> |
| 32 |
#include "mhw_vdbox_cmdpar.h" |
| 33 |
#include "codec_def_common.h" |
| 34 |
#include "codec_def_common_encode.h" |
| 35 |
|
| 36 |
#if _MEDIA_RESERVED |
| 37 |
#include "mhw_vdbox_vdenc_cmdpar_ext.h" |
| 38 |
#define __MHW_VDBOX_VDENC_WRAPPER(STUFF) |
| 39 |
#define __MHW_VDBOX_VDENC_WRAPPER_EXT(STUFF) STUFF |
| 40 |
#else |
| 41 |
#define __MHW_VDBOX_VDENC_WRAPPER(STUFF) STUFF |
| 42 |
#define __MHW_VDBOX_VDENC_WRAPPER_EXT(STUFF) |
| 43 |
#endif // _MEDIA_RESERVED |
| 44 |
|
| 45 |
namespace mhw |
| 46 |
{ |
| 47 |
namespace vdbox |
| 48 |
{ |
| 49 |
namespace vdenc |
| 50 |
{ |
| 51 |
static constexpr uint32_t MAX_REF_LIST_NUM = 2; |
| 52 |
static constexpr uint32_t MAX_REF_NUM_L0 = 4; |
| 53 |
static constexpr uint32_t MAX_REF_NUM_L1 = 4; // low delay B may have 3 L1 refs |
| 54 |
static constexpr uint32_t MAX_REF_NUM = MAX_REF_NUM_L0 > MAX_REF_NUM_L1 ? MAX_REF_NUM_L0 : MAX_REF_NUM_L1; |
| 55 |
static constexpr uint32_t MAX_REF_NUM_L0L1 = MAX_REF_NUM_L0 + MAX_REF_NUM_L1; |
| 56 |
|
| 57 |
enum class SurfaceFormat |
| 58 |
{ |
| 59 |
yuv422 = 0x0, |
| 60 |
rgba4444 = 0x1, |
| 61 |
yuv444 = 0x2, |
| 62 |
p010Variant = 0x3, |
| 63 |
planar4208 = 0x4, |
| 64 |
yCrCbSwapY422 = 0x5, |
| 65 |
yCrCbSwapUv422 = 0x6, |
| 66 |
yCrCbSwapUvy422 = 0x7, |
| 67 |
y216 = 0x8, |
| 68 |
y210 = 0x8, |
| 69 |
r10g10b10a2 = 0x9, |
| 70 |
y410 = 0xa, |
| 71 |
nv21 = 0xb, |
| 72 |
y416 = 0xc, |
| 73 |
p010 = 0xd, |
| 74 |
planarP016 = 0xe, |
| 75 |
y8Unorm = 0xf, |
| 76 |
y16 = 0x10, |
| 77 |
y216Variant = 0x11, |
| 78 |
y416Variant = 0x12, |
| 79 |
yuyvVariant = 0x13, |
| 80 |
ayuvVariant = 0x14, |
| 81 |
}; |
| 82 |
|
| 83 |
struct RowStorePar |
| 84 |
{ |
| 85 |
enum Codec |
| 86 |
{ |
| 87 |
AVC, |
| 88 |
HEVC, |
| 89 |
VP9, |
| 90 |
AV1 |
| 91 |
}; |
| 92 |
|
| 93 |
enum ChromaFormat |
| 94 |
{ |
| 95 |
MONOCHROME, |
| 96 |
YUV420, |
| 97 |
YUV422, |
| 98 |
YUV444 |
| 99 |
}; |
| 100 |
|
| 101 |
enum BitDepth |
| 102 |
{ |
| 103 |
DEPTH_8, |
| 104 |
DEPTH_10, |
| 105 |
DEPTH_12 |
| 106 |
}; |
| 107 |
|
| 108 |
enum LcuSize |
| 109 |
{ |
| 110 |
SIZE_32, |
| 111 |
SIZE_64, |
| 112 |
SIZE_OTHER, |
| 113 |
}; |
| 114 |
|
| 115 |
Codec mode = AVC; |
| 116 |
ChromaFormat format = MONOCHROME; |
| 117 |
BitDepth bitDepth = DEPTH_8; |
| 118 |
LcuSize lcuSize = SIZE_32; |
| 119 |
bool isField = false; |
| 120 |
uint32_t frameWidth = 0; |
| 121 |
}; |
| 122 |
|
| 123 |
struct _MHW_PAR_T(VDENC_STREAMIN_STATE) |
| 124 |
{ |
| 125 |
uint8_t maxTuSize; |
| 126 |
uint8_t maxCuSize; |
| 127 |
uint8_t numImePredictors; |
| 128 |
uint8_t numMergeCandidateCu64x64; |
| 129 |
uint8_t numMergeCandidateCu32x32; |
| 130 |
uint8_t numMergeCandidateCu16x16; |
| 131 |
uint8_t numMergeCandidateCu8x8; |
| 132 |
bool setQpRoiCtrl; |
| 133 |
int8_t forceQp[4]; |
| 134 |
uint8_t roiCtrl; |
| 135 |
uint8_t puTypeCtrl; |
| 136 |
}; |
| 137 |
|
| 138 |
struct _MHW_PAR_T(VDENC_CONTROL_STATE) |
| 139 |
{ |
| 140 |
bool vdencInitialization = true; |
| 141 |
}; |
| 142 |
|
| 143 |
struct _MHW_PAR_T(VDENC_PIPE_MODE_SELECT) |
| 144 |
{ |
| 145 |
uint8_t standardSelect = 0; |
| 146 |
bool scalabilityMode = false; |
| 147 |
bool frameStatisticsStreamOut = false; |
| 148 |
bool pakObjCmdStreamOut = false; |
| 149 |
bool tlbPrefetch = false; |
| 150 |
bool dynamicSlice = false; |
| 151 |
bool streamIn = false; |
| 152 |
uint8_t bitDepthMinus8 = 0; |
| 153 |
uint8_t chromaType = 0; |
| 154 |
uint8_t outputRangeControlCsc = 1; |
| 155 |
bool tileBasedReplayMode = false; |
| 156 |
bool randomAccess = false; |
| 157 |
bool rgbEncodingMode = false; |
| 158 |
bool hmeRegionPrefetch = true; |
| 159 |
uint8_t topPrefetchEnableMode = 0; |
| 160 |
uint8_t leftPrefetchAtWrapAround = 1; |
| 161 |
uint8_t verticalShift32Minus1 = 2; |
| 162 |
uint8_t hzShift32Minus1 = 3; |
| 163 |
uint8_t numVerticalReqMinus1 = 6; |
| 164 |
uint8_t numHzReqMinus1 = 2; |
| 165 |
uint8_t prefetchOffset = 0; |
| 166 |
uint8_t captureMode = 0; |
| 167 |
uint8_t wirelessSessionId = 0; |
| 168 |
uint8_t tailPointerReadFrequency = 0; |
| 169 |
uint8_t streamingBufferConfig = 0; |
| 170 |
bool bt2020RGB2YUV = 0; |
| 171 |
uint8_t rgbInputStudioRange = 0; |
| 172 |
uint8_t convertedYUVStudioRange = 0; |
| 173 |
uint8_t VdencPipeModeSelectPar0 = 0; |
| 174 |
uint8_t VdencPipeModeSelectPar1 = 0; |
| 175 |
uint8_t VdencPipeModeSelectPar2 = 0; |
| 176 |
uint8_t VdencPipeModeSelectPar3 = 0; |
| 177 |
uint8_t VdencPipeModeSelectPar4 = 0; |
| 178 |
uint8_t VdencPipeModeSelectPar5 = 0; |
| 179 |
uint8_t VdencPipeModeSelectPar6 = 0; |
| 180 |
uint8_t VdencPipeModeSelectPar7 = 0; |
| 181 |
uint8_t VdencPipeModeSelectPar8 = 0; |
| 182 |
bool fastPassEn = false; |
| 183 |
uint8_t fastPassScale = 0; |
| 184 |
uint8_t DownScaleType = 0; |
| 185 |
uint8_t VdencPipeModeSelectPar12 = 0; |
| 186 |
uint8_t VdencPipeModeSelectPar13 = 0; |
| 187 |
bool chromaPrefetchDisable = false; |
| 188 |
}; |
| 189 |
|
| 190 |
struct _MHW_PAR_T(VDENC_SRC_SURFACE_STATE) |
| 191 |
{ |
| 192 |
uint32_t width = 0; |
| 193 |
uint32_t height = 0; |
| 194 |
uint32_t pitch = 0; |
| 195 |
uint32_t uOffset = 0; |
| 196 |
uint32_t vOffset = 0; |
| 197 |
MOS_TILE_TYPE tileType = MOS_TILE_X; |
| 198 |
MOS_TILE_MODE_GMM tileModeGmm = MOS_TILE_LINEAR_GMM; |
| 199 |
MOS_FORMAT format = Format_Any; |
| 200 |
bool gmmTileEn = false; |
| 201 |
bool colorSpaceSelection = false; |
| 202 |
bool displayFormatSwizzle = false; |
| 203 |
uint32_t chromaDownsampleFilterControl = 0; |
| 204 |
uint8_t vDirection = 0; |
| 205 |
}; |
| 206 |
|
| 207 |
struct _MHW_PAR_T(VDENC_REF_SURFACE_STATE) |
| 208 |
{ |
| 209 |
uint32_t width = 0; |
| 210 |
uint32_t height = 0; |
| 211 |
uint32_t pitch = 0; |
| 212 |
uint32_t uOffset = 0; |
| 213 |
uint32_t vOffset = 0; |
| 214 |
MOS_TILE_TYPE tileType = MOS_TILE_X; |
| 215 |
MOS_TILE_MODE_GMM tileModeGmm = MOS_TILE_LINEAR_GMM; |
| 216 |
MOS_FORMAT format = Format_Any; |
| 217 |
bool gmmTileEn = false; |
| 218 |
uint8_t vDirection = 0; |
| 219 |
}; |
| 220 |
|
| 221 |
struct _MHW_PAR_T(VDENC_DS_REF_SURFACE_STATE) |
| 222 |
{ |
| 223 |
uint8_t vDirectionStage1 = 0; |
| 224 |
uint8_t vDirectionStage2 = 0; |
| 225 |
uint32_t widthStage1 = 0; |
| 226 |
uint32_t widthStage2 = 0; |
| 227 |
uint32_t heightStage1 = 0; |
| 228 |
uint32_t heightStage2 = 0; |
| 229 |
uint32_t pitchStage1 = 0; |
| 230 |
uint32_t pitchStage2 = 0; |
| 231 |
uint32_t uOffsetStage1 = 0; |
| 232 |
uint32_t uOffsetStage2 = 0; |
| 233 |
uint32_t vOffsetStage1 = 0; |
| 234 |
uint32_t vOffsetStage2 = 0; |
| 235 |
MOS_TILE_TYPE tileTypeStage1 = MOS_TILE_X; |
| 236 |
MOS_TILE_TYPE tileTypeStage2 = MOS_TILE_X; |
| 237 |
MOS_TILE_MODE_GMM tileModeGmmStage1 = MOS_TILE_LINEAR_GMM; |
| 238 |
MOS_TILE_MODE_GMM tileModeGmmStage2 = MOS_TILE_LINEAR_GMM; |
| 239 |
bool gmmTileEnStage1 = false; |
| 240 |
bool gmmTileEnStage2 = false; |
| 241 |
}; |
| 242 |
|
| 243 |
struct _MHW_PAR_T(VDENC_PIPE_BUF_ADDR_STATE) |
| 244 |
{ |
| 245 |
PMOS_SURFACE surfaceRaw = nullptr; |
| 246 |
MOS_MEMCOMP_STATE mmcStateRaw = MOS_MEMCOMP_DISABLED; |
| 247 |
uint32_t compressionFormatRaw = 0; |
| 248 |
uint32_t compressionFormatRecon = 0; |
| 249 |
PMOS_RESOURCE intraRowStoreScratchBuffer = nullptr; |
| 250 |
PMOS_RESOURCE streamOutBuffer = nullptr; |
| 251 |
uint32_t streamOutOffset = 0; |
| 252 |
PMOS_RESOURCE streamInBuffer = nullptr; |
| 253 |
uint32_t numActiveRefL0 = 0; |
| 254 |
uint32_t numActiveRefL1 = 0; |
| 255 |
PMOS_RESOURCE refs[MAX_REF_NUM_L0L1] = {}; |
| 256 |
PMOS_RESOURCE refsDsStage1[MAX_REF_NUM_L0L1] = {}; |
| 257 |
PMOS_RESOURCE refsDsStage2[MAX_REF_NUM_L0L1] = {}; |
| 258 |
MOS_MEMCOMP_STATE mmcStatePreDeblock = MOS_MEMCOMP_DISABLED; |
| 259 |
MOS_MEMCOMP_STATE mmcStatePostDeblock = MOS_MEMCOMP_DISABLED; |
| 260 |
PMOS_SURFACE surfaceDsStage1 = nullptr; |
| 261 |
MOS_MEMCOMP_STATE mmcStateDsStage1 = MOS_MEMCOMP_DISABLED; |
| 262 |
PMOS_SURFACE surfaceDsStage2 = nullptr; |
| 263 |
MOS_MEMCOMP_STATE mmcStateDsStage2 = MOS_MEMCOMP_DISABLED; |
| 264 |
uint8_t mmcSkipMask = 0; |
| 265 |
bool mmcEnabled = false; |
| 266 |
bool lowDelayB = false; |
| 267 |
bool isPFrame = false; //only HEVC should touch this flag |
| 268 |
PMOS_RESOURCE colocatedMvReadBuffer = nullptr; |
| 269 |
PMOS_RESOURCE colMvTempBuffer[MAX_REF_NUM_L0L1] = {}; |
| 270 |
PMOS_RESOURCE pakObjCmdStreamOutBuffer = nullptr; |
| 271 |
PMOS_RESOURCE segmentMapStreamInBuffer = nullptr; |
| 272 |
PMOS_RESOURCE segmentMapStreamOutBuffer = nullptr; |
| 273 |
PMOS_RESOURCE tileRowStoreBuffer = nullptr; |
| 274 |
PMOS_RESOURCE mfdIntraRowStoreScratchBuffer = nullptr; |
| 275 |
PMOS_RESOURCE cumulativeCuCountStreamOutBuffer = nullptr; |
| 276 |
PMOS_RESOURCE colocatedMvWriteBuffer = nullptr; |
| 277 |
PMOS_RESOURCE vdencPipeBufAddrStatePar0 = nullptr; |
| 278 |
PMOS_RESOURCE vdencPipeBufAddrStatePar1 = nullptr; |
| 279 |
PMOS_RESOURCE vdencPipeBufAddrStatePar2 = nullptr; |
| 280 |
}; |
| 281 |
|
| 282 |
struct _MHW_PAR_T(VDENC_WEIGHTSOFFSETS_STATE) |
| 283 |
{ |
| 284 |
int8_t weightsLuma[MAX_REF_LIST_NUM][MAX_REF_NUM] = {}; |
| 285 |
int16_t offsetsLuma[MAX_REF_LIST_NUM][MAX_REF_NUM] = {}; |
| 286 |
uint32_t denomLuma = 0; |
| 287 |
int8_t weightsChroma[MAX_REF_LIST_NUM][MAX_REF_NUM][2] = {}; |
| 288 |
int16_t offsetsChroma[MAX_REF_LIST_NUM][MAX_REF_NUM][2] = {}; |
| 289 |
uint32_t denomChroma = 0; |
| 290 |
}; |
| 291 |
|
| 292 |
struct _MHW_PAR_T(VDENC_HEVC_VP9_TILE_SLICE_STATE) |
| 293 |
{ |
| 294 |
bool tileEnable = false; |
| 295 |
bool tileRowStoreSelect = false; |
| 296 |
uint32_t tileWidth = 0; |
| 297 |
uint32_t tileHeight = 0; |
| 298 |
uint32_t numPipe = 0; |
| 299 |
uint32_t tileId = 0; |
| 300 |
uint32_t tileStartLCUX = 0; |
| 301 |
uint32_t tileStartLCUY = 0; |
| 302 |
uint32_t ctbSize = 0; |
| 303 |
uint32_t tileStreamInOffset = 0; |
| 304 |
uint32_t tileLCUStreamOutOffset = 0; |
| 305 |
uint32_t log2WeightDenomLuma = 0; |
| 306 |
uint32_t log2WeightDenomChroma = 0; |
| 307 |
uint32_t hevcVp9Log2WeightDenomLuma = 0; |
| 308 |
uint32_t paletteModeEnable = 0; |
| 309 |
uint32_t ibcControl = 0; |
| 310 |
uint32_t VdencHEVCVP9TileSlicePar0 = 0; |
| 311 |
uint32_t VdencHEVCVP9TileSlicePar1 = 0; |
| 312 |
uint32_t VdencHEVCVP9TileSlicePar2 = 0; |
| 313 |
uint32_t VdencHEVCVP9TileSlicePar3 = 0; |
| 314 |
uint32_t VdencHEVCVP9TileSlicePar4 = 0; |
| 315 |
uint32_t VdencHEVCVP9TileSlicePar5 = 0; |
| 316 |
uint32_t VdencHEVCVP9TileSlicePar6 = 0; |
| 317 |
uint32_t VdencHEVCVP9TileSlicePar7 = 0; |
| 318 |
uint32_t VdencHEVCVP9TileSlicePar8 = 0; |
| 319 |
uint32_t VdencHEVCVP9TileSlicePar9 = 0; |
| 320 |
uint32_t VdencHEVCVP9TileSlicePar10 = 0; |
| 321 |
uint32_t VdencHEVCVP9TileSlicePar11 = 0; |
| 322 |
uint32_t VdencHEVCVP9TileSlicePar12 = 0; |
| 323 |
uint32_t VdencHEVCVP9TileSlicePar13 = 0; |
| 324 |
uint32_t VdencHEVCVP9TileSlicePar14 = 0; |
| 325 |
uint32_t VdencHEVCVP9TileSlicePar15 = 0; |
| 326 |
uint8_t VdencHEVCVP9TileSlicePar16[3] = {}; |
| 327 |
uint32_t VdencHEVCVP9TileSlicePar17[3] = {}; |
| 328 |
bool VdencHEVCVP9TileSlicePar18 = false; |
| 329 |
uint32_t VdencHEVCVP9TileSlicePar19 = 0; |
| 330 |
uint32_t VdencHEVCVP9TileSlicePar22 = 0; |
| 331 |
uint32_t VdencHEVCVP9TileSlicePar23 = 0; |
| 332 |
uint32_t VdencHEVCVP9TileSlicePar24 = 0; |
| 333 |
uint32_t tileRowstoreOffset = 0; |
| 334 |
}; |
| 335 |
|
| 336 |
struct _MHW_PAR_T(VDENC_WALKER_STATE) |
| 337 |
{ |
| 338 |
bool firstSuperSlice = true; |
| 339 |
uint32_t tileSliceStartLcuMbX = 0; |
| 340 |
uint32_t tileSliceStartLcuMbY = 0; |
| 341 |
uint32_t nextTileSliceStartLcuMbX = 0; |
| 342 |
uint32_t nextTileSliceStartLcuMbY = 0; |
| 343 |
}; |
| 344 |
|
| 345 |
struct _MHW_PAR_T(VD_PIPELINE_FLUSH) |
| 346 |
{ |
| 347 |
bool waitDoneHEVC = false; |
| 348 |
bool waitDoneVDENC = false; |
| 349 |
bool waitDoneMFL = false; |
| 350 |
bool waitDoneMFX = false; |
| 351 |
bool waitDoneVDCmdMsgParser = false; |
| 352 |
bool flushHEVC = false; |
| 353 |
bool flushVDENC = false; |
| 354 |
bool flushMFL = false; |
| 355 |
bool flushMFX = false; |
| 356 |
bool waitDoneAV1 = false; |
| 357 |
bool flushAV1 = false; |
| 358 |
bool waitDoneVDAQM = false; |
| 359 |
bool flushVDAQM = false; |
| 360 |
bool vvcpPipelineDone = false; |
| 361 |
bool vvcpPipelineCommandFlush = false; |
| 362 |
|
| 363 |
__MHW_VDBOX_VDENC_WRAPPER_EXT(VD_PIPELINE_FLUSH_CMDPAR_EXT); |
| 364 |
}; |
| 365 |
|
| 366 |
struct _MHW_PAR_T(VDENC_AVC_SLICE_STATE) |
| 367 |
{ |
| 368 |
uint8_t roundIntra = 0; |
| 369 |
uint8_t roundIntraEnable = 1; |
| 370 |
uint8_t roundInter = 0; |
| 371 |
uint8_t roundInterEnable = 0; |
| 372 |
uint8_t log2WeightDenomLuma = 0; |
| 373 |
}; |
| 374 |
|
| 375 |
struct _MHW_PAR_T(VDENC_AVC_IMG_STATE) |
| 376 |
{ |
| 377 |
uint8_t pictureType = 0; |
| 378 |
uint8_t transform8X8Flag = 0; |
| 379 |
bool colMVWriteEnable = false; |
| 380 |
uint8_t subpelMode = 3; |
| 381 |
bool colMVReadEnable = false; |
| 382 |
uint8_t bidirectionalWeight = 0; |
| 383 |
uint16_t pictureHeightMinusOne = 0; |
| 384 |
uint16_t pictureWidth = 0; |
| 385 |
uint8_t fwdRefIdx0ReferencePicture = 0; |
| 386 |
uint8_t bwdRefIdx0ReferencePicture = 0; |
| 387 |
uint8_t fwdRefIdx1ReferencePicture = 0; |
| 388 |
uint8_t fwdRefIdx2ReferencePicture = 0; |
| 389 |
uint8_t numberOfL0ReferencesMinusOne = 0; |
| 390 |
uint8_t numberOfL1ReferencesMinusOne = 0; |
| 391 |
uint8_t intraRefreshMbPos = 0; |
| 392 |
uint8_t intraRefreshMbSizeMinusOne = 0; |
| 393 |
uint8_t intraRefreshEnableRollingIEnable = 0; |
| 394 |
uint8_t intraRefreshMode = 0; |
| 395 |
int8_t qpAdjustmentForRollingI = 0; |
| 396 |
uint8_t roiQpAdjustmentForZone0 = 0; |
| 397 |
uint8_t roiQpAdjustmentForZone1 = 0; |
| 398 |
uint8_t roiQpAdjustmentForZone2 = 0; |
| 399 |
uint8_t roiQpAdjustmentForZone3 = 0; |
| 400 |
uint8_t minQp = 0xa; |
| 401 |
uint8_t maxQp = 0x33; |
| 402 |
bool roiEnable = false; |
| 403 |
bool mbLevelQpEnable = false; |
| 404 |
bool mbLevelDeltaQpEnable = false; |
| 405 |
bool longtermReferenceFrameBwdRef0Indicator = false; |
| 406 |
uint8_t qpPrimeY = 0; |
| 407 |
uint8_t trellisQuantEn = 0; |
| 408 |
uint8_t pocNumberForCurrentPicture = 0; |
| 409 |
uint8_t pocNumberForFwdRef0 = 0; |
| 410 |
uint8_t pocNumberForFwdRef1 = 0; |
| 411 |
uint8_t pocNumberForFwdRef2 = 0; |
| 412 |
uint8_t pocNumberForBwdRef0 = 0; |
| 413 |
uint8_t plAdaptFrameField = 0; |
| 414 |
uint8_t currFrmFldPic = 0; |
| 415 |
uint8_t curPicType = 0; |
| 416 |
uint8_t fwdRefIdx0FieldType = 0; |
| 417 |
uint8_t bwdRefIdx0FieldType = 0; |
| 418 |
uint8_t fwdRefIdx1FieldType = 0; |
| 419 |
uint8_t fwdRefIdx2FieldType = 0; |
| 420 |
|
| 421 |
__MHW_VDBOX_VDENC_WRAPPER( |
| 422 |
std::vector<std::function<MOS_STATUS(uint32_t *)>> extSettings); |
| 423 |
__MHW_VDBOX_VDENC_WRAPPER_EXT( |
| 424 |
VDENC_AVC_IMG_STATE_CMDPAR_EXT); |
| 425 |
}; |
| 426 |
|
| 427 |
struct _MHW_PAR_T(VDENC_CMD1) |
| 428 |
{ |
| 429 |
uint16_t vdencCmd1Par0 = 0; |
| 430 |
uint16_t vdencCmd1Par1 = 0; |
| 431 |
uint8_t vdencCmd1Par2[8] = {}; |
| 432 |
uint8_t vdencCmd1Par3[12] = {}; |
| 433 |
uint8_t vdencCmd1Par4[12] = {}; |
| 434 |
uint8_t vdencCmd1Par5 = 0; |
| 435 |
uint8_t vdencCmd1Par6 = 0; |
| 436 |
uint8_t vdencCmd1Par7 = 0; |
| 437 |
uint8_t vdencCmd1Par8[4] = {}; |
| 438 |
uint8_t vdencCmd1Par9[4] = {}; |
| 439 |
uint8_t vdencCmd1Par10[4] = {}; |
| 440 |
uint8_t vdencCmd1Par11[4] = {}; |
| 441 |
uint8_t vdencCmd1Par12[4] = {}; |
| 442 |
uint8_t vdencCmd1Par13[4] = {}; |
| 443 |
uint8_t vdencCmd1Par14[4] = {}; |
| 444 |
uint8_t vdencCmd1Par15[4] = {}; |
| 445 |
uint8_t vdencCmd1Par16 = 0; |
| 446 |
uint8_t vdencCmd1Par17 = 0; |
| 447 |
uint8_t vdencCmd1Par18 = 0; |
| 448 |
uint8_t vdencCmd1Par19 = 0; |
| 449 |
uint8_t vdencCmd1Par20 = 0; |
| 450 |
uint8_t vdencCmd1Par21 = 0; |
| 451 |
uint8_t vdencCmd1Par22 = 0; |
| 452 |
uint8_t vdencCmd1Par23 = 0; |
| 453 |
uint8_t vdencCmd1Par24 = 0; |
| 454 |
uint8_t vdencCmd1Par25 = 0; |
| 455 |
uint8_t vdencCmd1Par26 = 0; |
| 456 |
uint8_t vdencCmd1Par27 = 0; |
| 457 |
uint8_t vdencCmd1Par28 = 0; |
| 458 |
uint8_t vdencCmd1Par29 = 0; |
| 459 |
uint8_t vdencCmd1Par30 = 0; |
| 460 |
uint8_t vdencCmd1Par31 = 0; |
| 461 |
uint8_t vdencCmd1Par32 = 0; |
| 462 |
uint8_t vdencCmd1Par33 = 0; |
| 463 |
uint8_t vdencCmd1Par34 = 0; |
| 464 |
uint8_t vdencCmd1Par35 = 0; |
| 465 |
uint8_t vdencCmd1Par36 = 0; |
| 466 |
uint8_t vdencCmd1Par37 = 0; |
| 467 |
uint8_t vdencCmd1Par38 = 0; |
| 468 |
uint8_t vdencCmd1Par39 = 0; |
| 469 |
uint8_t vdencCmd1Par40 = 0; |
| 470 |
uint8_t vdencCmd1Par41 = 0; |
| 471 |
uint8_t vdencCmd1Par42 = 0; |
| 472 |
uint8_t vdencCmd1Par43 = 0; |
| 473 |
uint8_t vdencCmd1Par44 = 0; |
| 474 |
uint8_t vdencCmd1Par45 = 0; |
| 475 |
uint8_t vdencCmd1Par46 = 0; |
| 476 |
uint8_t vdencCmd1Par47 = 0; |
| 477 |
uint8_t vdencCmd1Par48 = 0; |
| 478 |
uint8_t vdencCmd1Par49 = 0; |
| 479 |
uint8_t vdencCmd1Par50 = 0; |
| 480 |
uint8_t vdencCmd1Par51 = 0; |
| 481 |
uint8_t vdencCmd1Par52 = 0; |
| 482 |
uint8_t vdencCmd1Par53 = 0; |
| 483 |
uint8_t vdencCmd1Par54 = 0; |
| 484 |
uint8_t vdencCmd1Par55 = 0; |
| 485 |
uint8_t vdencCmd1Par56 = 0; |
| 486 |
uint8_t vdencCmd1Par57 = 0; |
| 487 |
uint8_t vdencCmd1Par58 = 0; |
| 488 |
uint8_t vdencCmd1Par59 = 0; |
| 489 |
uint8_t vdencCmd1Par60 = 0; |
| 490 |
uint8_t vdencCmd1Par61 = 0; |
| 491 |
uint8_t vdencCmd1Par62 = 0; |
| 492 |
uint8_t vdencCmd1Par63 = 0; |
| 493 |
uint8_t vdencCmd1Par64 = 0; |
| 494 |
uint8_t vdencCmd1Par65 = 0; |
| 495 |
uint8_t vdencCmd1Par66 = 0; |
| 496 |
uint8_t vdencCmd1Par67 = 0; |
| 497 |
uint8_t vdencCmd1Par68 = 0; |
| 498 |
uint8_t vdencCmd1Par69 = 0; |
| 499 |
uint8_t vdencCmd1Par70 = 0; |
| 500 |
uint8_t vdencCmd1Par71 = 0; |
| 501 |
uint8_t vdencCmd1Par72 = 0; |
| 502 |
uint8_t vdencCmd1Par73 = 0; |
| 503 |
uint8_t vdencCmd1Par74 = 0; |
| 504 |
uint8_t vdencCmd1Par75 = 0; |
| 505 |
uint8_t vdencCmd1Par76 = 0; |
| 506 |
uint8_t vdencCmd1Par77 = 0; |
| 507 |
uint8_t vdencCmd1Par78 = 0; |
| 508 |
uint8_t vdencCmd1Par79 = 0; |
| 509 |
uint8_t vdencCmd1Par80 = 0; |
| 510 |
uint8_t vdencCmd1Par81 = 0; |
| 511 |
uint8_t vdencCmd1Par82 = 0; |
| 512 |
uint8_t vdencCmd1Par83 = 0; |
| 513 |
uint8_t vdencCmd1Par84 = 0; |
| 514 |
uint8_t vdencCmd1Par85 = 0; |
| 515 |
uint8_t vdencCmd1Par86 = 0; |
| 516 |
uint8_t vdencCmd1Par87 = 0; |
| 517 |
uint8_t vdencCmd1Par88 = 0; |
| 518 |
uint8_t vdencCmd1Par89 = 0; |
| 519 |
uint8_t vdencCmd1Par90 = 0; |
| 520 |
uint8_t vdencCmd1Par91 = 0; |
| 521 |
uint8_t vdencCmd1Par92 = 0; |
| 522 |
uint8_t vdencCmd1Par93 = 0; |
| 523 |
uint8_t vdencCmd1Par94 = 0; |
| 524 |
uint8_t vdencCmd1Par95 = 0; |
| 525 |
uint8_t vdnecCmd1Par96[4] = {}; |
| 526 |
uint8_t vdnecCmd1Par97[4] = {}; |
| 527 |
uint8_t vdnecCmd1Par98[4] = {}; |
| 528 |
uint8_t vdnecCmd1Par99[4] = {}; |
| 529 |
uint8_t vdnecCmd1Par100[2] = {}; |
| 530 |
uint8_t vdnecCmd1Par101[2] = {}; |
| 531 |
uint8_t vdnecCmd1Par102[2] = {}; |
| 532 |
uint8_t vdnecCmd1Par103[2] = {}; |
| 533 |
uint8_t vdencCmd1Par104[4] = {}; |
| 534 |
uint8_t vdencCmd1Par105[4] = {}; |
| 535 |
uint8_t vdencCmd1Par106[4] = {}; |
| 536 |
uint8_t vdencCmd1Par107 = 0; |
| 537 |
uint8_t vdencCmd1Par108 = 0; |
| 538 |
uint8_t vdencCmd1Par109 = 0; |
| 539 |
uint8_t vdencCmd1Par110 = 0; |
| 540 |
uint8_t vdencCmd1Par111 = 0; |
| 541 |
uint8_t vdencCmd1Par112 = 0; |
| 542 |
uint8_t vdencCmd1Par113 = 0; |
| 543 |
uint8_t vdencCmd1Par114 = 0; |
| 544 |
uint8_t vdencCmd1Par115 = 0; |
| 545 |
}; |
| 546 |
|
| 547 |
struct _MHW_PAR_T(VDENC_CMD2) |
| 548 |
{ |
| 549 |
uint32_t width = 0; |
| 550 |
uint32_t height = 0; |
| 551 |
bool constrainedIntraPred = false; |
| 552 |
uint8_t pictureType = 0; |
| 553 |
bool temporalMvp = false; |
| 554 |
bool collocatedFromL0 = false; |
| 555 |
uint8_t longTermReferenceFlagsL0 = 0; |
| 556 |
uint8_t longTermReferenceFlagsL1 = 0; |
| 557 |
bool transformSkip = false; |
| 558 |
int8_t pocL0Ref0 = 1; |
| 559 |
int8_t pocL1Ref0 = -1; |
| 560 |
int8_t pocL0Ref1 = 2; |
| 561 |
int8_t pocL1Ref1 = -2; |
| 562 |
int8_t pocL0Ref2 = 3; |
| 563 |
int8_t pocL1Ref2 = -3; |
| 564 |
int8_t pocL0Ref3 = 4; |
| 565 |
int8_t pocL1Ref3 = -4; |
| 566 |
bool roiStreamIn = false; |
| 567 |
uint8_t numRefL0 = 0; |
| 568 |
uint8_t numRefL1 = 0; |
| 569 |
bool segmentation = false; |
| 570 |
bool segmentationTemporal = false; |
| 571 |
bool tiling = false; |
| 572 |
bool vdencStreamIn = false; |
| 573 |
bool pakOnlyMultiPass = false; |
| 574 |
uint8_t frameIdxL0Ref0 = 0; |
| 575 |
uint8_t frameIdxL0Ref1 = 0; |
| 576 |
uint8_t frameIdxL0Ref2 = 0; |
| 577 |
uint8_t frameIdxL1Ref0 = 0; |
| 578 |
uint8_t minQp = 0; |
| 579 |
uint8_t maxQp = 255; |
| 580 |
bool temporalMvEnableForIntegerSearch = false; |
| 581 |
|
| 582 |
// Temporal MV parameters for AV1 encoder |
| 583 |
// HAL layer MUST validate these values before assignment |
| 584 |
|
| 585 |
// Sequence order hint bits minus 1 (DW67 bits 2:0) |
| 586 |
// HAL layer MUST validate this value is within [0..7] range before assignment |
| 587 |
// Valid range: 0-7 (3 bits), used to generate bitmask for computing relative distance between order hints |
| 588 |
uint8_t sequenceOrderHintBitsMinus1 = 0; |
| 589 |
|
| 590 |
// Active reference bitmask for motion field projection (DW74 bits 31:24) |
| 591 |
// HAL layer MUST validate max 3 bits set and only at valid positions (0,1,2,4,6,7) before assignment |
| 592 |
// Valid bit positions: 0(LAST), 1(LAST2), 2(LAST3), 4(BWDREF), 6(ALTREF2), 7(ALTREF) |
| 593 |
// Priority order for merging: LAST, BWDREF, ALTREF2, ALTREF, LAST2 |
| 594 |
// Bit positions 3 and 5 are reserved and must not be set |
| 595 |
uint8_t activeRefBitmaskMfProj = 0; |
| 596 |
|
| 597 |
// Saved order hints array for motion field projection (DW73-85) |
| 598 |
// HAL layer MUST validate each element is within [0..255] range before assignment |
| 599 |
// Format: [reference frame index 0-6][7 reference indices of that reference frame] |
| 600 |
// Each element represents time steps for motion field projection |
| 601 |
// Index mapping: 0=LAST, 1=LAST2, 2=LAST3, 3=GOLDEN, 4=BWDREF, 5=ALTREF2, 6=ALTREF |
| 602 |
uint8_t savedOrderHints[7][7] = {}; |
| 603 |
uint8_t refOrderHints[8] = {}; |
| 604 |
|
| 605 |
uint16_t intraRefreshPos = 0; |
| 606 |
uint8_t intraRefreshMbSizeMinus1 = 1; |
| 607 |
uint8_t intraRefreshMode = 0; |
| 608 |
bool intraRefresh = false; |
| 609 |
int8_t qpAdjustmentForRollingI = 0; |
| 610 |
uint8_t qpForSegs[8] = {}; |
| 611 |
bool vp9DynamicSlice = false; |
| 612 |
uint8_t qpPrimeYDc = 0; |
| 613 |
uint8_t qpPrimeYAc = 0; |
| 614 |
uint32_t intraRefreshBoundary[3] = {}; |
| 615 |
uint8_t av1RefId[2][4] = {{1, 1, 1, 1}, {1, 1, 1, 1}}; |
| 616 |
uint8_t subPelMode = 3; |
| 617 |
uint8_t av1EnableIntraEdgeFilter = 0; |
| 618 |
|
| 619 |
__MHW_VDBOX_VDENC_WRAPPER( |
| 620 |
std::vector<std::function<MOS_STATUS(uint32_t *)>> extSettings); |
| 621 |
__MHW_VDBOX_VDENC_WRAPPER_EXT(VDENC_CMD2_CMDPAR_EXT); |
| 622 |
}; |
| 623 |
|
| 624 |
struct _MHW_PAR_T(VDENC_CMD3) |
| 625 |
{ |
| 626 |
uint8_t vdencCmd3Par0[8] = {}; |
| 627 |
uint8_t vdencCmd3Par1[12] = {}; |
| 628 |
uint8_t vdencCmd3Par2[12] = {}; |
| 629 |
uint8_t vdencCmd3Par3 = 0; |
| 630 |
uint8_t vdencCmd3Par4 = 0; |
| 631 |
uint8_t vdencCmd3Par5 = 0; |
| 632 |
uint8_t vdencCmd3Par6 = 0; |
| 633 |
uint8_t vdencCmd3Par7 = 0; |
| 634 |
uint8_t vdencCmd3Par8 = 0; |
| 635 |
uint8_t vdencCmd3Par9 = 0; |
| 636 |
uint8_t vdencCmd3Par10 = 0; |
| 637 |
uint8_t vdencCmd3Par11 = 0; |
| 638 |
uint8_t vdencCmd3Par12 = 0; |
| 639 |
uint8_t vdencCmd3Par13 = 0; |
| 640 |
uint8_t vdencCmd3Par14 = 0; |
| 641 |
uint8_t vdencCmd3Par15 = 0; |
| 642 |
uint8_t vdencCmd3Par16 = 0; |
| 643 |
uint8_t vdencCmd3Par17 = 0; |
| 644 |
uint8_t vdencCmd3Par18 = 0; |
| 645 |
uint8_t vdencCmd3Par19 = 0; |
| 646 |
uint8_t vdencCmd3Par20 = 0; |
| 647 |
uint8_t vdencCmd3Par21 = 0; |
| 648 |
uint8_t vdencCmd3Par22 = 0; |
| 649 |
uint8_t vdencCmd3Par23 = 0; |
| 650 |
uint8_t vdencCmd3Par24 = 0; |
| 651 |
uint8_t vdencCmd3Par25 = 0; |
| 652 |
uint8_t vdencCmd3Par26 = 0; |
| 653 |
uint8_t vdencCmd3Par27 = 0; |
| 654 |
uint8_t vdencCmd3Par28 = 0; |
| 655 |
uint8_t vdencCmd3Par29 = 0; |
| 656 |
uint8_t vdencCmd3Par30 = 0; |
| 657 |
uint16_t vdencCmd3Par31 = 0; |
| 658 |
uint16_t vdencCmd3Par32 = 0; |
| 659 |
}; |
| 660 |
} // namespace vdenc |
| 661 |
} // namespace vdbox |
| 662 |
} // namespace mhw |
| 663 |
|
| 664 |
#endif // __MHW_VDBOX_VDENC_CMDPAR_H__ |