Originally committed as revision 9343 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -62,6 +62,10 @@ · 61 unmodified lines | ||
| 62 | 62 | #define WFRAC_BITS 14 /* fractional bits for window */ |
| 63 | 63 | #endif |
| 64 | 64 | |
| 65 | +#define FRAC_ONE (1 << FRAC_BITS) | |
| 66 | + | |
| 67 | +#define FIX(a) ((int)((a) * FRAC_ONE)) | |
| 68 | + | |
| 65 | 69 | #if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT) |
| 66 | 70 | typedef int32_t OUT_INT; |
| 67 | 71 | #define OUT_MAX INT32_MAX |
| @@ -116,6 +120,13 @@ typedef struct MPADecodeContext { · 48 unmodified lines | ||
| 116 | 120 | AVCodecContext* avctx; |
| 117 | 121 | } MPADecodeContext; |
| 118 | 122 | |
| 123 | +/* layer 3 huffman tables */ | |
| 124 | +typedef struct HuffTable { | |
| 125 | + int xsize; | |
| 126 | + const uint8_t *bits; | |
| 127 | + const uint16_t *codes; | |
| 128 | +} HuffTable; | |
| 129 | + | |
| 119 | 130 | int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf); |
| 120 | 131 | int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate); |
| 121 | 132 | void ff_mpa_synth_init(MPA_INT *window); |
| @@ -46,9 +46,6 @@ · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | #include "mathops.h" |
| 48 | 48 | |
| 49 | −#define FRAC_ONE (1 << FRAC_BITS) | |
| 50 | − | |
| 51 | −#define FIX(a) ((int)((a) * FRAC_ONE)) | |
| 52 | 49 | /* WARNING: only correct for posititive numbers */ |
| 53 | 50 | #define FIXR(a) ((int)((a) * FRAC_ONE + 0.5)) |
| 54 | 51 | #define FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS) |
| @@ -91,13 +88,6 @@ typedef struct GranuleDef { · 36 unmodified lines | ||
| 91 | 88 | #define MODE_EXT_MS_STEREO 2 |
| 92 | 89 | #define MODE_EXT_I_STEREO 1 |
| 93 | 90 | |
| 94 | −/* layer 3 huffman tables */ | |
| 95 | −typedef struct HuffTable { | |
| 96 | − int xsize; | |
| 97 | − const uint8_t *bits; | |
| 98 | − const uint16_t *codes; | |
| 99 | −} HuffTable; | |
| 100 | − | |
| 101 | 91 | #include "mpegaudiodata.h" |
| 102 | 92 | #include "mpegaudiodectab.h" |
| 103 | 93 | |
| @@ -31,7 +31,6 @@ · 30 unmodified lines | ||
| 31 | 31 | /* currently, cannot change these constants (need to modify |
| 32 | 32 | quantization stage) */ |
| 33 | 33 | #define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) |
| 34 | −#define FIX(a) ((int)((a) * (1 << FRAC_BITS))) | |
| 35 | 34 | |
| 36 | 35 | #define SAMPLES_BUF_SIZE 4096 |
| 37 | 36 | |