aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegaudio.h
diff options
context:
space:
mode:
authorRoberto Togni <r_togni@tiscali.it>2005-10-18 20:16:43 +0000
committerRoberto Togni <r_togni@tiscali.it>2005-10-18 20:16:43 +0000
commitd9b1c197e5f99655328b713b7100e3125139546a (patch)
tree341d43d7b40c5533c6f35db90c13050a2ff8200b /libavcodec/mpegaudio.h
parentea7e68b1e2e3983198cac5814720d6f7655299bc (diff)
downloadffmpeg-d9b1c197e5f99655328b713b7100e3125139546a.tar.gz
QDM2 compatible decoder
Originally committed as revision 4649 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudio.h')
-rw-r--r--libavcodec/mpegaudio.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index 072c41bda7..2bcf38eac2 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -22,8 +22,42 @@
#define SAME_HEADER_MASK \
(0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
+/* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg
+ audio decoder */
+
+#ifdef USE_HIGHPRECISION
+#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */
+#define WFRAC_BITS 16 /* fractional bits for window */
+#else
+#define FRAC_BITS 15 /* fractional bits for sb_samples and dct */
+#define WFRAC_BITS 14 /* fractional bits for window */
+#endif
+
+#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
+typedef int32_t OUT_INT;
+#define OUT_MAX INT32_MAX
+#define OUT_MIN INT32_MIN
+#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 31)
+#else
+typedef int16_t OUT_INT;
+#define OUT_MAX INT16_MAX
+#define OUT_MIN INT16_MIN
+#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
+#endif
+
+#if FRAC_BITS <= 15
+typedef int16_t MPA_INT;
+#else
+typedef int32_t MPA_INT;
+#endif
+
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
+void ff_mpa_synth_init(MPA_INT *window);
+void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
+ MPA_INT *window, int *dither_state,
+ OUT_INT *samples, int incr,
+ int32_t sb_samples[SBLIMIT]);
extern const uint16_t mpa_bitrate_tab[2][3][15];
extern const uint16_t mpa_freq_tab[3];