| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 vpx_memset(denoiser->yv12_last_source.buffer_alloc, 0, | 407 vpx_memset(denoiser->yv12_last_source.buffer_alloc, 0, |
| 408 denoiser->yv12_last_source.frame_size); | 408 denoiser->yv12_last_source.frame_size); |
| 409 | 409 |
| 410 denoiser->denoise_state = vpx_calloc((num_mb_rows * num_mb_cols), 1); | 410 denoiser->denoise_state = vpx_calloc((num_mb_rows * num_mb_cols), 1); |
| 411 vpx_memset(denoiser->denoise_state, 0, (num_mb_rows * num_mb_cols)); | 411 vpx_memset(denoiser->denoise_state, 0, (num_mb_rows * num_mb_cols)); |
| 412 vp8_denoiser_set_parameters(denoiser, mode); | 412 vp8_denoiser_set_parameters(denoiser, mode); |
| 413 denoiser->nmse_source_diff = 0; | 413 denoiser->nmse_source_diff = 0; |
| 414 denoiser->nmse_source_diff_count = 0; | 414 denoiser->nmse_source_diff_count = 0; |
| 415 // TODO(marpan): Adjust thresholds, including effect on resolution. | 415 // TODO(marpan): Adjust thresholds, including effect on resolution. |
| 416 denoiser->threshold_aggressive_mode = 40; | 416 denoiser->threshold_aggressive_mode = 35; |
| 417 if (width * height > 640 * 480) | 417 if (width * height > 640 * 480) |
| 418 denoiser->threshold_aggressive_mode = 180; | 418 denoiser->threshold_aggressive_mode = 150; |
| 419 else if (width * height > 1280 * 720) |
| 420 denoiser->threshold_aggressive_mode = 1400; |
| 419 return 0; | 421 return 0; |
| 420 } | 422 } |
| 421 | 423 |
| 422 | 424 |
| 423 void vp8_denoiser_free(VP8_DENOISER *denoiser) | 425 void vp8_denoiser_free(VP8_DENOISER *denoiser) |
| 424 { | 426 { |
| 425 int i; | 427 int i; |
| 426 assert(denoiser); | 428 assert(denoiser); |
| 427 | 429 |
| 428 for (i = 0; i < MAX_REF_FRAMES ; i++) | 430 for (i = 0; i < MAX_REF_FRAMES ; i++) |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } | 682 } |
| 681 if (apply_filter) { | 683 if (apply_filter) { |
| 682 // Update the signal block |x|. Pixel changes are only to top and/or | 684 // Update the signal block |x|. Pixel changes are only to top and/or |
| 683 // left boundary pixels: can we avoid full block copy here. | 685 // left boundary pixels: can we avoid full block copy here. |
| 684 vp8_copy_mem16x16( | 686 vp8_copy_mem16x16( |
| 685 denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, | 687 denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, |
| 686 y_stride, x->thismb, 16); | 688 y_stride, x->thismb, 16); |
| 687 } | 689 } |
| 688 } | 690 } |
| 689 } | 691 } |
| OLD | NEW |