Commit 75ae90f7 authored by Angie Chiang's avatar Angie Chiang

Pass tx_type into get_tx_scale

Change-Id: I8a8df9fdefa492f66cf2cd29b0b081ad69b5d85e
parent c7c40d23
......@@ -291,7 +291,7 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
token_tab,
#endif // CONFIG_ANS
plane, sc, col, row, tx_size,
r, mbmi->segment_id);
tx_type, r, mbmi->segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size,
dst, pd->dst.stride, eob);
}
......@@ -327,7 +327,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, vpx_reader *r,
const scan_order *sc = get_scan(tx_size, tx_type, 1);
const int eob = vp10_decode_block_tokens(xd, plane, sc,
blk_col, blk_row, tx_size,
r, mbmi->segment_id);
tx_type, r, mbmi->segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size,
&pd->dst.buf[4 * blk_row * pd->dst.stride + 4 * blk_col],
pd->dst.stride, eob);
......@@ -373,7 +373,8 @@ static int reconstruct_inter_block(MACROBLOCKD *const xd,
#if CONFIG_ANS
token_tab,
#endif
plane, sc, col, row, tx_size, r,
plane, sc, col, row,
tx_size, tx_type, r,
mbmi->segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size,
......
......@@ -47,7 +47,8 @@ static INLINE int read_coeff(const vpx_prob *probs, int n, vpx_reader *r) {
static int decode_coefs(const MACROBLOCKD *xd,
PLANE_TYPE type,
tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq,
tran_low_t *dqcoeff, TX_SIZE tx_size, TX_TYPE tx_type,
const int16_t *dq,
int ctx, const int16_t *scan, const int16_t *nb,
vpx_reader *r) {
FRAME_COUNTS *counts = xd->counts;
......@@ -111,7 +112,7 @@ static int decode_coefs(const MACROBLOCKD *xd,
cat6_prob = vp10_cat6_prob;
#endif
dq_shift = get_tx_scale(xd, 0, tx_size);
dq_shift = get_tx_scale(xd, tx_type, tx_size);
while (c < max_eob) {
int val = -1;
......@@ -222,6 +223,7 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
const rans_dec_lut *const token_tab,
PLANE_TYPE type,
tran_low_t *dqcoeff, TX_SIZE tx_size,
TX_TYPE tx_type,
const int16_t *dq,
int ctx, const int16_t *scan, const int16_t *nb,
struct AnsDecoder *const ans) {
......@@ -247,7 +249,7 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
const uint8_t *cat5_prob;
const uint8_t *cat6_prob;
dq_shift = get_tx_scale(xd, 0, tx_size);
dq_shift = get_tx_scale(xd, tx_type, tx_size);
if (counts) {
coef_counts = counts->coef[tx_size][type][ref];
......@@ -462,6 +464,7 @@ int vp10_decode_block_tokens(MACROBLOCKD *const xd,
int plane, const scan_order *sc,
int x, int y,
TX_SIZE tx_size,
TX_TYPE tx_type,
#if CONFIG_ANS
struct AnsDecoder *const r,
#else
......@@ -474,11 +477,11 @@ int vp10_decode_block_tokens(MACROBLOCKD *const xd,
pd->left_context + y);
#if !CONFIG_ANS
const int eob = decode_coefs(xd, pd->plane_type,
pd->dqcoeff, tx_size,
pd->dqcoeff, tx_size, tx_type,
dequant, ctx, sc->scan, sc->neighbors, r);
#else
const int eob = decode_coefs_ans(xd, token_tab, pd->plane_type,
pd->dqcoeff, tx_size,
pd->dqcoeff, tx_size, tx_type,
dequant, ctx, sc->scan, sc->neighbors, r);
#endif // !CONFIG_ANS
dec_set_contexts(xd, pd, tx_size, eob > 0, x, y);
......
......@@ -29,6 +29,7 @@ int vp10_decode_block_tokens(MACROBLOCKD *const xd,
int plane, const scan_order *sc,
int x, int y,
TX_SIZE tx_size,
TX_TYPE tx_type,
#if CONFIG_ANS
struct AnsDecoder *const r,
#else
......
......@@ -1003,7 +1003,8 @@ static void dist_block(const VP10_COMP *cpi, MACROBLOCK *x, int plane,
const struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &xd->plane[plane];
int64_t this_sse;
int shift = (MAX_TX_SCALE - get_tx_scale(xd, 0, tx_size)) * 2;
int tx_type = get_tx_type(pd->plane_type, xd, block, tx_size);
int shift = (MAX_TX_SCALE - get_tx_scale(xd, tx_type, tx_size)) * 2;
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
#if CONFIG_VP9_HIGHBITDEPTH
......@@ -1177,7 +1178,9 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
const int64_t orig_sse = (int64_t)coeff[0] * coeff[0];
const int64_t resd_sse = coeff[0] - dqcoeff[0];
int64_t dc_correct = orig_sse - resd_sse * resd_sse;
int shift = (MAX_TX_SCALE - get_tx_scale(xd, 0, tx_size)) * 2;
const struct macroblockd_plane *const pd = &xd->plane[plane];
TX_TYPE tx_type = get_tx_type(pd->plane_type, xd, block, tx_size);
int shift = (MAX_TX_SCALE - get_tx_scale(xd, tx_type, tx_size)) * 2;
#if CONFIG_VP9_HIGHBITDEPTH
dc_correct >>= ((xd->bd - 8) * 2);
#endif
......
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