Skip to content

Commit

Permalink
[Encode] Fix coverity issues
Browse files Browse the repository at this point in the history
Fix coverity issues.
  • Loading branch information
Bossonor authored and intel-mediadev committed Dec 17, 2024
1 parent 014ee6e commit 2fed5f1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ namespace encode {
PMOS_RESOURCE osResource = nullptr;
uint32_t offset = 0;

m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset));

for (auto i = 0; i < 3; i++) // 64 bit SSE values for luma/ chroma channels need to be copied
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ namespace encode{
//initialize following
MOS_RESOURCE *osResourceInline = nullptr;
uint32_t offsetInline = 0;
m_statusReport->GetAddress(statusReportGlobalCount, osResourceInline, offsetInline);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportGlobalCount, osResourceInline, offsetInline));
offsetInline = m_atomicScratchBuf.operandSetSize * m_atomicScratchBuf.encodeUpdateIndex;
uint32_t zeroValueOffset = offsetInline;
uint32_t operand1Offset = offsetInline + m_atomicScratchBuf.operand1Offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace encode
MediaStatusReport *statusReport = pipeline->GetStatusReportInstance();
MOS_RESOURCE *osResource = nullptr;
uint32_t offset = 0;
statusReport->GetAddress(statusReportSliceReport, osResource, offset);
ENCODE_CHK_STATUS_RETURN(statusReport->GetAddress(statusReportSliceReport, osResource, offset));

uint32_t sizeOfSliceSizesBuffer = MOS_ALIGN_CEIL(CODECHAL_HEVC_MAX_NUM_SLICES_LVL_6 * CODECHAL_CACHELINE_SIZE, CODECHAL_PAGE_SIZE);

Expand Down Expand Up @@ -239,7 +239,7 @@ namespace encode
MOS_RESOURCE *osResource = nullptr;
uint32_t offset = 0;

statusReport->GetAddress(statusReportSliceReport, osResource, offset);
ENCODE_CHK_STATUS_RETURN(statusReport->GetAddress(statusReportSliceReport, osResource, offset));

uint32_t sizeOfSliceSizesBuffer = MOS_ALIGN_CEIL(CODECHAL_HEVC_MAX_NUM_SLICES_LVL_6 * CODECHAL_CACHELINE_SIZE, CODECHAL_PAGE_SIZE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ namespace encode
//initialize following
MOS_RESOURCE *osResourceInline = nullptr;
uint32_t offsetInline = 0;
m_statusReport->GetAddress(statusReportGlobalCount, osResourceInline, offsetInline);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportGlobalCount, osResourceInline, offsetInline));
offsetInline = m_atomicScratchBuf.operandSetSize * m_atomicScratchBuf.encodeUpdateIndex;
uint32_t zeroValueOffset = offsetInline;
uint32_t operand1Offset = offsetInline + m_atomicScratchBuf.operand1Offset;
Expand Down Expand Up @@ -1522,7 +1522,7 @@ MOS_STATUS HevcVdencPkt::AddAllCmds_HCP_PAK_INSERT_OBJECT_BRC(PMOS_COMMAND_BUFFE
auto mmioRegisters = m_hcpItf->GetMmioRegisters(m_vdboxIndex);
MOS_RESOURCE *osResource = nullptr;
uint32_t offset = 0;
m_statusReport->GetAddress(statusReportImageStatusCtrl, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportImageStatusCtrl, osResource, offset));
//uint32_t baseOffset = (m_encodeStatusBuf.wCurrIndex * m_encodeStatusBuf.dwReportSize) + sizeof(uint32_t) * 2; // encodeStatus is offset by 2 DWs in the resource

// Write back the HCP image control register for RC6 may clean it out
Expand Down Expand Up @@ -1835,7 +1835,7 @@ MOS_STATUS HevcVdencPkt::AddAllCmds_HCP_PAK_INSERT_OBJECT_BRC(PMOS_COMMAND_BUFFE
PMOS_RESOURCE osResource = nullptr;
uint32_t offset = 0;

m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset));

for (auto i = 0; i < 3; i++) // 64 bit SSE values for luma/ chroma channels need to be copied
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ namespace encode
PMOS_RESOURCE osResource = nullptr;
uint32_t offset = 0;

m_statusReport->GetAddress(statusReportLpla, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportLpla, osResource, offset));

RUN_FEATURE_INTERFACE_RETURN(VdencLplaAnalysis, HevcFeatureIDs::vdencLplaAnalysisFeature, ReadLPLAData, commandBuffer, osResource, offset);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ namespace encode {
EncodeReadBrcPakStatsParams readBrcPakStatsParams;
MOS_RESOURCE *osResource = nullptr;
uint32_t offset = 0;
m_statusReport->GetAddress(statusReportNumberPasses, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportNumberPasses, osResource, offset));
RUN_FEATURE_INTERFACE_RETURN(HEVCEncodeBRC, HevcFeatureIDs::hevcBrcFeature, SetReadBrcPakStatsParams, ucPass, offset, osResource, readBrcPakStatsParams);
ReadBrcPakStatistics(cmdBuffer, &readBrcPakStatsParams);
}
Expand Down Expand Up @@ -585,7 +585,7 @@ namespace encode {
PMOS_RESOURCE osResource = nullptr;
uint32_t offset = 0;

m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportSumSquareError, osResource, offset));

for (auto i = 0; i < 3; i++) // 64 bit SSE values for luma/ chroma channels need to be copied
{
Expand Down Expand Up @@ -1112,7 +1112,7 @@ namespace encode {
miStoreRegMemParams.dwRegister = mmioRegisters->hcpEncImageStatusCtrlRegOffset;
ENCODE_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_STORE_REGISTER_MEM)(&cmdBuffer));

m_statusReport->GetAddress(statusReportImageStatusCtrlOfLastBRCPass, osResource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportImageStatusCtrlOfLastBRCPass, osResource, offset));
miStoreRegMemParams = {};
miStoreRegMemParams.presStoreBuffer = osResource;
miStoreRegMemParams.dwOffset = offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ MOS_STATUS EncodeScalabilityMultiPipe::SendAttrWithFrameTracking(

if (frameTrackingRequested && m_frameTrackingEnabled)
{
m_statusReport->GetAddress(encode::statusReportGlobalCount, resource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(encode::statusReportGlobalCount, resource, offset));
cmdBuffer.Attributes.bEnableMediaFrameTracking = true;
cmdBuffer.Attributes.resMediaFrameTrackingSurface = resource;
cmdBuffer.Attributes.dwMediaFrameTrackingTag = m_statusReport->GetSubmittedCount() + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ MOS_STATUS EncodeScalabilitySinglePipe::SendAttrWithFrameTracking(

if (frameTrackingRequested && m_frameTrackingEnabled)
{
m_statusReport->GetAddress(encode::statusReportGlobalCount, resource, offset);
ENCODE_CHK_STATUS_RETURN(m_statusReport->GetAddress(encode::statusReportGlobalCount, resource, offset));
cmdBuffer.Attributes.bEnableMediaFrameTracking = true;
cmdBuffer.Attributes.resMediaFrameTrackingSurface = resource;
cmdBuffer.Attributes.dwMediaFrameTrackingTag = m_statusReport->GetSubmittedCount() + 1;
Expand Down

0 comments on commit 2fed5f1

Please sign in to comment.