History

move a couple of macros and structs to mpegaudio.h

Originally committed as revision 9343 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård committed 19 years ago

Commit c2d08dc1 parent 41e4c553 files · +11 −11Browse files

Unified · Split

3 files
  1. libavcodec/mpegaudio.h +11 −0
  2. libavcodec/mpegaudiodec.c +0 −10
  3. libavcodec/mpegaudioenc.c +0 −1
libavcodec/mpegaudio.h+11−0
@@ -62,6 +62,10 @@ · 61 unmodified lines
6262 #define WFRAC_BITS 14 /* fractional bits for window */
6363 #endif
6464
65+#define FRAC_ONE (1 << FRAC_BITS)
66+
67+#define FIX(a) ((int)((a) * FRAC_ONE))
68+
6569 #if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
6670 typedef int32_t OUT_INT;
6771 #define OUT_MAX INT32_MAX
@@ -116,6 +120,13 @@ typedef struct MPADecodeContext { · 48 unmodified lines
116120 AVCodecContext* avctx;
117121 } MPADecodeContext;
118122
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+
119130 int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
120131 int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate);
121132 void ff_mpa_synth_init(MPA_INT *window);
libavcodec/mpegaudiodec.c+0−10
@@ -46,9 +46,6 @@ · 45 unmodified lines
4646
4747 #include "mathops.h"
4848
49−#define FRAC_ONE (1 << FRAC_BITS)
50−
51−#define FIX(a) ((int)((a) * FRAC_ONE))
5249 /* WARNING: only correct for posititive numbers */
5350 #define FIXR(a) ((int)((a) * FRAC_ONE + 0.5))
5451 #define FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS)
@@ -91,13 +88,6 @@ typedef struct GranuleDef { · 36 unmodified lines
9188 #define MODE_EXT_MS_STEREO 2
9289 #define MODE_EXT_I_STEREO 1
9390
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−
10191 #include "mpegaudiodata.h"
10292 #include "mpegaudiodectab.h"
10393
libavcodec/mpegaudioenc.c+0−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 /* currently, cannot change these constants (need to modify
3232 quantization stage) */
3333 #define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
34−#define FIX(a) ((int)((a) * (1 << FRAC_BITS)))
3534
3635 #define SAMPLES_BUF_SIZE 4096
3736

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t