summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodemv.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_encodemv.c')
-rw-r--r--vp9/encoder/vp9_encodemv.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_encodemv.c b/vp9/encoder/vp9_encodemv.c
index 500f57442..f0c34b373 100644
--- a/vp9/encoder/vp9_encodemv.c
+++ b/vp9/encoder/vp9_encodemv.c
@@ -486,11 +486,11 @@ void vp9_encode_mv(VP9_COMP* cpi, vp9_writer* w,
if (mv_joint_horizontal(j))
encode_mv_component(w, diff.col, &mvctx->comps[1], usehp);
- // If auto_mv_step_size is enabled and it is an arf/non shown frame
- // then keep track of the largest motion vector component used.
- if (cpi->sf.auto_mv_step_size && !cpi->common.show_frame) {
- cpi->max_mv_magnitude = MAX((MAX(abs(mv->row), abs(mv->col)) >> 3),
- cpi->max_mv_magnitude);
+ // If auto_mv_step_size is enabled then keep track of the largest
+ // motion vector component used.
+ if (!cpi->dummy_packing && cpi->sf.auto_mv_step_size) {
+ unsigned int maxv = MAX(abs(mv->row), abs(mv->col)) >> 3;
+ cpi->max_mv_magnitude = MAX(maxv, cpi->max_mv_magnitude);
}
}
@@ -513,14 +513,14 @@ void vp9_update_nmv_count(VP9_COMP *cpi, MACROBLOCK *x,
MODE_INFO *mi = x->e_mbd.mode_info_context;
MB_MODE_INFO *const mbmi = &mi->mbmi;
MV diff;
- const int bw = 1 << b_width_log2(mbmi->sb_type);
- const int bh = 1 << b_height_log2(mbmi->sb_type);
+ const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[mbmi->sb_type];
+ const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[mbmi->sb_type];
int idx, idy;
if (mbmi->sb_type < BLOCK_SIZE_SB8X8) {
PARTITION_INFO *pi = x->partition_info;
- for (idy = 0; idy < 2; idy += bh) {
- for (idx = 0; idx < 2; idx += bw) {
+ for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
+ for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
const int i = idy * 2 + idx;
if (pi->bmi[i].mode == NEWMV) {
diff.row = mi->bmi[i].as_mv[0].as_mv.row - best_ref_mv->as_mv.row;