summaryrefslogtreecommitdiff
path: root/libavcodec/aac.h
diff options
context:
space:
mode:
authorYoung Han Lee <cpumaker@gmail.com>2011-02-14 18:09:43 +0900
committerAlex Converse <alex.converse@gmail.com>2011-02-14 21:43:42 -0800
commitead15f1dc196ad164d105e31c8c9025f8a4ee4e7 (patch)
tree0763bfb67ac39ea5828a60ee268e16d88dcd0501 /libavcodec/aac.h
parent77c330a046d668373cbd9542f3e1d4746916b02f (diff)
downloadffmpeg-ead15f1dc196ad164d105e31c8c9025f8a4ee4e7.tar.gz
aacdec: Implement LTP support.
Ported from gsoc svn.
Diffstat (limited to 'libavcodec/aac.h')
-rw-r--r--libavcodec/aac.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/libavcodec/aac.h b/libavcodec/aac.h
index cff476a6eb..a2bf70b001 100644
--- a/libavcodec/aac.h
+++ b/libavcodec/aac.h
@@ -43,6 +43,7 @@
#define MAX_ELEM_ID 16
#define TNS_MAX_ORDER 20
+#define MAX_LTP_LONG_SFB 40
enum RawDataBlockType {
TYPE_SCE,
@@ -131,6 +132,16 @@ typedef struct {
#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
/**
+ * Long Term Prediction
+ */
+typedef struct {
+ int8_t present;
+ int16_t lag;
+ float coef;
+ int8_t used[MAX_LTP_LONG_SFB];
+} LongTermPrediction;
+
+/**
* Individual Channel Stream
*/
typedef struct {
@@ -139,6 +150,7 @@ typedef struct {
uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sinus window.
int num_window_groups;
uint8_t group_len[8];
+ LongTermPrediction ltp;
const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window
int num_swb; ///< number of scalefactor window bands
@@ -206,14 +218,15 @@ typedef struct {
IndividualChannelStream ics;
TemporalNoiseShaping tns;
Pulse pulse;
- enum BandType band_type[128]; ///< band types
- int band_type_run_end[120]; ///< band type run end points
- float sf[120]; ///< scalefactors
- int sf_idx[128]; ///< scalefactor indices (used by encoder)
- uint8_t zeroes[128]; ///< band is not coded (used by encoder)
- DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT
- DECLARE_ALIGNED(16, float, saved)[1024]; ///< overlap
- DECLARE_ALIGNED(16, float, ret)[2048]; ///< PCM output
+ enum BandType band_type[128]; ///< band types
+ int band_type_run_end[120]; ///< band type run end points
+ float sf[120]; ///< scalefactors
+ int sf_idx[128]; ///< scalefactor indices (used by encoder)
+ uint8_t zeroes[128]; ///< band is not coded (used by encoder)
+ DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT
+ DECLARE_ALIGNED(16, float, saved)[1024]; ///< overlap
+ DECLARE_ALIGNED(16, float, ret)[2048]; ///< PCM output
+ DECLARE_ALIGNED(16, int16_t, ltp_state)[3072]; ///< time signal for LTP
PredictorState predictor_state[MAX_PREDICTORS];
} SingleChannelElement;
@@ -259,7 +272,7 @@ typedef struct {
* @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.)
* @{
*/
- DECLARE_ALIGNED(16, float, buf_mdct)[1024];
+ DECLARE_ALIGNED(16, float, buf_mdct)[2048];
/** @} */
/**
@@ -268,6 +281,7 @@ typedef struct {
*/
FFTContext mdct;
FFTContext mdct_small;
+ FFTContext mdct_ltp;
DSPContext dsp;
FmtConvertContext fmt_conv;
int random_state;