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

Remove use of av1_get_tx_scale in Daala TX

Daala TX does not scale coefficients based on TX size.  Although
previous patches force av1_get_tx_scale() to always return zero when
CONFIG_DAALA_TX is true, this patch removes the call entirely.  This
represents no functional change.

subset-1:
monty-rest-of-stack-Q3-s1@2017-11-13T14:39:52.160Z ->
 monty-rest-of-stack-rmscale-s1@2017-11-13T14:40:20.646Z

  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
0.0000 |     N/A |  0.0000 |   0.0000 | 0.0000 |  0.0000 |     0.0000

Change-Id: I5757282153c291c59510b17b5f71b3e0a56382ca
parent 57f6bfd0
......@@ -27,15 +27,12 @@
#endif
#endif
#if !CONFIG_DAALA_TX
int av1_get_tx_scale(const TX_SIZE tx_size) {
#if CONFIG_DAALA_TX
(void)tx_size;
return 0;
#else
const int pels = tx_size_2d[tx_size];
return (pels > 256) + (pels > 1024) + (pels > 4096);
#endif
}
#endif
#if !CONFIG_DAALA_TX
......
......@@ -40,8 +40,10 @@ typedef struct {
} highbd_transform_2d;
#endif // CONFIG_HIGHBITDEPTH
#if !CONFIG_DAALA_TX
#define MAX_TX_SCALE 1
int av1_get_tx_scale(const TX_SIZE tx_size);
#endif
void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
const TxfmParam *txfm_param);
......
......@@ -126,14 +126,15 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
uint8_t token_cache[MAX_TX_SQUARE];
const uint8_t *band_translate = get_band_translate(tx_size);
int dq_shift;
int v, token;
int32_t dqv = dq[0];
#if CONFIG_NEW_QUANT
const tran_low_t *dqv_val = &dq_val[0][0];
#endif // CONFIG_NEW_QUANT
dq_shift = av1_get_tx_scale(tx_size);
#if !CONFIG_DAALA_TX
int dq_shift = av1_get_tx_scale(tx_size);
#endif
band = *band_translate++;
......@@ -198,7 +199,9 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
#if CONFIG_NEW_QUANT
v = av1_dequant_abscoeff_nuq(val, dqv, dqv_val);
#if !CONFIG_DAALA_TX
v = dq_shift ? ROUND_POWER_OF_TWO(v, dq_shift) : v;
#endif
#else
#if CONFIG_AOM_QM
// Apply quant matrix only for 2D transforms
......@@ -206,7 +209,11 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
dqv = ((iqmatrix[scan[c]] * (int)dqv) + (1 << (AOM_QM_BITS - 1))) >>
AOM_QM_BITS;
#endif
#if !CONFIG_DAALA_TX
v = (val * dqv) >> dq_shift;
#else
v = val * dqv;
#endif
#endif
v = (int)check_range(av1_read_record_bit(xd->counts, r, ACCT_STR) ? -v : v,
......
......@@ -537,7 +537,11 @@ void av1_xform_quant(const AV1_COMMON *cm, MACROBLOCK *x, int plane, int block,
src_diff =
&p->src_diff[(blk_row * diff_stride + blk_col) << tx_size_wide_log2[0]];
#if CONFIG_DAALA_TX
qparam.log_scale = 0;
#else
qparam.log_scale = av1_get_tx_scale(tx_size);
#endif
#if CONFIG_NEW_QUANT
qparam.tx_size = tx_size;
qparam.dq = get_dq_profile_from_ctx(x->qindex, ctx, is_inter, plane_type);
......
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