summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudio.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-30 14:04:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-30 14:04:56 +0000
commita7a858996f8dc5807c696c344b347a0c314417ae (patch)
treebf1e5edfe417488cd7ec6bc98a5da0c029a23adc /libavcodec/mpegaudio.h
parent16dd93ab6adbe1ac330212e70a0b7538b4ec571b (diff)
dithering for the mpeg audio decoder
Originally committed as revision 3903 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudio.h')
-rw-r--r--libavcodec/mpegaudio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index e50e8bd6f6..072c41bda7 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -18,6 +18,10 @@
#define MPA_DUAL 2
#define MPA_MONO 3
+/* header + layer + bitrate + freq + lsf/mpeg25 */
+#define SAME_HEADER_MASK \
+ (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
+
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
@@ -29,3 +33,20 @@ extern const int sblimit_table[5];
extern const int quant_steps[17];
extern const int quant_bits[17];
extern const int32_t mpa_enwindow[257];
+
+/* fast header check for resync */
+static inline int ff_mpa_check_header(uint32_t header){
+ /* header */
+ if ((header & 0xffe00000) != 0xffe00000)
+ return -1;
+ /* layer check */
+ if ((header & (3<<17)) == 0)
+ return -1;
+ /* bit rate */
+ if ((header & (0xf<<12)) == 0xf<<12)
+ return -1;
+ /* frequency */
+ if ((header & (3<<10)) == 3<<10)
+ return -1;
+ return 0;
+}