Allocate proper buffer border
For alt_ref_buffer, use the same border as lookahead buffers, and
allocate proper buffer border.
Speed 1 Borg test result:
avg_psnr: ovr_psnr: ssim:
lowres: 0.000 0.000 0.000
midres: 0.000 0.000 0.000
hdres: -0.009 -0.008 0.003
STATS_CHANGED
Change-Id: Id53debe2e380f06541023aa20af0c550dfc08520
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 91640dc..88c3307 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -925,9 +925,9 @@
AV1_COMMON *cm = &cpi->common;
const SequenceHeader *const seq_params = &cm->seq_params;
const AV1EncoderConfig *oxcf = &cpi->oxcf;
+ int is_scale = (oxcf->resize_mode || oxcf->superres_mode);
if (!cpi->lookahead) {
- int is_scale = (oxcf->resize_mode || oxcf->superres_mode);
cpi->lookahead = av1_lookahead_init(
oxcf->width, oxcf->height, seq_params->subsampling_x,
seq_params->subsampling_y, seq_params->use_highbitdepth,
@@ -938,10 +938,12 @@
"Failed to allocate lag buffers");
// TODO(agrange) Check if ARF is enabled and skip allocation if not.
+ // (yunqing)Here use same border as lookahead buffers.
if (aom_realloc_frame_buffer(
&cpi->alt_ref_buffer, oxcf->width, oxcf->height,
seq_params->subsampling_x, seq_params->subsampling_y,
- seq_params->use_highbitdepth, oxcf->border_in_pixels,
+ seq_params->use_highbitdepth,
+ is_scale ? oxcf->border_in_pixels : AOM_ENC_LOOKAHEAD_BORDER,
cm->byte_alignment, NULL, NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");