patch-libavcodec_aac_h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $OpenBSD: patch-libavcodec_aac_h,v 1.3 2015/12/06 08:51:46 ajacoutot Exp $
  2. AAC encoder: Extensive improvements
  3. aacenc: add support for encoding files using Long Term Prediction
  4. avcodec/aac_tablegen: get rid of hardcoded tables entirely
  5. --- libavcodec/aac.h.orig Thu Nov 12 02:08:28 2015
  6. +++ libavcodec/aac.h Sun Nov 29 18:42:06 2015
  7. @@ -151,6 +151,8 @@ typedef struct PredictorState {
  8. #define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard
  9. #define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
  10. +#define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
  11. +
  12. #define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band
  13. #define NOISE_PRE_BITS 9 ///< length of preamble
  14. #define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble
  15. @@ -161,6 +163,7 @@ typedef struct PredictorState {
  16. typedef struct LongTermPrediction {
  17. int8_t present;
  18. int16_t lag;
  19. + int coef_idx;
  20. INTFLOAT coef;
  21. int8_t used[MAX_LTP_LONG_SFB];
  22. } LongTermPrediction;
  23. @@ -252,6 +255,7 @@ typedef struct SingleChannelElement {
  24. INTFLOAT sf[120]; ///< scalefactors
  25. int sf_idx[128]; ///< scalefactor indices (used by encoder)
  26. uint8_t zeroes[128]; ///< band is not coded (used by encoder)
  27. + uint8_t can_pns[128]; ///< band is allowed to PNS (informative)
  28. float is_ener[128]; ///< Intensity stereo pos (used by encoder)
  29. float pns_ener[128]; ///< Noise energy values (used by encoder)
  30. DECLARE_ALIGNED(32, INTFLOAT, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
  31. @@ -259,6 +263,7 @@ typedef struct SingleChannelElement {
  32. DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
  33. DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
  34. DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
  35. + DECLARE_ALIGNED(32, AAC_FLOAT, lcoeffs)[1024]; ///< MDCT of LTP coefficients (used by encoder)
  36. DECLARE_ALIGNED(32, AAC_FLOAT, prcoeffs)[1024]; ///< Main prediction coefs (used by encoder)
  37. PredictorState predictor_state[MAX_PREDICTORS];
  38. INTFLOAT *ret; ///< PCM output