| 1 |
/* |
| 2 |
* Copyright (c) 2017-2021, 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 codechal_encode_avc_base.h |
| 24 |
//! \brief Defines base class for AVC encoder. |
| 25 |
//! |
| 26 |
|
| 27 |
#ifndef __CODECHAL_ENCODE_AVC_BASE_H__ |
| 28 |
#define __CODECHAL_ENCODE_AVC_BASE_H__ |
| 29 |
|
| 30 |
#include "codechal_encoder_base.h" |
| 31 |
#include "codechal_kernel_hme.h" |
| 32 |
#if USE_CODECHAL_DEBUG_TOOL |
| 33 |
#include "codechal_debug_encode_par.h" |
| 34 |
#include "codechal_debug_kernel.h" |
| 35 |
#endif |
| 36 |
|
| 37 |
#define CODECHAL_ENCODE_AVC_INVALID_ROUNDING 0xFF |
| 38 |
#define CODECHAL_ENCODE_AVC_NUM_SYNC_TAGS 64 |
| 39 |
#define CODECHAL_ENCODE_AVC_INIT_DSH_SIZE MHW_PAGE_SIZE * 3 |
| 40 |
#define CODECHAL_ENCODE_AVC_VDENC_MIN_ICQ_QUALITYFACTOR 11 |
| 41 |
#define CODECHAL_ENCODE_AVC_DEFAULT_AVBR_ACCURACY 30 |
| 42 |
#define CODECHAL_ENCODE_AVC_MIN_AVBR_CONVERGENCE 100 |
| 43 |
#define CODECHAL_ENCODE_AVC_DEFAULT_AVBR_CONVERGENCE 150 |
| 44 |
#define CODECHAL_ENCODE_AVC_REF_PIC_SELECT_ENTRIES (CODEC_AVC_MAX_NUM_REF_FRAME + 1) // one extra for current picture |
| 45 |
// Invalid AVC PicID |
| 46 |
#define CODECHAL_ENCODE_AVC_INVALID_PIC_ID CODEC_AVC_NUM_UNCOMPRESSED_SURFACE |
| 47 |
|
| 48 |
#define CODECHAL_ENCODE_AVC_SFD_OUTPUT_BUFFER_SIZE_COMMON 128 |
| 49 |
|
| 50 |
#if USE_CODECHAL_DEBUG_TOOL |
| 51 |
#define CODECHAL_DEBUG_ENCODE_AVC_NAL_START_CODE_SEI 0x00000106 |
| 52 |
#define CODECHAL_DEBUG_ENCODE_AVC_NAL_START_CODE_PPS 0x00000128 |
| 53 |
|
| 54 |
struct EncodeAvcPar |
| 55 |
{ |
| 56 |
// DDI Params |
| 57 |
uint8_t ProfileIDC; |
| 58 |
uint8_t LevelIDC; |
| 59 |
uint8_t CabacInitIDC; |
| 60 |
uint8_t ChromaFormatIDC; |
| 61 |
uint8_t PictureCodingType; |
| 62 |
uint8_t MaxRefIdxL0; |
| 63 |
uint8_t MaxRefIdxL1; |
| 64 |
uint8_t MaxBRefIdxL0; |
| 65 |
uint8_t BRCMethod; |
| 66 |
uint8_t BRCType; |
| 67 |
uint8_t DeblockingIDC; |
| 68 |
uint8_t WeightedPred; |
| 69 |
uint8_t WeightedBiPred; |
| 70 |
char ChromaQpOffset; |
| 71 |
char SecondChromaQpOffset; |
| 72 |
char ISliceQP; |
| 73 |
char PSliceQP; |
| 74 |
char BSliceQP; |
| 75 |
char DeblockingFilterAlpha; |
| 76 |
char DeblockingFilterBeta; |
| 77 |
bool EnableSEI; |
| 78 |
bool DisableVUIHeader; |
| 79 |
bool EnableWeightPredictionDetection; |
| 80 |
bool EntropyCodingMode; |
| 81 |
bool DirectInference; |
| 82 |
bool Transform8x8Mode; |
| 83 |
bool UseOrigAsRef; |
| 84 |
bool BiSubMbPartMask; |
| 85 |
uint16_t NumP; |
| 86 |
uint16_t NumB; |
| 87 |
uint16_t FrameRateM; |
| 88 |
uint16_t FrameRateD; |
| 89 |
uint16_t CRFQualityFactor; |
| 90 |
uint32_t NumSlices; |
| 91 |
uint32_t SliceHeight; |
| 92 |
uint32_t NumSuperSlices; |
| 93 |
uint32_t SuperSliceHeight[CODECHAL_ENCODE_AVC_MAX_SLICES_SUPPORTED]; |
| 94 |
bool ConstrainedIntraPred; |
| 95 |
uint8_t SliceMode; |
| 96 |
int16_t hme0XOffset; |
| 97 |
int16_t hme0YOffset; |
| 98 |
int16_t hme1XOffset; |
| 99 |
int16_t hme1YOffset; |
| 100 |
|
| 101 |
// HME Params |
| 102 |
uint8_t SuperCombineDist; |
| 103 |
bool SuperHME; |
| 104 |
bool UltraHME; |
| 105 |
bool StreamInEnable; |
| 106 |
uint8_t StreamInL0FromNewRef; |
| 107 |
uint8_t StreamInL1FromNewRef; |
| 108 |
|
| 109 |
// BRC init Params |
| 110 |
bool MBBRCEnable; |
| 111 |
bool MBRC; |
| 112 |
uint16_t AvbrAccuracy; |
| 113 |
uint16_t AvbrConvergence; |
| 114 |
uint32_t BitRate; |
| 115 |
uint32_t InitVbvFullnessInBit; |
| 116 |
uint32_t MaxBitRate; |
| 117 |
uint32_t VbvSzInBit; |
| 118 |
uint32_t SlidingWindowEnable; |
| 119 |
uint32_t SlidingWindowSize; |
| 120 |
uint32_t SlidingWindowMaxRateRatio; |
| 121 |
uint32_t LowDelayGoldenFrameBoost; |
| 122 |
uint32_t TopQPDeltaThrforAdaptive2Pass; |
| 123 |
uint32_t BotQPDeltaThrforAdaptive2Pass; |
| 124 |
uint32_t TopFrmSzPctThrforAdaptive2Pass; |
| 125 |
uint32_t BotFrmSzPctThrforAdaptive2Pass; |
| 126 |
uint32_t MBHeaderCompensation; |
| 127 |
uint32_t QPSelectMethodforFirstPass; |
| 128 |
bool MBQpCtrl; |
| 129 |
bool ICQReEncode; |
| 130 |
bool AdaptiveCostAdjustEnable; |
| 131 |
bool AdaptiveHMEExtension; |
| 132 |
uint32_t QPMin; |
| 133 |
uint32_t QPMax; |
| 134 |
bool HrdConformanceCheckDisable; |
| 135 |
uint8_t StreamInStaticRegion; |
| 136 |
uint8_t ScenarioInfo; |
| 137 |
bool SliceSizeWA; |
| 138 |
uint32_t INumMbsLag; |
| 139 |
uint32_t PNumMbsLag; |
| 140 |
uint32_t LongTermInterval; |
| 141 |
|
| 142 |
// BRC frame update Params |
| 143 |
bool EnableMultipass; |
| 144 |
uint8_t MaxNumPakPasses; |
| 145 |
uint32_t UserMaxFrame; |
| 146 |
uint32_t UserMaxFrameP; |
| 147 |
bool FrameSkipEnable; |
| 148 |
bool SceneChgDetectEn; |
| 149 |
uint32_t SceneChgPrevIntraPctThresh; |
| 150 |
uint32_t SceneChgCurIntraPctThresh; |
| 151 |
uint32_t SceneChgWidth0; |
| 152 |
uint32_t SceneChgWidth1; |
| 153 |
bool Transform8x8PDisable; |
| 154 |
uint32_t SliceSizeThr; |
| 155 |
uint32_t SliceMaxSize; |
| 156 |
|
| 157 |
// Enc Params |
| 158 |
uint8_t SubPelMode; |
| 159 |
uint8_t MaxLenSP; |
| 160 |
uint8_t MEMethod; |
| 161 |
uint8_t BMEMethod; |
| 162 |
uint8_t HMECombineOverlap; |
| 163 |
uint8_t SearchX; |
| 164 |
uint8_t SearchY; |
| 165 |
uint8_t BSearchX; |
| 166 |
uint8_t BSearchY; |
| 167 |
uint8_t SearchControl; |
| 168 |
uint8_t BSearchControl; |
| 169 |
uint8_t BiMixDisable; |
| 170 |
uint32_t BiWeight; |
| 171 |
bool DisableExtendedMvCostRange; |
| 172 |
bool EnableAdaptiveSearch; |
| 173 |
bool EnableFBRBypass; |
| 174 |
bool BlockBasedSkip; |
| 175 |
bool MADEnableFlag; |
| 176 |
bool EnableMBFlatnessCheckOptimization; |
| 177 |
bool EnableArbitrarySliceSize; |
| 178 |
bool EnableWavefrontOptimization; |
| 179 |
bool BSkipType; |
| 180 |
bool EnableAdaptiveTxDecision; |
| 181 |
bool EnablePerMBStaticCheck; |
| 182 |
bool EnableAdaptiveSearchWindowSize; |
| 183 |
bool EnableIntraCostScalingForStaticFrame; |
| 184 |
uint32_t StaticFrameZMVPercent; |
| 185 |
uint32_t StaticFrameIntraCostScalingRatioP; |
| 186 |
uint32_t StaticFrameIntraCostScalingRatioB; |
| 187 |
bool AdaptiveMvStreamIn; |
| 188 |
uint32_t LargeMvThresh; |
| 189 |
uint32_t LargeMvPctThreshold; |
| 190 |
bool UniMixDisable; |
| 191 |
bool DirectMode; |
| 192 |
uint16_t RefThresh; |
| 193 |
uint16_t MBTextureThreshold; |
| 194 |
uint16_t TxDecisionThr; |
| 195 |
uint32_t MRDisableQPCheck; |
| 196 |
uint32_t AllFractional; |
| 197 |
uint32_t DisableAllFractionalCheckForHighRes; |
| 198 |
uint32_t HMECombineLen; |
| 199 |
uint32_t HMEBCombineLen; |
| 200 |
uint32_t FTQBasedSkip; |
| 201 |
uint32_t MultiplePred; |
| 202 |
uint32_t EnableAdaptiveIntraScaling; |
| 203 |
uint32_t SurvivedSkipCost; |
| 204 |
bool VDEncPerfMode; |
| 205 |
bool VdencExtPakObjDisable; |
| 206 |
bool PPMVDisable; |
| 207 |
uint8_t LeftNbrPelMode; |
| 208 |
uint8_t DisPSubPartMask; |
| 209 |
uint8_t DisPSubMbMask; |
| 210 |
uint8_t DisBSubPartMask; |
| 211 |
uint8_t DisBSubMbMask; |
| 212 |
uint8_t ImePredOverlapThr; |
| 213 |
uint8_t MBSizeEstScalingRatioINTRA; |
| 214 |
bool IntraMBHdrScaleFactor; |
| 215 |
uint8_t MBSizeEstScalingRatioINTER; |
| 216 |
bool InterMBHdrScaleFactor; |
| 217 |
uint8_t PFrameMaxNumImePred; |
| 218 |
uint8_t BFrameMaxNumImePred; |
| 219 |
uint8_t HMERefWindowSize; |
| 220 |
uint8_t IMELeftPredDep; |
| 221 |
uint8_t NumFMECandCheck; |
| 222 |
uint8_t PFrameImePredLargeSW; |
| 223 |
uint8_t BFrameImePredLargeSW; |
| 224 |
bool RdoChromaEnable; |
| 225 |
uint16_t Intra4x4ModeMask; |
| 226 |
uint16_t Intra8x8ModeMask; |
| 227 |
bool RdoIntraChromaSearch; |
| 228 |
uint8_t Intra16x16ModeMask; |
| 229 |
uint8_t InitMBBudgetTr4x4; |
| 230 |
bool ROIEnable; |
| 231 |
uint8_t PFrameZeroCbfEn; |
| 232 |
uint8_t BFrameZeroCbfEn; |
| 233 |
uint8_t ForceIPCMMinQP; |
| 234 |
uint8_t IntraTr4x4Percent; |
| 235 |
bool MultiPassHmeEnable; |
| 236 |
uint32_t IntraPredictionIFrame; |
| 237 |
uint32_t IntraPrediction; |
| 238 |
|
| 239 |
// PAK Params |
| 240 |
uint8_t RoundingIntra; |
| 241 |
bool RoundingIntraEnabled; |
| 242 |
bool EnableAdaptiveRounding; |
| 243 |
bool RoundingInterEnabled; |
| 244 |
bool EnableAdaptiveTrellisQuantization; |
| 245 |
bool TrellisQuantizationEnable; |
| 246 |
bool TrellisQuantizationChromaDisable; |
| 247 |
uint32_t RoundingInter; |
| 248 |
uint32_t RoundingInterB; |
| 249 |
uint32_t TrellisQuantizationRounding; |
| 250 |
uint8_t FrmHdrEncodingFrequency; |
| 251 |
bool ExtendedRhoDomainEn; |
| 252 |
}; |
| 253 |
#endif |
| 254 |
|
| 255 |
static const uint8_t CodecHal_TargetUsageToMode_AVC[NUM_TARGET_USAGE_MODES] = |
| 256 |
{ encodeNormalMode, encodeQualityMode, encodeQualityMode, encodeNormalMode, |
| 257 |
encodeNormalMode, encodeNormalMode, encodeNormalMode, encodePerformanceMode }; |
| 258 |
|
| 259 |
typedef struct _CODEC_AVC_REF_PIC_SELECT_LIST |
| 260 |
{ |
| 261 |
uint8_t FrameIdx; |
| 262 |
MOS_SURFACE sBuffer; |
| 263 |
} CODEC_AVC_REF_PIC_SELECT_LIST, *PCODEC_AVC_REF_PIC_SELECT_LIST; |
| 264 |
|
| 265 |
typedef struct _CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS |
| 266 |
{ |
| 267 |
PMOS_SURFACE psPreDeblockSurface; |
| 268 |
PMOS_SURFACE psPostDeblockSurface; |
| 269 |
PMOS_RESOURCE presMacroblockIldbStreamOutBuffer1; |
| 270 |
PMOS_RESOURCE presMacroblockIldbStreamOutBuffer2; |
| 271 |
|
| 272 |
bool bBrcEnabled; |
| 273 |
PMHW_BATCH_BUFFER pImgStateBatchBuffer; |
| 274 |
PMOS_RESOURCE presBrcHistoryBuffer; |
| 275 |
|
| 276 |
bool bDeblockerStreamOutEnable; |
| 277 |
bool bPostDeblockOutEnable; |
| 278 |
bool bPreDeblockOutEnable; |
| 279 |
bool bPerMBStreamOutEnable; |
| 280 |
} CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS, *PCODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS; |
| 281 |
|
| 282 |
typedef struct _CODECHAL_ENCODE_AVC_ME_CURBE |
| 283 |
{ |
| 284 |
// DW0 |
| 285 |
union |
| 286 |
{ |
| 287 |
struct |
| 288 |
{ |
| 289 |
uint32_t SkipModeEn : MOS_BITFIELD_BIT( 0 ); |
| 290 |
uint32_t AdaptiveEn : MOS_BITFIELD_BIT( 1 ); |
| 291 |
uint32_t BiMixDis : MOS_BITFIELD_BIT( 2 ); |
| 292 |
uint32_t : MOS_BITFIELD_RANGE( 3, 4 ); |
| 293 |
uint32_t EarlyImeSuccessEn : MOS_BITFIELD_BIT( 5 ); |
| 294 |
uint32_t : MOS_BITFIELD_BIT( 6 ); |
| 295 |
uint32_t T8x8FlagForInterEn : MOS_BITFIELD_BIT( 7 ); |
| 296 |
uint32_t : MOS_BITFIELD_RANGE( 8,23 ); |
| 297 |
uint32_t EarlyImeStop : MOS_BITFIELD_RANGE( 24,31 ); |
| 298 |
}; |
| 299 |
struct |
| 300 |
{ |
| 301 |
uint32_t Value; |
| 302 |
}; |
| 303 |
} DW0; |
| 304 |
|
| 305 |
// DW1 |
| 306 |
union |
| 307 |
{ |
| 308 |
struct |
| 309 |
{ |
| 310 |
uint32_t MaxNumMVs : MOS_BITFIELD_RANGE( 0, 5 ); |
| 311 |
uint32_t : MOS_BITFIELD_RANGE( 6,15 ); |
| 312 |
uint32_t BiWeight : MOS_BITFIELD_RANGE( 16,21 ); |
| 313 |
uint32_t : MOS_BITFIELD_RANGE( 22,27 ); |
| 314 |
uint32_t UniMixDisable : MOS_BITFIELD_BIT( 28 ); |
| 315 |
uint32_t : MOS_BITFIELD_RANGE( 29,31 ); |
| 316 |
}; |
| 317 |
struct |
| 318 |
{ |
| 319 |
uint32_t Value; |
| 320 |
}; |
| 321 |
} DW1; |
| 322 |
|
| 323 |
// DW2 |
| 324 |
union |
| 325 |
{ |
| 326 |
struct |
| 327 |
{ |
| 328 |
uint32_t MaxLenSP : MOS_BITFIELD_RANGE( 0, 7 ); |
| 329 |
uint32_t MaxNumSU : MOS_BITFIELD_RANGE( 8,15 ); |
| 330 |
uint32_t : MOS_BITFIELD_RANGE( 16,31 ); |
| 331 |
}; |
| 332 |
struct |
| 333 |
{ |
| 334 |
uint32_t Value; |
| 335 |
}; |
| 336 |
} DW2; |
| 337 |
|
| 338 |
// DW3 |
| 339 |
union |
| 340 |
{ |
| 341 |
struct |
| 342 |
{ |
| 343 |
uint32_t SrcSize : MOS_BITFIELD_RANGE( 0, 1 ); |
| 344 |
uint32_t : MOS_BITFIELD_RANGE( 2, 3 ); |
| 345 |
uint32_t MbTypeRemap : MOS_BITFIELD_RANGE( 4, 5 ); |
| 346 |
uint32_t SrcAccess : MOS_BITFIELD_BIT( 6 ); |
| 347 |
uint32_t RefAccess : MOS_BITFIELD_BIT( 7 ); |
| 348 |
uint32_t SearchCtrl : MOS_BITFIELD_RANGE( 8,10 ); |
| 349 |
uint32_t DualSearchPathOption : MOS_BITFIELD_BIT( 11 ); |
| 350 |
uint32_t SubPelMode : MOS_BITFIELD_RANGE( 12,13 ); |
| 351 |
uint32_t SkipType : MOS_BITFIELD_BIT( 14 ); |
| 352 |
uint32_t DisableFieldCacheAlloc : MOS_BITFIELD_BIT( 15 ); |
| 353 |
uint32_t InterChromaMode : MOS_BITFIELD_BIT( 16 ); |
| 354 |
uint32_t FTEnable : MOS_BITFIELD_BIT( 17 ); |
| 355 |
uint32_t BMEDisableFBR : MOS_BITFIELD_BIT( 18 ); |
| 356 |
uint32_t BlockBasedSkipEnable : MOS_BITFIELD_BIT( 19 ); |
| 357 |
uint32_t InterSAD : MOS_BITFIELD_RANGE( 20,21 ); |
| 358 |
uint32_t IntraSAD : MOS_BITFIELD_RANGE( 22,23 ); |
| 359 |
uint32_t SubMbPartMask : MOS_BITFIELD_RANGE( 24,30 ); |
| 360 |
uint32_t : MOS_BITFIELD_BIT( 31 ); |
| 361 |
}; |
| 362 |
struct |
| 363 |
{ |
| 364 |
uint32_t Value; |
| 365 |
}; |
| 366 |
} DW3; |
| 367 |
|
| 368 |
// DW4 |
| 369 |
union |
| 370 |
{ |
| 371 |
struct |
| 372 |
{ |
| 373 |
uint32_t : MOS_BITFIELD_RANGE( 0, 7 ); |
| 374 |
uint32_t PictureHeightMinus1 : MOS_BITFIELD_RANGE( 8,15 ); |
| 375 |
uint32_t PictureWidth : MOS_BITFIELD_RANGE( 16,23 ); |
| 376 |
uint32_t : MOS_BITFIELD_RANGE( 24,31 ); |
| 377 |
}; |
| 378 |
struct |
| 379 |
{ |
| 380 |
uint32_t Value; |
| 381 |
}; |
| 382 |
} DW4; |
| 383 |
|
| 384 |
// DW5 |
| 385 |
union |
| 386 |
{ |
| 387 |
struct |
| 388 |
{ |
| 389 |
uint32_t : MOS_BITFIELD_RANGE( 0, 7 ); |
| 390 |
uint32_t QpPrimeY : MOS_BITFIELD_RANGE( 8,15 ); |
| 391 |
uint32_t RefWidth : MOS_BITFIELD_RANGE( 16,23 ); |
| 392 |
uint32_t RefHeight : MOS_BITFIELD_RANGE( 24,31 ); |
| 393 |
}; |
| 394 |
struct |
| 395 |
{ |
| 396 |
uint32_t Value; |
| 397 |
}; |
| 398 |
} DW5; |
| 399 |
|
| 400 |
// DW6 |
| 401 |
union |
| 402 |
{ |
| 403 |
struct |
| 404 |
{ |
| 405 |
uint32_t : MOS_BITFIELD_RANGE( 0, 2 ); |
| 406 |
uint32_t WriteDistortions : MOS_BITFIELD_BIT( 3 ); |
| 407 |
uint32_t UseMvFromPrevStep : MOS_BITFIELD_BIT( 4 ); |
| 408 |
uint32_t : MOS_BITFIELD_RANGE( 5, 7 ); |
| 409 |
uint32_t SuperCombineDist : MOS_BITFIELD_RANGE( 8,15 ); |
| 410 |
uint32_t MaxVmvR : MOS_BITFIELD_RANGE( 16,31 ); |
| 411 |
}; |
| 412 |
struct |
| 413 |
{ |
| 414 |
uint32_t Value; |
| 415 |
}; |
| 416 |
} DW6; |
| 417 |
|
| 418 |
// DW7 |
| 419 |
union |
| 420 |
{ |
| 421 |
struct |
| 422 |
{ |
| 423 |
uint32_t : MOS_BITFIELD_RANGE( 0,15 ); |
| 424 |
uint32_t MVCostScaleFactor : MOS_BITFIELD_RANGE( 16,17 ); |
| 425 |
uint32_t BilinearEnable : MOS_BITFIELD_BIT( 18 ); |
| 426 |
uint32_t SrcFieldPolarity : MOS_BITFIELD_BIT( 19 ); |
| 427 |
uint32_t WeightedSADHAAR : MOS_BITFIELD_BIT( 20 ); |
| 428 |
uint32_t AConlyHAAR : MOS_BITFIELD_BIT( 21 ); |
| 429 |
uint32_t RefIDCostMode : MOS_BITFIELD_BIT( 22 ); |
| 430 |
uint32_t : MOS_BITFIELD_BIT( 23 ); |
| 431 |
uint32_t SkipCenterMask : MOS_BITFIELD_RANGE( 24,31 ); |
| 432 |
}; |
| 433 |
struct |
| 434 |
{ |
| 435 |
uint32_t Value; |
| 436 |
}; |
| 437 |
} DW7; |
| 438 |
|
| 439 |
// DW8 |
| 440 |
union |
| 441 |
{ |
| 442 |
struct |
| 443 |
{ |
| 444 |
uint32_t Mode0Cost : MOS_BITFIELD_RANGE( 0, 7 ); |
| 445 |
uint32_t Mode1Cost : MOS_BITFIELD_RANGE( 8,15 ); |
| 446 |
uint32_t Mode2Cost : MOS_BITFIELD_RANGE( 16,23 ); |
| 447 |
uint32_t Mode3Cost : MOS_BITFIELD_RANGE( 24,31 ); |
| 448 |
}; |
| 449 |
struct |
| 450 |
{ |
| 451 |
uint32_t Value; |
| 452 |
}; |
| 453 |
} DW8; |
| 454 |
|
| 455 |
// DW9 |
| 456 |
union |
| 457 |
{ |
| 458 |
struct |
| 459 |
{ |
| 460 |
uint32_t Mode4Cost : MOS_BITFIELD_RANGE( 0, 7 ); |
| 461 |
uint32_t Mode5Cost : MOS_BITFIELD_RANGE( 8,15 ); |
| 462 |
uint32_t Mode6Cost : MOS_BITFIELD_RANGE( 16,23 ); |
| 463 |
uint32_t Mode7Cost : MOS_BITFIELD_RANGE( 24,31 ); |
| 464 |
}; |
| 465 |
struct |
| 466 |
{ |
| 467 |
uint32_t Value; |
| 468 |
}; |
| 469 |
} DW9; |
| 470 |
|
| 471 |
// DW10 |
| 472 |
union |
| 473 |
{ |
| 474 |
struct |
| 475 |
{ |
| 476 |
uint32_t Mode8Cost : MOS_BITFIELD_RANGE( 0, 7 ); |
| 477 |
uint32_t Mode9Cost : MOS_BITFIELD_RANGE( 8,15 ); |
| 478 |
uint32_t RefIDCost : MOS_BITFIELD_RANGE( 16,23 ); |
| 479 |
uint32_t ChromaIntraModeCost : MOS_BITFIELD_RANGE( 24,31 ); |
| 480 |
}; |
| 481 |
struct |
| 482 |
{ |
| 483 |
uint32_t Value; |
| 484 |
}; |
| 485 |
} DW10; |
| 486 |
|
| 487 |
// DW11 |
| 488 |
union |
| 489 |
{ |
| 490 |
struct |
| 491 |
{ |
| 492 |
uint32_t MV0Cost : MOS_BITFIELD_RANGE( 0, 7 ); |
| 493 |
uint32_t MV1Cost : MOS_BITFIELD_RANGE( 8,15 ); |
| 494 |
uint32_t MV2Cost : MOS_BITFIELD_RANGE( 16,23 ); |
| 495 |
uint32_t MV3Cost : MOS_BITFIELD_RANGE( 24,31 ); |
| 496 |
}; |
| 497 |
struct |
| 498 |
{ |
| 499 |
uint32_t Value; |
| 500 |
}; |
| 501 |
} DW11; |
| 502 |
|
| 503 |
// DW12 |
| 504 |
union |
| 505 |
{ |
| 506 |
struct |
| 507 |
{ |
| 508 |
uint32_t MV4Cost : MOS_BITFIELD_RANGE( 0, 7 ); |
| 509 |
uint32_t MV5Cost : MOS_BITFIELD_RANGE( 8,15 ); |
| 510 |
uint32_t MV6Cost : MOS_BITFIELD_RANGE( 16,23 ); |
| 511 |
uint32_t MV7Cost : MOS_BITFIELD_RANGE( 24,31 ); |
| 512 |
}; |
| 513 |
struct |
| 514 |
{ |
| 515 |
uint32_t Value; |
| 516 |
}; |
| 517 |
} DW12; |
| 518 |
|
| 519 |
// DW13 |
| 520 |
union |
| 521 |
{ |
| 522 |
struct |
| 523 |
{ |
| 524 |
uint32_t NumRefIdxL0MinusOne : MOS_BITFIELD_RANGE( 0, 7 ); |
| 525 |
uint32_t NumRefIdxL1MinusOne : MOS_BITFIELD_RANGE( 8,15 ); |
| 526 |
uint32_t RefStreaminCost : MOS_BITFIELD_RANGE( 16,23 ); |
| 527 |
uint32_t ROIEnable : MOS_BITFIELD_RANGE( 24,26 ); |
| 528 |
uint32_t : MOS_BITFIELD_RANGE( 27,31 ); |
| 529 |
}; |
| 530 |
struct |
| 531 |
{ |
| 532 |
uint32_t Value; |
| 533 |
}; |
| 534 |
} DW13; |
| 535 |
|
| 536 |
// DW14 |
| 537 |
union |
| 538 |
{ |
| 539 |
struct |
| 540 |
{ |
| 541 |
uint32_t List0RefID0FieldParity : MOS_BITFIELD_BIT( 0 ); |
| 542 |
uint32_t List0RefID1FieldParity : MOS_BITFIELD_BIT( 1 ); |
| 543 |
uint32_t List0RefID2FieldParity : MOS_BITFIELD_BIT( 2 ); |
| 544 |
uint32_t List0RefID3FieldParity : MOS_BITFIELD_BIT( 3 ); |
| 545 |
uint32_t List0RefID4FieldParity : MOS_BITFIELD_BIT( 4 ); |
| 546 |
uint32_t List0RefID5FieldParity : MOS_BITFIELD_BIT( 5 ); |
| 547 |
uint32_t List0RefID6FieldParity : MOS_BITFIELD_BIT( 6 ); |
| 548 |
uint32_t List0RefID7FieldParity : MOS_BITFIELD_BIT( 7 ); |
| 549 |
uint32_t List1RefID0FieldParity : MOS_BITFIELD_BIT( 8 ); |
| 550 |
uint32_t List1RefID1FieldParity : MOS_BITFIELD_BIT( 9 ); |
| 551 |
uint32_t : MOS_BITFIELD_RANGE( 10,31 ); |
| 552 |
}; |
| 553 |
struct |
| 554 |
{ |
| 555 |
uint32_t Value; |
| 556 |
}; |
| 557 |
} DW14; |
| 558 |
|
| 559 |
// DW15 |
| 560 |
union |
| 561 |
{ |
| 562 |
struct |
| 563 |
{ |
| 564 |
uint32_t PrevMvReadPosFactor : MOS_BITFIELD_RANGE( 0, 7 ); |
| 565 |
uint32_t MvShiftFactor : MOS_BITFIELD_RANGE( 8,15 ); |
| 566 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 16,31 ); |
| 567 |
}; |
| 568 |
struct |
| 569 |
{ |
| 570 |
uint32_t Value; |
| 571 |
}; |
| 572 |
} DW15; |
| 573 |
|
| 574 |
struct |
| 575 |
{ |
| 576 |
// DW16 |
| 577 |
union |
| 578 |
{ |
| 579 |
struct |
| 580 |
{ |
| 581 |
SearchPathDelta SPDelta_0; |
| 582 |
SearchPathDelta SPDelta_1; |
| 583 |
SearchPathDelta SPDelta_2; |
| 584 |
SearchPathDelta SPDelta_3; |
| 585 |
}; |
| 586 |
struct |
| 587 |
{ |
| 588 |
uint32_t Value; |
| 589 |
}; |
| 590 |
} DW16; |
| 591 |
|
| 592 |
// DW17 |
| 593 |
union |
| 594 |
{ |
| 595 |
struct |
| 596 |
{ |
| 597 |
SearchPathDelta SPDelta_4; |
| 598 |
SearchPathDelta SPDelta_5; |
| 599 |
SearchPathDelta SPDelta_6; |
| 600 |
SearchPathDelta SPDelta_7; |
| 601 |
}; |
| 602 |
struct |
| 603 |
{ |
| 604 |
uint32_t Value; |
| 605 |
}; |
| 606 |
} DW17; |
| 607 |
|
| 608 |
// DW18 |
| 609 |
union |
| 610 |
{ |
| 611 |
struct |
| 612 |
{ |
| 613 |
SearchPathDelta SPDelta_8; |
| 614 |
SearchPathDelta SPDelta_9; |
| 615 |
SearchPathDelta SPDelta_10; |
| 616 |
SearchPathDelta SPDelta_11; |
| 617 |
}; |
| 618 |
struct |
| 619 |
{ |
| 620 |
uint32_t Value; |
| 621 |
}; |
| 622 |
} DW18; |
| 623 |
|
| 624 |
// DW19 |
| 625 |
union |
| 626 |
{ |
| 627 |
struct |
| 628 |
{ |
| 629 |
SearchPathDelta SPDelta_12; |
| 630 |
SearchPathDelta SPDelta_13; |
| 631 |
SearchPathDelta SPDelta_14; |
| 632 |
SearchPathDelta SPDelta_15; |
| 633 |
}; |
| 634 |
struct |
| 635 |
{ |
| 636 |
uint32_t Value; |
| 637 |
}; |
| 638 |
} DW19; |
| 639 |
|
| 640 |
// DW20 |
| 641 |
union |
| 642 |
{ |
| 643 |
struct |
| 644 |
{ |
| 645 |
SearchPathDelta SPDelta_16; |
| 646 |
SearchPathDelta SPDelta_17; |
| 647 |
SearchPathDelta SPDelta_18; |
| 648 |
SearchPathDelta SPDelta_19; |
| 649 |
}; |
| 650 |
struct |
| 651 |
{ |
| 652 |
uint32_t Value; |
| 653 |
}; |
| 654 |
} DW20; |
| 655 |
|
| 656 |
// DW21 |
| 657 |
union |
| 658 |
{ |
| 659 |
struct |
| 660 |
{ |
| 661 |
SearchPathDelta SPDelta_20; |
| 662 |
SearchPathDelta SPDelta_21; |
| 663 |
SearchPathDelta SPDelta_22; |
| 664 |
SearchPathDelta SPDelta_23; |
| 665 |
}; |
| 666 |
struct |
| 667 |
{ |
| 668 |
uint32_t Value; |
| 669 |
}; |
| 670 |
} DW21; |
| 671 |
|
| 672 |
// DW22 |
| 673 |
union |
| 674 |
{ |
| 675 |
struct |
| 676 |
{ |
| 677 |
SearchPathDelta SPDelta_24; |
| 678 |
SearchPathDelta SPDelta_25; |
| 679 |
SearchPathDelta SPDelta_26; |
| 680 |
SearchPathDelta SPDelta_27; |
| 681 |
}; |
| 682 |
struct |
| 683 |
{ |
| 684 |
uint32_t Value; |
| 685 |
}; |
| 686 |
} DW22; |
| 687 |
|
| 688 |
// DW23 |
| 689 |
union |
| 690 |
{ |
| 691 |
struct |
| 692 |
{ |
| 693 |
SearchPathDelta SPDelta_28; |
| 694 |
SearchPathDelta SPDelta_29; |
| 695 |
SearchPathDelta SPDelta_30; |
| 696 |
SearchPathDelta SPDelta_31; |
| 697 |
}; |
| 698 |
struct |
| 699 |
{ |
| 700 |
uint32_t Value; |
| 701 |
}; |
| 702 |
} DW23; |
| 703 |
|
| 704 |
// DW24 |
| 705 |
union |
| 706 |
{ |
| 707 |
struct |
| 708 |
{ |
| 709 |
SearchPathDelta SPDelta_32; |
| 710 |
SearchPathDelta SPDelta_33; |
| 711 |
SearchPathDelta SPDelta_34; |
| 712 |
SearchPathDelta SPDelta_35; |
| 713 |
}; |
| 714 |
struct |
| 715 |
{ |
| 716 |
uint32_t Value; |
| 717 |
}; |
| 718 |
} DW24; |
| 719 |
|
| 720 |
// DW25 |
| 721 |
union |
| 722 |
{ |
| 723 |
struct |
| 724 |
{ |
| 725 |
SearchPathDelta SPDelta_36; |
| 726 |
SearchPathDelta SPDelta_37; |
| 727 |
SearchPathDelta SPDelta_38; |
| 728 |
SearchPathDelta SPDelta_39; |
| 729 |
}; |
| 730 |
struct |
| 731 |
{ |
| 732 |
uint32_t Value; |
| 733 |
}; |
| 734 |
} DW25; |
| 735 |
|
| 736 |
// DW26 |
| 737 |
union |
| 738 |
{ |
| 739 |
struct |
| 740 |
{ |
| 741 |
SearchPathDelta SPDelta_40; |
| 742 |
SearchPathDelta SPDelta_41; |
| 743 |
SearchPathDelta SPDelta_42; |
| 744 |
SearchPathDelta SPDelta_43; |
| 745 |
}; |
| 746 |
struct |
| 747 |
{ |
| 748 |
uint32_t Value; |
| 749 |
}; |
| 750 |
} DW26; |
| 751 |
|
| 752 |
// DW27 |
| 753 |
union |
| 754 |
{ |
| 755 |
struct |
| 756 |
{ |
| 757 |
SearchPathDelta SPDelta_44; |
| 758 |
SearchPathDelta SPDelta_45; |
| 759 |
SearchPathDelta SPDelta_46; |
| 760 |
SearchPathDelta SPDelta_47; |
| 761 |
}; |
| 762 |
struct |
| 763 |
{ |
| 764 |
uint32_t Value; |
| 765 |
}; |
| 766 |
} DW27; |
| 767 |
|
| 768 |
// DW28 |
| 769 |
union |
| 770 |
{ |
| 771 |
struct |
| 772 |
{ |
| 773 |
SearchPathDelta SPDelta_48; |
| 774 |
SearchPathDelta SPDelta_49; |
| 775 |
SearchPathDelta SPDelta_50; |
| 776 |
SearchPathDelta SPDelta_51; |
| 777 |
}; |
| 778 |
struct |
| 779 |
{ |
| 780 |
uint32_t Value; |
| 781 |
}; |
| 782 |
} DW28; |
| 783 |
|
| 784 |
// DW29 |
| 785 |
union |
| 786 |
{ |
| 787 |
struct |
| 788 |
{ |
| 789 |
SearchPathDelta SPDelta_52; |
| 790 |
SearchPathDelta SPDelta_53; |
| 791 |
SearchPathDelta SPDelta_54; |
| 792 |
SearchPathDelta SPDelta_55; |
| 793 |
}; |
| 794 |
struct |
| 795 |
{ |
| 796 |
uint32_t Value; |
| 797 |
}; |
| 798 |
} DW29; |
| 799 |
} SPDelta; |
| 800 |
|
| 801 |
// DW30 |
| 802 |
union |
| 803 |
{ |
| 804 |
struct |
| 805 |
{ |
| 806 |
uint32_t ActualMBWidth : MOS_BITFIELD_RANGE( 0,15 ); |
| 807 |
uint32_t ActualMBHeight : MOS_BITFIELD_RANGE( 16,31 ); |
| 808 |
}; |
| 809 |
struct |
| 810 |
{ |
| 811 |
uint32_t Value; |
| 812 |
}; |
| 813 |
} DW30; |
| 814 |
|
| 815 |
// DW31 |
| 816 |
union |
| 817 |
{ |
| 818 |
struct |
| 819 |
{ |
| 820 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 0,31 ); |
| 821 |
}; |
| 822 |
struct |
| 823 |
{ |
| 824 |
uint32_t Value; |
| 825 |
}; |
| 826 |
} DW31; |
| 827 |
|
| 828 |
// DW32 |
| 829 |
union |
| 830 |
{ |
| 831 |
struct |
| 832 |
{ |
| 833 |
uint32_t _4xMeMvOutputDataSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 834 |
}; |
| 835 |
struct |
| 836 |
{ |
| 837 |
uint32_t Value; |
| 838 |
}; |
| 839 |
} DW32; |
| 840 |
|
| 841 |
// DW33 |
| 842 |
union |
| 843 |
{ |
| 844 |
struct |
| 845 |
{ |
| 846 |
uint32_t _16xOr32xMeMvInputDataSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 847 |
}; |
| 848 |
struct |
| 849 |
{ |
| 850 |
uint32_t Value; |
| 851 |
}; |
| 852 |
} DW33; |
| 853 |
|
| 854 |
// DW34 |
| 855 |
union |
| 856 |
{ |
| 857 |
struct |
| 858 |
{ |
| 859 |
uint32_t _4xMeOutputDistSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 860 |
}; |
| 861 |
struct |
| 862 |
{ |
| 863 |
uint32_t Value; |
| 864 |
}; |
| 865 |
} DW34; |
| 866 |
|
| 867 |
// DW35 |
| 868 |
union |
| 869 |
{ |
| 870 |
struct |
| 871 |
{ |
| 872 |
uint32_t _4xMeOutputBrcDistSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 873 |
}; |
| 874 |
struct |
| 875 |
{ |
| 876 |
uint32_t Value; |
| 877 |
}; |
| 878 |
} DW35; |
| 879 |
|
| 880 |
// DW36 |
| 881 |
union |
| 882 |
{ |
| 883 |
struct |
| 884 |
{ |
| 885 |
uint32_t VMEFwdInterPredictionSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 886 |
}; |
| 887 |
struct |
| 888 |
{ |
| 889 |
uint32_t Value; |
| 890 |
}; |
| 891 |
} DW36; |
| 892 |
|
| 893 |
// DW37 |
| 894 |
union |
| 895 |
{ |
| 896 |
struct |
| 897 |
{ |
| 898 |
uint32_t VMEBwdInterPredictionSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 899 |
}; |
| 900 |
struct |
| 901 |
{ |
| 902 |
uint32_t Value; |
| 903 |
}; |
| 904 |
} DW37; |
| 905 |
|
| 906 |
// DW38 |
| 907 |
union |
| 908 |
{ |
| 909 |
struct |
| 910 |
{ |
| 911 |
uint32_t VDEncStreamInSurfIndex : MOS_BITFIELD_RANGE( 0,31 ); |
| 912 |
}; |
| 913 |
struct |
| 914 |
{ |
| 915 |
uint32_t Value; |
| 916 |
}; |
| 917 |
} DW38; |
| 918 |
|
| 919 |
} CODECHAL_ENCODE_AVC_ME_CURBE, *PCODECHAL_ENCODE_AVC_ME_CURBE; |
| 920 |
C_ASSERT(MOS_BYTES_TO_DWORDS(sizeof(CODECHAL_ENCODE_AVC_ME_CURBE)) == 39); |
| 921 |
|
| 922 |
// AVC ME CURBE init data for G9 CM Kernel |
| 923 |
static const uint32_t g_cInit_CODECHAL_ENCODE_AVC_ME_CURBE[39] = |
| 924 |
{ |
| 925 |
0x00000000, 0x00200010, 0x00003939, 0x77a43000, 0x00000000, 0x28300000, 0x00000000, 0x00000000, |
| 926 |
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 927 |
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 928 |
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
| 929 |
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff |
| 930 |
}; |
| 931 |
|
| 932 |
// CURBE for Static Frame Detection kernel |
| 933 |
typedef struct _CODECHAL_ENCODE_AVC_SFD_CURBE_COMMON |
| 934 |
{ |
| 935 |
union |
| 936 |
{ |
| 937 |
struct |
| 938 |
{ |
| 939 |
uint32_t VDEncModeDisable : MOS_BITFIELD_BIT( 0 ); |
| 940 |
uint32_t BRCModeEnable : MOS_BITFIELD_BIT( 1 ); |
| 941 |
uint32_t SliceType : MOS_BITFIELD_RANGE( 2, 3 ); |
| 942 |
uint32_t : MOS_BITFIELD_BIT( 4 ); |
| 943 |
uint32_t StreamInType : MOS_BITFIELD_RANGE( 5, 8 ); |
| 944 |
uint32_t EnableAdaptiveMvStreamIn : MOS_BITFIELD_BIT( 9 ); |
| 945 |
uint32_t : MOS_BITFIELD_BIT( 10 ); |
| 946 |
uint32_t EnableIntraCostScalingForStaticFrame : MOS_BITFIELD_BIT( 11 ); |
| 947 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 12, 31 ); |
| 948 |
}; |
| 949 |
struct |
| 950 |
{ |
| 951 |
uint32_t Value; |
| 952 |
}; |
| 953 |
} DW0; |
| 954 |
|
| 955 |
union |
| 956 |
{ |
| 957 |
struct |
| 958 |
{ |
| 959 |
uint32_t QPValue : MOS_BITFIELD_RANGE( 0, 7 ); |
| 960 |
uint32_t NumOfRefs : MOS_BITFIELD_RANGE( 8, 15 ); |
| 961 |
uint32_t HMEStreamInRefCost : MOS_BITFIELD_RANGE( 16, 23 ); |
| 962 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 24, 31 ); |
| 963 |
}; |
| 964 |
struct |
| 965 |
{ |
| 966 |
uint32_t Value; |
| 967 |
}; |
| 968 |
} DW1; |
| 969 |
|
| 970 |
union |
| 971 |
{ |
| 972 |
struct |
| 973 |
{ |
| 974 |
uint32_t FrameWidthInMBs : MOS_BITFIELD_RANGE( 0, 15 ); // round-up to 4-MB aligned |
| 975 |
uint32_t FrameHeightInMBs : MOS_BITFIELD_RANGE( 16, 31 ); // round-up to 4-MB aligned |
| 976 |
}; |
| 977 |
struct |
| 978 |
{ |
| 979 |
uint32_t Value; |
| 980 |
}; |
| 981 |
} DW2; |
| 982 |
|
| 983 |
union |
| 984 |
{ |
| 985 |
struct |
| 986 |
{ |
| 987 |
uint32_t LargeMvThresh : MOS_BITFIELD_RANGE( 0, 31 ); |
| 988 |
}; |
| 989 |
struct |
| 990 |
{ |
| 991 |
uint32_t Value; |
| 992 |
}; |
| 993 |
} DW3; |
| 994 |
|
| 995 |
union |
| 996 |
{ |
| 997 |
struct |
| 998 |
{ |
| 999 |
uint32_t TotalLargeMvThreshold : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1000 |
}; |
| 1001 |
struct |
| 1002 |
{ |
| 1003 |
uint32_t Value; |
| 1004 |
}; |
| 1005 |
} DW4; |
| 1006 |
|
| 1007 |
union |
| 1008 |
{ |
| 1009 |
struct |
| 1010 |
{ |
| 1011 |
uint32_t ZMVThreshold : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1012 |
}; |
| 1013 |
struct |
| 1014 |
{ |
| 1015 |
uint32_t Value; |
| 1016 |
}; |
| 1017 |
} DW5; |
| 1018 |
|
| 1019 |
union |
| 1020 |
{ |
| 1021 |
struct |
| 1022 |
{ |
| 1023 |
uint32_t TotalZMVThreshold : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1024 |
}; |
| 1025 |
struct |
| 1026 |
{ |
| 1027 |
uint32_t Value; |
| 1028 |
}; |
| 1029 |
} DW6; |
| 1030 |
|
| 1031 |
union |
| 1032 |
{ |
| 1033 |
struct |
| 1034 |
{ |
| 1035 |
uint32_t MinDistThreshold : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1036 |
}; |
| 1037 |
struct |
| 1038 |
{ |
| 1039 |
uint32_t Value; |
| 1040 |
}; |
| 1041 |
} DW7; |
| 1042 |
|
| 1043 |
uint8_t CostTable[52]; |
| 1044 |
|
| 1045 |
union |
| 1046 |
{ |
| 1047 |
struct |
| 1048 |
{ |
| 1049 |
uint32_t ActualWidthInMB : MOS_BITFIELD_RANGE( 0, 15 ); |
| 1050 |
uint32_t ActualHeightInMB : MOS_BITFIELD_RANGE( 16, 31 ); |
| 1051 |
}; |
| 1052 |
struct |
| 1053 |
{ |
| 1054 |
uint32_t Value; |
| 1055 |
}; |
| 1056 |
} DW21; |
| 1057 |
|
| 1058 |
union |
| 1059 |
{ |
| 1060 |
struct |
| 1061 |
{ |
| 1062 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 0,31 ); |
| 1063 |
}; |
| 1064 |
struct |
| 1065 |
{ |
| 1066 |
uint32_t Value; |
| 1067 |
}; |
| 1068 |
} DW22; |
| 1069 |
|
| 1070 |
union |
| 1071 |
{ |
| 1072 |
struct |
| 1073 |
{ |
| 1074 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 0,31 ); |
| 1075 |
}; |
| 1076 |
struct |
| 1077 |
{ |
| 1078 |
uint32_t Value; |
| 1079 |
}; |
| 1080 |
} DW23; |
| 1081 |
|
| 1082 |
union |
| 1083 |
{ |
| 1084 |
struct |
| 1085 |
{ |
| 1086 |
uint32_t VDEncInputImagStateIndex : MOS_BITFIELD_RANGE( 0, 31 ); // used in VDEnc CQP mode |
| 1087 |
}; |
| 1088 |
struct |
| 1089 |
{ |
| 1090 |
uint32_t Value; |
| 1091 |
}; |
| 1092 |
} DW24; |
| 1093 |
|
| 1094 |
union |
| 1095 |
{ |
| 1096 |
struct |
| 1097 |
{ |
| 1098 |
uint32_t Reserved : MOS_BITFIELD_RANGE( 0,31 ); |
| 1099 |
}; |
| 1100 |
struct |
| 1101 |
{ |
| 1102 |
uint32_t Value; |
| 1103 |
}; |
| 1104 |
} DW25; |
| 1105 |
|
| 1106 |
union |
| 1107 |
{ |
| 1108 |
struct |
| 1109 |
{ |
| 1110 |
uint32_t MVDataSurfaceIndex : MOS_BITFIELD_RANGE( 0, 31 ); // contains HME MV Data generated by HME kernel |
| 1111 |
}; |
| 1112 |
struct |
| 1113 |
{ |
| 1114 |
uint32_t Value; |
| 1115 |
}; |
| 1116 |
} DW26; |
| 1117 |
|
| 1118 |
union |
| 1119 |
{ |
| 1120 |
struct |
| 1121 |
{ |
| 1122 |
uint32_t InterDistortionSurfaceIndex : MOS_BITFIELD_RANGE( 0, 31 ); // contains HME Inter Distortion generated by HME kernel |
| 1123 |
}; |
| 1124 |
struct |
| 1125 |
{ |
| 1126 |
uint32_t Value; |
| 1127 |
}; |
| 1128 |
} DW27; |
| 1129 |
|
| 1130 |
union |
| 1131 |
{ |
| 1132 |
struct |
| 1133 |
{ |
| 1134 |
uint32_t OutputDataSurfaceIndex : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1135 |
}; |
| 1136 |
struct |
| 1137 |
{ |
| 1138 |
uint32_t Value; |
| 1139 |
}; |
| 1140 |
} DW28; |
| 1141 |
|
| 1142 |
union |
| 1143 |
{ |
| 1144 |
struct |
| 1145 |
{ |
| 1146 |
uint32_t VDEncOutputImagStateIndex : MOS_BITFIELD_RANGE( 0, 31 ); |
| 1147 |
}; |
| 1148 |
struct |
| 1149 |
{ |
| 1150 |
uint32_t Value; |
| 1151 |
}; |
| 1152 |
} DW29; |
| 1153 |
|
| 1154 |
} CODECHAL_ENCODE_AVC_SFD_CURBE_COMMON, *PCODECHAL_ENCODE_AVC_SFD_CURBE_COMMON; |
| 1155 |
C_ASSERT(MOS_BYTES_TO_DWORDS(sizeof(CODECHAL_ENCODE_AVC_SFD_CURBE_COMMON)) == 30); |
| 1156 |
|
| 1157 |
typedef struct _CODECHAL_ENCODE_AVC_SFD_SURFACE_PARAMS |
| 1158 |
{ |
| 1159 |
uint32_t dwDownscaledWidthInMb4x; |
| 1160 |
uint32_t dwDownscaledHeightInMb4x; |
| 1161 |
uint32_t dwMeMvBottomFieldOffset; |
| 1162 |
uint32_t dwMeDistortionBottomFieldOffset; |
| 1163 |
PMOS_RESOURCE presVDEncImageStateInputBuffer; |
| 1164 |
PMOS_SURFACE psMeMvDataSurface; |
| 1165 |
PMOS_SURFACE psMeDistortionSurface; |
| 1166 |
PMOS_RESOURCE presOutputBuffer; |
| 1167 |
PMOS_RESOURCE presVDEncImageStateOutputBuffer; |
| 1168 |
PMHW_KERNEL_STATE pKernelState; |
| 1169 |
bool bVdencActive; |
| 1170 |
bool bVdencBrcEnabled; |
| 1171 |
} CODECHAL_ENCODE_AVC_SFD_SURFACE_PARAMS, *PCODECHAL_ENCODE_AVC_SFD_SURFACE_PARAMS; |
| 1172 |
|
| 1173 |
typedef struct _CODECHAL_ENCODE_AVC_SFD_CURBE_PARAMS |
| 1174 |
{ |
| 1175 |
PMHW_KERNEL_STATE pKernelState; |
| 1176 |
} CODECHAL_ENCODE_AVC_SFD_CURBE_PARAMS, *PCODECHAL_ENCODE_AVC_SFD_CURBE_PARAMS; |
| 1177 |
|
| 1178 |
//! |
| 1179 |
//! \brief Vertical MV component range based on levelIdc |
| 1180 |
//! \details VDBOX private function to get vertical MV componet range |
| 1181 |
//! \param [in] levelIdc |
| 1182 |
//! AVC level |
| 1183 |
//! \return uint32_t |
| 1184 |
//! return the max vertical mv component base on input level |
| 1185 |
//! |
| 1186 |
uint32_t CodecHalAvcEncode_GetMaxVmvR(uint8_t levelIdc); |
| 1187 |
|
| 1188 |
//! |
| 1189 |
//! \brief Get MV component range based on levelIdc |
| 1190 |
//! \details VDBOX private function to get MV componet range |
| 1191 |
//! \param [in] levelIdc |
| 1192 |
//! AVC level |
| 1193 |
//! \return uint32_t |
| 1194 |
//! return the max mv component base on input level |
| 1195 |
//! |
| 1196 |
uint32_t CodecHalAvcEncode_GetMaxMvLen(uint8_t levelIdc); |
| 1197 |
|
| 1198 |
//! |
| 1199 |
//! \brief Get the filed parity: Top filed or Bottom filed |
| 1200 |
//! \details Client facing function to get the filed parity: Top filed or Bottom filed |
| 1201 |
//! \param [in] params |
| 1202 |
//! PCODEC_AVC_ENCODE_SLICE_PARAMS pSlcParams |
| 1203 |
//! \param [list] list |
| 1204 |
//! forword or backword reference |
| 1205 |
//! \param [in] index |
| 1206 |
//! reference frame index |
| 1207 |
//! \return uint32_t |
| 1208 |
//! Bottom field or Top field |
| 1209 |
//! |
| 1210 |
bool CodecHalAvcEncode_GetFieldParity( |
| 1211 |
PCODEC_AVC_ENCODE_SLICE_PARAMS params, |
| 1212 |
uint32_t list, |
| 1213 |
uint32_t index); |
| 1214 |
|
| 1215 |
//! |
| 1216 |
//! \brief Get profile level max frame size |
| 1217 |
//! \param [in] seqParams |
| 1218 |
//! Encoder Sequence params |
| 1219 |
//! \param [in] encoder |
| 1220 |
//! Encoder structure |
| 1221 |
//! \param [in] profileLevelMaxFrame |
| 1222 |
//! Profile Level Max Frame |
| 1223 |
//! \return MOS_STATUS |
| 1224 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1225 |
//! |
| 1226 |
MOS_STATUS CodecHalAvcEncode_GetProfileLevelMaxFrameSize( |
| 1227 |
PCODEC_AVC_ENCODE_SEQUENCE_PARAMS seqParams, |
| 1228 |
CodechalEncoderState* encoder, |
| 1229 |
uint32_t* profileLevelMaxFrame); |
| 1230 |
|
| 1231 |
//! \brief Get the max number of allowed slice |
| 1232 |
//! \param [in] profileIdc |
| 1233 |
//! AVC profile idc |
| 1234 |
//! \param [in] levelIdc |
| 1235 |
//! AVC level idc |
| 1236 |
//! \param [in] framesPer100Sec |
| 1237 |
//! frame Per 100Sec |
| 1238 |
//! \return uint16_t |
| 1239 |
//! return uiMaxAllowedNumSlices |
| 1240 |
//! |
| 1241 |
uint16_t CodecHalAvcEncode_GetMaxNumSlicesAllowed( |
| 1242 |
CODEC_AVC_PROFILE_IDC profileIdc, |
| 1243 |
CODEC_AVC_LEVEL_IDC levelIdc, |
| 1244 |
uint32_t framesPer100Sec); |
| 1245 |
|
| 1246 |
//! |
| 1247 |
//! \brief Use to pack picture header related params |
| 1248 |
//! \param [in] params |
| 1249 |
//! picture header pack params |
| 1250 |
//! \return MOS_STATUS |
| 1251 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1252 |
//! |
| 1253 |
MOS_STATUS CodecHalAvcEncode_PackPictureHeader( |
| 1254 |
PCODECHAL_ENCODE_AVC_PACK_PIC_HEADER_PARAMS params); |
| 1255 |
|
| 1256 |
//! |
| 1257 |
//! \brief Use to pack slice header related params |
| 1258 |
//! \param [in] params |
| 1259 |
//! slice header pack params |
| 1260 |
//! \return MOS_STATUS |
| 1261 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1262 |
//! |
| 1263 |
MOS_STATUS CodecHalAvcEncode_PackSliceHeader( |
| 1264 |
PCODECHAL_ENCODE_AVC_PACK_SLC_HEADER_PARAMS params); |
| 1265 |
|
| 1266 |
//! |
| 1267 |
//! \brief Use to get picture num of slice header to be packed |
| 1268 |
//! \param [in] params |
| 1269 |
//! pack slice header pack params |
| 1270 |
//! \param [in] list |
| 1271 |
//! forword or backword reference |
| 1272 |
//! \return void |
| 1273 |
//! |
| 1274 |
static void CodecHal_PackSliceHeader_GetPicNum ( |
| 1275 |
PCODECHAL_ENCODE_AVC_PACK_SLC_HEADER_PARAMS params, |
| 1276 |
uint8_t list); |
| 1277 |
|
| 1278 |
//! |
| 1279 |
//! \class CodechalEncodeAvcBase |
| 1280 |
//! \brief CodechalE encode Avc base |
| 1281 |
//! |
| 1282 |
class CodechalEncodeAvcBase : public CodechalEncoderState |
| 1283 |
{ |
| 1284 |
public: |
| 1285 |
// AvcState functions. |
| 1286 |
//! |
| 1287 |
//! \brief Constructor |
| 1288 |
//! |
| 1289 |
CodechalEncodeAvcBase( |
| 1290 |
CodechalHwInterface * hwInterface, |
| 1291 |
CodechalDebugInterface *debugInterface, |
| 1292 |
PCODECHAL_STANDARD_INFO standardInfo); |
| 1293 |
|
| 1294 |
//! |
| 1295 |
//! \brief Copy constructor |
| 1296 |
//! |
| 1297 |
CodechalEncodeAvcBase(const CodechalEncodeAvcBase&) = delete; |
| 1298 |
|
| 1299 |
//! |
| 1300 |
//! \brief Copy assignment operator |
| 1301 |
//! |
| 1302 |
CodechalEncodeAvcBase& operator=(const CodechalEncodeAvcBase&) = delete; |
| 1303 |
|
| 1304 |
//! |
| 1305 |
//! \brief Destructor |
| 1306 |
//! |
| 1307 |
virtual ~CodechalEncodeAvcBase(); |
| 1308 |
|
| 1309 |
//Encode interface definitions |
| 1310 |
//! |
| 1311 |
//! \brief Initialize standard related members. |
| 1312 |
//! \details Initialize members, set proper value |
| 1313 |
//! to involved variables, allocate resources. |
| 1314 |
//! \param [in] settings |
| 1315 |
//! Encode settings. |
| 1316 |
//! |
| 1317 |
//! \return MOS_STATUS |
| 1318 |
//! MOS_STATUS_SUCCESS if success |
| 1319 |
//! |
| 1320 |
virtual MOS_STATUS Initialize(CodechalSetting * settings); |
| 1321 |
|
| 1322 |
virtual MOS_STATUS GetStatusReport( |
| 1323 |
EncodeStatus *encodeStatus, |
| 1324 |
EncodeStatusReport *encodeStatusReport); |
| 1325 |
|
| 1326 |
//! |
| 1327 |
//! \brief Encode User Feature Key Report. |
| 1328 |
//! \details Report user feature values set by encode. |
| 1329 |
//! |
| 1330 |
//! \return MOS_STATUS |
| 1331 |
//! MOS_STATUS_SUCCESS if success |
| 1332 |
//! |
| 1333 |
virtual MOS_STATUS UserFeatureKeyReport(); |
| 1334 |
|
| 1335 |
//! |
| 1336 |
//! \brief Initialize Encode ME kernel state |
| 1337 |
//! |
| 1338 |
//! \return MOS_STATUS |
| 1339 |
//! MOS_STATUS_SUCCESS if success |
| 1340 |
//! |
| 1341 |
virtual MOS_STATUS InitKernelStateMe() = 0; |
| 1342 |
|
| 1343 |
//! |
| 1344 |
//! \brief Set Encode ME kernel Curbe data. |
| 1345 |
//! |
| 1346 |
//! \param [in] params |
| 1347 |
//! Pointer to the MeCurbeParams |
| 1348 |
//! |
| 1349 |
//! \return MOS_STATUS |
| 1350 |
//! MOS_STATUS_SUCCESS if success |
| 1351 |
//! |
| 1352 |
virtual MOS_STATUS SetCurbeMe( MeCurbeParams* params ) = 0; |
| 1353 |
|
| 1354 |
//! |
| 1355 |
//! \brief Set Encode ME kernel Surfaces |
| 1356 |
//! |
| 1357 |
//! \param [in] cmdBuffer |
| 1358 |
//! Pointer to the MOS_COMMAND_BUFFER |
| 1359 |
//! \param [in] params |
| 1360 |
//! Pointer to the CODECHAL_ME_SURFACE_PARAMS |
| 1361 |
//! |
| 1362 |
//! \return MOS_STATUS |
| 1363 |
//! MOS_STATUS_SUCCESS if success |
| 1364 |
//! |
| 1365 |
virtual MOS_STATUS SendMeSurfaces( |
| 1366 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1367 |
MeSurfaceParams* params) = 0; |
| 1368 |
//! |
| 1369 |
//! \brief AVC State Initialization. |
| 1370 |
//! |
| 1371 |
//! \return MOS_STATUS |
| 1372 |
//! MOS_STATUS_SUCCESS if success |
| 1373 |
//! |
| 1374 |
virtual MOS_STATUS Initialize(); |
| 1375 |
|
| 1376 |
|
| 1377 |
//! |
| 1378 |
//! \brief AVC Resource Allocation for ENC. |
| 1379 |
//! |
| 1380 |
//! \return MOS_STATUS |
| 1381 |
//! MOS_STATUS_SUCCESS if success |
| 1382 |
//! |
| 1383 |
virtual MOS_STATUS AllocateEncResources(); |
| 1384 |
|
| 1385 |
//! |
| 1386 |
//! \brief AVC Resource Allocation for Encoder. |
| 1387 |
//! |
| 1388 |
//! \return MOS_STATUS |
| 1389 |
//! MOS_STATUS_SUCCESS if success |
| 1390 |
//! |
| 1391 |
virtual MOS_STATUS AllocateResources(); |
| 1392 |
|
| 1393 |
//! |
| 1394 |
//! \brief Set AVC Sequence Structs. |
| 1395 |
//! |
| 1396 |
//! \return MOS_STATUS |
| 1397 |
//! MOS_STATUS_SUCCESS if success |
| 1398 |
//! |
| 1399 |
virtual MOS_STATUS SetSequenceStructs(); |
| 1400 |
|
| 1401 |
//! |
| 1402 |
//! \brief Set AVC Picture Structs. |
| 1403 |
//! |
| 1404 |
//! \return MOS_STATUS |
| 1405 |
//! MOS_STATUS_SUCCESS if success |
| 1406 |
//! |
| 1407 |
virtual MOS_STATUS SetPictureStructs(); |
| 1408 |
|
| 1409 |
//! |
| 1410 |
//! \brief Set AVC Slice Structs. |
| 1411 |
//! |
| 1412 |
//! \return MOS_STATUS |
| 1413 |
//! MOS_STATUS_SUCCESS if success |
| 1414 |
//! |
| 1415 |
virtual MOS_STATUS SetSliceStructs(); |
| 1416 |
|
| 1417 |
//! |
| 1418 |
//! \brief Run Encode ME kernel |
| 1419 |
//! |
| 1420 |
//! \param [in] brcBuffers |
| 1421 |
//! Pointer to the EncodeBrcBuffers |
| 1422 |
//! \param [in] hmeLevel |
| 1423 |
//! Hme level |
| 1424 |
//! |
| 1425 |
//! \return MOS_STATUS |
| 1426 |
//! MOS_STATUS_SUCCESS if success |
| 1427 |
//! |
| 1428 |
virtual MOS_STATUS EncodeMeKernel( |
| 1429 |
EncodeBrcBuffers* brcBuffers, |
| 1430 |
HmeLevel hmeLevel); |
| 1431 |
|
| 1432 |
//! |
| 1433 |
//! \brief Allocate Batch Buffer For PakSlice. |
| 1434 |
//! |
| 1435 |
//! \param [in] numSlices |
| 1436 |
//! Number of Slice |
| 1437 |
//! \param [in] numPakPasses |
| 1438 |
//! Number of PAK pass. |
| 1439 |
//! \param [in] currRecycledBufIdx |
| 1440 |
//! Current Recycle Buffer Index. |
| 1441 |
//! |
| 1442 |
//! \return MOS_STATUS |
| 1443 |
//! MOS_STATUS_SUCCESS if success |
| 1444 |
//! |
| 1445 |
virtual MOS_STATUS AllocateBatchBufferForPakSlices( |
| 1446 |
uint32_t numSlices, |
| 1447 |
uint8_t numPakPasses, |
| 1448 |
uint8_t currRecycledBufIdx); |
| 1449 |
|
| 1450 |
//! |
| 1451 |
//! \brief Release Batch Buffer For PakSlice. |
| 1452 |
//! |
| 1453 |
//! \param [in] currRecycledBufIdx |
| 1454 |
//! Current Recycle Buffer Index. |
| 1455 |
//! |
| 1456 |
//! \return MOS_STATUS |
| 1457 |
//! MOS_STATUS_SUCCESS if success |
| 1458 |
//! |
| 1459 |
virtual MOS_STATUS ReleaseBatchBufferForPakSlices( uint8_t currRecycledBufIdx); |
| 1460 |
|
| 1461 |
//! |
| 1462 |
//! \brief Initialize kernel binary size info. |
| 1463 |
//! |
| 1464 |
//! \return MOS_STATUS |
| 1465 |
//! MOS_STATUS_SUCCESS if success |
| 1466 |
//! |
| 1467 |
MOS_STATUS AddIshSize(uint32_t kuid, uint8_t* kernelBase); |
| 1468 |
|
| 1469 |
//! |
| 1470 |
//! \brief Calculate scaling list |
| 1471 |
//! |
| 1472 |
//! \return void |
| 1473 |
//! |
| 1474 |
void ScalingListFlat(); |
| 1475 |
|
| 1476 |
//! |
| 1477 |
//! \brief Calculate scaling list |
| 1478 |
//! |
| 1479 |
//! \return void |
| 1480 |
//! |
| 1481 |
void ScalingListFallbackRuleA(); |
| 1482 |
|
| 1483 |
//! |
| 1484 |
//! \brief Get Dist Scale factor |
| 1485 |
//! |
| 1486 |
//! \return void |
| 1487 |
//! |
| 1488 |
void GetDistScaleFactor(); |
| 1489 |
|
| 1490 |
//! |
| 1491 |
//! \brief Initialize MMC state |
| 1492 |
//! |
| 1493 |
//! \return MOS_STATUS |
| 1494 |
//! MOS_STATUS_SUCCESS if success |
| 1495 |
//! |
| 1496 |
virtual MOS_STATUS InitMmcState(); |
| 1497 |
|
| 1498 |
//! |
| 1499 |
//! \brief Get bidirectional weight |
| 1500 |
//! |
| 1501 |
//! \param [in] distScaleFactorRefID0List0 |
| 1502 |
//! DistScaleFactorRefID0List0 |
| 1503 |
//! \param [in] weightedBiPredIdc |
| 1504 |
//! Same as AVC syntax element. |
| 1505 |
//! |
| 1506 |
//! \return int32_t |
| 1507 |
//! Bidirectional weight |
| 1508 |
//! |
| 1509 |
int32_t GetBiWeight( |
| 1510 |
uint32_t distScaleFactorRefID0List0, |
| 1511 |
uint16_t weightedBiPredIdc); |
| 1512 |
|
| 1513 |
//! |
| 1514 |
//! \brief Update the slice count according to the slice shutdown policy |
| 1515 |
//! |
| 1516 |
virtual void UpdateSSDSliceCount(); |
| 1517 |
|
| 1518 |
//! |
| 1519 |
//! \brief Build slices with header insertion |
| 1520 |
//! \param [in] cmdBuffer |
| 1521 |
//! command buffer |
| 1522 |
//! \param [in] params |
| 1523 |
//! VDBOX AVC slice state params |
| 1524 |
//! \return MOS_STATUS |
| 1525 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1526 |
//! |
| 1527 |
MOS_STATUS SendSlice( |
| 1528 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1529 |
PMHW_VDBOX_AVC_SLICE_STATE params); |
| 1530 |
|
| 1531 |
//! |
| 1532 |
//! \brief Store number passes |
| 1533 |
//! |
| 1534 |
//! \param [in] encodeStatusBuf |
| 1535 |
//! Encode status buffer |
| 1536 |
//! \param [in] miInterface |
| 1537 |
//! Mi interface |
| 1538 |
//! \param [in] cmdBuffer |
| 1539 |
//! Command buffer |
| 1540 |
//! \param [in] currPass |
| 1541 |
//! Curr pass |
| 1542 |
//! |
| 1543 |
//! \return MOS_STATUS |
| 1544 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1545 |
//! |
| 1546 |
MOS_STATUS StoreNumPasses( |
| 1547 |
EncodeStatusBuffer *encodeStatusBuf, |
| 1548 |
MhwMiInterface *miInterface, |
| 1549 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1550 |
uint32_t currPass); |
| 1551 |
|
| 1552 |
virtual MOS_STATUS AddMfxAvcSlice( |
| 1553 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1554 |
PMHW_BATCH_BUFFER batchBuffer, |
| 1555 |
PMHW_VDBOX_AVC_SLICE_STATE avcSliceState); |
| 1556 |
|
| 1557 |
virtual MOS_STATUS AddVdencSliceStateCmd( |
| 1558 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1559 |
PMHW_VDBOX_AVC_SLICE_STATE params); |
| 1560 |
|
| 1561 |
#if USE_CODECHAL_DEBUG_TOOL |
| 1562 |
MOS_STATUS DumpSeqParams( |
| 1563 |
PCODEC_AVC_ENCODE_SEQUENCE_PARAMS seqParams, |
| 1564 |
PCODEC_AVC_IQ_MATRIX_PARAMS matrixParams); |
| 1565 |
|
| 1566 |
MOS_STATUS DumpPicParams( |
| 1567 |
PCODEC_AVC_ENCODE_PIC_PARAMS picParams, |
| 1568 |
PCODEC_AVC_IQ_MATRIX_PARAMS matrixParams); |
| 1569 |
|
| 1570 |
MOS_STATUS DumpFeiPicParams( |
| 1571 |
CodecEncodeAvcFeiPicParams *feiPicParams); |
| 1572 |
|
| 1573 |
MOS_STATUS DumpSliceParams( |
| 1574 |
PCODEC_AVC_ENCODE_SLICE_PARAMS sliceParams, |
| 1575 |
PCODEC_AVC_ENCODE_PIC_PARAMS picParams); |
| 1576 |
|
| 1577 |
MOS_STATUS DumpVuiParams( |
| 1578 |
PCODECHAL_ENCODE_AVC_VUI_PARAMS avcVuiParams); |
| 1579 |
|
| 1580 |
#endif |
| 1581 |
|
| 1582 |
protected: |
| 1583 |
//! |
| 1584 |
//! \brief Set MFX_PIPE_MODE_SELECT parameter |
| 1585 |
//! |
| 1586 |
//! \param [in] genericParam |
| 1587 |
//! CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS |
| 1588 |
//! \param [out] param |
| 1589 |
//! reference to MHW_VDBOX_PIPE_MODE_SELECT_PARAMS |
| 1590 |
//! |
| 1591 |
//! \return void |
| 1592 |
//! |
| 1593 |
virtual void SetMfxPipeModeSelectParams( |
| 1594 |
const CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS& genericParam, |
| 1595 |
MHW_VDBOX_PIPE_MODE_SELECT_PARAMS& param); |
| 1596 |
|
| 1597 |
//! |
| 1598 |
//! \brief set MFX_PIPE_BUF_ADDR_STATE parameter |
| 1599 |
//! |
| 1600 |
//! \param [in] genericParam |
| 1601 |
//! CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS |
| 1602 |
//! \param [out] param |
| 1603 |
//! reference to MHW_VDBOX_PIPE_BUF_ADDR_PARAMS |
| 1604 |
//! |
| 1605 |
//! \return MOS_STATUS |
| 1606 |
//! MOS_STATUS_SUCCESS if success |
| 1607 |
//! |
| 1608 |
virtual MOS_STATUS SetMfxPipeBufAddrStateParams( |
| 1609 |
CODECHAL_ENCODE_AVC_GENERIC_PICTURE_LEVEL_PARAMS genericParam, |
| 1610 |
MHW_VDBOX_PIPE_BUF_ADDR_PARAMS& param); |
| 1611 |
|
| 1612 |
//! |
| 1613 |
//! \brief Set MFX_IND_OBJ_BASE_ADDR_STATE parameter |
| 1614 |
//! |
| 1615 |
//! \param [out] param |
| 1616 |
//! reference to MHW_VDBOX_IND_OBJ_BASE_ADDR_PARAMS |
| 1617 |
//! |
| 1618 |
//! \return void |
| 1619 |
//! |
| 1620 |
virtual void SetMfxIndObjBaseAddrStateParams(MHW_VDBOX_IND_OBJ_BASE_ADDR_PARAMS& param); |
| 1621 |
|
| 1622 |
//! |
| 1623 |
//! \brief Set MHW_VDBOX_BSP_BUF_BASE_ADDR_STATE parameter |
| 1624 |
//! |
| 1625 |
//! \param [out] param |
| 1626 |
//! reference to MHW_VDBOX_BSP_BUF_BASE_ADDR_PARAMS |
| 1627 |
//! |
| 1628 |
//! \return void |
| 1629 |
//! |
| 1630 |
virtual void SetMfxBspBufBaseAddrStateParams(MHW_VDBOX_BSP_BUF_BASE_ADDR_PARAMS& param); |
| 1631 |
|
| 1632 |
//! |
| 1633 |
//! \brief Set MHW_VDBOX_QM_STATE parameter |
| 1634 |
//! |
| 1635 |
//! \param [out] qmParams |
| 1636 |
//! reference to MHW_VDBOX_QM_PARAMS |
| 1637 |
//! \param [out] fqmParams |
| 1638 |
//! reference to MHW_VDBOX_QM_PARAMS |
| 1639 |
//! |
| 1640 |
//! \return void |
| 1641 |
//! |
| 1642 |
virtual void SetMfxQmStateParams(MHW_VDBOX_QM_PARAMS& qmParams, MHW_VDBOX_QM_PARAMS & fqmParams); |
| 1643 |
|
| 1644 |
//! |
| 1645 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1646 |
//! |
| 1647 |
//! \param [out] param |
| 1648 |
//! reference to MHW_VDBOX_AVC_IMG_PARAMS |
| 1649 |
//! |
| 1650 |
//! \return void |
| 1651 |
//! |
| 1652 |
virtual void SetMfxAvcImgStateParams(MHW_VDBOX_AVC_IMG_PARAMS& param); |
| 1653 |
|
| 1654 |
public: |
| 1655 |
PMOS_INTERFACE m_origOsInterface = nullptr; //!< Os Interface |
| 1656 |
CodechalHwInterface *m_origHwInterface = nullptr; //!< Hw Interface |
| 1657 |
PMHW_STATE_HEAP_INTERFACE m_origStateHeapInterface = nullptr; //!< StateHeap Interface |
| 1658 |
|
| 1659 |
// Parameters passed by application |
| 1660 |
PCODEC_AVC_ENCODE_PIC_PARAMS m_avcPicParams[CODEC_AVC_MAX_PPS_NUM]; //!< Pointer to array of picture parameter, could be removed |
| 1661 |
PCODEC_AVC_ENCODE_SEQUENCE_PARAMS m_avcSeqParams[CODEC_AVC_MAX_SPS_NUM]; //!< Pointer to array of sequence parameter, could be removed |
| 1662 |
PCODEC_AVC_ENCODE_PIC_PARAMS m_avcPicParam = nullptr; //!< Pointer to AVC picture parameter |
| 1663 |
PCODEC_AVC_ENCODE_SEQUENCE_PARAMS m_avcSeqParam = nullptr; //!< Pointer to AVC sequence parameter |
| 1664 |
PCODECHAL_ENCODE_AVC_QUALITY_CTRL_PARAMS m_avcQCParams = nullptr; //!< Pointer to video quality control parameter |
| 1665 |
PCODECHAL_ENCODE_AVC_ROUNDING_PARAMS m_avcRoundingParams = nullptr; //!< Pointer to AVC rounding parameter |
| 1666 |
PCODECHAL_ENCODE_AVC_VUI_PARAMS m_avcVuiParams = nullptr; //!< Pointer to AVC Uvi parameter |
| 1667 |
PCODEC_AVC_ENCODE_SLICE_PARAMS m_avcSliceParams = nullptr; //!< Pointer to AVC slice parameter |
| 1668 |
CodecEncodeAvcFeiPicParams *m_avcFeiPicParams = nullptr; //!< Pointer to FEI picture parameter |
| 1669 |
PCODEC_AVC_IQ_MATRIX_PARAMS m_avcIQMatrixParams = nullptr; //!< Pointer to IQMaxtrix parameter |
| 1670 |
PCODEC_AVC_ENCODE_IQ_WEIGTHSCALE_LISTS m_avcIQWeightScaleLists = nullptr; //!< Pointer to IQWidght ScaleLists |
| 1671 |
CODEC_AVC_ENCODE_USER_FLAGS m_userFlags; //!< Encoder user flag settings |
| 1672 |
uint32_t m_reconFrameSurfaceId[CODEC_AVC_NUM_UNCOMPRESSED_SURFACE]; |
| 1673 |
CODECHAL_ENCODE_AVC_ENCODER_USAGE m_encoderUsage = CODECHAL_ENCODE_AVC_SINGLE_PASS; |
| 1674 |
|
| 1675 |
CODEC_PIC_ID m_picIdx[CODEC_AVC_MAX_NUM_REF_FRAME]; //!< Picture index |
| 1676 |
PCODEC_REF_LIST m_refList[CODEC_AVC_NUM_UNCOMPRESSED_SURFACE]; //!< Pointer to reference list |
| 1677 |
CODEC_AVC_FRAME_STORE_ID m_avcFrameStoreID[CODEC_AVC_MAX_NUM_REF_FRAME]; //!< Refer to CODEC_AVC_FRAME_STORE_ID |
| 1678 |
CODECHAL_ENCODE_AVC_NAL_UNIT_TYPE m_nalUnitType; //!< Nal unit type |
| 1679 |
PCODECHAL_NAL_UNIT_PARAMS *m_nalUnitParams = nullptr; //!< Pointers to NAL unit parameters array |
| 1680 |
uint16_t m_sliceHeight = 0; //!< Slice height |
| 1681 |
uint8_t m_biWeightNumB = 0; //!< Bi direction Weight B frames num |
| 1682 |
bool m_deblockingEnabled = false; //!< Enable deblocking flag |
| 1683 |
bool m_mbaffEnabled = false; //!< Enable MBAFF flag |
| 1684 |
bool m_firstFieldIdrPic = false; //!< First field IDR flag |
| 1685 |
bool m_hmeEnabled = false; //!< Enable HME flag |
| 1686 |
bool m_16xMeEnabled = false; //!< Enable 16x ME flag |
| 1687 |
bool m_32xMeEnabled = false; //!< Enable 32x ME flag |
| 1688 |
bool m_skipBiasAdjustmentEnable = false;//!< Enable SkipBiasAdjustment flag |
| 1689 |
bool m_staticFrameDetectionInUse = false;//!< Enable Static Frame Detection flag |
| 1690 |
uint32_t m_sliceStructCaps = 0; //!< Slice struct |
| 1691 |
|
| 1692 |
CODECHAL_ENCODE_AVC_TQ_PARAMS m_trellisQuantParams; //!< Trellis Quantization params |
| 1693 |
|
| 1694 |
// B-frame |
| 1695 |
uint32_t m_distScaleFactorList0[CODEC_AVC_MAX_NUM_REF_FRAME * 2]; //!< the DistScaleFactor used to derive temporal direct motion vector |
| 1696 |
uint32_t m_biWeight = 0; //!< Bidirectional Weight |
| 1697 |
|
| 1698 |
// Batch Buffers |
| 1699 |
MHW_BATCH_BUFFER m_batchBufferForVdencImgStat[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM]; //!< VDEnc image state batch buffers |
| 1700 |
|
| 1701 |
// ME |
| 1702 |
CodechalKernelHme *m_hmeKernel = nullptr; //!< ME kernel object |
| 1703 |
MOS_SURFACE m_4xMeMvDataBuffer; //!< 4x motion estimation MV data buffer |
| 1704 |
uint32_t m_meMvBottomFieldOffset = 0; //!< ME MV bottom filed offset |
| 1705 |
MOS_SURFACE m_16xMeMvDataBuffer; //!< 16x motion estimation MV data buffer |
| 1706 |
uint32_t m_meMv16xBottomFieldOffset = 0; //!< 16x motion estimation MV bottom filed offset |
| 1707 |
MOS_SURFACE m_32xMeMvDataBuffer; //!< 32x motion estimation MV data buffer |
| 1708 |
uint32_t m_meMv32xBottomFieldOffset = 0; //!< 32x motion estimation MV bottom filed offset |
| 1709 |
MOS_SURFACE m_4xMeDistortionBuffer; //!< 4x ME distortion buffer |
| 1710 |
uint32_t m_meDistortionBottomFieldOffset = 0; //!< ME distortion bottom field offset |
| 1711 |
uint8_t *m_bmeMethodTable = nullptr; //!< Point to BME Method table |
| 1712 |
uint8_t *m_meMethodTable = nullptr; //!< Pointer to ME Method table |
| 1713 |
|
| 1714 |
// PAK Scratch Buffers |
| 1715 |
MOS_RESOURCE m_intraRowStoreScratchBuffer; //!< Handle of intra row store surface |
| 1716 |
MHW_BATCH_BUFFER m_batchBufferForPakSlices[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM]; //!< PAK Slice batch buffers |
| 1717 |
uint32_t m_pakSliceSize = 0; //!< PAK Slice Size |
| 1718 |
uint32_t m_pakSlicePatchListSize = 0; //!< PAK Slice patch list size |
| 1719 |
uint32_t m_currPakSliceIdx = 0; //!< Current PAK slice index |
| 1720 |
|
| 1721 |
bool m_4xMeDistortionBufferSupported = false; //!< Generation Specific Support Flags & User Feature Key Reads |
| 1722 |
|
| 1723 |
bool m_sliceSizeStreamoutSupported = false; //!< Enable PAK slice size streamout, valid for AVC VDEnc on KBL/CNL+ |
| 1724 |
MOS_RESOURCE m_pakSliceSizeStreamoutBuffer; //!< PAK slice size streamout buffer |
| 1725 |
|
| 1726 |
bool m_crePrefetchEnable = false; //!< Enable CRE prefetch flag |
| 1727 |
bool m_tlbPrefetchEnable = false; //!< Enable TLB prefetch flag |
| 1728 |
|
| 1729 |
const uint8_t m_codechalEncodeAvcSfdCostTablePFrame[CODEC_AVC_NUM_QP] = |
| 1730 |
{ |
| 1731 |
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 60, 60, 60, 60, 73, 73, 73, 76, 76, 76, 88, 89, 89, 91, 92, 93, 104, 104, 106, 107, 108, 109, 120, 120, 122, 123, 124, 125, 136, 136, 138, 139, 140, 141, 143, 143}; |
| 1732 |
|
| 1733 |
const uint8_t m_codechalEncodeAvcSfdCostTableBFrame[CODEC_AVC_NUM_QP] = |
| 1734 |
{ |
| 1735 |
57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 73, 73, 73, 73, 77, 77, 77, 89, 89, 89, 91, 93, 93, 95, 105, 106, 107, 108, 110, 111, 121, 122, 123, 124, 125, 127, 137, 138, 139, 140, 142, 143, 143, 143, 143, 143}; |
| 1736 |
|
| 1737 |
const uint8_t m_codechalEncodeAvcSfdCostTableVdEnc[CODEC_AVC_NUM_QP] = |
| 1738 |
{ |
| 1739 |
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 47, 56, 57, 59, 44, 45, 47, 56, 44, 47, 47, 45, 47, 47, 47, 47, 45, 47, 47, 56, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47}; |
| 1740 |
|
| 1741 |
#if USE_CODECHAL_DEBUG_TOOL |
| 1742 |
protected: |
| 1743 |
//! |
| 1744 |
//! \brief Create AVC PAR |
| 1745 |
//! |
| 1746 |
//! \return MOS_STATUS |
| 1747 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1748 |
//! |
| 1749 |
MOS_STATUS CreateAvcPar(); |
| 1750 |
|
| 1751 |
//! |
| 1752 |
//! \brief Destroy AVC PAR |
| 1753 |
//! |
| 1754 |
//! \return MOS_STATUS |
| 1755 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1756 |
//! |
| 1757 |
MOS_STATUS DestroyAvcPar(); |
| 1758 |
|
| 1759 |
//! |
| 1760 |
//! \brief Dump sequence PAR file |
| 1761 |
//! |
| 1762 |
//! \return MOS_STATUS |
| 1763 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1764 |
//! |
| 1765 |
virtual MOS_STATUS DumpSeqParFile() { return MOS_STATUS_SUCCESS; } |
| 1766 |
|
| 1767 |
//! |
| 1768 |
//! \brief Dump frame PAR file |
| 1769 |
//! |
| 1770 |
//! \return MOS_STATUS |
| 1771 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1772 |
//! |
| 1773 |
virtual MOS_STATUS DumpFrameParFile() { return MOS_STATUS_SUCCESS; } |
| 1774 |
|
| 1775 |
//! |
| 1776 |
//! \brief Populate const parameters |
| 1777 |
//! |
| 1778 |
//! \return MOS_STATUS |
| 1779 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1780 |
//! |
| 1781 |
MOS_STATUS PopulateConstParam(); |
| 1782 |
|
| 1783 |
//! |
| 1784 |
//! \brief Populate target usage as the first parameter of dumped par file |
| 1785 |
//! |
| 1786 |
//! \return MOS_STATUS |
| 1787 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1788 |
//! |
| 1789 |
MOS_STATUS PopulateTargetUsage(); |
| 1790 |
|
| 1791 |
//! |
| 1792 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1793 |
//! |
| 1794 |
//! \param [in] avcSeqParams |
| 1795 |
//! pointer to AVC encode sequence parameters |
| 1796 |
//! \param [in] avcPicParams |
| 1797 |
//! pointer to AVC encode picture parameters |
| 1798 |
//! \param [in] avcSlcParams |
| 1799 |
//! pointer to AVC encode slice parameters |
| 1800 |
//! |
| 1801 |
//! \return MOS_STATUS |
| 1802 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1803 |
//! |
| 1804 |
MOS_STATUS PopulateDdiParam( |
| 1805 |
PCODEC_AVC_ENCODE_SEQUENCE_PARAMS avcSeqParams, |
| 1806 |
PCODEC_AVC_ENCODE_PIC_PARAMS avcPicParams, |
| 1807 |
PCODEC_AVC_ENCODE_SLICE_PARAMS avcSlcParams); |
| 1808 |
|
| 1809 |
//! |
| 1810 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1811 |
//! |
| 1812 |
//! \param [in] adaptiveRoundingInterEnable |
| 1813 |
//! adaptive rounding inter enable flag |
| 1814 |
//! \param [in] sliceState |
| 1815 |
//! pointer to slice state |
| 1816 |
//! |
| 1817 |
//! \return MOS_STATUS |
| 1818 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1819 |
//! |
| 1820 |
MOS_STATUS PopulateSliceStateParam( |
| 1821 |
bool adaptiveRoundingInterEnable, |
| 1822 |
PMHW_VDBOX_AVC_SLICE_STATE sliceState); |
| 1823 |
|
| 1824 |
//! |
| 1825 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1826 |
//! |
| 1827 |
//! \param [in] *cmd |
| 1828 |
//! pointer to command |
| 1829 |
//! |
| 1830 |
//! \return MOS_STATUS |
| 1831 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1832 |
//! |
| 1833 |
MOS_STATUS PopulateSfdParam( |
| 1834 |
void *cmd); |
| 1835 |
|
| 1836 |
//! |
| 1837 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1838 |
//! |
| 1839 |
//! \param [in] is16xMeEnabled |
| 1840 |
//! 16x ME enabled flag |
| 1841 |
//! \param [in] is32xMeEnabled |
| 1842 |
//! 32x ME enabled flag |
| 1843 |
//! \param [in] meMethod |
| 1844 |
//! ME method |
| 1845 |
//! \param [in] *cmd |
| 1846 |
//! pointer to command |
| 1847 |
//! |
| 1848 |
//! \return MOS_STATUS |
| 1849 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1850 |
//! |
| 1851 |
virtual MOS_STATUS PopulateHmeParam( |
| 1852 |
bool is16xMeEnabled, |
| 1853 |
bool is32xMeEnabled, |
| 1854 |
uint8_t meMethod, |
| 1855 |
void *cmd) { return MOS_STATUS_SUCCESS; } |
| 1856 |
|
| 1857 |
//! |
| 1858 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1859 |
//! |
| 1860 |
//! \param [in] *cmd |
| 1861 |
//! pointer to command |
| 1862 |
//! |
| 1863 |
//! \return MOS_STATUS |
| 1864 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1865 |
//! |
| 1866 |
virtual MOS_STATUS PopulateBrcInitParam( |
| 1867 |
void *cmd) { return MOS_STATUS_SUCCESS; } |
| 1868 |
|
| 1869 |
//! |
| 1870 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1871 |
//! |
| 1872 |
//! \param [in] *cmd |
| 1873 |
//! pointer to command |
| 1874 |
//! |
| 1875 |
//! \return MOS_STATUS |
| 1876 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1877 |
//! |
| 1878 |
virtual MOS_STATUS PopulateBrcUpdateParam( |
| 1879 |
void *cmd) { return MOS_STATUS_SUCCESS; } |
| 1880 |
|
| 1881 |
//! |
| 1882 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1883 |
//! |
| 1884 |
//! \param [in] meMethod |
| 1885 |
//! ME method |
| 1886 |
//! \param [in] *cmd |
| 1887 |
//! pointer to command |
| 1888 |
//! |
| 1889 |
//! \return MOS_STATUS |
| 1890 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1891 |
//! |
| 1892 |
virtual MOS_STATUS PopulateEncParam( |
| 1893 |
uint8_t meMethod, |
| 1894 |
void *cmd) { return MOS_STATUS_SUCCESS; } |
| 1895 |
|
| 1896 |
//! |
| 1897 |
//! \brief Set MHW_VDBOX_AVC_IMG_STATE parameter |
| 1898 |
//! |
| 1899 |
//! \param [in] cmdBuffer |
| 1900 |
//! pointer to command buffer |
| 1901 |
//! \param [in] secondLevelBatchBuffer |
| 1902 |
//! pointer to second level batch buffer |
| 1903 |
//! |
| 1904 |
//! \return MOS_STATUS |
| 1905 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1906 |
//! |
| 1907 |
virtual MOS_STATUS PopulatePakParam( |
| 1908 |
PMOS_COMMAND_BUFFER cmdBuffer, |
| 1909 |
PMHW_BATCH_BUFFER secondLevelBatchBuffer) { return MOS_STATUS_SUCCESS; } |
| 1910 |
|
| 1911 |
EncodeAvcPar *m_avcPar = nullptr; //!< AVC PAR parameters |
| 1912 |
bool m_populateTargetUsage = false; |
| 1913 |
#endif |
| 1914 |
|
| 1915 |
//! |
| 1916 |
//! \brief Set frame store Id for avc codec. |
| 1917 |
//! \details |
| 1918 |
//! \return frameIdx |
| 1919 |
//! [in] frame index |
| 1920 |
//! \return MOS_STATUS |
| 1921 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 1922 |
//! |
| 1923 |
MOS_STATUS SetFrameStoreIds(uint8_t frameIdx); |
| 1924 |
|
| 1925 |
void fill_pad_with_value(PMOS_SURFACE psSurface, uint32_t real_height, uint32_t aligned_height); |
| 1926 |
}; |
| 1927 |
#endif // __CODECHAL_ENCODE_AVC_BASE_H__ |