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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc

Issue 1894083002: Tune QP-based quality thresholds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC 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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 } 597 }
598 } 598 }
599 599
600 rps_.Init(); 600 rps_.Init();
601 // Disable both high-QP limits and framedropping. Both are handled by libvpx 601 // Disable both high-QP limits and framedropping. Both are handled by libvpx
602 // internally. 602 // internally.
603 // QP thresholds are chosen to be high enough to be hit in practice when 603 // QP thresholds are chosen to be high enough to be hit in practice when
604 // quality is good, but also low enough to not cause a flip-flop behavior 604 // quality is good, but also low enough to not cause a flip-flop behavior
605 // (e.g. going up in resolution shouldn't give so bad quality that we should 605 // (e.g. going up in resolution shouldn't give so bad quality that we should
606 // go back down). 606 // go back down).
607 const int kLowQpThreshold = 23; 607 const int kLowQpThreshold = 29;
608 const int kDisabledBadQpThreshold = 128; 608 const int kDisabledBadQpThreshold = 100;
609 // TODO(glaznev/sprang): consider passing codec initial bitrate to quality 609 // TODO(glaznev/sprang): consider passing codec initial bitrate to quality
610 // scaler to avoid starting with HD for low initial bitrates. 610 // scaler to avoid starting with HD for low initial bitrates.
611 quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, 0, 0, 0, 611 quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, 0, 0, 0,
612 codec_.maxFramerate); 612 codec_.maxFramerate);
613 613
614 // Only apply scaling to improve for single-layer streams. The scaling metrics 614 // Only apply scaling to improve for single-layer streams. The scaling metrics
615 // use frame drops as a signal and is only applicable when we drop frames. 615 // use frame drops as a signal and is only applicable when we drop frames.
616 quality_scaler_enabled_ = encoders_.size() == 1 && 616 quality_scaler_enabled_ = encoders_.size() == 1 &&
617 configurations_[0].rc_dropframe_thresh > 0 && 617 configurations_[0].rc_dropframe_thresh > 0 &&
618 codec_.codecSpecific.VP8.automaticResizeOn; 618 codec_.codecSpecific.VP8.automaticResizeOn;
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 return -1; 1413 return -1;
1414 } 1414 }
1415 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != 1415 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) !=
1416 VPX_CODEC_OK) { 1416 VPX_CODEC_OK) {
1417 return -1; 1417 return -1;
1418 } 1418 }
1419 return 0; 1419 return 0;
1420 } 1420 }
1421 1421
1422 } // namespace webrtc 1422 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/java/jni/androidmediaencoder_jni.cc ('k') | webrtc/modules/video_coding/utility/quality_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698