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

Unified Diff: webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c

Issue 1179953003: Revert "Upconvert various types to int." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: 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/cng/webrtc_cng.c
diff --git a/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c b/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c
index 32e28591d71e8569dbc737e8181487b0154ebbcf..9862f125371d025538f83a721668ab6e8b158e36 100644
--- a/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c
+++ b/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c
@@ -36,7 +36,7 @@ typedef struct WebRtcCngDecoder_ {
typedef struct WebRtcCngEncoder_ {
int16_t enc_nrOfCoefs;
- int enc_sampfreq;
+ uint16_t enc_sampfreq;
int16_t enc_interval;
int16_t enc_msSinceSID;
int32_t enc_Energy;
@@ -142,8 +142,8 @@ int16_t WebRtcCng_CreateDec(CNG_dec_inst** cng_inst) {
* Return value : 0 - Ok
* -1 - Error
*/
-int WebRtcCng_InitEnc(CNG_enc_inst* cng_inst, int fs, int16_t interval,
- int16_t quality) {
+int16_t WebRtcCng_InitEnc(CNG_enc_inst* cng_inst, uint16_t fs, int16_t interval,
+ int16_t quality) {
int i;
WebRtcCngEncoder* inst = (WebRtcCngEncoder*) cng_inst;
memset(inst, 0, sizeof(WebRtcCngEncoder));
@@ -227,9 +227,9 @@ int16_t WebRtcCng_FreeDec(CNG_dec_inst* cng_inst) {
* Return value : 0 - Ok
* -1 - Error
*/
-int WebRtcCng_Encode(CNG_enc_inst* cng_inst, int16_t* speech,
- int16_t nrOfSamples, uint8_t* SIDdata,
- int16_t* bytesOut, int16_t forceSID) {
+int16_t WebRtcCng_Encode(CNG_enc_inst* cng_inst, int16_t* speech,
+ int16_t nrOfSamples, uint8_t* SIDdata,
+ int16_t* bytesOut, int16_t forceSID) {
WebRtcCngEncoder* inst = (WebRtcCngEncoder*) cng_inst;
int16_t arCoefs[WEBRTC_CNG_MAX_LPC_ORDER + 1];
@@ -388,12 +388,10 @@ int WebRtcCng_Encode(CNG_enc_inst* cng_inst, int16_t* speech,
inst->enc_msSinceSID = 0;
*bytesOut = inst->enc_nrOfCoefs + 1;
- inst->enc_msSinceSID +=
- (int16_t)((1000 * nrOfSamples) / inst->enc_sampfreq);
+ inst->enc_msSinceSID += (1000 * nrOfSamples) / inst->enc_sampfreq;
return inst->enc_nrOfCoefs + 1;
} else {
- inst->enc_msSinceSID +=
- (int16_t)((1000 * nrOfSamples) / inst->enc_sampfreq);
+ inst->enc_msSinceSID += (1000 * nrOfSamples) / inst->enc_sampfreq;
*bytesOut = 0;
return 0;
}
« no previous file with comments | « webrtc/modules/audio_coding/codecs/cng/include/webrtc_cng.h ('k') | webrtc/modules/audio_coding/codecs/g722/g722_interface.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698