summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2008-11-13 03:18:13 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2008-11-13 03:18:13 +0000
commit0cc51734b20032a5fea3020e40db968c5da91d1f (patch)
tree6052e9507c932776586f35c466a2b032061de8ae /libavcodec/ac3dec.h
parent0c5d750df9d0293b2ce27b6821c3209952c4e6b8 (diff)
add support for spectral extension
Originally committed as revision 15812 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3dec.h')
-rw-r--r--libavcodec/ac3dec.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index 617080910b..7d34837e0c 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -42,6 +42,11 @@
#define AC3_MAX_COEFS 256
#define AC3_BLOCK_SIZE 256
#define MAX_BLOCKS 6
+#define SPX_MAX_BANDS 17
+
+#define INT24_MIN -8388608
+#define INT24_MAX 8388607
+#define M_SQRT_POW2_15 181
typedef struct {
AVCodecContext *avctx; ///< parent context
@@ -88,6 +93,26 @@ typedef struct {
int cpl_coords[AC3_MAX_CHANNELS][18]; ///< coupling coordinates (cplco)
///@}
+///@defgroup spx spectral extension
+///@{
+ int spx_in_use[MAX_BLOCKS]; ///< spectral extension in use (spxinu)
+ int channel_in_spx[AC3_MAX_CHANNELS]; ///< channel in spectral extension (chinspx)
+ int spx_atten_code[AC3_MAX_CHANNELS]; ///< spx attenuation code (spxattencod)
+ int spx_coords_exist[AC3_MAX_CHANNELS]; ///< indicates if a channel has spx coords (spxcoe)
+ int spx_start_subband; ///< spx beginning frequency band (spxbegf)
+ int spx_start_freq; ///< spx start frequency bin
+ int spx_end_freq; ///< spx end frequency bin
+ int spx_copy_start_freq; ///< spx starting frequency for copying (copystartmant)
+ int num_spx_subbands; ///< number of spectral extension subbands
+ int num_spx_bands; ///< number of spectral extension bands (nspxbnds)
+ uint8_t spx_band_struct[SPX_MAX_BANDS]; ///< spectral extension band structure (spxbndstrc)
+ int spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each band (spxbndsztab)
+ int first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
+ int spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
+ int spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx signal blending factor (sblendfact)
+ int spx_coords[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spectral extension coordinates (spxco)
+///@}
+
///@defgroup aht adaptive hybrid transform
int channel_uses_aht[AC3_MAX_CHANNELS]; ///< channel AHT in use (chahtinu)
int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][MAX_BLOCKS]; ///< pre-IDCT mantissas
@@ -179,4 +204,6 @@ int ff_eac3_parse_header(AC3DecodeContext *s);
*/
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
+void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
+
#endif /* AVCODEC_AC3DEC_H */