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:
@ -27,7 +27,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_AbsQuant(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) Encoder instance */
|
||||
iLBC_bits *iLBC_encbits, /* (i/o) Encoded bits (outputs idxForMax
|
||||
and idxVec, uses state_first as
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_AbsQuant(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) Encoder instance */
|
||||
iLBC_bits *iLBC_encbits, /* (i/o) Encoded bits (outputs idxForMax
|
||||
and idxVec, uses state_first as
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_CbSearch(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) the encoder state structure */
|
||||
int16_t *index, /* (o) Codebook indices */
|
||||
int16_t *gain_index, /* (o) Gain quantization indices */
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_MAIN_SOURCE_CB_SEARCH_H_
|
||||
|
||||
void WebRtcIlbcfix_CbSearch(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) the encoder state structure */
|
||||
int16_t *index, /* (o) Codebook indices */
|
||||
int16_t *gain_index, /* (o) Gain quantization indices */
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
void WebRtcIlbcfix_DecodeImpl(
|
||||
int16_t *decblock, /* (o) decoded signal block */
|
||||
const uint16_t *bytes, /* (i) encoded signal bits */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
|
||||
IlbcDecoder *iLBCdec_inst, /* (i/o) the decoder state
|
||||
structure */
|
||||
int16_t mode /* (i) 0: bad packet, PLC,
|
||||
1: normal */
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
void WebRtcIlbcfix_DecodeImpl(
|
||||
int16_t *decblock, /* (o) decoded signal block */
|
||||
const uint16_t *bytes, /* (i) encoded signal bits */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
|
||||
IlbcDecoder *iLBCdec_inst, /* (i/o) the decoder state
|
||||
structure */
|
||||
int16_t mode /* (i) 0: bad packet, PLC,
|
||||
1: normal */
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_DecodeResidual(
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst,
|
||||
IlbcDecoder *iLBCdec_inst,
|
||||
/* (i/o) the decoder state structure */
|
||||
iLBC_bits *iLBC_encbits, /* (i/o) Encoded bits, which are used
|
||||
for the decoding */
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_DecodeResidual(
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst,
|
||||
IlbcDecoder *iLBCdec_inst,
|
||||
/* (i/o) the decoder state structure */
|
||||
iLBC_bits *iLBC_encbits, /* (i/o) Encoded bits, which are used
|
||||
for the decoding */
|
||||
|
||||
@ -31,7 +31,7 @@ void WebRtcIlbcfix_DecoderInterpolateLsp(
|
||||
coefficients */
|
||||
int16_t *lsfdeq, /* (i) dequantized lsf coefficients */
|
||||
int16_t length, /* (i) length of lsf coefficient vector */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst
|
||||
IlbcDecoder *iLBCdec_inst
|
||||
/* (i) the decoder state structure */
|
||||
){
|
||||
int i, pos, lp_length;
|
||||
|
||||
@ -31,7 +31,7 @@ void WebRtcIlbcfix_DecoderInterpolateLsp(
|
||||
coefficients */
|
||||
int16_t *lsfdeq, /* (i) dequantized lsf coefficients */
|
||||
int16_t length, /* (i) length of lsf coefficient vector */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst
|
||||
IlbcDecoder *iLBCdec_inst
|
||||
/* (i) the decoder state structure */
|
||||
);
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ typedef struct iLBC_bits_t_ {
|
||||
} iLBC_bits;
|
||||
|
||||
/* type definition encoder instance */
|
||||
typedef struct iLBC_Enc_Inst_t_ {
|
||||
typedef struct IlbcEncoder_ {
|
||||
|
||||
/* flag for frame size mode */
|
||||
int16_t mode;
|
||||
@ -167,10 +167,10 @@ typedef struct iLBC_Enc_Inst_t_ {
|
||||
int16_t diff;
|
||||
#endif
|
||||
|
||||
} iLBC_Enc_Inst_t;
|
||||
} IlbcEncoder;
|
||||
|
||||
/* type definition decoder instance */
|
||||
typedef struct iLBC_Dec_Inst_t_ {
|
||||
typedef struct IlbcDecoder_ {
|
||||
|
||||
/* flag for frame size mode */
|
||||
int16_t mode;
|
||||
@ -214,6 +214,6 @@ typedef struct iLBC_Dec_Inst_t_ {
|
||||
int16_t enh_buf[ENH_BUFL+ENH_BUFL_FILTEROVERHEAD];
|
||||
int16_t enh_period[ENH_NBLOCKS_TOT];
|
||||
|
||||
} iLBC_Dec_Inst_t;
|
||||
} IlbcDecoder;
|
||||
|
||||
#endif
|
||||
|
||||
@ -34,7 +34,7 @@ void WebRtcIlbcfix_DoThePlc(
|
||||
int16_t *decresidual, /* (i) decoded residual */
|
||||
int16_t *lpc, /* (i) decoded LPC (only used for no PL) */
|
||||
int16_t inlag, /* (i) pitch lag */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst
|
||||
IlbcDecoder *iLBCdec_inst
|
||||
/* (i/o) decoder instance */
|
||||
){
|
||||
int16_t i, pick;
|
||||
|
||||
@ -34,7 +34,7 @@ void WebRtcIlbcfix_DoThePlc(
|
||||
int16_t *decresidual, /* (i) decoded residual */
|
||||
int16_t *lpc, /* (i) decoded LPC (only used for no PL) */
|
||||
int16_t inlag, /* (i) pitch lag */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst
|
||||
IlbcDecoder *iLBCdec_inst
|
||||
/* (i/o) decoder instance */
|
||||
);
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
void WebRtcIlbcfix_EncodeImpl(
|
||||
uint16_t *bytes, /* (o) encoded data bits iLBC */
|
||||
const int16_t *block, /* (i) speech vector to encode */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
|
||||
IlbcEncoder *iLBCenc_inst /* (i/o) the general encoder
|
||||
state */
|
||||
){
|
||||
int n, meml_gotten, Nfor, Nback;
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
void WebRtcIlbcfix_EncodeImpl(
|
||||
uint16_t *bytes, /* (o) encoded data bits iLBC */
|
||||
const int16_t *block, /* (i) speech vector to encode */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
|
||||
IlbcEncoder *iLBCenc_inst /* (i/o) the general encoder
|
||||
state */
|
||||
);
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
|
||||
int16_t *out, /* (o) enhanced signal */
|
||||
int16_t *in, /* (i) unenhanced signal */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst /* (i) buffers etc */
|
||||
IlbcDecoder *iLBCdec_inst /* (i) buffers etc */
|
||||
){
|
||||
int iblock;
|
||||
int lag=20, tlag=20;
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
|
||||
int16_t *out, /* (o) enhanced signal */
|
||||
int16_t *in, /* (i) unenhanced signal */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst /* (i) buffers etc */
|
||||
IlbcDecoder *iLBCdec_inst /* (i) buffers etc */
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
int16_t WebRtcIlbcfix_FrameClassify(
|
||||
/* (o) Index to the max-energy sub frame */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i/o) the encoder state structure */
|
||||
int16_t *residualFIX /* (i) lpc residual signal */
|
||||
){
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
int16_t WebRtcIlbcfix_FrameClassify(
|
||||
/* (o) Index to the max-energy sub frame */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i/o) the encoder state structure */
|
||||
int16_t *residualFIX /* (i) lpc residual signal */
|
||||
);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
int16_t WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
IlbcDecoder *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
int16_t mode, /* (i) frame size mode */
|
||||
int use_enhancer) { /* (i) 1: use enhancer, 0: no enhancer */
|
||||
int i;
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
int16_t WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
IlbcDecoder *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
int16_t mode, /* (i) frame size mode */
|
||||
int use_enhancer /* (i) 1 to use enhancer
|
||||
0 to run without enhancer */
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
int16_t WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
IlbcEncoder *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
int16_t mode) { /* (i) frame size mode */
|
||||
iLBCenc_inst->mode = mode;
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
int16_t WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
IlbcEncoder *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
int16_t mode /* (i) frame size mode */
|
||||
);
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ void WebRtcIlbcfix_LpcEncode(
|
||||
before/after encoding */
|
||||
int16_t *lsf_index, /* (o) lsf quantization index */
|
||||
int16_t *data, /* (i) Speech to do LPC analysis on */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
) {
|
||||
/* Stack based */
|
||||
|
||||
@ -32,7 +32,7 @@ void WebRtcIlbcfix_LpcEncode(
|
||||
before/after encoding */
|
||||
int16_t *lsf_index, /* (o) lsf quantization index */
|
||||
int16_t *data, /* (i) Speech to do LPC analysis on */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
);
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ void WebRtcIlbcfix_SimpleInterpolateLsf(
|
||||
int16_t *lsfdeqold, /* (i) the dequantized lsf coefficients of the
|
||||
previous signal frame Q13 */
|
||||
int16_t length, /* (i) should equate FILTERORDER */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
) {
|
||||
int i, pos, lp_length;
|
||||
|
||||
@ -39,7 +39,7 @@ void WebRtcIlbcfix_SimpleInterpolateLsf(
|
||||
int16_t *lsfdeqold, /* (i) the dequantized lsf coefficients of the
|
||||
previous signal frame Q13 */
|
||||
int16_t length, /* (i) should equate FILTERORDER */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
);
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
void WebRtcIlbcfix_SimpleLpcAnalysis(
|
||||
int16_t *lsf, /* (o) lsf coefficients */
|
||||
int16_t *data, /* (i) new block of speech */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
) {
|
||||
int k;
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
void WebRtcIlbcfix_SimpleLpcAnalysis(
|
||||
int16_t *lsf, /* (o) lsf coefficients */
|
||||
int16_t *data, /* (i) new block of speech */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst
|
||||
IlbcEncoder *iLBCenc_inst
|
||||
/* (i/o) the encoder state structure */
|
||||
);
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_StateSearch(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) Encoder instance */
|
||||
iLBC_bits *iLBC_encbits,/* (i/o) Encoded bits (output idxForMax
|
||||
and idxVec, input state_first) */
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
void WebRtcIlbcfix_StateSearch(
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst,
|
||||
IlbcEncoder *iLBCenc_inst,
|
||||
/* (i) Encoder instance */
|
||||
iLBC_bits *iLBC_encbits,/* (i/o) Encoded bits (output idxForMax
|
||||
and idxVec, input state_first) */
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
short encode( /* (o) Number of bytes encoded */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
IlbcEncoder *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
int16_t *encoded_data, /* (o) The encoded bytes */
|
||||
int16_t *data /* (i) The signal block to encode */
|
||||
){
|
||||
@ -56,7 +56,7 @@ short encode( /* (o) Number of bytes encoded */
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
short decode( /* (o) Number of decoded samples */
|
||||
iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
IlbcDecoder *iLBCdec_inst, /* (i/o) Decoder instance */
|
||||
short *decoded_data, /* (o) Decoded signal block */
|
||||
short *encoded_data, /* (i) Encoded bytes */
|
||||
short mode /* (i) 0=PL, 1=Normal */
|
||||
@ -100,8 +100,8 @@ int main(int argc, char* argv[])
|
||||
short *channeldata;
|
||||
int blockcount = 0, noOfBlocks=0, i, noOfLostBlocks=0;
|
||||
short mode;
|
||||
iLBC_Enc_Inst_t Enc_Inst;
|
||||
iLBC_Dec_Inst_t Dec_Inst;
|
||||
IlbcEncoder Enc_Inst;
|
||||
IlbcDecoder Dec_Inst;
|
||||
|
||||
short frameLen;
|
||||
short count;
|
||||
|
||||
Reference in New Issue
Block a user