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

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

Issue 2833493003: Don't re-randomize picture_id/tl0_pic_idx when re-initializing internal encoders. (Closed)
Patch Set: Change back TimeMills() -> TimeMicros(). Created 3 years, 7 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 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
2 * 2 *
3 * Use of this source code is governed by a BSD-style license 3 * Use of this source code is governed by a BSD-style license
4 * that can be found in the LICENSE file in the root of the source 4 * that can be found in the LICENSE file in the root of the source
5 * tree. An additional intellectual property rights grant can be found 5 * tree. An additional intellectual property rights grant can be found
6 * in the file PATENTS. All contributing project authors may 6 * in the file PATENTS. All contributing project authors may
7 * be found in the AUTHORS file in the root of the source tree. 7 * be found in the AUTHORS file in the root of the source tree.
8 */ 8 */
9 9
10 #include "webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h" 10 #include "webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 last_base_layer_sync_(false) { 187 last_base_layer_sync_(false) {
188 RTC_CHECK_GE(kMaxTemporalStreams, number_of_temporal_layers); 188 RTC_CHECK_GE(kMaxTemporalStreams, number_of_temporal_layers);
189 RTC_CHECK_GE(number_of_temporal_layers, 0); 189 RTC_CHECK_GE(number_of_temporal_layers, 0);
190 RTC_CHECK_LE(number_of_temporal_layers, 4); 190 RTC_CHECK_LE(number_of_temporal_layers, 4);
191 } 191 }
192 192
193 int DefaultTemporalLayers::CurrentLayerId() const { 193 int DefaultTemporalLayers::CurrentLayerId() const {
194 return temporal_ids_[pattern_idx_ % temporal_ids_.size()]; 194 return temporal_ids_[pattern_idx_ % temporal_ids_.size()];
195 } 195 }
196 196
197 uint8_t DefaultTemporalLayers::Tl0PicIdx() const {
198 return tl0_pic_idx_;
199 }
200
197 std::vector<uint32_t> DefaultTemporalLayers::OnRatesUpdated( 201 std::vector<uint32_t> DefaultTemporalLayers::OnRatesUpdated(
198 int bitrate_kbps, 202 int bitrate_kbps,
199 int max_bitrate_kbps, 203 int max_bitrate_kbps,
200 int framerate) { 204 int framerate) {
201 std::vector<uint32_t> bitrates; 205 std::vector<uint32_t> bitrates;
202 for (size_t i = 0; i < num_layers_; ++i) { 206 for (size_t i = 0; i < num_layers_; ++i) {
203 float layer_bitrate = 207 float layer_bitrate =
204 bitrate_kbps * kVp8LayerRateAlloction[num_layers_ - 1][i]; 208 bitrate_kbps * kVp8LayerRateAlloction[num_layers_ - 1][i];
205 bitrates.push_back(static_cast<uint32_t>(layer_bitrate + 0.5)); 209 bitrates.push_back(static_cast<uint32_t>(layer_bitrate + 0.5));
206 } 210 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 if (listener_) 300 if (listener_)
297 listener_->OnTemporalLayersCreated(simulcast_id, tl); 301 listener_->OnTemporalLayersCreated(simulcast_id, tl);
298 return tl; 302 return tl;
299 } 303 }
300 304
301 void TemporalLayersFactory::SetListener(TemporalLayersListener* listener) { 305 void TemporalLayersFactory::SetListener(TemporalLayersListener* listener) {
302 listener_ = listener; 306 listener_ = listener;
303 } 307 }
304 308
305 } // namespace webrtc 309 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698