Unified · Split
| @@ -3847,6 +3847,9 @@ static void assign_motion_vector_info(const int block_width_4x4, · 3846 unmodified lines | ||
| 3847 | 3847 | const int col_4x4 = col_start_4x4 + j; |
| 3848 | 3848 | const int unit_index = row_4x4 * num_unit_cols + col_4x4; |
| 3849 | 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 | 3853 | motion_vector_info[unit_index].ref_frame[0] = source_ref_frame[0]; |
| 3851 | 3854 | motion_vector_info[unit_index].ref_frame[1] = source_ref_frame[1]; |
| 3852 | 3855 | motion_vector_info[unit_index].mv[0].as_mv.row = source_mv[0]->row; |
| @@ -4733,6 +4733,13 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data, · 4732 unmodified lines | ||
| 4733 | 4733 | mi->mv[0].as_int = xd->mi[0]->bmi[3].as_mv[0].as_int; |
| 4734 | 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 | 4744 | for (i = 0; i < REFERENCE_MODES; ++i) { |
| 4738 | 4745 | if (best_pred_rd[i] == INT64_MAX) |
| @@ -59,8 +59,10 @@ struct MotionVectorInfo { · 58 unmodified lines | ||
| 59 | 59 | // or kAltRefFrame. |
| 60 | 60 | RefFrameType ref_frame[2]; |
| 61 | 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 | 63 | double mv_row[2]; |
| 63 | 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 | 66 | double mv_column[2]; |
| 65 | 67 | }; |
| 66 | 68 | |