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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 dst_ptr1 += src_stride; | 49 dst_ptr1 += src_stride; |
50 } | 50 } |
51 | 51 |
52 for (i = 0; i < extend_bottom; ++i) { | 52 for (i = 0; i < extend_bottom; ++i) { |
53 vpx_memcpy(dst_ptr2, src_ptr2, linesize); | 53 vpx_memcpy(dst_ptr2, src_ptr2, linesize); |
54 dst_ptr2 += src_stride; | 54 dst_ptr2 += src_stride; |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 void vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) { | 58 void vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) { |
| 59 const int uv_border = ybf->border / 2; |
| 60 |
| 61 assert(ybf->border % 2 == 0); |
59 assert(ybf->y_height - ybf->y_crop_height < 16); | 62 assert(ybf->y_height - ybf->y_crop_height < 16); |
60 assert(ybf->y_width - ybf->y_crop_width < 16); | 63 assert(ybf->y_width - ybf->y_crop_width < 16); |
61 assert(ybf->y_height - ybf->y_crop_height >= 0); | 64 assert(ybf->y_height - ybf->y_crop_height >= 0); |
62 assert(ybf->y_width - ybf->y_crop_width >= 0); | 65 assert(ybf->y_width - ybf->y_crop_width >= 0); |
63 | 66 |
64 extend_plane(ybf->y_buffer, ybf->y_stride, | 67 extend_plane(ybf->y_buffer, ybf->y_stride, |
65 ybf->y_crop_width, ybf->y_crop_height, | 68 ybf->y_crop_width, ybf->y_crop_height, |
66 ybf->border, ybf->border, | 69 ybf->border, ybf->border, |
67 ybf->border + ybf->y_height - ybf->y_crop_height, | 70 ybf->border + ybf->y_height - ybf->y_crop_height, |
68 ybf->border + ybf->y_width - ybf->y_crop_width); | 71 ybf->border + ybf->y_width - ybf->y_crop_width); |
69 | 72 |
70 extend_plane(ybf->u_buffer, ybf->uv_stride, | 73 extend_plane(ybf->u_buffer, ybf->uv_stride, |
71 (ybf->y_crop_width + 1) / 2, (ybf->y_crop_height + 1) / 2, | 74 ybf->uv_crop_width, ybf->uv_crop_height, |
72 ybf->border / 2, ybf->border / 2, | 75 uv_border, uv_border, |
73 (ybf->border + ybf->y_height - ybf->y_crop_height + 1) / 2, | 76 uv_border + ybf->uv_height - ybf->uv_crop_height, |
74 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); | 77 uv_border + ybf->uv_width - ybf->uv_crop_width); |
75 | 78 |
76 extend_plane(ybf->v_buffer, ybf->uv_stride, | 79 extend_plane(ybf->v_buffer, ybf->uv_stride, |
77 (ybf->y_crop_width + 1) / 2, (ybf->y_crop_height + 1) / 2, | 80 ybf->uv_crop_width, ybf->uv_crop_height, |
78 ybf->border / 2, ybf->border / 2, | 81 uv_border, uv_border, |
79 (ybf->border + ybf->y_height - ybf->y_crop_height + 1) / 2, | 82 uv_border + ybf->uv_height - ybf->uv_crop_height, |
80 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); | 83 uv_border + ybf->uv_width - ybf->uv_crop_width); |
81 } | 84 } |
82 | 85 |
83 #if CONFIG_VP9 | 86 #if CONFIG_VP9 |
84 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) { | 87 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) { |
85 const int c_w = ybf->uv_crop_width; | 88 const int c_w = ybf->uv_crop_width; |
86 const int c_h = ybf->uv_crop_height; | 89 const int c_h = ybf->uv_crop_height; |
87 const int ss_x = ybf->uv_width < ybf->y_width; | 90 const int ss_x = ybf->uv_width < ybf->y_width; |
88 const int ss_y = ybf->uv_height < ybf->y_height; | 91 const int ss_y = ybf->uv_height < ybf->y_height; |
89 const int c_et = ext_size >> ss_y; | 92 const int c_et = ext_size >> ss_y; |
90 const int c_el = ext_size >> ss_x; | 93 const int c_el = ext_size >> ss_x; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 int row; | 172 int row; |
170 const uint8_t *src = src_ybc->y_buffer; | 173 const uint8_t *src = src_ybc->y_buffer; |
171 uint8_t *dst = dst_ybc->y_buffer; | 174 uint8_t *dst = dst_ybc->y_buffer; |
172 | 175 |
173 for (row = 0; row < src_ybc->y_height; ++row) { | 176 for (row = 0; row < src_ybc->y_height; ++row) { |
174 vpx_memcpy(dst, src, src_ybc->y_width); | 177 vpx_memcpy(dst, src, src_ybc->y_width); |
175 src += src_ybc->y_stride; | 178 src += src_ybc->y_stride; |
176 dst += dst_ybc->y_stride; | 179 dst += dst_ybc->y_stride; |
177 } | 180 } |
178 } | 181 } |
OLD | NEW |