summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2014-03-31 16:54:33 -0700
committerAlex Converse <aconverse@google.com>2014-03-31 16:55:39 -0700
commit12dd53d06a895a188ac491751e5c21acc12f42e8 (patch)
tree645fc45cb5c63f0c80671876f6b50a9b8a7bdbdb /vp9
parente1574b94e6747b57de248a4271751f4e6b8dd51c (diff)
downloadlibvpx-12dd53d06a895a188ac491751e5c21acc12f42e8.tar
libvpx-12dd53d06a895a188ac491751e5c21acc12f42e8.tar.gz
libvpx-12dd53d06a895a188ac491751e5c21acc12f42e8.tar.bz2
libvpx-12dd53d06a895a188ac491751e5c21acc12f42e8.zip
Propagate active map state.
This fixes active map for non-rd realtime speeds. Change-Id: I1bf416de3f7ef2e5dd2eabde052cce3c0683a52c
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 1e5890cda..76e74b739 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -168,9 +168,9 @@ static INLINE void set_modeinfo_offsets(VP9_COMMON *const cm,
xd->mi_8x8[0] = cm->mi + idx_str;
}
-static int is_block_in_mb_map(VP9_COMP *cpi, int mi_row, int mi_col,
+static int is_block_in_mb_map(const VP9_COMP *cpi, int mi_row, int mi_col,
BLOCK_SIZE bsize) {
- VP9_COMMON *const cm = &cpi->common;
+ const VP9_COMMON *const cm = &cpi->common;
const int mb_rows = cm->mb_rows;
const int mb_cols = cm->mb_cols;
const int mb_row = mi_row >> 1;
@@ -194,6 +194,16 @@ static int is_block_in_mb_map(VP9_COMP *cpi, int mi_row, int mi_col,
return 0;
}
+static int check_active_map(const VP9_COMP *cpi, const MACROBLOCK *x,
+ int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
+ if (cpi->active_map_enabled && !x->e_mbd.lossless) {
+ return is_block_in_mb_map(cpi, mi_row, mi_col, bsize);
+ } else {
+ return 1;
+ }
+}
+
static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
int mi_row, int mi_col, BLOCK_SIZE bsize) {
MACROBLOCK *const x = &cpi->mb;
@@ -211,12 +221,7 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
// Activity map pointer
x->mb_activity_ptr = &cpi->mb_activity_map[idx_map];
-
- if (cpi->active_map_enabled && !x->e_mbd.lossless) {
- x->in_active_map = is_block_in_mb_map(cpi, mi_row, mi_col, bsize);
- } else {
- x->in_active_map = 1;
- }
+ x->in_active_map = check_active_map(cpi, x, mi_row, mi_col, bsize);
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
@@ -1431,6 +1436,8 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
++cm->counts.switchable_interp[pred_ctx][mbmi->interp_filter];
}
}
+
+ x->skip = ctx->skip;
}
static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile,
@@ -1590,9 +1597,11 @@ static void rd_use_partition(VP9_COMP *cpi,
}
save_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
- set_offsets(cpi, tile, mi_row, mi_col, bsize);
if (bsize == BLOCK_16X16) {
+ set_offsets(cpi, tile, mi_row, mi_col, bsize);
x->mb_energy = vp9_block_energy(cpi, x, bsize);
+ } else {
+ x->in_active_map = check_active_map(cpi, x, mi_row, mi_col, bsize);
}
if (!x->in_active_map) {
@@ -2024,6 +2033,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
if (bsize == BLOCK_16X16) {
set_offsets(cpi, tile, mi_row, mi_col, bsize);
x->mb_energy = vp9_block_energy(cpi, x, bsize);
+ } else {
+ x->in_active_map = check_active_map(cpi, x, mi_row, mi_col, bsize);
}
// Determine partition types in search according to the speed features.
@@ -2674,6 +2685,8 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
assert(num_8x8_blocks_wide_lookup[bsize] ==
num_8x8_blocks_high_lookup[bsize]);
+ x->in_active_map = check_active_map(cpi, x, mi_row, mi_col, bsize);
+
// Determine partition types in search according to the speed features.
// The threshold set here has to be of square block size.
if (cpi->sf.auto_min_max_partition_size) {