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

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