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

Unified Diff: source/libvpx/vp9/decoder/vp9_detokenize.c

Issue 1169543007: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 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/decoder/vp9_detokenize.h ('k') | source/libvpx/vp9/encoder/arm/neon/vp9_variance_neon.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/decoder/vp9_detokenize.c
diff --git a/source/libvpx/vp9/decoder/vp9_detokenize.c b/source/libvpx/vp9/decoder/vp9_detokenize.c
index 63269844cc4353b700ca6ee8922a28fb6816a0d8..3304e64b2d553f81c730219c8fefa06adee1a68d 100644
--- a/source/libvpx/vp9/decoder/vp9_detokenize.c
+++ b/source/libvpx/vp9/decoder/vp9_detokenize.c
@@ -35,7 +35,7 @@
#define INCREMENT_COUNT(token) \
do { \
- if (!cm->frame_parallel_decoding_mode) \
+ if (counts) \
++coef_counts[band][ctx][token]; \
} while (0)
@@ -46,22 +46,21 @@ static INLINE int read_coeff(const vp9_prob *probs, int n, vp9_reader *r) {
return val;
}
-static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
- FRAME_COUNTS *counts, PLANE_TYPE type,
+static int decode_coefs(const MACROBLOCKD *xd,
+ PLANE_TYPE type,
tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq,
int ctx, const int16_t *scan, const int16_t *nb,
vp9_reader *r) {
+ FRAME_COUNTS *counts = xd->counts;
const int max_eob = 16 << (tx_size << 1);
- const FRAME_CONTEXT *const fc = cm->fc;
+ const FRAME_CONTEXT *const fc = xd->fc;
const int ref = is_inter_block(&xd->mi[0]->mbmi);
int band, c = 0;
const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref];
const vp9_prob *prob;
- unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1] =
- counts->coef[tx_size][type][ref];
- unsigned int (*eob_branch_count)[COEFF_CONTEXTS] =
- counts->eob_branch[tx_size][type][ref];
+ unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
+ unsigned int (*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32];
const uint8_t *band_translate = get_band_translate(tx_size);
const int dq_shift = (tx_size == TX_32X32);
@@ -74,9 +73,14 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
const uint8_t *cat5_prob;
const uint8_t *cat6_prob;
+ if (counts) {
+ coef_counts = counts->coef[tx_size][type][ref];
+ eob_branch_count = counts->eob_branch[tx_size][type][ref];
+ }
+
#if CONFIG_VP9_HIGHBITDEPTH
- if (cm->use_highbitdepth) {
- if (cm->bit_depth == VPX_BITS_10) {
+ if (xd->bd > VPX_BITS_8) {
+ if (xd->bd == VPX_BITS_10) {
cat1_prob = vp9_cat1_prob_high10;
cat2_prob = vp9_cat2_prob_high10;
cat3_prob = vp9_cat3_prob_high10;
@@ -112,7 +116,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
int val = -1;
band = *band_translate++;
prob = coef_probs[band][ctx];
- if (!cm->frame_parallel_decoding_mode)
+ if (counts)
++eob_branch_count[band][ctx];
if (!vp9_read(r, prob[EOB_CONTEXT_NODE])) {
INCREMENT_COUNT(EOB_MODEL_TOKEN);
@@ -162,7 +166,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
break;
case CATEGORY6_TOKEN:
#if CONFIG_VP9_HIGHBITDEPTH
- switch (cm->bit_depth) {
+ switch (xd->bd) {
case VPX_BITS_8:
val = CAT6_MIN_VAL + read_coeff(cat6_prob, 14, r);
break;
@@ -186,7 +190,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_VP9_HIGHBITDEPTH
dqcoeff[scan[c]] = highbd_check_range((vp9_read_bit(r) ? -v : v),
- cm->bit_depth);
+ xd->bd);
#else
dqcoeff[scan[c]] = check_range(vp9_read_bit(r) ? -v : v);
#endif // CONFIG_VP9_HIGHBITDEPTH
@@ -202,18 +206,17 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
return c;
}
-int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
- FRAME_COUNTS *counts, int plane, int block,
+int vp9_decode_block_tokens(MACROBLOCKD *xd,
+ int plane, int block,
BLOCK_SIZE plane_bsize, int x, int y,
TX_SIZE tx_size, vp9_reader *r,
int seg_id) {
struct macroblockd_plane *const pd = &xd->plane[plane];
- const int16_t *const dequant = (plane == 0) ? cm->y_dequant[seg_id]
- : cm->uv_dequant[seg_id];
+ const int16_t *const dequant = pd->seg_dequant[seg_id];
const int ctx = get_entropy_context(tx_size, pd->above_context + x,
pd->left_context + y);
const scan_order *so = get_scan(xd, tx_size, pd->plane_type, block);
- const int eob = decode_coefs(cm, xd, counts, pd->plane_type,
+ const int eob = decode_coefs(xd, pd->plane_type,
BLOCK_OFFSET(pd->dqcoeff, block), tx_size,
dequant, ctx, so->scan, so->neighbors, r);
vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.h ('k') | source/libvpx/vp9/encoder/arm/neon/vp9_variance_neon.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698