summaryrefslogtreecommitdiff
path: root/vp8/encoder/encodeframe.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2011-11-15 16:16:30 -0800
committerYaowu Xu <yaowu@google.com>2011-11-28 08:52:08 -0800
commit643238a3e02a1936fe9ddbfe2f1f7e046f25c8a0 (patch)
tree156067a4d06586689bd8bc3b0d3b9ac9ba9f2084 /vp8/encoder/encodeframe.c
parentee2051f6500cf2a576a50f966c5e43df42430f86 (diff)
downloadlibvpx-643238a3e02a1936fe9ddbfe2f1f7e046f25c8a0.tar
libvpx-643238a3e02a1936fe9ddbfe2f1f7e046f25c8a0.tar.gz
libvpx-643238a3e02a1936fe9ddbfe2f1f7e046f25c8a0.tar.bz2
libvpx-643238a3e02a1936fe9ddbfe2f1f7e046f25c8a0.zip
changed find_near_mvs search to include a mb from last frame
This is an experiment to include a mv contribution from last frame to nearest and near mv definition. Initial test showed some small though consistent gain. latest patch slightly better result ~.13%-~.18%. TODO: the entropy used to encode the mode choice, i.e. the mv counts based conditional distribution of modes should be re-collected to reflect this change, it is expected that there is some further gain from that. Change-Id: Ief1e284a36d8aa56b49ae5b360c91419ec494fa4
Diffstat (limited to 'vp8/encoder/encodeframe.c')
-rw-r--r--vp8/encoder/encodeframe.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index da6d7a451..22d53302a 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -767,6 +767,12 @@ void encode_mb_row(VP8_COMP *cpi,
// skip to next mb
xd->mode_info_context++;
+
+#if CONFIG_NEWNEAR
+ xd->prev_mode_info_context++;
+ assert((xd->prev_mode_info_context - cpi->common.prev_mip)
+ ==(xd->mode_info_context - cpi->common.mip));
+#endif
x->partition_info++;
xd->above_context++;
@@ -786,6 +792,9 @@ void encode_mb_row(VP8_COMP *cpi,
xd->dst.v_buffer + 8);
// this is to account for the border
+#if CONFIG_NEWNEAR
+ xd->prev_mode_info_context++;
+#endif
xd->mode_info_context++;
x->partition_info++;
@@ -829,6 +838,10 @@ void init_encode_frame_mb_context(VP8_COMP *cpi)
xd->mode_info_context = cm->mi;
xd->mode_info_stride = cm->mode_info_stride;
+#if CONFIG_NEWNEAR
+ xd->prev_mode_info_context = cm->prev_mi;
+#endif
+
xd->frame_type = cm->frame_type;
@@ -970,6 +983,11 @@ void vp8_encode_frame(VP8_COMP *cpi)
xd->mode_info_context = cm->mi;
+#if CONFIG_NEWNEAR
+ xd->prev_mode_info_context = cm->prev_mi;
+#endif
+
+
vp8_zero(cpi->MVcount);
vp8_zero(cpi->coef_counts);
@@ -1022,7 +1040,13 @@ void vp8_encode_frame(VP8_COMP *cpi)
x->src.u_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols;
x->src.v_buffer += 8 * x->src.uv_stride * (cpi->encoding_thread_count + 1) - 8 * cm->mb_cols;
- xd->mode_info_context += xd->mode_info_stride * cpi->encoding_thread_count;
+ xd->mode_info_context += xd->mode_info_stride
+ * cpi->encoding_thread_count;
+#if CONFIG_NEWNEAR
+ xd->prev_mode_info_context += xd->mode_info_stride
+ * cpi->encoding_thread_count;
+#endif
+
x->partition_info += xd->mode_info_stride * cpi->encoding_thread_count;
x->gf_active_ptr += cm->mb_cols * cpi->encoding_thread_count;