From 16a87b97f9eaf4eb0ab902815b73973fe77fd97d Mon Sep 17 00:00:00 2001 From: "marpan@webrtc.org" Date: Thu, 5 Mar 2015 22:19:00 +0000 Subject: [PATCH] Add VP9 denoiser test to videoprocessor_integrationtest. TBR=stefan@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/43599004 Cr-Commit-Position: refs/heads/master@{#8622} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8622 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../test/videoprocessor_integrationtest.cc | 22 +++++++++++++++++++ .../video_coding/codecs/vp9/vp9_impl.cc | 11 +++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc index 6f7a6178e8..147a9a2b78 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc @@ -703,6 +703,28 @@ TEST_F(VideoProcessorIntegrationTest, rc_metrics); } +// VP9: Run with no packet loss and denoiser on. One key frame (first frame). +TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { + // Bitrate and frame rate profile. + RateProfile rate_profile; + SetRateProfilePars(&rate_profile, 0, 500, 30, 0); + rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; + rate_profile.num_frames = kNbrFramesShort; + // Codec/network settings. + CodecConfigPars process_settings; + SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, + true, true, false); + // Metrics for expected quality. + QualityMetrics quality_metrics; + SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); + // Metrics for rate control. + RateControlMetrics rc_metrics[1]; + SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0); + ProcessFramesAndVerify(quality_metrics, + rate_profile, + process_settings, + rc_metrics); +} // TODO(marpan): Add temporal layer test for VP9, once changes are in // vp9 wrapper for this. diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc index 8af2c77e8b..fb167d75a6 100644 --- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -223,11 +223,12 @@ int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) { // The number tile columns will be capped by the encoder based on image size // (minimum width of tile column is 256 pixels, maximum is 4096). vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); - // TODO(marpan): Enable in future libvpx roll: waiting for SSE2 optimization. -// #if !defined(WEBRTC_ARCH_ARM) - // vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, - // inst->codecSpecific.VP9.denoisingOn ? 1 : 0); -// #endif +#if !defined(WEBRTC_ARCH_ARM) + // Note denoiser is still off by default until further testing/optimization, + // i.e., codecSpecific.VP9.denoisingOn == 0. + vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, + inst->codecSpecific.VP9.denoisingOn ? 1 : 0); +#endif inited_ = true; return WEBRTC_VIDEO_CODEC_OK; }