ref: e753d4930f3b2859968068ffb77f6a6159b2f3c6
parent: 812eb89b26e6fe458133e90e74b0a11b853df56d
author: angiebird <angiebird@google.com>
date: Thu Jun 11 11:10:38 EDT 2020
Let SetExternalGroupOfPicturesMap use c-style arr Change-Id: Ic92ce5a3cc5bb74120eb32fc6219e43b1b861f14
--- a/test/simple_encode_test.cc
+++ b/test/simple_encode_test.cc
@@ -389,7 +389,7 @@
frame_rate_den_, target_bitrate_, num_frames_,
in_file_path_str_.c_str());
simple_encode.ComputeFirstPassStats();
- simple_encode.SetExternalGroupOfPicturesMap(gop_map);
+ simple_encode.SetExternalGroupOfPicturesMap(gop_map.data(), gop_map.size());
const int num_coding_frames = simple_encode.GetCodingFrameNum();
EXPECT_EQ(static_cast<size_t>(num_coding_frames),
quantize_index_list.size());
@@ -427,7 +427,7 @@
// Last gop group.
gop_map[14] |= kGopMapFlagStart | kGopMapFlagUseAltRef;
- simple_encode.SetExternalGroupOfPicturesMap(gop_map);
+ simple_encode.SetExternalGroupOfPicturesMap(gop_map.data(), gop_map.size());
std::vector<int> observed_gop_map =
simple_encode.ObserveExternalGroupOfPicturesMap();
--- a/vp9/simple_encode.cc
+++ b/vp9/simple_encode.cc
@@ -806,8 +806,11 @@
return output_stats;
}
-void SimpleEncode::SetExternalGroupOfPicturesMap(std::vector<int> gop_map) {
- gop_map_ = gop_map;
+void SimpleEncode::SetExternalGroupOfPicturesMap(int *gop_map,
+ int gop_map_size) {
+ for (int i = 0; i < gop_map_size; ++i) {
+ gop_map_.push_back(gop_map[i]);
+ }
// The following will check and modify gop_map_ to make sure the
// gop_map_ satisfies the constraints.
// 1) Each key frame position should be at the start of a gop.
--- a/vp9/simple_encode.h
+++ b/vp9/simple_encode.h
@@ -335,7 +335,7 @@
// constraints.
// 1) Each key frame position should be at the start of a gop.
// 2) The last gop should not use an alt ref.
- void SetExternalGroupOfPicturesMap(std::vector<int> gop_map);
+ void SetExternalGroupOfPicturesMap(int *gop_map, int gop_map_size);
// Observe the group of pictures map set through
// SetExternalGroupOfPicturesMap(). This function should be called after