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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 denoiser->denoise_pars.denoise_mv_bias = 95; | 383 denoiser->denoise_pars.denoise_mv_bias = 95; |
384 denoiser->denoise_pars.pickmode_mv_bias = 100; | 384 denoiser->denoise_pars.pickmode_mv_bias = 100; |
385 denoiser->denoise_pars.qp_thresh = 0; | 385 denoiser->denoise_pars.qp_thresh = 0; |
386 denoiser->denoise_pars.consec_zerolast = UINT_MAX; | 386 denoiser->denoise_pars.consec_zerolast = UINT_MAX; |
387 denoiser->denoise_pars.spatial_blur = 0; | 387 denoiser->denoise_pars.spatial_blur = 0; |
388 } else { | 388 } else { |
389 denoiser->denoise_pars.scale_sse_thresh = 2; | 389 denoiser->denoise_pars.scale_sse_thresh = 2; |
390 denoiser->denoise_pars.scale_motion_thresh = 16; | 390 denoiser->denoise_pars.scale_motion_thresh = 16; |
391 denoiser->denoise_pars.scale_increase_filter = 1; | 391 denoiser->denoise_pars.scale_increase_filter = 1; |
392 denoiser->denoise_pars.denoise_mv_bias = 60; | 392 denoiser->denoise_pars.denoise_mv_bias = 60; |
393 denoiser->denoise_pars.pickmode_mv_bias = 60; | 393 denoiser->denoise_pars.pickmode_mv_bias = 75; |
394 denoiser->denoise_pars.qp_thresh = 100; | 394 denoiser->denoise_pars.qp_thresh = 85; |
395 denoiser->denoise_pars.consec_zerolast = 10; | 395 denoiser->denoise_pars.consec_zerolast = 15; |
396 denoiser->denoise_pars.spatial_blur = 20; | 396 denoiser->denoise_pars.spatial_blur = 20; |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, | 400 int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, |
401 int num_mb_rows, int num_mb_cols, int mode) | 401 int num_mb_rows, int num_mb_cols, int mode) |
402 { | 402 { |
403 int i; | 403 int i; |
404 assert(denoiser); | 404 assert(denoiser); |
405 denoiser->num_mb_cols = num_mb_cols; | 405 denoiser->num_mb_cols = num_mb_cols; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 denoiser->nmse_source_diff_count = 0; | 446 denoiser->nmse_source_diff_count = 0; |
447 denoiser->qp_avg = 0; | 447 denoiser->qp_avg = 0; |
448 // QP threshold below which we can go up to aggressive mode. | 448 // QP threshold below which we can go up to aggressive mode. |
449 denoiser->qp_threshold_up = 80; | 449 denoiser->qp_threshold_up = 80; |
450 // QP threshold above which we can go back down to normal mode. | 450 // QP threshold above which we can go back down to normal mode. |
451 // For now keep this second threshold high, so not used currently. | 451 // For now keep this second threshold high, so not used currently. |
452 denoiser->qp_threshold_down = 128; | 452 denoiser->qp_threshold_down = 128; |
453 // Bitrate thresholds and noise metric (nmse) thresholds for switching to | 453 // Bitrate thresholds and noise metric (nmse) thresholds for switching to |
454 // aggressive mode. | 454 // aggressive mode. |
455 // TODO(marpan): Adjust thresholds, including effect on resolution. | 455 // TODO(marpan): Adjust thresholds, including effect on resolution. |
456 denoiser->bitrate_threshold = 200000; // (bits/sec). | 456 denoiser->bitrate_threshold = 300000; // (bits/sec). |
457 denoiser->threshold_aggressive_mode = 35; | 457 denoiser->threshold_aggressive_mode = 35; |
458 if (width * height > 640 * 480) { | 458 if (width * height > 1280 * 720) { |
459 denoiser->bitrate_threshold = 500000; | 459 denoiser->bitrate_threshold = 2000000; |
460 denoiser->threshold_aggressive_mode = 100; | 460 denoiser->threshold_aggressive_mode = 1400; |
461 } else if (width * height > 960 * 540) { | 461 } else if (width * height > 960 * 540) { |
462 denoiser->bitrate_threshold = 800000; | 462 denoiser->bitrate_threshold = 800000; |
463 denoiser->threshold_aggressive_mode = 150; | 463 denoiser->threshold_aggressive_mode = 150; |
464 } else if (width * height > 1280 * 720) { | 464 } else if (width * height > 640 * 480) { |
465 denoiser->bitrate_threshold = 2000000; | 465 denoiser->bitrate_threshold = 500000; |
466 denoiser->threshold_aggressive_mode = 1400; | 466 denoiser->threshold_aggressive_mode = 100; |
467 } | 467 } |
468 return 0; | 468 return 0; |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 void vp8_denoiser_free(VP8_DENOISER *denoiser) | 472 void vp8_denoiser_free(VP8_DENOISER *denoiser) |
473 { | 473 { |
474 int i; | 474 int i; |
475 assert(denoiser); | 475 assert(denoiser); |
476 | 476 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 } | 729 } |
730 if (apply_filter) { | 730 if (apply_filter) { |
731 // Update the signal block |x|. Pixel changes are only to top and/or | 731 // Update the signal block |x|. Pixel changes are only to top and/or |
732 // left boundary pixels: can we avoid full block copy here. | 732 // left boundary pixels: can we avoid full block copy here. |
733 vp8_copy_mem16x16( | 733 vp8_copy_mem16x16( |
734 denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, | 734 denoiser->yv12_running_avg[INTRA_FRAME].y_buffer + recon_yoffset, |
735 y_stride, x->thismb, 16); | 735 y_stride, x->thismb, 16); |
736 } | 736 } |
737 } | 737 } |
738 } | 738 } |
OLD | NEW |