Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Encode] Av1e linux ARGB caps enable #1899

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion media_driver/linux/Xe_M/ddi/media_libva_caps_dg2.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class MediaLibvaCapsDG2 : public MediaLibvaCapsG12
{VP9, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP |
VA_RT_FORMAT_YUV444 | VA_RT_FORMAT_YUV444_10 | VA_RT_FORMAT_RGB32 |
VA_RT_FORMAT_RGB32_10BPP},
{AV1, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP}
{AV1, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP |
VA_RT_FORMAT_RGB32 | VA_RT_FORMAT_RGB32_10BPP}
};
m_encodeFormatTable = (struct EncodeFormatTable*)(&encodeFormatTableDG2[0]);
m_encodeFormatCount = sizeof(encodeFormatTableDG2)/sizeof(struct EncodeFormatTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ VAStatus DdiEncodeAV1::ParseSeqParams(void *ptr)
#else
av1SeqParams->SeqFlags.fields.HierarchicalFlag = seqParams->reserved8b;
#endif
av1SeqParams->SeqFlags.fields.DisplayFormatSwizzle = NeedDisplayFormatSwizzle(m_encodeCtx->RTtbl.pCurrentRT);

return VA_STATUS_SUCCESS;
}
Expand Down
19 changes: 19 additions & 0 deletions media_driver/linux/common/codec/ddi/media_ddi_encode_av1.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,25 @@ class DdiEncodeAV1 : public DdiEncodeBase

VAStatus CheckTile(const VAEncPictureParameterBufferAV1 *picParams);

//!
//! \brief Check whether swizzle needed
//!
//! \param [in] rawSurface
//! Pointer of Raw Surface
//!
//! \return bool, true if need, otherwise false
//!
inline bool NeedDisplayFormatSwizzle(DDI_MEDIA_SURFACE *rawSurface)
{
if (Media_Format_A8R8G8B8 == rawSurface->format ||
Media_Format_X8R8G8B8 == rawSurface->format ||
Media_Format_B10G10R10A2 == rawSurface->format)
{
return true;
}

return false;
}
uint32_t savedTargetBit[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
uint32_t savedFrameRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
uint32_t savedMaxBitRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ MOS_STATUS Av1BasicFeature::UpdateFormat(void *params)
switch(m_rawSurface.Format)
{
case Format_P010:
case Format_R10G10B10A2:
case Format_B10G10R10A2:
m_is10Bit = true;
m_bitDepth = 10;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ VAStatus DdiEncodeAV1::ParseSeqParams(void *ptr)
#else
av1SeqParams->SeqFlags.fields.HierarchicalFlag = seqParams->reserved8b;
#endif

av1SeqParams->SeqFlags.fields.DisplayFormatSwizzle = NeedDisplayFormatSwizzle(m_encodeCtx->RTtbl.pCurrentRT);
return VA_STATUS_SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,26 @@ class DdiEncodeAV1 : public encode::DdiEncodeBase
//!
CODECHAL_MODE GetEncodeCodecMode(VAProfile profile, VAEntrypoint entrypoint) override;

//!
//! \brief Check whether swizzle needed
//!
//! \param [in] rawSurface
//! Pointer of Raw Surface
//!
//! \return bool, true if need, otherwise false
//!
inline bool NeedDisplayFormatSwizzle(DDI_MEDIA_SURFACE *rawSurface)
{
if (Media_Format_A8R8G8B8 == rawSurface->format ||
Media_Format_X8R8G8B8 == rawSurface->format ||
Media_Format_B10G10R10A2 == rawSurface->format)
{
return true;
}

return false;
}

uint32_t savedTargetBit[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
uint32_t savedFrameRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
uint32_t savedMaxBitRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static ConfigDataList configDataList_VAProfileAV1Profile0_VAEntrypointEncSlice_X
//!
static const AttribList attribList_VAProfileAV1Profile0_VAEntrypointEncSlice_Xe_Lpm_plus_r0
{
{VAConfigAttribRTFormat, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10},
{VAConfigAttribRTFormat, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10 | VA_RT_FORMAT_RGB32 | VA_RT_FORMAT_RGB32_10BPP},
{VAConfigAttribEncDynamicScaling, 0},
{VAConfigAttribEncDirtyRect, VA_ATTRIB_NOT_SUPPORTED},
{VAConfigAttribEncAV1Ext2, VAProfileAV1Profile0_VAEntrypointEncSlice_encAV1Ext2.value},
Expand Down