diff options
author | Jean-Marc Valin <Jean-Marc.Valin@csiro.au> | 2007-11-26 06:47:00 +0300 |
---|---|---|
committer | Jean-Marc Valin <Jean-Marc.Valin@csiro.au> | 2008-05-19 10:14:15 +0400 |
commit | 9b09b8681342c3ab874c2c3f85a84227e3251e9d (patch) | |
tree | c3f4b11ade1d3334615122f525245f4e33111856 /include | |
parent | 622aadef4c06d7a49ca8ef8f5a0f3fad2690daf5 (diff) | |
parent | 30f2c34c35b3c4c50dec35a0686e998adc8eac64 (diff) |
Merge branch 'master' into stereo
Conflicts:
libspeex/mdf.c
Diffstat (limited to 'include')
-rw-r--r-- | include/speex/speex.h | 5 | ||||
-rw-r--r-- | include/speex/speex_echo.h | 8 | ||||
-rw-r--r-- | include/speex/speex_header.h | 3 | ||||
-rw-r--r-- | include/speex/speex_jitter.h | 13 | ||||
-rw-r--r-- | include/speex/speex_preprocess.h | 33 | ||||
-rw-r--r-- | include/speex/speex_resampler.h | 12 |
6 files changed, 61 insertions, 13 deletions
diff --git a/include/speex/speex.h b/include/speex/speex.h index 54349a1..82ba016 100644 --- a/include/speex/speex.h +++ b/include/speex/speex.h @@ -212,11 +212,6 @@ extern "C" { /** modeID for the defined ultra-wideband mode */ #define SPEEX_MODEID_UWB 2 -#ifdef EPIC_48K -/** modeID for the Epic 48K mode */ -#define SPEEX_MODEID_NB_48K 1000 -#endif - struct SpeexMode; diff --git a/include/speex/speex_echo.h b/include/speex/speex_echo.h index 91314f5..aef1f64 100644 --- a/include/speex/speex_echo.h +++ b/include/speex/speex_echo.h @@ -51,6 +51,14 @@ extern "C" { /** Get sampling rate */ #define SPEEX_ECHO_GET_SAMPLING_RATE 25 +/* Can't set window sizes */ +/** Get size of impulse response (int32) */ +#define SPEEX_ECHO_GET_IMPULSE_RESPONSE_SIZE 27 + +/* Can't set window content */ +/** Get impulse response (int32[]) */ +#define SPEEX_ECHO_GET_IMPULSE_RESPONSE 29 + /** Internal echo canceller state. Should never be accessed directly. */ struct SpeexEchoState_; diff --git a/include/speex/speex_header.h b/include/speex/speex_header.h index 5416459..f85b249 100644 --- a/include/speex/speex_header.h +++ b/include/speex/speex_header.h @@ -83,6 +83,9 @@ char *speex_header_to_packet(SpeexHeader *header, int *size); /** Creates a SpeexHeader from a packet */ SpeexHeader *speex_packet_to_header(char *packet, int size); +/** Frees the memory allocated by either speex_header_to_packet() or speex_packet_to_header() */ +void speex_header_free(void *ptr); + #ifdef __cplusplus } #endif diff --git a/include/speex/speex_jitter.h b/include/speex/speex_jitter.h index 5bae9cb..d68674b 100644 --- a/include/speex/speex_jitter.h +++ b/include/speex/speex_jitter.h @@ -63,16 +63,15 @@ struct _JitterBufferPacket { spx_uint32_t timestamp; /**< Timestamp for the packet */ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */ spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */ - spx_uint16_t flags; /**< Info about the returned packet */ spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */ }; /** Packet has been retrieved */ #define JITTER_BUFFER_OK 0 -/** Packet is missing */ +/** Packet is lost or is late */ #define JITTER_BUFFER_MISSING 1 -/** Packet is incomplete (does not cover the entire tick */ -#define JITTER_BUFFER_INCOMPLETE 2 +/** A "fake" packet is meant to be inserted here to increase buffering */ +#define JITTER_BUFFER_INSERTION 2 /** There was an error in the jitter buffer */ #define JITTER_BUFFER_INTERNAL_ERROR -1 /** Invalid argument */ @@ -117,10 +116,12 @@ struct _JitterBufferPacket { /** Initialises jitter buffer * - * @param tick Number of samples per "tick", i.e. the time period of the elements that will be retrieved + * @param step_size Starting value for the size of concleanment packets and delay + adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP + and JITTER_BUFFER_GET_CONCEALMENT_SIZE. * @return Newly created jitter buffer state */ -JitterBuffer *jitter_buffer_init(void); +JitterBuffer *jitter_buffer_init(int step_size); /** Restores jitter buffer to its original state * diff --git a/include/speex/speex_preprocess.h b/include/speex/speex_preprocess.h index a0d3aa3..f8eef2c 100644 --- a/include/speex/speex_preprocess.h +++ b/include/speex/speex_preprocess.h @@ -110,9 +110,9 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr); /** Get preprocessor Voice Activity Detection state */ #define SPEEX_PREPROCESS_GET_VAD 5 -/** Set preprocessor Automatic Gain Control level */ +/** Set preprocessor Automatic Gain Control level (float) */ #define SPEEX_PREPROCESS_SET_AGC_LEVEL 6 -/** Get preprocessor Automatic Gain Control level */ +/** Get preprocessor Automatic Gain Control level (float) */ #define SPEEX_PREPROCESS_GET_AGC_LEVEL 7 /** Set preprocessor dereverb state */ @@ -182,6 +182,35 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr); /** Get loudness */ #define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33 +/* Can't set gain */ +/** Get current gain (int32 percent) */ +#define SPEEX_PREPROCESS_GET_AGC_GAIN 35 + +/* Can't set spectrum size */ +/** Get spectrum size for power spectrum (int32) */ +#define SPEEX_PREPROCESS_GET_PSD_SIZE 37 + +/* Can't set power spectrum */ +/** Get power spectrum (int32[] of squared values) */ +#define SPEEX_PREPROCESS_GET_PSD 39 + +/* Can't set noise size */ +/** Get spectrum size for noise estimate (int32) */ +#define SPEEX_PREPROCESS_GET_NOISE_PSD_SIZE 41 + +/* Can't set noise estimate */ +/** Get noise estimate (int32[] of squared values) */ +#define SPEEX_PREPROCESS_GET_NOISE_PSD 43 + +/* Can't set speech probability */ +/** Get speech probability in last frame (int32). */ +#define SPEEX_PREPROCESS_GET_PROB 45 + +/** Set preprocessor Automatic Gain Control level (int32) */ +#define SPEEX_PREPROCESS_SET_AGC_TARGET 46 +/** Get preprocessor Automatic Gain Control level (int32) */ +#define SPEEX_PREPROCESS_GET_AGC_TARGET 47 + #ifdef __cplusplus } #endif diff --git a/include/speex/speex_resampler.h b/include/speex/speex_resampler.h index c44fbcd..54eef8d 100644 --- a/include/speex/speex_resampler.h +++ b/include/speex/speex_resampler.h @@ -71,6 +71,8 @@ #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride) #define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride) #define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride) +#define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_latency) +#define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_latency) #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros) #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror) @@ -300,6 +302,16 @@ void speex_resampler_set_output_stride(SpeexResamplerState *st, void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride); +/** Get the latency in input samples introduced by the resampler. + * @param st Resampler state + */ +int speex_resampler_get_input_latency(SpeexResamplerState *st); + +/** Get the latency in output samples introduced by the resampler. + * @param st Resampler state + */ +int speex_resampler_get_output_latency(SpeexResamplerState *st); + /** Make sure that the first samples to go out of the resamplers don't have * leading zeros. This is only useful before starting to use a newly created * resampler. It is recommended to use that when resampling an audio file, as |