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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 int motion_magnitude) { | 82 int motion_magnitude) { |
83 int r, c; | 83 int r, c; |
84 const uint8_t *sig_start = sig; | 84 const uint8_t *sig_start = sig; |
85 const uint8_t *mc_avg_start = mc_avg; | 85 const uint8_t *mc_avg_start = mc_avg; |
86 uint8_t *avg_start = avg; | 86 uint8_t *avg_start = avg; |
87 int diff, adj, absdiff, delta; | 87 int diff, adj, absdiff, delta; |
88 int adj_val[] = {3, 4, 6}; | 88 int adj_val[] = {3, 4, 6}; |
89 int total_adj = 0; | 89 int total_adj = 0; |
90 int shift_inc = 1; | 90 int shift_inc = 1; |
91 | 91 |
92 /* If motion_magnitude is small, making the denoiser more aggressive by | 92 // If motion_magnitude is small, making the denoiser more aggressive by |
93 * increasing the adjustment for each level. Add another increment for | 93 // increasing the adjustment for each level. Add another increment for |
94 * blocks that are labeled for increase denoising. */ | 94 // blocks that are labeled for increase denoising. |
95 if (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) { | 95 if (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) { |
96 if (increase_denoising) { | 96 if (increase_denoising) { |
97 shift_inc = 2; | 97 shift_inc = 2; |
98 } | 98 } |
99 adj_val[0] += shift_inc; | 99 adj_val[0] += shift_inc; |
100 adj_val[1] += shift_inc; | 100 adj_val[1] += shift_inc; |
101 adj_val[2] += shift_inc; | 101 adj_val[2] += shift_inc; |
102 } | 102 } |
103 | 103 |
104 // First attempt to apply a strong temporal denoising filter. | 104 // First attempt to apply a strong temporal denoising filter. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 int increase_denoising, | 206 int increase_denoising, |
207 int mi_row, | 207 int mi_row, |
208 int mi_col, | 208 int mi_col, |
209 PICK_MODE_CONTEXT *ctx, | 209 PICK_MODE_CONTEXT *ctx, |
210 int *motion_magnitude | 210 int *motion_magnitude |
211 ) { | 211 ) { |
212 int mv_col, mv_row; | 212 int mv_col, mv_row; |
213 int sse_diff = ctx->zeromv_sse - ctx->newmv_sse; | 213 int sse_diff = ctx->zeromv_sse - ctx->newmv_sse; |
214 MV_REFERENCE_FRAME frame; | 214 MV_REFERENCE_FRAME frame; |
215 MACROBLOCKD *filter_mbd = &mb->e_mbd; | 215 MACROBLOCKD *filter_mbd = &mb->e_mbd; |
216 MB_MODE_INFO *mbmi = &filter_mbd->mi[0]->mbmi; | 216 MB_MODE_INFO *mbmi = &filter_mbd->mi[0].src_mi->mbmi; |
217 | 217 |
218 MB_MODE_INFO saved_mbmi; | 218 MB_MODE_INFO saved_mbmi; |
219 int i, j; | 219 int i, j; |
220 struct buf_2d saved_dst[MAX_MB_PLANE]; | 220 struct buf_2d saved_dst[MAX_MB_PLANE]; |
221 struct buf_2d saved_pre[MAX_MB_PLANE][2]; // 2 pre buffers | 221 struct buf_2d saved_pre[MAX_MB_PLANE][2]; // 2 pre buffers |
222 | 222 |
223 // We will restore these after motion compensation. | 223 // We will restore these after motion compensation. |
224 saved_mbmi = *mbmi; | 224 saved_mbmi = *mbmi; |
225 for (i = 0; i < MAX_MB_PLANE; ++i) { | 225 for (i = 0; i < MAX_MB_PLANE; ++i) { |
226 for (j = 0; j < 2; ++j) { | 226 for (j = 0; j < 2; ++j) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 for (r = 0; r < yuv->uv_height / 2; ++r) { | 482 for (r = 0; r < yuv->uv_height / 2; ++r) { |
483 for (c = 0; c < yuv->uv_width / 2; ++c) { | 483 for (c = 0; c < yuv->uv_width / 2; ++c) { |
484 u[c] = UINT8_MAX / 2; | 484 u[c] = UINT8_MAX / 2; |
485 v[c] = UINT8_MAX / 2; | 485 v[c] = UINT8_MAX / 2; |
486 } | 486 } |
487 u += yuv->uv_stride + yuv->uv_width / 2; | 487 u += yuv->uv_stride + yuv->uv_width / 2; |
488 v += yuv->uv_stride + yuv->uv_width / 2; | 488 v += yuv->uv_stride + yuv->uv_width / 2; |
489 } | 489 } |
490 } | 490 } |
491 #endif | 491 #endif |
OLD | NEW |