ref: 25110038f78e62fa490f59dc2d4bf46bb8715357
parent: 12753b616049f20852a0bb598845d01c9b65d430
parent: 49d8bdc29b113492ae7d060f8254fa7b38c79e13
author: Dmitry Kovalev <dkovalev@google.com>
date: Wed Apr 30 11:01:26 EDT 2014
Merge "Using crop_{width, height} instead of {width, height}."
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -331,10 +331,6 @@
ret = vp9_post_proc_frame(&pbi->common, sd, flags);
#else
*sd = *pbi->common.frame_to_show;
- sd->y_width = pbi->common.width;
- sd->y_height = pbi->common.height;
- sd->uv_width = sd->y_width >> pbi->common.subsampling_x;
- sd->uv_height = sd->y_height >> pbi->common.subsampling_y;
ret = 0;
#endif /*!CONFIG_POSTPROC*/
vp9_clear_system_state();
--- a/vp9/vp9_iface_common.h
+++ b/vp9/vp9_iface_common.h
@@ -16,9 +16,11 @@
* the Y, U, and V planes, nor other alignment adjustments that
* might be representable by a YV12_BUFFER_CONFIG, so we just
* initialize all the fields.*/
- int bps = 12;
- if (yv12->uv_height == yv12->y_height) {
- if (yv12->uv_width == yv12->y_width) {
+ const int ss_x = yv12->uv_crop_width < yv12->y_crop_width;
+ const int ss_y = yv12->uv_crop_height < yv12->y_crop_height;
+ int bps;
+ if (!ss_y) {
+ if (!ss_x) {
img->fmt = VPX_IMG_FMT_I444;
bps = 24;
} else {
@@ -27,13 +29,14 @@
}
} else {
img->fmt = VPX_IMG_FMT_I420;
+ bps = 12;
}
img->w = yv12->y_stride;
img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * VP9_ENC_BORDER_IN_PIXELS, 3);
img->d_w = yv12->y_crop_width;
img->d_h = yv12->y_crop_height;
- img->x_chroma_shift = yv12->uv_width < yv12->y_width;
- img->y_chroma_shift = yv12->uv_height < yv12->y_height;
+ img->x_chroma_shift = ss_x;
+ img->y_chroma_shift = ss_y;
img->planes[VPX_PLANE_Y] = yv12->y_buffer;
img->planes[VPX_PLANE_U] = yv12->u_buffer;
img->planes[VPX_PLANE_V] = yv12->v_buffer;
--
⑨