Skip to content

Commit

Permalink
[JPEGe] Enable YUV400 JPEG Enc support
Browse files Browse the repository at this point in the history
The changes only enable YUV400 JPEG Enc support for Linux only.

OSPR: [PUBLIC]333

Issue: VSMGWL-73224
Test: manual
Github PR: 333 (Enable YUV400 JPEG Enc and BGR4 JPEG Enc (api2x))

Signed-off-by: Cheah, Vincent Beng Keat vincent.beng.keat.cheah@intel.com>
  • Loading branch information
vcheah authored and gfxVPLsdm committed Jul 23, 2024
1 parent f286eff commit a15c143
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions _studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ mfxStatus MFXVideoENCODEMJPEG_HW::QueryImplsDescription(
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUY2;
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_RGB4;
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_BGR4;
#if defined(LINUX)
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUV400;
memCaps.NumColorFormats = 6;
#else
memCaps.NumColorFormats = 5;
#endif

ah.PushBack(profileCaps.MemDesc);
profileCaps.MemDesc[1] = profileCaps.MemDesc[0];
Expand Down Expand Up @@ -392,6 +397,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_YUV400 && chromaFormat == MFX_CHROMAFORMAT_YUV400) ||
(fourCC == MFX_FOURCC_YUY2 && chromaFormat == MFX_CHROMAFORMAT_YUV422H) ||
((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444))
{
Expand Down Expand Up @@ -691,6 +697,7 @@ mfxStatus MFXVideoENCODEMJPEG_HW::Init(mfxVideoParam *par)
mfxU16 doubleBytesPerPx = 0;
switch(m_vParam.mfx.FrameInfo.FourCC)
{
case MFX_FOURCC_YUV400:
case MFX_FOURCC_NV12:
case MFX_FOURCC_YV12:
doubleBytesPerPx = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ mfxStatus MfxHwMJpegEncode::CheckJpegParam(VideoCORE *core, mfxVideoParam & par,
mfxF64 BytesPerPx = 0;
switch (par.mfx.FrameInfo.FourCC)
{
case MFX_FOURCC_YUV400:
case MFX_FOURCC_NV12:
case MFX_FOURCC_YV12:
BytesPerPx = 1.5;
Expand Down Expand Up @@ -286,7 +287,7 @@ mfxStatus ExecuteBuffers::Init(mfxVideoParam const *par, mfxEncodeCtrl const * c
m_pps.num_components = 3;
else if (fourCC == MFX_FOURCC_YUY2 && chromaFormat == MFX_CHROMAFORMAT_YUV422H)
m_pps.num_components = 3;
else if (fourCC == MFX_FOURCC_NV12 && chromaFormat == MFX_CHROMAFORMAT_YUV400)
else if ((fourCC == MFX_FOURCC_NV12 || fourCC == MFX_FOURCC_YUV400) && chromaFormat == MFX_CHROMAFORMAT_YUV400)
m_pps.num_components = 1;
else if ((fourCC == MFX_FOURCC_RGB4 || fourCC == MFX_FOURCC_BGR4) && chromaFormat == MFX_CHROMAFORMAT_YUV444)
m_pps.num_components = 3;
Expand Down

0 comments on commit a15c143

Please sign in to comment.