diff --git a/media_driver/agnostic/gen8/codec/hal/codechal_fei_avc_g8.cpp b/media_driver/agnostic/gen8/codec/hal/codechal_fei_avc_g8.cpp index d2cb0ab38bf..14f3c13715a 100644 --- a/media_driver/agnostic/gen8/codec/hal/codechal_fei_avc_g8.cpp +++ b/media_driver/agnostic/gen8/codec/hal/codechal_fei_avc_g8.cpp @@ -6196,7 +6196,6 @@ MOS_STATUS CodechalEncodeAvcEncFeiG8::SendAvcMbEncSurfaces(PMOS_COMMAND_BUFFER c // FEI distortion surface if (feiPicParams->DistortionEnable) { - size = params->dwFrameWidthInMb * params->dwFrameFieldHeightInMb * 48; MOS_ZeroMemory(&surfaceCodecParams, sizeof(CODECHAL_SURFACE_CODEC_PARAMS)); surfaceCodecParams.presBuffer = &(feiPicParams->resDistortion); surfaceCodecParams.dwOffset = 0; @@ -6225,7 +6224,6 @@ MOS_STATUS CodechalEncodeAvcEncFeiG8::SendAvcMbEncSurfaces(PMOS_COMMAND_BUFFER c &surfaceCodecParams, kernelState)); - size = params->dwFrameWidthInMb * params->dwFrameFieldHeightInMb + 3; MOS_ZeroMemory(&surfaceCodecParams, sizeof(CODECHAL_SURFACE_CODEC_PARAMS)); surfaceCodecParams.presBuffer = &(feiPicParams->resMBQp); surfaceCodecParams.dwOffset = 0; diff --git a/media_driver/agnostic/gen9/codec/hal/codechal_fei_avc_g9.cpp b/media_driver/agnostic/gen9/codec/hal/codechal_fei_avc_g9.cpp index 03c6c676d7c..bd00b036a53 100644 --- a/media_driver/agnostic/gen9/codec/hal/codechal_fei_avc_g9.cpp +++ b/media_driver/agnostic/gen9/codec/hal/codechal_fei_avc_g9.cpp @@ -6198,7 +6198,6 @@ MOS_STATUS CodechalEncodeAvcEncFeiG9::SendAvcMbEncSurfaces(PMOS_COMMAND_BUFFER c // FEI distortion surface if (feiPicParams->DistortionEnable) { - size = params->dwFrameWidthInMb * params->dwFrameFieldHeightInMb * 48; MOS_ZeroMemory(&surfaceCodecParams, sizeof(CODECHAL_SURFACE_CODEC_PARAMS)); surfaceCodecParams.presBuffer = &(feiPicParams->resDistortion); surfaceCodecParams.dwOffset = 0; @@ -6227,7 +6226,6 @@ MOS_STATUS CodechalEncodeAvcEncFeiG9::SendAvcMbEncSurfaces(PMOS_COMMAND_BUFFER c &surfaceCodecParams, kernelState)); - size = params->dwFrameWidthInMb * params->dwFrameFieldHeightInMb + 3; MOS_ZeroMemory(&surfaceCodecParams, sizeof(CODECHAL_SURFACE_CODEC_PARAMS)); surfaceCodecParams.presBuffer = &(feiPicParams->resMBQp); surfaceCodecParams.dwOffset = 0; diff --git a/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_basic_feature.cpp b/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_basic_feature.cpp index 92ad37cc13d..d853178f5e4 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_basic_feature.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_basic_feature.cpp @@ -1321,7 +1321,6 @@ MHW_SETPAR_DECL_SRC(HEVC_VP9_RDOQ_STATE, HevcBasicFeature) lambdaDouble *= MOS_MAX(1.00, MOS_MIN(1.6, 1.0 + 0.6 / 12.0 * (qpTemp - 10.0))); lambdaDouble = lambdaDouble * 16 + 0.5; lambda = (uint32_t)floor(lambdaDouble); - lambdaDouble = (lambdaDouble > 65535) ? 65535 : lambdaDouble; lambda = CodecHal_Clip3(0, 0xffff, lambda); params.lambdaTab[1][0][qp] = (uint16_t)lambda; } @@ -1332,7 +1331,6 @@ MHW_SETPAR_DECL_SRC(HEVC_VP9_RDOQ_STATE, HevcBasicFeature) lambdaDouble *= MOS_MAX(0.95, MOS_MIN(1.20, 0.25 / 12.0 * (qpTemp - 10.0) + 0.95)); lambdaDouble = lambdaDouble * 16 + 0.5; lambda = (uint32_t)floor(lambdaDouble); - lambdaDouble = (lambdaDouble > 65535) ? 65535 : lambdaDouble; lambda = CodecHal_Clip3(0, 0xffff, lambda); params.lambdaTab[1][1][qp] = (uint16_t)lambda; } diff --git a/media_softlet/agnostic/common/codec/hal/enc/shared/features/encode_preenc_basic_feature.cpp b/media_softlet/agnostic/common/codec/hal/enc/shared/features/encode_preenc_basic_feature.cpp index 4a4ad61f765..3e6c8491706 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/shared/features/encode_preenc_basic_feature.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/shared/features/encode_preenc_basic_feature.cpp @@ -1043,7 +1043,6 @@ MHW_SETPAR_DECL_SRC(HEVC_VP9_RDOQ_STATE, PreEncBasicFeature) lambdaDouble *= MOS_MAX(1.00, MOS_MIN(1.6, 1.0 + 0.6 / 12.0 * (qpTemp - 10.0))); lambdaDouble = lambdaDouble * 16 + 0.5; lambda = (uint32_t)floor(lambdaDouble); - lambdaDouble = (lambdaDouble > 65535) ? 65535 : lambdaDouble; lambda = CodecHal_Clip3(0, 0xffff, lambda); params.lambdaTab[1][0][qp] = (uint16_t)lambda; } @@ -1054,7 +1053,6 @@ MHW_SETPAR_DECL_SRC(HEVC_VP9_RDOQ_STATE, PreEncBasicFeature) lambdaDouble *= MOS_MAX(0.95, MOS_MIN(1.20, 0.25 / 12.0 * (qpTemp - 10.0) + 0.95)); lambdaDouble = lambdaDouble * 16 + 0.5; lambda = (uint32_t)floor(lambdaDouble); - lambdaDouble = (lambdaDouble > 65535) ? 65535 : lambdaDouble; lambda = CodecHal_Clip3(0, 0xffff, lambda); params.lambdaTab[1][1][qp] = (uint16_t)lambda; } diff --git a/media_softlet/agnostic/common/codec/hal/enc/shared/packet/encode_packet_utilities.cpp b/media_softlet/agnostic/common/codec/hal/enc/shared/packet/encode_packet_utilities.cpp index 1fe0833f2e1..214ff7192e1 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/shared/packet/encode_packet_utilities.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/shared/packet/encode_packet_utilities.cpp @@ -138,7 +138,7 @@ namespace encode { params.dwResourceOffset = 0; //sizeof(uint64_t); params.postSyncOperation = MHW_FLUSH_WRITE_TIMESTAMP_REG; params.bQWordEnable = 1; - m_miItf->MHW_ADDCMD_F(MI_FLUSH_DW)(cmdBuffer); + ENCODE_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_FLUSH_DW)(cmdBuffer)); return MOS_STATUS_SUCCESS; } 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 bae2c945a68..7d61238d201 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 @@ -377,7 +377,6 @@ MOS_STATUS Vp9EncodeTile::SetTileData(void *params) cuLevelStreamoutOffset += (m_tileData[idx].tileWidthInMinCbMinus1 + 1) * (m_tileData[idx].tileHeightInMinCbMinus1 + 1); sliceSizeStreamoutOffset += (m_tileData[idx].tileWidthInMinCbMinus1 + 1) * (m_tileData[idx].tileHeightInMinCbMinus1 + 1); - sseRowstoreOffset += (numLcuInTile * basicFeature->m_sizeOfSseSrcPixelRowStoreBufferPerLcu) / CODECHAL_CACHELINE_SIZE; bitstreamByteOffset += bitstreamSizePerTile; numLcusInTiles += numLcuInTile;