diff options
Diffstat (limited to 'webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c')
-rw-r--r-- | webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c b/webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c index 82fd053..486cd95 100644 --- a/webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c +++ b/webrtc/modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.c @@ -16,14 +16,14 @@ * */ -#include "bandwidth_estimator.h" -#include "settings.h" -#include "webrtc/modules/audio_coding/codecs/isac/main/include/isac.h" - -#include <assert.h> #include <math.h> #include <string.h> +#include "modules/audio_coding/codecs/isac/main/source/bandwidth_estimator.h" +#include "modules/audio_coding/codecs/isac/main/source/settings.h" +#include "modules/audio_coding/codecs/isac/main/include/isac.h" +#include "rtc_base/checks.h" + /* array of quantization levels for bottle neck info; Matlab code: */ /* sprintf('%4.1ff, ', logspace(log10(5000), log10(40000), 12)) */ static const float kQRateTableWb[12] = @@ -159,7 +159,7 @@ int16_t WebRtcIsac_UpdateBandwidthEstimator( int immediate_set = 0; int num_pkts_expected; - assert(!bwest_str->external_bw_info.in_use); + RTC_DCHECK(!bwest_str->external_bw_info.in_use); // We have to adjust the header-rate if the first packet has a // frame-size different than the initialized value. @@ -514,7 +514,7 @@ int16_t WebRtcIsac_UpdateUplinkBwImpl( int16_t index, enum IsacSamplingRate encoderSamplingFreq) { - assert(!bwest_str->external_bw_info.in_use); + RTC_DCHECK(!bwest_str->external_bw_info.in_use); if((index < 0) || (index > 23)) { @@ -572,7 +572,7 @@ int16_t WebRtcIsac_UpdateUplinkJitter( BwEstimatorstr* bwest_str, int32_t index) { - assert(!bwest_str->external_bw_info.in_use); + RTC_DCHECK(!bwest_str->external_bw_info.in_use); if((index < 0) || (index > 23)) { @@ -711,7 +711,7 @@ int32_t WebRtcIsac_GetDownlinkBandwidth( const BwEstimatorstr *bwest_str) float jitter_sign; float bw_adjust; - assert(!bwest_str->external_bw_info.in_use); + RTC_DCHECK(!bwest_str->external_bw_info.in_use); /* create a value between -1.0 and 1.0 indicating "average sign" of jitter */ jitter_sign = bwest_str->rec_jitter_short_term / @@ -741,7 +741,7 @@ WebRtcIsac_GetDownlinkMaxDelay(const BwEstimatorstr *bwest_str) { int32_t rec_max_delay; - assert(!bwest_str->external_bw_info.in_use); + RTC_DCHECK(!bwest_str->external_bw_info.in_use); rec_max_delay = (int32_t)(bwest_str->rec_max_delay); @@ -759,7 +759,7 @@ WebRtcIsac_GetDownlinkMaxDelay(const BwEstimatorstr *bwest_str) /* Clamp val to the closed interval [min,max]. */ static int32_t clamp(int32_t val, int32_t min, int32_t max) { - assert(min <= max); + RTC_DCHECK_LE(min, max); return val < min ? min : (val > max ? max : val); } @@ -775,24 +775,6 @@ int32_t WebRtcIsac_GetUplinkMaxDelay(const BwEstimatorstr* bwest_str) { : clamp(bwest_str->send_max_delay_avg, MIN_ISAC_MD, MAX_ISAC_MD); } -void WebRtcIsacBw_GetBandwidthInfo(BwEstimatorstr* bwest_str, - enum IsacSamplingRate decoder_sample_rate_hz, - IsacBandwidthInfo* bwinfo) { - assert(!bwest_str->external_bw_info.in_use); - bwinfo->in_use = 1; - bwinfo->send_bw_avg = WebRtcIsac_GetUplinkBandwidth(bwest_str); - bwinfo->send_max_delay_avg = WebRtcIsac_GetUplinkMaxDelay(bwest_str); - WebRtcIsac_GetDownlinkBwJitIndexImpl(bwest_str, &bwinfo->bottleneck_idx, - &bwinfo->jitter_info, - decoder_sample_rate_hz); -} - -void WebRtcIsacBw_SetBandwidthInfo(BwEstimatorstr* bwest_str, - const IsacBandwidthInfo* bwinfo) { - memcpy(&bwest_str->external_bw_info, bwinfo, - sizeof bwest_str->external_bw_info); -} - /* * update long-term average bitrate and amount of data in buffer * returns minimum payload size (bytes) |