summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2015-03-31 11:52:56 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2015-03-31 11:52:56 -0700
commit9670d766ab0fc1909b2c96dcc9e683432d047442 (patch)
tree6ff4f6508e4346c0445872016ecc0ad762e650d3 /vp9/encoder
parentd4f2f1dd5b7d36be78d215ef563c786c9654606c (diff)
parent4dcb839607efdcff4be3936bc07ab557bc59b7ea (diff)
downloadlibvpx-9670d766ab0fc1909b2c96dcc9e683432d047442.tar
libvpx-9670d766ab0fc1909b2c96dcc9e683432d047442.tar.gz
libvpx-9670d766ab0fc1909b2c96dcc9e683432d047442.tar.bz2
libvpx-9670d766ab0fc1909b2c96dcc9e683432d047442.zip
Merge "VP9E_GET_ACTIVE_MAP API function."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.c27
-rw-r--r--vp9/encoder/vp9_encoder.h2
2 files changed, 29 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index fc05811a3..59788eb82 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -183,6 +183,33 @@ int vp9_set_active_map(VP9_COMP* cpi,
}
}
+int vp9_get_active_map(VP9_COMP* cpi,
+ unsigned char* new_map_16x16,
+ int rows,
+ int cols) {
+ if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols &&
+ new_map_16x16) {
+ unsigned char* const seg_map_8x8 = cpi->segmentation_map;
+ const int mi_rows = cpi->common.mi_rows;
+ const int mi_cols = cpi->common.mi_cols;
+ vpx_memset(new_map_16x16, !cpi->active_map.enabled, rows * cols);
+ if (cpi->active_map.enabled) {
+ int r, c;
+ for (r = 0; r < mi_rows; ++r) {
+ for (c = 0; c < mi_cols; ++c) {
+ // Cyclic refresh segments are considered active despite not having
+ // AM_SEGMENT_ID_ACTIVE
+ new_map_16x16[(r >> 1) * cols + (c >> 1)] |=
+ seg_map_8x8[r * mi_cols + c] != AM_SEGMENT_ID_INACTIVE;
+ }
+ }
+ }
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) {
MACROBLOCK *const mb = &cpi->td.mb;
cpi->common.allow_high_precision_mv = allow_high_precision_mv;
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 914080c6f..3c57c8613 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -508,6 +508,8 @@ int vp9_update_entropy(VP9_COMP *cpi, int update);
int vp9_set_active_map(VP9_COMP *cpi, unsigned char *map, int rows, int cols);
+int vp9_get_active_map(VP9_COMP *cpi, unsigned char *map, int rows, int cols);
+
int vp9_set_internal_size(VP9_COMP *cpi,
VPX_SCALING horiz_mode, VPX_SCALING vert_mode);