aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aac.h
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-10-17 02:22:51 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-10-17 02:31:20 +0100
commit27d23ae07424a7c3a5d5e242ca702299cdd2e14c (patch)
treea0dbfe397948ae22e5ed1f591c00a90ed00a89e4 /libavcodec/aac.h
parent83900c0ed34c22487d6a97cdf9e9949d0795f5b0 (diff)
downloadffmpeg-27d23ae07424a7c3a5d5e242ca702299cdd2e14c.tar.gz
aacenc: add support for encoding files using Long Term Prediction
Long Term Prediction allows for prediction of spectral coefficients via the previously decoded time-dependent samples. This feature works well with harmonic content 2 or more frames long, like speech, human or non-human, piano music or any constant tones at very low bitrates. It should be noted that the current coder is highly efficient and the rate control system is unable to encode files at extremely low bitrates (less than 14kbps seems to be impossible) so this extension isn't capable of optimum operation. Dramatic difference is observable with some types of audio and speech but for the most part the audiable differences are subtle. The spectrum looks better however so the encoder is able to harvest the additional bits that this feature provies, should the user choose to enable it. So it's best to enable this feature only if encoding at the absolutely lowest bitrate that the encoder is capable of.
Diffstat (limited to 'libavcodec/aac.h')
-rw-r--r--libavcodec/aac.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aac.h b/libavcodec/aac.h
index 37f98adb31..3333bfe5b2 100644
--- a/libavcodec/aac.h
+++ b/libavcodec/aac.h
@@ -161,6 +161,7 @@ typedef struct PredictorState {
typedef struct LongTermPrediction {
int8_t present;
int16_t lag;
+ int coef_idx;
INTFLOAT coef;
int8_t used[MAX_LTP_LONG_SFB];
} LongTermPrediction;
@@ -260,6 +261,7 @@ typedef struct SingleChannelElement {
DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
+ DECLARE_ALIGNED(32, AAC_FLOAT, lcoeffs)[1024]; ///< MDCT of LTP coefficients (used by encoder)
DECLARE_ALIGNED(32, AAC_FLOAT, prcoeffs)[1024]; ///< Main prediction coefs (used by encoder)
PredictorState predictor_state[MAX_PREDICTORS];
INTFLOAT *ret; ///< PCM output