summaryrefslogtreecommitdiff
path: root/vp10/encoder/tokenize.c
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-10-22 17:25:00 -0700
committerJingning Han <jingning@google.com>2015-10-23 09:19:17 -0700
commitcaeb10bf06f758d317b2e76d274941e79414784e (patch)
tree7964cfc6489ef000c20fca9a59669e274ab7fd99 /vp10/encoder/tokenize.c
parentf4af1a9af48c972da1d5d8f04b84fed1017a25b5 (diff)
downloadlibvpx-caeb10bf06f758d317b2e76d274941e79414784e.tar
libvpx-caeb10bf06f758d317b2e76d274941e79414784e.tar.gz
libvpx-caeb10bf06f758d317b2e76d274941e79414784e.tar.bz2
libvpx-caeb10bf06f758d317b2e76d274941e79414784e.zip
Use explicit block position in foreach_transformed_block
Add the row and column index to the argument list of unit functions called by foreach_transformed_block wrapper. This avoids the repeated internal parsing according to the block index. Change-Id: Ie7508acdac0b498487564639bc5cc6378a8a0df7
Diffstat (limited to 'vp10/encoder/tokenize.c')
-rw-r--r--vp10/encoder/tokenize.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/vp10/encoder/tokenize.c b/vp10/encoder/tokenize.c
index 2c9998ba0..e568c0ba5 100644
--- a/vp10/encoder/tokenize.c
+++ b/vp10/encoder/tokenize.c
@@ -443,7 +443,9 @@ struct tokenize_b_args {
TOKENEXTRA **tp;
};
-static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
+static void set_entropy_context_b(int plane, int block,
+ int blk_row, int blk_col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
ThreadData *const td = args->td;
@@ -451,10 +453,8 @@ static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *p = &x->plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
- int aoff, loff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
vp10_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0,
- aoff, loff);
+ blk_col, blk_row);
}
static INLINE void add_token(TOKENEXTRA **t, const vpx_prob *context_tree,
@@ -520,7 +520,8 @@ void vp10_tokenize_palette_sb(struct ThreadData *const td,
}
}
-static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
+static void tokenize_b(int plane, int block, int blk_row, int blk_col,
+ BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
VP10_COMP *cpi = args->cpi;
@@ -553,11 +554,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
int16_t token;
EXTRABIT extra;
- int aoff, loff;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
-
- pt = get_entropy_context(tx_size, pd->above_context + aoff,
- pd->left_context + loff);
+ pt = get_entropy_context(tx_size, pd->above_context + blk_col,
+ pd->left_context + blk_row);
scan = so->scan;
nb = so->neighbors;
c = 0;
@@ -597,20 +595,22 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
*tp = t;
- vp10_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff);
+ vp10_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, blk_col, blk_row);
}
struct is_skippable_args {
uint16_t *eobs;
int *skippable;
};
-static void is_skippable(int plane, int block,
+static void is_skippable(int plane, int block, int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) {
struct is_skippable_args *args = argv;
(void)plane;
(void)plane_bsize;
(void)tx_size;
+ (void)blk_row;
+ (void)blk_col;
args->skippable[0] &= (!args->eobs[block]);
}
@@ -624,13 +624,15 @@ int vp10_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
return result;
}
-static void has_high_freq_coeff(int plane, int block,
+static void has_high_freq_coeff(int plane, int block, int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) {
struct is_skippable_args *args = argv;
int eobs = (tx_size == TX_4X4) ? 3 : 10;
(void) plane;
(void) plane_bsize;
+ (void) blk_row;
+ (void) blk_col;
*(args->skippable) |= (args->eobs[block] > eobs);
}