diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-12-19 11:03:23 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-12-19 11:03:23 -0800 |
commit | e4b85c9ed8c46a2a9f341585cfac46fe9916ff69 (patch) | |
tree | 7267e78bb9c355d8dc29af9b4b7c86d10bec588c | |
parent | 46444c268a0ec55e95b84354846a4ab12ab4dc7c (diff) | |
parent | de49895804d5d7fffffad4213e58522833fee063 (diff) | |
download | libvpx-e4b85c9ed8c46a2a9f341585cfac46fe9916ff69.tar libvpx-e4b85c9ed8c46a2a9f341585cfac46fe9916ff69.tar.gz libvpx-e4b85c9ed8c46a2a9f341585cfac46fe9916ff69.tar.bz2 libvpx-e4b85c9ed8c46a2a9f341585cfac46fe9916ff69.zip |
Merge "Adding get_zbin_mode_boost() function."
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index d49e3c1d1..b18408780 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -2523,6 +2523,25 @@ static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x) { x->act_zbin_adj = 1 - (int) (((int64_t) a + (b >> 1)) / b); #endif } + +static int get_zbin_mode_boost(MB_MODE_INFO *mbmi, int enabled) { + if (enabled) { + if (is_inter_block(mbmi)) { + if (mbmi->mode == ZEROMV) { + return mbmi->ref_frame[0] != LAST_FRAME ? GF_ZEROMV_ZBIN_BOOST + : LF_ZEROMV_ZBIN_BOOST; + } else { + return mbmi->sb_type < BLOCK_8X8 ? SPLIT_MV_ZBIN_BOOST + : MV_ZBIN_BOOST; + } + } else { + return INTRA_ZBIN_BOOST; + } + } else { + return 0; + } +} + static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled, int mi_row, int mi_col, BLOCK_SIZE bsize) { VP9_COMMON * const cm = &cpi->common; @@ -2561,24 +2580,8 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled, // Experimental code. Special case for gf and arf zeromv modes. // Increase zbin size to suppress noise - cpi->zbin_mode_boost = 0; - if (cpi->zbin_mode_boost_enabled) { - if (is_inter_block(mbmi)) { - if (mbmi->mode == ZEROMV) { - if (mbmi->ref_frame[0] != LAST_FRAME) - cpi->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST; - else - cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; - } else if (mbmi->sb_type < BLOCK_8X8) { - cpi->zbin_mode_boost = SPLIT_MV_ZBIN_BOOST; - } else { - cpi->zbin_mode_boost = MV_ZBIN_BOOST; - } - } else { - cpi->zbin_mode_boost = INTRA_ZBIN_BOOST; - } - } - + cpi->zbin_mode_boost = get_zbin_mode_boost(mbmi, + cpi->zbin_mode_boost_enabled); vp9_update_zbin_extra(cpi, x); } |