]> granicus.if.org Git - libvpx/commitdiff
Let SetExternalGroupOfPicturesMap use c-style arr
authorangiebird <angiebird@google.com>
Thu, 11 Jun 2020 22:10:38 +0000 (15:10 -0700)
committerangiebird <angiebird@google.com>
Thu, 11 Jun 2020 22:10:38 +0000 (15:10 -0700)
Change-Id: Ic92ce5a3cc5bb74120eb32fc6219e43b1b861f14

test/simple_encode_test.cc
vp9/simple_encode.cc
vp9/simple_encode.h

index a85675133b352a95d2bcd42c9fc75d34eae66fb1..69bed5a51a7c7b203bcb3c0219773145ae25de0b 100644 (file)
@@ -389,7 +389,7 @@ TEST_F(SimpleEncodeTest, EncodeConsistencySetExternalGroupOfPicturesMap) {
                                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 @@ TEST_F(SimpleEncodeTest, SetExternalGroupOfPicturesMap) {
   // 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();
index bce52e28cab13228ad8b233abde6757791d4543e..7bce91f7f0e3a0bfcd1aea5e36146a32336e503f 100644 (file)
@@ -806,8 +806,11 @@ std::vector<std::vector<double>> SimpleEncode::ObserveFirstPassStats() {
   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.
index d7c9dfa1401dabddaf9bb050ab777954145f06a1..b21732070164a961e5d3ac02f44a6ad64bfb303e 100644 (file)
@@ -335,7 +335,7 @@ class SimpleEncode {
   // 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