Commit 2a91ab7e authored by Yaowu Xu's avatar Yaowu Xu

Avoid left shift of negative numbers

Change-Id: I21f956a83687ebaeab81577aabdbfed2ea2b4dd2
parent f452fdfe
......@@ -245,7 +245,8 @@ static void cfl_subtract_averages(CFL_CTX *cfl, TX_SIZE tx_size) {
}
int avg_q3 = (sum_q3 + (1 << (num_pel_log2 - 1))) >> num_pel_log2;
// Loss is never more than 1/2 (in Q3)
assert(abs((avg_q3 << num_pel_log2) - sum_q3) <= 1 << num_pel_log2 >> 1);
assert(abs((avg_q3 * (1 << num_pel_log2)) - sum_q3) <=
1 << num_pel_log2 >> 1);
tx_pred_buf_q3 = pred_buf_q3;
for (int t_j = 0; t_j < tx_height; t_j++) {
......
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