summaryrefslogtreecommitdiff
path: root/vp8/encoder/tokenize.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-12-12 17:08:03 -0800
committerJohn Koleszar <jkoleszar@google.com>2011-12-13 11:58:56 -0800
commitd6020f9d52cbaa9629e3a3c6ad023360c9e7b483 (patch)
tree8e34ffa7ee2fa996b5b54e79df55bc8c5624bdb2 /vp8/encoder/tokenize.c
parent20573f0640e181e8363fd1efc52f16569715eb97 (diff)
downloadlibvpx-d6020f9d52cbaa9629e3a3c6ad023360c9e7b483.tar
libvpx-d6020f9d52cbaa9629e3a3c6ad023360c9e7b483.tar.gz
libvpx-d6020f9d52cbaa9629e3a3c6ad023360c9e7b483.tar.bz2
libvpx-d6020f9d52cbaa9629e3a3c6ad023360c9e7b483.zip
tokenizer: use correct block type context in stuff1st_order_b
The fast-path for skipped MBs was not correctly respecting the block type during update of the coefficient counts. Extracted this from part of change I365cfb6ac636f19c545f682e3aeac185253abaef Change-Id: I53d8cf0a00a98034b97b0ed3414b703bae74a739
Diffstat (limited to 'vp8/encoder/tokenize.c')
-rw-r--r--vp8/encoder/tokenize.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/vp8/encoder/tokenize.c b/vp8/encoder/tokenize.c
index e81948567..8bfc47f8f 100644
--- a/vp8/encoder/tokenize.c
+++ b/vp8/encoder/tokenize.c
@@ -514,17 +514,19 @@ static __inline void stuff1st_order_b
TOKENEXTRA **tp,
ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l,
+ int type,
VP8_COMP *cpi
)
{
int pt; /* near block/prev token context index */
+ int band;
TOKENEXTRA *t = *tp; /* store tokens starting here */
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
-
+ band = type ? 0 : 1;
t->Token = DCT_EOB_TOKEN;
- t->context_tree = cpi->common.fc.coef_probs [0] [1] [pt];
+ t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt];
t->skip_eob_node = 0;
- ++cpi->coef_counts [0] [1] [pt] [DCT_EOB_TOKEN];
+ ++cpi->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN];
++t;
*tp = t;
pt = 0; /* 0 <-> all coeff data is zero */
@@ -561,15 +563,19 @@ void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t)
ENTROPY_CONTEXT * L = (ENTROPY_CONTEXT *)x->left_context;
int plane_type;
int b;
-
- stuff2nd_order_b(t,
+ plane_type = 3;
+ if((x->mode_info_context->mbmi.mode != B_PRED
+ && x->mode_info_context->mbmi.mode != SPLITMV))
+ {
+ stuff2nd_order_b(t,
A + vp8_block2above[24], L + vp8_block2left[24], cpi);
- plane_type = 0;
+ plane_type = 0;
+ }
for (b = 0; b < 16; b++)
stuff1st_order_b(t,
A + vp8_block2above[b],
- L + vp8_block2left[b], cpi);
+ L + vp8_block2left[b], plane_type, cpi);
for (b = 16; b < 24; b++)
stuff1st_order_buv(t,