Commit 27aec502 authored by James Zern's avatar James Zern
Browse files

vp9_decode_tokens: limit scope of function params

replace VP9D_COMP usage with the (slightly) more targeted
VP9_COMMON/MACROBLCKD/struct segmentation structures.

Change-Id: Iabb3616e231417b0e17b7e4b384ea63167a81745
parent 2f5b7ad6
......@@ -169,7 +169,7 @@ static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE bsize, vp9_reader *r) {
cm->base_qindex));
// TODO(dkovalev) if (!vp9_reader_has_error(r))
return vp9_decode_tokens(pbi, r, bsize);
return vp9_decode_tokens(cm, xd, &cm->seg, r, bsize);
}
}
......
......@@ -208,7 +208,9 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
}
struct decode_block_args {
VP9D_COMP *pbi;
VP9_COMMON *cm;
MACROBLOCKD *xd;
struct segmentation *seg;
vp9_reader *r;
int *eobtotal;
};
......@@ -218,8 +220,8 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
const struct decode_block_args* const arg = argv;
// find the maximum eob for this transform size, adjusted by segment
MACROBLOCKD *xd = &arg->pbi->mb;
struct segmentation *seg = &arg->pbi->common.seg;
MACROBLOCKD *xd = arg->xd;
const struct segmentation *seg = arg->seg;
struct macroblockd_plane* pd = &xd->plane[plane];
const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
const int seg_eob = get_tx_eob(seg, segment_id, tx_size);
......@@ -229,7 +231,7 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
pt = get_entropy_context(tx_size, pd->above_context + aoff,
pd->left_context + loff);
eob = decode_coefs(&arg->pbi->common, xd, arg->r, block,
eob = decode_coefs(arg->cm, xd, arg->r, block,
pd->plane_type, seg_eob, BLOCK_OFFSET(pd->qcoeff, block),
tx_size, pd->dequant, pt);
......@@ -239,9 +241,11 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
*arg->eobtotal += eob;
}
int vp9_decode_tokens(VP9D_COMP *pbi, vp9_reader *r, BLOCK_SIZE bsize) {
int vp9_decode_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
struct segmentation *seg,
vp9_reader *r, BLOCK_SIZE bsize) {
int eobtotal = 0;
struct decode_block_args args = {pbi, r, &eobtotal};
foreach_transformed_block(&pbi->mb, bsize, decode_block, &args);
struct decode_block_args args = {cm, xd, seg, r, &eobtotal};
foreach_transformed_block(xd, bsize, decode_block, &args);
return eobtotal;
}
......@@ -15,6 +15,8 @@
#include "vp9/decoder/vp9_onyxd_int.h"
#include "vp9/decoder/vp9_dboolhuff.h"
int vp9_decode_tokens(VP9D_COMP* pbi, vp9_reader *r, BLOCK_SIZE bsize);
int vp9_decode_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
struct segmentation *seg,
vp9_reader *r, BLOCK_SIZE bsize);
#endif // VP9_DECODER_VP9_DETOKENIZE_H_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment