summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2015-10-08 18:50:50 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-10-08 18:50:50 +0000
commit95f8b819626790945f4be387554e0fab866a39b4 (patch)
tree07445eee2b4b9418b50ea70a0c20aa9b8f4ed85a
parentca67339901f21e25ce7c7c1b9c935c08a07e00eb (diff)
parent177e7b53e7e88a94b20cf04207803231c7116f9e (diff)
downloadlibvpx-95f8b819626790945f4be387554e0fab866a39b4.tar
libvpx-95f8b819626790945f4be387554e0fab866a39b4.tar.gz
libvpx-95f8b819626790945f4be387554e0fab866a39b4.tar.bz2
libvpx-95f8b819626790945f4be387554e0fab866a39b4.zip
Merge "vp10: use subexp probability updates for MV probs."
-rw-r--r--vp10/decoder/decodeframe.c4
-rw-r--r--vp10/encoder/encodemv.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c
index 6619b0004..ad02c953e 100644
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -170,8 +170,12 @@ static void read_frame_reference_mode_probs(VP10_COMMON *cm, vpx_reader *r) {
static void update_mv_probs(vpx_prob *p, int n, vpx_reader *r) {
int i;
for (i = 0; i < n; ++i)
+#if CONFIG_MISC_FIXES
+ vp10_diff_update_prob(r, &p[i]);
+#else
if (vpx_read(r, MV_UPDATE_PROB))
p[i] = (vpx_read_literal(r, 7) << 1) | 1;
+#endif
}
static void read_mv_probs(nmv_context *ctx, int allow_hp, vpx_reader *r) {
diff --git a/vp10/encoder/encodemv.c b/vp10/encoder/encodemv.c
index ca2de1fba..0736c65b3 100644
--- a/vp10/encoder/encodemv.c
+++ b/vp10/encoder/encodemv.c
@@ -15,6 +15,7 @@
#include "vp10/encoder/cost.h"
#include "vp10/encoder/encodemv.h"
+#include "vp10/encoder/subexp.h"
#include "vpx_dsp/vpx_dsp_common.h"
@@ -134,8 +135,12 @@ static void build_nmv_component_cost_table(int *mvcost,
}
}
-static int update_mv(vpx_writer *w, const unsigned int ct[2], vpx_prob *cur_p,
- vpx_prob upd_p) {
+static void update_mv(vpx_writer *w, const unsigned int ct[2], vpx_prob *cur_p,
+ vpx_prob upd_p) {
+#if CONFIG_MISC_FIXES
+ (void) upd_p;
+ vp10_cond_prob_diff_update(w, cur_p, ct);
+#else
const vpx_prob new_p = get_binary_prob(ct[0], ct[1]) | 1;
const int update = cost_branch256(ct, *cur_p) + vp10_cost_zero(upd_p) >
cost_branch256(ct, new_p) + vp10_cost_one(upd_p) + 7 * 256;
@@ -144,7 +149,7 @@ static int update_mv(vpx_writer *w, const unsigned int ct[2], vpx_prob *cur_p,
*cur_p = new_p;
vpx_write_literal(w, new_p >> 1, 7);
}
- return update;
+#endif
}
static void write_mv_update(const vpx_tree_index *tree,