Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ namespace decode
params.surfaceFormat = SURFACE_FORMAT_PLANAR4208; // 420 8 bit
}
}
#ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
else if (chromaType == avcChromaFormat420 && psSurface->Format == Format_P010)
{
if (ucBitDepthLumaMinus8 == 2 && ucBitDepthChromaMinus8 == 2)
Expand All @@ -263,7 +262,7 @@ namespace decode
params.surfaceFormat = SURFACE_FORMAT_Y216; // 422 10 bit (upto 16 bit)
}
}
#endif

return MOS_STATUS_SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,8 @@ namespace decode
{
AvcDecodePicPkt::MHW_SETPAR_F(MFX_AVC_IMG_STATE)(params);

#ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
params.bitDepthLumaMinus8 = m_avcPicParams->bit_depth_luma_minus8;
params.bitDepthChromaMinus8 = m_avcPicParams->bit_depth_chroma_minus8;
#endif
#ifdef _DECODE_PROCESSING_SUPPORTED
if (m_downSamplingFeature->IsVDAQMHistogramEnabled())
{
Expand All @@ -257,7 +255,6 @@ namespace decode
params.surfaceFormat = SURFACE_FORMAT_PLANAR4208; // 420 8 bit
}
}
#ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
else if (chromaType == avcChromaFormat420 && psSurface->Format == Format_P010)
{
if (ucBitDepthLumaMinus8 == 2 && ucBitDepthChromaMinus8 == 2)
Expand All @@ -272,7 +269,6 @@ namespace decode
params.surfaceFormat = SURFACE_FORMAT_Y216; // 422 10 bit (upto 16 bit)
}
}
#endif

return MOS_STATUS_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion media_softlet/agnostic/common/hw/vdbox/media_srcs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ set(TMP_SOFTLET_MHW_VDBOX_AQM_HEADERS_ "")
set(SOFTLET_MHW_VDBOX_PRIVATE_INCLUDE_DIRS_
${SOFTLET_MHW_VDBOX_PRIVATE_INCLUDE_DIRS_}
${CMAKE_CURRENT_LIST_DIR}
)
)
52 changes: 47 additions & 5 deletions media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_mfx_cmdpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@
#include "codec_def_common_jpeg.h"
#include "codec_def_common_mpeg2.h"

#ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
#include "mhw_vdbox_mfx_cmdpar_ext.h"
#define __MHW_VDBOX_MFX_WRAPPER_EXT(STUFF) STUFF
#else
#define __MHW_VDBOX_MFX_WRAPPER_EXT(STUFF)
#endif

namespace mhw
{
Expand All @@ -63,6 +58,53 @@ enum SURFACE_FORMAT
SURFACE_FORMAT_Y8UNORM = 12, //!< Sample_8x8 Only
};

enum SURFACE_FORMAT_EXT
{
SURFACE_FORMAT_P010 = 13, //!< P010 for 420 10 bits
SURFACE_FORMAT_Y216 = 14, //!< Y216 for 422 10 bit (upto 16 bit)
SURFACE_FORMAT_Y210V = 14, //!< Y210 Variant
};

#define MFX_AVC_IMG_STATE_EXT \
uint8_t minFrameWSize = 0; \
uint8_t loadSlicePointerFlag = 0;\
uint8_t tqchromadisable = 1; \
uint8_t pakQpShift = 0; \
uint8_t nonfirstpassflag = 0; \
uint8_t minframewsizeunits = 0; \
uint8_t granularCrcPoison = 0; \
uint8_t poisonNthGranularCrc = 0; \
uint8_t granularCrcStreamoutEnable = 0; \
uint8_t granularCrcStreaminEnable = 0

#define MFX_AVC_SLICE_STATE_EXT \
uint8_t rateControlCounterEnable = 0; \
uint8_t rcTriggleMode = 0; \
uint8_t rcStableTolerance = 0; \
uint8_t rcPanicEnable = 0; \
uint8_t mbTypeDirectConversionDis = 0; \
uint8_t mbTypeSkipConversionDis = 0; \
uint8_t compressBitstreamOutputDisFlag = 0;\
uint8_t streamID10 = 0; \
uint8_t magnitudeQpMaxNegativeModifier = 0;\
uint8_t magnitudeQpMaxPositiveModifier = 0;\
uint8_t shrinkParamShrinkResistance = 0; \
uint8_t shrinkParamShrinkInit = 0; \
uint8_t growParamGrowResistance = 0; \
uint8_t correct6 = 0; \
uint8_t correct5 = 0; \
uint8_t correct4 = 0; \
uint8_t correct3 = 0; \
uint8_t correct2 = 0; \
uint8_t correct1 = 0

#define MFX_SURFACE_STATE_EXT \
uint8_t variantSurfaceFormatEnable = 0;

#define MFX_PIPE_BUF_ADDR_STATE_EXT \
PMOS_RESOURCE granularCRCStreaminBuffer; \
PMOS_RESOURCE granularCRCStreamoutBuffer;

//!
//! \enum MfxDecoderModeSelect
//! \brief MFX decoder mode select
Expand Down
4 changes: 0 additions & 4 deletions media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_mfx_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include "mhw_impl.h"
#include "mhw_mi_impl.h"

#ifdef IGFX_MFX_INTERFACE_EXT_SUPPORT
#include "mhw_vdbox_mfx_hwcmd_ext.h"
#endif

#define AVC_MPR_ROWSTORE_BASEADDRESS 256
#define AVC_MPR_ROWSTORE_BASEADDRESS_MBAFF 512
#define AVC_IP_ROWSTORE_BASEADDRESS 512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,44 @@ VAStatus DdiDecodeAvc::RenderPicture(
return va;
}

MOS_FORMAT DdiDecodeAvc::GetFormat()
{
DDI_CODEC_FUNC_ENTER;

MOS_FORMAT Format = Format_NV12;
DDI_CODEC_RENDER_TARGET_TABLE *rtTbl = &(m_decodeCtx->RTtbl);
CodechalDecodeParams *decodeParams = &m_decodeCtx->DecodeParams;
CODEC_AVC_PIC_PARAMS *picParams = (CODEC_AVC_PIC_PARAMS *)decodeParams->m_picParams;

uint8_t chromaType = picParams->seq_fields.chroma_format_idc;
uint8_t ucBitDepthLumaMinus8 = picParams->bit_depth_luma_minus8;
uint8_t ucBitDepthChromaMinus8 = picParams->bit_depth_chroma_minus8;

if ((chromaType == avcChromaFormatMono || chromaType == avcChromaFormat420) && rtTbl->pCurrentRT->format == Media_Format_NV12)
{
if (ucBitDepthLumaMinus8 == 0 && ucBitDepthChromaMinus8 == 0)
{
Format = Format_NV12; //420 8 bit
}
}
else if (chromaType == avcChromaFormat420 && rtTbl->pCurrentRT->format == Media_Format_P010)
{
if (ucBitDepthLumaMinus8 == 2 && ucBitDepthChromaMinus8 == 2)
{
Format = Format_P010; //420 10 bit
}
}
else if (chromaType == avcChromaFormat422 && rtTbl->pCurrentRT->format == Media_Format_Y210)
{
if (ucBitDepthLumaMinus8 == 2 && ucBitDepthChromaMinus8 == 2)
{
Format = Format_Y210; // 422 10 bit
}
}

return Format;
}

VAStatus DdiDecodeAvc::SetDecodeParams()
{
DDI_CODEC_FUNC_ENTER;
Expand Down Expand Up @@ -631,6 +669,16 @@ VAStatus DdiDecodeAvc::CodecHalInit(

m_codechalSettings->lumaChromaDepth = CODECHAL_LUMA_CHROMA_DEPTH_8_BITS;

#if VA_CHECK_VERSION(1, 18, 0)
if (m_ddiDecodeAttr->profile == VAProfileH264High10
#if VA_CHECK_VERSION(1, 23, 0)
|| m_ddiDecodeAttr->profile == VAProfileH264High422
#endif
) {
m_codechalSettings->lumaChromaDepth |= CODECHAL_LUMA_CHROMA_DEPTH_10_BITS;
}
#endif

m_codechalSettings->mode = CODECHAL_DECODE_MODE_AVCVLD;
m_codechalSettings->standard = CODECHAL_AVC;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class DdiDecodeAvc : public DdiDecodeBase
VABufferID *buffers,
int32_t numBuffers) override;

virtual MOS_FORMAT GetFormat() override;

virtual VAStatus SetDecodeParams() override;

virtual void ContextInit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ static bool RegisteredH264HighVLD =
static bool RegisteredH264ConstrainedBaselineVLD =
DdiDecodeFactory::
Register<decode::DdiDecodeAvc>(ComponentInfo{VAProfileH264ConstrainedBaseline, VAEntrypointVLD});
#if VA_CHECK_VERSION(1, 18, 0)
static bool RegisteredH264High10VLD =
DdiDecodeFactory::
Register<decode::DdiDecodeAvc>(ComponentInfo{VAProfileH264High10, VAEntrypointVLD});
#endif
#if VA_CHECK_VERSION(1, 23, 0)
static bool RegisteredH264High422VLD =
DdiDecodeFactory::
Register<decode::DdiDecodeAvc>(ComponentInfo{VAProfileH264High422, VAEntrypointVLD});
Comment thread
vcheah marked this conversation as resolved.
#endif
#endif // _AVC_DECODE_SUPPORTED

#if defined (_AV1_DECODE_SUPPORTED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ static const EntrypointMap entrypointMap_VAProfileH264High_Xe3_Lpm_r0
#endif
};

static const EntrypointMap entrypointMap_VAProfileH264High10_Xe3_Lpm_r0
{
#if defined(_AVC_DECODE_SUPPORTED)
{VAEntrypointVLD, &entrypointMap_VAProfileH264High10Dec_Data_Xe3_Lpm_r0},
#endif
};

static const EntrypointMap entrypointMap_VAProfileH264High422_Xe3_Lpm_r0
{
#if defined(_AVC_DECODE_SUPPORTED)
{VAEntrypointVLD, &entrypointMap_VAProfileH264High422Dec_Data_Xe3_Lpm_r0},
#endif
};

static const EntrypointMap entrypointMap_VAProfileH264ConstrainedBaseline_Xe3_Lpm_r0
{
#if defined(_AVC_ENCODE_VDENC_SUPPORTED)
Expand Down Expand Up @@ -391,6 +405,15 @@ static const ProfileMap profileMap_Xe3_Lpm_r0
{VAProfileH264ConstrainedBaseline, &entrypointMap_VAProfileH264ConstrainedBaseline_Xe3_Lpm_r0},
#endif

#if defined(_AVC_DECODE_SUPPORTED)
#if VA_CHECK_VERSION(1, 18, 0)
{VAProfileH264High10, &entrypointMap_VAProfileH264High10_Xe3_Lpm_r0},
#endif
#if VA_CHECK_VERSION(1, 23, 0)
{VAProfileH264High422, &entrypointMap_VAProfileH264High422_Xe3_Lpm_r0},
Comment thread
vcheah marked this conversation as resolved.
#endif
#endif

#if defined(_JPEG_ENCODE_SUPPORTED) || defined(_JPEG_DECODE_SUPPORTED)
{VAProfileJPEGBaseline, &entrypointMap_VAProfileJPEGBaseline_Xe3_Lpm_r0},
#endif
Expand Down Expand Up @@ -453,6 +476,15 @@ static const ProfileMap profileMap_Xe3_Lpm_ext_r0
{VAProfileH264ConstrainedBaseline, &entrypointMap_VAProfileH264ConstrainedBaseline_Xe3_Lpm_r0},
#endif

#if defined(_AVC_DECODE_SUPPORTED)
#if VA_CHECK_VERSION(1, 18, 0)
{VAProfileH264High10, &entrypointMap_VAProfileH264High10_Xe3_Lpm_r0},
#endif
#if VA_CHECK_VERSION(1, 23, 0)
{VAProfileH264High422, &entrypointMap_VAProfileH264High422_Xe3_Lpm_r0},
Comment thread
vcheah marked this conversation as resolved.
#endif
#endif

#if defined(_JPEG_ENCODE_SUPPORTED) || defined(_JPEG_DECODE_SUPPORTED)
{VAProfileJPEGBaseline, &entrypointMap_VAProfileJPEGBaseline_Xe3_Lpm_r0},
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ static ConfigDataList configDataList_VAProfileH264High10_VAEntrypointVLD_Xe3_Lpm
{VA_DEC_SLICE_MODE_BASE, VA_ENCRYPTION_TYPE_NONE, VA_DEC_PROCESSING}
};

static ConfigDataList configDataList_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0 =
{
{VA_DEC_SLICE_MODE_NORMAL, VA_ENCRYPTION_TYPE_NONE, VA_DEC_PROCESSING_NONE},
{VA_DEC_SLICE_MODE_NORMAL, VA_ENCRYPTION_TYPE_NONE, VA_DEC_PROCESSING},
{VA_DEC_SLICE_MODE_BASE, VA_ENCRYPTION_TYPE_NONE, VA_DEC_PROCESSING_NONE},
{VA_DEC_SLICE_MODE_BASE, VA_ENCRYPTION_TYPE_NONE, VA_DEC_PROCESSING}
};

//!
//! \brief Definition for AttribList
//!
Expand Down Expand Up @@ -107,6 +115,18 @@ static const AttribList attribList_VAProfileH264High10_VAEntrypointVLD_Xe3_Lpm_r
{VAConfigAttribCustomRoundingControl, 1},
};

static const AttribList attribList_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0
{
{VAConfigAttribRTFormat, VA_RT_FORMAT_YUV420_10 | VA_RT_FORMAT_YUV422_10 | VA_RT_FORMAT_YUV420_10BPP},
{VAConfigAttribDecSliceMode, VA_DEC_SLICE_MODE_NORMAL | VA_DEC_SLICE_MODE_BASE},
{VAConfigAttribDecProcessing, VA_DEC_PROCESSING},
{VAConfigAttribMaxPictureWidth, CODEC_4K_MAX_PIC_WIDTH},
{VAConfigAttribMaxPictureHeight, CODEC_4K_MAX_PIC_HEIGHT},
{VAConfigAttribEncryption, VA_ATTRIB_NOT_SUPPORTED},
{VAConfigAttribProcessingRate, VA_PROCESSING_RATE_DECODE},
{VAConfigAttribCustomRoundingControl, 1},
};

static const AttribList attribList_VAProfileH264ConstrainedBaseline_VAEntrypointVLD_Xe3_Lpm_r0
{
{VAConfigAttribRTFormat, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV422 | VA_RT_FORMAT_RGB32},
Expand Down Expand Up @@ -166,6 +186,14 @@ static ProfileSurfaceAttribInfo surfaceAttribInfo_VAProfileH264High10_VAEntrypoi
}}}
};

static ProfileSurfaceAttribInfo surfaceAttribInfo_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0 =
{
{VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC_Y210}}},
{VASurfaceAttribMaxWidth, VA_SURFACE_ATTRIB_GETTABLE, {VAGenericValueTypeInteger, {CODEC_4K_MAX_PIC_WIDTH}}},
{VASurfaceAttribMaxHeight, VA_SURFACE_ATTRIB_GETTABLE, {VAGenericValueTypeInteger, {CODEC_4K_MAX_PIC_HEIGHT}}},
{VASurfaceAttribMemoryType, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_SURFACE_ATTRIB_MEM_TYPE_VA| VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2}}}
};

static ProfileSurfaceAttribInfo surfaceAttribInfo_VAProfileH264ConstrainedBaseline_VAEntrypointVLD_Xe3_Lpm_r0 =
{
{VASurfaceAttribPixelFormat, VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE, {VAGenericValueTypeInteger, {VA_FOURCC_NV12}}},
Expand Down Expand Up @@ -211,4 +239,10 @@ static const EntrypointData entrypointMap_VAProfileH264High10Dec_Data_Xe3_Lpm_r0
&surfaceAttribInfo_VAProfileH264High10_VAEntrypointVLD_Xe3_Lpm_r0
};

static const EntrypointData entrypointMap_VAProfileH264High422Dec_Data_Xe3_Lpm_r0
{
&attribList_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0,
&configDataList_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0,
&surfaceAttribInfo_VAProfileH264High422_VAEntrypointVLD_Xe3_Lpm_r0
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ static EntrypointMap entrypointMap_VAProfileNone_Xe3_lpm_r0
{VAEntrypointVideoProc, &entrypointMap_VAProfileNone_Data_Xe3_lpm_r0},
};

#endif
#endif
Loading