| 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 |
| 11 #include "vp9/common/vp9_extend.h" | 11 #include "vp9/common/vp9_extend.h" |
| 12 #include "vpx_mem/vpx_mem.h" | 12 #include "vpx_mem/vpx_mem.h" |
| 13 | 13 |
| 14 static void copy_and_extend_plane(unsigned char *s, /* source */ | 14 static void copy_and_extend_plane(uint8_t *s, /* source */ |
| 15 int sp, /* source pitch */ | 15 int sp, /* source pitch */ |
| 16 unsigned char *d, /* destination */ | 16 uint8_t *d, /* destination */ |
| 17 int dp, /* destination pitch */ | 17 int dp, /* destination pitch */ |
| 18 int h, /* height */ | 18 int h, /* height */ |
| 19 int w, /* width */ | 19 int w, /* width */ |
| 20 int et, /* extend top border */ | 20 int et, /* extend top border */ |
| 21 int el, /* extend left border */ | 21 int el, /* extend left border */ |
| 22 int eb, /* extend bottom border */ | 22 int eb, /* extend bottom border */ |
| 23 int er) { /* extend right border */ | 23 int er) { /* extend right border */ |
| 24 int i; | 24 int i; |
| 25 unsigned char *src_ptr1, *src_ptr2; | 25 uint8_t *src_ptr1, *src_ptr2; |
| 26 unsigned char *dest_ptr1, *dest_ptr2; | 26 uint8_t *dest_ptr1, *dest_ptr2; |
| 27 int linesize; | 27 int linesize; |
| 28 | 28 |
| 29 /* copy the left and right most columns out */ | 29 /* copy the left and right most columns out */ |
| 30 src_ptr1 = s; | 30 src_ptr1 = s; |
| 31 src_ptr2 = s + w - 1; | 31 src_ptr2 = s + w - 1; |
| 32 dest_ptr1 = d - el; | 32 dest_ptr1 = d - el; |
| 33 dest_ptr2 = d + w; | 33 dest_ptr2 = d + w; |
| 34 | 34 |
| 35 for (i = 0; i < h; i++) { | 35 for (i = 0; i < h; i++) { |
| 36 vpx_memset(dest_ptr1, src_ptr1[0], el); | 36 vpx_memset(dest_ptr1, src_ptr1[0], el); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 copy_and_extend_plane(src->v_buffer + src_uv_offset, | 137 copy_and_extend_plane(src->v_buffer + src_uv_offset, |
| 138 src->uv_stride, | 138 src->uv_stride, |
| 139 dst->v_buffer + dst_uv_offset, | 139 dst->v_buffer + dst_uv_offset, |
| 140 dst->uv_stride, | 140 dst->uv_stride, |
| 141 srch, srcw, | 141 srch, srcw, |
| 142 et, el, eb, er); | 142 et, el, eb, er); |
| 143 } | 143 } |
| 144 | 144 |
| 145 /* note the extension is only for the last row, for intra prediction purpose */ | 145 /* note the extension is only for the last row, for intra prediction purpose */ |
| 146 void vp9_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, | 146 void vp9_extend_mb_row(YV12_BUFFER_CONFIG *ybf, uint8_t *YPtr, |
| 147 unsigned char *UPtr, unsigned char *VPtr) { | 147 uint8_t *UPtr, uint8_t *VPtr) { |
| 148 int i; | 148 int i; |
| 149 | 149 |
| 150 YPtr += ybf->y_stride * 14; | 150 YPtr += ybf->y_stride * 14; |
| 151 UPtr += ybf->uv_stride * 6; | 151 UPtr += ybf->uv_stride * 6; |
| 152 VPtr += ybf->uv_stride * 6; | 152 VPtr += ybf->uv_stride * 6; |
| 153 | 153 |
| 154 for (i = 0; i < 4; i++) { | 154 for (i = 0; i < 4; i++) { |
| 155 YPtr[i] = YPtr[-1]; | 155 YPtr[i] = YPtr[-1]; |
| 156 UPtr[i] = UPtr[-1]; | 156 UPtr[i] = UPtr[-1]; |
| 157 VPtr[i] = VPtr[-1]; | 157 VPtr[i] = VPtr[-1]; |
| 158 } | 158 } |
| 159 | 159 |
| 160 YPtr += ybf->y_stride; | 160 YPtr += ybf->y_stride; |
| 161 UPtr += ybf->uv_stride; | 161 UPtr += ybf->uv_stride; |
| 162 VPtr += ybf->uv_stride; | 162 VPtr += ybf->uv_stride; |
| 163 | 163 |
| 164 for (i = 0; i < 4; i++) { | 164 for (i = 0; i < 4; i++) { |
| 165 YPtr[i] = YPtr[-1]; | 165 YPtr[i] = YPtr[-1]; |
| 166 UPtr[i] = UPtr[-1]; | 166 UPtr[i] = UPtr[-1]; |
| 167 VPtr[i] = VPtr[-1]; | 167 VPtr[i] = VPtr[-1]; |
| 168 } | 168 } |
| 169 } | 169 } |
| OLD | NEW |