Commit 52168e9d authored by Yushin Cho's avatar Yushin Cho

Change PVQ's gaintheta symbols to use dyadic and ec_adapt adaptation

Change-Id: I367d5561f53f60df42c3ff6f334b1441c85788bd
parent 13d0662b
......@@ -206,8 +206,7 @@ void od_adapt_pvq_ctx_reset(od_pvq_adapt_ctx *state, int is_keyframe) {
for (i = 0; i < OD_TXSIZES*PVQ_MAX_PARTITIONS; i++) {
state->pvq_ext[i] = is_keyframe ? 24576 : 2 << 16;
}
state->pvq_gaintheta_increment = 128;
OD_CDFS_INIT(state->pvq_gaintheta_cdf, state->pvq_gaintheta_increment >> 2);
OD_CDFS_INIT(state->pvq_gaintheta_cdf, 0);
OD_CDFS_INIT_Q15(state->pvq_skip_dir_cdf);
OD_CDFS_INIT(ctx->pvq_split_cdf, 0);
}
......
......@@ -131,9 +131,8 @@ struct od_pvq_adapt_ctx {
generic_encoder pvq_param_model[3];
int pvq_ext[OD_TXSIZES*PVQ_MAX_PARTITIONS];
int pvq_exg[OD_NPLANES_MAX][OD_TXSIZES][PVQ_MAX_PARTITIONS];
int pvq_gaintheta_increment;
uint16_t pvq_gaintheta_cdf[2*OD_TXSIZES*PVQ_MAX_PARTITIONS][16];
uint16_t pvq_skip_dir_cdf[2*(OD_TXSIZES-1)][CDF_SIZE(7)];
uint16_t pvq_gaintheta_cdf[2*OD_TXSIZES*PVQ_MAX_PARTITIONS][CDF_SIZE(16)];
uint16_t pvq_skip_dir_cdf[2*(OD_TXSIZES-1)][CDF_SIZE(7)];
};
typedef struct od_qm_entry {
......
......@@ -173,9 +173,8 @@ static void pvq_decode_partition(aom_reader *r,
/* Jointly decode gain, itheta and noref for small values. Then we handle
larger gain. We need to wait for itheta because in the !nodesync case
it depends on max_theta, which depends on the gain. */
id = aom_decode_cdf_adapt(r, &adapt->pvq.pvq_gaintheta_cdf[cdf_ctx][0],
8 + 7*has_skip, adapt->pvq.pvq_gaintheta_increment,
"pvq:gaintheta");
id = aom_read_symbol_pvq(r, &adapt->pvq.pvq_gaintheta_cdf[cdf_ctx][0],
8 + 7*has_skip, "pvq:gaintheta");
if (!is_keyframe && id >= 10) id++;
if (is_keyframe && id >= 8) id++;
if (id >= 8) {
......
......@@ -680,8 +680,8 @@ void pvq_encode_partition(aom_writer *w,
}
/* Jointly code gain, theta and noref for small values. Then we handle
larger gain and theta values. For noref, theta = -1. */
aom_encode_cdf_adapt(w, id, &adapt->pvq.pvq_gaintheta_cdf[cdf_ctx][0],
8 + 7*code_skip, adapt->pvq.pvq_gaintheta_increment);
aom_write_symbol_pvq(w, id, &adapt->pvq.pvq_gaintheta_cdf[cdf_ctx][0],
8 + 7*code_skip);
if (encode_flip) {
/* We could eventually do some smarter entropy coding here, but it would
have to be good enough to overcome the overhead of the entropy coder.
......
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