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

Side by Side Diff: source/libvpx/vp9/decoder/vp9_detokenize.c

Issue 897063002: Revert "libvpx: Pull from upstream" (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.h ('k') | source/libvpx/vp9/decoder/vp9_dthread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 2, 6, /* 0 = LOW_VAL */ 49 2, 6, /* 0 = LOW_VAL */
50 -TWO_TOKEN, 4, /* 1 = TWO */ 50 -TWO_TOKEN, 4, /* 1 = TWO */
51 -THREE_TOKEN, -FOUR_TOKEN, /* 2 = THREE */ 51 -THREE_TOKEN, -FOUR_TOKEN, /* 2 = THREE */
52 8, 10, /* 3 = HIGH_LOW */ 52 8, 10, /* 3 = HIGH_LOW */
53 -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, /* 4 = CAT_ONE */ 53 -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, /* 4 = CAT_ONE */
54 12, 14, /* 5 = CAT_THREEFOUR */ 54 12, 14, /* 5 = CAT_THREEFOUR */
55 -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, /* 6 = CAT_THREE */ 55 -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, /* 6 = CAT_THREE */
56 -CATEGORY5_TOKEN, -CATEGORY6_TOKEN /* 7 = CAT_FIVE */ 56 -CATEGORY5_TOKEN, -CATEGORY6_TOKEN /* 7 = CAT_FIVE */
57 }; 57 };
58 58
59 static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, 59 static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, PLANE_TYPE type,
60 FRAME_COUNTS *counts, PLANE_TYPE type,
61 tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq, 60 tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq,
62 int ctx, const int16_t *scan, const int16_t *nb, 61 int ctx, const int16_t *scan, const int16_t *nb,
63 vp9_reader *r) { 62 vp9_reader *r) {
64 const int max_eob = 16 << (tx_size << 1); 63 const int max_eob = 16 << (tx_size << 1);
65 const FRAME_CONTEXT *const fc = cm->fc; 64 const FRAME_CONTEXT *const fc = cm->fc;
65 FRAME_COUNTS *const counts = &cm->counts;
66 const int ref = is_inter_block(&xd->mi[0].src_mi->mbmi); 66 const int ref = is_inter_block(&xd->mi[0].src_mi->mbmi);
67 int band, c = 0; 67 int band, c = 0;
68 const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] = 68 const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
69 fc->coef_probs[tx_size][type][ref]; 69 fc->coef_probs[tx_size][type][ref];
70 const vp9_prob *prob; 70 const vp9_prob *prob;
71 unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1] = 71 unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1] =
72 counts->coef[tx_size][type][ref]; 72 counts->coef[tx_size][type][ref];
73 unsigned int (*eob_branch_count)[COEFF_CONTEXTS] = 73 unsigned int (*eob_branch_count)[COEFF_CONTEXTS] =
74 counts->eob_branch[tx_size][type][ref]; 74 counts->eob_branch[tx_size][type][ref];
75 uint8_t token_cache[32 * 32]; 75 uint8_t token_cache[32 * 32];
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 token_cache[scan[c]] = vp9_pt_energy_class[token]; 206 token_cache[scan[c]] = vp9_pt_energy_class[token];
207 ++c; 207 ++c;
208 ctx = get_coef_context(nb, token_cache, c); 208 ctx = get_coef_context(nb, token_cache, c);
209 dqv = dq[1]; 209 dqv = dq[1];
210 } 210 }
211 211
212 return c; 212 return c;
213 } 213 }
214 214
215 int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd, 215 int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
216 FRAME_COUNTS *counts, int plane, int block, 216 int plane, int block, BLOCK_SIZE plane_bsize,
217 BLOCK_SIZE plane_bsize, int x, int y, 217 int x, int y, TX_SIZE tx_size, vp9_reader *r) {
218 TX_SIZE tx_size, vp9_reader *r) {
219 struct macroblockd_plane *const pd = &xd->plane[plane]; 218 struct macroblockd_plane *const pd = &xd->plane[plane];
220 const int ctx = get_entropy_context(tx_size, pd->above_context + x, 219 const int ctx = get_entropy_context(tx_size, pd->above_context + x,
221 pd->left_context + y); 220 pd->left_context + y);
222 const scan_order *so = get_scan(xd, tx_size, pd->plane_type, block); 221 const scan_order *so = get_scan(xd, tx_size, pd->plane_type, block);
223 const int eob = decode_coefs(cm, xd, counts, pd->plane_type, 222 const int eob = decode_coefs(cm, xd, pd->plane_type,
224 BLOCK_OFFSET(pd->dqcoeff, block), tx_size, 223 BLOCK_OFFSET(pd->dqcoeff, block), tx_size,
225 pd->dequant, ctx, so->scan, so->neighbors, r); 224 pd->dequant, ctx, so->scan, so->neighbors, r);
226 vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y); 225 vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
227 return eob; 226 return eob;
228 } 227 }
229 228
230 229
OLDNEW
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.h ('k') | source/libvpx/vp9/decoder/vp9_dthread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698