blob: a69b6fb0dbb1b1ebf049dbd093ecb6a774ccec31 [file] [log] [blame]
From 3a36cb9ce094dbab76ff6239959d5c73c4c20ea1 Mon Sep 17 00:00:00 2001
From: AlexeiLeonenko <alexei.leonenko@intel.com>
Date: Wed, 25 Nov 2020 22:45:34 +0800
Subject: [PATCH] Fix for flags in PAK_OBJECT_INSERT command
If app_data is split into several payloads for PAK_OBJECT_INSERT
command only last one should be marked as last header/end of slice.
---
.../agnostic/common/codec/hal/codechal_encode_jpeg.cpp | 4 ++--
.../agnostic/gen11/codec/hal/codechal_encode_jpeg_g11.cpp | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/media_driver/agnostic/common/codec/hal/codechal_encode_jpeg.cpp b/media_driver/agnostic/common/codec/hal/codechal_encode_jpeg.cpp
index 031c43e692ac..5c94f7376221 100644
--- a/media_driver/agnostic/common/codec/hal/codechal_encode_jpeg.cpp
+++ b/media_driver/agnostic/common/codec/hal/codechal_encode_jpeg.cpp
@@ -966,8 +966,8 @@ MOS_STATUS CodechalEncodeJpegState::ExecuteSliceLevel()
}
pakInsertObjectParams.dwOffset = 0;
pakInsertObjectParams.dwBitSize = pakInsertObjectParams.pBsBuffer->BufferSize;
- //if full header is included in application data, it will be the last insert headers
- if((appDataCmdSizeResidue == 0) && m_fullHeaderInAppData)
+ //if full header is included in application data, it will be the last header to insert and last chunk of it should be marked with EndOfSlice
+ if((appDataCmdSizeResidue == 0) && m_fullHeaderInAppData && (i == numAppDataCmdsNeeded - 1))
{
pakInsertObjectParams.bLastHeader = true;
pakInsertObjectParams.bEndOfSlice = true;
diff --git a/media_driver/agnostic/gen11/codec/hal/codechal_encode_jpeg_g11.cpp b/media_driver/agnostic/gen11/codec/hal/codechal_encode_jpeg_g11.cpp
index 6195243deb3d..8a8b63da9819 100644
--- a/media_driver/agnostic/gen11/codec/hal/codechal_encode_jpeg_g11.cpp
+++ b/media_driver/agnostic/gen11/codec/hal/codechal_encode_jpeg_g11.cpp
@@ -420,7 +420,8 @@ MOS_STATUS CodechalEncodeJpegStateG11::ExecuteSliceLevel()
}
pakInsertObjectParams.dwOffset = 0;
pakInsertObjectParams.dwBitSize = pakInsertObjectParams.pBsBuffer->BufferSize;
- if((appDataCmdSizeResidue == 0) && m_fullHeaderInAppData)
+ //if full header is included in application data, it will be the last header to insert and last chunk of it should be marked with EndOfSlice
+ if ((appDataCmdSizeResidue == 0) && m_fullHeaderInAppData && (i == numAppDataCmdsNeeded - 1))
{
pakInsertObjectParams.bLastHeader = true;
pakInsertObjectParams.bEndOfSlice = true;
--
2.25.1