summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2014-08-15 10:50:40 -0700
committerJohann <johannkoenig@google.com>2014-08-15 14:55:21 -0700
commit69dc876b4e9cfe4e94b16e7aa2a446918ccb8a37 (patch)
tree9314d76a7732fd4e1491dcc22d07393efd7e9949 /vp8
parentc5d8c1e785f057458c9e6bbd8f6259279d5e689e (diff)
downloadlibvpx-69dc876b4e9cfe4e94b16e7aa2a446918ccb8a37.tar
libvpx-69dc876b4e9cfe4e94b16e7aa2a446918ccb8a37.tar.gz
libvpx-69dc876b4e9cfe4e94b16e7aa2a446918ccb8a37.tar.bz2
libvpx-69dc876b4e9cfe4e94b16e7aa2a446918ccb8a37.zip
Set uv_crop_height/width in all the places
When configuring the buffer make sure to set all the (now) required fields. Use the canonical variables and match the style from vpx_scale. https://code.google.com/p/webm/issues/detail?id=841 Change-Id: I71b43d4a03756b8b2d6d60fdf8d7bf41b8041787
Diffstat (limited to 'vp8')
-rw-r--r--vp8/vp8_cx_iface.c18
-rw-r--r--vp8/vp8_dx_iface.c18
2 files changed, 24 insertions, 12 deletions
diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c
index d515fc0bd..0c522bd08 100644
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -734,17 +734,23 @@ static vpx_codec_err_t vp8e_destroy(vpx_codec_alg_priv_t *ctx)
static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
YV12_BUFFER_CONFIG *yv12)
{
+ const int y_w = img->d_w;
+ const int y_h = img->d_h;
+ const int uv_w = (img->d_w + 1) / 2;
+ const int uv_h = (img->d_h + 1) / 2;
vpx_codec_err_t res = VPX_CODEC_OK;
yv12->y_buffer = img->planes[VPX_PLANE_Y];
yv12->u_buffer = img->planes[VPX_PLANE_U];
yv12->v_buffer = img->planes[VPX_PLANE_V];
- yv12->y_crop_width = img->d_w;
- yv12->y_crop_height = img->d_h;
- yv12->y_width = img->d_w;
- yv12->y_height = img->d_h;
- yv12->uv_width = (1 + yv12->y_width) / 2;
- yv12->uv_height = (1 + yv12->y_height) / 2;
+ yv12->y_crop_width = y_w;
+ yv12->y_crop_height = y_h;
+ yv12->y_width = y_w;
+ yv12->y_height = y_h;
+ yv12->uv_crop_width = uv_w;
+ yv12->uv_crop_height = uv_h;
+ yv12->uv_width = uv_w;
+ yv12->uv_height = uv_h;
yv12->y_stride = img->stride[VPX_PLANE_Y];
yv12->uv_stride = img->stride[VPX_PLANE_U];
diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c
index 9a0cdb79a..c76ac145f 100644
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -566,17 +566,23 @@ static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
YV12_BUFFER_CONFIG *yv12)
{
+ const int y_w = img->d_w;
+ const int y_h = img->d_h;
+ const int uv_w = (img->d_w + 1) / 2;
+ const int uv_h = (img->d_h + 1) / 2;
vpx_codec_err_t res = VPX_CODEC_OK;
yv12->y_buffer = img->planes[VPX_PLANE_Y];
yv12->u_buffer = img->planes[VPX_PLANE_U];
yv12->v_buffer = img->planes[VPX_PLANE_V];
- yv12->y_crop_width = img->d_w;
- yv12->y_crop_height = img->d_h;
- yv12->y_width = img->d_w;
- yv12->y_height = img->d_h;
- yv12->uv_width = yv12->y_width / 2;
- yv12->uv_height = yv12->y_height / 2;
+ yv12->y_crop_width = y_w;
+ yv12->y_crop_height = y_h;
+ yv12->y_width = y_w;
+ yv12->y_height = y_h;
+ yv12->uv_crop_width = uv_w;
+ yv12->uv_crop_height = uv_h;
+ yv12->uv_width = uv_w;
+ yv12->uv_height = uv_h;
yv12->y_stride = img->stride[VPX_PLANE_Y];
yv12->uv_stride = img->stride[VPX_PLANE_U];