summaryrefslogtreecommitdiff
path: root/vp9/simple_encode.h
diff options
context:
space:
mode:
authorangiebird <angiebird@google.com>2020-03-02 16:50:39 -0800
committerangiebird <angiebird@google.com>2020-03-03 10:57:03 -0800
commit483bcb310dea5a4fcb91af343408b14a9158ae29 (patch)
tree5858a64c355d2b462d0c74349b0c91609dd01c76 /vp9/simple_encode.h
parentfc898231f126a38db8c789be16c5d9e8dc72c293 (diff)
downloadlibvpx-483bcb310dea5a4fcb91af343408b14a9158ae29.tar
libvpx-483bcb310dea5a4fcb91af343408b14a9158ae29.tar.gz
libvpx-483bcb310dea5a4fcb91af343408b14a9158ae29.tar.bz2
libvpx-483bcb310dea5a4fcb91af343408b14a9158ae29.zip
Add key frame group info to SimpleEncode
Change-Id: I2c5abbe23c84c6d794e06ed6429136b10fb18683
Diffstat (limited to 'vp9/simple_encode.h')
-rw-r--r--vp9/simple_encode.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h
index 1a064c854..67007e5c3 100644
--- a/vp9/simple_encode.h
+++ b/vp9/simple_encode.h
@@ -306,12 +306,11 @@ class SimpleEncode {
// This function should be called after StartEncode() or EncodeFrame().
void EndEncode();
- // Given a key_frame_index, computes this key frame group's size.
// The key frame group size includes one key frame plus the number of
// following inter frames. Note that the key frame group size only counts the
// show frames. The number of no show frames like alternate refereces are not
// counted.
- int GetKeyFrameGroupSize(int key_frame_index) const;
+ int GetKeyFrameGroupSize() const;
// Provides the group of pictures that the next coding frame is in.
// Only call this function between StartEncode() and EndEncode()
@@ -355,11 +354,29 @@ class SimpleEncode {
std::vector<int> external_arf_indexes_;
GroupOfPicture group_of_picture_;
+ // The key frame group size includes one key frame plus the number of
+ // following inter frames. Note that the key frame group size only counts the
+ // show frames. The number of no show frames like alternate refereces are not
+ // counted.
+ int key_frame_group_size_;
+
+ // The index for the to-be-coded show frame in the key frame group.
+ int key_frame_group_index_;
+
+ // Update key_frame_group_size_ and reset key_frame_group_index_.
+ void UpdateKeyFrameGroup(int key_frame_show_index);
+
+ // Update key_frame_group_index_.
+ void PostUpdateKeyFrameGroupIndex(FrameType frame_type);
+
// Each show or no show frame is assigned with a coding index based on its
// coding order (starting from zero) in the coding process of the entire
// video. The coding index of the to-be-coded frame.
int frame_coding_index_;
+ // Number of show frames we have coded so far.
+ int show_frame_count_;
+
// TODO(angiebird): Do we need to reset ref_frames_info_ when the next key
// frame appears?
// Reference frames info of the to-be-coded frame.