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

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

Issue 2309743002: Move the QP scaling thresholds to the relevant encoders (Closed)
Patch Set: Remove redundant call Created 4 years, 2 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 inst->simulcastStream[stream_idx].height, kVp832ByteAlign); 555 inst->simulcastStream[stream_idx].height, kVp832ByteAlign);
556 SetStreamState(stream_bitrates[stream_idx] > 0, stream_idx); 556 SetStreamState(stream_bitrates[stream_idx] > 0, stream_idx);
557 configurations_[i].rc_target_bitrate = stream_bitrates[stream_idx]; 557 configurations_[i].rc_target_bitrate = stream_bitrates[stream_idx];
558 temporal_layers_[stream_idx]->ConfigureBitrates( 558 temporal_layers_[stream_idx]->ConfigureBitrates(
559 stream_bitrates[stream_idx], inst->maxBitrate, inst->maxFramerate, 559 stream_bitrates[stream_idx], inst->maxBitrate, inst->maxFramerate,
560 &configurations_[i]); 560 &configurations_[i]);
561 } 561 }
562 } 562 }
563 563
564 rps_.Init(); 564 rps_.Init();
565 quality_scaler_.Init(QualityScaler::kLowVp8QpThreshold, 565 quality_scaler_.Init(codec_.codecType, codec_.startBitrate, codec_.width,
566 QualityScaler::kBadVp8QpThreshold, codec_.startBitrate, 566 codec_.height, codec_.maxFramerate);
567 codec_.width, codec_.height, codec_.maxFramerate);
568 567
569 // Only apply scaling to improve for single-layer streams. The scaling metrics 568 // Only apply scaling to improve for single-layer streams. The scaling metrics
570 // use frame drops as a signal and is only applicable when we drop frames. 569 // use frame drops as a signal and is only applicable when we drop frames.
571 quality_scaler_enabled_ = encoders_.size() == 1 && 570 quality_scaler_enabled_ = encoders_.size() == 1 &&
572 configurations_[0].rc_dropframe_thresh > 0 && 571 configurations_[0].rc_dropframe_thresh > 0 &&
573 codec_.codecSpecific.VP8.automaticResizeOn; 572 codec_.codecSpecific.VP8.automaticResizeOn;
574 573
575 return InitAndSetControlSettings(); 574 return InitAndSetControlSettings();
576 } 575 }
577 576
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 return -1; 1363 return -1;
1365 } 1364 }
1366 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != 1365 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) !=
1367 VPX_CODEC_OK) { 1366 VPX_CODEC_OK) {
1368 return -1; 1367 return -1;
1369 } 1368 }
1370 return 0; 1369 return 0;
1371 } 1370 }
1372 1371
1373 } // namespace webrtc 1372 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698