Mercurial > libavcodec.hg
annotate aac.h @ 7499:3eec98e5ab8f libavcodec
AAC definitions and structures that have been OKed from the SoC AAC decoder
code
author | superdump |
---|---|
date | Tue, 05 Aug 2008 19:27:17 +0000 |
parents | |
children | a3f7ffdb676d |
rev | line source |
---|---|
7499
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
1 /* |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
2 * AAC definitions and structures |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
3 * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
4 * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
5 * |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
6 * This file is part of FFmpeg. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
7 * |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
12 * |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
17 * |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
21 */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
22 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
23 /** |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
24 * @file aac.h |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
25 * AAC definitions and structures |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
26 * @author Oded Shimon ( ods15 ods15 dyndns org ) |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
27 * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
28 */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
29 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
30 #ifndef FFMPEG_AAC_H |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
31 #define FFMPEG_AAC_H |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
32 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
33 #include "avcodec.h" |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
34 #include "dsputil.h" |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
35 #include "mpeg4audio.h" |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
36 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
37 #include <stdint.h> |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
38 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
39 #define AAC_INIT_VLC_STATIC(num, size) \ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
40 INIT_VLC_STATIC(&vlc_spectral[num], 6, ff_aac_spectral_sizes[num], \ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
41 ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
42 ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
43 size); |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
44 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
45 #define IVQUANT_SIZE 1024 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
46 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
47 enum WindowSequence { |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
48 ONLY_LONG_SEQUENCE, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
49 LONG_START_SEQUENCE, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
50 EIGHT_SHORT_SEQUENCE, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
51 LONG_STOP_SEQUENCE, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
52 }; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
53 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
54 enum ChannelType { |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
55 AAC_CHANNEL_FRONT = 1, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
56 AAC_CHANNEL_SIDE = 2, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
57 AAC_CHANNEL_BACK = 3, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
58 AAC_CHANNEL_LFE = 4, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
59 AAC_CHANNEL_CC = 5, |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
60 }; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
61 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
62 /** |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
63 * main AAC context |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
64 */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
65 typedef struct { |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
66 AVCodecContext * avccontext; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
67 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
68 /** |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
69 * @defgroup tables Computed / set up during initialization. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
70 * @{ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
71 */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
72 MDCTContext mdct; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
73 MDCTContext mdct_small; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
74 DSPContext dsp; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
75 /** @} */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
76 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
77 /** |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
78 * @defgroup output Members used for output interleaving and down-mixing. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
79 * @{ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
80 */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
81 float add_bias; ///< offset for dsp.float_to_int16 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
82 float sf_scale; ///< Pre-scale for correct IMDCT and dsp.float_to_int16. |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
83 int sf_offset; ///< offset into pow2sf_tab as appropriate for dsp.float_to_int16 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
84 /** @} */ |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
85 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
86 } AACContext; |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
87 |
3eec98e5ab8f
AAC definitions and structures that have been OKed from the SoC AAC decoder
superdump
parents:
diff
changeset
|
88 #endif /* FFMPEG_AAC_H */ |