Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1418133012: Disable denoising for VP9 by default. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 void* WebRtcVideoChannel2::WebRtcVideoSendStream::ConfigureVideoEncoderSettings( 477 void* WebRtcVideoChannel2::WebRtcVideoSendStream::ConfigureVideoEncoderSettings(
478 const VideoCodec& codec, 478 const VideoCodec& codec,
479 const VideoOptions& options, 479 const VideoOptions& options,
480 bool is_screencast) { 480 bool is_screencast) {
481 // No automatic resizing when using simulcast or screencast. 481 // No automatic resizing when using simulcast or screencast.
482 bool automatic_resize = 482 bool automatic_resize =
483 !is_screencast && parameters_.config.rtp.ssrcs.size() == 1; 483 !is_screencast && parameters_.config.rtp.ssrcs.size() == 1;
484 bool frame_dropping = !is_screencast; 484 bool frame_dropping = !is_screencast;
485 bool denoising; 485 bool denoising;
486 bool codec_default_denoising = false;
486 if (is_screencast) { 487 if (is_screencast) {
487 denoising = false; 488 denoising = false;
488 } else { 489 } else {
489 options.video_noise_reduction.Get(&denoising); 490 // Use codec default if video_noise_reduction is unset.
491 codec_default_denoising = !options.video_noise_reduction.Get(&denoising);
490 } 492 }
491 493
492 if (CodecNamesEq(codec.name, kVp8CodecName)) { 494 if (CodecNamesEq(codec.name, kVp8CodecName)) {
493 encoder_settings_.vp8 = webrtc::VideoEncoder::GetDefaultVp8Settings(); 495 encoder_settings_.vp8 = webrtc::VideoEncoder::GetDefaultVp8Settings();
494 encoder_settings_.vp8.automaticResizeOn = automatic_resize; 496 encoder_settings_.vp8.automaticResizeOn = automatic_resize;
495 encoder_settings_.vp8.denoisingOn = denoising; 497 // VP8 denoising is enabled by default.
498 encoder_settings_.vp8.denoisingOn =
499 codec_default_denoising ? true : denoising;
496 encoder_settings_.vp8.frameDroppingOn = frame_dropping; 500 encoder_settings_.vp8.frameDroppingOn = frame_dropping;
497 return &encoder_settings_.vp8; 501 return &encoder_settings_.vp8;
498 } 502 }
499 if (CodecNamesEq(codec.name, kVp9CodecName)) { 503 if (CodecNamesEq(codec.name, kVp9CodecName)) {
500 encoder_settings_.vp9 = webrtc::VideoEncoder::GetDefaultVp9Settings(); 504 encoder_settings_.vp9 = webrtc::VideoEncoder::GetDefaultVp9Settings();
501 encoder_settings_.vp9.denoisingOn = denoising; 505 // VP9 denoising is disabled by default.
506 encoder_settings_.vp9.denoisingOn =
507 codec_default_denoising ? false : denoising;
502 encoder_settings_.vp9.frameDroppingOn = frame_dropping; 508 encoder_settings_.vp9.frameDroppingOn = frame_dropping;
503 return &encoder_settings_.vp9; 509 return &encoder_settings_.vp9;
504 } 510 }
505 return NULL; 511 return NULL;
506 } 512 }
507 513
508 DefaultUnsignalledSsrcHandler::DefaultUnsignalledSsrcHandler() 514 DefaultUnsignalledSsrcHandler::DefaultUnsignalledSsrcHandler()
509 : default_recv_ssrc_(0), default_renderer_(NULL) {} 515 : default_recv_ssrc_(0), default_renderer_(NULL) {}
510 516
511 UnsignalledSsrcHandler::Action DefaultUnsignalledSsrcHandler::OnUnsignalledSsrc( 517 UnsignalledSsrcHandler::Action DefaultUnsignalledSsrcHandler::OnUnsignalledSsrc(
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 rtcp_receiver_report_ssrc_ = kDefaultRtcpReceiverReportSsrc; 780 rtcp_receiver_report_ssrc_ = kDefaultRtcpReceiverReportSsrc;
775 sending_ = false; 781 sending_ = false;
776 default_send_ssrc_ = 0; 782 default_send_ssrc_ = 0;
777 SetRecvCodecs(recv_codecs); 783 SetRecvCodecs(recv_codecs);
778 } 784 }
779 785
780 void WebRtcVideoChannel2::SetDefaultOptions() { 786 void WebRtcVideoChannel2::SetDefaultOptions() {
781 options_.cpu_overuse_detection.Set(true); 787 options_.cpu_overuse_detection.Set(true);
782 options_.dscp.Set(false); 788 options_.dscp.Set(false);
783 options_.suspend_below_min_bitrate.Set(false); 789 options_.suspend_below_min_bitrate.Set(false);
784 options_.video_noise_reduction.Set(true);
785 options_.screencast_min_bitrate.Set(0); 790 options_.screencast_min_bitrate.Set(0);
786 } 791 }
787 792
788 WebRtcVideoChannel2::~WebRtcVideoChannel2() { 793 WebRtcVideoChannel2::~WebRtcVideoChannel2() {
789 for (auto& kv : send_streams_) 794 for (auto& kv : send_streams_)
790 delete kv.second; 795 delete kv.second;
791 for (auto& kv : receive_streams_) 796 for (auto& kv : receive_streams_)
792 delete kv.second; 797 delete kv.second;
793 } 798 }
794 799
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2749 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2745 } 2750 }
2746 } 2751 }
2747 2752
2748 return video_codecs; 2753 return video_codecs;
2749 } 2754 }
2750 2755
2751 } // namespace cricket 2756 } // namespace cricket
2752 2757
2753 #endif // HAVE_WEBRTC_VIDEO 2758 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698