mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-05 05:04:45 +02:00
onevpl-intel-gpu: backport patches to fix bugs
1. Enable JPEG Enc support with BGR4 format. * 0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch 2. Fixed YV12 setBuffers for V & U plane offsets calculation * 0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
parent
f937848a04
commit
e318d88002
|
@ -0,0 +1,32 @@
|
|||
From e118062518c95d8fb0080cc8276b123a90bd0eb9 Mon Sep 17 00:00:00 2001
|
||||
From: gfxVPLsdm <gfxvplsdm@intel.com>
|
||||
Date: Wed, 21 Feb 2024 17:11:52 +0800
|
||||
Subject: [PATCH] Fix SetBuffersYV12() V & U plane offsets calculation (#6475)
|
||||
|
||||
Signed-off-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com>
|
||||
Co-authored-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/ce704ddfe11724767ba86c9425a3917dc3100d4a]
|
||||
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
|
||||
---
|
||||
_studio/shared/src/libmfx_core_vaapi.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/_studio/shared/src/libmfx_core_vaapi.cpp b/_studio/shared/src/libmfx_core_vaapi.cpp
|
||||
index 2cad86f8..fd5fc269 100644
|
||||
--- a/_studio/shared/src/libmfx_core_vaapi.cpp
|
||||
+++ b/_studio/shared/src/libmfx_core_vaapi.cpp
|
||||
@@ -462,8 +462,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
- eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[1] / 2);
|
||||
- eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[2] / 2);
|
||||
+ eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[0]);
|
||||
+ eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[1] / 2);
|
||||
}
|
||||
eb.num_planes = 3;
|
||||
eb.data_size = eb.offsets[2] + (eb.height * eb.pitches[2] / 2);
|
||||
--
|
||||
2.40.1
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
From 40c0bc6d3dfe172dd25908df2c16de29c34fa4d4 Mon Sep 17 00:00:00 2001
|
||||
From: gfxVPLsdm <gfxvplsdm@intel.com>
|
||||
Date: Mon, 5 Feb 2024 17:14:07 +0800
|
||||
Subject: [PATCH] [JPEGe] Enable BGR4 JPEG Enc support (#6470)
|
||||
|
||||
Co-authored-by: vcheah <vincent.beng.keat.cheah@intel.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/e73763d05f8fdc348c356b58dcb83075b5e868f8]
|
||||
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
|
||||
---
|
||||
.../mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp | 6 ++++--
|
||||
.../encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | 9 +++++----
|
||||
2 files changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
|
||||
index 141564b1..332f6372 100644
|
||||
--- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
|
||||
+++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
|
||||
@@ -212,7 +212,8 @@ mfxStatus MFXVideoENCODEMJPEG_HW::QueryImplsDescription(
|
||||
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YV12;
|
||||
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUY2;
|
||||
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_RGB4;
|
||||
- memCaps.NumColorFormats = 4;
|
||||
+ ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_BGR4;
|
||||
+ memCaps.NumColorFormats = 5;
|
||||
|
||||
ah.PushBack(profileCaps.MemDesc);
|
||||
profileCaps.MemDesc[1] = profileCaps.MemDesc[0];
|
||||
@@ -392,7 +393,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Query(VideoCORE * core, mfxVideoParam *in, mfx
|
||||
if ((fourCC == 0 && chromaFormat == 0) ||
|
||||
(fourCC == MFX_FOURCC_NV12 && (chromaFormat == MFX_CHROMAFORMAT_YUV420 || chromaFormat == MFX_CHROMAFORMAT_YUV400)) ||
|
||||
(fourCC == MFX_FOURCC_YUY2 && chromaFormat == MFX_CHROMAFORMAT_YUV422H) ||
|
||||
- (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444))
|
||||
+ ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444))
|
||||
{
|
||||
out->mfx.FrameInfo.FourCC = in->mfx.FrameInfo.FourCC;
|
||||
out->mfx.FrameInfo.ChromaFormat = in->mfx.FrameInfo.ChromaFormat;
|
||||
@@ -698,6 +699,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Init(mfxVideoParam *par)
|
||||
doubleBytesPerPx = 4;
|
||||
break;
|
||||
case MFX_FOURCC_RGB4:
|
||||
+ case MFX_FOURCC_BGR4:
|
||||
default:
|
||||
doubleBytesPerPx = 8;
|
||||
break;
|
||||
diff --git a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
|
||||
index 3fc619d1..b1ab556e 100644
|
||||
--- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
|
||||
+++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp
|
||||
@@ -108,6 +108,7 @@ mfxStatus MfxHwMJpegEncode::CheckJpegParam(VideoCORE *core, mfxVideoParam & par,
|
||||
BytesPerPx = 2;
|
||||
break;
|
||||
case MFX_FOURCC_RGB4:
|
||||
+ case MFX_FOURCC_BGR4:
|
||||
default:
|
||||
BytesPerPx = 4;
|
||||
}
|
||||
@@ -157,7 +158,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
|
||||
|
||||
m_payload_base.length = 0;
|
||||
m_payload_list.clear();
|
||||
- if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444)
|
||||
+ if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)
|
||||
{
|
||||
m_app14_data.header = 0xEEFF;//APP14
|
||||
m_app14_data.lenH = 0;
|
||||
@@ -287,7 +288,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
|
||||
m_pps.num_components = 3;
|
||||
else if (fourCC == MFX_FOURCC_NV12 && chromaFormat == MFX_CHROMAFORMAT_YUV400)
|
||||
m_pps.num_components = 1;
|
||||
- else if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444)
|
||||
+ else if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)
|
||||
m_pps.num_components = 3;
|
||||
else
|
||||
MFX_RETURN(MFX_ERR_UNDEFINED_BEHAVIOR);
|
||||
@@ -341,7 +342,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
|
||||
{
|
||||
// No external tables - use Quality parameter
|
||||
m_dqt_list.resize(0);
|
||||
- if (fourCC == MFX_FOURCC_RGB4)
|
||||
+ if (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4)
|
||||
{
|
||||
m_pps.quantiser_table_selector[0] = 0;
|
||||
m_pps.quantiser_table_selector[1] = 0;
|
||||
@@ -393,7 +394,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
|
||||
{
|
||||
m_dht_list.resize(0);
|
||||
}
|
||||
- else if (hwCaps->MaxNumHuffTable == 1 || fourCC == MFX_FOURCC_RGB4)
|
||||
+ else if (hwCaps->MaxNumHuffTable == 1 || (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4))
|
||||
{
|
||||
m_dht_list.resize(1);
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
|
@ -19,6 +19,8 @@ RDEPENDS:${PN} += "intel-media-driver"
|
|||
|
||||
SRC_URI = "git://github.com/oneapi-src/oneVPL-intel-gpu.git;protocol=https;nobranch=1;lfs=0 \
|
||||
file://0001-ARLH-DID-open-source-6286.patch \
|
||||
file://0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch \
|
||||
file://0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch \
|
||||
"
|
||||
|
||||
SRCREV = "852fa9f705ef44c004d014548601f3804a6de705"
|
||||
|
|
Loading…
Reference in New Issue
Block a user