Skip to content

Commit

Permalink
fix vp8 decode issue intel#190, change the first partition size
Browse files Browse the repository at this point in the history
when the count in VABoolCoderContextVPX is zero, actually it means there are 8 bit in bool coder

correct first partition_size,when there is 8 bits in bool coder

Signed-off-by: XinfengZhang <carl.zhang@intel.com>
  • Loading branch information
XinfengZhang committed Jul 18, 2018
1 parent 1c24545 commit 1f6553f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions media_driver/linux/common/codec/ddi/media_ddi_decode_vp8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ VAStatus DdiDecodeVP8::ParseSliceParams(
picParams->CodedCoeffTokenPartition = (num_token_partitions != 8) ? (num_token_partitions >> 1) : 3;
//macroblock_offset is in unit of bit.it should be always the next byte, the byte is divided to two parts
//used bits and remaining bits, if used bits == 8, uiFirstMbByteOffset should add 1, so use 8 to do the ceil operator
picParams->uiFirstMbByteOffset = slcParam->slice_data_offset + ((slcParam->macroblock_offset + 8) >> 3);
picParams->uiFirstMbByteOffset = slcParam->slice_data_offset + ((slcParam->macroblock_offset + 7) >> 3);

memcpy_s(picParams->uiPartitionSize, sizeof(picParams->uiPartitionSize), slcParam->partition_size, sizeof(picParams->uiPartitionSize));

//partition 0 size in command buffer includes the one byte in bool decoder if remaining bits of bool decoder is not zero.
picParams->uiPartitionSize[0] += (slcParam->macroblock_offset & 0x7) ? 1 : 0;
//bool coder count should be 0-7, if it is 0 (ucP0EntropyCount == 0), actually it means there are 8 bit is loaded in bool coder.
if(picParams->ucP0EntropyCount == 0)
{
picParams->uiFirstMbByteOffset += 1;
picParams->uiPartitionSize[0] -= 1;
}

return VA_STATUS_SUCCESS;
}
Expand Down

0 comments on commit 1f6553f

Please sign in to comment.