diff options
| author | Lim Siew Hoon <siew.hoon.lim@intel.com> | 2024-02-26 15:10:13 +0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2024-02-26 16:43:47 +0800 |
| commit | e318d88002830d6eee31b0b5508f8351098e7fe5 (patch) | |
| tree | 122a4f4bbb83c85473b36f06da2b6472d87bd770 /recipes-multimedia/onevpl | |
| parent | f937848a04d199f960fd8cef009ba5ed2da51331 (diff) | |
| download | meta-intel-e318d88002830d6eee31b0b5508f8351098e7fe5.tar.gz | |
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>
Diffstat (limited to 'recipes-multimedia/onevpl')
3 files changed, 130 insertions, 0 deletions
diff --git a/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch b/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch new file mode 100644 index 00000000..8e014c97 --- /dev/null +++ b/recipes-multimedia/onevpl/files/0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From e118062518c95d8fb0080cc8276b123a90bd0eb9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: gfxVPLsdm <gfxvplsdm@intel.com> | ||
| 3 | Date: Wed, 21 Feb 2024 17:11:52 +0800 | ||
| 4 | Subject: [PATCH] Fix SetBuffersYV12() V & U plane offsets calculation (#6475) | ||
| 5 | |||
| 6 | Signed-off-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com> | ||
| 7 | Co-authored-by: Hoe, Sheng Yang <sheng.yang.hoe@intel.com> | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/ce704ddfe11724767ba86c9425a3917dc3100d4a] | ||
| 10 | Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> | ||
| 11 | --- | ||
| 12 | _studio/shared/src/libmfx_core_vaapi.cpp | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/_studio/shared/src/libmfx_core_vaapi.cpp b/_studio/shared/src/libmfx_core_vaapi.cpp | ||
| 16 | index 2cad86f8..fd5fc269 100644 | ||
| 17 | --- a/_studio/shared/src/libmfx_core_vaapi.cpp | ||
| 18 | +++ b/_studio/shared/src/libmfx_core_vaapi.cpp | ||
| 19 | @@ -462,8 +462,8 @@ public: | ||
| 20 | } | ||
| 21 | else | ||
| 22 | { | ||
| 23 | - eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[1] / 2); | ||
| 24 | - eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[2] / 2); | ||
| 25 | + eb.offsets[1] = eb.offsets[0] + uint32_t(eb.height * eb.pitches[0]); | ||
| 26 | + eb.offsets[2] = eb.offsets[1] + uint32_t(eb.height * eb.pitches[1] / 2); | ||
| 27 | } | ||
| 28 | eb.num_planes = 3; | ||
| 29 | eb.data_size = eb.offsets[2] + (eb.height * eb.pitches[2] / 2); | ||
| 30 | -- | ||
| 31 | 2.40.1 | ||
| 32 | |||
diff --git a/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch b/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch new file mode 100644 index 00000000..e3854407 --- /dev/null +++ b/recipes-multimedia/onevpl/files/0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | From 40c0bc6d3dfe172dd25908df2c16de29c34fa4d4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: gfxVPLsdm <gfxvplsdm@intel.com> | ||
| 3 | Date: Mon, 5 Feb 2024 17:14:07 +0800 | ||
| 4 | Subject: [PATCH] [JPEGe] Enable BGR4 JPEG Enc support (#6470) | ||
| 5 | |||
| 6 | Co-authored-by: vcheah <vincent.beng.keat.cheah@intel.com> | ||
| 7 | |||
| 8 | Upstream-Status: Backport [https://github.com/oneapi-src/oneVPL-intel-gpu/commit/e73763d05f8fdc348c356b58dcb83075b5e868f8] | ||
| 9 | Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> | ||
| 10 | --- | ||
| 11 | .../mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp | 6 ++++-- | ||
| 12 | .../encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | 9 +++++---- | ||
| 13 | 2 files changed, 9 insertions(+), 6 deletions(-) | ||
| 14 | |||
| 15 | 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 | ||
| 16 | index 141564b1..332f6372 100644 | ||
| 17 | --- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp | ||
| 18 | +++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp | ||
| 19 | @@ -212,7 +212,8 @@ mfxStatus MFXVideoENCODEMJPEG_HW::QueryImplsDescription( | ||
| 20 | ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YV12; | ||
| 21 | ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUY2; | ||
| 22 | ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_RGB4; | ||
| 23 | - memCaps.NumColorFormats = 4; | ||
| 24 | + ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_BGR4; | ||
| 25 | + memCaps.NumColorFormats = 5; | ||
| 26 | |||
| 27 | ah.PushBack(profileCaps.MemDesc); | ||
| 28 | profileCaps.MemDesc[1] = profileCaps.MemDesc[0]; | ||
| 29 | @@ -392,7 +393,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Query(VideoCORE * core, mfxVideoParam *in, mfx | ||
| 30 | if ((fourCC == 0 && chromaFormat == 0) || | ||
| 31 | (fourCC == MFX_FOURCC_NV12 && (chromaFormat == MFX_CHROMAFORMAT_YUV420 || chromaFormat == MFX_CHROMAFORMAT_YUV400)) || | ||
| 32 | (fourCC == MFX_FOURCC_YUY2 && chromaFormat == MFX_CHROMAFORMAT_YUV422H) || | ||
| 33 | - (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444)) | ||
| 34 | + ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)) | ||
| 35 | { | ||
| 36 | out->mfx.FrameInfo.FourCC = in->mfx.FrameInfo.FourCC; | ||
| 37 | out->mfx.FrameInfo.ChromaFormat = in->mfx.FrameInfo.ChromaFormat; | ||
| 38 | @@ -698,6 +699,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Init(mfxVideoParam *par) | ||
| 39 | doubleBytesPerPx = 4; | ||
| 40 | break; | ||
| 41 | case MFX_FOURCC_RGB4: | ||
| 42 | + case MFX_FOURCC_BGR4: | ||
| 43 | default: | ||
| 44 | doubleBytesPerPx = 8; | ||
| 45 | break; | ||
| 46 | 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 | ||
| 47 | index 3fc619d1..b1ab556e 100644 | ||
| 48 | --- a/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | ||
| 49 | +++ b/_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp | ||
| 50 | @@ -108,6 +108,7 @@ mfxStatus MfxHwMJpegEncode::CheckJpegParam(VideoCORE *core, mfxVideoParam & par, | ||
| 51 | BytesPerPx = 2; | ||
| 52 | break; | ||
| 53 | case MFX_FOURCC_RGB4: | ||
| 54 | + case MFX_FOURCC_BGR4: | ||
| 55 | default: | ||
| 56 | BytesPerPx = 4; | ||
| 57 | } | ||
| 58 | @@ -157,7 +158,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c | ||
| 59 | |||
| 60 | m_payload_base.length = 0; | ||
| 61 | m_payload_list.clear(); | ||
| 62 | - if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444) | ||
| 63 | + if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444) | ||
| 64 | { | ||
| 65 | m_app14_data.header = 0xEEFF;//APP14 | ||
| 66 | m_app14_data.lenH = 0; | ||
| 67 | @@ -287,7 +288,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c | ||
| 68 | m_pps.num_components = 3; | ||
| 69 | else if (fourCC == MFX_FOURCC_NV12 && chromaFormat == MFX_CHROMAFORMAT_YUV400) | ||
| 70 | m_pps.num_components = 1; | ||
| 71 | - else if (fourCC == MFX_FOURCC_RGB4 && chromaFormat == MFX_CHROMAFORMAT_YUV444) | ||
| 72 | + else if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444) | ||
| 73 | m_pps.num_components = 3; | ||
| 74 | else | ||
| 75 | MFX_RETURN(MFX_ERR_UNDEFINED_BEHAVIOR); | ||
| 76 | @@ -341,7 +342,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c | ||
| 77 | { | ||
| 78 | // No external tables - use Quality parameter | ||
| 79 | m_dqt_list.resize(0); | ||
| 80 | - if (fourCC == MFX_FOURCC_RGB4) | ||
| 81 | + if (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) | ||
| 82 | { | ||
| 83 | m_pps.quantiser_table_selector[0] = 0; | ||
| 84 | m_pps.quantiser_table_selector[1] = 0; | ||
| 85 | @@ -393,7 +394,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c | ||
| 86 | { | ||
| 87 | m_dht_list.resize(0); | ||
| 88 | } | ||
| 89 | - else if (hwCaps->MaxNumHuffTable == 1 || fourCC == MFX_FOURCC_RGB4) | ||
| 90 | + else if (hwCaps->MaxNumHuffTable == 1 || (fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4)) | ||
| 91 | { | ||
| 92 | m_dht_list.resize(1); | ||
| 93 | |||
| 94 | -- | ||
| 95 | 2.40.1 | ||
| 96 | |||
diff --git a/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb index 8db5ef52..0b849bf1 100644 --- a/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb +++ b/recipes-multimedia/onevpl/onevpl-intel-gpu_23.4.3.bb | |||
| @@ -19,6 +19,8 @@ RDEPENDS:${PN} += "intel-media-driver" | |||
| 19 | 19 | ||
| 20 | SRC_URI = "git://github.com/oneapi-src/oneVPL-intel-gpu.git;protocol=https;nobranch=1;lfs=0 \ | 20 | SRC_URI = "git://github.com/oneapi-src/oneVPL-intel-gpu.git;protocol=https;nobranch=1;lfs=0 \ |
| 21 | file://0001-ARLH-DID-open-source-6286.patch \ | 21 | file://0001-ARLH-DID-open-source-6286.patch \ |
| 22 | file://0001-JPEGe-Enable-BGR4-JPEG-Enc-support-6470.patch \ | ||
| 23 | file://0001-Fix-SetBuffersYV12-V-U-plane-offsets-calculation-647.patch \ | ||
| 22 | " | 24 | " |
| 23 | 25 | ||
| 24 | SRCREV = "852fa9f705ef44c004d014548601f3804a6de705" | 26 | SRCREV = "852fa9f705ef44c004d014548601f3804a6de705" |
