summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rdopt.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2017-03-31 10:39:57 -0700
committerYunqing Wang <yunqingwang@google.com>2017-04-06 00:50:56 +0000
commit1aa46abbdfc31e02e139eb0fa8b73b9527006e04 (patch)
tree352218e8d03ea98d3434f02acfaa5a4065ded3ed /vp9/encoder/vp9_rdopt.c
parent41fac447073466a1186f28f3cff21fbc528592f5 (diff)
downloadlibvpx-1aa46abbdfc31e02e139eb0fa8b73b9527006e04.tar
libvpx-1aa46abbdfc31e02e139eb0fa8b73b9527006e04.tar.gz
libvpx-1aa46abbdfc31e02e139eb0fa8b73b9527006e04.tar.bz2
libvpx-1aa46abbdfc31e02e139eb0fa8b73b9527006e04.zip
VP9 motion vector unit test
To prevent the motion vector out of range bug, added a motion vector unit test in VP9. In the 4k video encoding, always forced to use extreme motion vectors and also encouraged to use INTER modes. In the decoding, checked if the motion vector was valid, and also checked the encoder/decoder mismatch. The tests showed that this unit test could reveal the issue we saw before. Change-Id: I0a880bd847dad8a13f7fd2012faf6868b02fa3b4
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r--vp9/encoder/vp9_rdopt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index bbfc2dc4b..d23d32446 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3241,6 +3241,9 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
if (best_rd < mode_threshold[mode_index]) continue;
+ // This is only used in motion vector unit test.
+ if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
+
if (sf->motion_field_mode_search) {
const int mi_width = VPXMIN(num_8x8_blocks_wide_lookup[bsize],
tile_info->mi_col_end - mi_col);
@@ -3924,6 +3927,9 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
&rd_thresh_freq_fact[ref_index]))
continue;
+ // This is only used in motion vector unit test.
+ if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
+
comp_pred = second_ref_frame > INTRA_FRAME;
if (comp_pred) {
if (!cpi->allow_comp_inter_inter) continue;