Denoise 2 spatial layes at most. Add noise sensitivity level 2 for vp9 such that applications can control whether to denoise the second highest spatial layer. Add tests to cover this case.
Showing the changes to examples (1 of 10 files). Show all
Unified · Split
| @@ -32,13 +32,21 @@ static const char *exec_name; · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | void usage_exit(void) { exit(EXIT_FAILURE); } |
| 34 | 34 | |
| 35 | −// Denoiser states, for temporal denoising. | |
| 36 | −enum denoiserState { | |
| 37 | − kDenoiserOff, | |
| 38 | − kDenoiserOnYOnly, | |
| 39 | − kDenoiserOnYUV, | |
| 40 | − kDenoiserOnYUVAggressive, | |
| 41 | − kDenoiserOnAdaptive | |
| 35 | +// Denoiser states for vp8, for temporal denoising. | |
| 36 | +enum denoiserStateVp8 { | |
| 37 | + kVp8DenoiserOff, | |
| 38 | + kVp8DenoiserOnYOnly, | |
| 39 | + kVp8DenoiserOnYUV, | |
| 40 | + kVp8DenoiserOnYUVAggressive, | |
| 41 | + kVp8DenoiserOnAdaptive | |
| 42 | +}; | |
| 43 | + | |
| 44 | +// Denoiser states for vp9, for temporal denoising. | |
| 45 | +enum denoiserStateVp9 { | |
| 46 | + kVp9DenoiserOff, | |
| 47 | + kVp9DenoiserOnYOnly, | |
| 48 | + // For SVC: denoise the top two spatial layers. | |
| 49 | + kVp9DenoiserOnYTwoSpatialLayers | |
| 42 | 50 | }; |
| 43 | 51 | |
| 44 | 52 | static int mode_to_num_layers[13] = { 1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 3 }; |
| @@ -755,7 +763,7 @@ int main(int argc, char **argv) { · 710 unmodified lines | ||
| 755 | 763 | |
| 756 | 764 | if (strncmp(encoder->name, "vp8", 3) == 0) { |
| 757 | 765 | vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed); |
| 758 | − vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kDenoiserOff); | |
| 766 | + vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kVp8DenoiserOff); | |
| 759 | 767 | vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1); |
| 760 | 768 | vpx_codec_control(&codec, VP8E_SET_GF_CBR_BOOST_PCT, 0); |
| 761 | 769 | #if VP8_ROI_MAP |
| @@ -772,7 +780,7 @@ int main(int argc, char **argv) { · 10 unmodified lines | ||
| 772 | 780 | vpx_codec_control(&codec, VP9E_SET_GF_CBR_BOOST_PCT, 0); |
| 773 | 781 | vpx_codec_control(&codec, VP9E_SET_FRAME_PARALLEL_DECODING, 0); |
| 774 | 782 | vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0); |
| 775 | − vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, kDenoiserOff); | |
| 783 | + vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, kVp9DenoiserOff); | |
| 776 | 784 | vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1); |
| 777 | 785 | vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0); |
| 778 | 786 | vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1)); |