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; }