summaryrefslogtreecommitdiff
path: root/vp8/decoder/decodemv.c
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2012-08-24 15:44:01 +0100
committerPaul Wilkins <paulwilkins@google.com>2012-08-24 18:08:21 +0100
commit2d60bee1fbfb7e5b6862e4e636151effabae98e3 (patch)
tree3f0760847eaba681c8c708f6e4f029129cd81137 /vp8/decoder/decodemv.c
parent3777125ba66d15fef1436ea8871b3901a86c6991 (diff)
downloadlibvpx-2d60bee1fbfb7e5b6862e4e636151effabae98e3.tar
libvpx-2d60bee1fbfb7e5b6862e4e636151effabae98e3.tar.gz
libvpx-2d60bee1fbfb7e5b6862e4e636151effabae98e3.tar.bz2
libvpx-2d60bee1fbfb7e5b6862e4e636151effabae98e3.zip
New Motion Reference Search
Alternative strategy for finding a list of candidate motion vectors to use as reference values in mv coding and as nearest and near. Sort by sad in vp8_find_best_ref_mvs() rather than just pick the best. Allow 0,0 as a best ref option but not a nearest or near unless there are no alternatives. Encode/Decode verified on at least some clips. Some commented out experimental and stats code still in place. Gain over existing code averages about 1% on derf (alll metrics) with improvement on all clips. Other test results pending. The entropy coding of the mode (nearest/near etc) still depends upon and requires the old "findnear" code so this needs looking at and may provide room for further gains. Change-Id: I871d7cba1d1c379c4bad9bcccce1fb19c46b8247
Diffstat (limited to 'vp8/decoder/decodemv.c')
-rw-r--r--vp8/decoder/decodemv.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index 5e0600c2d..069d073d4 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -657,6 +657,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
prev_mi,
&nearest, &nearby, &best_mv, rct,
mbmi->ref_frame, cm->ref_frame_sign_bias);
+
#if CONFIG_NEWBESTREFMV
{
int ref_fb_idx;
@@ -679,6 +680,23 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
xd->pre.u_buffer = cm->yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset;
xd->pre.v_buffer = cm->yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset;
+#if CONFIG_NEW_MVREF
+ // Update stats on relative distance of chosen vector to the
+ // possible best reference vectors.
+ {
+ int i;
+ MV_REFERENCE_FRAME ref_frame = mbmi->ref_frame;
+
+ find_mv_refs(xd, mi, prev_mi,
+ ref_frame, mbmi->ref_mvs[ref_frame],
+ cm->ref_frame_sign_bias );
+
+ // Copy over the candidates.
+ vpx_memcpy(xd->ref_mv, mbmi->ref_mvs[ref_frame],
+ (MAX_MV_REFS * sizeof(int_mv)) );
+ }
+#endif
+
vp8_find_best_ref_mvs(xd,
xd->pre.y_buffer,
recon_y_stride,
@@ -763,6 +781,23 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
rct,
mbmi->second_ref_frame,
cm->ref_frame_sign_bias);
+
+#if CONFIG_NEW_MVREF
+ // Update stats on relative distance of chosen vector to the
+ // possible best reference vectors.
+ {
+ MV_REFERENCE_FRAME ref_frame = mbmi->second_ref_frame;
+
+ find_mv_refs(xd, mi, prev_mi,
+ ref_frame, mbmi->ref_mvs[ref_frame],
+ cm->ref_frame_sign_bias );
+
+ // Copy over the mv candidates
+ vpx_memcpy(xd->ref_mv, mbmi->ref_mvs[ref_frame],
+ (MAX_MV_REFS * sizeof(int_mv)) );
+ }
+#endif
+
vp8_find_best_ref_mvs(xd,
xd->second_pre.y_buffer,
recon_y_stride,