OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 27 matching lines...) Expand all Loading... |
38 * motion correction motion correction | 38 * motion correction motion correction |
39 * [-255, -16] 3 -6 -7 | 39 * [-255, -16] 3 -6 -7 |
40 * [-15, -8] 2 -4 -5 | 40 * [-15, -8] 2 -4 -5 |
41 * [-7, -4] 1 -3 -4 | 41 * [-7, -4] 1 -3 -4 |
42 * [-3, 3] 0 diff diff | 42 * [-3, 3] 0 diff diff |
43 * [4, 7] 1 3 4 | 43 * [4, 7] 1 3 4 |
44 * [8, 15] 2 4 5 | 44 * [8, 15] 2 4 5 |
45 * [16, 255] 3 6 7 | 45 * [16, 255] 3 6 7 |
46 */ | 46 */ |
47 | 47 |
48 int vp8_denoiser_filter_neon(YV12_BUFFER_CONFIG *mc_running_avg, | 48 int vp8_denoiser_filter_neon(unsigned char *mc_running_avg_y, |
49 YV12_BUFFER_CONFIG *running_avg, | 49 int mc_running_avg_y_stride, |
50 MACROBLOCK *signal, unsigned int motion_magnitude, | 50 unsigned char *running_avg_y, |
51 int y_offset, int uv_offset) { | 51 int running_avg_y_stride, |
| 52 unsigned char *sig, int sig_stride, |
| 53 unsigned int motion_magnitude) { |
52 /* If motion_magnitude is small, making the denoiser more aggressive by | 54 /* If motion_magnitude is small, making the denoiser more aggressive by |
53 * increasing the adjustment for each level, level1 adjustment is | 55 * increasing the adjustment for each level, level1 adjustment is |
54 * increased, the deltas stay the same. | 56 * increased, the deltas stay the same. |
55 */ | 57 */ |
56 const uint8x16_t v_level1_adjustment = vdupq_n_u8( | 58 const uint8x16_t v_level1_adjustment = vdupq_n_u8( |
57 (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 4 : 3); | 59 (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 4 : 3); |
58 const uint8x16_t v_delta_level_1_and_2 = vdupq_n_u8(1); | 60 const uint8x16_t v_delta_level_1_and_2 = vdupq_n_u8(1); |
59 const uint8x16_t v_delta_level_2_and_3 = vdupq_n_u8(2); | 61 const uint8x16_t v_delta_level_2_and_3 = vdupq_n_u8(2); |
60 const uint8x16_t v_level1_threshold = vdupq_n_u8(4); | 62 const uint8x16_t v_level1_threshold = vdupq_n_u8(4); |
61 const uint8x16_t v_level2_threshold = vdupq_n_u8(8); | 63 const uint8x16_t v_level2_threshold = vdupq_n_u8(8); |
62 const uint8x16_t v_level3_threshold = vdupq_n_u8(16); | 64 const uint8x16_t v_level3_threshold = vdupq_n_u8(16); |
63 | |
64 /* Local variables for array pointers and strides. */ | |
65 unsigned char *sig = signal->thismb; | |
66 int sig_stride = 16; | |
67 unsigned char *mc_running_avg_y = mc_running_avg->y_buffer + y_offset; | |
68 int mc_running_avg_y_stride = mc_running_avg->y_stride; | |
69 unsigned char *running_avg_y = running_avg->y_buffer + y_offset; | |
70 int running_avg_y_stride = running_avg->y_stride; | |
71 int64x2_t v_sum_diff_total = vdupq_n_s64(0); | 65 int64x2_t v_sum_diff_total = vdupq_n_s64(0); |
72 | 66 |
73 /* Go over lines. */ | 67 /* Go over lines. */ |
74 int i; | 68 int i; |
75 for (i = 0; i < 16; ++i) { | 69 for (i = 0; i < 16; ++i) { |
76 /* Load inputs. */ | 70 /* Load inputs. */ |
77 const uint8x16_t v_sig = vld1q_u8(sig); | 71 const uint8x16_t v_sig = vld1q_u8(sig); |
78 const uint8x16_t v_mc_running_avg_y = vld1q_u8(mc_running_avg_y); | 72 const uint8x16_t v_mc_running_avg_y = vld1q_u8(mc_running_avg_y); |
79 | 73 |
80 /* Calculate absolute difference and sign masks. */ | 74 /* Calculate absolute difference and sign masks. */ |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 151 } |
158 | 152 |
159 /* Tell above level that block was filtered. */ | 153 /* Tell above level that block was filtered. */ |
160 running_avg_y -= running_avg_y_stride * 16; | 154 running_avg_y -= running_avg_y_stride * 16; |
161 sig -= sig_stride * 16; | 155 sig -= sig_stride * 16; |
162 | 156 |
163 vp8_copy_mem16x16(running_avg_y, running_avg_y_stride, sig, sig_stride); | 157 vp8_copy_mem16x16(running_avg_y, running_avg_y_stride, sig, sig_stride); |
164 | 158 |
165 return FILTER_BLOCK; | 159 return FILTER_BLOCK; |
166 } | 160 } |
OLD | NEW |