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