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

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

Issue 1208923002: iSAC: Functions for importing and exporting bandwidth est. info (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: review comments Created 5 years, 6 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/main/source/isac.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
index d278c7fd8bc50a21867a62e00da2981e2a0b22ed..a19fd01167c26e24b445b6d56e7f3021b3612d88 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
+++ b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
@@ -17,6 +17,7 @@
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
+#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -113,9 +114,8 @@ static void UpdateBottleneck(ISACMainStruct* instISAC) {
if ((instISAC->codingMode == 0) &&
(instISAC->instLB.ISACencLB_obj.buffer_index == 0) &&
(instISAC->instLB.ISACencLB_obj.frame_nb == 0)) {
- int32_t bottleneck;
- WebRtcIsac_GetUplinkBandwidth(&(instISAC->bwestimator_obj),
- &bottleneck);
+ int32_t bottleneck =
+ WebRtcIsac_GetUplinkBandwidth(&instISAC->bwestimator_obj);
/* Adding hysteresis when increasing signal bandwidth. */
if ((instISAC->bandwidthKHz == isac8kHz)
@@ -670,7 +670,7 @@ int WebRtcIsac_Encode(ISACStruct* ISAC_main_inst,
}
/* Add Garbage if required. */
- WebRtcIsac_GetUplinkBandwidth(&instISAC->bwestimator_obj, &bottleneck);
+ bottleneck = WebRtcIsac_GetUplinkBandwidth(&instISAC->bwestimator_obj);
if (instISAC->codingMode == 0) {
int minBytes;
int limit;
@@ -2384,3 +2384,18 @@ uint16_t WebRtcIsac_DecSampRate(ISACStruct* ISAC_main_inst) {
ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
return instISAC->decoderSamplingRateKHz == kIsacWideband ? 16000 : 32000;
}
+
+void WebRtcIsac_GetBandwidthInfo(ISACStruct* inst,
+ IsacBandwidthInfo* bwinfo) {
+ ISACMainStruct* instISAC = (ISACMainStruct*)inst;
+ assert(instISAC->initFlag & BIT_MASK_DEC_INIT);
+ WebRtcIsacBw_GetBandwidthInfo(&instISAC->bwestimator_obj,
+ instISAC->decoderSamplingRateKHz, bwinfo);
+}
+
+void WebRtcIsac_SetBandwidthInfo(ISACStruct* inst,
+ const IsacBandwidthInfo* bwinfo) {
+ ISACMainStruct* instISAC = (ISACMainStruct*)inst;
+ assert(instISAC->initFlag & BIT_MASK_ENC_INIT);
+ WebRtcIsacBw_SetBandwidthInfo(&instISAC->bwestimator_obj, bwinfo);
+}

Powered by Google App Engine
This is Rietveld 408576698