| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); | 74 (ybf->border + ybf->y_width - ybf->y_crop_width + 1) / 2); |
| 75 | 75 |
| 76 extend_plane(ybf->v_buffer, ybf->uv_stride, | 76 extend_plane(ybf->v_buffer, ybf->uv_stride, |
| 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, int ext_size) { |
| 85 int subsampling_x, int subsampling_y, | |
| 86 int ext_size) { | |
| 87 const int c_w = ybf->uv_crop_width; | 85 const int c_w = ybf->uv_crop_width; |
| 88 const int c_h = ybf->uv_crop_height; | 86 const int c_h = ybf->uv_crop_height; |
| 89 const int c_ext_size = ext_size >> 1; | 87 const int c_ext_size = ext_size >> 1; |
| 90 const int c_et = c_ext_size; | 88 const int c_et = c_ext_size; |
| 91 const int c_el = c_ext_size; | 89 const int c_el = c_ext_size; |
| 92 const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height; | 90 const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height; |
| 93 const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width; | 91 const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width; |
| 94 | 92 |
| 95 assert(ybf->y_height - ybf->y_crop_height < 16); | 93 assert(ybf->y_height - ybf->y_crop_height < 16); |
| 96 assert(ybf->y_width - ybf->y_crop_width < 16); | 94 assert(ybf->y_width - ybf->y_crop_width < 16); |
| 97 assert(ybf->y_height - ybf->y_crop_height >= 0); | 95 assert(ybf->y_height - ybf->y_crop_height >= 0); |
| 98 assert(ybf->y_width - ybf->y_crop_width >= 0); | 96 assert(ybf->y_width - ybf->y_crop_width >= 0); |
| 99 | 97 |
| 100 extend_plane(ybf->y_buffer, ybf->y_stride, | 98 extend_plane(ybf->y_buffer, ybf->y_stride, |
| 101 ybf->y_crop_width, ybf->y_crop_height, | 99 ybf->y_crop_width, ybf->y_crop_height, |
| 102 ext_size, ext_size, | 100 ext_size, ext_size, |
| 103 ext_size + ybf->y_height - ybf->y_crop_height, | 101 ext_size + ybf->y_height - ybf->y_crop_height, |
| 104 ext_size + ybf->y_width - ybf->y_crop_width); | 102 ext_size + ybf->y_width - ybf->y_crop_width); |
| 105 | 103 |
| 106 extend_plane(ybf->u_buffer, ybf->uv_stride, | 104 extend_plane(ybf->u_buffer, ybf->uv_stride, |
| 107 c_w, c_h, c_et, c_el, c_eb, c_er); | 105 c_w, c_h, c_et, c_el, c_eb, c_er); |
| 108 | 106 |
| 109 extend_plane(ybf->v_buffer, ybf->uv_stride, | 107 extend_plane(ybf->v_buffer, ybf->uv_stride, |
| 110 c_w, c_h, c_et, c_el, c_eb, c_er); | 108 c_w, c_h, c_et, c_el, c_eb, c_er); |
| 111 } | 109 } |
| 112 | 110 |
| 113 void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf, | 111 void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) { |
| 114 int subsampling_x, int subsampling_y) { | 112 extend_frame(ybf, ybf->border); |
| 115 extend_frame(ybf, subsampling_x, subsampling_y, ybf->border); | |
| 116 } | 113 } |
| 117 | 114 |
| 118 void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf, | 115 void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf) { |
| 119 int subsampling_x, int subsampling_y) { | |
| 120 const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? | 116 const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ? |
| 121 VP9INNERBORDERINPIXELS : ybf->border; | 117 VP9INNERBORDERINPIXELS : ybf->border; |
| 122 extend_frame(ybf, subsampling_x, subsampling_y, inner_bw); | 118 extend_frame(ybf, inner_bw); |
| 123 } | 119 } |
| 124 #endif // CONFIG_VP9 | 120 #endif // CONFIG_VP9 |
| 125 | 121 |
| 126 // Copies the source image into the destination image and updates the | 122 // Copies the source image into the destination image and updates the |
| 127 // destination's UMV borders. | 123 // destination's UMV borders. |
| 128 // Note: The frames are assumed to be identical in size. | 124 // Note: The frames are assumed to be identical in size. |
| 129 void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc, | 125 void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc, |
| 130 YV12_BUFFER_CONFIG *dst_ybc) { | 126 YV12_BUFFER_CONFIG *dst_ybc) { |
| 131 int row; | 127 int row; |
| 132 const uint8_t *src = src_ybc->y_buffer; | 128 const uint8_t *src = src_ybc->y_buffer; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 int row; | 168 int row; |
| 173 const uint8_t *src = src_ybc->y_buffer; | 169 const uint8_t *src = src_ybc->y_buffer; |
| 174 uint8_t *dst = dst_ybc->y_buffer; | 170 uint8_t *dst = dst_ybc->y_buffer; |
| 175 | 171 |
| 176 for (row = 0; row < src_ybc->y_height; ++row) { | 172 for (row = 0; row < src_ybc->y_height; ++row) { |
| 177 vpx_memcpy(dst, src, src_ybc->y_width); | 173 vpx_memcpy(dst, src, src_ybc->y_width); |
| 178 src += src_ybc->y_stride; | 174 src += src_ybc->y_stride; |
| 179 dst += dst_ybc->y_stride; | 175 dst += dst_ybc->y_stride; |
| 180 } | 176 } |
| 181 } | 177 } |
| OLD | NEW |