annotate aac_parser.h @ 8986:4d5d7e08f1d3 libavcodec

Some buffer checks for indeo3
author alexc
date Thu, 19 Feb 2009 22:56:35 +0000
parents 2cbfa4cd4670
children 0dce4fe6e6f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8549
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
1 /*
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
2 * AAC parser prototypes
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
3 * Copyright (c) 2003 Fabrice Bellard
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
4 * Copyright (c) 2003 Michael Niedermayer
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
5 *
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
6 * This file is part of FFmpeg.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
7 *
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
12 *
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
16 * Lesser General Public License for more details.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
17 *
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
21 */
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
22
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
23 #ifndef AVCODEC_AAC_PARSER_H
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
24 #define AVCODEC_AAC_PARSER_H
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
25
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
26 #include <stdint.h>
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
27 #include "aac_ac3_parser.h"
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
28 #include "bitstream.h"
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
29
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
30 typedef struct {
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
31 uint32_t sample_rate;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
32 uint32_t samples;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
33 uint32_t bit_rate;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
34 uint8_t crc_absent;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
35 uint8_t object_type;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
36 uint8_t sampling_index;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
37 uint8_t chan_config;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
38 uint8_t num_aac_frames;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
39 } AACADTSHeaderInfo;
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
40
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
41 /**
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
42 * Parses AAC frame header.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
43 * Parses the ADTS frame header to the end of the variable header, which is
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
44 * the first 54 bits.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
45 * @param gbc[in] BitContext containing the first 54 bits of the frame.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
46 * @param hdr[out] Pointer to struct where header info is written.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
47 * @return Returns 0 on success, -1 if there is a sync word mismatch,
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
48 * -2 if the version element is invalid, -3 if the sample rate
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
49 * element is invalid, or -4 if the bit rate element is invalid.
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
50 */
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
51 int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
52
2cbfa4cd4670 Support ADTS AAC files in the ffaac decoder (limited to streams containing one
superdump
parents:
diff changeset
53 #endif /* AVCODEC_AAC_PARSER_H */