FFmpeg
Loading...
Searching...
No Matches
mpegaudio.h
Go to the documentation of this file.
1/*
2 * copyright (c) 2001 Fabrice Bellard
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * 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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * 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 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file
23 * mpeg audio declarations for both encoder and decoder.
24 */
25
26#ifndef AVCODEC_MPEGAUDIO_H
27#define AVCODEC_MPEGAUDIO_H
28
29#ifndef USE_FLOATS
30# define USE_FLOATS 0
31#endif
32
33#include <stdint.h>
34#include "libavutil/internal.h"
35
36/* max frame size, in samples */
37#define MPA_FRAME_SIZE 1152
38
39/* max compressed frame size */
40#define MPA_MAX_CODED_FRAME_SIZE 1792
41
42/**
43 * Delay of the layer III synthesis filterbank, in samples. The LAME tag and
44 * iTunSMPB store the encoder delay and padding without it.
45 */
46#define MP3_DECODER_DELAY (528 + 1)
47
48#define MPA_MAX_CHANNELS 2
49
50#define SBLIMIT 32 /* number of subbands */
51
52#define MPA_STEREO 0
53#define MPA_JSTEREO 1
54#define MPA_DUAL 2
55#define MPA_MONO 3
56
57#ifndef FRAC_BITS
58#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */
59#define WFRAC_BITS 16 /* fractional bits for window */
60#endif
61
62#define IMDCT_SCALAR 1.759
63
64#define FRAC_ONE (1 << FRAC_BITS)
65
66#define FIX(a) ((int)((a) * FRAC_ONE))
67
68#if USE_FLOATS
69# define INTFLOAT float
70# define SUINTFLOAT float
71typedef float MPA_INT;
72typedef float OUT_INT;
73#elif FRAC_BITS <= 15
74# define INTFLOAT int
75# define SUINTFLOAT SUINT
76typedef int16_t MPA_INT;
77typedef int16_t OUT_INT;
78#else
79# define INTFLOAT int
80# define SUINTFLOAT SUINT
81typedef int32_t MPA_INT;
82typedef int16_t OUT_INT;
83#endif
84
85int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
86
87#endif /* AVCODEC_MPEGAUDIO_H */
int32_t
common internal API header
int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf)
Definition mpegaudio.c:31
int16_t OUT_INT
Definition mpegaudio.h:77
int16_t MPA_INT
Definition mpegaudio.h:76
int64_t bitrate
Definition av1_levels.c:47