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
3847 const int col_4x4 = col_start_4x4 + j;3847 const int col_4x4 = col_start_4x4 + j;
3848 const int unit_index = row_4x4 * num_unit_cols + col_4x4;3848 const int unit_index = row_4x4 * num_unit_cols + col_4x4;
3849 if (row_4x4 >= num_unit_rows || col_4x4 >= num_unit_cols) continue;3849 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 }
3850 motion_vector_info[unit_index].ref_frame[0] = source_ref_frame[0];3853 motion_vector_info[unit_index].ref_frame[0] = source_ref_frame[0];
3851 motion_vector_info[unit_index].ref_frame[1] = source_ref_frame[1];3854 motion_vector_info[unit_index].ref_frame[1] = source_ref_frame[1];
3852 motion_vector_info[unit_index].mv[0].as_mv.row = source_mv[0]->row;3855 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
4733 mi->mv[0].as_int = xd->mi[0]->bmi[3].as_mv[0].as_int;4733 mi->mv[0].as_int = xd->mi[0]->bmi[3].as_mv[0].as_int;
4734 mi->mv[1].as_int = xd->mi[0]->bmi[3].as_mv[1].as_int;4734 mi->mv[1].as_int = xd->mi[0]->bmi[3].as_mv[1].as_int;
4735 }4735 }
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 }
4736 4743
4737 for (i = 0; i < REFERENCE_MODES; ++i) {4744 for (i = 0; i < REFERENCE_MODES; ++i) {
4738 if (best_pred_rd[i] == INT64_MAX)4745 if (best_pred_rd[i] == INT64_MAX)
vp9/simple_encode.h+2−0
@@ -59,8 +59,10 @@ struct MotionVectorInfo { · 58 unmodified lines
59 // or kAltRefFrame.59 // or kAltRefFrame.
60 RefFrameType ref_frame[2];60 RefFrameType ref_frame[2];
61 // The row offset of motion vectors in the unit of pixel.61 // The row offset of motion vectors in the unit of pixel.
62 // If the second motion vector does not exist, the value is 0.
62 double mv_row[2];63 double mv_row[2];
63 // The column offset of motion vectors in the unit of pixel.64 // The column offset of motion vectors in the unit of pixel.
65 // If the second motion vector does not exist, the value is 0.
64 double mv_column[2];66 double mv_column[2];
65};67};
66 68

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