[CFL] use CDF_SIZE macro
EC_ADAPT stores the count at the last position. As such, the CDF_SIZE
macro adds 1 to the array size. This resolves valgrind warnings about
jumps on uninitialized variables.
Change-Id: I58d607a57756cb166a9ae5c4565537ce202183fd
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index 743b489..369eb6e 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -2931,7 +2931,7 @@
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_CFL
-static const aom_cdf_prob default_cfl_alpha_cdf[CFL_ALPHABET_SIZE] = {
+static const aom_cdf_prob default_cfl_alpha_cdf[CDF_SIZE(CFL_ALPHABET_SIZE)] = {
// decreasing likelihood, after 6 iterations of alpha RDO on subset 3
AOM_ICDF(23928), AOM_ICDF(26267), AOM_ICDF(27319), AOM_ICDF(28330),
AOM_ICDF(29341), AOM_ICDF(30160), AOM_ICDF(30581), AOM_ICDF(30983),
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 991b3c2..c774702 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -304,7 +304,7 @@
od_adapt_ctx pvq_context;
#endif // CONFIG_PVQ
#if CONFIG_CFL
- aom_cdf_prob cfl_alpha_cdf[CFL_ALPHABET_SIZE];
+ aom_cdf_prob cfl_alpha_cdf[CDF_SIZE(CFL_ALPHABET_SIZE)];
#endif
} FRAME_CONTEXT;
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index cdd5b70..a6cdde6 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -1642,8 +1642,9 @@
#error "CfL rate estimation requires ec_adapt."
#endif
FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
- assert(ec_ctx->cfl_alpha_cdf[CFL_ALPHABET_SIZE - 1] == AOM_ICDF(32768U));
- const int prob_den = 32768U;
+ assert(ec_ctx->cfl_alpha_cdf[CFL_ALPHABET_SIZE - 1] ==
+ AOM_ICDF(CDF_PROB_TOP));
+ const int prob_den = CDF_PROB_TOP;
CFL_CTX *const cfl = xd->cfl;
int cfl_costs[CFL_ALPHABET_SIZE];