diff options
author | Marco Paniconi <marpan@google.com> | 2018-08-02 20:48:17 -0700 |
---|---|---|
committer | Marco Paniconi <marpan@google.com> | 2018-08-02 21:23:11 -0700 |
commit | 5f914dd902b8414d7d4d8c21d0be96059f2c5103 (patch) | |
tree | ffcbd4084ebbb8da883e685cdae25faa2132896c /vp9 | |
parent | d22b1d69575bb4852555e3636dedb0ee6e635250 (diff) | |
download | libvpx-5f914dd902b8414d7d4d8c21d0be96059f2c5103.tar libvpx-5f914dd902b8414d7d4d8c21d0be96059f2c5103.tar.gz libvpx-5f914dd902b8414d7d4d8c21d0be96059f2c5103.tar.bz2 libvpx-5f914dd902b8414d7d4d8c21d0be96059f2c5103.zip |
vp9: Add zero_temp_sad count to scene detection.
For real-time screen-content mode: makes the
scene/slide change detection more robust.
Change-Id: I28d8d28b42bb92d527811f814bf14bbbbb53ab25
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 82cec1084..47669a049 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -2640,6 +2640,7 @@ void vp9_scene_detection_onepass(VP9_COMP *cpi) { int frames_to_buffer = 1; int frame = 0; int scene_cut_force_key_frame = 0; + int num_zero_temp_sad = 0; uint64_t avg_sad_current = 0; uint32_t min_thresh = 10000; float thresh = 8.0f; @@ -2703,6 +2704,7 @@ void vp9_scene_detection_onepass(VP9_COMP *cpi) { last_src_y = frames[frame + 1]->y_buffer; last_src_ystride = frames[frame + 1]->y_stride; } + num_zero_temp_sad = 0; for (sbi_row = 0; sbi_row < sb_rows; ++sbi_row) { for (sbi_col = 0; sbi_col < sb_cols; ++sbi_col) { // Checker-board pattern, ignore boundary. @@ -2714,6 +2716,7 @@ void vp9_scene_detection_onepass(VP9_COMP *cpi) { last_src_ystride); avg_sad += tmp_sad; num_samples++; + if (tmp_sad == 0) num_zero_temp_sad++; } src_y += 64; last_src_y += 64; @@ -2730,7 +2733,8 @@ void vp9_scene_detection_onepass(VP9_COMP *cpi) { if (avg_sad > VPXMAX(min_thresh, (unsigned int)(rc->avg_source_sad[0] * thresh)) && - rc->frames_since_key > 1) + rc->frames_since_key > 1 && + num_zero_temp_sad < 3 * (num_samples >> 2)) rc->high_source_sad = 1; else rc->high_source_sad = 0; |