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
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 9e1cec0..f20701c 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -66,16 +66,31 @@
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],