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.
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;
memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));
memset(&cm->next_ref_frame_map, -1, sizeof(cm->next_ref_frame_map));
- cm->current_video_frame = 0;
+ init_frame_indexes(cm);
pbi->ready_for_new_data = 1;
pbi->common.buffer_pool = pool;
vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
- cm->current_video_frame = 0;
+ init_frame_indexes(cm);
cpi->partition_search_skippable_frame = 0;
cpi->tile_data = NULL;
vp9_swap_mi_and_prev_mi(cm);
// Don't increment frame counters if this was an altref buffer
// update not a real frame
- ++cm->current_video_frame;
+ update_frame_indexes(cm, cm->show_frame);
if (cpi->use_svc) vp9_inc_frame_in_layer(cpi);
}
fclose(recon_file);
}
- ++cm->current_video_frame;
+ // In the first pass, every frame is considered as a show frame.
+ update_frame_indexes(cm, /*show_frame=*/1);
if (cpi->use_svc) vp9_inc_frame_in_layer(cpi);
}