| From acc168f6985f15b672ee36e559cbe42d96ec5297 Mon Sep 17 00:00:00 2001 |
| From: XinfengZhang <carl.zhang@intel.com> |
| Date: Fri, 18 Mar 2022 03:06:14 -0400 |
| Subject: [PATCH] enable VP8 encode for BXT and APL |
| |
| reuse the interface of KBL |
| |
| Signed-off-by: XinfengZhang <carl.zhang@intel.com> |
| --- |
| media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp | 5 +++++ |
| .../linux/ult/ult_app/RefCapsTable_BXT.h | 1 + |
| .../media_interfaces_g9_bxt.cpp | 17 +++++++++++++++++ |
| .../media_interfaces_g9_bxt.h | 7 +++++++ |
| 4 files changed, 30 insertions(+) |
| |
| diff --git a/media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp b/media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp |
| index 9f4fa2f3cb64..af1b1efb4622 100755 |
| --- a/media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp |
| +++ b/media_driver/linux/gen9/ddi/media_sku_wa_g9.cpp |
| @@ -62,6 +62,10 @@ static struct LinuxCodecInfo bxtCodecInfo = |
| .avcVdenc = 1, |
| .vp9Decoding = 1, |
| .hevc10Decoding = 1, |
| + .vp9b10Decoding = 0, |
| + .hevc10Encoding = 0, |
| + .hevc12Encoding = 0, |
| + .vp8Encoding = SET_STATUS_BY_FULL_OPEN_SOURCE(1, 0), |
| }; |
| |
| /* This can also be applied to CFL */ |
| @@ -252,6 +256,7 @@ static bool InitBxtMediaSku(struct GfxDeviceInfo *devInfo, |
| MEDIA_WR_SKU(skuTable, FtrEncodeAVCVdenc, codecInfo->avcVdenc); |
| MEDIA_WR_SKU(skuTable, FtrVP9VLDDecoding, codecInfo->vp9Decoding); |
| MEDIA_WR_SKU(skuTable, FtrIntelVP9VLDProfile0Decoding8bit420, codecInfo->vp9Decoding); |
| + MEDIA_WR_SKU(skuTable, FtrEncodeVP8, codecInfo->vp8Encoding); |
| } |
| |
| MEDIA_WR_SKU(skuTable, FtrEnableMediaKernels, drvInfo->hasHuc); |
| diff --git a/media_driver/linux/ult/ult_app/RefCapsTable_BXT.h b/media_driver/linux/ult/ult_app/RefCapsTable_BXT.h |
| index f5c33ab92e4d..a257980a7954 100644 |
| --- a/media_driver/linux/ult/ult_app/RefCapsTable_BXT.h |
| +++ b/media_driver/linux/ult/ult_app/RefCapsTable_BXT.h |
| @@ -45,6 +45,7 @@ std::vector<FeatureID> refFeatureIDTable_BXT = { |
| { VAProfileJPEGBaseline , VAEntrypointVLD }, |
| { VAProfileJPEGBaseline , VAEntrypointEncPicture }, |
| { VAProfileVP8Version0_3 , VAEntrypointVLD }, |
| + { VAProfileVP8Version0_3 , VAEntrypointEncSlice }, |
| { VAProfileHEVCMain , VAEntrypointVLD }, |
| { VAProfileHEVCMain , VAEntrypointEncSlice }, |
| { VAProfileHEVCMain10 , VAEntrypointVLD }, |
| diff --git a/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.cpp b/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.cpp |
| index 700683078c5f..53b8b01ff424 100644 |
| --- a/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.cpp |
| +++ b/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.cpp |
| @@ -436,6 +436,23 @@ MOS_STATUS CodechalInterfacesG9Bxt::Initialize( |
| } |
| } |
| else |
| +#endif |
| +#ifdef _VP8_ENCODE_SUPPORTED |
| + if (info->Mode == CODECHAL_ENCODE_MODE_VP8) |
| + { |
| + // Setup encode interface functions |
| + encoder = MOS_New(Encode::Vp8, hwInterface, debugInterface, info); |
| + if (encoder == nullptr) |
| + { |
| + CODECHAL_PUBLIC_ASSERTMESSAGE("VP8 Encode allocation failed!"); |
| + return MOS_STATUS_INVALID_PARAMETER; |
| + } |
| + else |
| + { |
| + m_codechalDevice = encoder; |
| + } |
| + } |
| + else |
| #endif |
| { |
| CODECHAL_PUBLIC_ASSERTMESSAGE("Unsupported encode function requested."); |
| diff --git a/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.h b/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.h |
| index 09c8ef285811..2bf3acb32e11 100644 |
| --- a/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.h |
| +++ b/media_driver/media_interface/media_interfaces_m9_bxt/media_interfaces_g9_bxt.h |
| @@ -100,6 +100,10 @@ |
| #ifdef _HEVC_ENCODE_VME_SUPPORTED |
| #include "codechal_encode_hevc_g9_bxt.h" |
| #endif |
| +#ifdef _VP8_ENCODE_SUPPORTED |
| +#include "codechal_encode_vp8_g9.h" |
| +#endif |
| + |
| #include "cm_hal_g9.h" |
| #include "vphal_g9_bxt.h" |
| |
| @@ -193,6 +197,9 @@ public: |
| #ifdef _AVC_ENCODE_VDENC_SUPPORTED |
| using AvcVdenc = CodechalVdencAvcStateG9Bxt; |
| #endif |
| +#ifdef _VP8_ENCODE_SUPPORTED |
| + using Vp8 = CodechalEncodeVp8G9; |
| +#endif |
| }; |
| |
| class CodechalInterfacesG9Bxt : public CodechalDevice |
| -- |
| 2.17.1 |
| |