History

Merge "Set mv to zero if the second ref does not exist"

Cheng Chen committed 6 years ago

Commit 6ca77eb2 parents b7075bc 9d5bc183 files · +12 −0Browse files

Unified · Split

3 files
  1. vp9/encoder/vp9_encodeframe.c +3 −0
  2. vp9/encoder/vp9_rdopt.c +7 −0
  3. vp9/simple_encode.h +2 −0
vp9/encoder/vp9_encodeframe.c+3−0
@@ -3847,6 +3847,9 @@ static void assign_motion_vector_info(const int block_width_4x4, · 3846 unmodified lines
38473847 const int col_4x4 = col_start_4x4 + j;
38483848 const int unit_index = row_4x4 * num_unit_cols + col_4x4;
38493849 if (row_4x4 >= num_unit_rows || col_4x4 >= num_unit_cols) continue;
3850+ if (source_ref_frame[1] == NONE) {
3851+ assert(source_mv[1]->row == 0 && source_mv[1]->col == 0);
3852+ }
38503853 motion_vector_info[unit_index].ref_frame[0] = source_ref_frame[0];
38513854 motion_vector_info[unit_index].ref_frame[1] = source_ref_frame[1];
38523855 motion_vector_info[unit_index].mv[0].as_mv.row = source_mv[0]->row;
vp9/encoder/vp9_rdopt.c+7−0
@@ -4733,6 +4733,13 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data, · 4732 unmodified lines
47334733 mi->mv[0].as_int = xd->mi[0]->bmi[3].as_mv[0].as_int;
47344734 mi->mv[1].as_int = xd->mi[0]->bmi[3].as_mv[1].as_int;
47354735 }
4736+ // If the second reference does not exist, set the corresponding mv to zero.
4737+ if (mi->ref_frame[1] == NONE) {
4738+ mi->mv[1].as_int = 0;
4739+ for (i = 0; i < 4; ++i) {
4740+ mi->bmi[i].as_mv[1].as_int = 0;
4741+ }
4742+ }
47364743
47374744 for (i = 0; i < REFERENCE_MODES; ++i) {
47384745 if (best_pred_rd[i] == INT64_MAX)
vp9/simple_encode.h+2−0
@@ -59,8 +59,10 @@ struct MotionVectorInfo { · 58 unmodified lines
5959 // or kAltRefFrame.
6060 RefFrameType ref_frame[2];
6161 // The row offset of motion vectors in the unit of pixel.
62+ // If the second motion vector does not exist, the value is 0.
6263 double mv_row[2];
6364 // The column offset of motion vectors in the unit of pixel.
65+ // If the second motion vector does not exist, the value is 0.
6466 double mv_column[2];
6567 };
6668

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t