summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/encoder
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/av1/encoder')
-rw-r--r--third_party/aom/av1/encoder/encoder.c13
-rw-r--r--third_party/aom/av1/encoder/encoder.h4
-rw-r--r--third_party/aom/av1/encoder/mcomp.c1
-rw-r--r--third_party/aom/av1/encoder/speed_features.c8
4 files changed, 20 insertions, 6 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);
diff --git a/third_party/aom/av1/encoder/encoder.h b/third_party/aom/av1/encoder/encoder.h
index 5f6f67eda8..e87ab9be1f 100644
--- a/third_party/aom/av1/encoder/encoder.h
+++ b/third_party/aom/av1/encoder/encoder.h
@@ -3156,14 +3156,14 @@ typedef struct AV1_COMP {
FRAME_INDEX_SET frame_index_set;
/*!
- * Store the cm->width in the last call of alloc_compressor_data(). Help
+ * Stores the cm->width in the last call of alloc_compressor_data(). Helps
* determine whether compressor data should be reallocated when cm->width
* changes.
*/
int data_alloc_width;
/*!
- * Store the cm->height in the last call of alloc_compressor_data(). Help
+ * Stores the cm->height in the last call of alloc_compressor_data(). Helps
* determine whether compressor data should be reallocated when cm->height
* changes.
*/
diff --git a/third_party/aom/av1/encoder/mcomp.c b/third_party/aom/av1/encoder/mcomp.c
index 4e53447379..f3a9828cb3 100644
--- a/third_party/aom/av1/encoder/mcomp.c
+++ b/third_party/aom/av1/encoder/mcomp.c
@@ -1807,7 +1807,6 @@ int av1_full_pixel_search(const FULLPEL_MV start_mv,
}
assert(ms_params->ms_buffers.ref->stride == ms_params->search_sites->stride);
- assert(ms_params->ms_buffers.ref->width == ms_params->ms_buffers.src->width);
switch (search_method) {
case FAST_BIGDIA:
diff --git a/third_party/aom/av1/encoder/speed_features.c b/third_party/aom/av1/encoder/speed_features.c
index a6c0971096..63d69cadc5 100644
--- a/third_party/aom/av1/encoder/speed_features.c
+++ b/third_party/aom/av1/encoder/speed_features.c
@@ -1624,6 +1624,14 @@ static void set_rt_speed_feature_framesize_dependent(const AV1_COMP *const cpi,
sf->rt_sf.use_rtc_tf = 0;
sf->rt_sf.nonrd_prune_ref_frame_search = 1;
}
+ // rtc_tf feature allocates new source because of possible
+ // temporal filtering which may change the input source during encoding:
+ // this causes an issue on resized frames when psnr is calculated,
+ // so disable it here for frames that are resized (encoding width/height
+ // different from configured width/height).
+ if (is_psnr_calc_enabled(cpi) && (cpi->oxcf.frm_dim_cfg.width != cm->width ||
+ cpi->oxcf.frm_dim_cfg.height != cm->height))
+ sf->rt_sf.use_rtc_tf = 0;
}
// TODO(kyslov): now this is very similar to