Merge "vp9: speed 8: Fix seg fault in partition copy when drop frames."

This commit is contained in:
Jerome Jiang 2017-05-13 03:20:48 +00:00 committed by Gerrit Code Review
commit 6b9d130214
3 changed files with 9 additions and 2 deletions

View File

@ -4414,12 +4414,14 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
++cm->current_video_frame;
cpi->ext_refresh_frame_flags_pending = 0;
cpi->svc.rc_drop_superframe = 1;
cpi->last_frame_dropped = 1;
// TODO(marpan): Advancing the svc counters on dropped frames can break
// the referencing scheme for the fixed svc patterns defined in
// vp9_one_pass_cbr_svc_start_layer(). Look into fixing this issue, but
// for now, don't advance the svc frame counters on dropped frame.
// if (cpi->use_svc)
// vp9_inc_frame_in_layer(cpi);
return;
}
}
@ -4437,6 +4439,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
encode_with_recode_loop(cpi, size, dest);
}
cpi->last_frame_dropped = 0;
// Disable segmentation if it decrease rate/distortion ratio
if (cpi->oxcf.aq_mode == LOOKAHEAD_AQ)
vp9_try_disable_lookahead_aq(cpi, size, dest);

View File

@ -704,6 +704,8 @@ typedef struct VP9_COMP {
uint8_t *prev_variance_low;
uint8_t *copied_frame_cnt;
uint8_t max_copied_frame;
// If the last frame is dropped, we don't copy partition.
uint8_t last_frame_dropped;
// For each superblock: keeps track of the last time (in frame distance) the
// the superblock did not have low source sad.

View File

@ -565,8 +565,9 @@ static void set_rt_speed_feature_framesize_independent(
if (speed >= 8) {
sf->adaptive_rd_thresh = 4;
// Enable partition copy
if (!cpi->use_svc && !cpi->resize_pending && cpi->resize_state == ORIG &&
!cpi->external_resize && cpi->oxcf.resize_mode == RESIZE_NONE) {
if (!cpi->last_frame_dropped && !cpi->use_svc && !cpi->resize_pending &&
cpi->resize_state == ORIG && !cpi->external_resize &&
cpi->oxcf.resize_mode == RESIZE_NONE) {
sf->copy_partition_flag = 1;
cpi->max_copied_frame = 4;
}