summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-05-28 16:25:43 -0700
committerDeb Mukherjee <debargha@google.com>2013-05-28 16:32:03 -0700
commitd8c0989d56d21e2d72a95b8855b2ddd218c5b068 (patch)
treec161953f023782f09a456759c205a6849cf06dbc /vp9/encoder
parenta2db88fc26a9392312201c385e75f111fd82130e (diff)
downloadlibvpx-d8c0989d56d21e2d72a95b8855b2ddd218c5b068.tar
libvpx-d8c0989d56d21e2d72a95b8855b2ddd218c5b068.tar.gz
libvpx-d8c0989d56d21e2d72a95b8855b2ddd218c5b068.tar.bz2
libvpx-d8c0989d56d21e2d72a95b8855b2ddd218c5b068.zip
Clean up related to coefficient modeling
Uses reduced arrays for probabilities and branch counts in the encoder. No change in bitstream. Change-Id: Iec605446f44db4cd325eb45fa12a3003a6ee29db
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_bitstream.c14
-rw-r--r--vp9/encoder/vp9_onyx_int.h16
2 files changed, 16 insertions, 14 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index a2d7d4e08..98cdb1590 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1067,7 +1067,7 @@ static void print_prob_tree(vp9_coeff_probs *coef_probs, int block_types) {
fclose(f);
}
-static void build_tree_distribution(vp9_coeff_probs *coef_probs,
+static void build_tree_distribution(vp9_coeff_probs_model *coef_probs,
vp9_coeff_count *coef_counts,
unsigned int (*eob_branch_ct)[REF_TYPES]
[COEF_BANDS]
@@ -1076,12 +1076,13 @@ static void build_tree_distribution(vp9_coeff_probs *coef_probs,
VP9_COMP *cpi,
vp9_coeff_accum *context_counters,
#endif
- vp9_coeff_stats *coef_branch_ct,
+ vp9_coeff_stats_model *coef_branch_ct,
int block_types) {
int i, j, k, l;
#ifdef ENTROPY_STATS
int t = 0;
#endif
+ unsigned int model_counts[UNCONSTRAINED_NODES + 1];
for (i = 0; i < block_types; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
@@ -1089,10 +1090,11 @@ static void build_tree_distribution(vp9_coeff_probs *coef_probs,
for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
if (l >= 3 && k == 0)
continue;
- vp9_tree_probs_from_distribution(vp9_coef_tree,
+ vp9_full_to_model_count(model_counts, coef_counts[i][j][k][l]);
+ vp9_tree_probs_from_distribution(vp9_coefmodel_tree,
coef_probs[i][j][k][l],
coef_branch_ct[i][j][k][l],
- coef_counts[i][j][k][l], 0);
+ model_counts, 0);
coef_branch_ct[i][j][k][l][0][1] = eob_branch_ct[i][j][k][l] -
coef_branch_ct[i][j][k][l][0][0];
coef_probs[i][j][k][l][0] =
@@ -1149,9 +1151,9 @@ static void update_coef_probs_common(
#ifdef ENTROPY_STATS
vp9_coeff_stats *tree_update_hist,
#endif
- vp9_coeff_probs *new_frame_coef_probs,
+ vp9_coeff_probs_model *new_frame_coef_probs,
vp9_coeff_probs_model *old_frame_coef_probs,
- vp9_coeff_stats *frame_branch_ct,
+ vp9_coeff_stats_model *frame_branch_ct,
TX_SIZE tx_size) {
int i, j, k, l, t;
int update[2] = {0, 0};
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index e3e95eda9..f45a7e8c9 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -424,20 +424,20 @@ typedef struct VP9_COMP {
nmv_context_counts NMVcount;
vp9_coeff_count coef_counts_4x4[BLOCK_TYPES];
- vp9_coeff_probs frame_coef_probs_4x4[BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct_4x4[BLOCK_TYPES];
+ vp9_coeff_probs_model frame_coef_probs_4x4[BLOCK_TYPES];
+ vp9_coeff_stats_model frame_branch_ct_4x4[BLOCK_TYPES];
vp9_coeff_count coef_counts_8x8[BLOCK_TYPES];
- vp9_coeff_probs frame_coef_probs_8x8[BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct_8x8[BLOCK_TYPES];
+ vp9_coeff_probs_model frame_coef_probs_8x8[BLOCK_TYPES];
+ vp9_coeff_stats_model frame_branch_ct_8x8[BLOCK_TYPES];
vp9_coeff_count coef_counts_16x16[BLOCK_TYPES];
- vp9_coeff_probs frame_coef_probs_16x16[BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct_16x16[BLOCK_TYPES];
+ vp9_coeff_probs_model frame_coef_probs_16x16[BLOCK_TYPES];
+ vp9_coeff_stats_model frame_branch_ct_16x16[BLOCK_TYPES];
vp9_coeff_count coef_counts_32x32[BLOCK_TYPES];
- vp9_coeff_probs frame_coef_probs_32x32[BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct_32x32[BLOCK_TYPES];
+ vp9_coeff_probs_model frame_coef_probs_32x32[BLOCK_TYPES];
+ vp9_coeff_stats_model frame_branch_ct_32x32[BLOCK_TYPES];
int gfu_boost;
int last_boost;