| 1 |
/* |
| 2 |
* Copyright (c) 2018-2024, 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 |
#ifndef __VP_SFC_COMMON_H__ |
| 23 |
#define __VP_SFC_COMMON_H__ |
| 24 |
|
| 25 |
#include "vp_common.h" |
| 26 |
#include "vp_pipeline_common.h" |
| 27 |
#include "mhw_sfc_itf.h" |
| 28 |
|
| 29 |
namespace vp |
| 30 |
{ |
| 31 |
//! |
| 32 |
//! \brief Constants used to derive Line Buffer sizes |
| 33 |
//! |
| 34 |
#define SFC_CACHELINE_SIZE_IN_BYTES (512 / 8) |
| 35 |
#define SFC_AVS_LINEBUFFER_SIZE_PER_PIXEL_4_TAP_12BIT (5 * SFC_CACHELINE_SIZE_IN_BYTES / 8) |
| 36 |
#define SFC_AVS_LINEBUFFER_SIZE_PER_PIXEL_8_TAP_12BIT (6 * SFC_CACHELINE_SIZE_IN_BYTES / 8) |
| 37 |
#define SFC_AVS_LINEBUFFER_SIZE_PER_PIXEL_4_TAP_8BIT (3 * SFC_CACHELINE_SIZE_IN_BYTES / 8) |
| 38 |
#define SFC_AVS_LINEBUFFER_SIZE_PER_PIXEL_8_TAP_8BIT (5 * SFC_CACHELINE_SIZE_IN_BYTES / 8) |
| 39 |
#define SFC_IEF_LINEBUFFER_SIZE_PER_VERTICAL_PIXEL (1 * SFC_CACHELINE_SIZE_IN_BYTES / 4) |
| 40 |
#define SFC_SFD_LINEBUFFER_SIZE_PER_PIXEL (1 * SFC_CACHELINE_SIZE_IN_BYTES / 10) |
| 41 |
#define SFC_LINEBUFEER_SIZE_LIMITED 4000 |
| 42 |
|
| 43 |
typedef struct _SFC_COLORFILL_PARAMS |
| 44 |
{ |
| 45 |
bool bColorfillEnable; // Colorfill Enable |
| 46 |
float fColorFillYRPixel; // ColorFill Y/R pixel |
| 47 |
float fColorFillUGPixel; // ColorFill U/G pixel |
| 48 |
float fColorFillVBPixel; // ColorFill V/B pixel |
| 49 |
float fColorFillAPixel; // ColorFill A pixel |
| 50 |
float fAlphaPixel; // Alpha pixel |
| 51 |
}SFC_COLORFILL_PARAMS, *PSFC_COLORFILL_PARAMS; |
| 52 |
|
| 53 |
//! |
| 54 |
//! \brief Transient Render data populated for every BLT call |
| 55 |
//! |
| 56 |
typedef struct _VPHAL_SFC_RENDER_DATA |
| 57 |
{ |
| 58 |
bool bColorFill; //!< Enable ColorFill |
| 59 |
bool bScaling; //!< Enable Scaling |
| 60 |
bool bIEF; //!< Enable IEF filter |
| 61 |
bool bCSC; //!< Enable CSC filter |
| 62 |
bool bMirrorEnable; //!< Enable Mirror filter |
| 63 |
|
| 64 |
float fScaleX; //!< X Scaling ratio |
| 65 |
float fScaleY; //!< Y Scaling ratio |
| 66 |
uint16_t wIEFFactor; //!< IEF factor |
| 67 |
mhw::sfc::SFC_STATE_PAR *sfcStateParams; //!< Pointer to SFC state params |
| 68 |
PVPHAL_IEF_PARAMS pIefParams; //!< Pointer to IEF params |
| 69 |
PMHW_AVS_PARAMS pAvsParams; //!< Pointer to AVS params |
| 70 |
PVPHAL_ALPHA_PARAMS pAlphaParams; //!< Pointer to Alpha params |
| 71 |
VPHAL_CSPACE SfcInputCspace; //!< SFC Input Color Space |
| 72 |
MOS_FORMAT SfcInputFormat; //!< SFC Input Format |
| 73 |
VPHAL_ROTATION SfcRotation; //!< SFC Rotation Mode |
| 74 |
uint32_t mirrorType; //!< Mirror Type -- vert/horiz |
| 75 |
VPHAL_SCALING_MODE SfcScalingMode; //!< SFC Scaling Mode |
| 76 |
|
| 77 |
uint32_t SfcSrcChromaSiting; //!< SFC Source Surface Chroma Siting |
| 78 |
|
| 79 |
PVP_SURFACE pSfcPipeOutSurface; //!< SFC Pipe output surface |
| 80 |
|
| 81 |
bool bForcePolyPhaseCoefs; //!< SFC AVS force polyphase coef |
| 82 |
bool b1stPassOfSfc2PassScaling; //!< 1st Pass of Sfc 2Pass Scaling |
| 83 |
|
| 84 |
} VP_SFC_RENDER_DATA, *PVP_SFC_RENDER_DATA; |
| 85 |
|
| 86 |
typedef struct _VPHAL_SFC_RENDER_DATA_LEGACY |
| 87 |
{ |
| 88 |
bool bColorFill; //!< Enable ColorFill |
| 89 |
bool bScaling; //!< Enable Scaling |
| 90 |
bool bIEF; //!< Enable IEF filter |
| 91 |
bool bCSC; //!< Enable CSC filter |
| 92 |
bool bMirrorEnable; //!< Enable Mirror filter |
| 93 |
|
| 94 |
float fScaleX; //!< X Scaling ratio |
| 95 |
float fScaleY; //!< Y Scaling ratio |
| 96 |
uint16_t wIEFFactor; //!< IEF factor |
| 97 |
MHW_SFC_STATE_PARAMS *sfcStateParams; //!< Pointer to SFC state params |
| 98 |
PVPHAL_IEF_PARAMS pIefParams; //!< Pointer to IEF params |
| 99 |
PMHW_AVS_PARAMS pAvsParams; //!< Pointer to AVS params |
| 100 |
PVPHAL_ALPHA_PARAMS pAlphaParams; //!< Pointer to Alpha params |
| 101 |
VPHAL_CSPACE SfcInputCspace; //!< SFC Input Color Space |
| 102 |
MOS_FORMAT SfcInputFormat; //!< SFC Input Format |
| 103 |
VPHAL_ROTATION SfcRotation; //!< SFC Rotation Mode |
| 104 |
uint32_t mirrorType; //!< Mirror Type -- vert/horiz |
| 105 |
VPHAL_SCALING_MODE SfcScalingMode; //!< SFC Scaling Mode |
| 106 |
|
| 107 |
uint32_t SfcSrcChromaSiting; //!< SFC Source Surface Chroma Siting |
| 108 |
|
| 109 |
PVP_SURFACE pSfcPipeOutSurface; //!< SFC Pipe output surface |
| 110 |
|
| 111 |
bool bForcePolyPhaseCoefs; //!< SFC AVS force polyphase coef |
| 112 |
bool b1stPassOfSfc2PassScaling; //!< 1st Pass of Sfc 2Pass Scaling |
| 113 |
|
| 114 |
} VP_SFC_RENDER_DATA_LEGACY, * PVP_SFC_RENDER_DATA_LEGACY; |
| 115 |
|
| 116 |
//! |
| 117 |
//! \brief Structure to hold AVS Coeff tables |
| 118 |
//! |
| 119 |
struct VPHAL_SFC_AVS_STATE |
| 120 |
{ |
| 121 |
mhw::sfc::SFC_AVS_LUMA_Coeff_Table_PAR LumaCoeffs; |
| 122 |
mhw::sfc::SFC_AVS_CHROMA_Coeff_Table_PAR ChromaCoeffs; |
| 123 |
mhw::sfc::SFC_AVS_STATE_PAR AvsStateParams; |
| 124 |
}; |
| 125 |
|
| 126 |
//! |
| 127 |
//! \brief Structure to hold AVS Coeff tables |
| 128 |
//! |
| 129 |
struct VPHAL_SFC_AVS_STATE_LEGACY |
| 130 |
{ |
| 131 |
MHW_SFC_AVS_LUMA_TABLE LumaCoeffs; |
| 132 |
MHW_SFC_AVS_CHROMA_TABLE ChromaCoeffs; |
| 133 |
MHW_SFC_AVS_STATE AvsStateParams; |
| 134 |
}; |
| 135 |
|
| 136 |
} |
| 137 |
#endif // !__VP_SFC_COMMON_H__ |