Rename _t struct types in audio_coding.

_t names are reserved in POSIX.

R=henrik.lundin@webrtc.org
BUG=162

Review URL: https://webrtc-codereview.appspot.com/34509004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7933 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2014-12-17 15:23:29 +00:00
parent 209df9bf77
commit eb544460e4
51 changed files with 187 additions and 184 deletions

View File

@ -28,7 +28,7 @@ int16_t WebRtcIlbcfix_EncoderAssign(IlbcEncoderInstance** iLBC_encinst,
int16_t* ILBCENC_inst_Addr,
int16_t* size) {
*iLBC_encinst=(IlbcEncoderInstance*)ILBCENC_inst_Addr;
*size=sizeof(iLBC_Enc_Inst_t)/sizeof(int16_t);
*size=sizeof(IlbcEncoder)/sizeof(int16_t);
if (*iLBC_encinst!=NULL) {
return(0);
} else {
@ -40,7 +40,7 @@ int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance** iLBC_decinst,
int16_t* ILBCDEC_inst_Addr,
int16_t* size) {
*iLBC_decinst=(IlbcDecoderInstance*)ILBCDEC_inst_Addr;
*size=sizeof(iLBC_Dec_Inst_t)/sizeof(int16_t);
*size=sizeof(IlbcDecoder)/sizeof(int16_t);
if (*iLBC_decinst!=NULL) {
return(0);
} else {
@ -49,7 +49,7 @@ int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance** iLBC_decinst,
}
int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) {
*iLBC_encinst=(IlbcEncoderInstance*)malloc(sizeof(iLBC_Enc_Inst_t));
*iLBC_encinst=(IlbcEncoderInstance*)malloc(sizeof(IlbcEncoder));
if (*iLBC_encinst!=NULL) {
WebRtcSpl_Init();
return(0);
@ -59,7 +59,7 @@ int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) {
}
int16_t WebRtcIlbcfix_DecoderCreate(IlbcDecoderInstance **iLBC_decinst) {
*iLBC_decinst=(IlbcDecoderInstance*)malloc(sizeof(iLBC_Dec_Inst_t));
*iLBC_decinst=(IlbcDecoderInstance*)malloc(sizeof(IlbcDecoder));
if (*iLBC_decinst!=NULL) {
WebRtcSpl_Init();
return(0);
@ -81,7 +81,7 @@ int16_t WebRtcIlbcfix_DecoderFree(IlbcDecoderInstance *iLBC_decinst) {
int16_t WebRtcIlbcfix_EncoderInit(IlbcEncoderInstance* iLBCenc_inst,
int16_t mode) {
if ((mode==20)||(mode==30)) {
WebRtcIlbcfix_InitEncode((iLBC_Enc_Inst_t*) iLBCenc_inst, mode);
WebRtcIlbcfix_InitEncode((IlbcEncoder*) iLBCenc_inst, mode);
return(0);
} else {
return(-1);
@ -95,12 +95,12 @@ int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
int16_t pos = 0;
int16_t encpos = 0;
if ((len != ((iLBC_Enc_Inst_t*)iLBCenc_inst)->blockl) &&
if ((len != ((IlbcEncoder*)iLBCenc_inst)->blockl) &&
#ifdef SPLIT_10MS
(len != 80) &&
#endif
(len != 2*((iLBC_Enc_Inst_t*)iLBCenc_inst)->blockl) &&
(len != 3*((iLBC_Enc_Inst_t*)iLBCenc_inst)->blockl))
(len != 2*((IlbcEncoder*)iLBCenc_inst)->blockl) &&
(len != 3*((IlbcEncoder*)iLBCenc_inst)->blockl))
{
/* A maximum of 3 frames/packet is allowed */
return(-1);
@ -109,14 +109,14 @@ int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
/* call encoder */
while (pos<len) {
WebRtcIlbcfix_EncodeImpl((uint16_t*)&encoded[2 * encpos], &speechIn[pos],
(iLBC_Enc_Inst_t*)iLBCenc_inst);
(IlbcEncoder*)iLBCenc_inst);
#ifdef SPLIT_10MS
pos += 80;
if(((iLBC_Enc_Inst_t*)iLBCenc_inst)->section == 0)
if(((IlbcEncoder*)iLBCenc_inst)->section == 0)
#else
pos += ((iLBC_Enc_Inst_t*)iLBCenc_inst)->blockl;
pos += ((IlbcEncoder*)iLBCenc_inst)->blockl;
#endif
encpos += ((iLBC_Enc_Inst_t*)iLBCenc_inst)->no_of_words;
encpos += ((IlbcEncoder*)iLBCenc_inst)->no_of_words;
}
return (encpos*2);
}
@ -125,18 +125,18 @@ int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
int16_t WebRtcIlbcfix_DecoderInit(IlbcDecoderInstance* iLBCdec_inst,
int16_t mode) {
if ((mode==20)||(mode==30)) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, mode, 1);
WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, mode, 1);
return(0);
} else {
return(-1);
}
}
int16_t WebRtcIlbcfix_DecoderInit20Ms(IlbcDecoderInstance *iLBCdec_inst) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 20, 1);
WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, 20, 1);
return(0);
}
int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst) {
WebRtcIlbcfix_InitDecode((iLBC_Dec_Inst_t*) iLBCdec_inst, 30, 1);
WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, 30, 1);
return(0);
}
@ -150,19 +150,19 @@ int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst,
int i=0;
/* Allow for automatic switching between the frame sizes
(although you do get some discontinuity) */
if ((len==((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==2*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==3*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)) {
if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) {
/* ok, do nothing */
} else {
/* Test if the mode has changed */
if (((iLBC_Dec_Inst_t*)iLBCdec_inst)->mode==20) {
if (((IlbcDecoder*)iLBCdec_inst)->mode==20) {
if ((len==NO_OF_BYTES_30MS)||
(len==2*NO_OF_BYTES_30MS)||
(len==3*NO_OF_BYTES_30MS)) {
WebRtcIlbcfix_InitDecode(
((iLBC_Dec_Inst_t*)iLBCdec_inst), 30,
((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer);
((IlbcDecoder*)iLBCdec_inst), 30,
((IlbcDecoder*)iLBCdec_inst)->use_enhancer);
} else {
/* Unsupported frame length */
return(-1);
@ -172,8 +172,8 @@ int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst,
(len==2*NO_OF_BYTES_20MS)||
(len==3*NO_OF_BYTES_20MS)) {
WebRtcIlbcfix_InitDecode(
((iLBC_Dec_Inst_t*)iLBCdec_inst), 20,
((iLBC_Dec_Inst_t*)iLBCdec_inst)->use_enhancer);
((IlbcDecoder*)iLBCdec_inst), 20,
((IlbcDecoder*)iLBCdec_inst)->use_enhancer);
} else {
/* Unsupported frame length */
return(-1);
@ -181,17 +181,17 @@ int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst,
}
}
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
&decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
[i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words],
(IlbcDecoder*)iLBCdec_inst, 1);
i++;
}
/* iLBC does not support VAD/CNG yet */
*speechType=1;
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
return(i*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst,
@ -201,25 +201,25 @@ int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst,
int16_t *speechType)
{
int i=0;
if ((len==((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==2*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==3*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)) {
if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) {
/* ok, do nothing */
} else {
return(-1);
}
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
&decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
[i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words],
(IlbcDecoder*)iLBCdec_inst, 1);
i++;
}
/* iLBC does not support VAD/CNG yet */
*speechType=1;
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
return(i*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst,
@ -229,25 +229,25 @@ int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst,
int16_t *speechType)
{
int i=0;
if ((len==((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==2*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)||
(len==3*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)) {
if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
(len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) {
/* ok, do nothing */
} else {
return(-1);
}
while ((i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_bytes)<len) {
while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) {
WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl],
&decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl],
(const uint16_t*)&encoded
[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->no_of_words],
(iLBC_Dec_Inst_t*)iLBCdec_inst, 1);
[i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words],
(IlbcDecoder*)iLBCdec_inst, 1);
i++;
}
/* iLBC does not support VAD/CNG yet */
*speechType=1;
return(i*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
return(i*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance* iLBCdec_inst,
@ -259,10 +259,10 @@ int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance* iLBCdec_inst,
for (i=0;i<noOfLostFrames;i++) {
/* call decoder */
WebRtcIlbcfix_DecodeImpl(
&decoded[i * ((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl], &dummy,
(iLBC_Dec_Inst_t*)iLBCdec_inst, 0);
&decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], &dummy,
(IlbcDecoder*)iLBCdec_inst, 0);
}
return (noOfLostFrames*((iLBC_Dec_Inst_t*)iLBCdec_inst)->blockl);
return (noOfLostFrames*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance* iLBCdec_inst,
@ -272,8 +272,8 @@ int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance* iLBCdec_inst,
(void)(decoded = NULL);
(void)(noOfLostFrames = 0);
WebRtcSpl_MemSetW16(((iLBC_Dec_Inst_t*)iLBCdec_inst)->enh_buf, 0, ENH_BUFL);
((iLBC_Dec_Inst_t*)iLBCdec_inst)->prev_enh_pl = 2;
WebRtcSpl_MemSetW16(((IlbcDecoder*)iLBCdec_inst)->enh_buf, 0, ENH_BUFL);
((IlbcDecoder*)iLBCdec_inst)->prev_enh_pl = 2;
return (0);
}