summaryrefslogtreecommitdiff
path: root/vpx_scale/generic
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2013-07-15 14:59:59 -0700
committerYaowu Xu <yaowu@google.com>2013-07-15 20:52:13 -0700
commit5b915ebd92e2a09d5e4acd4d9816c350744c4b4a (patch)
tree617ce890e85afb7e13636348b92f1e9f30415b5f /vpx_scale/generic
parentb02c4d364f53e14ddae000552a1ddadbc7ceef8f (diff)
downloadlibvpx-5b915ebd92e2a09d5e4acd4d9816c350744c4b4a.tar
libvpx-5b915ebd92e2a09d5e4acd4d9816c350744c4b4a.tar.gz
libvpx-5b915ebd92e2a09d5e4acd4d9816c350744c4b4a.tar.bz2
libvpx-5b915ebd92e2a09d5e4acd4d9816c350744c4b4a.zip
Change to extend full border only when needed
This is a short term optimization till we work out a decoder implementation requiring no frame border extension. Change-Id: I02d15bfde4d926b50a4e58b393d8c4062d1be70f
Diffstat (limited to 'vpx_scale/generic')
-rw-r--r--vpx_scale/generic/yv12extend.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/vpx_scale/generic/yv12extend.c b/vpx_scale/generic/yv12extend.c
index c38fb807a..60df0af56 100644
--- a/vpx_scale/generic/yv12extend.c
+++ b/vpx_scale/generic/yv12extend.c
@@ -96,12 +96,13 @@ vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
}
#if CONFIG_VP9
-void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf,
- int subsampling_x, int subsampling_y) {
+static void extend_frame(YV12_BUFFER_CONFIG *ybf,
+ int subsampling_x, int subsampling_y,
+ int ext_size) {
const int c_w = (ybf->y_crop_width + subsampling_x) >> subsampling_x;
const int c_h = (ybf->y_crop_height + subsampling_y) >> subsampling_y;
- const int c_et = ybf->border >> subsampling_y;
- const int c_el = ybf->border >> subsampling_x;
+ const int c_et = ext_size >> subsampling_y;
+ const int c_el = ext_size >> subsampling_x;
const int c_eb = (ybf->border + ybf->y_height - ybf->y_crop_height +
subsampling_y) >> subsampling_y;
const int c_er = (ybf->border + ybf->y_width - ybf->y_crop_width +
@@ -114,9 +115,9 @@ void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf,
extend_plane(ybf->y_buffer, ybf->y_stride,
ybf->y_crop_width, ybf->y_crop_height,
- ybf->border, ybf->border,
- ybf->border + ybf->y_height - ybf->y_crop_height,
- ybf->border + ybf->y_width - ybf->y_crop_width);
+ ext_size, ext_size,
+ ext_size + ybf->y_height - ybf->y_crop_height,
+ ext_size + ybf->y_width - ybf->y_crop_width);
extend_plane(ybf->u_buffer, ybf->uv_stride,
c_w, c_h, c_et, c_el, c_eb, c_er);
@@ -124,6 +125,19 @@ void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf,
extend_plane(ybf->v_buffer, ybf->uv_stride,
c_w, c_h, c_et, c_el, c_eb, c_er);
}
+
+
+void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf,
+ int subsampling_x, int subsampling_y) {
+ extend_frame(ybf, subsampling_x, subsampling_y, ybf->border);
+}
+
+void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf,
+ int subsampling_x, int subsampling_y) {
+ const int inner_bw = ybf->border > VP9INNERBORDERINPIXLES ?
+ VP9INNERBORDERINPIXLES : ybf->border;
+ extend_frame(ybf, subsampling_x, subsampling_y, inner_bw);
+}
#endif
/****************************************************************************