summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-04-07 12:50:30 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2015-04-07 12:50:30 -0700
commit6de407b63897d950d43681ba8e633fcd3e8dc8c2 (patch)
tree34bb8029cdb8f27fca9feea788215eef166b3808
parent8de26efa66184ba6f51a800aa56b93997b52793b (diff)
parent60e01c65302d08e3e8c5b7f22a111b003545dc34 (diff)
downloadlibvpx-6de407b63897d950d43681ba8e633fcd3e8dc8c2.tar
libvpx-6de407b63897d950d43681ba8e633fcd3e8dc8c2.tar.gz
libvpx-6de407b63897d950d43681ba8e633fcd3e8dc8c2.tar.bz2
libvpx-6de407b63897d950d43681ba8e633fcd3e8dc8c2.zip
Merge "Account for eob cost in the RTC mode decision process"
-rw-r--r--vp9/encoder/vp9_pickmode.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 894da9b23..19824628a 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -589,6 +589,7 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist,
xd->mb_to_right_edge >> (5 + pd->subsampling_x));
const int max_blocks_high = num_4x4_h + (xd->mb_to_bottom_edge >= 0 ? 0 :
xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
+ int eob_cost = 0;
(void)cpi;
vp9_subtract_plane(x, bsize, plane);
@@ -641,12 +642,14 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist,
break;
}
*skippable &= (*eob == 0);
+ eob_cost += 1;
}
block += step;
}
}
if (*skippable && *sse < INT64_MAX) {
+ *rate = 0;
*dist = (*sse << 6) >> shift;
*sse = *dist;
return;
@@ -675,8 +678,8 @@ static void block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int64_t *dist,
}
}
- *rate <<= 8;
- *rate *= 6;
+ *rate <<= 10;
+ *rate += (eob_cost << 8);
}
#endif
@@ -905,9 +908,9 @@ static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
i, j, 0);
// TODO(jingning): This needs further refactoring.
- if (plane_bsize <= BLOCK_16X16) {
+ if (plane_bsize <= BLOCK_32X32) {
block_yrd(cpi, x, &rate, &dist, &is_skippable, &this_sse, 0,
- bsize_tx, tx_size);
+ bsize_tx, MIN(tx_size, TX_16X16));
x->skip_txfm[0] = is_skippable;
if (is_skippable)
rate = vp9_cost_bit(vp9_get_skip_prob(&cpi->common, xd), 1);
@@ -1348,10 +1351,10 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
vp9_get_switchable_rate(cpi, xd) : 0;
}
- if (bsize <= BLOCK_16X16) {
+ if (bsize <= BLOCK_32X32) {
this_sse = (int64_t)sse_y;
block_yrd(cpi, x, &this_rdc.rate, &this_rdc.dist, &is_skippable,
- &this_sse, 0, bsize, mbmi->tx_size);
+ &this_sse, 0, bsize, MIN(mbmi->tx_size, TX_16X16));
x->skip_txfm[0] = is_skippable;
if (is_skippable) {
this_rdc.rate = vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);