diff options
Diffstat (limited to 'third_party/aom/av1/encoder/encoder.c')
-rw-r--r-- | third_party/aom/av1/encoder/encoder.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/third_party/aom/av1/encoder/encoder.c b/third_party/aom/av1/encoder/encoder.c index 4732ad435b..fe053af5cc 100644 --- a/third_party/aom/av1/encoder/encoder.c +++ b/third_party/aom/av1/encoder/encoder.c @@ -2594,15 +2594,19 @@ static int encode_without_recode(AV1_COMP *cpi) { if (cpi->ref_frame_flags & av1_ref_frame_flag_list[GOLDEN_FRAME]) { const YV12_BUFFER_CONFIG *const ref = get_ref_frame_yv12_buf(cm, GOLDEN_FRAME); - if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) + if (ref == NULL || ref->y_crop_width != cm->width || + ref->y_crop_height != cm->height) { cpi->ref_frame_flags ^= AOM_GOLD_FLAG; + } } } if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]) { const YV12_BUFFER_CONFIG *const ref = get_ref_frame_yv12_buf(cm, ALTREF_FRAME); - if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) + if (ref == NULL || ref->y_crop_width != cm->width || + ref->y_crop_height != cm->height) { cpi->ref_frame_flags ^= AOM_ALT_FLAG; + } } } @@ -2700,10 +2704,13 @@ static int encode_without_recode(AV1_COMP *cpi) { update_motion_stat(cpi); // Adjust the refresh of the golden (longer-term) reference based on QP - // selected for this frame. This is for CBR with 1 layer/non-svc RTC mode. + // selected for this frame. This is for CBR real-time mode, and only + // for single layer without usage of the set_ref_frame_config (so + // reference structure for 1 layer is set internally). if (!frame_is_intra_only(cm) && cpi->oxcf.rc_cfg.mode == AOM_CBR && cpi->oxcf.mode == REALTIME && svc->number_spatial_layers == 1 && svc->number_temporal_layers == 1 && !cpi->rc.rtc_external_ratectrl && + !cpi->ppi->rtc_ref.set_ref_frame_config && sf->rt_sf.gf_refresh_based_on_qp) av1_adjust_gf_refresh_qp_one_pass_rt(cpi); |