Commit 4af07d92 authored by Angie Chiang's avatar Angie Chiang

Fix get_txb_ctx

get_txb_ctx is designed under the condition that ctx is uint8_t
Hence, we cast ctx to uint8_t before further operations

Change-Id: If8423d6e5edd346034cb9631726e930c47bc682b
parent 133733cb
......@@ -329,21 +329,21 @@ static INLINE void get_txb_ctx(BLOCK_SIZE bsize, TX_SIZE tx_size, int plane,
int dc_sign = 0;
for (k = 0; k < tx_size_in_blocks; ++k) {
int sign = a[k] >> COEFF_CONTEXT_BITS;
int sign = ((uint8_t)a[k]) >> COEFF_CONTEXT_BITS;
if (sign == 1)
--dc_sign;
else if (sign == 2)
++dc_sign;
else if (sign != 0)
exit(0);
assert(0);
sign = l[k] >> 6;
sign = ((uint8_t)l[k]) >> COEFF_CONTEXT_BITS;
if (sign == 1)
--dc_sign;
else if (sign == 2)
++dc_sign;
else if (sign != 0)
exit(0);
assert(0);
}
txb_ctx->dc_sign_ctx = get_dc_sign_ctx(dc_sign);
......@@ -351,8 +351,8 @@ static INLINE void get_txb_ctx(BLOCK_SIZE bsize, TX_SIZE tx_size, int plane,
int top = 0;
int left = 0;
for (k = 0; k < tx_size_in_blocks; ++k) {
top = AOMMAX(top, (a[k] & COEFF_CONTEXT_MASK));
left = AOMMAX(left, (l[k] & COEFF_CONTEXT_MASK));
top = AOMMAX(top, ((uint8_t)a[k] & COEFF_CONTEXT_MASK));
left = AOMMAX(left, ((uint8_t)l[k] & COEFF_CONTEXT_MASK));
}
top = AOMMIN(top, 255);
left = AOMMIN(left, 255);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment