Remove the vestigal skip_eob feature from tokenization.
Repack TOKENEXTRA fields. Speed impact within measurment margin of error. Change-Id: I9a6d1dde1bb4a0766b02d0cb74c871ddde907cde
This commit is contained in:
parent
31a94868b5
commit
5bd99f83d9
@ -428,25 +428,21 @@ static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void add_token(TOKENEXTRA **t, const vpx_prob *context_tree,
|
static INLINE void add_token(TOKENEXTRA **t, const vpx_prob *context_tree,
|
||||||
int32_t extra, uint8_t token,
|
int16_t token, EXTRABIT extra,
|
||||||
uint8_t skip_eob_node,
|
|
||||||
unsigned int *counts) {
|
unsigned int *counts) {
|
||||||
|
(*t)->context_tree = context_tree;
|
||||||
(*t)->token = token;
|
(*t)->token = token;
|
||||||
(*t)->extra = extra;
|
(*t)->extra = extra;
|
||||||
(*t)->context_tree = context_tree;
|
|
||||||
(*t)->skip_eob_node = skip_eob_node;
|
|
||||||
(*t)++;
|
(*t)++;
|
||||||
++counts[token];
|
++counts[token];
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void add_token_no_extra(TOKENEXTRA **t,
|
static INLINE void add_token_no_extra(TOKENEXTRA **t,
|
||||||
const vpx_prob *context_tree,
|
const vpx_prob *context_tree,
|
||||||
uint8_t token,
|
int16_t token,
|
||||||
uint8_t skip_eob_node,
|
|
||||||
unsigned int *counts) {
|
unsigned int *counts) {
|
||||||
(*t)->token = token;
|
|
||||||
(*t)->context_tree = context_tree;
|
(*t)->context_tree = context_tree;
|
||||||
(*t)->skip_eob_node = skip_eob_node;
|
(*t)->token = token;
|
||||||
(*t)++;
|
(*t)++;
|
||||||
++counts[token];
|
++counts[token];
|
||||||
}
|
}
|
||||||
@ -501,15 +497,13 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
|
|
||||||
while (c < eob) {
|
while (c < eob) {
|
||||||
int v = 0;
|
int v = 0;
|
||||||
int skip_eob = 0;
|
|
||||||
v = qcoeff[scan[c]];
|
v = qcoeff[scan[c]];
|
||||||
|
++eob_branch[band[c]][pt];
|
||||||
|
|
||||||
while (!v) {
|
while (!v) {
|
||||||
add_token_no_extra(&t, coef_probs[band[c]][pt], ZERO_TOKEN, skip_eob,
|
add_token_no_extra(&t, coef_probs[band[c]][pt], ZERO_TOKEN,
|
||||||
counts[band[c]][pt]);
|
counts[band[c]][pt]);
|
||||||
eob_branch[band[c]][pt] += !skip_eob;
|
|
||||||
|
|
||||||
skip_eob = 1;
|
|
||||||
token_cache[scan[c]] = 0;
|
token_cache[scan[c]] = 0;
|
||||||
++c;
|
++c;
|
||||||
pt = get_coef_context(nb, token_cache, c);
|
pt = get_coef_context(nb, token_cache, c);
|
||||||
@ -518,18 +512,17 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
|
|
||||||
vp9_get_token_extra(v, &token, &extra);
|
vp9_get_token_extra(v, &token, &extra);
|
||||||
|
|
||||||
add_token(&t, coef_probs[band[c]][pt], extra, (uint8_t)token,
|
add_token(&t, coef_probs[band[c]][pt], token, extra,
|
||||||
(uint8_t)skip_eob, counts[band[c]][pt]);
|
counts[band[c]][pt]);
|
||||||
eob_branch[band[c]][pt] += !skip_eob;
|
|
||||||
|
|
||||||
token_cache[scan[c]] = vp9_pt_energy_class[token];
|
token_cache[scan[c]] = vp9_pt_energy_class[token];
|
||||||
++c;
|
++c;
|
||||||
pt = get_coef_context(nb, token_cache, c);
|
pt = get_coef_context(nb, token_cache, c);
|
||||||
}
|
}
|
||||||
if (c < seg_eob) {
|
if (c < seg_eob) {
|
||||||
add_token_no_extra(&t, coef_probs[band[c]][pt], EOB_TOKEN, 0,
|
|
||||||
counts[band[c]][pt]);
|
|
||||||
++eob_branch[band[c]][pt];
|
++eob_branch[band[c]][pt];
|
||||||
|
add_token_no_extra(&t, coef_probs[band[c]][pt], EOB_TOKEN,
|
||||||
|
counts[band[c]][pt]);
|
||||||
}
|
}
|
||||||
|
|
||||||
*tp = t;
|
*tp = t;
|
||||||
|
@ -36,9 +36,8 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const vpx_prob *context_tree;
|
const vpx_prob *context_tree;
|
||||||
|
int16_t token;
|
||||||
EXTRABIT extra;
|
EXTRABIT extra;
|
||||||
uint8_t token;
|
|
||||||
uint8_t skip_eob_node;
|
|
||||||
} TOKENEXTRA;
|
} TOKENEXTRA;
|
||||||
|
|
||||||
extern const vpx_tree_index vp9_coef_tree[];
|
extern const vpx_tree_index vp9_coef_tree[];
|
||||||
|
Loading…
Reference in New Issue
Block a user