Update single inter mode prob model in rd search
Update the inter mode probability model in the rate distortion
optimization search process. This has neutral impact on low
resolution coding performance, improves midres by 0.099%.
Change-Id: Icfa6cde05656242db5ec91c635d90a6c7e305e2c
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 64f91a4..85ce8be 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -702,23 +702,30 @@
ctx->rdcost = rd_cost->rdcost;
}
-static void update_inter_mode_stats(FRAME_COUNTS *counts, PREDICTION_MODE mode,
- int16_t mode_context) {
+static void update_inter_mode_stats(FRAME_CONTEXT *fc, FRAME_COUNTS *counts,
+ PREDICTION_MODE mode, int16_t mode_context,
+ uint8_t allow_update_cdf) {
int16_t mode_ctx = mode_context & NEWMV_CTX_MASK;
if (mode == NEWMV) {
++counts->newmv_mode[mode_ctx][0];
+ if (allow_update_cdf) update_cdf(fc->newmv_cdf[mode_ctx], 0, 2);
return;
} else {
++counts->newmv_mode[mode_ctx][1];
+ if (allow_update_cdf) update_cdf(fc->newmv_cdf[mode_ctx], 1, 2);
mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
if (mode == GLOBALMV) {
++counts->zeromv_mode[mode_ctx][0];
+ if (allow_update_cdf) update_cdf(fc->zeromv_cdf[mode_ctx], 0, 2);
return;
} else {
++counts->zeromv_mode[mode_ctx][1];
+ if (allow_update_cdf) update_cdf(fc->zeromv_cdf[mode_ctx], 1, 2);
mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
++counts->refmv_mode[mode_ctx][mode != NEARESTMV];
+ if (allow_update_cdf)
+ update_cdf(fc->refmv_cdf[mode_ctx], mode != NEARESTMV, 2);
}
}
}
@@ -1253,7 +1260,7 @@
update_cdf(fc->inter_compound_mode_cdf[mode_ctx],
INTER_COMPOUND_OFFSET(mode), INTER_COMPOUND_MODES);
} else {
- update_inter_mode_stats(counts, mode, mode_ctx);
+ update_inter_mode_stats(fc, counts, mode, mode_ctx, allow_update_cdf);
}
#else
if (has_second_ref(mbmi)) {
diff --git a/test/decode_to_md5.sh b/test/decode_to_md5.sh
index 27bea91..9710db2 100755
--- a/test/decode_to_md5.sh
+++ b/test/decode_to_md5.sh
@@ -57,7 +57,7 @@
decode_to_md5_av1() {
# expected MD5 sum for the last frame.
- local expected_md5="dc9d5c24d2c74994ecc361ae0d44e6cf"
+ local expected_md5="60db2035cd1389e2544bb151df476d8e"
local file="${AV1_IVF_FILE}"
# TODO(urvang): Check in the encoded file (like libvpx does) to avoid