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

[Decode] Optimize error syntax check for hevc #1744

Merged
merged 1 commit into from
Dec 7, 2023
Merged
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 @@ -387,6 +387,11 @@ MOS_STATUS HevcBasicFeature::NumEntryPointOffsetsCheck(uint32_t sliceIdx)
return MOS_STATUS_SUCCESS;
}

/**
* This is potential issue that may cause output corruption with incorrect referece;
* And it has error concealment in hcp ref idx state setting by ignoring invalid reference.
* We should avoid stopping playback by giving an error return here.
*/
MOS_STATUS HevcBasicFeature::ReferenceParamCheck(uint32_t sliceIdx)
{
DECODE_FUNC_CALL();
Expand All @@ -397,14 +402,14 @@ MOS_STATUS HevcBasicFeature::ReferenceParamCheck(uint32_t sliceIdx)
if (m_hevcSliceParams[sliceIdx].num_ref_idx_l0_active_minus1 >= CODEC_MAX_NUM_REF_FRAME_HEVC )
{
DECODE_ASSERTMESSAGE("num_ref_idx_l0_active_minus1 %d is out of range [0, 14]\n", m_hevcSliceParams[sliceIdx].num_ref_idx_l0_active_minus1);
return MOS_STATUS_INVALID_PARAMETER;
m_hevcSliceParams[sliceIdx].num_ref_idx_l0_active_minus1 = 0;
}
if (decodeHevcBSlice == m_hevcSliceParams[sliceIdx].LongSliceFlags.fields.slice_type)
{
if (m_hevcSliceParams[sliceIdx].num_ref_idx_l1_active_minus1 >= CODEC_MAX_NUM_REF_FRAME_HEVC)
{
DECODE_ASSERTMESSAGE("num_ref_idx_l1_active_minus1 %d is out of range [0, 14]\n", m_hevcSliceParams[sliceIdx].num_ref_idx_l1_active_minus1);
return MOS_STATUS_INVALID_PARAMETER;
m_hevcSliceParams[sliceIdx].num_ref_idx_l1_active_minus1 = 0;
}
}
}
Expand Down Expand Up @@ -447,7 +452,6 @@ MOS_STATUS HevcBasicFeature::ReferenceParamCheck(uint32_t sliceIdx)
{
DECODE_ASSERTMESSAGE("num_ref_idx_active_minus1[%d] = %d, RefPicList[%d].FrameIdx is all 127\n",
listIdx, num_ref_idx_active_minus1[listIdx], listIdx);
return MOS_STATUS_INVALID_PARAMETER;
}
}
return MOS_STATUS_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@ MOS_STATUS HevcReferenceFrames::UpdateCurRefList(const CODEC_HEVC_PIC_PARAMS & p

if ((refCurrIndex == picParams.CurrPic.FrameIdx) || (refBeforeIndex == picParams.CurrPic.FrameIdx) || (refAfterIndex == picParams.CurrPic.FrameIdx))
{
return MOS_STATUS_INVALID_PARAMETER;
DECODE_ASSERTMESSAGE("Invalid refFrame index: refCurrIndex: %d, refBeforeIndex: %d, refAfterIndex: %d, currPic frameInx: %d\n",
refCurrIndex, refBeforeIndex, refAfterIndex, picParams.CurrPic.FrameIdx);

/**
*This is potential issue that may cause output curruption by refering to destsurface; But should avoid stopping playback by giving an error return here.
//return MOS_STATUS_INVALID_PARAMETER;
*/
}
}
}
Expand Down
Loading