summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_entropymode.c
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-11-01 15:09:43 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-11-01 15:09:43 -0700
commitdf19c6b64c24573cf2c77026e23aaca57372221a (patch)
tree0b2226375234e9d0e2ed419366f2d606d5a2236c /vp9/common/vp9_entropymode.c
parent340b2b076ef2bb0f4b1b195744d52562477b2b1e (diff)
downloadlibvpx-df19c6b64c24573cf2c77026e23aaca57372221a.tar
libvpx-df19c6b64c24573cf2c77026e23aaca57372221a.tar.gz
libvpx-df19c6b64c24573cf2c77026e23aaca57372221a.tar.bz2
libvpx-df19c6b64c24573cf2c77026e23aaca57372221a.zip
Removing 'new' probability calculation from convert_distribution().
We don't have to calculate 'new' probability in convert_distribution() because it is enough to calculate only 'new' counters which could be used to calculate probability if necessary. That's why removing a lot of unused temporary probability arrays and reducing number of get_binary_prob() calls. Change-Id: I4e14eb7203d1ace61bbddefd6b9b6326be83ba63
Diffstat (limited to 'vp9/common/vp9_entropymode.c')
-rw-r--r--vp9/common/vp9_entropymode.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c
index 21c91d6e3..5f388ae73 100644
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -349,13 +349,8 @@ void vp9_entropy_mode_init() {
#define COUNT_SAT 20
#define MAX_UPDATE_FACTOR 128
-static int update_ct(vp9_prob pre_prob, vp9_prob prob,
- const unsigned int ct[2]) {
- return merge_probs(pre_prob, prob, ct, COUNT_SAT, MAX_UPDATE_FACTOR);
-}
-
-static int update_ct2(vp9_prob pre_prob, const unsigned int ct[2]) {
- return merge_probs2(pre_prob, ct, COUNT_SAT, MAX_UPDATE_FACTOR);
+static int update_ct(vp9_prob pre_prob, const unsigned int ct[2]) {
+ return merge_probs(pre_prob, ct, COUNT_SAT, MAX_UPDATE_FACTOR);
}
static void update_mode_probs(int n_modes,
@@ -364,14 +359,13 @@ static void update_mode_probs(int n_modes,
const vp9_prob *pre_probs, vp9_prob *dst_probs,
unsigned int tok0_offset) {
#define MAX_PROBS 32
- vp9_prob probs[MAX_PROBS];
unsigned int branch_ct[MAX_PROBS][2];
int t;
assert(n_modes - 1 < MAX_PROBS);
- vp9_tree_probs_from_distribution(tree, probs, branch_ct, cnt, tok0_offset);
+ vp9_tree_probs_from_distribution(tree, branch_ct, cnt, tok0_offset);
for (t = 0; t < n_modes - 1; ++t)
- dst_probs[t] = update_ct(pre_probs[t], probs[t], branch_ct[t]);
+ dst_probs[t] = update_ct(pre_probs[t], branch_ct[t]);
}
void vp9_adapt_mode_probs(VP9_COMMON *cm) {
@@ -381,18 +375,18 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
const FRAME_COUNTS *counts = &cm->counts;
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
- fc->intra_inter_prob[i] = update_ct2(pre_fc->intra_inter_prob[i],
- counts->intra_inter[i]);
+ fc->intra_inter_prob[i] = update_ct(pre_fc->intra_inter_prob[i],
+ counts->intra_inter[i]);
for (i = 0; i < COMP_INTER_CONTEXTS; i++)
- fc->comp_inter_prob[i] = update_ct2(pre_fc->comp_inter_prob[i],
- counts->comp_inter[i]);
+ fc->comp_inter_prob[i] = update_ct(pre_fc->comp_inter_prob[i],
+ counts->comp_inter[i]);
for (i = 0; i < REF_CONTEXTS; i++)
- fc->comp_ref_prob[i] = update_ct2(pre_fc->comp_ref_prob[i],
- counts->comp_ref[i]);
+ fc->comp_ref_prob[i] = update_ct(pre_fc->comp_ref_prob[i],
+ counts->comp_ref[i]);
for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < 2; j++)
- fc->single_ref_prob[i][j] = update_ct2(pre_fc->single_ref_prob[i][j],
- counts->single_ref[i][j]);
+ fc->single_ref_prob[i][j] = update_ct(pre_fc->single_ref_prob[i][j],
+ counts->single_ref[i][j]);
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
update_mode_probs(INTER_MODES, vp9_inter_mode_tree,
@@ -432,24 +426,23 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
for (i = 0; i < TX_SIZE_CONTEXTS; ++i) {
tx_counts_to_branch_counts_8x8(counts->tx.p8x8[i], branch_ct_8x8p);
for (j = 0; j < TX_SIZES - 3; ++j)
- fc->tx_probs.p8x8[i][j] = update_ct2(pre_fc->tx_probs.p8x8[i][j],
- branch_ct_8x8p[j]);
+ fc->tx_probs.p8x8[i][j] = update_ct(pre_fc->tx_probs.p8x8[i][j],
+ branch_ct_8x8p[j]);
tx_counts_to_branch_counts_16x16(counts->tx.p16x16[i], branch_ct_16x16p);
for (j = 0; j < TX_SIZES - 2; ++j)
- fc->tx_probs.p16x16[i][j] = update_ct2(pre_fc->tx_probs.p16x16[i][j],
- branch_ct_16x16p[j]);
+ fc->tx_probs.p16x16[i][j] = update_ct(pre_fc->tx_probs.p16x16[i][j],
+ branch_ct_16x16p[j]);
tx_counts_to_branch_counts_32x32(counts->tx.p32x32[i], branch_ct_32x32p);
for (j = 0; j < TX_SIZES - 1; ++j)
- fc->tx_probs.p32x32[i][j] = update_ct2(pre_fc->tx_probs.p32x32[i][j],
- branch_ct_32x32p[j]);
+ fc->tx_probs.p32x32[i][j] = update_ct(pre_fc->tx_probs.p32x32[i][j],
+ branch_ct_32x32p[j]);
}
}
for (i = 0; i < MBSKIP_CONTEXTS; ++i)
- fc->mbskip_probs[i] = update_ct2(pre_fc->mbskip_probs[i],
- counts->mbskip[i]);
+ fc->mbskip_probs[i] = update_ct(pre_fc->mbskip_probs[i], counts->mbskip[i]);
}
static void set_default_lf_deltas(struct loopfilter *lf) {