summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_bitstream.c113
-rw-r--r--vp9/encoder/vp9_encodeframe.c10
-rw-r--r--vp9/encoder/vp9_firstpass.c27
-rw-r--r--vp9/encoder/vp9_firstpass.h4
-rw-r--r--vp9/encoder/vp9_mcomp.c18
-rw-r--r--vp9/encoder/vp9_mcomp.h3
-rw-r--r--vp9/encoder/vp9_onyx_if.c7
-rw-r--r--vp9/encoder/vp9_pickmode.c29
-rw-r--r--vp9/encoder/vp9_rdopt.c5
9 files changed, 104 insertions, 112 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 5655f2d77..585b69099 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -94,13 +94,13 @@ static void write_selected_tx_size(const VP9_COMP *cpi,
}
}
-static int write_skip(const VP9_COMP *cpi, int segment_id, MODE_INFO *m,
+static int write_skip(const VP9_COMP *cpi, int segment_id, const MODE_INFO *mi,
vp9_writer *w) {
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
if (vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
return 1;
} else {
- const int skip = m->mbmi.skip;
+ const int skip = mi->mbmi.skip;
vp9_write(w, skip, vp9_get_skip_prob(&cpi->common, xd));
return skip;
}
@@ -225,108 +225,107 @@ static void write_ref_frames(const VP9_COMP *cpi, vp9_writer *w) {
}
}
-static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
+static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi,
+ vp9_writer *w) {
VP9_COMMON *const cm = &cpi->common;
const nmv_context *nmvc = &cm->fc.nmvc;
- MACROBLOCK *const x = &cpi->mb;
- MACROBLOCKD *const xd = &x->e_mbd;
+ const MACROBLOCK *const x = &cpi->mb;
+ const MACROBLOCKD *const xd = &x->e_mbd;
const struct segmentation *const seg = &cm->seg;
- const MB_MODE_INFO *const mi = &m->mbmi;
- const MV_REFERENCE_FRAME ref0 = mi->ref_frame[0];
- const MV_REFERENCE_FRAME ref1 = mi->ref_frame[1];
- const MB_PREDICTION_MODE mode = mi->mode;
- const int segment_id = mi->segment_id;
- const BLOCK_SIZE bsize = mi->sb_type;
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
+ const MB_PREDICTION_MODE mode = mbmi->mode;
+ const int segment_id = mbmi->segment_id;
+ const BLOCK_SIZE bsize = mbmi->sb_type;
const int allow_hp = cm->allow_high_precision_mv;
- int skip;
+ const int is_inter = is_inter_block(mbmi);
+ const int is_compound = has_second_ref(mbmi);
+ int skip, ref;
if (seg->update_map) {
if (seg->temporal_update) {
- const int pred_flag = mi->seg_id_predicted;
+ const int pred_flag = mbmi->seg_id_predicted;
vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
- vp9_write(bc, pred_flag, pred_prob);
+ vp9_write(w, pred_flag, pred_prob);
if (!pred_flag)
- write_segment_id(bc, seg, segment_id);
+ write_segment_id(w, seg, segment_id);
} else {
- write_segment_id(bc, seg, segment_id);
+ write_segment_id(w, seg, segment_id);
}
}
- skip = write_skip(cpi, segment_id, m, bc);
+ skip = write_skip(cpi, segment_id, mi, w);
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME))
- vp9_write(bc, ref0 != INTRA_FRAME, vp9_get_intra_inter_prob(cm, xd));
+ vp9_write(w, is_inter, vp9_get_intra_inter_prob(cm, xd));
if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT &&
- !(ref0 != INTRA_FRAME &&
+ !(is_inter &&
(skip || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
- write_selected_tx_size(cpi, mi->tx_size, bsize, bc);
+ write_selected_tx_size(cpi, mbmi->tx_size, bsize, w);
}
- if (ref0 == INTRA_FRAME) {
+ if (!is_inter) {
if (bsize >= BLOCK_8X8) {
- write_intra_mode(bc, mode, cm->fc.y_mode_prob[size_group_lookup[bsize]]);
+ write_intra_mode(w, mode, cm->fc.y_mode_prob[size_group_lookup[bsize]]);
} else {
int idx, idy;
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
- const MB_PREDICTION_MODE bm = m->bmi[idy * 2 + idx].as_mode;
- write_intra_mode(bc, bm, cm->fc.y_mode_prob[0]);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
+ for (idy = 0; idy < 2; idy += num_4x4_h) {
+ for (idx = 0; idx < 2; idx += num_4x4_w) {
+ const MB_PREDICTION_MODE b_mode = mi->bmi[idy * 2 + idx].as_mode;
+ write_intra_mode(w, b_mode, cm->fc.y_mode_prob[0]);
}
}
}
- write_intra_mode(bc, mi->uv_mode, cm->fc.uv_mode_prob[mode]);
+ write_intra_mode(w, mbmi->uv_mode, cm->fc.uv_mode_prob[mode]);
} else {
- vp9_prob *mv_ref_p;
- write_ref_frames(cpi, bc);
- mv_ref_p = cm->fc.inter_mode_probs[mi->mode_context[ref0]];
+ const int mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]];
+ const vp9_prob *const inter_probs = cm->fc.inter_mode_probs[mode_ctx];
+ write_ref_frames(cpi, w);
// If segment skip is not enabled code the mode.
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
if (bsize >= BLOCK_8X8) {
- write_inter_mode(bc, mode, mv_ref_p);
- ++cm->counts.inter_mode[mi->mode_context[ref0]][INTER_OFFSET(mode)];
+ write_inter_mode(w, mode, inter_probs);
+ ++cm->counts.inter_mode[mode_ctx][INTER_OFFSET(mode)];
}
}
if (cm->interp_filter == SWITCHABLE) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
- vp9_write_token(bc, vp9_switchable_interp_tree,
+ vp9_write_token(w, vp9_switchable_interp_tree,
cm->fc.switchable_interp_prob[ctx],
- &switchable_interp_encodings[mi->interp_filter]);
+ &switchable_interp_encodings[mbmi->interp_filter]);
} else {
- assert(mi->interp_filter == cm->interp_filter);
+ assert(mbmi->interp_filter == cm->interp_filter);
}
if (bsize < BLOCK_8X8) {
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
int idx, idy;
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
+ for (idy = 0; idy < 2; idy += num_4x4_h) {
+ for (idx = 0; idx < 2; idx += num_4x4_w) {
const int j = idy * 2 + idx;
- const MB_PREDICTION_MODE b_mode = m->bmi[j].as_mode;
- write_inter_mode(bc, b_mode, mv_ref_p);
- ++cm->counts.inter_mode[mi->mode_context[ref0]][INTER_OFFSET(b_mode)];
+ const MB_PREDICTION_MODE b_mode = mi->bmi[j].as_mode;
+ write_inter_mode(w, b_mode, inter_probs);
+ ++cm->counts.inter_mode[mode_ctx][INTER_OFFSET(b_mode)];
if (b_mode == NEWMV) {
- vp9_encode_mv(cpi, bc, &m->bmi[j].as_mv[0].as_mv,
- &mi->ref_mvs[ref0][0].as_mv, nmvc, allow_hp);
-
- if (has_second_ref(mi))
- vp9_encode_mv(cpi, bc, &m->bmi[j].as_mv[1].as_mv,
- &mi->ref_mvs[ref1][0].as_mv, nmvc, allow_hp);
+ for (ref = 0; ref < 1 + is_compound; ++ref)
+ vp9_encode_mv(cpi, w, &mi->bmi[j].as_mv[ref].as_mv,
+ &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv,
+ nmvc, allow_hp);
}
}
}
- } else if (mode == NEWMV) {
- vp9_encode_mv(cpi, bc, &mi->mv[0].as_mv,
- &mi->ref_mvs[ref0][0].as_mv, nmvc, allow_hp);
-
- if (has_second_ref(mi))
- vp9_encode_mv(cpi, bc, &mi->mv[1].as_mv,
- &mi->ref_mvs[ref1][0].as_mv, nmvc, allow_hp);
+ } else {
+ if (mode == NEWMV) {
+ for (ref = 0; ref < 1 + is_compound; ++ref)
+ vp9_encode_mv(cpi, w, &mbmi->mv[ref].as_mv,
+ &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv, nmvc,
+ allow_hp);
+ }
}
}
}
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 435abddbe..57079dfd7 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -607,7 +607,7 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
mbmi = &xd->mi_8x8[0]->mbmi;
// Set up destination pointers
- setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
+ vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
// Set up limit values for MV components
// mv beyond the range do not produce new/different prediction block
@@ -2082,8 +2082,9 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
vp9_setup_src_planes(x, cpi->Source, 0, 0);
// TODO(jkoleszar): are these initializations required?
- setup_pre_planes(xd, 0, get_ref_frame_buffer(cpi, LAST_FRAME), 0, 0, NULL);
- setup_dst_planes(xd, get_frame_new_buffer(cm), 0, 0);
+ vp9_setup_pre_planes(xd, 0, get_ref_frame_buffer(cpi, LAST_FRAME), 0, 0,
+ NULL);
+ vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), 0, 0);
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
@@ -2801,7 +2802,8 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
for (ref = 0; ref < 1 + is_compound; ++ref) {
YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi,
mbmi->ref_frame[ref]);
- setup_pre_planes(xd, ref, cfg, mi_row, mi_col, &xd->block_refs[ref]->sf);
+ vp9_setup_pre_planes(xd, ref, cfg, mi_row, mi_col,
+ &xd->block_refs[ref]->sf);
}
vp9_build_inter_predictors_sb(xd, mi_row, mi_col, MAX(bsize, BLOCK_8X8));
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index d83c4357b..f548de503 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -20,7 +20,7 @@
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_quant_common.h"
-#include "vp9/common/vp9_reconinter.h" // setup_dst_planes()
+#include "vp9/common/vp9_reconinter.h" // vp9_setup_dst_planes()
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/encoder/vp9_block.h"
@@ -95,7 +95,7 @@ static int kfboost_qadjust(int qindex) {
// 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;
}
@@ -504,8 +504,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
vp9_clear_system_state();
vp9_setup_src_planes(x, cpi->Source, 0, 0);
- setup_pre_planes(xd, 0, lst_yv12, 0, 0, NULL);
- setup_dst_planes(xd, new_yv12, 0, 0);
+ vp9_setup_pre_planes(xd, 0, lst_yv12, 0, 0, NULL);
+ vp9_setup_dst_planes(xd, new_yv12, 0, 0);
xd->mi_8x8 = cm->mi_grid_visible;
xd->mi_8x8[0] = cm->mi;
@@ -903,7 +903,7 @@ extern void vp9_new_framerate(VP9_COMP *cpi, double framerate);
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;
@@ -1011,7 +1011,7 @@ static int detect_transition_to_still(VP9_COMP *cpi, int frame_interval,
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...
@@ -1346,7 +1346,7 @@ void define_fixed_arf_period(VP9_COMP *cpi) {
// 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;
@@ -1793,19 +1793,12 @@ static int test_candidate_kf(VP9_COMP *cpi,
((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 /
@@ -1861,7 +1854,7 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
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;
diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h
index 03c0e20bb..9f44a307b 100644
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -43,7 +43,9 @@ struct twopass_rc {
unsigned int this_iiratio;
FIRSTPASS_STATS total_stats;
FIRSTPASS_STATS this_frame_stats;
- FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start;
+ const FIRSTPASS_STATS *stats_in;
+ const FIRSTPASS_STATS *stats_in_start;
+ const FIRSTPASS_STATS *stats_in_end;
FIRSTPASS_STATS total_left_stats;
int first_pass_done;
int64_t bits_left;
diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c
index 3ff4a672d..26f1a0289 100644
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -711,23 +711,21 @@ static int vp9_pattern_search(const MACROBLOCK *x,
}
int vp9_get_mvpred_var(const MACROBLOCK *x,
- MV *best_mv,
- const MV *center_mv,
+ const MV *best_mv, const MV *center_mv,
const vp9_variance_fn_ptr_t *vfp,
int use_mvcost) {
- unsigned int bestsad;
- MV this_mv;
+ unsigned int unused;
+
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const int in_what_stride = xd->plane[0].pre[0].stride;
const uint8_t *base_offset = xd->plane[0].pre[0].buf;
- const uint8_t *this_offset = base_offset + (best_mv->row * in_what_stride) +
- best_mv->col;
- this_mv.row = best_mv->row * 8;
- this_mv.col = best_mv->col * 8;
- return vfp->vf(what, what_stride, this_offset, in_what_stride, &bestsad) +
- (use_mvcost ? mv_err_cost(&this_mv, center_mv, x->nmvjointcost,
+ const uint8_t *this_offset = &base_offset[best_mv->row * in_what_stride +
+ best_mv->col];
+ const MV mv = {best_mv->row * 8, best_mv->col * 8};
+ return vfp->vf(what, what_stride, this_offset, in_what_stride, &unused) +
+ (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost,
x->mvcost, x->errorperbit) : 0);
}
diff --git a/vp9/encoder/vp9_mcomp.h b/vp9/encoder/vp9_mcomp.h
index e1e149e5f..917de75e6 100644
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -38,8 +38,7 @@ int vp9_mv_bit_cost(const MV *mv, const MV *ref,
// Utility to compute variance + MV rate cost for a given MV
int vp9_get_mvpred_var(const MACROBLOCK *x,
- MV *best_mv,
- const MV *center_mv,
+ const MV *best_mv, const MV *center_mv,
const vp9_variance_fn_ptr_t *vfp,
int use_mvcost);
int vp9_get_mvpred_av_var(const MACROBLOCK *x,
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 318e7168f..57d2c78ab 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1879,13 +1879,12 @@ VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf) {
if (cpi->pass == 1) {
vp9_init_first_pass(cpi);
} else if (cpi->pass == 2) {
- size_t packet_sz = sizeof(FIRSTPASS_STATS);
- int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
+ const size_t packet_sz = sizeof(FIRSTPASS_STATS);
+ const int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
cpi->twopass.stats_in = cpi->twopass.stats_in_start;
- cpi->twopass.stats_in_end = (void *)((char *)cpi->twopass.stats_in
- + (packets - 1) * packet_sz);
+ cpi->twopass.stats_in_end = &cpi->twopass.stats_in[packets - 1];
vp9_init_second_pass(cpi);
}
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 9ece4593d..c10b4f3e2 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -59,7 +59,7 @@ static int full_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[i] = xd->plane[i].pre[0];
- setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
}
vp9_set_mv_search_range(x, &ref_mv);
@@ -170,7 +170,7 @@ static void sub_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[i] = xd->plane[i].pre[0];
- setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
}
tmp_mv->col >>= 3;
@@ -198,9 +198,9 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
// Note our transform coeffs are 8 times an orthogonal transform.
// Hence quantizer step is also 8 times. To get effective quantizer
// we need to divide by 8 before sending to modeling function.
- int64_t rate_sum = 0;
- int64_t dist_sum = 0;
unsigned int sse;
+ int rate;
+ int64_t dist;
struct macroblock_plane *const p = &x->plane[0];
@@ -210,18 +210,11 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
(void) cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride, &sse);
- {
- int rate;
- int64_t dist;
- vp9_model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs],
- pd->dequant[1] >> 3, &rate, &dist);
- rate_sum += rate;
- dist_sum += dist;
- }
-
+ vp9_model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs],
+ pd->dequant[1] >> 3, &rate, &dist);
- *out_rate_sum = (int)rate_sum;
- *out_dist_sum = dist_sum << 4;
+ *out_rate_sum = rate;
+ *out_dist_sum = dist << 4;
}
// TODO(jingning) placeholder for inter-frame non-RD mode decision.
@@ -317,6 +310,11 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
&frame_mv[NEWMV][ref_frame].as_mv);
}
+ if (this_mode != NEARESTMV)
+ if (frame_mv[this_mode][ref_frame].as_int ==
+ frame_mv[NEARESTMV][ref_frame].as_int)
+ continue;
+
mbmi->mode = this_mode;
mbmi->mv[0].as_int = frame_mv[this_mode][ref_frame].as_int;
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
@@ -362,5 +360,6 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
}
}
}
+
return INT64_MAX;
}
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 4be4c50d1..0542a3447 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2401,7 +2401,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[i] = xd->plane[i].pre[0];
- setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
}
vp9_set_mv_search_range(x, &ref_mv);
@@ -2564,7 +2564,8 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
// motion search code to be used without additional modifications.
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[ref][i] = xd->plane[i].pre[ref];
- setup_pre_planes(xd, ref, scaled_ref_frame[ref], mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, ref, scaled_ref_frame[ref], mi_row, mi_col,
+ NULL);
}
frame_mv[refs[ref]].as_int = single_newmv[refs[ref]].as_int;