annotate flac.h @ 6920:d02af7474bff libavcodec

Prevent 128*1<<trellis from becoming 0 and creating 0 sized arrays. fixes CID84 RUN2 CID85 RUN2 CID86 RUN2 CID87 RUN2 CID88 RUN2 CID89 RUN2 CID90 RUN2 CID91 RUN2 CID92 RUN2 CID93 RUN2 CID94 RUN2 CID95 RUN2 CID96 RUN2 CID97 RUN2 CID98 RUN2 CID99 RUN2 CID100 RUN2 CID101 RUN2 CID102 RUN2 CID103 RUN2 CID104 RUN2 CID105 RUN2 CID106 RUN2
author michael
date Wed, 28 May 2008 11:59:41 +0000
parents dc4f5c55af40
children c4a4495715dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
1 /*
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
2 * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
3 * Copyright (c) 2008 Justin Ruggles
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
4 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
5 * This file is part of FFmpeg.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
6 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
11 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
15 * Lesser General Public License for more details.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
16 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
20 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
21
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
22 /**
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
23 * @file flac.h
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
24 * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
25 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
26
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
27 #ifndef FFMPEG_FLAC_H
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
28 #define FFMPEG_FLAC_H
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
29
6732
dc4f5c55af40 include avcodec.h
jbr
parents: 6729
diff changeset
30 #include "avcodec.h"
dc4f5c55af40 include avcodec.h
jbr
parents: 6729
diff changeset
31
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
32 /**
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
33 * Data needed from the Streaminfo header for use by the raw FLAC demuxer
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
34 * and/or the FLAC decoder.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
35 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
36 #define FLACSTREAMINFO \
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
37 int min_blocksize; /**< minimum block size, in samples */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
38 int max_blocksize; /**< maximum block size, in samples */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
39 int max_framesize; /**< maximum frame size, in bytes */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
40 int samplerate; /**< sample rate */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
41 int channels; /**< number of channels */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
42 int bps; /**< bits-per-sample */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
43
6729
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
44 typedef struct FLACStreaminfo {
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
45 FLACSTREAMINFO
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
46 } FLACStreaminfo;
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
47
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
48 /**
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
49 * Parse the Streaminfo metadata block
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
50 * @param[out] avctx codec context to set basic stream parameters
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
51 * @param[out] s where parsed information is stored
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
52 * @param[in] buffer pointer to start of 34-byte streaminfo data
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
53 */
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
54 void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
55 const uint8_t *buffer);
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
56
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
57 #endif /* FFMPEG_FLAC_H */