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

Unified Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c

Issue 2274083002: Replace calls to assert() with RTC_DCHECK_*() in .c code (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 4 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/codecs/isac/fix/source/bandwidth_estimator.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c
index b074962eae81350346e4ed28f0ae08cdb24534a4..fa63b46d2e6b928da386df795358a0293a1fdd3c 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c
@@ -20,9 +20,8 @@
#include "bandwidth_estimator.h"
-#include <assert.h>
#include "settings.h"
-
+#include "webrtc/base/checks.h"
/* array of quantization levels for bottle neck info; Matlab code: */
/* sprintf('%4.1ff, ', logspace(log10(5000), log10(40000), 12)) */
@@ -180,7 +179,7 @@ int32_t WebRtcIsacfix_UpdateUplinkBwImpl(BwEstimatorstr *bweStr,
int16_t errCode;
- assert(!bweStr->external_bw_info.in_use);
+ RTC_DCHECK(!bweStr->external_bw_info.in_use);
/* UPDATE ESTIMATES FROM OTHER SIDE */
@@ -551,7 +550,7 @@ int16_t WebRtcIsacfix_UpdateUplinkBwRec(BwEstimatorstr *bweStr,
{
uint16_t RateInd;
- assert(!bweStr->external_bw_info.in_use);
+ RTC_DCHECK(!bweStr->external_bw_info.in_use);
if ( (Index < 0) || (Index > 23) ) {
return -ISAC_RANGE_ERROR_BW_ESTIMATOR;
@@ -732,7 +731,7 @@ uint16_t WebRtcIsacfix_GetDownlinkBandwidth(const BwEstimatorstr *bweStr)
int32_t rec_jitter_short_term_abs_inv; /* Q18 */
int32_t temp;
- assert(!bweStr->external_bw_info.in_use);
+ RTC_DCHECK(!bweStr->external_bw_info.in_use);
/* Q18 rec jitter short term abs is in Q13, multiply it by 2^13 to save precision
2^18 then needs to be shifted 13 bits to 2^31 */
@@ -790,7 +789,7 @@ int16_t WebRtcIsacfix_GetDownlinkMaxDelay(const BwEstimatorstr *bweStr)
{
int16_t recMaxDelay = (int16_t)(bweStr->recMaxDelay >> 15);
- assert(!bweStr->external_bw_info.in_use);
+ RTC_DCHECK(!bweStr->external_bw_info.in_use);
/* limit range of jitter estimate */
if (recMaxDelay < MIN_ISAC_MD) {
@@ -804,7 +803,7 @@ int16_t WebRtcIsacfix_GetDownlinkMaxDelay(const BwEstimatorstr *bweStr)
/* Clamp val to the closed interval [min,max]. */
static int16_t clamp(int16_t val, int16_t min, int16_t max) {
- assert(min <= max);
+ RTC_DCHECK_LE(min, max);
return val < min ? min : (val > max ? max : val);
}
@@ -822,7 +821,7 @@ int16_t WebRtcIsacfix_GetUplinkMaxDelay(const BwEstimatorstr* bweStr) {
void WebRtcIsacfixBw_GetBandwidthInfo(BwEstimatorstr* bweStr,
IsacBandwidthInfo* bwinfo) {
- assert(!bweStr->external_bw_info.in_use);
+ RTC_DCHECK(!bweStr->external_bw_info.in_use);
bwinfo->in_use = 1;
bwinfo->send_bw_avg = WebRtcIsacfix_GetUplinkBandwidth(bweStr);
bwinfo->send_max_delay_avg = WebRtcIsacfix_GetUplinkMaxDelay(bweStr);

Powered by Google App Engine
This is Rietveld 408576698