summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-04-11 14:54:53 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-04-11 14:54:53 -0700
commit7a97959f138a558773d8a26be0e7c96b5a8893b1 (patch)
tree40c9b45479c30b77f2eaff5fc60cba92b1be9b71 /vp9/encoder
parent4ba74ae81ace116fe6f5863047035d02b8134e45 (diff)
parent66f413af4f8a0ae318e15929274a84e59068430a (diff)
downloadlibvpx-7a97959f138a558773d8a26be0e7c96b5a8893b1.tar
libvpx-7a97959f138a558773d8a26be0e7c96b5a8893b1.tar.gz
libvpx-7a97959f138a558773d8a26be0e7c96b5a8893b1.tar.bz2
libvpx-7a97959f138a558773d8a26be0e7c96b5a8893b1.zip
Merge "Turning model-based updates on with modelcoefprob" into experimental
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_bitstream.c18
-rw-r--r--vp9/encoder/vp9_onyx_if.c21
2 files changed, 21 insertions, 18 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 886e1fcdc..932fc0df1 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -404,7 +404,7 @@ static int prob_diff_update_savings_search_model(const unsigned int *ct,
const vp9_prob *oldp,
vp9_prob *bestp,
const vp9_prob upd,
- int b, int r) {
+ int b, int r, int q) {
int i, old_b, new_b, update_b, savings, bestsavings, step;
int newp;
vp9_prob bestnewp, newplist[ENTROPY_NODES];
@@ -2068,8 +2068,8 @@ static void update_nzc_probs(VP9_COMP* cpi,
#endif // CONFIG_CODE_NONZEROCOUNT
static void update_coef_probs_common(vp9_writer* const bc,
-#ifdef ENTROPY_STATS
VP9_COMP *cpi,
+#ifdef ENTROPY_STATS
vp9_coeff_stats *tree_update_hist,
#endif
vp9_coeff_probs *new_frame_coef_probs,
@@ -2112,7 +2112,8 @@ static void update_coef_probs_common(vp9_writer* const bc,
if (t == UNCONSTRAINED_NODES - 1)
s = prob_diff_update_savings_search_model(
frame_branch_ct[i][j][k][l][0],
- old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+ old_frame_coef_probs[i][j][k][l], &newp, upd, i, j,
+ cpi->common.base_qindex);
else
#endif
s = prob_diff_update_savings_search(
@@ -2166,7 +2167,8 @@ static void update_coef_probs_common(vp9_writer* const bc,
if (t == UNCONSTRAINED_NODES - 1)
s = prob_diff_update_savings_search_model(
frame_branch_ct[i][j][k][l][0],
- old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+ old_frame_coef_probs[i][j][k][l], &newp, upd, i, j,
+ cpi->common.base_qindex);
else
#endif
s = prob_diff_update_savings_search(
@@ -2209,8 +2211,8 @@ static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
build_coeff_contexts(cpi);
update_coef_probs_common(bc,
-#ifdef ENTROPY_STATS
cpi,
+#ifdef ENTROPY_STATS
tree_update_hist_4x4,
#endif
cpi->frame_coef_probs_4x4,
@@ -2221,8 +2223,8 @@ static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
/* do not do this if not even allowed */
if (cpi->common.txfm_mode != ONLY_4X4) {
update_coef_probs_common(bc,
-#ifdef ENTROPY_STATS
cpi,
+#ifdef ENTROPY_STATS
tree_update_hist_8x8,
#endif
cpi->frame_coef_probs_8x8,
@@ -2233,8 +2235,8 @@ static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
if (cpi->common.txfm_mode > ALLOW_8X8) {
update_coef_probs_common(bc,
-#ifdef ENTROPY_STATS
cpi,
+#ifdef ENTROPY_STATS
tree_update_hist_16x16,
#endif
cpi->frame_coef_probs_16x16,
@@ -2245,8 +2247,8 @@ static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
if (cpi->common.txfm_mode > ALLOW_16X16) {
update_coef_probs_common(bc,
-#ifdef ENTROPY_STATS
cpi,
+#ifdef ENTROPY_STATS
tree_update_hist_32x32,
#endif
cpi->frame_coef_probs_32x32,
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index aab072e65..0102e6d7c 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -2943,25 +2943,26 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
// Set up entropy depending on frame type.
if (cm->frame_type == KEY_FRAME) {
/* Choose which entropy context to use. When using a forward reference
- * frame, it immediately follows the keyframe, and thus benefits from
- * using the same entropy context established by the keyframe. Otherwise,
- * use the default context 0.
- */
+ * frame, it immediately follows the keyframe, and thus benefits from
+ * using the same entropy context established by the keyframe. Otherwise,
+ * use the default context 0.
+ */
cm->frame_context_idx = cpi->oxcf.play_alternate;
vp9_setup_key_frame(cpi);
} else {
- /* Choose which entropy context to use. Currently there are only two
- * contexts used, one for normal frames and one for alt ref frames.
- */
+ /* Choose which entropy context to use. Currently there are only two
+ * contexts used, one for normal frames and one for alt ref frames.
+ */
cpi->common.frame_context_idx = cpi->refresh_alt_ref_frame;
vp9_setup_inter_frame(cpi);
}
}
// transform / motion compensation build reconstruction frame
-#if CONFIG_MODELCOEFPROB && ADJUST_KF_COEF_PROBS
- if (cm->frame_type == KEY_FRAME)
- vp9_adjust_default_coef_probs(cm);
+#if CONFIG_MODELCOEFPROB
+ if (cm->frame_type == KEY_FRAME) {
+ vp9_default_coef_probs(cm);
+ }
#endif
vp9_encode_frame(cpi);