| 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 |
#ifndef __MEDIA_LIBVA_CAPS_G11_H__ |
| 28 |
#define __MEDIA_LIBVA_CAPS_G11_H__ |
| 29 |
|
| 30 |
#include "media_libva_caps.h" |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
class MediaLibvaCapsG11 : public MediaLibvaCaps |
| 37 |
{ |
| 38 |
public: |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
MediaLibvaCapsG11(DDI_MEDIA_CONTEXT *mediaCtx) : MediaLibvaCaps(mediaCtx) |
| 43 |
{ |
| 44 |
|
| 45 |
static struct EncodeFormatTable encodeFormatTableICL[] = |
| 46 |
{ |
| 47 |
{AVC, DualPipe, VA_RT_FORMAT_YUV420}, |
| 48 |
{AVC, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV422 | VA_RT_FORMAT_YUV444 | VA_RT_FORMAT_RGB32}, |
| 49 |
{HEVC, DualPipe, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP | VA_RT_FORMAT_YUV422 | VA_RT_FORMAT_YUV422_10}, |
| 50 |
{HEVC, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP | VA_RT_FORMAT_YUV444 | VA_RT_FORMAT_YUV444_10 | VA_RT_FORMAT_RGB32 | VA_RT_FORMAT_RGB32_10BPP}, |
| 51 |
{VP9, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP | VA_RT_FORMAT_YUV444 | VA_RT_FORMAT_YUV444_10 | VA_RT_FORMAT_RGB32 | VA_RT_FORMAT_RGB32_10BPP}, |
| 52 |
}; |
| 53 |
m_encodeFormatTable = (struct EncodeFormatTable*)(&encodeFormatTableICL[0]); |
| 54 |
m_encodeFormatCount = sizeof(encodeFormatTableICL)/sizeof(struct EncodeFormatTable); |
| 55 |
|
| 56 |
return; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
virtual VAStatus Init() override |
| 61 |
{ |
| 62 |
return LoadProfileEntrypoints(); |
| 63 |
} |
| 64 |
|
| 65 |
virtual VAStatus QueryImageFormats(VAImageFormat *formatList, int32_t *num_formats) override; |
| 66 |
|
| 67 |
virtual uint32_t GetImageFormatsMaxNum() override; |
| 68 |
|
| 69 |
virtual bool IsImageSupported(uint32_t fourcc) override; |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
virtual VAStatus PopulateColorMaskInfo(VAImageFormat *vaImgFmt) override; |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
CODECHAL_MODE GetEncodeCodecMode(VAProfile profile, VAEntrypoint entrypoint) override; |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
virtual std::string GetDecodeCodecKey(VAProfile profile) override; |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
std::string GetEncodeCodecKey(VAProfile profile, VAEntrypoint entrypoint, uint32_t feiFunction) override; |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
virtual GMM_RESOURCE_FORMAT ConvertMediaFmtToGmmFmt(DDI_MEDIA_FORMAT format) override; |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
VAStatus QuerySurfaceAttributes( |
| 152 |
VAConfigID configId, |
| 153 |
VASurfaceAttrib *attribList, |
| 154 |
uint32_t *numAttribs) override; |
| 155 |
|
| 156 |
protected: |
| 157 |
static const uint32_t m_maxHevcEncWidth = |
| 158 |
CODEC_8K_MAX_PIC_WIDTH; |
| 159 |
static const uint32_t m_maxHevcEncHeight = |
| 160 |
CODEC_8K_MAX_PIC_HEIGHT; |
| 161 |
static const uint32_t m_maxVp9EncWidth = |
| 162 |
CODEC_8K_MAX_PIC_WIDTH; |
| 163 |
static const uint32_t m_maxVp9EncHeight = |
| 164 |
CODEC_8K_MAX_PIC_HEIGHT; |
| 165 |
static const uint32_t m_minVp9EncWidth = |
| 166 |
CODEC_128_MIN_PIC_WIDTH; |
| 167 |
static const uint32_t m_minVp9EncHeight = |
| 168 |
CODEC_96_MIN_PIC_HEIGHT; |
| 169 |
static const VAImageFormat m_G11ImageFormats[]; |
| 170 |
static const VAConfigAttribValEncRateControlExt m_encVp9RateControlExt; |
| 171 |
|
| 172 |
virtual VAStatus GetPlatformSpecificAttrib(VAProfile profile, |
| 173 |
VAEntrypoint entrypoint, |
| 174 |
VAConfigAttribType type, |
| 175 |
unsigned int *value) override; |
| 176 |
|
| 177 |
virtual VAStatus LoadProfileEntrypoints() override; |
| 178 |
virtual VAStatus LoadVp9EncProfileEntrypoints() override; |
| 179 |
virtual VAStatus LoadHevcEncProfileEntrypoints() override; |
| 180 |
|
| 181 |
virtual VAStatus CheckEncodeResolution( |
| 182 |
VAProfile profile, |
| 183 |
uint32_t width, |
| 184 |
uint32_t height) override; |
| 185 |
virtual VAStatus CheckDecodeResolution( |
| 186 |
int32_t codecMode, |
| 187 |
VAProfile profile, |
| 188 |
uint32_t width, |
| 189 |
uint32_t height) override; |
| 190 |
|
| 191 |
virtual VAStatus CreateEncAttributes( |
| 192 |
VAProfile profile, |
| 193 |
VAEntrypoint entrypoint, |
| 194 |
AttribMap **attributeList) override; |
| 195 |
|
| 196 |
virtual VAStatus CreateDecAttributes( |
| 197 |
VAProfile profile, |
| 198 |
VAEntrypoint entrypoint, |
| 199 |
AttribMap **attributeList) override; |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
VAStatus LoadHevcEncLpProfileEntrypoints(); |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
VAStatus QueryAVCROIMaxNum(uint32_t rcMode, bool isVdenc, uint32_t *maxNum, bool *isRoiInDeltaQP) override; |
| 225 |
}; |
| 226 |
#endif |