summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_pickmode.c
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2014-03-07 10:34:34 -0800
committerJingning Han <jingning@google.com>2014-03-07 10:34:34 -0800
commit02509024750ea8f637d6334308620a6cd32e405a (patch)
treeafa36bd2b8babd3547bf2dd4e5258321cb0bb796 /vp9/encoder/vp9_pickmode.c
parent6849cde89328b70ed2fd0ffd9cd225ead6025fd9 (diff)
downloadlibvpx-02509024750ea8f637d6334308620a6cd32e405a.tar
libvpx-02509024750ea8f637d6334308620a6cd32e405a.tar.gz
libvpx-02509024750ea8f637d6334308620a6cd32e405a.tar.bz2
libvpx-02509024750ea8f637d6334308620a6cd32e405a.zip
Clearn up model_rd in non-RD coding mode
The rate-distortion model in non-RD coding mode is only applied to luma component. This commit removed a few redundant addition steps. Change-Id: Id8edc0a47c2dbef8deba43debe2c95db39454de3
Diffstat (limited to 'vp9/encoder/vp9_pickmode.c')
-rw-r--r--vp9/encoder/vp9_pickmode.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 92409a179..5a505f6f5 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -193,9 +193,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];
@@ -205,18 +205,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.
@@ -357,5 +350,6 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
}
}
}
+
return INT64_MAX;
}