Commit bca9e9ee authored by Monty's avatar Monty Committed by Christopher Montgomery
Browse files

Fix build when daala_tx and lv_map are both enabled

Daala TX removes the av1_get_tx_scale() call, which lv_map uses.
This patch eliminates use of the call when Daala TX is enabled.

Change-Id: I55ecdf630b8c5e1b30328a64252d1ca98e0c94ca
parent 9007d345
......@@ -73,7 +73,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
struct macroblockd_plane *const pd = &xd->plane[plane];
const int16_t *const dequant = pd->seg_dequant_QTX[mbmi->segment_id];
tran_low_t *const tcoeffs = pd->dqcoeff;
#if !CONFIG_DAALA_TX
const int shift = av1_get_tx_scale(tx_size);
#endif
const int bwl = get_txb_bwl(tx_size);
const int width = get_txb_wide(tx_size);
const int height = get_txb_high(tx_size);
......@@ -206,7 +208,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
*max_scan_line = AOMMAX(*max_scan_line, pos);
if (level < 3) {
cul_level += level;
#if CONFIG_DAALA_TX
tcoeffs[pos] = level * dequant[!!c];
#else
tcoeffs[pos] = (level * dequant[!!c]) >> shift;
#endif
} else {
update_pos[num_updates++] = pos;
}
......@@ -235,7 +241,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
// semantic: is_k = 1 if level > (k+1)
if (is_k == 0) {
cul_level += k + 1;
#if CONFIG_DAALA_TX
tcoeffs[pos] = (k + 1) * dequant[!!c];
#else
tcoeffs[pos] = ((k + 1) * dequant[!!c]) >> shift;
#endif
break;
}
}
......@@ -309,7 +319,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
}
if (*level <= NUM_BASE_LEVELS + COEFF_BASE_RANGE) {
cul_level += *level;
#if CONFIG_DAALA_TX
tran_low_t t = *level * dequant[!!pos];
#else
tran_low_t t = (*level * dequant[!!pos]) >> shift;
#endif
if (signs[pos]) t = -t;
tcoeffs[pos] = t;
continue;
......@@ -341,7 +355,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
*level = NUM_BASE_LEVELS + 1 + br_base + br_offset;
cul_level += *level;
#if CONFIG_DAALA_TX
tran_low_t t = *level * dequant[!!pos];
#else
tran_low_t t = (*level * dequant[!!pos]) >> shift;
#endif
if (signs[pos]) t = -t;
tcoeffs[pos] = t;
break;
......@@ -356,7 +374,11 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
// Save golomb in tcoeffs because adding it to level may incur overflow
tran_low_t t = *level + read_golomb(xd, r, counts);
cul_level += t;
#if CONFIG_DAALA_TX
t = t * dequant[!!pos];
#else
t = (t * dequant[!!pos]) >> shift;
#endif
if (signs[pos]) t = -t;
tcoeffs[pos] = t;
}
......
......@@ -130,7 +130,7 @@ static INLINE int64_t get_coeff_dist(tran_low_t tcoeff, tran_low_t dqcoeff,
int depth_shift = (TX_COEFF_DEPTH - 11) * 2;
int depth_round = depth_shift > 1 ? (1 << (depth_shift - 1)) : 0;
const int64_t diff = tcoeff - dqcoeff;
const int64_t error = diff * diff + depth_round >> depth_shift;
const int64_t error = (diff * diff + depth_round) >> depth_shift;
(void)shift;
#else
const int64_t diff = (tcoeff - dqcoeff) * (1 << shift);
......@@ -2014,7 +2014,11 @@ int av1_optimize_txb(const AV1_COMMON *cm, MACROBLOCK *x, int plane,
const SCAN_ORDER *const scan_order = get_scan(cm, tx_size, tx_type, mbmi);
const LV_MAP_COEFF_COST txb_costs = x->coeff_costs[txs_ctx][plane_type];
#if CONFIG_DAALA_TX
const int shift = 0;
#else
const int shift = av1_get_tx_scale(tx_size);
#endif
const int64_t rdmult =
((x->rdmult * plane_rd_mult[is_inter][plane_type] << (2 * (xd->bd - 8))) +
2) >>
......
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