OLD | NEW |
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = 29; | 607 const int kLowQpThreshold = 29; |
608 const int kDisabledBadQpThreshold = 100; | 608 const int kDisabledBadQpThreshold = 100; |
609 // TODO(glaznev/sprang): consider passing codec initial bitrate to quality | 609 quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, |
610 // scaler to avoid starting with HD for low initial bitrates. | 610 codec_.startBitrate, codec_.width, codec_.height, |
611 quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, 0, 0, 0, | |
612 codec_.maxFramerate); | 611 codec_.maxFramerate); |
613 | 612 |
614 // Only apply scaling to improve for single-layer streams. The scaling metrics | 613 // 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. | 614 // use frame drops as a signal and is only applicable when we drop frames. |
616 quality_scaler_enabled_ = encoders_.size() == 1 && | 615 quality_scaler_enabled_ = encoders_.size() == 1 && |
617 configurations_[0].rc_dropframe_thresh > 0 && | 616 configurations_[0].rc_dropframe_thresh > 0 && |
618 codec_.codecSpecific.VP8.automaticResizeOn; | 617 codec_.codecSpecific.VP8.automaticResizeOn; |
619 | 618 |
620 return InitAndSetControlSettings(); | 619 return InitAndSetControlSettings(); |
621 } | 620 } |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 return -1; | 1412 return -1; |
1414 } | 1413 } |
1415 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1414 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
1416 VPX_CODEC_OK) { | 1415 VPX_CODEC_OK) { |
1417 return -1; | 1416 return -1; |
1418 } | 1417 } |
1419 return 0; | 1418 return 0; |
1420 } | 1419 } |
1421 | 1420 |
1422 } // namespace webrtc | 1421 } // namespace webrtc |
OLD | NEW |