Wrap encode, decode, PLC NB functions in #define to avoid warnings.
Review URL: http://webrtc-codereview.appspot.com/133005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@492 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -144,6 +144,8 @@ extern "C" {
|
|||||||
* 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band samples
|
* 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band samples
|
||||||
* corresponding to 30 or 60 ms frames), and then proceeds to the encoding.
|
* corresponding to 30 or 60 ms frames), and then proceeds to the encoding.
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - speechIn : input speech vector.
|
* - speechIn : input speech vector.
|
||||||
@@ -158,9 +160,11 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
const WebRtc_Word16 *speechIn,
|
const WebRtc_Word16 *speechIn,
|
||||||
WebRtc_Word16 *encoded);
|
WebRtc_Word16 *encoded);
|
||||||
|
#endif // WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -262,6 +266,8 @@ extern "C" {
|
|||||||
* Output speech length will be a multiple of 240 samples: 240 or 480 samples,
|
* Output speech length will be a multiple of 240 samples: 240 or 480 samples,
|
||||||
* depending on the framesize (30 or 60 ms).
|
* depending on the framesize (30 or 60 ms).
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - encoded : encoded ISAC frame(s)
|
* - encoded : encoded ISAC frame(s)
|
||||||
@@ -274,11 +280,13 @@ extern "C" {
|
|||||||
* -1 - Error
|
* -1 - Error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
const WebRtc_UWord16 *encoded,
|
const WebRtc_UWord16 *encoded,
|
||||||
WebRtc_Word16 len,
|
WebRtc_Word16 len,
|
||||||
WebRtc_Word16 *decoded,
|
WebRtc_Word16 *decoded,
|
||||||
WebRtc_Word16 *speechType);
|
WebRtc_Word16 *speechType);
|
||||||
|
#endif // WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -288,6 +296,8 @@ extern "C" {
|
|||||||
* Output speech length will be "240*noOfLostFrames" samples
|
* Output speech length will be "240*noOfLostFrames" samples
|
||||||
* that equevalent of "30*noOfLostFrames" millisecond.
|
* that equevalent of "30*noOfLostFrames" millisecond.
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - noOfLostFrames : Number of PLC frames (240 sample=30ms) to produce
|
* - noOfLostFrames : Number of PLC frames (240 sample=30ms) to produce
|
||||||
@@ -300,9 +310,11 @@ extern "C" {
|
|||||||
* -1 - Error
|
* -1 - Error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_DecodePlcNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_DecodePlcNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
WebRtc_Word16 *decoded,
|
WebRtc_Word16 *decoded,
|
||||||
WebRtc_Word16 noOfLostFrames );
|
WebRtc_Word16 noOfLostFrames );
|
||||||
|
#endif // WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void WebRtcIsacfix_FilterAndCombine1(WebRtc_Word16 *tempin_ch1,
|
|||||||
WebRtc_Word16 *out16,
|
WebRtc_Word16 *out16,
|
||||||
PostFiltBankstr *postfiltdata);
|
PostFiltBankstr *postfiltdata);
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
|
|
||||||
void WebRtcIsacfix_SplitAndFilter2(WebRtc_Word16 *in,
|
void WebRtcIsacfix_SplitAndFilter2(WebRtc_Word16 *in,
|
||||||
WebRtc_Word16 *LP16,
|
WebRtc_Word16 *LP16,
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ void WebRtcIsacfix_SplitAndFilter1(WebRtc_Word16 *pin,
|
|||||||
}/*end of WebRtcIsacfix_SplitAndFilter */
|
}/*end of WebRtcIsacfix_SplitAndFilter */
|
||||||
|
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
|
|
||||||
/* Without lookahead */
|
/* Without lookahead */
|
||||||
void WebRtcIsacfix_SplitAndFilter2(WebRtc_Word16 *pin,
|
void WebRtcIsacfix_SplitAndFilter2(WebRtc_Word16 *pin,
|
||||||
@@ -267,7 +267,7 @@ void WebRtcIsacfix_FilterAndCombine1(WebRtc_Word16 *tempin_ch1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
/* Function WebRtcIsacfix_FilterAndCombine */
|
/* Function WebRtcIsacfix_FilterAndCombine */
|
||||||
/* This is a decoder function that takes the decimated
|
/* This is a decoder function that takes the decimated
|
||||||
length len/2 input low-pass and
|
length len/2 input low-pass and
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ WebRtc_Word16 WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
ISAC_inst->ISACenc_obj.bitstr_obj.stream[k] = 0;
|
ISAC_inst->ISACenc_obj.bitstr_obj.stream[k] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtcIsacfix_InitPostFilterbank(&ISAC_inst->ISACenc_obj.interpolatorstr_obj);
|
WebRtcIsacfix_InitPostFilterbank(&ISAC_inst->ISACenc_obj.interpolatorstr_obj);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -332,6 +332,8 @@ WebRtc_Word16 WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band samples
|
* 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band samples
|
||||||
* corresponding to 30 or 60 ms frames), and then proceeds to the encoding.
|
* corresponding to 30 or 60 ms frames), and then proceeds to the encoding.
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - speechIn : input speech vector.
|
* - speechIn : input speech vector.
|
||||||
@@ -345,13 +347,11 @@ WebRtc_Word16 WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* so it keeps buffering speech samples.
|
* so it keeps buffering speech samples.
|
||||||
* : -1 - Error
|
* : -1 - Error
|
||||||
*/
|
*/
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
const WebRtc_Word16 *speechIn,
|
const WebRtc_Word16 *speechIn,
|
||||||
WebRtc_Word16 *encoded)
|
WebRtc_Word16 *encoded)
|
||||||
{
|
{
|
||||||
#ifdef NB_CALLS
|
|
||||||
|
|
||||||
ISACFIX_SubStruct *ISAC_inst;
|
ISACFIX_SubStruct *ISAC_inst;
|
||||||
WebRtc_Word16 stream_len;
|
WebRtc_Word16 stream_len;
|
||||||
WebRtc_Word16 speechInWB[FRAMESAMPLES_10ms];
|
WebRtc_Word16 speechInWB[FRAMESAMPLES_10ms];
|
||||||
@@ -407,11 +407,8 @@ WebRtc_Word16 WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
|
|
||||||
|
|
||||||
return stream_len;
|
return stream_len;
|
||||||
|
|
||||||
#else /* NB_CALLS not defined */
|
|
||||||
return -1;
|
|
||||||
#endif /* NB_CALLS */
|
|
||||||
}
|
}
|
||||||
|
#endif /* WEBRTC_ISAC_FIX_NB_CALLS_ENABLED */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -511,7 +508,7 @@ WebRtc_Word16 WebRtcIsacfix_DecoderInit(ISACFIX_MainStruct *ISAC_main_inst)
|
|||||||
WebRtcIsacfix_InitPlc( &ISAC_inst->ISACdec_obj.plcstr_obj );
|
WebRtcIsacfix_InitPlc( &ISAC_inst->ISACdec_obj.plcstr_obj );
|
||||||
|
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtcIsacfix_InitPreFilterbank(&ISAC_inst->ISACdec_obj.decimatorstr_obj);
|
WebRtcIsacfix_InitPreFilterbank(&ISAC_inst->ISACdec_obj.decimatorstr_obj);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -814,6 +811,8 @@ WebRtc_Word16 WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* Output speech length will be a multiple of 240 samples: 240 or 480 samples,
|
* Output speech length will be a multiple of 240 samples: 240 or 480 samples,
|
||||||
* depending on the framesize (30 or 60 ms).
|
* depending on the framesize (30 or 60 ms).
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - encoded : encoded ISAC frame(s)
|
* - encoded : encoded ISAC frame(s)
|
||||||
@@ -826,14 +825,13 @@ WebRtc_Word16 WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* -1 - Error
|
* -1 - Error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
const WebRtc_UWord16 *encoded,
|
const WebRtc_UWord16 *encoded,
|
||||||
WebRtc_Word16 len,
|
WebRtc_Word16 len,
|
||||||
WebRtc_Word16 *decoded,
|
WebRtc_Word16 *decoded,
|
||||||
WebRtc_Word16 *speechType)
|
WebRtc_Word16 *speechType)
|
||||||
{
|
{
|
||||||
#ifdef NB_CALLS
|
|
||||||
ISACFIX_SubStruct *ISAC_inst;
|
ISACFIX_SubStruct *ISAC_inst;
|
||||||
/* twice the number of samples (480 or 960), output from decoder */
|
/* twice the number of samples (480 or 960), output from decoder */
|
||||||
/* that were actually used in the encoder/decoder (determined on the fly) */
|
/* that were actually used in the encoder/decoder (determined on the fly) */
|
||||||
@@ -908,11 +906,8 @@ WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return number_of_samples/2;
|
return number_of_samples/2;
|
||||||
|
|
||||||
#else /* NB_CALLS not defined */
|
|
||||||
return -1;
|
|
||||||
#endif /* NB_CALLS */
|
|
||||||
}
|
}
|
||||||
|
#endif /* WEBRTC_ISAC_FIX_NB_CALLS_ENABLED */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -922,6 +917,8 @@ WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* Output speech length will be "240*noOfLostFrames" samples
|
* Output speech length will be "240*noOfLostFrames" samples
|
||||||
* that is equevalent of "30*noOfLostFrames" millisecond.
|
* that is equevalent of "30*noOfLostFrames" millisecond.
|
||||||
*
|
*
|
||||||
|
* The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
|
||||||
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* - ISAC_main_inst : ISAC instance.
|
* - ISAC_main_inst : ISAC instance.
|
||||||
* - noOfLostFrames : Number of PLC frames (240 sample=30ms) to produce
|
* - noOfLostFrames : Number of PLC frames (240 sample=30ms) to produce
|
||||||
@@ -933,13 +930,11 @@ WebRtc_Word16 WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
* -1 - Error
|
* -1 - Error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
WebRtc_Word16 WebRtcIsacfix_DecodePlcNb(ISACFIX_MainStruct *ISAC_main_inst,
|
WebRtc_Word16 WebRtcIsacfix_DecodePlcNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||||
WebRtc_Word16 *decoded,
|
WebRtc_Word16 *decoded,
|
||||||
WebRtc_Word16 noOfLostFrames )
|
WebRtc_Word16 noOfLostFrames )
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
|
||||||
|
|
||||||
WebRtc_Word16 no_of_samples, declen, k, ok;
|
WebRtc_Word16 no_of_samples, declen, k, ok;
|
||||||
WebRtc_Word16 outframeNB[FRAMESAMPLES];
|
WebRtc_Word16 outframeNB[FRAMESAMPLES];
|
||||||
WebRtc_Word16 outframeWB[FRAMESAMPLES];
|
WebRtc_Word16 outframeWB[FRAMESAMPLES];
|
||||||
@@ -977,14 +972,8 @@ WebRtc_Word16 WebRtcIsacfix_DecodePlcNb(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return declen;
|
return declen;
|
||||||
|
|
||||||
|
|
||||||
#else /* NB_CALLS not defined */
|
|
||||||
return -1;
|
|
||||||
#endif /* NB_CALLS */
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif /* WEBRTC_ISAC_FIX_NB_CALLS_ENABLED */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ typedef struct {
|
|||||||
WebRtc_UWord16 MaxBits;
|
WebRtc_UWord16 MaxBits;
|
||||||
|
|
||||||
WebRtc_Word16 bitstr_seed;
|
WebRtc_Word16 bitstr_seed;
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
PostFiltBankstr interpolatorstr_obj;
|
PostFiltBankstr interpolatorstr_obj;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ typedef struct {
|
|||||||
PitchFiltstr pitchfiltstr_obj;
|
PitchFiltstr pitchfiltstr_obj;
|
||||||
PLCstr plcstr_obj; /* TS; for packet loss concealment */
|
PLCstr plcstr_obj; /* TS; for packet loss concealment */
|
||||||
|
|
||||||
#ifdef NB_CALLS
|
#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
|
||||||
PreFiltBankstr decimatorstr_obj;
|
PreFiltBankstr decimatorstr_obj;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user