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 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 vpx_memcpy(top_dst, top_src, linesize); | 97 vpx_memcpy(top_dst, top_src, linesize); |
98 top_dst += src_stride; | 98 top_dst += src_stride; |
99 } | 99 } |
100 | 100 |
101 for (i = 0; i < extend_bottom; i++) { | 101 for (i = 0; i < extend_bottom; i++) { |
102 vpx_memcpy(bot_dst, bot_src, linesize); | 102 vpx_memcpy(bot_dst, bot_src, linesize); |
103 bot_dst += src_stride; | 103 bot_dst += src_stride; |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, | 107 static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) { |
108 int subsampling_x, int subsampling_y, | |
109 int ext_size) { | |
110 const int c_w = ybf->uv_crop_width; | 108 const int c_w = ybf->uv_crop_width; |
111 const int c_h = ybf->uv_crop_height; | 109 const int c_h = ybf->uv_crop_height; |
112 const int c_ext_size = ext_size >> 1; | 110 const int ss_x = ybf->uv_width < ybf->y_width; |
113 const int c_et = c_ext_size; | 111 const int ss_y = ybf->uv_height < ybf->y_height; |
114 const int c_el = c_ext_size; | 112 const int c_et = ext_size >> ss_y; |
115 const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height; | 113 const int c_el = ext_size >> ss_x; |
116 const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width; | 114 const int c_eb = c_et + ybf->uv_height - ybf->uv_crop_height; |
| 115 const int c_er = c_el + ybf->uv_width - ybf->uv_crop_width; |
117 | 116 |
118 assert(ybf->y_height - ybf->y_crop_height < 16); | 117 assert(ybf->y_height - ybf->y_crop_height < 16); |
119 assert(ybf->y_width - ybf->y_crop_width < 16); | 118 assert(ybf->y_width - ybf->y_crop_width < 16); |
120 assert(ybf->y_height - ybf->y_crop_height >= 0); | 119 assert(ybf->y_height - ybf->y_crop_height >= 0); |
121 assert(ybf->y_width - ybf->y_crop_width >= 0); | 120 assert(ybf->y_width - ybf->y_crop_width >= 0); |
122 | 121 |
123 extend_plane(ybf->y_buffer, ybf->y_stride, | 122 extend_plane(ybf->y_buffer, ybf->y_stride, |
124 ybf->y_crop_width, ybf->y_crop_height, | 123 ybf->y_crop_width, ybf->y_crop_height, |
125 ext_size, ext_size, | 124 ext_size, ext_size, |
126 ext_size + ybf->y_height - ybf->y_crop_height, | 125 ext_size + ybf->y_height - ybf->y_crop_height, |
127 ext_size + ybf->y_width - ybf->y_crop_width); | 126 ext_size + ybf->y_width - ybf->y_crop_width); |
128 | 127 |
129 extend_plane(ybf->u_buffer, ybf->uv_stride, | 128 extend_plane(ybf->u_buffer, ybf->uv_stride, |
130 c_w, c_h, c_et, c_el, c_eb, c_er); | 129 c_w, c_h, c_et, c_el, c_eb, c_er); |
131 | 130 |
132 extend_plane(ybf->v_buffer, ybf->uv_stride, | 131 extend_plane(ybf->v_buffer, ybf->uv_stride, |
133 c_w, c_h, c_et, c_el, c_eb, c_er); | 132 c_w, c_h, c_et, c_el, c_eb, c_er); |
134 } | 133 } |
135 | 134 |
136 void vp9_extend_frame_borders_dspr2(YV12_BUFFER_CONFIG *ybf, | 135 void vp9_extend_frame_borders_dspr2(YV12_BUFFER_CONFIG *ybf) { |
137 int subsampling_x, int subsampling_y) { | 136 extend_frame(ybf, ybf->border); |
138 extend_frame(ybf, subsampling_x, subsampling_y, ybf->border); | |
139 } | 137 } |
140 | 138 |
141 void vp9_extend_frame_inner_borders_dspr2(YV12_BUFFER_CONFIG *ybf, | 139 void vp9_extend_frame_inner_borders_dspr2(YV12_BUFFER_CONFIG *ybf) { |
142 int subsampling_x, | |
143 int subsampling_y) { | |
144 const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? | 140 const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? |
145 VP9INNERBORDERINPIXELS : ybf->border; | 141 VP9INNERBORDERINPIXELS : ybf->border; |
146 extend_frame(ybf, subsampling_x, subsampling_y, inner_bw); | 142 extend_frame(ybf, inner_bw); |
147 } | 143 } |
148 #endif | 144 #endif |
OLD | NEW |