Skip to content

Commit

Permalink
[Decode] Enable AV1 VDSFC for BMG Linux
Browse files Browse the repository at this point in the history
Add SFC downsampling and CSC support in AV1 decode DDI for Linux
  • Loading branch information
hayden-sun authored and intel-mediadev committed Dec 21, 2023
1 parent 949b367 commit de0144a
Showing 1 changed file with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,9 @@ VAStatus DdiDecodeAv1::RenderPicture(
DDI_CHK_RET(ParsePicParams(mediaCtx, picParam), "ParsePicParams failed!");
break;
}

case VAProcPipelineParameterBufferType:
{
DDI_CODEC_NORMALMESSAGE("ProcPipeline is not supported for AV1 decoding\n");
DDI_CHK_RET(ParseProcessingBuffer(mediaCtx, data),"ParseProcessingBuffer failed!");
break;
}
case VADecodeStreamoutBufferType:
Expand Down Expand Up @@ -838,6 +837,31 @@ VAStatus DdiDecodeAv1::CodecHalInit(
return vaStatus;
}

#ifdef _DECODE_PROCESSING_SUPPORTED
if (m_decProcessingType == VA_DEC_PROCESSING)
{
DecodeProcessingParams *procParams = nullptr;

m_codechalSettings->downsamplingHinted = true;

procParams = (DecodeProcessingParams *)MOS_AllocAndZeroMemory(sizeof(DecodeProcessingParams));
if (procParams == nullptr)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
FreeResource();
return vaStatus;
}

m_decodeCtx->DecodeParams.m_procParams = procParams;
procParams->m_outputSurface = (PMOS_SURFACE)MOS_AllocAndZeroMemory(sizeof(MOS_SURFACE));
if (procParams->m_outputSurface == nullptr)
{
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
FreeResource();
return vaStatus;
}
}
#endif
vaStatus = CreateCodecHal(mediaCtx,
ptr,
&standardInfo);
Expand Down Expand Up @@ -876,6 +900,15 @@ void DdiDecodeAv1::FreeResource()
MOS_FreeMemory(m_decodeCtx->DecodeParams.m_sliceParams);
m_decodeCtx->DecodeParams.m_sliceParams = nullptr;

#ifdef _DECODE_PROCESSING_SUPPORTED
if (m_decodeCtx->DecodeParams.m_procParams)
{
auto procParams = (DecodeProcessingParams *)m_decodeCtx->DecodeParams.m_procParams;
MOS_FreeMemory(procParams->m_outputSurface);

MOS_FreeMemory(m_decodeCtx->DecodeParams.m_procParams);
}
#endif
return;
}

Expand Down

0 comments on commit de0144a

Please sign in to comment.