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 #include "vp9/common/vp9_convolve.h" | |
11 | 10 |
12 #include <assert.h> | 11 #include <assert.h> |
13 | 12 |
14 #include "./vpx_config.h" | 13 #include "./vpx_config.h" |
15 #include "./vp9_rtcd.h" | 14 #include "./vp9_rtcd.h" |
16 #include "vp9/common/vp9_common.h" | 15 #include "vp9/common/vp9_common.h" |
| 16 #include "vp9/common/vp9_convolve.h" |
17 #include "vp9/common/vp9_filter.h" | 17 #include "vp9/common/vp9_filter.h" |
18 #include "vpx/vpx_integer.h" | 18 #include "vpx/vpx_integer.h" |
19 #include "vpx_ports/mem.h" | 19 #include "vpx_ports/mem.h" |
20 | 20 |
21 static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride, | 21 static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride, |
22 uint8_t *dst, ptrdiff_t dst_stride, | 22 uint8_t *dst, ptrdiff_t dst_stride, |
23 const int16_t *filter_x0, int x_step_q4, | 23 const int16_t *filter_x0, int x_step_q4, |
24 const int16_t *filter_y, int y_step_q4, | 24 const int16_t *filter_y, int y_step_q4, |
25 int w, int h, int taps) { | 25 int w, int h, int taps) { |
26 int x, y, k; | 26 int x, y, k; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 275 } |
276 | 276 |
277 void vp9_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride, | 277 void vp9_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride, |
278 uint8_t *dst, ptrdiff_t dst_stride, | 278 uint8_t *dst, ptrdiff_t dst_stride, |
279 const int16_t *filter_x, int filter_x_stride, | 279 const int16_t *filter_x, int filter_x_stride, |
280 const int16_t *filter_y, int filter_y_stride, | 280 const int16_t *filter_y, int filter_y_stride, |
281 int w, int h) { | 281 int w, int h) { |
282 int r; | 282 int r; |
283 | 283 |
284 for (r = h; r > 0; --r) { | 284 for (r = h; r > 0; --r) { |
285 memcpy(dst, src, w); | 285 vpx_memcpy(dst, src, w); |
286 src += src_stride; | 286 src += src_stride; |
287 dst += dst_stride; | 287 dst += dst_stride; |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 void vp9_convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride, | 291 void vp9_convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride, |
292 uint8_t *dst, ptrdiff_t dst_stride, | 292 uint8_t *dst, ptrdiff_t dst_stride, |
293 const int16_t *filter_x, int filter_x_stride, | 293 const int16_t *filter_x, int filter_x_stride, |
294 const int16_t *filter_y, int filter_y_stride, | 294 const int16_t *filter_y, int filter_y_stride, |
295 int w, int h) { | 295 int w, int h) { |
296 int x, y; | 296 int x, y; |
297 | 297 |
298 for (y = 0; y < h; ++y) { | 298 for (y = 0; y < h; ++y) { |
299 for (x = 0; x < w; ++x) | 299 for (x = 0; x < w; ++x) |
300 dst[x] = ROUND_POWER_OF_TWO(dst[x] + src[x], 1); | 300 dst[x] = ROUND_POWER_OF_TWO(dst[x] + src[x], 1); |
301 | 301 |
302 src += src_stride; | 302 src += src_stride; |
303 dst += dst_stride; | 303 dst += dst_stride; |
304 } | 304 } |
305 } | 305 } |
OLD | NEW |