Commit 02b3af04 authored by Jingning Han's avatar Jingning Han
Browse files

Refactor tx_size to pixel number in decodeframe.c

Use the table access to retrieve pixel numbers from tx_size.

Change-Id: Ibf392dcfdf80606b6ab972d60550ed75cbe652db
parent 8876a3ac
......@@ -302,11 +302,12 @@ static void inverse_transform_block_inter(MACROBLOCKD *xd, int plane,
dqcoeff[0] = 0;
} else {
if (tx_type == DCT_DCT && tx_size <= TX_16X16 && eob <= 10)
memset(dqcoeff, 0, 4 * (4 << tx_size) * sizeof(dqcoeff[0]));
memset(dqcoeff, 0, 4 * tx_size_1d[tx_size] * sizeof(dqcoeff[0]));
else if (tx_size == TX_32X32 && eob <= 34)
memset(dqcoeff, 0, 256 * sizeof(dqcoeff[0]));
else
memset(dqcoeff, 0, (16 << (tx_size << 1)) * sizeof(dqcoeff[0]));
memset(dqcoeff, 0,
(1 << (tx_size_1d_log2[tx_size] * 2)) * sizeof(dqcoeff[0]));
}
}
}
......@@ -366,11 +367,12 @@ static void inverse_transform_block_intra(MACROBLOCKD *xd, int plane,
dqcoeff[0] = 0;
} else {
if (tx_type == DCT_DCT && tx_size <= TX_16X16 && eob <= 10)
memset(dqcoeff, 0, 4 * (4 << tx_size) * sizeof(dqcoeff[0]));
memset(dqcoeff, 0, 4 * tx_size_1d[tx_size] * sizeof(dqcoeff[0]));
else if (tx_size == TX_32X32 && eob <= 34)
memset(dqcoeff, 0, 256 * sizeof(dqcoeff[0]));
else
memset(dqcoeff, 0, (16 << (tx_size << 1)) * sizeof(dqcoeff[0]));
memset(dqcoeff, 0,
(1 << (tx_size_1d_log2[tx_size] * 2)) * sizeof(dqcoeff[0]));
}
}
}
......
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