Reduce loop restoration buffer padding size
Loop restoration buffer need 32 pixel padding if
intrinsics used, 3 pixel padding otherwise.
Observed memory footprint reduction with no impact on
encoder/decoder performance.
stream cpu-used encoder decoder
BasketballDrill_832x480 1 ~0.79% ~4.93%
parkrun_720p50 3 ~0.65% ~3.81%
Change-Id: I7b0a2178bb20312de2d3cd683bf0ab04f04e346d
diff --git a/av1/common/restoration.c b/av1/common/restoration.c
index c62862b..9e472b8 100644
--- a/av1/common/restoration.c
+++ b/av1/common/restoration.c
@@ -1099,7 +1099,7 @@
const int frame_height = frame->crop_heights[0];
if (aom_realloc_frame_buffer(
lr_ctxt->dst, frame_width, frame_height, seq_params->subsampling_x,
- seq_params->subsampling_y, highbd, AOM_BORDER_IN_PIXELS,
+ seq_params->subsampling_y, highbd, AOM_RESTORATION_FRAME_BORDER,
cm->byte_alignment, NULL, NULL, NULL) < 0)
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate restoration dst buffer");
diff --git a/av1/common/restoration.h b/av1/common/restoration.h
index d834f92..5d196a9 100644
--- a/av1/common/restoration.h
+++ b/av1/common/restoration.h
@@ -22,6 +22,8 @@
extern "C" {
#endif
+// Boarder for Loop restoration buffer
+#define AOM_RESTORATION_FRAME_BORDER 32
#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
#define RINT(x) ((x) < 0 ? (int)((x)-0.5) : (int)((x) + 0.5))
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 95d57c8..8d7d4f4 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -868,7 +868,7 @@
&cpi->trial_frame_rst, cm->superres_upscaled_width,
cm->superres_upscaled_height, seq_params->subsampling_x,
seq_params->subsampling_y, seq_params->use_highbitdepth,
- AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL, NULL))
+ AOM_RESTORATION_FRAME_BORDER, cm->byte_alignment, NULL, NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate trial restored frame buffer");