Skip to content

Commit

Permalink
[JPEGe] Enable YUV400 JPEG Enc support
Browse files Browse the repository at this point in the history
Signed-off-by: Cheah, Vincent Beng Keat [email protected]>
  • Loading branch information
vcheah committed Jun 10, 2024
1 parent efe87f4 commit 6cc747d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion _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,8 @@ 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;
memCaps.NumColorFormats = 5;
ah.PushBack(memCaps.ColorFormats) = MFX_FOURCC_YUV400;
memCaps.NumColorFormats = 6;

ah.PushBack(profileCaps.MemDesc);
profileCaps.MemDesc[1] = profileCaps.MemDesc[0];
Expand Down Expand Up @@ -392,6 +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_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 +693,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 6cc747d

Please sign in to comment.