summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorScott LaVarnway <slavarnway@google.com>2011-10-19 13:38:35 -0400
committerScott LaVarnway <slavarnway@google.com>2011-10-19 13:38:35 -0400
commit5e54085703ab9c7e4254167be9f4a019387c37ef (patch)
tree785dd43a3005bf67ed6ef20ba6d39ec987950db5 /vp8
parent63a77cbed9cfe3373defec6caca7b9d018f5b90e (diff)
downloadlibvpx-5e54085703ab9c7e4254167be9f4a019387c37ef.tar
libvpx-5e54085703ab9c7e4254167be9f4a019387c37ef.tar.gz
libvpx-5e54085703ab9c7e4254167be9f4a019387c37ef.tar.bz2
libvpx-5e54085703ab9c7e4254167be9f4a019387c37ef.zip
Improved token decoder
Tests showed over 2% improvement on various HD clips. Change-Id: I94a30d209c92cbd5fef285122f9fc570688635fe
Diffstat (limited to 'vp8')
-rw-r--r--vp8/decoder/detokenize.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/vp8/decoder/detokenize.c b/vp8/decoder/detokenize.c
index 1a71948cb..1d4568593 100644
--- a/vp8/decoder/detokenize.c
+++ b/vp8/decoder/detokenize.c
@@ -9,7 +9,6 @@
*/
-#include "vp8/common/type_aliases.h"
#include "vp8/common/blockd.h"
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
@@ -205,33 +204,34 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x)
VP8_BD_VALUE value;
const int *scan;
register unsigned int shift;
- UINT32 split;
+ unsigned int split;
VP8_BD_VALUE bigsplit;
- INT16 *qcoeff_ptr;
+ short *qcoeff_ptr;
const vp8_prob *coef_probs;
- int type;
int stop;
- INT16 val, bits_count;
- INT16 c;
- INT16 v;
+ int val, bits_count;
+ int c;
+ int v;
const vp8_prob *Prob;
+ int start_coeff;
+
- type = 3;
i = 0;
stop = 16;
scan = vp8_default_zig_zag1d;
qcoeff_ptr = &x->qcoeff[0];
+ coef_probs = fc->coef_probs [3] [ 0 ] [0];
if (x->mode_info_context->mbmi.mode != B_PRED &&
x->mode_info_context->mbmi.mode != SPLITMV)
{
i = 24;
stop = 24;
- type = 1;
qcoeff_ptr += 24*16;
eobtotal -= 16;
+ coef_probs = fc->coef_probs [1] [ 0 ] [0];
}
bufend = bc->user_buffer_end;
@@ -240,23 +240,24 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x)
count = bc->count;
range = bc->range;
-
- coef_probs = fc->coef_probs [type] [ 0 ] [0];
+ start_coeff = 0;
BLOCK_LOOP:
a = A + vp8_block2above[i];
l = L + vp8_block2left[i];
- c = (INT16)(!type);
+ c = start_coeff;
- /*Dest = ((A)!=0) + ((B)!=0);*/
VP8_COMBINEENTROPYCONTEXTS(v, *a, *l);
+
Prob = coef_probs;
Prob += v * ENTROPY_NODES;
+ *a = *l = 0;
DO_WHILE:
Prob += coef_bands_x[c];
DECODE_AND_BRANCH_IF_ZERO(Prob[EOB_CONTEXT_NODE], BLOCK_FINISHED);
+ *a = *l = 1;
CHECK_0_:
DECODE_AND_LOOP_IF_ZERO(Prob[ZERO_CONTEXT_NODE], CHECK_0_);
@@ -346,7 +347,7 @@ ONE_CONTEXT_NODE_0_:
qcoeff_ptr [ 15 ] = (INT16) v;
BLOCK_FINISHED:
- *a = *l = ((eobs[i] = c) != !type); /* any nonzero data? */
+ eobs[i] = c;
eobtotal += c;
qcoeff_ptr += 16;
@@ -357,18 +358,18 @@ BLOCK_FINISHED:
if (i == 25)
{
- type = 0;
+ start_coeff = 1;
i = 0;
stop = 16;
- coef_probs = fc->coef_probs [type] [ 0 ] [0];
+ coef_probs = fc->coef_probs [0] [ 0 ] [0];
qcoeff_ptr -= (24*16 + 16);
goto BLOCK_LOOP;
}
if (i == 16)
{
- type = 2;
- coef_probs = fc->coef_probs [type] [ 0 ] [0];
+ start_coeff = 0;
+ coef_probs = fc->coef_probs [2] [ 0 ] [0];
stop = 24;
goto BLOCK_LOOP;
}