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

Unified Diff: webrtc/modules/audio_coding/neteq/expand.cc

Issue 2714063002: Introduce dchecked_cast, and start using it (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/expand.cc
diff --git a/webrtc/modules/audio_coding/neteq/expand.cc b/webrtc/modules/audio_coding/neteq/expand.cc
index 2154bfde637179f522f3f2d44c30b97ac244ad82..0c527fe041de64a7a58541582ea562f915bbaf61 100644
--- a/webrtc/modules/audio_coding/neteq/expand.cc
+++ b/webrtc/modules/audio_coding/neteq/expand.cc
@@ -222,7 +222,7 @@ int Expand::Process(AudioMultiVector* output) {
// >= 64 * fs_mult => go from 1 to 0 in about 32 ms.
// temp_shift = getbits(max_lag_) - 5.
int temp_shift =
- (31 - WebRtcSpl_NormW32(rtc::checked_cast<int32_t>(max_lag_))) - 5;
+ (31 - WebRtcSpl_NormW32(rtc::dchecked_cast<int32_t>(max_lag_))) - 5;
int16_t mix_factor_increment = 256 >> temp_shift;
if (stop_muting_) {
mix_factor_increment = 0;
@@ -315,8 +315,8 @@ int Expand::Process(AudioMultiVector* output) {
kMaxConsecutiveExpands : consecutive_expands_ + 1;
expand_duration_samples_ += output->Size();
// Clamp the duration counter at 2 seconds.
- expand_duration_samples_ =
- std::min(expand_duration_samples_, rtc::checked_cast<size_t>(fs_hz_ * 2));
+ expand_duration_samples_ = std::min(expand_duration_samples_,
+ rtc::dchecked_cast<size_t>(fs_hz_ * 2));
return 0;
}
@@ -325,7 +325,7 @@ void Expand::SetParametersForNormalAfterExpand() {
lag_index_direction_ = 0;
stop_muting_ = true; // Do not mute signal any more.
statistics_->LogDelayedPacketOutageEvent(
- rtc::checked_cast<int>(expand_duration_samples_) / (fs_hz_ / 1000));
+ rtc::dchecked_cast<int>(expand_duration_samples_) / (fs_hz_ / 1000));
}
void Expand::SetParametersForMergeAfterExpand() {

Powered by Google App Engine
This is Rietveld 408576698