summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_extend.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/common/vp9_extend.c')
-rw-r--r--vp9/common/vp9_extend.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/vp9/common/vp9_extend.c b/vp9/common/vp9_extend.c
index 6aeadf6aa..95ec59061 100644
--- a/vp9/common/vp9_extend.c
+++ b/vp9/common/vp9_extend.c
@@ -60,10 +60,22 @@ void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
const int eb_y = dst->border + dst->y_height - src->y_height;
const int er_y = dst->border + dst->y_width - src->y_width;
- const int et_uv = dst->border >> 1;
- const int el_uv = dst->border >> 1;
- const int eb_uv = (dst->border >> 1) + dst->uv_height - src->uv_height;
- const int er_uv = (dst->border >> 1) + dst->uv_width - src->uv_width;
+ const int et_uv = dst->border >> (dst->uv_height != dst->y_height);
+ const int el_uv = dst->border >> (dst->uv_width != dst->y_width);
+ const int eb_uv = et_uv + dst->uv_height - src->uv_height;
+ const int er_uv = el_uv + dst->uv_width - src->uv_width;
+
+#if CONFIG_ALPHA
+ const int et_a = dst->border >> (dst->alpha_height != dst->y_height);
+ const int el_a = dst->border >> (dst->alpha_width != dst->y_width);
+ const int eb_a = et_a + dst->alpha_height - src->alpha_height;
+ const int er_a = el_a + dst->alpha_width - src->alpha_width;
+
+ copy_and_extend_plane(src->alpha_buffer, src->alpha_stride,
+ dst->alpha_buffer, dst->alpha_stride,
+ src->alpha_width, src->alpha_height,
+ et_a, el_a, eb_a, er_a);
+#endif
copy_and_extend_plane(src->y_buffer, src->y_stride,
dst->y_buffer, dst->y_stride,