mpegaudio.h 2.02 KB
Newer Older
1 2 3
/*
 * copyright (c) 2001 Fabrice Bellard
 *
4 5 6
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
7 8
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * FFmpeg is distributed in the hope that it will be useful,
12 13 14 15 16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with FFmpeg; if not, write to the Free Software
18 19 20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

Michael Niedermayer's avatar
Michael Niedermayer committed
21
/**
22
 * @file
Michael Niedermayer's avatar
Michael Niedermayer committed
23 24
 * mpeg audio declarations for both encoder and decoder.
 */
25

26 27
#ifndef AVCODEC_MPEGAUDIO_H
#define AVCODEC_MPEGAUDIO_H
28

29 30
#ifndef USE_FLOATS
#   define USE_FLOATS 0
31 32
#endif

33
#include <stdint.h>
34
#include "libavutil/internal.h"
35

36
/* max frame size, in samples */
37
#define MPA_FRAME_SIZE 1152
Fabrice Bellard's avatar
Fabrice Bellard committed
38 39

/* max compressed frame size */
40
#define MPA_MAX_CODED_FRAME_SIZE 1792
Fabrice Bellard's avatar
Fabrice Bellard committed
41 42 43 44 45

#define MPA_MAX_CHANNELS 2

#define SBLIMIT 32 /* number of subbands */

46 47 48 49 50
#define MPA_STEREO  0
#define MPA_JSTEREO 1
#define MPA_DUAL    2
#define MPA_MONO    3

51
#ifndef FRAC_BITS
Roberto Togni's avatar
Roberto Togni committed
52 53 54 55
#define FRAC_BITS   23   /* fractional bits for sb_samples and dct */
#define WFRAC_BITS  16   /* fractional bits for window */
#endif

56 57
#define IMDCT_SCALAR 1.759

58 59 60 61
#define FRAC_ONE    (1 << FRAC_BITS)

#define FIX(a)   ((int)((a) * FRAC_ONE))

62
#if USE_FLOATS
63
#   define INTFLOAT float
64
#   define SUINTFLOAT float
65
typedef float MPA_INT;
66
typedef float OUT_INT;
67 68
#elif FRAC_BITS <= 15
#   define INTFLOAT int
69
#   define SUINTFLOAT SUINT
Roberto Togni's avatar
Roberto Togni committed
70
typedef int16_t MPA_INT;
71
typedef int16_t OUT_INT;
Roberto Togni's avatar
Roberto Togni committed
72
#else
73
#   define INTFLOAT int
74
#   define SUINTFLOAT SUINT
Roberto Togni's avatar
Roberto Togni committed
75
typedef int32_t MPA_INT;
76
typedef int16_t OUT_INT;
Roberto Togni's avatar
Roberto Togni committed
77 78
#endif

79
int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
80

81
#endif /* AVCODEC_MPEGAUDIO_H */