OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 (ybf->y_crop_width + 1) / 2, (ybf->y_crop_height + 1) / 2, | 77 (ybf->y_crop_width + 1) / 2, (ybf->y_crop_height + 1) / 2, |
78 ybf->border / 2, ybf->border / 2, | 78 ybf->border / 2, ybf->border / 2, |
79 (ybf->border + ybf->y_height - ybf->y_crop_height + 1) / 2, | 79 (ybf->border + ybf->y_height - ybf->y_crop_height + 1) / 2, |
80 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); | 80 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); |
81 } | 81 } |
82 | 82 |
83 #if CONFIG_VP9 | 83 #if CONFIG_VP9 |
84 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, | 84 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, |
85 int subsampling_x, int subsampling_y, | 85 int subsampling_x, int subsampling_y, |
86 int ext_size) { | 86 int ext_size) { |
87 const int c_w = (ybf->y_crop_width + subsampling_x) >> subsampling_x; | 87 const int c_w = ybf->uv_crop_width; |
88 const int c_h = (ybf->y_crop_height + subsampling_y) >> subsampling_y; | 88 const int c_h = ybf->uv_crop_height; |
89 const int c_et = ext_size >> subsampling_y; | 89 const int c_ext_size = ext_size >> 1; |
90 const int c_el = ext_size >> subsampling_x; | 90 const int c_et = c_ext_size; |
91 const int c_eb = (ext_size + ybf->y_height - ybf->y_crop_height + | 91 const int c_el = c_ext_size; |
92 subsampling_y) >> subsampling_y; | 92 const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height; |
93 const int c_er = (ext_size + ybf->y_width - ybf->y_crop_width + | 93 const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width; |
94 subsampling_x) >> subsampling_x; | |
95 | 94 |
96 assert(ybf->y_height - ybf->y_crop_height < 16); | 95 assert(ybf->y_height - ybf->y_crop_height < 16); |
97 assert(ybf->y_width - ybf->y_crop_width < 16); | 96 assert(ybf->y_width - ybf->y_crop_width < 16); |
98 assert(ybf->y_height - ybf->y_crop_height >= 0); | 97 assert(ybf->y_height - ybf->y_crop_height >= 0); |
99 assert(ybf->y_width - ybf->y_crop_width >= 0); | 98 assert(ybf->y_width - ybf->y_crop_width >= 0); |
100 | 99 |
101 extend_plane(ybf->y_buffer, ybf->y_stride, | 100 extend_plane(ybf->y_buffer, ybf->y_stride, |
102 ybf->y_crop_width, ybf->y_crop_height, | 101 ybf->y_crop_width, ybf->y_crop_height, |
103 ext_size, ext_size, | 102 ext_size, ext_size, |
104 ext_size + ybf->y_height - ybf->y_crop_height, | 103 ext_size + ybf->y_height - ybf->y_crop_height, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 int row; | 172 int row; |
174 const uint8_t *src = src_ybc->y_buffer; | 173 const uint8_t *src = src_ybc->y_buffer; |
175 uint8_t *dst = dst_ybc->y_buffer; | 174 uint8_t *dst = dst_ybc->y_buffer; |
176 | 175 |
177 for (row = 0; row < src_ybc->y_height; ++row) { | 176 for (row = 0; row < src_ybc->y_height; ++row) { |
178 vpx_memcpy(dst, src, src_ybc->y_width); | 177 vpx_memcpy(dst, src, src_ybc->y_width); |
179 src += src_ybc->y_stride; | 178 src += src_ybc->y_stride; |
180 dst += dst_ybc->y_stride; | 179 dst += dst_ybc->y_stride; |
181 } | 180 } |
182 } | 181 } |
OLD | NEW |