Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: source/libvpx/vp9/encoder/vp9_tokenize.c

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_tokenize.h ('k') | source/libvpx/vp9/encoder/vp9_vaq.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_tokenize.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_tokenize.c (revision 254565)
+++ source/libvpx/vp9/encoder/vp9_tokenize.c (working copy)
@@ -23,8 +23,8 @@
static TOKENVALUE dct_value_tokens[DCT_MAX_VALUE * 2];
const TOKENVALUE *vp9_dct_value_tokens_ptr;
-static int dct_value_cost[DCT_MAX_VALUE * 2];
-const int *vp9_dct_value_cost_ptr;
+static int16_t dct_value_cost[DCT_MAX_VALUE * 2];
+const int16_t *vp9_dct_value_cost_ptr;
// Array indices are identical to previously-existing CONTEXT_NODE indices
const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
@@ -199,6 +199,12 @@
++counts[token];
}
+static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id,
+ TX_SIZE tx_size) {
+ const int eob_max = 16 << (tx_size << 1);
+ return vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max;
+}
+
static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
@@ -214,7 +220,7 @@
TOKENEXTRA *t = *tp; /* store tokens starting here */
int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
- const int16_t *qcoeff_ptr = BLOCK_OFFSET(p->qcoeff, block);
+ const int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
const int segment_id = mbmi->segment_id;
const int16_t *scan, *nb;
const scan_order *so;
@@ -241,7 +247,7 @@
while (c < eob) {
int v = 0;
int skip_eob = 0;
- v = qcoeff_ptr[scan[c]];
+ v = qcoeff[scan[c]];
while (!v) {
add_token_no_extra(&t, coef_probs[band[c]][pt], ZERO_TOKEN, skip_eob,
@@ -252,12 +258,13 @@
token_cache[scan[c]] = 0;
++c;
pt = get_coef_context(nb, token_cache, c);
- v = qcoeff_ptr[scan[c]];
+ v = qcoeff[scan[c]];
}
add_token(&t, coef_probs[band[c]][pt],
vp9_dct_value_tokens_ptr[v].extra,
- vp9_dct_value_tokens_ptr[v].token, skip_eob,
+ (uint8_t)vp9_dct_value_tokens_ptr[v].token,
+ (uint8_t)skip_eob,
counts[band[c]][pt]);
eob_branch[band[c]][pt] += !skip_eob;
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_tokenize.h ('k') | source/libvpx/vp9/encoder/vp9_vaq.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698