| 1 |
/* |
| 2 |
* Copyright (c) 2017, 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_fei_hevc_g9_skl.h |
| 24 |
//! \brief HEVC FEI dual-pipe encoder for GEN9 SKL. |
| 25 |
//! |
| 26 |
|
| 27 |
#ifndef __CODECHAL_FEI_HEVC__G9_SKL_H__ |
| 28 |
#define __CODECHAL_FEI_HEVC__G9_SKL_H__ |
| 29 |
|
| 30 |
#include "codechal_encode_hevc_g9.h" |
| 31 |
|
| 32 |
|
| 33 |
//! HEVC encoder FEI intra 32x32 PU mode decision kernel curbe for GEN9 |
| 34 |
struct CODECHAL_FEI_HEVC_I_32x32_PU_MODE_DECISION_CURBE_G9 |
| 35 |
{ |
| 36 |
union { |
| 37 |
struct { |
| 38 |
uint32_t FrameWidth : MOS_BITFIELD_RANGE(0, 15); |
| 39 |
uint32_t FrameHeight : MOS_BITFIELD_RANGE(16, 31); |
| 40 |
}; |
| 41 |
uint32_t Value; |
| 42 |
} DW0; |
| 43 |
|
| 44 |
union { |
| 45 |
struct { |
| 46 |
uint32_t SliceType : MOS_BITFIELD_RANGE(0, 1); |
| 47 |
uint32_t PuType : MOS_BITFIELD_RANGE(2, 3); |
| 48 |
uint32_t EnableStatsDataDump : MOS_BITFIELD_BIT(4); |
| 49 |
uint32_t LCUType : MOS_BITFIELD_BIT(5); |
| 50 |
uint32_t Res_6_15 : MOS_BITFIELD_RANGE(6, 15); |
| 51 |
uint32_t SliceQp : MOS_BITFIELD_RANGE(16, 23); |
| 52 |
uint32_t BRCEnable : MOS_BITFIELD_BIT(24); |
| 53 |
uint32_t LCUBRCEnable : MOS_BITFIELD_BIT(25); |
| 54 |
uint32_t ROIEnable : MOS_BITFIELD_BIT(26); |
| 55 |
uint32_t FASTSurveillanceFlag : MOS_BITFIELD_BIT(27); |
| 56 |
uint32_t Res_28 : MOS_BITFIELD_BIT(28); |
| 57 |
uint32_t EnableFlexibleParam : MOS_BITFIELD_BIT(29); |
| 58 |
uint32_t EnableQualityImprovement : MOS_BITFIELD_BIT(30); |
| 59 |
uint32_t EnableDebugDump : MOS_BITFIELD_BIT(31); |
| 60 |
}; |
| 61 |
uint32_t Value; |
| 62 |
} DW1; |
| 63 |
|
| 64 |
union { |
| 65 |
struct { |
| 66 |
uint32_t Lambda; |
| 67 |
}; |
| 68 |
uint32_t Value; |
| 69 |
} DW2; |
| 70 |
|
| 71 |
union { |
| 72 |
struct { |
| 73 |
uint32_t ModeCost32x32; |
| 74 |
}; |
| 75 |
uint32_t Value; |
| 76 |
} DW3; |
| 77 |
|
| 78 |
union { |
| 79 |
struct { |
| 80 |
uint32_t EarlyExit; |
| 81 |
}; |
| 82 |
uint32_t Value; |
| 83 |
} DW4; |
| 84 |
|
| 85 |
union { |
| 86 |
struct { |
| 87 |
uint32_t NewLambdaForHaarTransform; |
| 88 |
}; |
| 89 |
uint32_t Value; |
| 90 |
} DW5; |
| 91 |
|
| 92 |
union { |
| 93 |
struct { |
| 94 |
uint32_t Reserved; |
| 95 |
}; |
| 96 |
uint32_t Value; |
| 97 |
} DW6; |
| 98 |
|
| 99 |
union { |
| 100 |
struct { |
| 101 |
uint32_t Reserved; |
| 102 |
}; |
| 103 |
uint32_t Value; |
| 104 |
} DW7; |
| 105 |
|
| 106 |
union { |
| 107 |
struct { |
| 108 |
uint32_t BTI_32x32PU_Output; |
| 109 |
}; |
| 110 |
uint32_t Value; |
| 111 |
} DW8; |
| 112 |
|
| 113 |
union { |
| 114 |
struct { |
| 115 |
uint32_t BTI_Src_Y; |
| 116 |
}; |
| 117 |
uint32_t Value; |
| 118 |
} DW9; |
| 119 |
|
| 120 |
union { |
| 121 |
struct { |
| 122 |
uint32_t BTI_Src_Y2x; |
| 123 |
}; |
| 124 |
uint32_t Value; |
| 125 |
} DW10; |
| 126 |
|
| 127 |
union { |
| 128 |
struct { |
| 129 |
uint32_t BTI_Slice_Map; |
| 130 |
}; |
| 131 |
uint32_t Value; |
| 132 |
} DW11; |
| 133 |
|
| 134 |
union { |
| 135 |
struct { |
| 136 |
uint32_t BTI_Src_Y2x_VME; |
| 137 |
}; |
| 138 |
uint32_t Value; |
| 139 |
} DW12; |
| 140 |
|
| 141 |
union { |
| 142 |
struct { |
| 143 |
uint32_t BTI_Brc_Input; |
| 144 |
}; |
| 145 |
uint32_t Value; |
| 146 |
} DW13; |
| 147 |
|
| 148 |
union { |
| 149 |
struct { |
| 150 |
uint32_t BTI_LCU_Qp_Surface; |
| 151 |
}; |
| 152 |
uint32_t Value; |
| 153 |
} DW14; |
| 154 |
|
| 155 |
union { |
| 156 |
struct { |
| 157 |
uint32_t BTI_Brc_Data; |
| 158 |
}; |
| 159 |
uint32_t Value; |
| 160 |
} DW15; |
| 161 |
|
| 162 |
union { |
| 163 |
struct { |
| 164 |
uint32_t BTI_Stats_Data; |
| 165 |
}; |
| 166 |
uint32_t Value; |
| 167 |
} DW16; |
| 168 |
|
| 169 |
union { |
| 170 |
struct { |
| 171 |
uint32_t BTI_Kernel_Debug; |
| 172 |
}; |
| 173 |
uint32_t Value; |
| 174 |
} DW17; |
| 175 |
}; |
| 176 |
|
| 177 |
using PCODECHAL_FEI_HEVC_I_32x32_PU_MODE_DECISION_CURBE_G9 = struct CODECHAL_FEI_HEVC_I_32x32_PU_MODE_DECISION_CURBE_G9*; |
| 178 |
C_ASSERT(MOS_BYTES_TO_DWORDS(sizeof(CODECHAL_FEI_HEVC_I_32x32_PU_MODE_DECISION_CURBE_G9)) == 18); |
| 179 |
|
| 180 |
//! HEVC encoder FEI intra 16x16 PU mode decision kernel curbe for GEN9 |
| 181 |
struct CODECHAL_FEI_HEVC_I_16x16_PU_MODEDECISION_CURBE_G9 |
| 182 |
{ |
| 183 |
union { |
| 184 |
struct { |
| 185 |
uint32_t FrameWidth : MOS_BITFIELD_RANGE(0, 15); |
| 186 |
uint32_t FrameHeight : MOS_BITFIELD_RANGE(16, 31); |
| 187 |
}; |
| 188 |
uint32_t Value; |
| 189 |
} DW0; |
| 190 |
|
| 191 |
union { |
| 192 |
struct { |
| 193 |
uint32_t Log2MaxCUSize : MOS_BITFIELD_RANGE(0, 7); |
| 194 |
uint32_t Log2MinCUSize : MOS_BITFIELD_RANGE(8, 15); |
| 195 |
uint32_t Log2MinTUSize : MOS_BITFIELD_RANGE(16, 23); |
| 196 |
uint32_t SliceQp : MOS_BITFIELD_RANGE(24, 31); |
| 197 |
}; |
| 198 |
uint32_t Value; |
| 199 |
} DW1; |
| 200 |
|
| 201 |
union { |
| 202 |
struct { |
| 203 |
uint32_t FixedPoint_Lambda_PredMode; |
| 204 |
}; |
| 205 |
uint32_t Value; |
| 206 |
} DW2; |
| 207 |
|
| 208 |
union { |
| 209 |
struct { |
| 210 |
uint32_t LambdaScalingFactor : MOS_BITFIELD_RANGE(0, 7); |
| 211 |
uint32_t SliceType : MOS_BITFIELD_RANGE(8, 9); |
| 212 |
uint32_t Reserved_10_15 : MOS_BITFIELD_RANGE(10, 15); |
| 213 |
uint32_t IntraRefreshEn : MOS_BITFIELD_RANGE(16, 17); |
| 214 |
uint32_t EnableRollingIntra : MOS_BITFIELD_BIT(18); |
| 215 |
uint32_t HalfUpdateMixedLCU : MOS_BITFIELD_BIT(19); |
| 216 |
uint32_t Reserved_20_23 : MOS_BITFIELD_RANGE(20, 23); |
| 217 |
uint32_t EnableIntraEarlyExit : MOS_BITFIELD_BIT(24); |
| 218 |
uint32_t BRCEnable : MOS_BITFIELD_BIT(25); |
| 219 |
uint32_t LCUBRCEnable : MOS_BITFIELD_BIT(26); |
| 220 |
uint32_t ROIEnable : MOS_BITFIELD_BIT(27); |
| 221 |
uint32_t FASTSurveillanceFlag : MOS_BITFIELD_BIT(28); |
| 222 |
uint32_t EnableQualityImprovement : MOS_BITFIELD_BIT(29); |
| 223 |
uint32_t EnableFlexibleParam : MOS_BITFIELD_BIT(30); |
| 224 |
uint32_t Reserved_31 : MOS_BITFIELD_BIT(31); |
| 225 |
}; |
| 226 |
uint32_t Value; |
| 227 |
} DW3; |
| 228 |
|
| 229 |
union { |
| 230 |
struct { |
| 231 |
uint32_t PenaltyForIntra8x8NonDCPredMode : MOS_BITFIELD_RANGE(0, 7); |
| 232 |
uint32_t IntraComputeType : MOS_BITFIELD_RANGE(8, 15); |
| 233 |
uint32_t AVCIntra8x8Mask : MOS_BITFIELD_RANGE(16, 23); |
| 234 |
uint32_t IntraSadAdjust : MOS_BITFIELD_RANGE(24, 31); |
| 235 |
}; |
| 236 |
uint32_t Value; |
| 237 |
} DW4; |
| 238 |
|
| 239 |
union { |
| 240 |
struct { |
| 241 |
uint32_t FixedPoint_Lambda_CU_Mode_for_Cost_Calculation; |
| 242 |
}; |
| 243 |
uint32_t Value; |
| 244 |
} DW5; |
| 245 |
|
| 246 |
union { |
| 247 |
struct { |
| 248 |
uint32_t ScreenContentFlag : MOS_BITFIELD_BIT(0); |
| 249 |
uint32_t Reserved : MOS_BITFIELD_RANGE(1, 31); |
| 250 |
}; |
| 251 |
uint32_t Value; |
| 252 |
} DW6; |
| 253 |
|
| 254 |
union { |
| 255 |
struct { |
| 256 |
uint32_t ModeCostIntraNonPred : MOS_BITFIELD_RANGE(0, 7); |
| 257 |
uint32_t ModeCostIntra16x16 : MOS_BITFIELD_RANGE(8, 15); |
| 258 |
uint32_t ModeCostIntra8x8 : MOS_BITFIELD_RANGE(16, 23); |
| 259 |
uint32_t ModeCostIntra4x4 : MOS_BITFIELD_RANGE(24, 31); |
| 260 |
}; |
| 261 |
uint32_t Value; |
| 262 |
} DW7; |
| 263 |
|
| 264 |
union { |
| 265 |
struct { |
| 266 |
uint32_t FixedPoint_Lambda_CU_Mode_for_Luma; |
| 267 |
}; |
| 268 |
uint32_t Value; |
| 269 |
} DW8; |
| 270 |
|
| 271 |
union { |
| 272 |
struct { |
| 273 |
uint32_t IntraRefreshMBNum : MOS_BITFIELD_RANGE(0, 15); |
| 274 |
uint32_t IntraRefreshUnitInMB : MOS_BITFIELD_RANGE(16, 23); |
| 275 |
uint32_t IntraRefreshQPDelta : MOS_BITFIELD_RANGE(24, 31); |
| 276 |
}; |
| 277 |
uint32_t Value; |
| 278 |
} DW9; |
| 279 |
|
| 280 |
union { |
| 281 |
struct { |
| 282 |
// 0: for intra, no Haar |
| 283 |
// 1: for inter or enable statictics data dump, need Haar |
| 284 |
uint32_t HaarTransformMode : MOS_BITFIELD_RANGE(0, 1); |
| 285 |
uint32_t SimplifiedFlagForInter : MOS_BITFIELD_BIT(2); |
| 286 |
uint32_t Reserved : MOS_BITFIELD_RANGE(3, 31); |
| 287 |
}; |
| 288 |
uint32_t Value; |
| 289 |
} DW10; |
| 290 |
|
| 291 |
union { |
| 292 |
struct { |
| 293 |
uint32_t Reserved; |
| 294 |
}; |
| 295 |
uint32_t Value; |
| 296 |
} DW11; |
| 297 |
|
| 298 |
union { |
| 299 |
struct { |
| 300 |
uint32_t Reserved; |
| 301 |
}; |
| 302 |
uint32_t Value; |
| 303 |
} DW12; |
| 304 |
|
| 305 |
union { |
| 306 |
struct { |
| 307 |
uint32_t Reserved; |
| 308 |
}; |
| 309 |
uint32_t Value; |
| 310 |
} DW13; |
| 311 |
|
| 312 |
union { |
| 313 |
struct { |
| 314 |
uint32_t Reserved; |
| 315 |
}; |
| 316 |
uint32_t Value; |
| 317 |
} DW14; |
| 318 |
|
| 319 |
union { |
| 320 |
struct { |
| 321 |
uint32_t Reserved; |
| 322 |
}; |
| 323 |
uint32_t Value; |
| 324 |
} DW15; |
| 325 |
|
| 326 |
union { |
| 327 |
struct { |
| 328 |
uint32_t BTI_Src_Y; |
| 329 |
}; |
| 330 |
uint32_t Value; |
| 331 |
} DW16; |
| 332 |
|
| 333 |
union { |
| 334 |
struct { |
| 335 |
uint32_t BTI_Sad_16x16_PU; |
| 336 |
}; |
| 337 |
uint32_t Value; |
| 338 |
} DW17; |
| 339 |
|
| 340 |
union { |
| 341 |
struct { |
| 342 |
uint32_t BTI_PAK_Object; |
| 343 |
}; |
| 344 |
uint32_t Value; |
| 345 |
} DW18; |
| 346 |
|
| 347 |
union { |
| 348 |
struct { |
| 349 |
uint32_t BTI_SAD_32x32_PU_mode; |
| 350 |
}; |
| 351 |
uint32_t Value; |
| 352 |
} DW19; |
| 353 |
|
| 354 |
union { |
| 355 |
struct { |
| 356 |
uint32_t BTI_VME_Mode_8x8; |
| 357 |
}; |
| 358 |
uint32_t Value; |
| 359 |
} DW20; |
| 360 |
|
| 361 |
union { |
| 362 |
struct { |
| 363 |
uint32_t BTI_Slice_Map; |
| 364 |
}; |
| 365 |
uint32_t Value; |
| 366 |
} DW21; |
| 367 |
|
| 368 |
union { |
| 369 |
struct { |
| 370 |
uint32_t BTI_VME_Src; |
| 371 |
}; |
| 372 |
uint32_t Value; |
| 373 |
} DW22; |
| 374 |
|
| 375 |
union { |
| 376 |
struct { |
| 377 |
uint32_t BTI_BRC_Input; |
| 378 |
}; |
| 379 |
uint32_t Value; |
| 380 |
} DW23; |
| 381 |
|
| 382 |
union { |
| 383 |
struct { |
| 384 |
uint32_t BTI_Simplest_Intra; |
| 385 |
}; |
| 386 |
uint32_t Value; |
| 387 |
} DW24; |
| 388 |
|
| 389 |
union { |
| 390 |
struct { |
| 391 |
uint32_t BTI_LCU_Qp_Surface; |
| 392 |
}; |
| 393 |
uint32_t Value; |
| 394 |
} DW25; |
| 395 |
|
| 396 |
union { |
| 397 |
struct { |
| 398 |
uint32_t BTI_BRC_Data; |
| 399 |
}; |
| 400 |
uint32_t Value; |
| 401 |
} DW26; |
| 402 |
|
| 403 |
union { |
| 404 |
struct { |
| 405 |
uint32_t BTI_Debug; |
| 406 |
}; |
| 407 |
uint32_t Value; |
| 408 |
} DW27; |
| 409 |
}; |
| 410 |
|
| 411 |
using PCODECHAL_FEI_HEVC_I_16x16_PU_MODEDECISION_CURBE_G9 = struct CODECHAL_FEI_HEVC_I_16x16_PU_MODEDECISION_CURBE_G9*; |
| 412 |
C_ASSERT(MOS_BYTES_TO_DWORDS(sizeof(CODECHAL_FEI_HEVC_I_16x16_PU_MODEDECISION_CURBE_G9)) == 28); |
| 413 |
|
| 414 |
//! HEVC encoder FEI intra 8x8 PU kernel curbe for GEN9 |
| 415 |
struct CODECHAL_FEI_HEVC_I_8x8_PU_CURBE_G9 |
| 416 |
{ |
| 417 |
union { |
| 418 |
struct { |
| 419 |
uint32_t FrameWidth : MOS_BITFIELD_RANGE(0, 15); |
| 420 |
uint32_t FrameHeight : MOS_BITFIELD_RANGE(16, 31); |
| 421 |
}; |
| 422 |
uint32_t Value; |
| 423 |
} DW0; |
| 424 |
|
| 425 |
union { |
| 426 |
struct { |
| 427 |
uint32_t SliceType : MOS_BITFIELD_RANGE(0, 1); |
| 428 |
uint32_t PuType : MOS_BITFIELD_RANGE(2, 3); |
| 429 |
uint32_t DcFilterFlag : MOS_BITFIELD_BIT(4); |
| 430 |
uint32_t AngleRefineFlag : MOS_BITFIELD_BIT(5); |
| 431 |
uint32_t LCUType : MOS_BITFIELD_BIT(6); |
| 432 |
uint32_t ScreenContentFlag : MOS_BITFIELD_BIT(7); |
| 433 |
uint32_t IntraRefreshEn : MOS_BITFIELD_RANGE(8, 9); |
| 434 |
uint32_t EnableRollingIntra : MOS_BITFIELD_BIT(10); |
| 435 |
uint32_t HalfUpdateMixedLCU : MOS_BITFIELD_BIT(11); |
| 436 |
uint32_t Reserved_12_15 : MOS_BITFIELD_RANGE(12, 15); |
| 437 |
uint32_t QPValue : MOS_BITFIELD_RANGE(16, 23); |
| 438 |
uint32_t EnableIntraEarlyExit : MOS_BITFIELD_BIT(24); |
| 439 |
uint32_t BRCEnable : MOS_BITFIELD_BIT(25); |
| 440 |
uint32_t LCUBRCEnable : MOS_BITFIELD_BIT(26); |
| 441 |
uint32_t ROIEnable : MOS_BITFIELD_BIT(27); |
| 442 |
uint32_t FASTSurveillanceFlag : MOS_BITFIELD_BIT(28); |
| 443 |
uint32_t EnableFlexibleParam : MOS_BITFIELD_BIT(29); |
| 444 |
uint32_t EnableQualityImprovement : MOS_BITFIELD_BIT(30); |
| 445 |
uint32_t EnableDebugDump : MOS_BITFIELD_BIT(31); |
| 446 |
}; |
| 447 |
uint32_t Value; |
| 448 |
} DW1; |
| 449 |
|
| 450 |
union { |
| 451 |
struct { |
| 452 |
uint32_t LumaLambda; |
| 453 |
}; |
| 454 |
uint32_t Value; |
| 455 |
} DW2; |
| 456 |
|
| 457 |
union { |
| 458 |
struct { |
| 459 |
uint32_t ChromaLambda; |
| 460 |
}; |
| 461 |
uint32_t Value; |
| 462 |
} DW3; |
| 463 |
|
| 464 |
union { |
| 465 |
struct { |
| 466 |
uint32_t HaarTransformFlag : MOS_BITFIELD_RANGE(0, 1); |
| 467 |
uint32_t SimplifiedFlagForInter : MOS_BITFIELD_BIT(2); |
| 468 |
uint32_t Reserved : MOS_BITFIELD_RANGE(3, 31); |
| 469 |
}; |
| 470 |
uint32_t Value; |
| 471 |
} DW4; |
| 472 |
|
| 473 |
union { |
| 474 |
struct { |
| 475 |
uint32_t IntraRefreshMBNum : MOS_BITFIELD_RANGE(0, 15); |
| 476 |
uint32_t IntraRefreshUnitInMB : MOS_BITFIELD_RANGE(16, 23); |
| 477 |
uint32_t IntraRefreshQPDelta : MOS_BITFIELD_RANGE(24, 31); |
| 478 |
}; |
| 479 |
uint32_t Value; |
| 480 |
} DW5; |
| 481 |
|
| 482 |
union { |
| 483 |
struct { |
| 484 |
uint32_t Reserved; |
| 485 |
}; |
| 486 |
uint32_t Value; |
| 487 |
} DW6; |
| 488 |
|
| 489 |
union { |
| 490 |
struct { |
| 491 |
uint32_t Reserved; |
| 492 |
}; |
| 493 |
uint32_t Value; |
| 494 |
} DW7; |
| 495 |
|
| 496 |
union { |
| 497 |
struct { |
| 498 |
uint32_t BTI_Src_Y; |
| 499 |
}; |
| 500 |
uint32_t Value; |
| 501 |
} DW8; |
| 502 |
|
| 503 |
union { |
| 504 |
struct { |
| 505 |
uint32_t BTI_Slice_Map; |
| 506 |
}; |
| 507 |
uint32_t Value; |
| 508 |
} DW9; |
| 509 |
|
| 510 |
union { |
| 511 |
struct { |
| 512 |
uint32_t BTI_VME_8x8_Mode; |
| 513 |
}; |
| 514 |
uint32_t Value; |
| 515 |
} DW10; |
| 516 |
|
| 517 |
union { |
| 518 |
struct { |
| 519 |
uint32_t BTI_Intra_Mode; |
| 520 |
}; |
| 521 |
uint32_t Value; |
| 522 |
} DW11; |
| 523 |
|
| 524 |
union { |
| 525 |
struct { |
| 526 |
uint32_t BTI_BRC_Input; |
| 527 |
}; |
| 528 |
uint32_t Value; |
| 529 |
} DW12; |
| 530 |
|
| 531 |
union { |
| 532 |
struct { |
| 533 |
uint32_t BTI_Simplest_Intra; |
| 534 |
}; |
| 535 |
uint32_t Value; |
| 536 |
} DW13; |
| 537 |
|
| 538 |
union { |
| 539 |
struct { |
| 540 |
uint32_t BTI_LCU_Qp_Surface; |
| 541 |
}; |
| 542 |
uint32_t Value; |
| 543 |
} DW14; |
| 544 |
|
| 545 |
union { |
| 546 |
struct { |
| 547 |
uint32_t BTI_BRC_Data; |
| 548 |
}; |
| 549 |
uint32_t Value; |
| 550 |
} DW15; |
| 551 |
|
| 552 |
union { |
| 553 |
struct { |
| 554 |
uint32_t BTI_Debug; |
| 555 |
}; |
| 556 |
uint32_t Value; |
| 557 |
} DW16; |
| 558 |
}; |
| 559 |
|
| 560 |
using PCODECHAL_FEI_HEVC_I_8x8_PU_CURBE_G9 = struct CODECHAL_FEI_HEVC_I_8x8_PU_CURBE_G9*; |
| 561 |
C_ASSERT(MOS_BYTES_TO_DWORDS(sizeof(CODECHAL_FEI_HEVC_I_8x8_PU_CURBE_G9)) == 17); |
| 562 |
|
| 563 |
class CodechalFeiHevcStateG9Skl : public CodechalEncHevcStateG9 |
| 564 |
{ |
| 565 |
// static constexpr uint32_t NUM_CONCURRENT_THREAD = 2; //!< Number of concurrent threads |
| 566 |
// static constexpr uint32_t MAX_NUM_KERNEL_SPLIT = 8; //!< Maximal kernel split number |
| 567 |
|
| 568 |
static const uint32_t FEI_ENCB_B_CURBE_INIT[56]; //!< Initialization FEI ENC curbe for B frame |
| 569 |
static const uint32_t FEI_ENCB_P_CURBE_INIT[56]; //!< Initialization FEI ENC curbe for P frame |
| 570 |
static const uint32_t FEI_ENCB_I_CURBE_INIT[56]; //!< Initialization FEI ENC curbe for I frame |
| 571 |
public: |
| 572 |
//! |
| 573 |
//! \brief Constructor |
| 574 |
//! |
| 575 |
CodechalFeiHevcStateG9Skl(CodechalHwInterface* hwInterface, |
| 576 |
CodechalDebugInterface* debugInterface, |
| 577 |
PCODECHAL_STANDARD_INFO standardInfo); |
| 578 |
|
| 579 |
//! |
| 580 |
//! \brief Destructor |
| 581 |
//! |
| 582 |
~CodechalFeiHevcStateG9Skl() {}; |
| 583 |
|
| 584 |
private: |
| 585 |
// Resources for the render engine |
| 586 |
MOS_SURFACE m_lcuQP = {}; //!< input LCU QP surface |
| 587 |
|
| 588 |
CodecEncodeHevcFeiPicParams *m_feiPicParams = nullptr; |
| 589 |
|
| 590 |
//! |
| 591 |
//! \brief Get encoder kernel header and kernel size |
| 592 |
//! |
| 593 |
//! \param [in] binary |
| 594 |
//! Pointer to kernel binary |
| 595 |
//! \param [in] operation |
| 596 |
//! Enc kernel operation |
| 597 |
//! \param [in] krnStateIdx |
| 598 |
//! Kernel state index |
| 599 |
//! \param [out] krnHeader |
| 600 |
//! Pointer to kernel header |
| 601 |
//! \param [out] krnSize |
| 602 |
//! Pointer to kernel size |
| 603 |
//! |
| 604 |
//! \return MOS_STATUS |
| 605 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 606 |
//! |
| 607 |
static MOS_STATUS GetKernelHeaderAndSize( |
| 608 |
void *binary, |
| 609 |
EncOperation operation, |
| 610 |
uint32_t krnStateIdx, |
| 611 |
void *krnHeader, |
| 612 |
uint32_t *krnSize); |
| 613 |
|
| 614 |
// inherited virtual functions |
| 615 |
|
| 616 |
//! |
| 617 |
//! \brief Set MbEnc kernel parameters |
| 618 |
//! |
| 619 |
//! \param [in] pKernelParams |
| 620 |
//! Pointer to kernel parameters |
| 621 |
//! \param [in] idx |
| 622 |
//! MbEnc kernel index |
| 623 |
//! |
| 624 |
//! \return MOS_STATUS |
| 625 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 626 |
//! |
| 627 |
virtual MOS_STATUS SetMbEncKernelParams(MHW_KERNEL_PARAM* pKernelParams, uint32_t idx); |
| 628 |
|
| 629 |
//! |
| 630 |
//! \brief Set MbEnc kernel binding table |
| 631 |
//! |
| 632 |
//! \param [in] pBindingTable |
| 633 |
//! Pointer to binding table |
| 634 |
//! \param [in] idx |
| 635 |
//! MbEnc kernel index |
| 636 |
//! |
| 637 |
//! \return MOS_STATUS |
| 638 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 639 |
//! |
| 640 |
virtual MOS_STATUS SetMbEncBindingTable(PCODECHAL_ENCODE_BINDING_TABLE_GENERIC pBindingTable, uint32_t idx); |
| 641 |
|
| 642 |
//! |
| 643 |
//! \brief End kernel function and submit command buffer |
| 644 |
//! |
| 645 |
//! \param [in] mediaStateType |
| 646 |
//! Media state type |
| 647 |
//! \param [in] kernelState |
| 648 |
//! Pointer to kernel state |
| 649 |
//! \param [in] cmdBuffer |
| 650 |
//! Pointer to command buffer |
| 651 |
//! |
| 652 |
//! \return MOS_STATUS |
| 653 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 654 |
//! |
| 655 |
virtual MOS_STATUS EndKernelCall( |
| 656 |
CODECHAL_MEDIA_STATE_TYPE mediaStateType, |
| 657 |
PMHW_KERNEL_STATE kernelState, |
| 658 |
PMOS_COMMAND_BUFFER cmdBuffer); |
| 659 |
|
| 660 |
virtual MOS_STATUS InitKernelState(); |
| 661 |
virtual MOS_STATUS Initialize(CodechalSetting * pSettings); |
| 662 |
virtual uint32_t GetMaxBtCount(); |
| 663 |
virtual MOS_STATUS AllocateEncResources(); |
| 664 |
virtual MOS_STATUS FreeEncResources(); |
| 665 |
virtual MOS_STATUS InitSurfaceInfoTable(); |
| 666 |
virtual MOS_STATUS SetSequenceStructs(); |
| 667 |
|
| 668 |
//! |
| 669 |
//! \brief Invoke 2x down scaling kernel |
| 670 |
//! |
| 671 |
//! \return MOS_STATUS |
| 672 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 673 |
//! |
| 674 |
virtual MOS_STATUS Encode2xScalingKernel(); |
| 675 |
|
| 676 |
//! |
| 677 |
//! \brief Invoke 32x32 PU mode decision kernel |
| 678 |
//! |
| 679 |
//! \return MOS_STATUS |
| 680 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 681 |
//! |
| 682 |
virtual MOS_STATUS Encode32x32PuModeDecisionKernel(); |
| 683 |
|
| 684 |
//! |
| 685 |
//! \brief Invoke 16x16 PU SAD computation kernel |
| 686 |
//! |
| 687 |
//! \return MOS_STATUS |
| 688 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 689 |
//! |
| 690 |
virtual MOS_STATUS Encode16x16SadPuComputationKernel(); |
| 691 |
|
| 692 |
//! |
| 693 |
//! \brief Invoke 16x16 PU mode decision kernel |
| 694 |
//! |
| 695 |
//! \return MOS_STATUS |
| 696 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 697 |
//! |
| 698 |
virtual MOS_STATUS Encode16x16PuModeDecisionKernel(); |
| 699 |
|
| 700 |
//! |
| 701 |
//! \brief Invoke 8x8 PU kernel |
| 702 |
//! |
| 703 |
//! \return MOS_STATUS |
| 704 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 705 |
//! |
| 706 |
virtual MOS_STATUS Encode8x8PUKernel(); |
| 707 |
|
| 708 |
//! |
| 709 |
//! \brief Invoke 8x8 PU FMode kernel |
| 710 |
//! |
| 711 |
//! \return MOS_STATUS |
| 712 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 713 |
//! |
| 714 |
virtual MOS_STATUS Encode8x8PUFMODEKernel(); |
| 715 |
|
| 716 |
//! |
| 717 |
//! \brief Invoke 32x32 B intra check kernel |
| 718 |
//! |
| 719 |
//! \return MOS_STATUS |
| 720 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 721 |
//! |
| 722 |
virtual MOS_STATUS Encode32X32BIntraCheckKernel(); |
| 723 |
|
| 724 |
//! |
| 725 |
//! \brief Invoke 8x8 B Pak kernel |
| 726 |
//! |
| 727 |
//! \param [in] pCurbe |
| 728 |
//! Pointer to B_MB_ENC curbe structure |
| 729 |
//! |
| 730 |
//! \return MOS_STATUS |
| 731 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 732 |
//! |
| 733 |
MOS_STATUS Encode8x8BPakKernel(struct CODECHAL_FEI_HEVC_B_MB_ENC_CURBE_G9* pCurbe); |
| 734 |
|
| 735 |
//! |
| 736 |
//! \brief Invoke 8x8 B MbEnc kernel |
| 737 |
//! |
| 738 |
//! \return MOS_STATUS |
| 739 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 740 |
//! |
| 741 |
virtual MOS_STATUS Encode8x8PBMbEncKernel(); |
| 742 |
|
| 743 |
//! |
| 744 |
//! \brief Encode kernel functions |
| 745 |
//! |
| 746 |
//! \return MOS_STATUS |
| 747 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 748 |
//! |
| 749 |
virtual MOS_STATUS EncodeKernelFunctions(); |
| 750 |
|
| 751 |
//! |
| 752 |
//! \brief Initialize surface info |
| 753 |
//! |
| 754 |
//! \return MOS_STATUS |
| 755 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 756 |
//! |
| 757 |
// virtual MOS_STATUS InitSurfaceInfoTable(); |
| 758 |
|
| 759 |
// Inherited virtual function |
| 760 |
bool UsePlatformControlFlag() |
| 761 |
{ |
| 762 |
return false; |
| 763 |
} |
| 764 |
}; |
| 765 |
|
| 766 |
#endif // __CODECHAL_FEI_HEVC__G9_SKL_H__ |
| 767 |
|