summaryrefslogtreecommitdiff
path: root/vp10/encoder/rdopt.c
diff options
context:
space:
mode:
authorShunyao Li <shunyaoli@google.com>2015-08-19 12:04:56 -0700
committerShunyao Li <shunyaoli@google.com>2015-08-24 18:15:09 -0700
commitaa006d714998ba043052b9c506a8b22afa61ac70 (patch)
treeffbb7a829fa2ce090d6898a8bda45a8df62d01b1 /vp10/encoder/rdopt.c
parentf1d090e2f56e28b3218fb99f648bd5d59ae2f4b1 (diff)
downloadlibvpx-aa006d714998ba043052b9c506a8b22afa61ac70.tar
libvpx-aa006d714998ba043052b9c506a8b22afa61ac70.tar.gz
libvpx-aa006d714998ba043052b9c506a8b22afa61ac70.tar.bz2
libvpx-aa006d714998ba043052b9c506a8b22afa61ac70.zip
Add transform size rate for intra skip mode in rdopt
stdhd +0.226 hevchr +0.091 hevcmr +0.052 derflr +0.033 Change-Id: I84034209c5760609a99bd6e0ce55e02534b72cac
Diffstat (limited to 'vp10/encoder/rdopt.c')
-rw-r--r--vp10/encoder/rdopt.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index 9dd315fe5..14efe0ef0 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -646,22 +646,29 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
}
for (n = start_tx; n >= end_tx; n--) {
+ int r_tx_size = 0;
+ for (m = 0; m <= n - (n == (int) max_tx_size); m++) {
+ if (m == n)
+ r_tx_size += vp10_cost_zero(tx_probs[m]);
+ else
+ r_tx_size += vp10_cost_one(tx_probs[m]);
+ }
txfm_rd_in_plane(x, &r[n][0], &d[n], &s[n],
&sse[n], ref_best_rd, 0, bs, n,
cpi->sf.use_fast_coef_costing);
r[n][1] = r[n][0];
if (r[n][0] < INT_MAX) {
- for (m = 0; m <= n - (n == (int) max_tx_size); m++) {
- if (m == n)
- r[n][1] += vp10_cost_zero(tx_probs[m]);
- else
- r[n][1] += vp10_cost_one(tx_probs[m]);
- }
+ r[n][1] += r_tx_size;
}
- if (d[n] == INT64_MAX) {
+ if (d[n] == INT64_MAX || r[n][0] == INT_MAX) {
rd[n][0] = rd[n][1] = INT64_MAX;
} else if (s[n]) {
- rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, d[n]);
+ if (is_inter_block(mbmi)) {
+ rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, sse[n]);
+ } else {
+ rd[n][0] = RDCOST(x->rdmult, x->rddiv, s1, sse[n]);
+ rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1 + r_tx_size, sse[n]);
+ }
} else {
rd[n][0] = RDCOST(x->rdmult, x->rddiv, r[n][0] + s0, d[n]);
rd[n][1] = RDCOST(x->rdmult, x->rddiv, r[n][1] + s0, d[n]);