mpegaudio.h 1.88 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 31 32
#ifndef CONFIG_FLOAT
#   define CONFIG_FLOAT 0
#endif

33
#include <stdint.h>
34

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

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

#define MPA_MAX_CHANNELS 2

#define SBLIMIT 32 /* number of subbands */

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

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

55 56 57 58
#define FRAC_ONE    (1 << FRAC_BITS)

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

59 60 61
#if CONFIG_FLOAT
#   define INTFLOAT float
typedef float MPA_INT;
62
typedef float OUT_INT;
63 64
#elif FRAC_BITS <= 15
#   define INTFLOAT int
Roberto Togni's avatar
Roberto Togni committed
65
typedef int16_t MPA_INT;
66
typedef int16_t OUT_INT;
Roberto Togni's avatar
Roberto Togni committed
67
#else
68
#   define INTFLOAT int
Roberto Togni's avatar
Roberto Togni committed
69
typedef int32_t MPA_INT;
70
typedef int16_t OUT_INT;
Roberto Togni's avatar
Roberto Togni committed
71 72
#endif

73
int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
74

75
#endif /* AVCODEC_MPEGAUDIO_H */