rd_use_partition(cpi, tile, mi, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1, cpi->pc_root);
} else {
+ GF_GROUP * gf_grp = &cpi->twopass.gf_group;
+ int last_was_mid_sequence_overlay = 0;
+ if ((cpi->pass == 2) && (gf_grp->index)) {
+ if (gf_grp->update_type[gf_grp->index - 1] == OVERLAY_UPDATE)
+ last_was_mid_sequence_overlay = 1;
+ }
if ((cm->current_video_frame
% sf->last_partitioning_redo_frequency) == 0
+ || last_was_mid_sequence_overlay
|| cm->prev_mi == 0
|| cm->show_frame == 0
|| cm->frame_type == KEY_FRAME
cm->show_frame = 1;
cm->intra_only = 0;
- // Check to see if the frame to be encoded is an overlay
- // for a previous arf frame and if so configure it as such.
- if (cpi->pass == 0)
- is_src_altref(cpi);
+ // Check to see if the frame to be encoded is an overlay for a previous
+ // arf frame and if so configure it as such.
+ is_src_altref(cpi);
}
}
twopass->gf_group.rf_level[frame_index] = GF_ARF_STD;
twopass->gf_group.bit_allocation[frame_index] = gf_arf_bits;
twopass->gf_group.arf_src_offset[frame_index] =
- rc->baseline_gf_interval - 1;
+ (unsigned char)(rc->baseline_gf_interval - 1);
twopass->gf_group.arf_update_idx[frame_index] = 2;
twopass->gf_group.arf_ref_idx[frame_index] = 2;
++frame_index;
twopass->gf_group.update_type[frame_index] = ARF_UPDATE;
twopass->gf_group.rf_level[frame_index] = GF_ARF_LOW;
twopass->gf_group.arf_src_offset[frame_index] =
- ((rc->baseline_gf_interval - 1) >> 1);
+ (unsigned char)((rc->baseline_gf_interval >> 1) - 1);
twopass->gf_group.arf_update_idx[frame_index] = 3;
twopass->gf_group.arf_ref_idx[frame_index] = 2;
++frame_index;
twopass->gf_group.arf_update_idx[frame_index] = 2;
twopass->gf_group.arf_ref_idx[frame_index] = 2;
}
+ } else {
+ twopass->gf_group.arf_update_idx[frame_index] = 2;
+ twopass->gf_group.arf_ref_idx[frame_index] = 2;
}
target_frame_size = clamp(target_frame_size, 0,
twopass->gf_group.bit_allocation[middle_frame_idx] + mid_boost_bits;
twopass->gf_group.update_type[middle_frame_idx] = OVERLAY_UPDATE;
twopass->gf_group.bit_allocation[middle_frame_idx] = 0;
+
+ // Configure the overlay frame at the end of the sequence that will also
+ // be the start frame of the next group. The reason for doing this here
+ // is that on entry to vp9_get_compressed_data() for the overlay
+ // frame, but before the call to vp9_rc_get_second_pass_params() the
+ // data will otherwise be undefined.
+ twopass->gf_group.update_type[frame_index] = OVERLAY_UPDATE;
+ twopass->gf_group.rf_level[frame_index] = INTER_NORMAL;
+ twopass->gf_group.arf_update_idx[frame_index] = 2;
+ twopass->gf_group.arf_ref_idx[frame_index] = 2;
}
}
if (speed >= 2) {
if (MIN(cm->width, cm->height) >= 720) {
- sf->lf_motion_threshold = LOW_MOITION_THRESHOLD;
+ sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
sf->last_partitioning_redo_frequency = 3;
sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
: DISABLE_ALL_INTER_SPLIT;
} else {
sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
sf->last_partitioning_redo_frequency = 2;
- sf->lf_motion_threshold = NO_MOITION_THRESHOLD;
+ sf->lf_motion_threshold = NO_MOTION_THRESHOLD;
}
- sf->adaptive_pred_interp_filter = 2;
+
+ sf->adaptive_pred_interp_filter = 0;
sf->reference_masking = 1;
sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
FLAG_SKIP_INTRA_BESTINTER |
else
sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
- sf->lf_motion_threshold = LOW_MOITION_THRESHOLD;
+ sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
sf->last_partitioning_redo_frequency = 3;
sf->recode_loop = ALLOW_RECODE_KFMAXBW;
sf->adaptive_rd_thresh = 3;
sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
- sf->lf_motion_threshold = LOW_MOITION_THRESHOLD;
+ sf->lf_motion_threshold = LOW_MOTION_THRESHOLD;
sf->adjust_partitioning_from_last_frame = 1;
sf->last_partitioning_redo_frequency = 3;
sf->use_lp32x32fdct = 1;
} SUBPEL_SEARCH_METHODS;
typedef enum {
- NO_MOITION_THRESHOLD = 0,
- LOW_MOITION_THRESHOLD = 7
+ NO_MOTION_THRESHOLD = 0,
+ LOW_MOTION_THRESHOLD = 7
} MOTION_THRESHOLD;
typedef enum {