summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/i965_decoder_utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c
index 6326796..98e931a 100644
--- a/src/i965_decoder_utils.c
+++ b/src/i965_decoder_utils.c
@@ -196,7 +196,7 @@ avc_get_first_mb_bit_offset_with_epb(
{
unsigned int in_slice_data_bit_offset = slice_param->slice_data_bit_offset;
unsigned int out_slice_data_bit_offset;
- unsigned int i, j, buf_size, data_size, header_size;
+ unsigned int i, j, n, buf_size, data_size, header_size;
uint8_t *buf;
int ret;
@@ -213,11 +213,11 @@ avc_get_first_mb_bit_offset_with_epb(
);
assert(ret == 0);
- for (i = 2, j = 2; i < buf_size && j < header_size; i++, j++) {
+ for (i = 2, j = 2, n = 0; i < buf_size && j < header_size; i++, j++) {
if (buf[i] == 0x03 && buf[i - 1] == 0x00 && buf[i - 2] == 0x00)
- i += 2, j++;
+ i += 2, j++, n++;
}
- out_slice_data_bit_offset = in_slice_data_bit_offset % 8 + i * 8;
+ out_slice_data_bit_offset = in_slice_data_bit_offset + n * 8;
if (mode_flag == ENTROPY_CABAC)
out_slice_data_bit_offset = ALIGN(out_slice_data_bit_offset, 0x8);