diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-20 05:42:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-20 05:48:22 +0200 |
commit | 80d156d7fdc44b09783ba242fe2681a6d4cc8df5 (patch) | |
tree | 7881b70297c87daa2f6d6f4790afaf438c53b3aa /libavcodec/mpegaudio.h | |
parent | 6efb29686fc9a7f76480405df8fe7eaa7a9dd4cf (diff) | |
parent | 984ece7503597d30e6f3bdeb67e337ea1616f880 (diff) | |
download | ffmpeg-80d156d7fdc44b09783ba242fe2681a6d4cc8df5.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
qdm2: Use floating point synthesis filter.
h264: correct border check.
h264: fix loopfilter with threading at slice boundaries.
Fix ff_mpa_synth_filter_fixed() prototype
Rename costablegen.c ---> cos_tablegen.c.
Collapse tableprint.c into tableprint.h.
Simplify trig table rules
Remove potentially unstable filenames from comments in generated files.
Ignore generated tables and generated table generator programs.
Simplify CLEANFILES make variable by using wildcards.
Remove silly insults from avformat_version() Doxygen documentation.
mpegaudiodsp: fix x86 and ppc makefiles
configure: Adjust AVX assembler check.
mpegaudio: remove unused version of SAME_HEADER_MASK
mpegaudio: remove useless #undef at end of file
asfdec: add missing #include for av_bswap32()
mpegaudio: merge two #if CONFIG_FLOAT blocks
mpegaudio: move some struct definitions from mpegaudio.h
Move some mpegaudio functions to new mpegaudiodsp subsystem
Conflicts:
libavcodec/h264.c
libavcodec/x86/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudio.h')
-rw-r--r-- | libavcodec/mpegaudio.h | 90 |
1 files changed, 3 insertions, 87 deletions
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h index 005598797d..7e2ca845d1 100644 --- a/libavcodec/mpegaudio.h +++ b/libavcodec/mpegaudio.h @@ -31,9 +31,6 @@ #endif #include "avcodec.h" -#include "get_bits.h" -#include "dsputil.h" -#include "dct.h" /* max frame size, in samples */ #define MPA_FRAME_SIZE 1152 @@ -50,10 +47,6 @@ #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)) - #define MP3_MASK 0xFFFE0CCF #ifndef FRAC_BITS @@ -66,46 +59,19 @@ #define FIX(a) ((int)((a) * FRAC_ONE)) #if CONFIG_FLOAT -typedef float OUT_INT; -#else -typedef int16_t OUT_INT; -#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15) -#endif - -#if CONFIG_FLOAT # define INTFLOAT float typedef float MPA_INT; +typedef float OUT_INT; #elif FRAC_BITS <= 15 # define INTFLOAT int typedef int16_t MPA_INT; +typedef int16_t OUT_INT; #else # define INTFLOAT int typedef int32_t MPA_INT; +typedef int16_t OUT_INT; #endif -#define BACKSTEP_SIZE 512 -#define EXTRABYTES 24 - -/* layer 3 "granule" */ -typedef struct GranuleDef { - uint8_t scfsi; - int part2_3_length; - int big_values; - int global_gain; - int scalefac_compress; - uint8_t block_type; - uint8_t switch_point; - int table_select[3]; - int subblock_gain[3]; - uint8_t scalefac_scale; - uint8_t count1table_select; - int region_size[3]; /* number of huffman codes in each region */ - int preflag; - int short_start, long_end; /* long/short band indexes */ - uint8_t scale_factors[40]; - INTFLOAT sb_hybrid[SBLIMIT * 18]; /* 576 samples */ -} GranuleDef; - #define MPA_DECODE_HEADER \ int frame_size; \ int error_protection; \ @@ -122,58 +88,8 @@ typedef struct MPADecodeHeader { MPA_DECODE_HEADER } MPADecodeHeader; -typedef struct MPADecodeContext { - MPA_DECODE_HEADER - uint8_t last_buf[2*BACKSTEP_SIZE + EXTRABYTES]; - int last_buf_size; - /* next header (used in free format parsing) */ - uint32_t free_format_next_header; - GetBitContext gb; - GetBitContext in_gb; - DECLARE_ALIGNED(16, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512 * 2]; - int synth_buf_offset[MPA_MAX_CHANNELS]; - DECLARE_ALIGNED(16, INTFLOAT, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT]; - INTFLOAT mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */ - GranuleDef granules[2][2]; /* Used in Layer 3 */ -#ifdef DEBUG - int frame_count; -#endif - int adu_mode; ///< 0 for standard mp3, 1 for adu formatted mp3 - int dither_state; - int error_recognition; - AVCodecContext* avctx; -#if CONFIG_FLOAT - DCTContext dct; -#endif - void (*apply_window_mp3)(MPA_INT *synth_buf, MPA_INT *window, - int *dither_state, OUT_INT *samples, int incr); -} MPADecodeContext; - -/* layer 3 huffman tables */ -typedef struct HuffTable { - int xsize; - const uint8_t *bits; - const uint16_t *codes; -} HuffTable; - int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf); int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate); -extern MPA_INT ff_mpa_synth_window_fixed[]; -void ff_mpa_synth_init_fixed(MPA_INT *window); -void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset, - MPA_INT *window, int *dither_state, - OUT_INT *samples, int incr, - INTFLOAT sb_samples[SBLIMIT]); - -void ff_mpa_synth_init_float(MPA_INT *window); -void ff_mpa_synth_filter_float(MPADecodeContext *s, - MPA_INT *synth_buf_ptr, int *synth_buf_offset, - MPA_INT *window, int *dither_state, - OUT_INT *samples, int incr, - INTFLOAT sb_samples[SBLIMIT]); - -void ff_mpegaudiodec_init_mmx(MPADecodeContext *s); -void ff_mpegaudiodec_init_altivec(MPADecodeContext *s); /* fast header check for resync */ static inline int ff_mpa_check_header(uint32_t header){ |