summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-04-16 16:15:05 -0700
committerMarco Paniconi <marpan@google.com>2018-04-18 12:39:56 -0700
commitce11afb0e02a81a1e0e38ea9f3c3e13920439b1f (patch)
tree7ed399dff06838fe8206963db088c04b5dac4d41 /vp9/encoder/vp9_ratectrl.c
parent03fa7018737180d6ee7c495543410c2b2f9f6d09 (diff)
downloadlibvpx-ce11afb0e02a81a1e0e38ea9f3c3e13920439b1f.tar
libvpx-ce11afb0e02a81a1e0e38ea9f3c3e13920439b1f.tar.gz
libvpx-ce11afb0e02a81a1e0e38ea9f3c3e13920439b1f.tar.bz2
libvpx-ce11afb0e02a81a1e0e38ea9f3c3e13920439b1f.zip
vp9: Changes for scene detection overshoot and SVC.
Refactor the scene detection for 1 pass cbr to allow the scene detection to be checked once per superframe (on the base layer), using the full resolution sources. If scene change is detected: check for re-encoding due to large overshoot for all spatial layers withing the superframe. Add speed feature to control the re-encode step. Keep the re-encode step on for now. Small change in nonrd_pickmode to remove the possible skip of golden reference for SVC, when the high_source_sad is set for the superframe. Change only affects SVC encoding with screen-content mode enabled. Change-Id: If4cfb52cb0dd0f0fce1c4214fa8b413f8f803d56
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r--vp9/encoder/vp9_ratectrl.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index c9632e904..748a0ddd8 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -2284,18 +2284,34 @@ static void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi,
void vp9_scene_detection_onepass(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
+ YV12_BUFFER_CONFIG const *unscaled_src = cpi->un_scaled_source;
+ YV12_BUFFER_CONFIG const *unscaled_last_src = cpi->unscaled_last_source;
+ uint8_t *src_y;
+ int src_ystride;
+ int src_width;
+ int src_height;
+ uint8_t *last_src_y;
+ int last_src_ystride;
+ int last_src_width;
+ int last_src_height;
+ if (cpi->un_scaled_source == NULL || cpi->unscaled_last_source == NULL ||
+ (cpi->use_svc && cpi->svc.current_superframe == 0))
+ return;
+ src_y = unscaled_src->y_buffer;
+ src_ystride = unscaled_src->y_stride;
+ src_width = unscaled_src->y_width;
+ src_height = unscaled_src->y_height;
+ last_src_y = unscaled_last_src->y_buffer;
+ last_src_ystride = unscaled_last_src->y_stride;
+ last_src_width = unscaled_last_src->y_width;
+ last_src_height = unscaled_last_src->y_height;
#if CONFIG_VP9_HIGHBITDEPTH
if (cm->use_highbitdepth) return;
#endif
rc->high_source_sad = 0;
- if (cpi->Last_Source != NULL &&
- cpi->Last_Source->y_width == cpi->Source->y_width &&
- cpi->Last_Source->y_height == cpi->Source->y_height) {
+ if (cpi->svc.spatial_layer_id == 0 && src_width == last_src_width &&
+ src_height == last_src_height) {
YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS] = { NULL };
- uint8_t *src_y = cpi->Source->y_buffer;
- int src_ystride = cpi->Source->y_stride;
- uint8_t *last_src_y = cpi->Last_Source->y_buffer;
- int last_src_ystride = cpi->Last_Source->y_stride;
int start_frame = 0;
int frames_to_buffer = 1;
int frame = 0;