diff options
author | Paul Wilkins <paulwilkins@google.com> | 2013-06-27 02:28:41 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-06-27 02:28:41 -0700 |
commit | 05ffdf2625e62c7804edd9a546ead51830d8ef3c (patch) | |
tree | 98a4f6e48471127f6f8f04b5d2556e424f29f3e4 /vp9/encoder/vp9_encodemv.c | |
parent | 59af9049d37eefa77787e3f10dd3143aecf03f14 (diff) | |
parent | 9f3ab83486e5259293b8074600019d4e38f3eae2 (diff) | |
download | libvpx-05ffdf2625e62c7804edd9a546ead51830d8ef3c.tar libvpx-05ffdf2625e62c7804edd9a546ead51830d8ef3c.tar.gz libvpx-05ffdf2625e62c7804edd9a546ead51830d8ef3c.tar.bz2 libvpx-05ffdf2625e62c7804edd9a546ead51830d8ef3c.zip |
Merge "Auto adapt step size feature."
Diffstat (limited to 'vp9/encoder/vp9_encodemv.c')
-rw-r--r-- | vp9/encoder/vp9_encodemv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_encodemv.c b/vp9/encoder/vp9_encodemv.c index 5ffe05462..08ef6910d 100644 --- a/vp9/encoder/vp9_encodemv.c +++ b/vp9/encoder/vp9_encodemv.c @@ -591,7 +591,8 @@ void vp9_write_nmv_probs(VP9_COMP* const cpi, int usehp, vp9_writer* const bc) { } } -void vp9_encode_mv(vp9_writer* w, const MV* mv, const MV* ref, +void vp9_encode_mv(VP9_COMP* cpi, vp9_writer* w, + const MV* mv, const MV* ref, const nmv_context* mvctx, int usehp) { const MV diff = {mv->row - ref->row, mv->col - ref->col}; @@ -604,6 +605,13 @@ void vp9_encode_mv(vp9_writer* w, const MV* mv, const MV* ref, 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); + } } void vp9_build_nmv_cost_table(int *mvjoint, |