summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2015-03-11 11:31:47 -0700
committerYunqing Wang <yunqingwang@google.com>2015-03-12 14:04:14 -0700
commit5d677c97eb3737e15399dcd5c1ee26dc5a3f7ba9 (patch)
tree317e41e37094936a66d503438af505c11261955c /vp9/encoder
parent340260585c9becb8c905ca8679904b78e0364a43 (diff)
downloadlibvpx-5d677c97eb3737e15399dcd5c1ee26dc5a3f7ba9.tar
libvpx-5d677c97eb3737e15399dcd5c1ee26dc5a3f7ba9.tar.gz
libvpx-5d677c97eb3737e15399dcd5c1ee26dc5a3f7ba9.tar.bz2
libvpx-5d677c97eb3737e15399dcd5c1ee26dc5a3f7ba9.zip
Minorly modify model_rd_for_sb_y function
Added a skip_dc check. If skip_dc = 1, we could eliminate calling of vp9_model_rd_from_var_lapndz(). This gave slight PSNR & SSIM gain(<0.1%), and no speed change. Change-Id: If5ca733366148c86b98e196a00cc890f50e9a3e5
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_pickmode.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index dedec5f54..f457f20b1 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -221,6 +221,8 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
const uint32_t ac_quant = pd->dequant[1];
unsigned int var = cpi->fn_ptr[bsize].vf(p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride, &sse);
+ int skip_dc = 0;
+
*var_y = var;
*sse_y = sse;
@@ -262,6 +264,9 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
// Check if dc coefficient can be quantized to zero.
if (sse_tx - var_tx < dc_thr || sse == var)
x->skip_txfm[0] = 1;
+ } else {
+ if (sse_tx - var_tx < dc_thr || sse == var)
+ skip_dc = 1;
}
}
@@ -271,21 +276,28 @@ static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
return;
}
+ if (!skip_dc) {
#if CONFIG_VP9_HIGHBITDEPTH
- if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize],
- dc_quant >> (xd->bd - 5), &rate, &dist);
- } else {
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
+ vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize],
+ dc_quant >> (xd->bd - 5), &rate, &dist);
+ } else {
+ vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize],
+ dc_quant >> 3, &rate, &dist);
+ }
+#else
vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize],
dc_quant >> 3, &rate, &dist);
- }
-#else
- vp9_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bsize],
- dc_quant >> 3, &rate, &dist);
#endif // CONFIG_VP9_HIGHBITDEPTH
+ }
- *out_rate_sum = rate >> 1;
- *out_dist_sum = dist << 3;
+ if (!skip_dc) {
+ *out_rate_sum = rate >> 1;
+ *out_dist_sum = dist << 3;
+ } else {
+ *out_rate_sum = 0;
+ *out_dist_sum = (sse - var) << 4;
+ }
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {