summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_if.c
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2017-10-12 15:03:22 -0700
committerJerome Jiang <jianj@google.com>2017-10-17 15:23:03 -0700
commitdbb8926b86610684c4a2e3aba503aa0222cd951d (patch)
tree5941821de78c3efd57ebd19e5c117d791115944b /vp8/encoder/onyx_if.c
parenta9248457b16b0a728d666292ae1341d81b737271 (diff)
downloadlibvpx-dbb8926b86610684c4a2e3aba503aa0222cd951d.tar
libvpx-dbb8926b86610684c4a2e3aba503aa0222cd951d.tar.gz
libvpx-dbb8926b86610684c4a2e3aba503aa0222cd951d.tar.bz2
libvpx-dbb8926b86610684c4a2e3aba503aa0222cd951d.zip
vp8: Enable use of ROI map.
Disable cyclic refresh if ROI is used and add flag to properly handle the static_thresh deltas. Remove the ROI test for cyclic refresh (it's allowed but disabled if ROI is used). Add an example in vpx_temporal_svc_encoder.c. Turned off by default. BUG=webm:1470 Change-Id: Ief9ba1d7f967bc00511b412b491c3f70943bfbda
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r--vp8/encoder/onyx_if.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 2c2a783a9..5d714e122 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1553,9 +1553,8 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
setup_features(cpi);
- {
+ if (!cpi->use_roi_static_threshold) {
int i;
-
for (i = 0; i < MAX_MB_SEGMENTS; ++i) {
cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
}
@@ -1815,6 +1814,8 @@ struct VP8_COMP *vp8_create_compressor(VP8_CONFIG *oxcf) {
cpi->active_map_enabled = 0;
+ cpi->use_roi_static_threshold = 0;
+
#if 0
/* Experimental code for lagged and one pass */
/* Initialise one_pass GF frames stats */
@@ -5354,9 +5355,6 @@ int vp8_set_roimap(VP8_COMP *cpi, unsigned char *map, unsigned int rows,
const int range = 63;
int i;
- // This method is currently incompatible with the cyclic refresh method
- if (cpi->cyclic_refresh_mode_enabled) return -1;
-
// Check number of rows and columns match
if (cpi->common.mb_rows != (int)rows || cpi->common.mb_cols != (int)cols) {
return -1;
@@ -5375,7 +5373,11 @@ int vp8_set_roimap(VP8_COMP *cpi, unsigned char *map, unsigned int rows,
return -1;
}
- if (!map) {
+ // Also disable segmentation if no deltas are specified.
+ if (!map || (delta_q[0] == 0 && delta_q[1] == 0 && delta_q[2] == 0 &&
+ delta_q[3] == 0 && delta_lf[0] == 0 && delta_lf[1] == 0 &&
+ delta_lf[2] == 0 && delta_lf[3] == 0 && threshold[0] == 0 &&
+ threshold[1] == 0 && threshold[2] == 0 && threshold[3] == 0)) {
disable_segmentation(cpi);
return 0;
}
@@ -5412,6 +5414,11 @@ int vp8_set_roimap(VP8_COMP *cpi, unsigned char *map, unsigned int rows,
/* Initialise the feature data structure */
set_segment_data(cpi, &feature_data[0][0], SEGMENT_DELTADATA);
+ if (threshold[0] != 0 || threshold[1] != 0 || threshold[2] != 0 ||
+ threshold[3] != 0)
+ cpi->use_roi_static_threshold = 1;
+ cpi->cyclic_refresh_mode_enabled = 0;
+
return 0;
}