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

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

Issue 17009012: libvpx: Pull from upstream (Closed) Base URL: http://src.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 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/vp9_block.h » ('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
===================================================================
--- source/libvpx/vp9/decoder/vp9_detokenize.c (revision 207064)
+++ source/libvpx/vp9/decoder/vp9_detokenize.c (working copy)
@@ -8,15 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/mem.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_common.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vp9/decoder/vp9_detokenize.h"
#include "vp9/common/vp9_seg_common.h"
+#include "vp9/decoder/vp9_detokenize.h"
+#include "vp9/decoder/vp9_onyxd_int.h"
+
#if CONFIG_BALANCED_COEFTREE
#define ZERO_CONTEXT_NODE 0
#define EOB_CONTEXT_NODE 1
@@ -24,6 +25,7 @@
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#endif
+
#define ONE_CONTEXT_NODE 2
#define LOW_VAL_CONTEXT_NODE 3
#define TWO_CONTEXT_NODE 4
@@ -89,13 +91,12 @@
val += 1 << bits_count; \
} while (0);
-static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
+static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd,
vp9_reader *r, int block_idx,
PLANE_TYPE type, int seg_eob, int16_t *qcoeff_ptr,
TX_SIZE txfm_size, const int16_t *dq,
ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L) {
ENTROPY_CONTEXT above_ec, left_ec;
- FRAME_CONTEXT *const fc = &dx->common.fc;
int pt, c = 0, pad, default_eob;
int band;
vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES];
@@ -298,10 +299,10 @@
struct decode_block_args {
VP9D_COMP *pbi;
- MACROBLOCKD *xd;
vp9_reader *r;
int *eobtotal;
};
+
static void decode_block(int plane, int block,
BLOCK_SIZE_TYPE bsize,
int ss_txfrm_size,
@@ -310,42 +311,37 @@
const int bw = b_width_log2(bsize);
// find the maximum eob for this transform size, adjusted by segment
- MACROBLOCKD *xd = arg->xd;
- const int segment_id = arg->xd->mode_info_context->mbmi.segment_id;
+ MACROBLOCKD *xd = &arg->pbi->mb;
+ struct macroblockd_plane* pd = &xd->plane[plane];
+ const int segment_id = xd->mode_info_context->mbmi.segment_id;
const TX_SIZE ss_tx_size = ss_txfrm_size / 2;
- const int seg_eob = get_eob(arg->xd, segment_id, 16 << ss_txfrm_size);
- int16_t* const qcoeff_base = arg->xd->plane[plane].qcoeff;
+ const int seg_eob = get_eob(xd, segment_id, 16 << ss_txfrm_size);
const int off = block >> ss_txfrm_size;
- const int mod = bw - ss_tx_size - arg->xd->plane[plane].subsampling_x;
+ const int mod = bw - ss_tx_size - pd->subsampling_x;
const int aoff = (off & ((1 << mod) - 1)) << ss_tx_size;
const int loff = (off >> mod) << ss_tx_size;
- int pt;
- ENTROPY_CONTEXT *A = arg->xd->plane[plane].above_context + aoff;
- ENTROPY_CONTEXT *L = arg->xd->plane[plane].left_context + loff;
- const int eob = decode_coefs(arg->pbi, arg->xd, arg->r, block,
- arg->xd->plane[plane].plane_type, seg_eob,
- BLOCK_OFFSET(qcoeff_base, block, 16),
- ss_tx_size, arg->xd->plane[plane].dequant,
- A,
- L);
+ ENTROPY_CONTEXT *A = pd->above_context + aoff;
+ ENTROPY_CONTEXT *L = pd->left_context + loff;
+ const int eob = decode_coefs(&arg->pbi->common.fc, xd, arg->r, block,
+ pd->plane_type, seg_eob,
+ BLOCK_OFFSET(pd->qcoeff, block, 16),
+ ss_tx_size, pd->dequant, A, L);
+
if (xd->mb_to_right_edge < 0 || xd->mb_to_bottom_edge < 0) {
set_contexts_on_border(xd, bsize, plane, ss_tx_size, eob, aoff, loff, A, L);
} else {
- for (pt = 0; pt < (1 << ss_tx_size); pt++) {
+ int pt;
+ for (pt = 0; pt < (1 << ss_tx_size); pt++)
A[pt] = L[pt] = eob > 0;
- }
}
- arg->xd->plane[plane].eobs[block] = eob;
- arg->eobtotal[0] += eob;
+ pd->eobs[block] = eob;
+ *arg->eobtotal += eob;
}
-int vp9_decode_tokens(VP9D_COMP* const pbi,
- MACROBLOCKD* const xd,
- vp9_reader *r,
- BLOCK_SIZE_TYPE bsize) {
+int vp9_decode_tokens(VP9D_COMP *pbi, vp9_reader *r, BLOCK_SIZE_TYPE bsize) {
int eobtotal = 0;
- struct decode_block_args args = {pbi, xd, r, &eobtotal};
- foreach_transformed_block(xd, bsize, decode_block, &args);
+ struct decode_block_args args = {pbi, r, &eobtotal};
+ foreach_transformed_block(&pbi->mb, bsize, decode_block, &args);
return eobtotal;
}
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_detokenize.h ('k') | source/libvpx/vp9/encoder/vp9_block.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698