summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-02-01 11:52:49 -0800
committerMarco <marpan@google.com>2016-02-01 11:57:56 -0800
commit734dc36173769bd0334b58b2173da4ece1ae1cf5 (patch)
treef381757075cc2ac09b833422f8ca07f1f7de2b13
parentf51dd8c2ac7dcdbc269918b0d0fe30920f5641f7 (diff)
downloadlibvpx-734dc36173769bd0334b58b2173da4ece1ae1cf5.tar
libvpx-734dc36173769bd0334b58b2173da4ece1ae1cf5.tar.gz
libvpx-734dc36173769bd0334b58b2173da4ece1ae1cf5.tar.bz2
libvpx-734dc36173769bd0334b58b2173da4ece1ae1cf5.zip
vp9: Add flag to control usage of skin detection.
Set off as default; on for 1 pass cbr mode, speed >=5, non-screen-content. Change-Id: I03f2497e4028b354fd83b8a7d0e072c2a6bec878
-rw-r--r--vp9/encoder/vp9_aq_cyclicrefresh.c2
-rw-r--r--vp9/encoder/vp9_encodeframe.c4
-rw-r--r--vp9/encoder/vp9_encoder.c9
-rw-r--r--vp9/encoder/vp9_encoder.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c
index de6deb53b..0982fd6ff 100644
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -210,7 +210,7 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi,
int is_skin = 0;
if (refresh_this_block == 0 &&
bsize <= BLOCK_16X16 &&
- cpi->oxcf.content != VP9E_CONTENT_SCREEN) {
+ cpi->use_skin_detection) {
is_skin = vp9_compute_skin_block(p[0].src.buf,
p[1].src.buf,
p[2].src.buf,
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index f2ac39e5b..4159fe5e7 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -779,8 +779,8 @@ static int choose_partitioning(VP9_COMP *cpi,
// (i.e., y_sad < cpi->vbp_threshold_sad) below. For now leave this as is.
x->sb_is_skin = 0;
#if !CONFIG_VP9_HIGHBITDEPTH
- if (cpi->oxcf.content != VP9E_CONTENT_SCREEN && (!low_res && (mi_col >= 8 &&
- mi_col + 8 < cm->mi_cols && mi_row >= 8 && mi_row + 8 < cm->mi_rows))) {
+ if (cpi->use_skin_detection && !low_res && (mi_col >= 8 &&
+ mi_col + 8 < cm->mi_cols && mi_row >= 8 && mi_row + 8 < cm->mi_rows)) {
int num_16x16_skin = 0;
int num_16x16_nonskin = 0;
uint8_t *ysignal = x->plane[0].src.buf;
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index d4e17b8ca..5341c9444 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1671,6 +1671,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
cpi->resize_state = 0;
cpi->resize_avg_qp = 0;
cpi->resize_buffer_underflow = 0;
+ cpi->use_skin_detection = 0;
cpi->common.buffer_pool = pool;
cpi->rc.high_source_sad = 0;
@@ -3330,6 +3331,14 @@ static void encode_without_recode_loop(VP9_COMP *cpi,
set_size_independent_vars(cpi);
set_size_dependent_vars(cpi, &q, &bottom_index, &top_index);
+ if (cpi->oxcf.speed >= 5 &&
+ cpi->oxcf.pass == 0 &&
+ cpi->oxcf.rc_mode == VPX_CBR &&
+ cpi->oxcf.content != VP9E_CONTENT_SCREEN &&
+ cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ cpi->use_skin_detection = 1;
+ }
+
vp9_set_quantizer(cm, q);
vp9_set_variance_partition_thresholds(cpi, q);
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 76c36f4e5..838ceacd6 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -494,6 +494,8 @@ typedef struct VP9_COMP {
int resize_buffer_underflow;
int resize_count;
+ int use_skin_detection;
+
NOISE_ESTIMATE noise_estimate;
// VAR_BASED_PARTITION thresholds