diff options
-rw-r--r-- | chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.c | 12 | ||||
-rw-r--r-- | chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.h | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.c b/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.c index afc801eb31a..8cb99628c8e 100644 --- a/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.c +++ b/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.c @@ -1843,6 +1843,8 @@ void av1_rc_postencode_update(AV1_COMP *cpi, uint64_t bytes_used) { update_golden_frame_stats(cpi); if (current_frame->frame_type == KEY_FRAME) rc->frames_since_key = 0; + rc->prev_coded_width = cm->width; + rc->prev_coded_height = cm->height; // if (current_frame->frame_number == 1 && cm->show_frame) /* rc->this_frame_target = @@ -1858,6 +1860,8 @@ void av1_rc_postencode_update_drop_frame(AV1_COMP *cpi) { cpi->rc.frames_to_key--; cpi->rc.rc_2_frame = 0; cpi->rc.rc_1_frame = 0; + cpi->rc.prev_coded_width = cpi->common.width; + cpi->rc.prev_coded_height = cpi->common.height; } int av1_find_qindex(double desired_q, aom_bit_depth_t bit_depth, @@ -2598,8 +2602,12 @@ void av1_get_one_pass_rt_params(AV1_COMP *cpi, } } // Check for scene change, for non-SVC for now. - if (!cpi->use_svc && cpi->sf.rt_sf.check_scene_detection) - rc_scene_detection_onepass_rt(cpi); + if (!cpi->use_svc && cpi->sf.rt_sf.check_scene_detection) { + if (rc->prev_coded_width == cm->width && + rc->prev_coded_height == cm->height) { + rc_scene_detection_onepass_rt(cpi); + } + } // Check for dynamic resize, for single spatial layer for now. // For temporal layers only check on base temporal layer. if (cpi->oxcf.resize_cfg.resize_mode == RESIZE_DYNAMIC) { diff --git a/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.h b/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.h index 7f26f388374..65aa91f806c 100644 --- a/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.h +++ b/chromium/third_party/libaom/source/libaom/av1/encoder/ratectrl.h @@ -298,6 +298,9 @@ typedef struct { int resize_buffer_underflow; int resize_count; /*!\endcond */ + + int prev_coded_width; + int prev_coded_height; } RATE_CONTROL; /*!\cond */ |