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 |
11 #include "webrtc/modules/video_coding/codecs/vp8/vp8_impl.h" | 11 #include "webrtc/modules/video_coding/codecs/vp8/vp8_impl.h" |
12 | 12 |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 #include <string.h> | 14 #include <string.h> |
15 #include <time.h> | 15 #include <time.h> |
16 #include <algorithm> | 16 #include <algorithm> |
17 | 17 |
18 // NOTE(ajm): Path provided by gyp. | 18 // NOTE(ajm): Path provided by gyp. |
19 #include "libyuv/scale.h" // NOLINT | 19 #include "libyuv/scale.h" // NOLINT |
20 #include "libyuv/convert.h" // NOLINT | 20 #include "libyuv/convert.h" // NOLINT |
21 | 21 |
22 #include "webrtc/base/checks.h" | 22 #include "webrtc/base/checks.h" |
23 #include "webrtc/base/timeutils.h" | |
23 #include "webrtc/base/trace_event.h" | 24 #include "webrtc/base/trace_event.h" |
24 #include "webrtc/common_types.h" | 25 #include "webrtc/common_types.h" |
25 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 26 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
26 #include "webrtc/modules/include/module_common_types.h" | 27 #include "webrtc/modules/include/module_common_types.h" |
27 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 28 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
28 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" | 29 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" |
29 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" | 30 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" |
30 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" | 31 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" |
31 #include "webrtc/system_wrappers/include/clock.h" | 32 #include "webrtc/system_wrappers/include/clock.h" |
32 #include "webrtc/system_wrappers/include/tick_util.h" | |
33 | 33 |
34 namespace webrtc { | 34 namespace webrtc { |
35 namespace { | 35 namespace { |
36 | 36 |
37 enum { kVp8ErrorPropagationTh = 30 }; | 37 enum { kVp8ErrorPropagationTh = 30 }; |
38 enum { kVp832ByteAlign = 32 }; | 38 enum { kVp832ByteAlign = 32 }; |
39 | 39 |
40 // VP8 denoiser states. | 40 // VP8 denoiser states. |
41 enum denoiserState { | 41 enum denoiserState { |
42 kDenoiserOff, | 42 kDenoiserOff, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 qp_max_(56), // Setting for max quantizer. | 159 qp_max_(56), // Setting for max quantizer. |
160 cpu_speed_default_(-6), | 160 cpu_speed_default_(-6), |
161 rc_max_intra_target_(0), | 161 rc_max_intra_target_(0), |
162 token_partitions_(VP8_ONE_TOKENPARTITION), | 162 token_partitions_(VP8_ONE_TOKENPARTITION), |
163 down_scale_requested_(false), | 163 down_scale_requested_(false), |
164 down_scale_bitrate_(0), | 164 down_scale_bitrate_(0), |
165 tl0_frame_dropper_(), | 165 tl0_frame_dropper_(), |
166 tl1_frame_dropper_(kTl1MaxTimeToDropFrames), | 166 tl1_frame_dropper_(kTl1MaxTimeToDropFrames), |
167 key_frame_request_(kMaxSimulcastStreams, false), | 167 key_frame_request_(kMaxSimulcastStreams, false), |
168 quality_scaler_enabled_(false) { | 168 quality_scaler_enabled_(false) { |
169 uint32_t seed = static_cast<uint32_t>(TickTime::MillisecondTimestamp()); | 169 uint32_t seed = rtc::Time32(); |
stefan-webrtc
2016/04/19 09:19:12
Not a big fan of the function name Time32 as it do
nisse-webrtc
2016/04/19 12:19:25
Do you have any concrete suggestion on what to do
stefan-webrtc
2016/04/19 12:40:47
Maybe a templated method which returns time in mil
nisse-webrtc
2016/04/19 13:48:51
No templates just for this, please. Casting the re
| |
170 srand(seed); | 170 srand(seed); |
171 | 171 |
172 picture_id_.reserve(kMaxSimulcastStreams); | 172 picture_id_.reserve(kMaxSimulcastStreams); |
173 last_key_frame_picture_id_.reserve(kMaxSimulcastStreams); | 173 last_key_frame_picture_id_.reserve(kMaxSimulcastStreams); |
174 temporal_layers_.reserve(kMaxSimulcastStreams); | 174 temporal_layers_.reserve(kMaxSimulcastStreams); |
175 raw_images_.reserve(kMaxSimulcastStreams); | 175 raw_images_.reserve(kMaxSimulcastStreams); |
176 encoded_images_.reserve(kMaxSimulcastStreams); | 176 encoded_images_.reserve(kMaxSimulcastStreams); |
177 send_stream_.reserve(kMaxSimulcastStreams); | 177 send_stream_.reserve(kMaxSimulcastStreams); |
178 cpu_speed_.assign(kMaxSimulcastStreams, -6); // Set default to -6. | 178 cpu_speed_.assign(kMaxSimulcastStreams, -6); // Set default to -6. |
179 encoders_.reserve(kMaxSimulcastStreams); | 179 encoders_.reserve(kMaxSimulcastStreams); |
(...skipping 1229 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 |