Commit 31b980aa authored by Yushin Cho's avatar Yushin Cho

Delete unused od_encode_quantizer_scaling() of PVQ

Frankly I don't know what this was exactly doing in Daala
but it cannot be supported in AV1 because
state.sb_q_sacaling is not defined.

Change-Id: I75cb9080aa2a4af544b436b07ddcb9c27b3d25c4
parent 74752ca1
......@@ -1299,8 +1299,7 @@ PVQ_SKIP_TYPE av1_pvq_encode_helper(MACROBLOCK *x, tran_low_t *const coeff,
plane,
tx_size, OD_PVQ_BETA[use_activity_masking][plane][tx_size],
OD_ROBUST_STREAM,
0, // is_keyframe,
0, 0, 0, // q_scaling, bx, by,
0, // is_keyframe,
daala_enc->state.qm + off, daala_enc->state.qm_inv + off,
speed, // speed
pvq_info);
......
......@@ -719,31 +719,6 @@ int od_rdo_quant(od_coeff x, int q, double delta0, double pvq_norm_lambda) {
}
}
#if OD_SIGNAL_Q_SCALING
void od_encode_quantizer_scaling(daala_enc_ctx *enc, int q_scaling,
int sbx, int sby, int skip) {
int nhsb;
OD_ASSERT(skip == !!skip);
nhsb = enc->state.nhsb;
OD_ASSERT(sbx < nhsb);
OD_ASSERT(sby < enc->state.nvsb);
OD_ASSERT(!skip || q_scaling == 0);
enc->state.sb_q_scaling[sby*nhsb + sbx] = q_scaling;
if (!skip) {
int above;
int left;
/* use value from neighbour if possible, otherwise use 0 */
above = sby > 0 ? enc->state.sb_q_scaling[(sby - 1)*enc->state.nhsb + sbx]
: 0;
left = sbx > 0 ? enc->state.sb_q_scaling[sby*enc->state.nhsb + (sbx - 1)]
: 0;
aom_encode_cdf_adapt(&enc->w, q_scaling,
enc->state.adapt.q_cdf[above + left*4], 4,
enc->state.adapt.q_increment);
}
}
#endif
/** Encode a coefficient block (excepting DC) using PVQ
*
* @param [in,out] enc daala encoder context
......@@ -756,9 +731,6 @@ void od_encode_quantizer_scaling(daala_enc_ctx *enc, int q_scaling,
* @param [in] beta per-band activity masking beta param
* @param [in] nodesync make stream robust to error in the reference
* @param [in] is_keyframe whether we're encoding a keyframe
* @param [in] q_scaling scaling factor to apply to quantizer
* @param [in] bx x-coordinate of this block
* @param [in] by y-coordinate of this block
* @param [in] qm QM with magnitude compensation
* @param [in] qm_inv Inverse of QM with magnitude compensation
* @param [in] speed Make search faster by making approximations
......@@ -778,9 +750,6 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
const od_val16 *beta,
int nodesync,
int is_keyframe,
int q_scaling,
int bx,
int by,
const int16_t *qm,
const int16_t *qm_inv,
int speed,
......@@ -811,11 +780,6 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
double dc_rate;
int use_masking;
PVQ_SKIP_TYPE ac_dc_coded;
#if !OD_SIGNAL_Q_SCALING
OD_UNUSED(q_scaling);
OD_UNUSED(bx);
OD_UNUSED(by);
#endif
aom_clear_system_state();
......@@ -923,12 +887,6 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
aom_encode_cdf_adapt(&enc->w, 2 + (out[0] != 0), skip_cdf,
4, enc->state.adapt.skip_increment);
ac_dc_coded = AC_CODED + (out[0] != 0);
#if OD_SIGNAL_Q_SCALING
if (bs == OD_TXSIZES - 1 && pli == 0) {
od_encode_quantizer_scaling(enc, q_scaling, bx >> (OD_TXSIZES - 1),
by >> (OD_TXSIZES - 1), 0);
}
#endif
cfl_encoded = 0;
skip_rest = 1;
skip_theta_value = is_keyframe ? -1 : 0;
......@@ -1033,17 +991,6 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
aom_encode_cdf_adapt(&enc->w, out[0] != 0, skip_cdf,
4, enc->state.adapt.skip_increment);
ac_dc_coded = (out[0] != 0);
#if OD_SIGNAL_Q_SCALING
if (bs == OD_TXSIZES - 1 && pli == 0) {
int skip;
skip = out[0] == 0;
if (skip) {
q_scaling = 0;
}
od_encode_quantizer_scaling(enc, q_scaling, bx >> (OD_TXSIZES - 1),
by >> (OD_TXSIZES - 1), skip);
}
#endif
if (is_keyframe) for (i = 1; i < 1 << (2*bs + 4); i++) out[i] = 0;
else for (i = 1; i < 1 << (2*bs + 4); i++) out[i] = ref[i];
}
......
......@@ -19,20 +19,11 @@
# include "av1/common/pvq.h"
# include "av1/encoder/encint.h"
#ifndef OD_SIGNAL_Q_SCALING
# define OD_SIGNAL_Q_SCALING (0)
#endif
void aom_encode_band_pvq_splits(aom_writer *w, od_pvq_codeword_ctx *adapt,
const int *y, int n, int k, int level);
void aom_laplace_encode_special(aom_writer *w, int x, unsigned decay, int max);
#if OD_SIGNAL_Q_SCALING
void od_encode_quantizer_scaling(daala_enc_ctx *enc, int q_scaling, int bx,
int by, int skip);
#endif
void pvq_encode_partition(aom_writer *w,
int qg,
int theta,
......@@ -54,8 +45,8 @@ void pvq_encode_partition(aom_writer *w,
PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc, od_coeff *ref,
const od_coeff *in, od_coeff *out, int q_dc, int q_ac, int pli, int bs,
const od_val16 *beta, int nodesync, int is_keyframe, int q_scaling, int bx,
int by, const int16_t *qm, const int16_t *qm_inv, int speed,
const od_val16 *beta, int nodesync, int is_keyframe,
const int16_t *qm, const int16_t *qm_inv, int speed,
PVQ_INFO *pvq_info);
#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