summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-02-23 17:49:34 -0800
committerMarco <marpan@google.com>2016-02-23 17:52:37 -0800
commit1cab19e9e4cac95c33120d1256ad6128ba4920b7 (patch)
tree8424d967b8731ca8499b91c5f1b63830eb31363c
parenta0278cad3f352e4d878f59ecf414f0af2badae8b (diff)
downloadlibvpx-1cab19e9e4cac95c33120d1256ad6128ba4920b7.tar
libvpx-1cab19e9e4cac95c33120d1256ad6128ba4920b7.tar.gz
libvpx-1cab19e9e4cac95c33120d1256ad6128ba4920b7.tar.bz2
libvpx-1cab19e9e4cac95c33120d1256ad6128ba4920b7.zip
vp9: Update to scene/content change detection.
Update some parameters and put check on frame size change. For 1 pass VBR mode, speed >= 5. Change-Id: If24ed94a21e705ea57d40b9bf235ad079db786fc
-rw-r--r--vp9/encoder/vp9_ratectrl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 042fe0b94..d64b5c53b 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -2017,14 +2017,16 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
VP9_COMMON * const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
rc->high_source_sad = 0;
- if (cpi->Last_Source != NULL) {
+ if (cpi->Last_Source != NULL &&
+ cpi->Last_Source->y_width == cm->width &&
+ cpi->Last_Source->y_height == cm->height) {
const uint8_t *src_y = cpi->Source->y_buffer;
const int src_ystride = cpi->Source->y_stride;
const uint8_t *last_src_y = cpi->Last_Source->y_buffer;
const int last_src_ystride = cpi->Last_Source->y_stride;
int sbi_row, sbi_col;
const BLOCK_SIZE bsize = BLOCK_64X64;
- const uint32_t min_thresh = 4000;
+ uint32_t min_thresh = 4000;
float thresh = 8.0f;
// Loop over sub-sample of frame, and compute average sad over 64x64 blocks.
uint64_t avg_sad = 0;
@@ -2057,7 +2059,8 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
// for cases where there is small change from content that is completely
// static.
if (cpi->oxcf.rc_mode == VPX_VBR) {
- thresh = 2.5f;
+ min_thresh = 20000;
+ thresh = 2.0f;
}
if (avg_sad >
VPXMAX(min_thresh, (unsigned int)(rc->avg_source_sad * thresh)) &&
@@ -2065,7 +2068,8 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
rc->high_source_sad = 1;
else
rc->high_source_sad = 0;
- rc->avg_source_sad = (rc->avg_source_sad + avg_sad) >> 1;
+ if (avg_sad > 0)
+ rc->avg_source_sad = (rc->avg_source_sad + avg_sad) >> 1;
// For VBR, under scene change/high content change, force golden refresh.
if (cpi->oxcf.rc_mode == VPX_VBR &&
rc->high_source_sad &&