// Resets the first pass file to the given position using a relative seek from
// the current position.
static void reset_fpf_position(struct twopass_rc *p,
- FIRSTPASS_STATS *position) {
+ const FIRSTPASS_STATS *position) {
p->stats_in = position;
}
x->sadperbit16, &num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
+ if (tmp_err < INT_MAX)
+ tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
&num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
+ if (tmp_err < INT_MAX)
+ tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
mv.as_mv.row *= 8;
mv.as_mv.col *= 8;
this_error = motion_error;
- vp9_set_mbmode_and_mvs(xd, NEWMV, &mv.as_mv);
+ xd->mi_8x8[0]->mbmi.mode = NEWMV;
+ xd->mi_8x8[0]->mbmi.mv[0] = mv;
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
void vp9_init_second_pass(VP9_COMP *cpi) {
FIRSTPASS_STATS this_frame;
- FIRSTPASS_STATS *start_pos;
+ const FIRSTPASS_STATS *start_pos;
struct twopass_rc *const twopass = &cpi->twopass;
const VP9_CONFIG *const oxcf = &cpi->oxcf;
loop_decay_rate >= 0.999 &&
last_decay_rate < 0.9) {
int j;
- FIRSTPASS_STATS *position = cpi->twopass.stats_in;
+ const FIRSTPASS_STATS *position = cpi->twopass.stats_in;
FIRSTPASS_STATS tmp_next_frame;
// Look ahead a few frames to see if static condition persists...
// Analyse and define a gf/arf group.
static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
FIRSTPASS_STATS next_frame = { 0 };
- FIRSTPASS_STATS *start_pos;
+ const FIRSTPASS_STATS *start_pos;
struct twopass_rc *const twopass = &cpi->twopass;
int i;
double boost_score = 0.0;
((next_frame->intra_error /
DOUBLE_DIVIDE_CHECK(next_frame->coded_error)) > 3.5))))) {
int i;
- FIRSTPASS_STATS *start_pos;
-
- FIRSTPASS_STATS local_next_frame;
-
+ const FIRSTPASS_STATS *start_pos = cpi->twopass.stats_in;
+ FIRSTPASS_STATS local_next_frame = *next_frame;
double boost_score = 0.0;
double old_boost_score = 0.0;
double decay_accumulator = 1.0;
- local_next_frame = *next_frame;
-
- // Note the starting file position so we can reset to it.
- start_pos = cpi->twopass.stats_in;
-
// Examine how well the key frame predicts subsequent frames.
for (i = 0; i < 16; ++i) {
double next_iiratio = (IIKFACTOR1 * local_next_frame.intra_error /
FIRSTPASS_STATS last_frame;
FIRSTPASS_STATS first_frame;
FIRSTPASS_STATS next_frame;
- FIRSTPASS_STATS *start_position;
+ const FIRSTPASS_STATS *start_position;
double decay_accumulator = 1.0;
double zero_motion_accumulator = 1.0;