-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathmhw_sfc.h
622 lines (567 loc) · 28 KB
/
mhw_sfc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
/*
* Copyright (c) 2014-2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
//!
//! \file mhw_sfc.h
//! \brief MHW interface for constructing commands for the SFC
//! \details Impelements the functionalities common across all platforms for MHW_SFC
//!
#ifndef __MHW_SFC_H__
#define __MHW_SFC_H__
#include "mhw_cp_interface.h"
#include "mhw_state_heap.h"
#include "mhw_utilities.h"
#include "mos_os.h"
#include "media_defs.h"
static const int MHW_SFC_CACHELINE_SIZE = 64;
static const int MHW_SFC_MIN_HEIGHT = 128;
static const int MHW_SFC_MIN_WIDTH = 128;
static const int MHW_SFC_MAX_HEIGHT = 4096;
static const int MHW_SFC_MAX_WIDTH = 4096;
static const int MHW_SFC_VE_HEIGHT_ALIGN = 4;
static const int MHW_SFC_VE_WIDTH_ALIGN = 16;
static const float MHW_SFC_MIN_SCALINGFACTOR = (1.0F / 8.0F);
static const float MHW_SFC_MAX_SCALINGFACTOR = 8.0F;
// After resuming from S3/S4, SFD surface is also need even scaled height smaller than 4160, such as 4154.
// Lower the MHW_SFC_SFD_BUFF_HEIGHT_BAR from 4160 to 4000 to ensure SFD surface can be allocated for such case.
static const uint32_t MHW_SFC_SFD_BUFF_HEIGHT_BAR = 4000;
#define NEED_SFD_LINE_BUFFER(_SURFACE_HEIGHT) ((_SURFACE_HEIGHT) > MHW_SFC_SFD_BUFF_HEIGHT_BAR)
#define SFD_LINE_BUFFER_SIZE(_SURFACE_HEIGHT) (NEED_SFD_LINE_BUFFER(_SURFACE_HEIGHT) ? (uint32_t)ceil((_SURFACE_HEIGHT) * MHW_SFC_CACHELINE_SIZE / 10) : 0)
typedef class MhwSfcInterface MHW_SFC_INTERFACE, *PMHW_SFC_INTERFACE;
typedef enum _SFC_AVS_INPUT_SITING_COEF
{
SFC_AVS_INPUT_SITING_COEF_0_OVER_8 = 0x0,
SFC_AVS_INPUT_SITING_COEF_1_OVER_8 = 0x1,
SFC_AVS_INPUT_SITING_COEF_2_OVER_8 = 0x2,
SFC_AVS_INPUT_SITING_COEF_3_OVER_8 = 0x3,
SFC_AVS_INPUT_SITING_COEF_4_OVER_8 = 0x4,
SFC_AVS_INPUT_SITING_COEF_5_OVER_8 = 0x5,
SFC_AVS_INPUT_SITING_COEF_6_OVER_8 = 0x6,
SFC_AVS_INPUT_SITING_COEF_7_OVER_8 = 0x7,
SFC_AVS_INPUT_SITING_COEF_8_OVER_8 = 0x8
} SFC_AVS_INPUT_SITING_COEF, *PSFC_AVS_INPUT_SITING_COEF;
//!
//! \brief Structure to hold AVS Luma Filter Coeff, same as SFC_AVS_LUMA_FILTER_COEFF_G9
//!
typedef struct _SFC_AVS_LUMA_FILTER_COEFF
{
// DWORD 0
union
{
struct
{
uint32_t Table0XFilterCoefficient0 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table0YFilterCoefficient0 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table0XFilterCoefficient1 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table0YFilterCoefficient1 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW0;
// DWORD 1
union
{
struct
{
uint32_t Table0XFilterCoefficient2 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table0YFilterCoefficient2 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table0XFilterCoefficient3 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table0YFilterCoefficient3 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW1;
// DWORD 2
union
{
struct
{
uint32_t Table0XFilterCoefficient4 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table0YFilterCoefficient4 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table0XFilterCoefficient5 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table0YFilterCoefficient5 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW2;
// DWORD 3
union
{
struct
{
uint32_t Table0XFilterCoefficient6 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table0YFilterCoefficient6 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table0XFilterCoefficient7 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table0YFilterCoefficient7 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW3;
} SFC_AVS_LUMA_FILTER_COEFF, *PSFC_AVS_LUMA_FILTER_COEFF;
//!
//! \brief Structure to hold AVS Chroma Filter Coeff, same as SFC_AVS_CHROMA_FILTER_COEFF_G9
//!
typedef struct _SFC_AVS_CHROMA_FILTER_COEFF
{
// DWORD 0
union
{
struct
{
uint32_t Table1XFilterCoefficient2 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table1YFilterCoefficient2 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table1XFilterCoefficient3 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table1YFilterCoefficient3 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW0;
// DWORD 1
union
{
struct
{
uint32_t Table1XFilterCoefficient4 : MHW_BITFIELD_RANGE(0,7);
uint32_t Table1YFilterCoefficient4 : MHW_BITFIELD_RANGE(8,15);
uint32_t Table1XFilterCoefficient5 : MHW_BITFIELD_RANGE(16,23);
uint32_t Table1YFilterCoefficient5 : MHW_BITFIELD_RANGE(24,31);
};
struct
{
uint32_t Value;
};
} DW1;
} SFC_AVS_CHROMA_FILTER_COEFF, *PSFC_AVS_CHROMA_FILTER_COEFF;
//!
//! \brief Structure to hold AVS Luma Coeff tables
//!
typedef struct _MHW_SFC_AVS_LUMA_TABLE
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode
SFC_AVS_LUMA_FILTER_COEFF LumaTable[NUM_HW_POLYPHASE_TABLES];
} MHW_SFC_AVS_LUMA_TABLE, *PMHW_SFC_AVS_LUMA_TABLE;
//!
//! \brief Structure to hold AVS Chroma Coeff tables
//!
typedef struct _MHW_SFC_AVS_CHROMA_TABLE
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode
SFC_AVS_CHROMA_FILTER_COEFF ChromaTable[NUM_HW_POLYPHASE_TABLES];
} MHW_SFC_AVS_CHROMA_TABLE, *PMHW_SFC_AVS_CHROMA_TABLE;
//!
//! \brief Structure to hold AVS State
//!
typedef struct _MHW_SFC_AVS_STATE
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode
uint32_t dwInputHorizontalSiting;
uint32_t dwInputVerticalSitting;
uint32_t dwAVSFilterMode; // Bilinear, 5x5 or 8x8
} MHW_SFC_AVS_STATE, *PMHW_SFC_AVS_STATE;
//!
//! \brief SFC State Command parameters
//!
typedef struct _MHW_SFC_STATE_PARAMS
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode: VD-to-SFC or VE-to-SFC
uint32_t dwVDVEInputOrderingMode;
uint32_t dwInputChromaSubSampling; // Chroma subsampling at SFC input
float fAlphaPixel; // Alpha pixel
float fChromaSubSamplingXSiteOffset; // Chroma siting X offset
float fChromaSubSamplingYSiteOffset; // Chroma siting Y offset
uint32_t dwChromaDownSamplingMode; // Chroma Downsampling Mode
uint32_t dwChromaDownSamplingVerticalCoef; // Chomra Downsampling Vertical Coef
uint32_t dwChromaDownSamplingHorizontalCoef; // Chomra Downsampling Horizontal Coef
uint32_t dwOutputFrameHeight; // Output Frame Height
uint32_t dwOutputFrameWidth; // Output Frame Width
MOS_FORMAT OutputFrameFormat; // Output Frame Format
uint32_t dwInputFrameHeight; // Input Frame Height
uint32_t dwInputFrameWidth; // Input Frame Width
MOS_FORMAT InputFrameFormat; // Input Frame Format
// Scaling parameters
uint32_t dwAVSFilterMode; // Bilinear, 5x5 or 8x8
uint32_t dwSourceRegionHeight; // Source/Crop region height
uint32_t dwSourceRegionWidth; // Source/Crop region width
uint32_t dwSourceRegionVerticalOffset; // Source/Crop region vertical offset
uint32_t dwSourceRegionHorizontalOffset; // Source/Crop region horizontal offset
uint32_t dwScaledRegionHeight; // Scaled region height
uint32_t dwScaledRegionWidth; // Scaled region width
uint32_t dwScaledRegionVerticalOffset; // Scaled region vertical offset
uint32_t dwScaledRegionHorizontalOffset; // Scaled region horizontal offset
uint32_t dwTargetRectangleStartHorizontalOffset; // Target rectangle start horizontal offset
uint32_t dwTargetRectangleEndHorizontalOffset; // Target rectangle end horizontal offset
uint32_t dwTargetRectangleStartVerticalOffset; // Target rectangle start vertical offset
uint32_t dwTargetRectangleEndVerticalOffset; // Target rectangle end vertical offset
bool bRectangleEnabled; // Target rectangle enabled
float fAVSXScalingRatio; // X Scaling Ratio
float fAVSYScalingRatio; // Y Scaling Ratio
bool bBypassXAdaptiveFilter; // If true, X direction will use Default Sharpness level to blend
// b/w smooth and sharp filters rather than the calculated value
bool bBypassYAdaptiveFilter; // If true, Y direction will use Default Sharpness level to blend
// b/w smooth and sharp filters rather than the calculated value
bool bRGBAdaptive; // If true, Enable the RGB Adaptive filter
// IEF params
bool bIEFEnable; // IEF Filter enable
bool bSkinToneTunedIEFEnable; // Skin Tone Tuned IEF enable
bool bAVSChromaUpsamplingEnable; // Up sample chroma prior to IEF filter
bool b8tapChromafiltering; // This bit enables 8 tap filtering for Chroma Channels
// Rotation Params
MHW_ROTATION RotationMode; // Rotation mode -- 0, 90, 180 or 270
uint32_t dwMirrorType; // Mirror Type -- vert/horiz
bool bMirrorEnable; // Mirror mode -- enable/disable
// ColorFill params
bool bColorFillEnable; // ColorFill enable
float fColorFillYRPixel; // ColorFill Y/R pixel
float fColorFillUGPixel; // ColorFill U/G pixel
float fColorFillVBPixel; // ColorFill V/B pixel
float fColorFillAPixel; // ColorFill A pixel
// CSC Params
bool bCSCEnable; // YUV->RGB/YUV->YUV CSC enable
bool bRGBASwapEnable; // R, B Channel Swap enable
bool bInputColorSpace; //0: YUV color space, 1:RGB color space
// Memory compression Enable Flag
bool bMMCEnable; // Flag used to decide whether sfc output should be compressed
MOS_RESOURCE_MMC_MODE MMCMode; // Memory compression mode
// Resources used by SFC
PMOS_RESOURCE pOsResOutputSurface; // Output Frame written by SFC
PMOS_RESOURCE pOsResAVSLineBuffer; // AVS Line buffer used by SFC
PMOS_RESOURCE pOsResIEFLineBuffer; // IEF Line buffer used by SFC
uint32_t dwOutputSurfaceOffset; // Output Frame offset (page based offset)
uint16_t wOutputSurfaceUXOffset; // Output Frame offset (page internal U offset for X axis)
uint16_t wOutputSurfaceUYOffset; // Output Frame offset (page internal U offset for Y axis)
uint16_t wOutputSurfaceVXOffset; // Output Frame offset (page internal V offset for X axis)
uint16_t wOutputSurfaceVYOffset; // Output Frame offset (page internal V offset for Y axis)
bool isDemosaicEnabled = false; //!< Enable Demosaic
} MHW_SFC_STATE_PARAMS, *PMHW_SFC_STATE_PARAMS;
//!
//! \brief SFC Output Surface Command parameters
//!
typedef struct _MHW_SFC_OUT_SURFACE_PARAMS
{
uint32_t ChromaSiting; //!< Chroma siting
MOS_FORMAT Format; //!< Surface format
uint32_t dwWidth; //!< Surface width
uint32_t dwHeight; //!< Surface height
uint32_t dwPitch; //!< Surface pitch
MOS_TILE_TYPE TileType; //!< Tile Type
MOS_TILE_MODE_GMM TileModeGMM; //!< Tile Type from GMM Definition
bool bGMMTileEnabled; //!< GMM defined tile mode flag
uint32_t dwStreamID; //!< Surface StreamID
uint32_t dwSurfaceXOffset; //!< Surface X offset
uint32_t dwSurfaceYOffset; //!< Surface Y offset
uint32_t dwUYoffset; //!< Surface Uoffset in Vertical
uint32_t dwVUoffset; //!< Surface Voffset in Vertical, named by Vplane relative to Uplane
PMOS_RESOURCE pOsResource; //!< Surface resource
bool bCompressible; //!< Surface can be compressed
uint32_t dwCompressionFormat;//!< Surface Compression format
} MHW_SFC_OUT_SURFACE_PARAMS, *PMHW_SFC_OUT_SURFACE_PARAMS;
//!
//! \brief SFC Lock Command parameters
//!
typedef struct _MHW_SFC_LOCK_PARAMS
{
uint32_t dwGaClientId; // Ga Client Id
uint8_t sfcPipeMode; //!< SFC Pipe Mode
bool bOutputToMemory; // Write Vebox or Vdbox o/p to memory
} MHW_SFC_LOCK_PARAMS, *PMHW_SFC_LOCK_PARAMS;
//!
//! \brief SFC IEF State parameters
//!
typedef struct _MHW_SFC_IEF_STATE_PARAMS
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode
// IEF params
bool bSkinDetailFactor; // Skin Detail Factor
bool bVYSTDEnable; // Enable STD in VY subspace
bool bIEFEnable; // Enable IEF
uint8_t StrongEdgeWeight;
uint8_t RegularWeight;
uint8_t StrongEdgeThreshold;
uint32_t dwGainFactor;
uint32_t dwR5xCoefficient;
uint32_t dwR5cxCoefficient;
uint32_t dwR5cCoefficient;
uint32_t dwR3xCoefficient;
uint32_t dwR3cCoefficient;
// CSC params
bool bCSCEnable; // Enable CSC transform
float *pfCscCoeff; // [3x3] CSC Coeff matrix
float *pfCscInOffset; // [3x1] CSC Input Offset matrix
float *pfCscOutOffset; // [3x1] CSC Output Offset matrix
} MHW_SFC_IEF_STATE_PARAMS, *PMHW_SFC_IEF_STATE_PARAMS;
class MhwSfcInterface
{
public:
virtual ~MhwSfcInterface()
{
}
//!
//! \brief Adds a resource to the command buffer or indirect state (SSH)
//! \details Internal MHW function to add either a graphics address of a resource or
//! add the resource to the patch list for the requested buffer or state
//! \param [in] pOsInterface
//! OS interface
//! \param [in] pCmdBuffer
//! If adding a resource to the command buffer, the buffer to which the resource
//! is added
//! \param [in] pParams
//! Parameters necessary to add the graphics address
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
//!
MOS_STATUS(*pfnAddResourceToCmd) (
PMOS_INTERFACE pOsInterface,
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_RESOURCE_PARAMS pParams);
//!
//! \brief Add SFC Lock
//! \param [in] pCmdBuffer
//! Pointer to Command buffer
//! \param [in] pSfcLockParams
//! Pointer to SFC_LOCK params
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcLock (
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_LOCK_PARAMS pSfcLockParams) = 0;
//!
//! \brief Add SFC State
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] pSfcStateParams
//! Pointer to SFC_STATE params
//! \param [in] pOutSurface
//! Pointer to Output surface params
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcState(
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_STATE_PARAMS pSfcStateParams,
PMHW_SFC_OUT_SURFACE_PARAMS pOutSurface) = 0;
//!
//! \brief Add SFC AVS State command
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] pSfcAvsState
//! Pointer to SFC AVS State
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcAvsState(
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_AVS_STATE pSfcAvsState) = 0;
//!
//! \brief Add SFC Frame Start command
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] sfcPipeMode
//! SFC pipe mode
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcFrameStart (
PMOS_COMMAND_BUFFER pCmdBuffer,
uint8_t sfcPipeMode) = 0;
//!
//! \brief Add SFC IEF State command
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] pSfcIefStateParams
//! Pointer to IEF State params
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcIefState(
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_IEF_STATE_PARAMS pSfcIefStateParams) = 0;
//!
//! \brief Add SFC AVS Chroma Table command
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] pChromaTable
//! Pointer to Chroma Coefficient table
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcAvsChromaTable (
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_AVS_CHROMA_TABLE pChromaTable) = 0;
//!
//! \brief Add SFC AVS Chroma Table command
//! \param [in] pCmdBuffer
//! Pointer to Command Buffer
//! \param [in] pChromaTable
//! Pointer to Chroma Coefficient table
//! \return MOS_STATUS
//!
virtual MOS_STATUS AddSfcAvsLumaTable (
PMOS_COMMAND_BUFFER pCmdBuffer,
PMHW_SFC_AVS_LUMA_TABLE pLumaTable) = 0;
//!
//! \brief Set Sfc Sampler8x8 Table
//! \details Set Sfc AVS Luma and Chroma table
//! \param [out] pLumaTable
//! Pointer to AVS luma table
//! \param [out] pChromaTable
//! Pointer to AVS chroma table
//! \param [in] pAvsParams
//! Pointer to AVS params
//! \param [in] SrcFormat
//! Input Source Format
//! \param [in] fScaleX
//! Scaling ratio in width
//! \param [in] fScaleY
//! Scaling ratio in height
//! \param [in] dwChromaSiting
//! Chroma Siting info
//! \return MOS_STATUS
//!
virtual MOS_STATUS SetSfcSamplerTable (
PMHW_SFC_AVS_LUMA_TABLE pLumaTable,
PMHW_SFC_AVS_CHROMA_TABLE pChromaTable,
PMHW_AVS_PARAMS pAvsParams,
MOS_FORMAT SrcFormat,
float fScaleX,
float fScaleY,
uint32_t dwChromaSiting,
bool bUse8x8Filter,
float fHPStrength,
float fLanczosT);
//!
//! \brief Sets AVS Scaling Mode. Will configure the different coefficients of 8-Tap polyphase filter according to scaling mode.
//! \param [in] ScalingMode
//! AVS scaling mode e.g. Nearest, 8-Tap polyphase etc.
//! \return MOS_STATUS
//!
virtual MOS_STATUS SetSfcAVSScalingMode(
MHW_SCALING_MODE ScalingMode)
{
m_scalingMode = ScalingMode;
return MOS_STATUS_SUCCESS;
}
virtual MOS_STATUS GetInputFrameWidthHeightAlignUnit(uint32_t &widthAlignUnit, uint32_t &heightAlignUnit,
bool bVdbox, CODECHAL_STANDARD codecStandard, CodecDecodeJpegChromaType jpegChromaType);
//!
//! \brief Set Sfc Index
//! \details Set Sfc Index
//! \param [in] dwSfcIndex
//! set Sfc Index
//! \param [in] dwSfcCount
//! set Sfc Count
//! \return MOS_STATUS
//! MOS_STATUS_SUCCESS if success, else fail reason
virtual MOS_STATUS SetSfcIndex(
uint32_t dwSfcIndex,
uint32_t dwSfcCount)
{
MOS_UNUSED(dwSfcIndex);
MOS_UNUSED(dwSfcCount);
return MOS_STATUS_SUCCESS;
}
//!
//! \brief Get new sfc interface, temporal solution before switching from
//! old interface to new one
//!
//! \return pointer to new render interface
//!
virtual std::shared_ptr<void> GetNewSfcInterface() { return nullptr; }
protected:
MhwSfcInterface(PMOS_INTERFACE pOsInterface);
//!
//! \brief Sets AVS Luma Coefficient table
//! \param [in] SrcFormat
//! Source format
//! \param [in] pCoeffTable
//! Pointer to coefficient table
//! \param [in] piYCoefsX
//! Pointer to Y coefficients X
//! \param [in] piYCoefsY
//! Pointer to Y coefficients Y
//! \param [in] bUse8x8Filter
//! Is 8x8 Filter used
//! \return void
//!
void SetSfcAVSLumaTable(
MOS_FORMAT SrcFormat,
PSFC_AVS_LUMA_FILTER_COEFF pCoeffTable,
int32_t *piYCoefsX,
int32_t *piYCoefsY,
bool bUse8x8Filter);
//!
//! \brief Sets AVS Chroma Coefficient table
//! \param [in] pUVCoeffTable
//! Pointer to UV coefficient table
//! \param [in] piUVCoefsX
//! Pointer to UV coefficients X
//! \param [in] piUVCoefsY
//! Pointer to UV coefficients Y
//! \return void
//!
void SetSfcAVSChromaTable(
PSFC_AVS_CHROMA_FILTER_COEFF pUVCoeffTable,
int32_t *piUVCoefsX,
int32_t *piUVCoefsY);
public:
enum SFC_PIPE_MODE
{
SFC_PIPE_MODE_VDBOX = 0,
SFC_PIPE_MODE_VEBOX = 1
};
enum SfcScalabMode
{
sfcScalabModeSingle = 0, //!< 0 - single pipe
sfcScalabModeLeftCol, //!< 1 - left most column
sfcScalabModeRightCol, //!< 2 - right most column
sfcScalabModeMiddleCol //!< 3 - middle column
};
enum SfcScalabTileType
{
sfcScalabRealTile = 0, //!< 0 - real tile
sfcScalabVirtualTile //!< 1 - virtual tile
};
public:
PMOS_INTERFACE m_osInterface = nullptr;
uint16_t m_veWidthAlignment = MHW_SFC_VE_WIDTH_ALIGN;
uint16_t m_veHeightAlignment = MHW_SFC_VE_HEIGHT_ALIGN;
uint32_t m_maxWidth = MHW_SFC_MAX_WIDTH;
uint32_t m_maxHeight = MHW_SFC_MAX_HEIGHT;
uint32_t m_minWidth = MHW_SFC_MIN_WIDTH;
uint32_t m_minHeight = MHW_SFC_MIN_HEIGHT;
float m_maxScalingRatio = MHW_SFC_MAX_SCALINGFACTOR;
float m_minScalingRatio = MHW_SFC_MIN_SCALINGFACTOR;
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_outputSurfCtrl; // Output Frame caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_avsLineBufferCtrl; // AVS Line Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_iefLineBufferCtrl; // IEF Line Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_sfdLineBufferCtrl; // SFD Line Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_avsLineTileBufferCtrl; // AVS Line Tile Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_iefLineTileBufferCtrl; // IEF Line Tile Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_sfdLineTileBufferCtrl; // SFD Line Tile Buffer caching control bits
MHW_MEMORY_OBJECT_CONTROL_PARAMS m_histogramBufferCtrl; // Histogram Buffer caching control bits
MHW_SCALING_MODE m_scalingMode;
std::shared_ptr<void> m_sfcItfNew = nullptr;
};
#endif // __MHW_SFC_H__