diff options
author | Angie Chiang <angiebird@google.com> | 2019-02-05 18:27:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-02-05 18:27:15 +0000 |
commit | 5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe (patch) | |
tree | e03d7df63dfd36cec5f0b1cd7bfde8c2613d148b /vp9/encoder | |
parent | 171ae2cbae638a7459533303bebd6fbacce19369 (diff) | |
parent | 2b6f7cb3f2b06aff3bd9f352509640951eb9e941 (diff) | |
download | libvpx-5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe.tar libvpx-5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe.tar.gz libvpx-5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe.tar.bz2 libvpx-5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe.zip |
Merge "Add dist scale in get_mv_dist"
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_rd.h | 3 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index b8c86ea43..362077a6c 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -6146,7 +6146,7 @@ static double get_mv_dist(int mv_mode, VP9_COMP *cpi, MACROBLOCKD *xd, // TODO(angiebird): Consider subpixel when computing the sse. cpi->fn_ptr[bsize].vf(src.buf, src.stride, get_buf_from_mv(&pre, &full_mv), pre.stride, &sse); - return (double)sse; + return (double)(sse << VP9_DIST_SCALE_LOG2); } else { assert(0); return 0; diff --git a/vp9/encoder/vp9_rd.h b/vp9/encoder/vp9_rd.h index fa85f2176..062ca3277 100644 --- a/vp9/encoder/vp9_rd.h +++ b/vp9/encoder/vp9_rd.h @@ -42,6 +42,9 @@ extern "C" { #define RD_THRESH_MAX_FACT 64 #define RD_THRESH_INC 1 +#define VP9_DIST_SCALE_LOG2 4 +#define VP9_DIST_SCALE (1 << VP9_DIST_SCALE_LOG2) + // This enumerator type needs to be kept aligned with the mode order in // const MODE_DEFINITION vp9_mode_order[MAX_MODES] used in the rd code. typedef enum { diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index c73b0ed87..6f07269d4 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -273,9 +273,9 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x, } *skip_txfm_sb = skip_flag; - *skip_sse_sb = total_sse << 4; + *skip_sse_sb = total_sse << VP9_DIST_SCALE_LOG2; *out_rate_sum = (int)rate_sum; - *out_dist_sum = dist_sum << 4; + *out_dist_sum = dist_sum << VP9_DIST_SCALE_LOG2; } #if CONFIG_VP9_HIGHBITDEPTH |