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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 inst->simulcastStream[stream_idx].height, kVp832ByteAlign); | 591 inst->simulcastStream[stream_idx].height, kVp832ByteAlign); |
592 SetStreamState(stream_bitrates[stream_idx] > 0, stream_idx); | 592 SetStreamState(stream_bitrates[stream_idx] > 0, stream_idx); |
593 configurations_[i].rc_target_bitrate = stream_bitrates[stream_idx]; | 593 configurations_[i].rc_target_bitrate = stream_bitrates[stream_idx]; |
594 temporal_layers_[stream_idx]->ConfigureBitrates( | 594 temporal_layers_[stream_idx]->ConfigureBitrates( |
595 stream_bitrates[stream_idx], inst->maxBitrate, inst->maxFramerate, | 595 stream_bitrates[stream_idx], inst->maxBitrate, inst->maxFramerate, |
596 &configurations_[i]); | 596 &configurations_[i]); |
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 | |
602 // internally. | |
603 // QP thresholds are chosen to be high enough to be hit in practice when | 601 // 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 | 602 // 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 | 603 // (e.g. going up in resolution shouldn't give so bad quality that we should |
606 // go back down). | 604 // go back down). |
607 const int kLowQpThreshold = 29; | 605 const int kLowQpThreshold = 29; |
608 const int kDisabledBadQpThreshold = 100; | 606 const int kBadQpThreshold = 100; |
609 quality_scaler_.Init(kLowQpThreshold, kDisabledBadQpThreshold, false, | 607 quality_scaler_.Init(kLowQpThreshold, kBadQpThreshold, |
610 codec_.startBitrate, codec_.width, codec_.height, | 608 codec_.startBitrate, codec_.width, codec_.height, |
611 codec_.maxFramerate); | 609 codec_.maxFramerate); |
612 | 610 |
613 // Only apply scaling to improve for single-layer streams. The scaling metrics | 611 // Only apply scaling to improve for single-layer streams. The scaling metrics |
614 // use frame drops as a signal and is only applicable when we drop frames. | 612 // use frame drops as a signal and is only applicable when we drop frames. |
615 quality_scaler_enabled_ = encoders_.size() == 1 && | 613 quality_scaler_enabled_ = encoders_.size() == 1 && |
616 configurations_[0].rc_dropframe_thresh > 0 && | 614 configurations_[0].rc_dropframe_thresh > 0 && |
617 codec_.codecSpecific.VP8.automaticResizeOn; | 615 codec_.codecSpecific.VP8.automaticResizeOn; |
618 | 616 |
619 return InitAndSetControlSettings(); | 617 return InitAndSetControlSettings(); |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 return -1; | 1411 return -1; |
1414 } | 1412 } |
1415 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1413 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
1416 VPX_CODEC_OK) { | 1414 VPX_CODEC_OK) { |
1417 return -1; | 1415 return -1; |
1418 } | 1416 } |
1419 return 0; | 1417 return 0; |
1420 } | 1418 } |
1421 | 1419 |
1422 } // namespace webrtc | 1420 } // namespace webrtc |
OLD | NEW |