Skip to content

Commit

Permalink
change the mb address value to the real MB address
Browse files Browse the repository at this point in the history
following VAAPI definition. #fix issue intel#82

Signed-off-by: XinfengZhang <carl.zhang@intel.com>
  • Loading branch information
XinfengZhang committed Jan 23, 2018
1 parent 90eadc3 commit b9e7b3a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,14 @@ VAStatus DdiEncodeMpeg2::ParseSlcParams(
//attention memory area protection
MOS_ZeroMemory(mpeg2SlcParams, sizeof(CodecEncodeMpeg2SliceParmas) * numSlices);

CodecEncodeMpeg2SequenceParams *mpeg2Sps = (CodecEncodeMpeg2SequenceParams *)m_encodeCtx->pSeqParams;
auto picWidthInMb = CODECHAL_GET_WIDTH_IN_MACROBLOCKS(mpeg2Sps->m_frameWidth);

for (uint32_t slcCount = 0; slcCount < numSlices; slcCount++)
{
mpeg2SlcParams->m_numMbsForSlice = vaEncSlcParamsMPEG2->num_macroblocks;
mpeg2SlcParams->m_firstMbX = (vaEncSlcParamsMPEG2->macroblock_address >> 16) & 0xFF;
mpeg2SlcParams->m_firstMbY = vaEncSlcParamsMPEG2->macroblock_address & 0xFF;
mpeg2SlcParams->m_firstMbX = (vaEncSlcParamsMPEG2->macroblock_address % picWidthInMb);
mpeg2SlcParams->m_firstMbY = vaEncSlcParamsMPEG2->macroblock_address / picWidthInMb;
mpeg2SlcParams->m_intraSlice = vaEncSlcParamsMPEG2->is_intra_slice;
mpeg2SlcParams->m_quantiserScaleCode = vaEncSlcParamsMPEG2->quantiser_scale_code;
mpeg2SlcParams++;
Expand Down

0 comments on commit b9e7b3a

Please sign in to comment.