OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef VP9_VP9_IFACE_COMMON_H_ | 10 #ifndef VP9_VP9_IFACE_COMMON_H_ |
11 #define VP9_VP9_IFACE_COMMON_H_ | 11 #define VP9_VP9_IFACE_COMMON_H_ |
12 | 12 |
| 13 #include "vpx_ports/mem.h" |
| 14 |
13 static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12, | 15 static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12, |
14 void *user_priv) { | 16 void *user_priv) { |
15 /** vpx_img_wrap() doesn't allow specifying independent strides for | 17 /** vpx_img_wrap() doesn't allow specifying independent strides for |
16 * the Y, U, and V planes, nor other alignment adjustments that | 18 * the Y, U, and V planes, nor other alignment adjustments that |
17 * might be representable by a YV12_BUFFER_CONFIG, so we just | 19 * might be representable by a YV12_BUFFER_CONFIG, so we just |
18 * initialize all the fields.*/ | 20 * initialize all the fields.*/ |
19 int bps; | 21 int bps; |
20 if (!yv12->subsampling_y) { | 22 if (!yv12->subsampling_y) { |
21 if (!yv12->subsampling_x) { | 23 if (!yv12->subsampling_x) { |
22 img->fmt = VPX_IMG_FMT_I444; | 24 img->fmt = VPX_IMG_FMT_I444; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 yv12->border = (yv12->y_stride - img->w) / 2; | 121 yv12->border = (yv12->y_stride - img->w) / 2; |
120 #else | 122 #else |
121 yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2; | 123 yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2; |
122 #endif // CONFIG_VP9_HIGHBITDEPTH | 124 #endif // CONFIG_VP9_HIGHBITDEPTH |
123 yv12->subsampling_x = img->x_chroma_shift; | 125 yv12->subsampling_x = img->x_chroma_shift; |
124 yv12->subsampling_y = img->y_chroma_shift; | 126 yv12->subsampling_y = img->y_chroma_shift; |
125 return VPX_CODEC_OK; | 127 return VPX_CODEC_OK; |
126 } | 128 } |
127 | 129 |
128 #endif // VP9_VP9_IFACE_COMMON_H_ | 130 #endif // VP9_VP9_IFACE_COMMON_H_ |
OLD | NEW |