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

Side by Side Diff: webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.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 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 18 matching lines...) Expand all
29 29
30 class MockTemporalLayers : public TemporalLayers { 30 class MockTemporalLayers : public TemporalLayers {
31 public: 31 public:
32 MOCK_METHOD1(UpdateLayerConfig, TemporalReferences(uint32_t)); 32 MOCK_METHOD1(UpdateLayerConfig, TemporalReferences(uint32_t));
33 MOCK_METHOD3(OnRatesUpdated, std::vector<uint32_t>(int, int, int)); 33 MOCK_METHOD3(OnRatesUpdated, std::vector<uint32_t>(int, int, int));
34 MOCK_METHOD1(UpdateConfiguration, bool(vpx_codec_enc_cfg_t*)); 34 MOCK_METHOD1(UpdateConfiguration, bool(vpx_codec_enc_cfg_t*));
35 MOCK_METHOD3(PopulateCodecSpecific, 35 MOCK_METHOD3(PopulateCodecSpecific,
36 void(bool, CodecSpecificInfoVP8*, uint32_t)); 36 void(bool, CodecSpecificInfoVP8*, uint32_t));
37 MOCK_METHOD2(FrameEncoded, void(unsigned int, int)); 37 MOCK_METHOD2(FrameEncoded, void(unsigned int, int));
38 MOCK_CONST_METHOD0(CurrentLayerId, int()); 38 MOCK_CONST_METHOD0(CurrentLayerId, int());
39 MOCK_CONST_METHOD0(Tl0PicIdx, uint8_t());
39 }; 40 };
40 } // namespace 41 } // namespace
41 42
42 class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> { 43 class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> {
43 public: 44 public:
44 SimulcastRateAllocatorTest() { 45 SimulcastRateAllocatorTest() {
45 memset(&codec_, 0, sizeof(VideoCodec)); 46 memset(&codec_, 0, sizeof(VideoCodec));
46 codec_.minBitrate = kMinBitrateKbps; 47 codec_.minBitrate = kMinBitrateKbps;
47 codec_.targetBitrate = kTargetBitrateKbps; 48 codec_.targetBitrate = kTargetBitrateKbps;
48 codec_.maxBitrate = kMaxBitrateKbps; 49 codec_.maxBitrate = kMaxBitrateKbps;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 allocator_->GetAllocation(kMaxBitrateKbps * 2000, kFramerateFps); 363 allocator_->GetAllocation(kMaxBitrateKbps * 2000, kFramerateFps);
363 364
364 // Fill both TL0 and TL1, but no more. 365 // Fill both TL0 and TL1, but no more.
365 EXPECT_EQ(kMaxBitrateKbps, allocation.get_sum_kbps()); 366 EXPECT_EQ(kMaxBitrateKbps, allocation.get_sum_kbps());
366 EXPECT_EQ(kTargetBitrateKbps, allocation.GetBitrate(0, 0) / 1000); 367 EXPECT_EQ(kTargetBitrateKbps, allocation.GetBitrate(0, 0) / 1000);
367 EXPECT_EQ(kMaxBitrateKbps - kTargetBitrateKbps, 368 EXPECT_EQ(kMaxBitrateKbps - kTargetBitrateKbps,
368 allocation.GetBitrate(0, 1) / 1000); 369 allocation.GetBitrate(0, 1) / 1000);
369 } 370 }
370 371
371 } // namespace webrtc 372 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc ('k') | webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698