#define MIN_GF_INTERVAL 4
#endif
+
// #define LONG_TERM_VBR_CORRECTION
static void swap_yv12(YV12_BUFFER_CONFIG *a, YV12_BUFFER_CONFIG *b) {
TileInfo tile;
struct macroblock_plane *const p = x->plane;
struct macroblockd_plane *const pd = xd->plane;
- const PICK_MODE_CONTEXT *ctx = &x->pc_root->none;
+ const PICK_MODE_CONTEXT *ctx = &cpi->pc_root->none;
int i;
int recon_yoffset, recon_uvoffset;
vp9_setup_src_planes(x, cpi->Source, 0, 0);
vp9_setup_pre_planes(xd, 0, first_ref_buf, 0, 0, NULL);
- vp9_setup_dst_planes(xd, new_yv12, 0, 0);
+ vp9_setup_dst_planes(xd->plane, new_yv12, 0, 0);
xd->mi = cm->mi_grid_visible;
xd->mi[0] = cm->mi;
static void calculate_section_intra_ratio(struct twopass_rc *twopass,
const FIRSTPASS_STATS *start_pos,
int section_length) {
- FIRSTPASS_STATS next_frame = { 0 };
- FIRSTPASS_STATS sectionstats = { 0 };
+ FIRSTPASS_STATS next_frame;
+ FIRSTPASS_STATS sectionstats;
int i;
+ vp9_zero(next_frame);
+ vp9_zero(sectionstats);
+
reset_fpf_position(twopass, start_pos);
for (i = 0; i < section_length; ++i) {
RATE_CONTROL *const rc = &cpi->rc;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
struct twopass_rc *const twopass = &cpi->twopass;
- FIRSTPASS_STATS next_frame = { 0 };
+ FIRSTPASS_STATS next_frame;
const FIRSTPASS_STATS *start_pos;
int i;
double boost_score = 0.0;
int flash_detected;
int active_max_gf_interval;
- twopass->gf_group_bits = 0;
-
vp9_clear_system_state();
+ vp9_zero(next_frame);
+ twopass->gf_group_bits = 0;
start_pos = twopass->stats_in;
// Load stats for the current frame.
int target;
LAYER_CONTEXT *lc = NULL;
- int is_spatial_svc = (cpi->use_svc && cpi->svc.number_temporal_layers == 1);
-
+ const int is_spatial_svc = (cpi->use_svc &&
+ cpi->svc.number_temporal_layers == 1);
if (is_spatial_svc) {
lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id];
frames_left = (int)(twopass->total_stats.count -
this_frame_copy = this_frame;
find_next_key_frame(cpi, &this_frame_copy);
// Don't place key frame in any enhancement layers in spatial svc
- if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ if (is_spatial_svc) {
lc->is_key_frame = 1;
if (cpi->svc.spatial_layer_id > 0) {
cm->frame_type = INTER_FRAME;
}
}
} else {
- if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ if (is_spatial_svc) {
lc->is_key_frame = 0;
}
cm->frame_type = INTER_FRAME;