ref: 5e54085703ab9c7e4254167be9f4a019387c37ef
parent: 63a77cbed9cfe3373defec6caca7b9d018f5b90e
author: Scott LaVarnway <slavarnway@google.com>
date: Wed Oct 19 09:38:35 EDT 2011
Improved token decoder Tests showed over 2% improvement on various HD clips. Change-Id: I94a30d209c92cbd5fef285122f9fc570688635fe
--- 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,24 +204,25 @@
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)
@@ -229,9 +229,9 @@
{
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 @@
count = bc->count;
range = bc->range;
+ start_coeff = 0;
- coef_probs = fc->coef_probs [type] [ 0 ] [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 @@
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,10 +358,10 @@
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;
}
@@ -367,8 +368,8 @@
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;
}
--
⑨