diff options
author | angiebird <angiebird@google.com> | 2020-02-26 16:43:50 -0800 |
---|---|---|
committer | angiebird <angiebird@google.com> | 2020-03-02 20:17:09 -0800 |
commit | 93834facfb9715b1eafec761cdeca91dde1dce1b (patch) | |
tree | 67d7e699e7a455f9990e3f007083c733e258d88d /vp9/common/vp9_onyxc_int.h | |
parent | a1c0c95c8c6dbab14c1223cdfdd0dc62022c6444 (diff) | |
download | libvpx-93834facfb9715b1eafec761cdeca91dde1dce1b.tar libvpx-93834facfb9715b1eafec761cdeca91dde1dce1b.tar.gz libvpx-93834facfb9715b1eafec761cdeca91dde1dce1b.tar.bz2 libvpx-93834facfb9715b1eafec761cdeca91dde1dce1b.zip |
Add init/update_frame_indexes()
We will init and update current_video_frame and
current_frame_coding_index in the functions.
So it's easier to keep track of when the frame indexes are updated.
Change-Id: Id6ba46643f8923348bb4f81c5dd9ace553244057
Diffstat (limited to 'vp9/common/vp9_onyxc_int.h')
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index f3942a8f0..60759f3b3 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -226,7 +226,16 @@ typedef struct VP9Common { unsigned int frame_context_idx; /* Context to use/update */ FRAME_COUNTS counts; + // TODO(angiebird): current_video_frame/current_frame_coding_index into a + // structure unsigned int current_video_frame; +#if CONFIG_RATE_CTRL + // Each show or no show frame is assigned with a coding index based on its + // coding order (starting from zero). + + // Current frame's coding index. + int current_frame_coding_index; +#endif BITSTREAM_PROFILE profile; // VPX_BITS_8 in profile 0 or 1, VPX_BITS_10 or VPX_BITS_12 in profile 2 or 3. @@ -254,6 +263,22 @@ typedef struct VP9Common { int lf_row; } VP9_COMMON; +static INLINE void init_frame_indexes(VP9_COMMON *cm) { + cm->current_video_frame = 0; +#if CONFIG_RATE_CTRL + cm->current_frame_coding_index = 0; +#endif // CONFIG_RATE_CTRL +} + +static INLINE void update_frame_indexes(VP9_COMMON *cm, int show_frame) { + if (show_frame) { + ++cm->current_video_frame; + } +#if CONFIG_RATE_CTRL + ++cm->current_frame_coding_index; +#endif // CONFIG_RATE_CTRL +} + typedef struct { int frame_width; int frame_height; |