1) Use kRefFrameTypeNone in the unit test 2) Reset mv_info in fp_motion_vector_info_init 3) Call fp_motion_vector_info_init() in first_pass_encode() 4) Set mv_info for intra frame. 5) Set mv_info with zero mv as default for inter frame 6) Remove duplicated fp_motion_vector_info in encode_frame_info
Showing the changes to test (1 of 4 files). Show all
Unified · Split
| @@ -74,8 +74,9 @@ TEST_F(SimpleEncodeTest, ObserveFirstPassMotionVectors) { · 73 unmodified lines | ||
| 74 | 74 | EXPECT_EQ(num_blocks, fps_motion_vectors[i].size()); |
| 75 | 75 | for (size_t j = 0; j < num_blocks; ++j) { |
| 76 | 76 | const int mv_count = fps_motion_vectors[i][j].mv_count; |
| 77 | − const int ref_count = (fps_motion_vectors[i][j].ref_frame[0] > 0) + | |
| 78 | − (fps_motion_vectors[i][j].ref_frame[1] > 0); | |
| 77 | + const int ref_count = | |
| 78 | + (fps_motion_vectors[i][j].ref_frame[0] != kRefFrameTypeNone) + | |
| 79 | + (fps_motion_vectors[i][j].ref_frame[1] != kRefFrameTypeNone); | |
| 79 | 80 | EXPECT_EQ(mv_count, ref_count); |
| 80 | 81 | } |
| 81 | 82 | } |