summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorDaniel Kang <ddkang@google.com>2012-08-06 18:29:59 -0700
committerDaniel Kang <ddkang@google.com>2012-08-07 16:56:48 -0700
commitdce0896249b9d3eebb52522beeebba00eface3b8 (patch)
tree91954fc1e1db5533b0d548a1a0d236baf240d218 /vp8
parent1099f368e3d5ecdf1f336964f2d7d89b98fa95e9 (diff)
downloadlibvpx-dce0896249b9d3eebb52522beeebba00eface3b8.tar
libvpx-dce0896249b9d3eebb52522beeebba00eface3b8.tar.gz
libvpx-dce0896249b9d3eebb52522beeebba00eface3b8.tar.bz2
libvpx-dce0896249b9d3eebb52522beeebba00eface3b8.zip
Change the RD cost functions to take into account the seg_eob.
Change-Id: I2f96e5b205f70fdb559f01637c4b5730246c38a8
Diffstat (limited to 'vp8')
-rw-r--r--vp8/encoder/rdopt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index 946c170b5..2d6f34e80 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -575,11 +575,13 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type,
int tx_type) {
const int eob = b->eob;
int c = !type; /* start at coef 0, unless Y with Y2 */
- int cost = 0, default_eob;
+ int cost = 0, default_eob, seg_eob;
int pt; /* surrounding block/prev coef predictor */
int const *scan, *band;
short *qcoeff_ptr = b->qcoeff;
+ int segment_id = mb->e_mbd.mode_info_context->mbmi.segment_id;
+
switch (tx_type) {
case TX_4X4:
scan = vp8_default_zig_zag1d;
@@ -625,6 +627,11 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type,
default:
break;
}
+ if (segfeature_active(&mb->e_mbd, segment_id, SEG_LVL_EOB))
+ seg_eob = get_segdata(&mb->e_mbd, segment_id, SEG_LVL_EOB);
+ else
+ seg_eob = default_eob;
+
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
@@ -636,7 +643,7 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type,
pt = vp8_prev_token_class[t];
}
- if (c < default_eob)
+ if (c < seg_eob)
cost += mb->token_costs[tx_type][type][band[c]]
[pt][DCT_EOB_TOKEN];