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

Unified Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.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/fix/source/isacfix.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
index 9b1927bef900c0adbb221df30afe1e1e492839f3..2441e41ccb49227657b619bade968c014a87f57a 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
@@ -72,10 +72,12 @@ int16_t WebRtcIsacfix_AssignSize(int *sizeinbytes) {
int16_t WebRtcIsacfix_Assign(ISACFIX_MainStruct **inst, void *ISACFIX_inst_Addr) {
if (ISACFIX_inst_Addr!=NULL) {
- *inst = (ISACFIX_MainStruct*)ISACFIX_inst_Addr;
- (*(ISACFIX_SubStruct**)inst)->errorcode = 0;
- (*(ISACFIX_SubStruct**)inst)->initflag = 0;
- (*(ISACFIX_SubStruct**)inst)->ISACenc_obj.SaveEnc_ptr = NULL;
+ ISACFIX_SubStruct* self = ISACFIX_inst_Addr;
+ *inst = (ISACFIX_MainStruct*)self;
+ self->errorcode = 0;
+ self->initflag = 0;
+ self->ISACenc_obj.SaveEnc_ptr = NULL;
+ WebRtcIsacfix_InitBandwidthEstimator(&self->bwestimator_obj);
return(0);
} else {
return(-1);
@@ -108,6 +110,7 @@ int16_t WebRtcIsacfix_Create(ISACFIX_MainStruct **ISAC_main_inst)
(*(ISACFIX_SubStruct**)ISAC_main_inst)->initflag = 0;
(*(ISACFIX_SubStruct**)ISAC_main_inst)->ISACenc_obj.SaveEnc_ptr = NULL;
WebRtcSpl_Init();
+ WebRtcIsacfix_InitBandwidthEstimator(&tempo->bwestimator_obj);
return(0);
} else {
return(-1);
@@ -293,8 +296,6 @@ int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
WebRtcIsacfix_InitPitchFilter(&ISAC_inst->ISACenc_obj.pitchfiltstr_obj);
WebRtcIsacfix_InitPitchAnalysis(&ISAC_inst->ISACenc_obj.pitchanalysisstr_obj);
-
- WebRtcIsacfix_InitBandwidthEstimator(&ISAC_inst->bwestimator_obj);
WebRtcIsacfix_InitRateModel(&ISAC_inst->ISACenc_obj.rate_data_obj);
@@ -1526,3 +1527,17 @@ void WebRtcIsacfix_version(char *version)
{
strcpy(version, "3.6.0");
}
+
+void WebRtcIsacfix_GetBandwidthInfo(ISACFIX_MainStruct* ISAC_main_inst,
+ IsacBandwidthInfo* bwinfo) {
+ ISACFIX_SubStruct* inst = (ISACFIX_SubStruct*)ISAC_main_inst;
+ assert(inst->initflag & 1); // Decoder initialized.
+ WebRtcIsacfixBw_GetBandwidthInfo(&inst->bwestimator_obj, bwinfo);
+}
+
+void WebRtcIsacfix_SetBandwidthInfo(ISACFIX_MainStruct* ISAC_main_inst,
+ const IsacBandwidthInfo* bwinfo) {
+ ISACFIX_SubStruct* inst = (ISACFIX_SubStruct*)ISAC_main_inst;
+ assert(inst->initflag & 2); // Encoder initialized.
+ WebRtcIsacfixBw_SetBandwidthInfo(&inst->bwestimator_obj, bwinfo);
+}

Powered by Google App Engine
This is Rietveld 408576698