summaryrefslogtreecommitdiff
path: root/vp9/common/entropymode.c
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2012-11-07 06:50:25 -0800
committerDeb Mukherjee <debargha@google.com>2012-11-16 06:56:29 -0800
commit0c917fc9755108887901bc0ea44e1952de8a2c65 (patch)
tree9a402304bdfc0dbc0e08c158e282a28d8690639f /vp9/common/entropymode.c
parent16e268668204566d7f4b2d4fc6775f996773d74d (diff)
downloadlibvpx-0c917fc9755108887901bc0ea44e1952de8a2c65.tar
libvpx-0c917fc9755108887901bc0ea44e1952de8a2c65.tar.gz
libvpx-0c917fc9755108887901bc0ea44e1952de8a2c65.tar.bz2
libvpx-0c917fc9755108887901bc0ea44e1952de8a2c65.zip
Compound inter-intra experiment
A patch on compound inter-intra prediction. In compound inter-intra prediction, a new predictor for 16x16 inter coded MBs are obtained by combining a single inter predictor with a 16x16 intra predictor, in a manner that the weight varies with distance from the top/left boundary. The current search strategy is to combine the best inter mode with the best intra mode obtained independently. Results so far: derf +0.31% yt +0.32% std-hd +0.35% hd +0.42% It is conceivable that the results would improve somewhat with a more thorough search strategy where all intra modes are searched given the best mv, or even a joint search for the best mv and the best intra mode. Change-Id: I7951f1ed0d6eb31ca32ac24d120f1585bcd8d79b
Diffstat (limited to 'vp9/common/entropymode.c')
-rw-r--r--vp9/common/entropymode.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/vp9/common/entropymode.c b/vp9/common/entropymode.c
index d0e83ecb2..83ba21c55 100644
--- a/vp9/common/entropymode.c
+++ b/vp9/common/entropymode.c
@@ -345,6 +345,9 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
vpx_memcpy(x->fc.mbsplit_prob, vp9_mbsplit_probs, sizeof(vp9_mbsplit_probs));
vpx_memcpy(x->fc.switchable_interp_prob, vp9_switchable_interp_prob,
sizeof(vp9_switchable_interp_prob));
+#if CONFIG_COMP_INTERINTRA_PRED
+ x->fc.interintra_prob = VP9_DEF_INTERINTRA_PROB;
+#endif
}
@@ -547,6 +550,9 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
vp9_prob i8x8_mode_probs[VP9_I8X8_MODES - 1];
vp9_prob sub_mv_ref_probs[VP9_SUBMVREFS - 1];
vp9_prob mbsplit_probs[VP9_NUMMBSPLITS - 1];
+#if CONFIG_COMP_INTERINTRA_PRED
+ vp9_prob interintra_prob;
+#endif
#ifdef MODE_COUNT_TESTING
printf("static const unsigned int\nymode_counts"
"[VP9_YMODES] = {\n");
@@ -581,6 +587,12 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
"[VP9_NUMMBSPLITS] = {\n");
for (t = 0; t < VP9_NUMMBSPLITS; ++t) printf("%d, ", cm->fc.mbsplit_counts[t]);
printf("};\n");
+#if CONFIG_COMP_INTERINTRA_PRED
+ printf("static const unsigned int\ninterintra_counts"
+ "[2] = {\n");
+ for (t = 0; t < 2; ++t) printf("%d, ", cm->fc.interintra_counts[t]);
+ printf("};\n");
+#endif
#endif
vp9_tree_probs_from_distribution(
VP9_YMODES, vp9_ymode_encodings, vp9_ymode_tree,
@@ -673,4 +685,21 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
else if (prob > 255) cm->fc.mbsplit_prob[t] = 255;
else cm->fc.mbsplit_prob[t] = prob;
}
+#if CONFIG_COMP_INTERINTRA_PRED
+ if (cm->use_interintra) {
+ int prob;
+ interintra_prob = vp9_bin_prob_from_distribution(cm->fc.interintra_counts);
+ count = cm->fc.interintra_counts[0] + cm->fc.interintra_counts[1];
+ count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count;
+ factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT);
+ prob = ((int)cm->fc.pre_interintra_prob * (256 - factor) +
+ (int)interintra_prob * factor + 128) >> 8;
+ if (prob <= 0)
+ cm->fc.interintra_prob = 1;
+ else if (prob > 255)
+ cm->fc.interintra_prob = 255;
+ else
+ cm->fc.interintra_prob = prob;
+ }
+#endif
}