summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_pickmode.c
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-03-31 10:57:41 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2015-03-31 11:02:20 -0700
commit531468a07a62de99521e92377b440d7c87705812 (patch)
tree8e16bc0563139c585624a790bbf9a00b510c5609 /vp9/encoder/vp9_pickmode.c
parent014fa4529802ec89d1f3239722955c1493b688db (diff)
downloadlibvpx-531468a07a62de99521e92377b440d7c87705812.tar
libvpx-531468a07a62de99521e92377b440d7c87705812.tar.gz
libvpx-531468a07a62de99521e92377b440d7c87705812.tar.bz2
libvpx-531468a07a62de99521e92377b440d7c87705812.zip
Tuning SATD rate calculation for speed
This commit allows the encoder to check the eob per transform block to decide how to compute the SATD rate cost. If the entire block is quantized to zero, there is no need to add anything; if only the DC coefficient is non-zero, add its absolute value; otherwise, sum over the block. This reduces the CPU cycles spent on vp9_satd_sse2 to one third. Change-Id: I0d56044b793b286efc0875fafc0b8bf2d2047e32
Diffstat (limited to 'vp9/encoder/vp9_pickmode.c')
-rw-r--r--vp9/encoder/vp9_pickmode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index c3629ddd9..f8a5e6ae7 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -401,7 +401,11 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist,
}
*dist += vp9_block_error(coeff, dqcoeff, step << 4, &this_sse) >> shift;
- *rate += (int)vp9_satd((const int16_t *)qcoeff, step << 4);
+
+ if (*eob == 1)
+ *rate += (int)abs(qcoeff[0]);
+ else if (*eob > 1)
+ *rate += (int)vp9_satd((const int16_t *)qcoeff, step << 4);
*sse += (this_sse >> shift);
*skippable &= (*eob == 0);