celt.h | celt.h | |||
---|---|---|---|---|
/* (C) 2007 Jean-Marc Valin, CSIRO | /* (C) 2007-2008 Jean-Marc Valin, CSIRO | |||
*/ | */ | |||
/** | /** | |||
@file celt.h | @file celt.h | |||
@brief Contains all the functions for encoding and decoding audio streams | @brief Contains all the functions for encoding and decoding audio streams | |||
*/ | */ | |||
/* | /* | |||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions | modification, are permitted provided that the following conditions | |||
are met: | are met: | |||
skipping to change at line 83 | skipping to change at line 83 | |||
/** State of the decoder. One decoder state is needed for each stream. It i s | /** State of the decoder. One decoder state is needed for each stream. It i s | |||
initialised once at the beginning of the stream. Do *not* re-initialise | initialised once at the beginning of the stream. Do *not* re-initialise | |||
the state for every frame */ | the state for every frame */ | |||
typedef struct CELTDecoder CELTDecoder; | typedef struct CELTDecoder CELTDecoder; | |||
/** The mode contains all the information necessary to create an encoder. B oth | /** The mode contains all the information necessary to create an encoder. B oth | |||
the encoder and decoder need to be initialised with exactly the same mo de, | the encoder and decoder need to be initialised with exactly the same mo de, | |||
otherwise the quality will be very bad */ | otherwise the quality will be very bad */ | |||
typedef struct CELTMode CELTMode; | typedef struct CELTMode CELTMode; | |||
/* To be removed soon */ | ||||
#define celt_mono celt_mode_create(44100, 1, 256, 128, NULL) | ||||
#define celt_stereo celt_mode_create(44100, 2, 256, 128, NULL) | ||||
/** \defgroup codec Encoding and decoding */ | /** \defgroup codec Encoding and decoding */ | |||
/* @{ */ | /* @{ */ | |||
/* Mode calls */ | /* Mode calls */ | |||
/** Creates a new mode struct. This will be passed to an encoder or decoder . | /** Creates a new mode struct. This will be passed to an encoder or decoder . | |||
The mode MUST NOT BE DESTROYED until the encoders and decoders that use it | The mode MUST NOT BE DESTROYED until the encoders and decoders that use it | |||
are destroyed as well. | are destroyed as well. | |||
@param Fs Sampling rate (32000 to 64000 Hz) | @param Fs Sampling rate (32000 to 64000 Hz) | |||
@param channels Number of channels | @param channels Number of channels | |||
@param frame_size Number of samples (per channel) to encode in each packet (64 - 256) | @param frame_size Number of samples (per channel) to encode in each packet (64 - 256) | |||
@param lookahead Extra latency (in samples per channel) in addition to the frame size (between 32 and frame_size). The larger that value, the better the quality (at the expense of latency) | @param lookahead Extra latency (in samples per channel) in addition to the frame size (between 32 and frame_size). The larger that value, the better the quality (at the expense of latency) | |||
@param error Returned error code (if NULL, no error will be returned) | @param error Returned error code (if NULL, no error will be returned) | |||
@return A newly created mode | @return A newly created mode | |||
*/ | */ | |||
CELTMode *celt_mode_create(int Fs, int channels, int frame_size, int lookah ead, int *error); | CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, i nt lookahead, int *error); | |||
/** Destroys a mode struct. Only call this after all encoders and decoders | /** Destroys a mode struct. Only call this after all encoders and decoders | |||
using this mode are destroyed as well. | using this mode are destroyed as well. | |||
@param mode Mode to be destroyed | @param mode Mode to be destroyed | |||
*/ | */ | |||
void celt_mode_destroy(CELTMode *mode); | void celt_mode_destroy(CELTMode *mode); | |||
/** Query information from a mode */ | /** Query information from a mode */ | |||
int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value); | int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value); | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 2 lines changed or added | |||
celt_types.h | celt_types.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
********************************************************************/ | ********************************************************************/ | |||
/** | /** | |||
@file celt_types.h | @file celt_types.h | |||
@brief CELT types | @brief CELT types | |||
*/ | */ | |||
#ifndef _CELT_TYPES_H | #ifndef _CELT_TYPES_H | |||
#define _CELT_TYPES_H | #define _CELT_TYPES_H | |||
/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ | /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ | |||
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defi ned(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) ) | #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defi ned(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HA VE_STDINT_H)) | |||
#include <stdint.h> | #include <stdint.h> | |||
typedef int16_t celt_int16_t; | typedef int16_t celt_int16_t; | |||
typedef uint16_t celt_uint16_t; | typedef uint16_t celt_uint16_t; | |||
typedef int32_t celt_int32_t; | typedef int32_t celt_int32_t; | |||
typedef uint32_t celt_uint32_t; | typedef uint32_t celt_uint32_t; | |||
typedef int64_t celt_int64_t; | typedef int64_t celt_int64_t; | |||
typedef uint64_t celt_uint64_t; | typedef uint64_t celt_uint64_t; | |||
#elif defined(_WIN32) | #elif defined(_WIN32) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||