Commit 693eedd1 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Use CDFs to compute all intra mode related costs.

When EC_ADAPT is enabled, this patch uses the adapted CDF after
 encoding the entire frame to compute the non-adapted costs that are
 used in RDO decision making when coding the following frame.
Future patches will update these costs periodically while coding the
 frame to keep them in sync with the actual rates used when coding the
 symbols with the adapted CDF.

master@2017-06-30T01:10:29.197Z -> intra_cdfs@2017-06-30T01:09:41.171Z

   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-0.0168 |  0.0031 | -0.0181 |  -0.0018 | -0.0022 | -0.0209 |    -0.0027

Change-Id: Id9e284b429e4d2a31d418141af6935d7ece1180e
parent 858e2388
......@@ -5025,9 +5025,11 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#endif // CONFIG_EXT_INTER
#if !CONFIG_EC_ADAPT
for (i = 0; i < BLOCK_SIZE_GROUPS; i++)
aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->y_mode_prob[i],
counts->y_mode[i], fc->y_mode_prob[i]);
#endif
if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
......@@ -5112,9 +5114,11 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
counts->seg.tree_total, fc->seg.tree_probs);
}
#if !CONFIG_EC_ADAPT
for (i = 0; i < INTRA_MODES; ++i)
aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->uv_mode_prob[i],
counts->uv_mode[i], fc->uv_mode_prob[i]);
#endif
#if CONFIG_EXT_PARTITION_TYPES
for (i = 0; i < PARTITION_PLOFFSET; ++i)
......
......@@ -66,16 +66,31 @@ static void fill_mode_costs(AV1_COMP *cpi) {
for (i = 0; i < INTRA_MODES; ++i)
for (j = 0; j < INTRA_MODES; ++j)
#if CONFIG_EC_ADAPT
av1_cost_tokens_from_cdf(cpi->y_mode_costs[i][j], av1_kf_y_mode_cdf[i][j],
av1_intra_mode_inv);
#else
av1_cost_tokens(cpi->y_mode_costs[i][j], av1_kf_y_mode_prob[i][j],
av1_intra_mode_tree);
#endif
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
#if CONFIG_EC_ADAPT
av1_cost_tokens_from_cdf(cpi->mbmode_cost[i], fc->y_mode_cdf[i],
av1_intra_mode_inv);
#else
av1_cost_tokens(cpi->mbmode_cost[i], fc->y_mode_prob[i],
av1_intra_mode_tree);
#endif
for (i = 0; i < INTRA_MODES; ++i)
#if CONFIG_EC_ADAPT
av1_cost_tokens_from_cdf(cpi->intra_uv_mode_cost[i], fc->uv_mode_cdf[i],
av1_intra_mode_inv);
#else
av1_cost_tokens(cpi->intra_uv_mode_cost[i], fc->uv_mode_prob[i],
av1_intra_mode_tree);
#endif
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
av1_cost_tokens(cpi->switchable_interp_costs[i],
......
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