Commit 19bb3498 authored by Luc Trudeau's avatar Luc Trudeau

[CFL] Compute alpha costs using av1_cost_symbol

Use the uniform way to compue the cost of symbols in AV1.

Results on Subset1 (compared to 8a516a8f with CfL enabled)

   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-0.0357 | -0.0854 |  0.0305 |  -0.0422 | -0.0097 | -0.0171 |    -0.1042

Change-Id: Ie908fc7d20c480634002c78027b070223b3ea96d
parent 4e81d929
......@@ -1492,18 +1492,17 @@ static int cfl_alpha_dist(const uint8_t *y_pix, int y_stride,
static inline void cfl_update_costs(CFL_CTX *cfl, FRAME_CONTEXT *ec_ctx) {
assert(ec_ctx->cfl_alpha_cdf[CFL_ALPHABET_SIZE - 1] ==
AOM_ICDF(CDF_PROB_TOP));
const int prob_den = CDF_PROB_TOP;
int prob_num = AOM_ICDF(ec_ctx->cfl_alpha_cdf[0]);
cfl->costs[0] = av1_cost_zero(get_prob(prob_num, prob_den));
aom_cdf_prob prev_cdf = 0;
for (int c = 1; c < CFL_ALPHABET_SIZE; c++) {
int sign_bit_cost = (cfl_alpha_codes[c][CFL_PRED_U] != 0) +
(cfl_alpha_codes[c][CFL_PRED_V] != 0);
prob_num = AOM_ICDF(ec_ctx->cfl_alpha_cdf[c]) -
AOM_ICDF(ec_ctx->cfl_alpha_cdf[c - 1]);
cfl->costs[c] = av1_cost_zero(get_prob(prob_num, prob_den)) +
av1_cost_literal(sign_bit_cost);
for (int c = 0; c < CFL_ALPHABET_SIZE; c++) {
const int sign_bit_cost = (cfl_alpha_codes[c][CFL_PRED_U] != 0) +
(cfl_alpha_codes[c][CFL_PRED_V] != 0);
aom_cdf_prob prob = AOM_ICDF(ec_ctx->cfl_alpha_cdf[c]) - prev_cdf;
prev_cdf = AOM_ICDF(ec_ctx->cfl_alpha_cdf[c]);
cfl->costs[c] = av1_cost_symbol(prob) + av1_cost_literal(sign_bit_cost);
}
}
......
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