Commit 8191ed8b authored by Aℓex Converse's avatar Aℓex Converse Committed by Gerrit Code Review
Browse files

Merge changes If196d9e5,Ib669d572

* changes:
  Simplify is_skippable to point straight to eobs.
  Don't initialize extra context tree buffers for 4x8 and 8x4.
parents bd863314 d3b6062a
...@@ -69,10 +69,13 @@ static void alloc_tree_contexts(VP9_COMMON *cm, PC_TREE *tree, ...@@ -69,10 +69,13 @@ static void alloc_tree_contexts(VP9_COMMON *cm, PC_TREE *tree,
alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[0]); alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[0]);
alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[0]); alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[0]);
/* TODO(Jbb): for 4x8 and 8x4 these allocated values are not used. if (num_4x4_blk > 4) {
* Figure out a better way to do this. */ alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]);
alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]); alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]);
alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]); } else {
memset(&tree->horizontal[1], 0, sizeof(tree->horizontal[1]));
memset(&tree->vertical[1], 0, sizeof(tree->vertical[1]));
}
} }
static void free_tree_contexts(PC_TREE *tree) { static void free_tree_contexts(PC_TREE *tree) {
......
...@@ -568,23 +568,24 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -568,23 +568,24 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
} }
struct is_skippable_args { struct is_skippable_args {
MACROBLOCK *x; uint16_t *eobs;
int *skippable; int *skippable;
}; };
static void is_skippable(int plane, int block, static void is_skippable(int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) { void *argv) {
struct is_skippable_args *args = argv; struct is_skippable_args *args = argv;
(void)plane;
(void)plane_bsize; (void)plane_bsize;
(void)tx_size; (void)tx_size;
args->skippable[0] &= (!args->x->plane[plane].eobs[block]); args->skippable[0] &= (!args->eobs[block]);
} }
// TODO(yaowu): rewrite and optimize this function to remove the usage of // TODO(yaowu): rewrite and optimize this function to remove the usage of
// vp9_foreach_transform_block() and simplify is_skippable(). // vp9_foreach_transform_block() and simplify is_skippable().
int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
int result = 1; int result = 1;
struct is_skippable_args args = {x, &result}; struct is_skippable_args args = {x->plane[plane].eobs, &result};
vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, is_skippable, vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, is_skippable,
&args); &args);
return result; return result;
...@@ -595,14 +596,15 @@ static void has_high_freq_coeff(int plane, int block, ...@@ -595,14 +596,15 @@ static void has_high_freq_coeff(int plane, int block,
void *argv) { void *argv) {
struct is_skippable_args *args = argv; struct is_skippable_args *args = argv;
int eobs = (tx_size == TX_4X4) ? 3 : 10; int eobs = (tx_size == TX_4X4) ? 3 : 10;
(void) plane;
(void) plane_bsize; (void) plane_bsize;
*(args->skippable) |= (args->x->plane[plane].eobs[block] > eobs); *(args->skippable) |= (args->eobs[block] > eobs);
} }
int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
int result = 0; int result = 0;
struct is_skippable_args args = {x, &result}; struct is_skippable_args args = {x->plane[plane].eobs, &result};
vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane,
has_high_freq_coeff, &args); has_high_freq_coeff, &args);
return result; return result;
......
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