diff --git a/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_m_base.cpp b/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_m_base.cpp index 9d2bc6be16c..464023168d5 100644 --- a/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_m_base.cpp +++ b/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_m_base.cpp @@ -251,7 +251,7 @@ namespace encode auto brcFeature = dynamic_cast(m_featureManager->GetFeature(Av1FeatureIDs::av1BrcFeature)); ENCODE_CHK_NULL_RETURN(brcFeature); auto vdenc2ndLevelBatchBuffer = brcFeature->GetVdenc2ndLevelBatchBuffer(m_pipeline->m_currRecycledBufIdx); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); //AV1 Tile Commands //set up VD_CONTROL_STATE command diff --git a/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_lpm.cpp b/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_lpm.cpp index 9ced071b0b8..f38f4f18de6 100644 --- a/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_lpm.cpp +++ b/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_lpm.cpp @@ -111,7 +111,7 @@ MOS_STATUS Av1VdencPktXe2_Lpm::AddOneTileCommands( auto brcFeature = dynamic_cast(m_featureManager->GetFeature(Av1FeatureIDs::av1BrcFeature)); ENCODE_CHK_NULL_RETURN(brcFeature); auto vdenc2ndLevelBatchBuffer = brcFeature->GetVdenc2ndLevelBatchBuffer(m_pipeline->m_currRecycledBufIdx); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); ENCODE_CHK_STATUS_RETURN(AddAllCmds_AVP_PIPE_MODE_SELECT(tempCmdBuffer)); ENCODE_CHK_STATUS_RETURN(AddAllCmds_AVP_SURFACE_STATE(tempCmdBuffer)); diff --git a/media_softlet/agnostic/Xe_M_plus/Xe2_HPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_hpm.cpp b/media_softlet/agnostic/Xe_M_plus/Xe2_HPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_hpm.cpp index 7d9f63feedc..d563867918f 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe2_HPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_hpm.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe2_HPM/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe2_hpm.cpp @@ -111,7 +111,7 @@ MOS_STATUS Av1VdencPktXe2_Hpm::AddOneTileCommands( auto brcFeature = dynamic_cast(m_featureManager->GetFeature(Av1FeatureIDs::av1BrcFeature)); ENCODE_CHK_NULL_RETURN(brcFeature); auto vdenc2ndLevelBatchBuffer = brcFeature->GetVdenc2ndLevelBatchBuffer(m_pipeline->m_currRecycledBufIdx); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); ENCODE_CHK_STATUS_RETURN(AddAllCmds_AVP_PIPE_MODE_SELECT(tempCmdBuffer)); ENCODE_CHK_STATUS_RETURN(AddAllCmds_AVP_SURFACE_STATE(tempCmdBuffer)); diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_lpm_plus_base.cpp b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_lpm_plus_base.cpp index 62ee1b647f2..3ec4723ab8d 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_lpm_plus_base.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/av1/packet/encode_av1_vdenc_packet_xe_lpm_plus_base.cpp @@ -374,7 +374,7 @@ MOS_STATUS Av1VdencPktXe_Lpm_Plus_Base::AddOneTileCommands( auto brcFeature = dynamic_cast(m_featureManager->GetFeature(Av1FeatureIDs::av1BrcFeature)); ENCODE_CHK_NULL_RETURN(brcFeature); auto vdenc2ndLevelBatchBuffer = brcFeature->GetVdenc2ndLevelBatchBuffer(m_pipeline->m_currRecycledBufIdx); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); ENCODE_CHK_STATUS_RETURN(AddAllCmds_AVP_PIPE_MODE_SELECT(tempCmdBuffer)); diff --git a/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp b/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp index d41c8aaab94..48b23ee5224 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp @@ -1409,7 +1409,7 @@ namespace encode{ ENCODE_CHK_NULL_RETURN(pakInsertOutputBatchBuffer); // send pak insert obj cmds after back annotation ENCODE_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_BATCH_BUFFER_START)(cmdBuffer, pakInsertOutputBatchBuffer)); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); HalOcaInterfaceNext::OnSubLevelBBStart( *cmdBuffer, m_osInterface->pOsContext, @@ -1923,7 +1923,7 @@ namespace encode{ auto brcFeature = dynamic_cast(m_featureManager->GetFeature(Av1FeatureIDs::av1BrcFeature)); ENCODE_CHK_NULL_RETURN(brcFeature); auto vdenc2ndLevelBatchBuffer = brcFeature->GetVdenc2ndLevelBatchBuffer(m_pipeline->m_currRecycledBufIdx); - auto slbbData = brcFeature->GetSLBData(); + const auto &slbbData = brcFeature->GetSLBData(); //qp uint32_t qpOffset = resourceOffset.dwMetaDataSize + tileNum * resourceOffset.dwMetaDataSubRegionSize + resourceOffset.dwTilePartitionSize + AV1ResourceOffset.dwQuantization + AV1ResourceOffset.dwBaseQIndex; diff --git a/media_softlet/agnostic/common/codec/hal/enc/vp9/features/encode_vp9_tile.cpp b/media_softlet/agnostic/common/codec/hal/enc/vp9/features/encode_vp9_tile.cpp index 7fc271cb027..f6176e65d0a 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/vp9/features/encode_vp9_tile.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/vp9/features/encode_vp9_tile.cpp @@ -515,7 +515,7 @@ MHW_SETPAR_DECL_SRC(HCP_TILE_CODING, Vp9EncodeTile) { ENCODE_FUNC_CALL(); - auto tileCodingParams = m_curTileCodingParams; + const auto &tileCodingParams = m_curTileCodingParams; params.numberOfActiveBePipes = tileCodingParams.NumberOfActiveBePipes; params.numOfTileColumnsInFrame = tileCodingParams.NumOfTileColumnsInFrame; @@ -660,7 +660,7 @@ MHW_SETPAR_DECL_SRC(VDENC_HEVC_VP9_TILE_SLICE_STATE, Vp9EncodeTile) ENCODE_CHK_NULL_RETURN(vp9BasicFeature); auto picParams = vp9BasicFeature->m_vp9PicParams; ENCODE_CHK_NULL_RETURN(picParams); - auto tileCodingParams = m_curTileCodingParams; + const auto &tileCodingParams = m_curTileCodingParams; params.ctbSize = CODEC_VP9_SUPER_BLOCK_WIDTH; if (!m_enabled) @@ -706,7 +706,7 @@ MHW_SETPAR_DECL_SRC(VDENC_WALKER_STATE, Vp9EncodeTile) ENCODE_CHK_NULL_RETURN(vp9BasicFeature); auto picParams = vp9BasicFeature->m_vp9PicParams; ENCODE_CHK_NULL_RETURN(picParams); - auto tileCodingParams = m_curTileCodingParams; + const auto &tileCodingParams = m_curTileCodingParams; if (!m_enabled) { diff --git a/media_softlet/agnostic/common/codec/hal/enc/vp9/packet/encode_vp9_hpu_packet.cpp b/media_softlet/agnostic/common/codec/hal/enc/vp9/packet/encode_vp9_hpu_packet.cpp index 2f09f73fac7..e245c2f4961 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/vp9/packet/encode_vp9_hpu_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/vp9/packet/encode_vp9_hpu_packet.cpp @@ -386,7 +386,7 @@ MOS_STATUS Vp9HpuPkt::PatchHucProbCommands(MOS_COMMAND_BUFFER *commandBuffer, ui params.resBitstreamByteCountPerFrame = osResource; params.bitstreamByteCountPerFrameOffset = offset; - auto virtualAddrParams = m_hucItf->MHW_GETPAR_F(HUC_VIRTUAL_ADDR_STATE)(); + const auto &virtualAddrParams = m_hucItf->MHW_GETPAR_F(HUC_VIRTUAL_ADDR_STATE)(); auto ©MemMemParams = m_miItf->MHW_GETPAR_F(MI_COPY_MEM_MEM)(); copyMemMemParams = {}; copyMemMemParams.presSrc = virtualAddrParams.regionParams[11].presRegion; diff --git a/media_softlet/agnostic/common/os/mos_utilities_next.cpp b/media_softlet/agnostic/common/os/mos_utilities_next.cpp index ec780d9c713..b2eea5a8eac 100644 --- a/media_softlet/agnostic/common/os/mos_utilities_next.cpp +++ b/media_softlet/agnostic/common/os/mos_utilities_next.cpp @@ -935,7 +935,7 @@ void PerfUtility::getPerfInfo(std::vector& record, PerfInfo* info) info->count = (uint32_t)record.size(); double sum = 0, max = 0, min = 10000000.0; - for (auto t : record) + for (const auto &t : record) { sum += t.time; max = (max < t.time) ? t.time : max; diff --git a/media_softlet/agnostic/common/shared/task/media_cmd_task.cpp b/media_softlet/agnostic/common/shared/task/media_cmd_task.cpp index 92a9ce5d8f9..c6bf3634c4a 100644 --- a/media_softlet/agnostic/common/shared/task/media_cmd_task.cpp +++ b/media_softlet/agnostic/common/shared/task/media_cmd_task.cpp @@ -48,7 +48,7 @@ MOS_STATUS CmdTask::CalculateCmdBufferSizeFromActivePackets() m_cmdBufSize = 0; m_patchListSize = 0; - for (auto prop : m_packets) + for (const auto &prop : m_packets) { // Calculate total size based on pipe 0 if (prop.stateProperty.currentPipe == 0) diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp index c03eab72fcd..1b7736700a6 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp @@ -522,7 +522,7 @@ MOS_STATUS VpRenderHdr3DLutKernelCM::GetCurbeState(void *&curbe, uint32_t &curbe { VP_FUNC_CALL(); curbeLength = 0; - for (auto arg : m_kernelArgs) + for (const auto &arg : m_kernelArgs) { curbeLength += arg.uSize; } diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hvs_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hvs_kernel.cpp index bdf97b500b1..417d59c5bab 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hvs_kernel.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hvs_kernel.cpp @@ -257,7 +257,7 @@ MOS_STATUS VpRenderHVSKernel::GetCurbeState(void *&curbe, uint32_t &curbeLength) { VP_FUNC_CALL(); curbeLength = 0; - for (auto arg : m_kernelArgs) + for (const auto &arg : m_kernelArgs) { curbeLength += arg.uSize; } @@ -307,7 +307,7 @@ MOS_STATUS VpRenderHVSKernel::SetupSurfaceState() PMOS_INTERFACE osInterface = m_hwInterface->m_osInterface; m_surfaceBindingIndex.clear(); m_surfaceState.clear(); - for (auto arg : m_kernelArgs) + for (const auto &arg : m_kernelArgs) { VP_RENDER_CHK_NULL_RETURN(arg.pData); diff --git a/media_softlet/linux/common/ddi/media_capstable_specific.cpp b/media_softlet/linux/common/ddi/media_capstable_specific.cpp index 59ea4cafa45..6860a980b01 100644 --- a/media_softlet/linux/common/ddi/media_capstable_specific.cpp +++ b/media_softlet/linux/common/ddi/media_capstable_specific.cpp @@ -229,7 +229,7 @@ VAStatus MediaCapsTableSpecific::CreateConfig( DDI_UNUSED(configId); VAStatus ret = VA_STATUS_ERROR_UNSUPPORTED_PROFILE; - for (auto configItem : m_configList) + for (const auto &configItem : m_configList) { // check profile, entrypoint here if (configItem.profile == profile)