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 |
(...skipping 3275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3286 } | 3286 } |
3287 } | 3287 } |
3288 if (cpi->oxcf.noise_sensitivity == 4) | 3288 if (cpi->oxcf.noise_sensitivity == 4) |
3289 vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_last_source); | 3289 vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_last_source); |
3290 | 3290 |
3291 } | 3291 } |
3292 #endif | 3292 #endif |
3293 | 3293 |
3294 } | 3294 } |
3295 | 3295 |
| 3296 #if CONFIG_TEMPORAL_DENOISING |
3296 static void process_denoiser_mode_change(VP8_COMP *cpi) { | 3297 static void process_denoiser_mode_change(VP8_COMP *cpi) { |
3297 const VP8_COMMON *const cm = &cpi->common; | 3298 const VP8_COMMON *const cm = &cpi->common; |
3298 int i, j; | 3299 int i, j; |
3299 int total = 0; | 3300 int total = 0; |
3300 int num_blocks = 0; | 3301 int num_blocks = 0; |
3301 // Number of blocks skipped along row/column in computing the | 3302 // Number of blocks skipped along row/column in computing the |
3302 // nmse (normalized mean square error) of source. | 3303 // nmse (normalized mean square error) of source. |
3303 int skip = 2; | 3304 int skip = 2; |
3304 // Only select blocks for computing nmse that have been encoded | 3305 // Only select blocks for computing nmse that have been encoded |
3305 // as ZERO LAST min_consec_zero_last frames in a row. | 3306 // as ZERO LAST min_consec_zero_last frames in a row. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 (cpi->denoiser.nmse_source_diff < | 3393 (cpi->denoiser.nmse_source_diff < |
3393 cpi->denoiser.threshold_aggressive_mode)) { | 3394 cpi->denoiser.threshold_aggressive_mode)) { |
3394 vp8_denoiser_set_parameters(&cpi->denoiser, kDenoiserOnYUV); | 3395 vp8_denoiser_set_parameters(&cpi->denoiser, kDenoiserOnYUV); |
3395 } | 3396 } |
3396 } | 3397 } |
3397 // Reset metric and counter for next interval. | 3398 // Reset metric and counter for next interval. |
3398 cpi->denoiser.nmse_source_diff = 0; | 3399 cpi->denoiser.nmse_source_diff = 0; |
3399 cpi->denoiser.nmse_source_diff_count = 0; | 3400 cpi->denoiser.nmse_source_diff_count = 0; |
3400 } | 3401 } |
3401 } | 3402 } |
| 3403 #endif |
3402 | 3404 |
3403 void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) | 3405 void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) |
3404 { | 3406 { |
3405 const FRAME_TYPE frame_type = cm->frame_type; | 3407 const FRAME_TYPE frame_type = cm->frame_type; |
3406 | 3408 |
3407 if (cm->no_lpf) | 3409 if (cm->no_lpf) |
3408 { | 3410 { |
3409 cm->filter_level = 0; | 3411 cm->filter_level = 0; |
3410 } | 3412 } |
3411 else | 3413 else |
(...skipping 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5730 } | 5732 } |
5731 | 5733 |
5732 return Total; | 5734 return Total; |
5733 } | 5735 } |
5734 | 5736 |
5735 | 5737 |
5736 int vp8_get_quantizer(VP8_COMP *cpi) | 5738 int vp8_get_quantizer(VP8_COMP *cpi) |
5737 { | 5739 { |
5738 return cpi->common.base_qindex; | 5740 return cpi->common.base_qindex; |
5739 } | 5741 } |
OLD | NEW |