diff options
author | angiebird <angiebird@google.com> | 2020-05-27 00:30:11 -0700 |
---|---|---|
committer | angiebird <angiebird@google.com> | 2020-05-28 18:07:12 -0700 |
commit | 34034789d758440415306a637e6aea57f34e1a4c (patch) | |
tree | c5cbcd5772ba90ffec9226cb3cecfd4c3a234be8 /vp9/simple_encode.h | |
parent | 9c7e04a159f79994f0a19c1b0407cb3f029080fc (diff) | |
download | libvpx-34034789d758440415306a637e6aea57f34e1a4c.tar.gz libvpx-34034789d758440415306a637e6aea57f34e1a4c.tar.bz2 libvpx-34034789d758440415306a637e6aea57f34e1a4c.zip |
Add extra check / unit test to SetExternalGroupOfPicturesMap()
Let SetExternalGroupOfPicturesMap() modify the gop_map_ to satisfy
the following constraints.
1) Each key frame position should be at the start of a gop.
2) The last gop should not use an alt ref.
Add unit test for SetExternalGroupOfPicturesMap()
Change-Id: Iee9bd238ad0fc5c2ccbf2fbd065a280c854cd718
Diffstat (limited to 'vp9/simple_encode.h')
-rw-r--r-- | vp9/simple_encode.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h index 80ecafdab..d7c9dfa14 100644 --- a/vp9/simple_encode.h +++ b/vp9/simple_encode.h @@ -322,7 +322,7 @@ class SimpleEncode { std::vector<int> ObserveKeyFrameMap() const; // Sets group of pictures map for coding the entire video. - // Each entry in the gop_map is corresponding to a show frame in the video. + // Each entry in the gop_map corresponds to a show frame in the video. // Therefore, the size of gop_map should equal to the number of show frames in // the entire video. // If a given entry's kGopMapFlagStart is set, it means this is the start of a @@ -331,7 +331,16 @@ class SimpleEncode { // If a given entry is zero, it means it's in the middle of a gop. // This function should be called only once after ComputeFirstPassStats(), // before StartEncode(). - void SetExternalGroupOfPicture(std::vector<int> gop_map); + // This API will check and modify the gop_map to satisfy the following + // 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); + + // Observe the group of pictures map set through + // SetExternalGroupOfPicturesMap(). This function should be called after + // SetExternalGroupOfPicturesMap(). + std::vector<int> ObserveExternalGroupOfPicturesMap(); // Initializes the encoder for actual encoding. // This function should be called after ComputeFirstPassStats(). |