Commit e2721a65 authored by Jingning Han's avatar Jingning Han

Rename AOM_ENC/DEC_BORDER_IN_PIXELS to AOM_BORDER_IN_PIXELS

Change-Id: I5d36aba6870f0783577b80d46defda7604029382
parent 947c7f0c
......@@ -24,8 +24,11 @@ extern "C" {
#define AOMBORDERINPIXELS 32
#define AOMINNERBORDERINPIXELS 96
#define AOM_INTERP_EXTEND 4
#define AOM_ENC_BORDER_IN_PIXELS 160
#define AOM_DEC_BORDER_IN_PIXELS 160
// TODO(jingning): Use unified inter predictor for encoder and
// decoder during the development process. Revisit the frame border
// to improve the decoder performance.
#define AOM_BORDER_IN_PIXELS 160
typedef struct yv12_buffer_config {
int y_width;
......
......@@ -41,7 +41,7 @@ static void yuvconfig2image(aom_image_t *img, const YV12_BUFFER_CONFIG *yv12,
img->range = yv12->color_range;
img->bit_depth = 8;
img->w = yv12->y_stride;
img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * AOM_ENC_BORDER_IN_PIXELS, 3);
img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * AOM_BORDER_IN_PIXELS, 3);
img->d_w = yv12->y_crop_width;
img->d_h = yv12->y_crop_height;
img->r_w = yv12->render_width;
......
......@@ -960,7 +960,7 @@ static void setup_frame_size(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_DEC_BORDER_IN_PIXELS, cm->byte_alignment,
AOM_BORDER_IN_PIXELS, cm->byte_alignment,
&pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb,
pool->cb_priv)) {
unlock_buffer_pool(pool);
......@@ -1050,7 +1050,7 @@ static void setup_frame_size_with_refs(AV1_COMMON *cm,
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_DEC_BORDER_IN_PIXELS, cm->byte_alignment,
AOM_BORDER_IN_PIXELS, cm->byte_alignment,
&pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb,
pool->cb_priv)) {
unlock_buffer_pool(pool);
......
......@@ -678,8 +678,8 @@ static void alloc_raw_frame_buffers(AV1_COMP *cpi) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
NULL, NULL, NULL))
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
}
......@@ -691,8 +691,8 @@ static void alloc_util_frame_buffers(AV1_COMP *cpi) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
NULL, NULL, NULL))
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate last frame buffer");
......@@ -701,8 +701,8 @@ static void alloc_util_frame_buffers(AV1_COMP *cpi) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
NULL, NULL, NULL))
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
......@@ -711,8 +711,8 @@ static void alloc_util_frame_buffers(AV1_COMP *cpi) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
NULL, NULL, NULL))
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL))
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
"Failed to allocate scaled last source buffer");
}
......@@ -2377,10 +2377,10 @@ void av1_scale_references(AV1_COMP *cpi) {
new_fb_ptr = &pool->frame_bufs[new_fb];
if (force_scaling || new_fb_ptr->buf.y_crop_width != cm->width ||
new_fb_ptr->buf.y_crop_height != cm->height) {
aom_realloc_frame_buffer(
&new_fb_ptr->buf, cm->width, cm->height, cm->subsampling_x,
cm->subsampling_y, cm->use_highbitdepth, AOM_ENC_BORDER_IN_PIXELS,
cm->byte_alignment, NULL, NULL, NULL);
aom_realloc_frame_buffer(&new_fb_ptr->buf, cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
cm->byte_alignment, NULL, NULL, NULL);
scale_and_extend_frame(ref, &new_fb_ptr->buf, (int)cm->bit_depth);
cpi->scaled_ref_idx[ref_frame - 1] = new_fb;
alloc_frame_mvs(cm, new_fb);
......@@ -2400,7 +2400,7 @@ void av1_scale_references(AV1_COMP *cpi) {
new_fb_ptr->buf.y_crop_height != cm->height) {
aom_realloc_frame_buffer(&new_fb_ptr->buf, cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
AOM_BORDER_IN_PIXELS, cm->byte_alignment,
NULL, NULL, NULL);
scale_and_extend_frame(ref, &new_fb_ptr->buf);
cpi->scaled_ref_idx[ref_frame - 1] = new_fb;
......@@ -2665,8 +2665,8 @@ static void set_frame_size(AV1_COMP *cpi) {
#if CONFIG_AOM_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
NULL, NULL);
AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL,
NULL);
alloc_util_frame_buffers(cpi);
init_motion_estimation(cpi);
......
......@@ -68,12 +68,12 @@ struct lookahead_ctx *av1_lookahead_init(unsigned int width,
ctx->buf = calloc(depth, sizeof(*ctx->buf));
if (!ctx->buf) goto bail;
for (i = 0; i < depth; i++)
if (aom_alloc_frame_buffer(
&ctx->buf[i].img, width, height, subsampling_x, subsampling_y,
if (aom_alloc_frame_buffer(&ctx->buf[i].img, width, height, subsampling_x,
subsampling_y,
#if CONFIG_AOM_HIGHBITDEPTH
use_highbitdepth,
use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, legacy_byte_alignment))
AOM_BORDER_IN_PIXELS, legacy_byte_alignment))
goto bail;
}
return ctx;
......@@ -165,7 +165,7 @@ int av1_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
#if CONFIG_AOM_HIGHBITDEPTH
use_highbitdepth,
#endif
AOM_ENC_BORDER_IN_PIXELS, 0))
AOM_BORDER_IN_PIXELS, 0))
return 1;
aom_free_frame_buffer(&buf->img);
buf->img = new_img;
......
......@@ -2331,9 +2331,8 @@ static int discount_newmv_test(const AV1_COMP *cpi, int this_mode,
(mode_mv[NEARMV][ref_frame].as_int == INVALID_MV)));
}
#define LEFT_TOP_MARGIN ((AOM_ENC_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
#define RIGHT_BOTTOM_MARGIN \
((AOM_ENC_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
#define LEFT_TOP_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
#define RIGHT_BOTTOM_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
// TODO(jingning): this mv clamping function should be block size dependent.
static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
......
......@@ -62,7 +62,7 @@ void av1_compute_skin_map(AV1_COMP *const cpi, FILE *yuv_skinmap_file) {
YV12_BUFFER_CONFIG skinmap;
memset(&skinmap, 0, sizeof(YV12_BUFFER_CONFIG));
if (aom_alloc_frame_buffer(&skinmap, cm->width, cm->height, cm->subsampling_x,
cm->subsampling_y, AOM_ENC_BORDER_IN_PIXELS,
cm->subsampling_y, AOM_BORDER_IN_PIXELS,
cm->byte_alignment)) {
aom_free_frame_buffer(&skinmap);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment