annotate lib/libavcodec/avcodec.h @ 2181:17b3e40daedc

_427E01_cast_spell continue
author Ritor1
date Thu, 23 Jan 2014 00:18:05 +0600
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * copyright (c) 2001 Fabrice Bellard
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 #ifndef AVCODEC_AVCODEC_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 #define AVCODEC_AVCODEC_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25 * @file
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 * @ingroup libavc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 * Libavcodec external API header
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 #include <errno.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 #include "../libavutil/samplefmt.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 #include "../libavutil/avutil.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33 #include "../libavutil/buffer.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 #include "../libavutil/cpu.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 #include "../libavutil/channel_layout.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36 #include "../libavutil/dict.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 #include "../libavutil/frame.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 #include "../libavutil/log.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 #include "../libavutil/pixfmt.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 #include "../libavutil/rational.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 #include "../libavcodec/version.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 * @defgroup libavc Encoding/Decoding Library
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 * @defgroup lavc_decoding Decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 * @defgroup lavc_encoding Encoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 * @defgroup lavc_codec Codecs
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 * @defgroup lavc_codec_native Native Codecs
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 * @defgroup lavc_codec_wrappers External library wrappers
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67 * @defgroup lavc_internal Internal
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75 * @defgroup lavc_core Core functions/structures.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76 * @ingroup libavc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 * Basic definitions, functions for querying libavcodec capabilities,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79 * allocating core structures, etc.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 * Identify the syntax and semantics of the bitstream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86 * The principle is roughly:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 * Two decoders with the same ID can decode the same streams.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88 * Two encoders with the same ID can encode compatible streams.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89 * There may be slight deviations from the principle due to implementation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 * details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92 * If you add a codec ID to this list, add it so that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93 * 1. no value of a existing codec ID changes (that would break ABI),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94 * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95 * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97 * After adding new codec IDs, do not forget to add an entry to the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 * descriptor list and bump libavcodec minor version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100 enum AVCodecID {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 AV_CODEC_ID_NONE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103 /* video codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104 AV_CODEC_ID_MPEG1VIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105 AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 AV_CODEC_ID_MPEG2VIDEO_XVMC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107 AV_CODEC_ID_H261,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 AV_CODEC_ID_H263,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109 AV_CODEC_ID_RV10,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 AV_CODEC_ID_RV20,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111 AV_CODEC_ID_MJPEG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112 AV_CODEC_ID_MJPEGB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113 AV_CODEC_ID_LJPEG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 AV_CODEC_ID_SP5X,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 AV_CODEC_ID_JPEGLS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116 AV_CODEC_ID_MPEG4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117 AV_CODEC_ID_RAWVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118 AV_CODEC_ID_MSMPEG4V1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 AV_CODEC_ID_MSMPEG4V2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120 AV_CODEC_ID_MSMPEG4V3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121 AV_CODEC_ID_WMV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 AV_CODEC_ID_WMV2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 AV_CODEC_ID_H263P,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124 AV_CODEC_ID_H263I,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 AV_CODEC_ID_FLV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126 AV_CODEC_ID_SVQ1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127 AV_CODEC_ID_SVQ3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 AV_CODEC_ID_DVVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129 AV_CODEC_ID_HUFFYUV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 AV_CODEC_ID_CYUV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131 AV_CODEC_ID_H264,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 AV_CODEC_ID_INDEO3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 AV_CODEC_ID_VP3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 AV_CODEC_ID_THEORA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 AV_CODEC_ID_ASV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136 AV_CODEC_ID_ASV2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137 AV_CODEC_ID_FFV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138 AV_CODEC_ID_4XM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 AV_CODEC_ID_VCR1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140 AV_CODEC_ID_CLJR,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141 AV_CODEC_ID_MDEC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 AV_CODEC_ID_ROQ,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143 AV_CODEC_ID_INTERPLAY_VIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 AV_CODEC_ID_XAN_WC3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 AV_CODEC_ID_XAN_WC4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146 AV_CODEC_ID_RPZA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147 AV_CODEC_ID_CINEPAK,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148 AV_CODEC_ID_WS_VQA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149 AV_CODEC_ID_MSRLE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150 AV_CODEC_ID_MSVIDEO1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 AV_CODEC_ID_IDCIN,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
152 AV_CODEC_ID_8BPS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
153 AV_CODEC_ID_SMC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
154 AV_CODEC_ID_FLIC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
155 AV_CODEC_ID_TRUEMOTION1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
156 AV_CODEC_ID_VMDVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
157 AV_CODEC_ID_MSZH,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
158 AV_CODEC_ID_ZLIB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
159 AV_CODEC_ID_QTRLE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
160 AV_CODEC_ID_TSCC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
161 AV_CODEC_ID_ULTI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
162 AV_CODEC_ID_QDRAW,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
163 AV_CODEC_ID_VIXL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
164 AV_CODEC_ID_QPEG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
165 AV_CODEC_ID_PNG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
166 AV_CODEC_ID_PPM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
167 AV_CODEC_ID_PBM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
168 AV_CODEC_ID_PGM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
169 AV_CODEC_ID_PGMYUV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
170 AV_CODEC_ID_PAM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
171 AV_CODEC_ID_FFVHUFF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
172 AV_CODEC_ID_RV30,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
173 AV_CODEC_ID_RV40,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
174 AV_CODEC_ID_VC1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
175 AV_CODEC_ID_WMV3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
176 AV_CODEC_ID_LOCO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
177 AV_CODEC_ID_WNV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
178 AV_CODEC_ID_AASC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
179 AV_CODEC_ID_INDEO2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
180 AV_CODEC_ID_FRAPS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
181 AV_CODEC_ID_TRUEMOTION2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
182 AV_CODEC_ID_BMP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
183 AV_CODEC_ID_CSCD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
184 AV_CODEC_ID_MMVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
185 AV_CODEC_ID_ZMBV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
186 AV_CODEC_ID_AVS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
187 AV_CODEC_ID_SMACKVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
188 AV_CODEC_ID_NUV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
189 AV_CODEC_ID_KMVC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
190 AV_CODEC_ID_FLASHSV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
191 AV_CODEC_ID_CAVS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
192 AV_CODEC_ID_JPEG2000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
193 AV_CODEC_ID_VMNC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
194 AV_CODEC_ID_VP5,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
195 AV_CODEC_ID_VP6,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
196 AV_CODEC_ID_VP6F,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
197 AV_CODEC_ID_TARGA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
198 AV_CODEC_ID_DSICINVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
199 AV_CODEC_ID_TIERTEXSEQVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
200 AV_CODEC_ID_TIFF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
201 AV_CODEC_ID_GIF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
202 AV_CODEC_ID_DXA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
203 AV_CODEC_ID_DNXHD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
204 AV_CODEC_ID_THP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
205 AV_CODEC_ID_SGI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
206 AV_CODEC_ID_C93,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
207 AV_CODEC_ID_BETHSOFTVID,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
208 AV_CODEC_ID_PTX,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
209 AV_CODEC_ID_TXD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
210 AV_CODEC_ID_VP6A,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
211 AV_CODEC_ID_AMV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
212 AV_CODEC_ID_VB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
213 AV_CODEC_ID_PCX,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
214 AV_CODEC_ID_SUNRAST,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
215 AV_CODEC_ID_INDEO4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
216 AV_CODEC_ID_INDEO5,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
217 AV_CODEC_ID_MIMIC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
218 AV_CODEC_ID_RL2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
219 AV_CODEC_ID_ESCAPE124,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
220 AV_CODEC_ID_DIRAC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
221 AV_CODEC_ID_BFI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
222 AV_CODEC_ID_CMV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
223 AV_CODEC_ID_MOTIONPIXELS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
224 AV_CODEC_ID_TGV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
225 AV_CODEC_ID_TGQ,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
226 AV_CODEC_ID_TQI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
227 AV_CODEC_ID_AURA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
228 AV_CODEC_ID_AURA2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
229 AV_CODEC_ID_V210X,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
230 AV_CODEC_ID_TMV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
231 AV_CODEC_ID_V210,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
232 AV_CODEC_ID_DPX,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
233 AV_CODEC_ID_MAD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
234 AV_CODEC_ID_FRWU,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
235 AV_CODEC_ID_FLASHSV2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
236 AV_CODEC_ID_CDGRAPHICS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
237 AV_CODEC_ID_R210,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
238 AV_CODEC_ID_ANM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
239 AV_CODEC_ID_BINKVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
240 AV_CODEC_ID_IFF_ILBM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
241 AV_CODEC_ID_IFF_BYTERUN1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
242 AV_CODEC_ID_KGV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
243 AV_CODEC_ID_YOP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
244 AV_CODEC_ID_VP8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
245 AV_CODEC_ID_PICTOR,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
246 AV_CODEC_ID_ANSI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
247 AV_CODEC_ID_A64_MULTI,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
248 AV_CODEC_ID_A64_MULTI5,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
249 AV_CODEC_ID_R10K,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
250 AV_CODEC_ID_MXPEG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
251 AV_CODEC_ID_LAGARITH,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
252 AV_CODEC_ID_PRORES,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
253 AV_CODEC_ID_JV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
254 AV_CODEC_ID_DFA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
255 AV_CODEC_ID_WMV3IMAGE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
256 AV_CODEC_ID_VC1IMAGE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
257 AV_CODEC_ID_UTVIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
258 AV_CODEC_ID_BMV_VIDEO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
259 AV_CODEC_ID_VBLE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
260 AV_CODEC_ID_DXTORY,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
261 AV_CODEC_ID_V410,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
262 AV_CODEC_ID_XWD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
263 AV_CODEC_ID_CDXL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
264 AV_CODEC_ID_XBM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
265 AV_CODEC_ID_ZEROCODEC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
266 AV_CODEC_ID_MSS1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
267 AV_CODEC_ID_MSA1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
268 AV_CODEC_ID_TSCC2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
269 AV_CODEC_ID_MTS2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
270 AV_CODEC_ID_CLLC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
271 AV_CODEC_ID_MSS2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
272 AV_CODEC_ID_VP9,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
273 AV_CODEC_ID_AIC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
274 AV_CODEC_ID_ESCAPE130_DEPRECATED,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
275
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
276 AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
277 AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
278 AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
279 AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
280 AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
281
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
282 AV_CODEC_ID_012V = MKBETAG('0','1','2','V'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
283 AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
284 AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
285 AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
286 AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
287 AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
288 AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
289 AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
290 AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
291 AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
292 AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
293 AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
294 AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
295 AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
296 AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
297 AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
298 AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
299 AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
300 AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
301
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
302 /* various PCM "codecs" */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
303 AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
304 AV_CODEC_ID_PCM_S16LE = 0x10000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
305 AV_CODEC_ID_PCM_S16BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
306 AV_CODEC_ID_PCM_U16LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
307 AV_CODEC_ID_PCM_U16BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
308 AV_CODEC_ID_PCM_S8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
309 AV_CODEC_ID_PCM_U8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
310 AV_CODEC_ID_PCM_MULAW,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
311 AV_CODEC_ID_PCM_ALAW,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
312 AV_CODEC_ID_PCM_S32LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
313 AV_CODEC_ID_PCM_S32BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
314 AV_CODEC_ID_PCM_U32LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
315 AV_CODEC_ID_PCM_U32BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
316 AV_CODEC_ID_PCM_S24LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
317 AV_CODEC_ID_PCM_S24BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
318 AV_CODEC_ID_PCM_U24LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
319 AV_CODEC_ID_PCM_U24BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
320 AV_CODEC_ID_PCM_S24DAUD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
321 AV_CODEC_ID_PCM_ZORK,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
322 AV_CODEC_ID_PCM_S16LE_PLANAR,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
323 AV_CODEC_ID_PCM_DVD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
324 AV_CODEC_ID_PCM_F32BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
325 AV_CODEC_ID_PCM_F32LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
326 AV_CODEC_ID_PCM_F64BE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
327 AV_CODEC_ID_PCM_F64LE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
328 AV_CODEC_ID_PCM_BLURAY,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
329 AV_CODEC_ID_PCM_LXF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
330 AV_CODEC_ID_S302M,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
331 AV_CODEC_ID_PCM_S8_PLANAR,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
332 AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
333 AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
334 AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
335
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
336 /* various ADPCM codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
337 AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
338 AV_CODEC_ID_ADPCM_IMA_WAV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
339 AV_CODEC_ID_ADPCM_IMA_DK3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
340 AV_CODEC_ID_ADPCM_IMA_DK4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
341 AV_CODEC_ID_ADPCM_IMA_WS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
342 AV_CODEC_ID_ADPCM_IMA_SMJPEG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
343 AV_CODEC_ID_ADPCM_MS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
344 AV_CODEC_ID_ADPCM_4XM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
345 AV_CODEC_ID_ADPCM_XA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
346 AV_CODEC_ID_ADPCM_ADX,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
347 AV_CODEC_ID_ADPCM_EA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
348 AV_CODEC_ID_ADPCM_G726,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
349 AV_CODEC_ID_ADPCM_CT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
350 AV_CODEC_ID_ADPCM_SWF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
351 AV_CODEC_ID_ADPCM_YAMAHA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
352 AV_CODEC_ID_ADPCM_SBPRO_4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
353 AV_CODEC_ID_ADPCM_SBPRO_3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
354 AV_CODEC_ID_ADPCM_SBPRO_2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
355 AV_CODEC_ID_ADPCM_THP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
356 AV_CODEC_ID_ADPCM_IMA_AMV,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
357 AV_CODEC_ID_ADPCM_EA_R1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
358 AV_CODEC_ID_ADPCM_EA_R3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
359 AV_CODEC_ID_ADPCM_EA_R2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
360 AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
361 AV_CODEC_ID_ADPCM_IMA_EA_EACS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
362 AV_CODEC_ID_ADPCM_EA_XAS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
363 AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
364 AV_CODEC_ID_ADPCM_IMA_ISS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
365 AV_CODEC_ID_ADPCM_G722,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
366 AV_CODEC_ID_ADPCM_IMA_APC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
367 AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
368 AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
369 AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
370 AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
371 AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
372
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
373 /* AMR */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
374 AV_CODEC_ID_AMR_NB = 0x12000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
375 AV_CODEC_ID_AMR_WB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
376
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
377 /* RealAudio codecs*/
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
378 AV_CODEC_ID_RA_144 = 0x13000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
379 AV_CODEC_ID_RA_288,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
380
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
381 /* various DPCM codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
382 AV_CODEC_ID_ROQ_DPCM = 0x14000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
383 AV_CODEC_ID_INTERPLAY_DPCM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
384 AV_CODEC_ID_XAN_DPCM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
385 AV_CODEC_ID_SOL_DPCM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
386
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
387 /* audio codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
388 AV_CODEC_ID_MP2 = 0x15000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
389 AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
390 AV_CODEC_ID_AAC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
391 AV_CODEC_ID_AC3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
392 AV_CODEC_ID_DTS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
393 AV_CODEC_ID_VORBIS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
394 AV_CODEC_ID_DVAUDIO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
395 AV_CODEC_ID_WMAV1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
396 AV_CODEC_ID_WMAV2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
397 AV_CODEC_ID_MACE3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
398 AV_CODEC_ID_MACE6,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
399 AV_CODEC_ID_VMDAUDIO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
400 AV_CODEC_ID_FLAC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
401 AV_CODEC_ID_MP3ADU,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
402 AV_CODEC_ID_MP3ON4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
403 AV_CODEC_ID_SHORTEN,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
404 AV_CODEC_ID_ALAC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
405 AV_CODEC_ID_WESTWOOD_SND1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
406 AV_CODEC_ID_GSM, ///< as in Berlin toast format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
407 AV_CODEC_ID_QDM2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
408 AV_CODEC_ID_COOK,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
409 AV_CODEC_ID_TRUESPEECH,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
410 AV_CODEC_ID_TTA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
411 AV_CODEC_ID_SMACKAUDIO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
412 AV_CODEC_ID_QCELP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
413 AV_CODEC_ID_WAVPACK,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
414 AV_CODEC_ID_DSICINAUDIO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
415 AV_CODEC_ID_IMC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
416 AV_CODEC_ID_MUSEPACK7,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
417 AV_CODEC_ID_MLP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
418 AV_CODEC_ID_GSM_MS, /* as found in WAV */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
419 AV_CODEC_ID_ATRAC3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
420 AV_CODEC_ID_VOXWARE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
421 AV_CODEC_ID_APE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
422 AV_CODEC_ID_NELLYMOSER,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
423 AV_CODEC_ID_MUSEPACK8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
424 AV_CODEC_ID_SPEEX,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
425 AV_CODEC_ID_WMAVOICE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
426 AV_CODEC_ID_WMAPRO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
427 AV_CODEC_ID_WMALOSSLESS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
428 AV_CODEC_ID_ATRAC3P,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
429 AV_CODEC_ID_EAC3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
430 AV_CODEC_ID_SIPR,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
431 AV_CODEC_ID_MP1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
432 AV_CODEC_ID_TWINVQ,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
433 AV_CODEC_ID_TRUEHD,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
434 AV_CODEC_ID_MP4ALS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
435 AV_CODEC_ID_ATRAC1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
436 AV_CODEC_ID_BINKAUDIO_RDFT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
437 AV_CODEC_ID_BINKAUDIO_DCT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
438 AV_CODEC_ID_AAC_LATM,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
439 AV_CODEC_ID_QDMC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
440 AV_CODEC_ID_CELT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
441 AV_CODEC_ID_G723_1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
442 AV_CODEC_ID_G729,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
443 AV_CODEC_ID_8SVX_EXP,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
444 AV_CODEC_ID_8SVX_FIB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
445 AV_CODEC_ID_BMV_AUDIO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
446 AV_CODEC_ID_RALF,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
447 AV_CODEC_ID_IAC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
448 AV_CODEC_ID_ILBC,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
449 AV_CODEC_ID_OPUS_DEPRECATED,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
450 AV_CODEC_ID_COMFORT_NOISE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
451 AV_CODEC_ID_TAK_DEPRECATED,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
452 AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
453 AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
454 AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
455 AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
456 AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
457 AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
458 AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
459 AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
460
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
461 /* subtitle codecs */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
462 AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
463 AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
464 AV_CODEC_ID_DVB_SUBTITLE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
465 AV_CODEC_ID_TEXT, ///< raw UTF-8 text
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
466 AV_CODEC_ID_XSUB,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
467 AV_CODEC_ID_SSA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
468 AV_CODEC_ID_MOV_TEXT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
469 AV_CODEC_ID_HDMV_PGS_SUBTITLE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
470 AV_CODEC_ID_DVB_TELETEXT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
471 AV_CODEC_ID_SRT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
472 AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
473 AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
474 AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
475 AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
476 AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
477 AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
478 AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
479 AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
480 AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
481 AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
482 AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
483 AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
484 AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
485
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
486 /* other specific kind of codecs (generally used for attachments) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
487 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
488 AV_CODEC_ID_TTF = 0x18000,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
489 AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
490 AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
491 AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
492 AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
493 AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
494 AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
495
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
496
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
497 AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
498
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
499 AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
500 * stream (only used by libavformat) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
501 AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
502 * stream (only used by libavformat) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
503 AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
504
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
505 #if FF_API_CODEC_ID
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
506 #include "old_codec_ids.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
507 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
508 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
509
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
510 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
511 * This struct describes the properties of a single codec described by an
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
512 * AVCodecID.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
513 * @see avcodec_get_descriptor()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
514 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
515 typedef struct AVCodecDescriptor {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
516 enum AVCodecID id;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
517 enum AVMediaType type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
518 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
519 * Name of the codec described by this descriptor. It is non-empty and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
520 * unique for each codec descriptor. It should contain alphanumeric
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
521 * characters and '_' only.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
522 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
523 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
524 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
525 * A more descriptive name for this codec. May be NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
526 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
527 const char *long_name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
528 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
529 * Codec properties, a combination of AV_CODEC_PROP_* flags.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
530 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
531 int props;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
532 } AVCodecDescriptor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
533
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
534 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
535 * Codec uses only intra compression.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
536 * Video codecs only.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
537 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
538 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
539 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
540 * Codec supports lossy compression. Audio and video codecs only.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
541 * @note a codec may support both lossy and lossless
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
542 * compression modes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
543 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
544 #define AV_CODEC_PROP_LOSSY (1 << 1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
545 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
546 * Codec supports lossless compression. Audio and video codecs only.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
547 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
548 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
549 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
550 * Subtitle codec is bitmap based
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
551 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
552 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
553 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
554 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
555 * Subtitle codec is text based.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
556 * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
557 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
558 #define AV_CODEC_PROP_TEXT_SUB (1 << 17)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
559
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
560 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
561 * @ingroup lavc_decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
562 * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
563 * This is mainly needed because some optimized bitstream readers read
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
564 * 32 or 64 bit at once and could read over the end.<br>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
565 * Note: If the first 23 bits of the additional bytes are not 0, then damaged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
566 * MPEG bitstreams could cause overread and segfault.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
567 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
568 #define FF_INPUT_BUFFER_PADDING_SIZE 16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
569
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
570 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
571 * @ingroup lavc_encoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
572 * minimum encoding buffer size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
573 * Used to avoid some checks during header writing.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
574 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
575 #define FF_MIN_BUFFER_SIZE 16384
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
576
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
577
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
578 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
579 * @ingroup lavc_encoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
580 * motion estimation type.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
581 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
582 enum Motion_Est_ID {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
583 ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
584 ME_FULL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
585 ME_LOG,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
586 ME_PHODS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
587 ME_EPZS, ///< enhanced predictive zonal search
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
588 ME_X1, ///< reserved for experiments
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
589 ME_HEX, ///< hexagon based search
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
590 ME_UMH, ///< uneven multi-hexagon search
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
591 ME_TESA, ///< transformed exhaustive search algorithm
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
592 ME_ITER=50, ///< iterative search
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
593 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
594
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
595 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
596 * @ingroup lavc_decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
597 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
598 enum AVDiscard{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
599 /* We leave some space between them for extensions (drop some
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
600 * keyframes for intra-only or drop just some bidir frames). */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
601 AVDISCARD_NONE =-16, ///< discard nothing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
602 AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
603 AVDISCARD_NONREF = 8, ///< discard all non reference
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
604 AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
605 AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
606 AVDISCARD_ALL = 48, ///< discard all
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
607 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
608
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
609 enum AVColorPrimaries{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
610 AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
611 AVCOL_PRI_UNSPECIFIED = 2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
612 AVCOL_PRI_BT470M = 4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
613 AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
614 AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
615 AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
616 AVCOL_PRI_FILM = 8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
617 AVCOL_PRI_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
618 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
619
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
620 enum AVColorTransferCharacteristic{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
621 AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
622 AVCOL_TRC_UNSPECIFIED = 2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
623 AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
624 AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
625 AVCOL_TRC_SMPTE240M = 7,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
626 AVCOL_TRC_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
627 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
628
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
629 enum AVColorSpace{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
630 AVCOL_SPC_RGB = 0,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
631 AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
632 AVCOL_SPC_UNSPECIFIED = 2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
633 AVCOL_SPC_FCC = 4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
634 AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
635 AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
636 AVCOL_SPC_SMPTE240M = 7,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
637 AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
638 AVCOL_SPC_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
639 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
640 #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
641
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
642 enum AVColorRange{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
643 AVCOL_RANGE_UNSPECIFIED = 0,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
644 AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
645 AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
646 AVCOL_RANGE_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
647 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
648
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
649 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
650 * X X 3 4 X X are luma samples,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
651 * 1 2 1-6 are possible chroma positions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
652 * X X 5 6 X 0 is undefined/unknown position
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
653 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
654 enum AVChromaLocation{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
655 AVCHROMA_LOC_UNSPECIFIED = 0,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
656 AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
657 AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
658 AVCHROMA_LOC_TOPLEFT = 3, ///< DV
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
659 AVCHROMA_LOC_TOP = 4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
660 AVCHROMA_LOC_BOTTOMLEFT = 5,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
661 AVCHROMA_LOC_BOTTOM = 6,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
662 AVCHROMA_LOC_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
663 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
664
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
665 enum AVAudioServiceType {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
666 AV_AUDIO_SERVICE_TYPE_MAIN = 0,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
667 AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
668 AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
669 AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
670 AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
671 AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
672 AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
673 AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
674 AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
675 AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
676 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
677
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
678 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
679 * @ingroup lavc_encoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
680 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
681 typedef struct RcOverride{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
682 int start_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
683 int end_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
684 int qscale; // If this is 0 then quality_factor will be used instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
685 float quality_factor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
686 } RcOverride;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
687
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
688 #define FF_MAX_B_FRAMES 16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
689
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
690 /* encoding support
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
691 These flags can be passed in AVCodecContext.flags before initialization.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
692 Note: Not everything is supported yet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
693 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
694
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
695 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
696 * Allow decoders to produce frames with data planes that are not aligned
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
697 * to CPU requirements (e.g. due to cropping).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
698 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
699 #define CODEC_FLAG_UNALIGNED 0x0001
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
700 #define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
701 #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
702 #define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
703 #define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
704 #define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
705 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
706 * The parent program guarantees that the input for B-frames containing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
707 * streams is not written to for at least s->max_b_frames+1 frames, if
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
708 * this is not set the input will be copied.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
709 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
710 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
711 #define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
712 #define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
713 #define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
714 #define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
715 #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
716 #define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
717 location instead of only at frame boundaries. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
718 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
719 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
720 #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
721 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
722 #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
723 /* Fx : Flag for h263+ extra options */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
724 #define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
725 #define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
726 #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
727 #define CODEC_FLAG_CLOSED_GOP 0x80000000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
728 #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
729 #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
730 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
731 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!!
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
732 #define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
733
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
734 #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
735 #define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
736
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
737 /* Unsupported options :
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
738 * Syntax Arithmetic coding (SAC)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
739 * Reference Picture Selection
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
740 * Independent Segment Decoding */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
741 /* /Fx */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
742 /* codec capabilities */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
743
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
744 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
745 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
746 * Codec uses get_buffer() for allocating buffers and supports custom allocators.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
747 * If not set, it might not use get_buffer() at all or use operations that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
748 * assume the buffer was allocated by avcodec_default_get_buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
749 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
750 #define CODEC_CAP_DR1 0x0002
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
751 #define CODEC_CAP_TRUNCATED 0x0008
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
752 /* Codec can export data for HW decoding (XvMC). */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
753 #define CODEC_CAP_HWACCEL 0x0010
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
754 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
755 * Encoder or decoder requires flushing with NULL input at the end in order to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
756 * give the complete and correct output.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
757 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
758 * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
759 * with NULL data. The user can still send NULL data to the public encode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
760 * or decode function, but libavcodec will not pass it along to the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
761 * unless this flag is set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
762 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
763 * Decoders:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
764 * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
765 * avpkt->size=0 at the end to get the delayed data until the decoder no longer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
766 * returns frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
767 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
768 * Encoders:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
769 * The encoder needs to be fed with NULL data at the end of encoding until the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
770 * encoder no longer returns data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
771 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
772 * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
773 * flag also means that the encoder must set the pts and duration for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
774 * each output packet. If this flag is not set, the pts and duration will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
775 * be determined by libavcodec from the input frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
776 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
777 #define CODEC_CAP_DELAY 0x0020
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
778 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
779 * Codec can be fed a final frame with a smaller size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
780 * This can be used to prevent truncation of the last audio samples.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
781 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
782 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
783 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
784 * Codec can export data for HW decoding (VDPAU).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
785 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
786 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
787 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
788 * Codec can output multiple frames per AVPacket
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
789 * Normally demuxers return one frame at a time, demuxers which do not do
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
790 * are connected to a parser to split what they return into proper frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
791 * This flag is reserved to the very rare category of codecs which have a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
792 * bitstream that cannot be split into frames without timeconsuming
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
793 * operations like full decoding. Demuxers carring such bitstreams thus
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
794 * may return multiple frames in a packet. This has many disadvantages like
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
795 * prohibiting stream copy in many cases thus it should only be considered
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
796 * as a last resort.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
797 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
798 #define CODEC_CAP_SUBFRAMES 0x0100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
799 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
800 * Codec is experimental and is thus avoided in favor of non experimental
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
801 * encoders
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
802 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
803 #define CODEC_CAP_EXPERIMENTAL 0x0200
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
804 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
805 * Codec should fill in channel configuration and samplerate instead of container
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
806 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
807 #define CODEC_CAP_CHANNEL_CONF 0x0400
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
808
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
809 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
810 * Codec is able to deal with negative linesizes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
811 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
812 #define CODEC_CAP_NEG_LINESIZES 0x0800
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
813
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
814 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
815 * Codec supports frame-level multithreading.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
816 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
817 #define CODEC_CAP_FRAME_THREADS 0x1000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
818 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
819 * Codec supports slice-based (or partition-based) multithreading.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
820 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
821 #define CODEC_CAP_SLICE_THREADS 0x2000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
822 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
823 * Codec supports changed parameters at any point.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
824 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
825 #define CODEC_CAP_PARAM_CHANGE 0x4000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
826 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
827 * Codec supports avctx->thread_count == 0 (auto).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
828 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
829 #define CODEC_CAP_AUTO_THREADS 0x8000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
830 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
831 * Audio encoder supports receiving a different number of samples in each call.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
832 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
833 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
834 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
835 * Codec is intra only.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
836 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
837 #define CODEC_CAP_INTRA_ONLY 0x40000000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
838 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
839 * Codec is lossless.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
840 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
841 #define CODEC_CAP_LOSSLESS 0x80000000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
842
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
843 //The following defines may change, don't expect compatibility if you use them.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
844 #define MB_TYPE_INTRA4x4 0x0001
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
845 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
846 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
847 #define MB_TYPE_16x16 0x0008
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
848 #define MB_TYPE_16x8 0x0010
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
849 #define MB_TYPE_8x16 0x0020
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
850 #define MB_TYPE_8x8 0x0040
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
851 #define MB_TYPE_INTERLACED 0x0080
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
852 #define MB_TYPE_DIRECT2 0x0100 //FIXME
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
853 #define MB_TYPE_ACPRED 0x0200
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
854 #define MB_TYPE_GMC 0x0400
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
855 #define MB_TYPE_SKIP 0x0800
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
856 #define MB_TYPE_P0L0 0x1000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
857 #define MB_TYPE_P1L0 0x2000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
858 #define MB_TYPE_P0L1 0x4000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
859 #define MB_TYPE_P1L1 0x8000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
860 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
861 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
862 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
863 #define MB_TYPE_QUANT 0x00010000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
864 #define MB_TYPE_CBP 0x00020000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
865 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
866
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
867 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
868 * Pan Scan area.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
869 * This specifies the area which should be displayed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
870 * Note there may be multiple such areas for one frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
871 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
872 typedef struct AVPanScan{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
873 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
874 * id
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
875 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
876 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
877 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
878 int id;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
879
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
880 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
881 * width and height in 1/16 pel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
882 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
883 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
884 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
885 int width;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
886 int height;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
887
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
888 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
889 * position of the top left corner in 1/16 pel for up to 3 fields/frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
890 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
891 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
892 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
893 int16_t position[3][2];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
894 }AVPanScan;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
895
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
896 #define FF_QSCALE_TYPE_MPEG1 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
897 #define FF_QSCALE_TYPE_MPEG2 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
898 #define FF_QSCALE_TYPE_H264 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
899 #define FF_QSCALE_TYPE_VP56 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
900
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
901 #if FF_API_GET_BUFFER
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
902 #define FF_BUFFER_TYPE_INTERNAL 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
903 #define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
904 #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
905 #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
906
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
907 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
908 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
909 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
910 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
911 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
912
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
913 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
914 * The decoder will keep a reference to the frame and may reuse it later.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
915 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
916 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
917
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
918 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
919 * @defgroup lavc_packet AVPacket
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
920 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
921 * Types and functions for working with AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
922 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
923 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
924 enum AVPacketSideDataType {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
925 AV_PKT_DATA_PALETTE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
926 AV_PKT_DATA_NEW_EXTRADATA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
927
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
928 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
929 * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
930 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
931 * u32le param_flags
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
932 * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
933 * s32le channel_count
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
934 * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
935 * u64le channel_layout
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
936 * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
937 * s32le sample_rate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
938 * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
939 * s32le width
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
940 * s32le height
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
941 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
942 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
943 AV_PKT_DATA_PARAM_CHANGE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
944
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
945 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
946 * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
947 * structures with info about macroblocks relevant to splitting the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
948 * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
949 * That is, it does not necessarily contain info about all macroblocks,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
950 * as long as the distance between macroblocks in the info is smaller
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
951 * than the target payload size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
952 * Each MB info structure is 12 bytes, and is laid out as follows:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
953 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
954 * u32le bit offset from the start of the packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
955 * u8 current quantizer at the start of the macroblock
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
956 * u8 GOB number
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
957 * u16le macroblock address within the GOB
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
958 * u8 horizontal MV predictor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
959 * u8 vertical MV predictor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
960 * u8 horizontal MV predictor for block number 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
961 * u8 vertical MV predictor for block number 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
962 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
963 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
964 AV_PKT_DATA_H263_MB_INFO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
965
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
966 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
967 * Recommmends skipping the specified number of samples
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
968 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
969 * u32le number of samples to skip from start of this packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
970 * u32le number of samples to skip from end of this packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
971 * u8 reason for start skip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
972 * u8 reason for end skip (0=padding silence, 1=convergence)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
973 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
974 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
975 AV_PKT_DATA_SKIP_SAMPLES=70,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
976
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
977 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
978 * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
979 * the packet may contain "dual mono" audio specific to Japanese DTV
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
980 * and if it is true, recommends only the selected channel to be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
981 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
982 * u8 selected channels (0=mail/left, 1=sub/right, 2=both)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
983 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
984 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
985 AV_PKT_DATA_JP_DUALMONO,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
986
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
987 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
988 * A list of zero terminated key/value strings. There is no end marker for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
989 * the list, so it is required to rely on the side data size to stop.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
990 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
991 AV_PKT_DATA_STRINGS_METADATA,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
992
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
993 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
994 * Subtitle event position
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
995 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
996 * u32le x1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
997 * u32le y1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
998 * u32le x2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
999 * u32le y2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1000 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1001 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1002 AV_PKT_DATA_SUBTITLE_POSITION,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1003
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1004 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1005 * Data found in BlockAdditional element of matroska container. There is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1006 * no end marker for the data, so it is required to rely on the side data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1007 * size to recognize the end. 8 byte id (as found in BlockAddId) followed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1008 * by data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1009 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1010 AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1011 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1012
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1013 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1014 * This structure stores compressed data. It is typically exported by demuxers
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1015 * and then passed as input to decoders, or received as output from encoders and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1016 * then passed to muxers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1017 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1018 * For video, it should typically contain one compressed frame. For audio it may
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1019 * contain several compressed frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1020 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1021 * AVPacket is one of the few structs in FFmpeg, whose size is a part of public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1022 * ABI. Thus it may be allocated on stack and no new fields can be added to it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1023 * without libavcodec and libavformat major bump.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1024 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1025 * The semantics of data ownership depends on the buf or destruct (deprecated)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1026 * fields. If either is set, the packet data is dynamically allocated and is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1027 * valid indefinitely until av_free_packet() is called (which in turn calls
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1028 * av_buffer_unref()/the destruct callback to free the data). If neither is set,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1029 * the packet data is typically backed by some static buffer somewhere and is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1030 * only valid for a limited time (e.g. until the next read call when demuxing).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1031 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1032 * The side data is always allocated with av_malloc() and is freed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1033 * av_free_packet().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1034 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1035 typedef struct AVPacket {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1036 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1037 * A reference to the reference-counted buffer where the packet data is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1038 * stored.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1039 * May be NULL, then the packet data is not reference-counted.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1040 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1041 AVBufferRef *buf;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1042 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1043 * Presentation timestamp in AVStream->time_base units; the time at which
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1044 * the decompressed packet will be presented to the user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1045 * Can be AV_NOPTS_VALUE if it is not stored in the file.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1046 * pts MUST be larger or equal to dts as presentation cannot happen before
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1047 * decompression, unless one wants to view hex dumps. Some formats misuse
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1048 * the terms dts and pts/cts to mean something different. Such timestamps
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1049 * must be converted to true pts/dts before they are stored in AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1050 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1051 int64_t pts;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1052 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1053 * Decompression timestamp in AVStream->time_base units; the time at which
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1054 * the packet is decompressed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1055 * Can be AV_NOPTS_VALUE if it is not stored in the file.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1056 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1057 int64_t dts;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1058 uint8_t *data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1059 int size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1060 int stream_index;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1061 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1062 * A combination of AV_PKT_FLAG values
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1063 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1064 int flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1065 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1066 * Additional packet data that can be provided by the container.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1067 * Packet can contain several types of side information.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1068 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1069 struct {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1070 uint8_t *data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1071 int size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1072 enum AVPacketSideDataType type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1073 } *side_data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1074 int side_data_elems;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1075
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1076 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1077 * Duration of this packet in AVStream->time_base units, 0 if unknown.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1078 * Equals next_pts - this_pts in presentation order.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1079 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1080 int duration;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1081 #if FF_API_DESTRUCT_PACKET
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1082 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1083 void (*destruct)(struct AVPacket *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1084 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1085 void *priv;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1086 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1087 int64_t pos; ///< byte position in stream, -1 if unknown
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1088
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1089 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1090 * Time difference in AVStream->time_base units from the pts of this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1091 * packet to the point at which the output from the decoder has converged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1092 * independent from the availability of previous frames. That is, the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1093 * frames are virtually identical no matter if decoding started from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1094 * the very first frame or from this keyframe.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1095 * Is AV_NOPTS_VALUE if unknown.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1096 * This field is not the display duration of the current packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1097 * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1098 * set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1099 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1100 * The purpose of this field is to allow seeking in streams that have no
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1101 * keyframes in the conventional sense. It corresponds to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1102 * recovery point SEI in H.264 and match_time_delta in NUT. It is also
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1103 * essential for some types of subtitle streams to ensure that all
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1104 * subtitles are correctly displayed after seeking.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1105 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1106 int64_t convergence_duration;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1107 } AVPacket;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1108 #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1109 #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1110
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1111 enum AVSideDataParamChangeFlags {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1112 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1113 AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1114 AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1115 AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1116 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1117 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1118 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1119 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1120
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1121 struct AVCodecInternal;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1122
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1123 enum AVFieldOrder {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1124 AV_FIELD_UNKNOWN,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1125 AV_FIELD_PROGRESSIVE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1126 AV_FIELD_TT, //< Top coded_first, top displayed first
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1127 AV_FIELD_BB, //< Bottom coded first, bottom displayed first
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1128 AV_FIELD_TB, //< Top coded first, bottom displayed first
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1129 AV_FIELD_BT, //< Bottom coded first, top displayed first
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1130 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1131
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1132 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1133 * main external API structure.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1134 * New fields can be added to the end with minor version bumps.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1135 * Removal, reordering and changes to existing fields require a major
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1136 * version bump.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1137 * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1138 * applications.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1139 * sizeof(AVCodecContext) must not be used outside libav*.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1140 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1141 typedef struct AVCodecContext {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1142 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1143 * information on struct for av_log
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1144 * - set by avcodec_alloc_context3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1145 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1146 const AVClass *av_class;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1147 int log_level_offset;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1148
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1149 enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1150 const struct AVCodec *codec;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1151 char codec_name[32];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1152 enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1153
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1154 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1155 * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1156 * This is used to work around some encoder bugs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1157 * A demuxer should set this to what is stored in the field used to identify the codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1158 * If there are multiple such fields in a container then the demuxer should choose the one
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1159 * which maximizes the information about the used codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1160 * If the codec tag field in a container is larger than 32 bits then the demuxer should
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1161 * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1162 * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1163 * first.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1164 * - encoding: Set by user, if not then the default based on codec_id will be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1165 * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1166 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1167 unsigned int codec_tag;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1168
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1169 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1170 * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1171 * This is used to work around some encoder bugs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1172 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1173 * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1174 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1175 unsigned int stream_codec_tag;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1176
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1177 void *priv_data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1178
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1179 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1180 * Private context used for internal data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1181 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1182 * Unlike priv_data, this is not codec-specific. It is used in general
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1183 * libavcodec functions.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1184 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1185 struct AVCodecInternal *internal;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1186
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1187 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1188 * Private data of the user, can be used to carry app specific stuff.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1189 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1190 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1191 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1192 void *opaque;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1193
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1194 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1195 * the average bitrate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1196 * - encoding: Set by user; unused for constant quantizer encoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1197 * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1198 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1199 int bit_rate;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1200
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1201 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1202 * number of bits the bitstream is allowed to diverge from the reference.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1203 * the reference can be CBR (for CBR pass1) or VBR (for pass2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1204 * - encoding: Set by user; unused for constant quantizer encoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1205 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1206 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1207 int bit_rate_tolerance;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1208
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1209 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1210 * Global quality for codecs which cannot change it per frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1211 * This should be proportional to MPEG-1/2/4 qscale.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1212 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1213 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1214 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1215 int global_quality;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1216
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1217 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1218 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1219 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1220 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1221 int compression_level;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1222 #define FF_COMPRESSION_DEFAULT -1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1223
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1224 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1225 * CODEC_FLAG_*.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1226 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1227 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1228 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1229 int flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1230
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1231 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1232 * CODEC_FLAG2_*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1233 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1234 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1235 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1236 int flags2;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1237
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1238 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1239 * some codecs need / can use extradata like Huffman tables.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1240 * mjpeg: Huffman tables
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1241 * rv10: additional flags
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1242 * mpeg4: global headers (they can be in the bitstream or here)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1243 * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1244 * than extradata_size to avoid prolems if it is read with the bitstream reader.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1245 * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1246 * - encoding: Set/allocated/freed by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1247 * - decoding: Set/allocated/freed by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1248 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1249 uint8_t *extradata;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1250 int extradata_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1251
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1252 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1253 * This is the fundamental unit of time (in seconds) in terms
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1254 * of which frame timestamps are represented. For fixed-fps content,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1255 * timebase should be 1/framerate and timestamp increments should be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1256 * identically 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1257 * - encoding: MUST be set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1258 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1259 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1260 AVRational time_base;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1261
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1262 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1263 * For some codecs, the time base is closer to the field rate than the frame rate.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1264 * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1265 * if no telecine is used ...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1266 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1267 * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1268 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1269 int ticks_per_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1270
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1271 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1272 * Codec delay.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1273 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1274 * Encoding: Number of frames delay there will be from the encoder input to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1275 * the decoder output. (we assume the decoder matches the spec)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1276 * Decoding: Number of frames delay in addition to what a standard decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1277 * as specified in the spec would produce.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1278 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1279 * Video:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1280 * Number of frames the decoded output will be delayed relative to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1281 * encoded input.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1282 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1283 * Audio:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1284 * For encoding, this is the number of "priming" samples added to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1285 * beginning of the stream. The decoded output will be delayed by this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1286 * many samples relative to the input to the encoder. Note that this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1287 * field is purely informational and does not directly affect the pts
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1288 * output by the encoder, which should always be based on the actual
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1289 * presentation time, including any delay.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1290 * For decoding, this is the number of samples the decoder needs to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1291 * output before the decoder's output is valid. When seeking, you should
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1292 * start decoding this many samples prior to your desired seek point.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1293 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1294 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1295 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1296 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1297 int delay;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1298
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1299
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1300 /* video only */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1301 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1302 * picture width / height.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1303 * - encoding: MUST be set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1304 * - decoding: May be set by the user before opening the decoder if known e.g.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1305 * from the container. Some decoders will require the dimensions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1306 * to be set by the caller. During decoding, the decoder may
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1307 * overwrite those values as required.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1308 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1309 int width, height;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1310
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1311 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1312 * Bitstream width / height, may be different from width/height e.g. when
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1313 * the decoded frame is cropped before being output or lowres is enabled.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1314 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1315 * - decoding: May be set by the user before opening the decoder if known
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1316 * e.g. from the container. During decoding, the decoder may
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1317 * overwrite those values as required.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1318 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1319 int coded_width, coded_height;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1320
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1321 #define FF_ASPECT_EXTENDED 15
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1322
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1323 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1324 * the number of pictures in a group of pictures, or 0 for intra_only
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1325 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1326 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1327 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1328 int gop_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1329
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1330 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1331 * Pixel format, see AV_PIX_FMT_xxx.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1332 * May be set by the demuxer if known from headers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1333 * May be overridden by the decoder if it knows better.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1334 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1335 * - decoding: Set by user if known, overridden by libavcodec if known
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1336 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1337 enum AVPixelFormat pix_fmt;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1338
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1339 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1340 * Motion estimation algorithm used for video coding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1341 * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1342 * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1343 * - encoding: MUST be set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1344 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1345 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1346 int me_method;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1347
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1348 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1349 * If non NULL, 'draw_horiz_band' is called by the libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1350 * decoder to draw a horizontal band. It improves cache usage. Not
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1351 * all codecs can do that. You must check the codec capabilities
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1352 * beforehand.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1353 * When multithreading is used, it may be called from multiple threads
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1354 * at the same time; threads might draw different parts of the same AVFrame,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1355 * or multiple AVFrames, and there is no guarantee that slices will be drawn
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1356 * in order.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1357 * The function is also used by hardware acceleration APIs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1358 * It is called at least once during frame decoding to pass
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1359 * the data needed for hardware render.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1360 * In that mode instead of pixel data, AVFrame points to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1361 * a structure specific to the acceleration API. The application
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1362 * reads the structure and can change some fields to indicate progress
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1363 * or mark state.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1364 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1365 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1366 * @param height the height of the slice
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1367 * @param y the y position of the slice
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1368 * @param type 1->top field, 2->bottom field, 3->frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1369 * @param offset offset into the AVFrame.data from which the slice should be read
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1370 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1371 void (*draw_horiz_band)(struct AVCodecContext *s,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1372 const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1373 int y, int type, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1374
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1375 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1376 * callback to negotiate the pixelFormat
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1377 * @param fmt is the list of formats which are supported by the codec,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1378 * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1379 * The first is always the native one.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1380 * @return the chosen format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1381 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1382 * - decoding: Set by user, if not set the native format will be chosen.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1383 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1384 enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1385
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1386 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1387 * maximum number of B-frames between non-B-frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1388 * Note: The output will be delayed by max_b_frames+1 relative to the input.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1389 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1390 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1391 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1392 int max_b_frames;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1393
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1394 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1395 * qscale factor between IP and B-frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1396 * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1397 * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1398 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1399 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1400 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1401 float b_quant_factor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1402
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1403 /** obsolete FIXME remove */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1404 int rc_strategy;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1405 #define FF_RC_STRATEGY_XVID 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1406
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1407 int b_frame_strategy;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1408
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1409 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1410 * qscale offset between IP and B-frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1411 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1412 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1413 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1414 float b_quant_offset;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1415
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1416 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1417 * Size of the frame reordering buffer in the decoder.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1418 * For MPEG-2 it is 1 IPB or 0 low delay IP.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1419 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1420 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1421 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1422 int has_b_frames;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1423
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1424 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1425 * 0-> h263 quant 1-> mpeg quant
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1426 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1427 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1428 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1429 int mpeg_quant;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1430
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1431 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1432 * qscale factor between P and I-frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1433 * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1434 * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1435 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1436 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1437 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1438 float i_quant_factor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1439
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1440 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1441 * qscale offset between P and I-frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1442 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1443 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1444 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1445 float i_quant_offset;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1446
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1447 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1448 * luminance masking (0-> disabled)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1449 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1450 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1451 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1452 float lumi_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1453
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1454 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1455 * temporary complexity masking (0-> disabled)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1456 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1457 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1458 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1459 float temporal_cplx_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1460
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1461 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1462 * spatial complexity masking (0-> disabled)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1463 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1464 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1465 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1466 float spatial_cplx_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1467
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1468 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1469 * p block masking (0-> disabled)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1470 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1471 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1472 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1473 float p_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1474
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1475 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1476 * darkness masking (0-> disabled)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1477 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1478 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1479 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1480 float dark_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1481
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1482 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1483 * slice count
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1484 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1485 * - decoding: Set by user (or 0).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1486 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1487 int slice_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1488 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1489 * prediction method (needed for huffyuv)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1490 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1491 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1492 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1493 int prediction_method;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1494 #define FF_PRED_LEFT 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1495 #define FF_PRED_PLANE 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1496 #define FF_PRED_MEDIAN 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1497
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1498 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1499 * slice offsets in the frame in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1500 * - encoding: Set/allocated by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1501 * - decoding: Set/allocated by user (or NULL).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1502 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1503 int *slice_offset;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1504
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1505 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1506 * sample aspect ratio (0 if unknown)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1507 * That is the width of a pixel divided by the height of the pixel.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1508 * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1509 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1510 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1511 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1512 AVRational sample_aspect_ratio;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1513
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1514 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1515 * motion estimation comparison function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1516 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1517 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1518 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1519 int me_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1520 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1521 * subpixel motion estimation comparison function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1522 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1523 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1524 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1525 int me_sub_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1526 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1527 * macroblock comparison function (not supported yet)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1528 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1529 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1530 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1531 int mb_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1532 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1533 * interlaced DCT comparison function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1534 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1535 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1536 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1537 int ildct_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1538 #define FF_CMP_SAD 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1539 #define FF_CMP_SSE 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1540 #define FF_CMP_SATD 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1541 #define FF_CMP_DCT 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1542 #define FF_CMP_PSNR 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1543 #define FF_CMP_BIT 5
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1544 #define FF_CMP_RD 6
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1545 #define FF_CMP_ZERO 7
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1546 #define FF_CMP_VSAD 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1547 #define FF_CMP_VSSE 9
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1548 #define FF_CMP_NSSE 10
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1549 #define FF_CMP_W53 11
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1550 #define FF_CMP_W97 12
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1551 #define FF_CMP_DCTMAX 13
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1552 #define FF_CMP_DCT264 14
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1553 #define FF_CMP_CHROMA 256
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1554
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1555 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1556 * ME diamond size & shape
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1557 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1558 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1559 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1560 int dia_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1561
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1562 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1563 * amount of previous MV predictors (2a+1 x 2a+1 square)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1564 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1565 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1566 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1567 int last_predictor_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1568
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1569 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1570 * prepass for motion estimation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1571 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1572 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1573 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1574 int pre_me;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1575
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1576 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1577 * motion estimation prepass comparison function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1578 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1579 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1580 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1581 int me_pre_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1582
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1583 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1584 * ME prepass diamond size & shape
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1585 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1586 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1587 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1588 int pre_dia_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1589
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1590 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1591 * subpel ME quality
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1592 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1593 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1594 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1595 int me_subpel_quality;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1596
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1597 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1598 * DTG active format information (additional aspect ratio
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1599 * information only used in DVB MPEG-2 transport streams)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1600 * 0 if not set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1601 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1602 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1603 * - decoding: Set by decoder.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1604 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1605 int dtg_active_format;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1606 #define FF_DTG_AFD_SAME 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1607 #define FF_DTG_AFD_4_3 9
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1608 #define FF_DTG_AFD_16_9 10
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1609 #define FF_DTG_AFD_14_9 11
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1610 #define FF_DTG_AFD_4_3_SP_14_9 13
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1611 #define FF_DTG_AFD_16_9_SP_14_9 14
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1612 #define FF_DTG_AFD_SP_4_3 15
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1613
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1614 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1615 * maximum motion estimation search range in subpel units
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1616 * If 0 then no limit.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1617 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1618 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1619 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1620 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1621 int me_range;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1622
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1623 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1624 * intra quantizer bias
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1625 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1626 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1627 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1628 int intra_quant_bias;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1629 #define FF_DEFAULT_QUANT_BIAS 999999
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1630
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1631 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1632 * inter quantizer bias
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1633 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1634 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1635 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1636 int inter_quant_bias;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1637
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1638 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1639 * slice flags
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1640 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1641 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1642 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1643 int slice_flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1644 #define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1645 #define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1646 #define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1647
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1648 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1649 * XVideo Motion Acceleration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1650 * - encoding: forbidden
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1651 * - decoding: set by decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1652 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1653 int xvmc_acceleration;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1654
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1655 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1656 * macroblock decision mode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1657 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1658 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1659 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1660 int mb_decision;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1661 #define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1662 #define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1663 #define FF_MB_DECISION_RD 2 ///< rate distortion
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1664
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1665 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1666 * custom intra quantization matrix
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1667 * - encoding: Set by user, can be NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1668 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1669 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1670 uint16_t *intra_matrix;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1671
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1672 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1673 * custom inter quantization matrix
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1674 * - encoding: Set by user, can be NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1675 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1676 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1677 uint16_t *inter_matrix;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1678
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1679 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1680 * scene change detection threshold
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1681 * 0 is default, larger means fewer detected scene changes.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1682 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1683 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1684 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1685 int scenechange_threshold;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1686
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1687 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1688 * noise reduction strength
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1689 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1690 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1691 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1692 int noise_reduction;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1693
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1694 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1695 * Motion estimation threshold below which no motion estimation is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1696 * performed, but instead the user specified motion vectors are used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1697 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1698 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1699 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1700 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1701 int me_threshold;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1702
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1703 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1704 * Macroblock threshold below which the user specified macroblock types will be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1705 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1706 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1707 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1708 int mb_threshold;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1709
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1710 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1711 * precision of the intra DC coefficient - 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1712 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1713 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1714 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1715 int intra_dc_precision;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1716
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1717 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1718 * Number of macroblock rows at the top which are skipped.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1719 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1720 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1721 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1722 int skip_top;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1723
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1724 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1725 * Number of macroblock rows at the bottom which are skipped.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1726 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1727 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1728 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1729 int skip_bottom;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1730
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1731 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1732 * Border processing masking, raises the quantizer for mbs on the borders
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1733 * of the picture.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1734 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1735 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1736 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1737 float border_masking;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1738
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1739 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1740 * minimum MB lagrange multipler
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1741 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1742 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1743 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1744 int mb_lmin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1745
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1746 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1747 * maximum MB lagrange multipler
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1748 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1749 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1750 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1751 int mb_lmax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1752
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1753 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1754 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1755 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1756 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1757 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1758 int me_penalty_compensation;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1759
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1760 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1761 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1762 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1763 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1764 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1765 int bidir_refine;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1766
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1767 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1768 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1769 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1770 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1771 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1772 int brd_scale;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1773
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1774 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1775 * minimum GOP size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1776 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1777 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1778 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1779 int keyint_min;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1780
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1781 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1782 * number of reference frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1783 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1784 * - decoding: Set by lavc.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1785 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1786 int refs;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1787
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1788 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1789 * chroma qp offset from luma
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1790 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1791 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1792 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1793 int chromaoffset;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1794
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1795 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1796 * Multiplied by qscale for each frame and added to scene_change_score.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1797 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1798 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1799 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1800 int scenechange_factor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1801
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1802 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1803 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1804 * Note: Value depends upon the compare function used for fullpel ME.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1805 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1806 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1807 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1808 int mv0_threshold;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1809
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1810 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1811 * Adjust sensitivity of b_frame_strategy 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1812 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1813 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1814 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1815 int b_sensitivity;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1816
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1817 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1818 * Chromaticity coordinates of the source primaries.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1819 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1820 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1821 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1822 enum AVColorPrimaries color_primaries;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1823
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1824 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1825 * Color Transfer Characteristic.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1826 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1827 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1828 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1829 enum AVColorTransferCharacteristic color_trc;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1830
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1831 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1832 * YUV colorspace type.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1833 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1834 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1835 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1836 enum AVColorSpace colorspace;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1837
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1838 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1839 * MPEG vs JPEG YUV range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1840 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1841 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1842 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1843 enum AVColorRange color_range;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1844
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1845 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1846 * This defines the location of chroma samples.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1847 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1848 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1849 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1850 enum AVChromaLocation chroma_sample_location;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1851
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1852 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1853 * Number of slices.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1854 * Indicates number of picture subdivisions. Used for parallelized
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1855 * decoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1856 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1857 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1858 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1859 int slices;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1860
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1861 /** Field order
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1862 * - encoding: set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1863 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1864 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1865 enum AVFieldOrder field_order;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1866
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1867 /* audio only */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1868 int sample_rate; ///< samples per second
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1869 int channels; ///< number of audio channels
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1870
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1871 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1872 * audio sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1873 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1874 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1875 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1876 enum AVSampleFormat sample_fmt; ///< sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1877
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1878 /* The following data should not be initialized. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1879 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1880 * Number of samples per channel in an audio frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1881 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1882 * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1883 * except the last must contain exactly frame_size samples per channel.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1884 * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1885 * frame size is not restricted.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1886 * - decoding: may be set by some decoders to indicate constant frame size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1887 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1888 int frame_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1889
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1890 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1891 * Frame counter, set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1892 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1893 * - decoding: total number of frames returned from the decoder so far.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1894 * - encoding: total number of frames passed to the encoder so far.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1895 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1896 * @note the counter is not incremented if encoding/decoding resulted in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1897 * an error.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1898 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1899 int frame_number;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1900
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1901 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1902 * number of bytes per packet if constant and known or 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1903 * Used by some WAV based audio codecs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1904 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1905 int block_align;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1906
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1907 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1908 * Audio cutoff bandwidth (0 means "automatic")
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1909 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1910 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1911 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1912 int cutoff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1913
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1914 #if FF_API_REQUEST_CHANNELS
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1915 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1916 * Decoder should decode to this many channels if it can (0 for default)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1917 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1918 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1919 * @deprecated Deprecated in favor of request_channel_layout.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1920 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1921 int request_channels;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1922 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1923
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1924 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1925 * Audio channel layout.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1926 * - encoding: set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1927 * - decoding: set by user, may be overwritten by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1928 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1929 uint64_t channel_layout;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1930
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1931 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1932 * Request decoder to use this channel layout if it can (0 for default)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1933 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1934 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1935 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1936 uint64_t request_channel_layout;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1937
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1938 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1939 * Type of service that the audio stream conveys.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1940 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1941 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1942 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1943 enum AVAudioServiceType audio_service_type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1944
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1945 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1946 * desired sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1947 * - encoding: Not used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1948 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1949 * Decoder will decode to this format if it can.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1950 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1951 enum AVSampleFormat request_sample_fmt;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1952
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1953 #if FF_API_GET_BUFFER
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1954 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1955 * Called at the beginning of each frame to get a buffer for it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1956 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1957 * The function will set AVFrame.data[], AVFrame.linesize[].
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1958 * AVFrame.extended_data[] must also be set, but it should be the same as
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1959 * AVFrame.data[] except for planar audio with more channels than can fit
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1960 * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1961 * many data pointers as it can hold.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1962 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1963 * if CODEC_CAP_DR1 is not set then get_buffer() must call
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1964 * avcodec_default_get_buffer() instead of providing buffers allocated by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1965 * some other means.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1966 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1967 * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1968 * need it. avcodec_default_get_buffer() aligns the output buffer properly,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1969 * but if get_buffer() is overridden then alignment considerations should
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1970 * be taken into account.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1971 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1972 * @see avcodec_default_get_buffer()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1973 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1974 * Video:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1975 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1976 * If pic.reference is set then the frame will be read later by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1977 * avcodec_align_dimensions2() should be used to find the required width and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1978 * height, as they normally need to be rounded up to the next multiple of 16.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1979 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1980 * If frame multithreading is used and thread_safe_callbacks is set,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1981 * it may be called from a different thread, but not from more than one at
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1982 * once. Does not need to be reentrant.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1983 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1984 * @see release_buffer(), reget_buffer()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1985 * @see avcodec_align_dimensions2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1986 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1987 * Audio:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1988 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1989 * Decoders request a buffer of a particular size by setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1990 * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1991 * however, utilize only part of the buffer by setting AVFrame.nb_samples
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1992 * to a smaller value in the output frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1993 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1994 * Decoders cannot use the buffer after returning from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1995 * avcodec_decode_audio4(), so they will not call release_buffer(), as it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1996 * is assumed to be released immediately upon return. In some rare cases,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1997 * a decoder may need to call get_buffer() more than once in a single
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1998 * call to avcodec_decode_audio4(). In that case, when get_buffer() is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1999 * called again after it has already been called once, the previously
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2000 * acquired buffer is assumed to be released at that time and may not be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2001 * reused by the decoder.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2002 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2003 * As a convenience, av_samples_get_buffer_size() and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2004 * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2005 * functions to find the required data size and to fill data pointers and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2006 * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2007 * since all planes must be the same size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2008 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2009 * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2010 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2011 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2012 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2013 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2014 * @deprecated use get_buffer2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2015 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2016 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2017 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2018
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2019 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2020 * Called to release buffers which were allocated with get_buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2021 * A released buffer can be reused in get_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2022 * pic.data[*] must be set to NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2023 * May be called from a different thread if frame multithreading is used,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2024 * but not by more than one thread at once, so does not need to be reentrant.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2025 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2026 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2027 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2028 * @deprecated custom freeing callbacks should be set from get_buffer2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2029 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2030 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2031 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2032
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2033 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2034 * Called at the beginning of a frame to get cr buffer for it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2035 * Buffer type (size, hints) must be the same. libavcodec won't check it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2036 * libavcodec will pass previous buffer in pic, function should return
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2037 * same buffer or new buffer with old frame "painted" into it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2038 * If pic.data[0] == NULL must behave like get_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2039 * if CODEC_CAP_DR1 is not set then reget_buffer() must call
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2040 * avcodec_default_reget_buffer() instead of providing buffers allocated by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2041 * some other means.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2042 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2043 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2044 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2045 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2046 int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2047 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2048
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2049 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2050 * This callback is called at the beginning of each frame to get data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2051 * buffer(s) for it. There may be one contiguous buffer for all the data or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2052 * there may be a buffer per each data plane or anything in between. What
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2053 * this means is, you may set however many entries in buf[] you feel necessary.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2054 * Each buffer must be reference-counted using the AVBuffer API (see description
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2055 * of buf[] below).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2056 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2057 * The following fields will be set in the frame before this callback is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2058 * called:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2059 * - format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2060 * - width, height (video only)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2061 * - sample_rate, channel_layout, nb_samples (audio only)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2062 * Their values may differ from the corresponding values in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2063 * AVCodecContext. This callback must use the frame values, not the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2064 * context values, to calculate the required buffer size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2065 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2066 * This callback must fill the following fields in the frame:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2067 * - data[]
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2068 * - linesize[]
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2069 * - extended_data:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2070 * * if the data is planar audio with more than 8 channels, then this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2071 * callback must allocate and fill extended_data to contain all pointers
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2072 * to all data planes. data[] must hold as many pointers as it can.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2073 * extended_data must be allocated with av_malloc() and will be freed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2074 * av_frame_unref().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2075 * * otherwise exended_data must point to data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2076 * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2077 * the frame's data and extended_data pointers must be contained in these. That
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2078 * is, one AVBufferRef for each allocated chunk of memory, not necessarily one
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2079 * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2080 * and av_buffer_ref().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2081 * - extended_buf and nb_extended_buf must be allocated with av_malloc() by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2082 * this callback and filled with the extra buffers if there are more
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2083 * buffers than buf[] can hold. extended_buf will be freed in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2084 * av_frame_unref().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2085 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2086 * If CODEC_CAP_DR1 is not set then get_buffer2() must call
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2087 * avcodec_default_get_buffer2() instead of providing buffers allocated by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2088 * some other means.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2089 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2090 * Each data plane must be aligned to the maximum required by the target
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2091 * CPU.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2092 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2093 * @see avcodec_default_get_buffer2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2094 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2095 * Video:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2096 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2097 * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2098 * (read and/or written to if it is writable) later by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2099 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2100 * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2101 * edge of the size returned by avcodec_get_edge_width() on all sides.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2102 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2103 * avcodec_align_dimensions2() should be used to find the required width and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2104 * height, as they normally need to be rounded up to the next multiple of 16.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2105 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2106 * If frame multithreading is used and thread_safe_callbacks is set,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2107 * this callback may be called from a different thread, but not from more
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2108 * than one at once. Does not need to be reentrant.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2109 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2110 * @see avcodec_align_dimensions2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2111 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2112 * Audio:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2113 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2114 * Decoders request a buffer of a particular size by setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2115 * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2116 * however, utilize only part of the buffer by setting AVFrame.nb_samples
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2117 * to a smaller value in the output frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2118 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2119 * As a convenience, av_samples_get_buffer_size() and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2120 * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2121 * functions to find the required data size and to fill data pointers and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2122 * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2123 * since all planes must be the same size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2124 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2125 * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2126 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2127 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2128 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2129 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2130 int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2131
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2132 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2133 * If non-zero, the decoded audio and video frames returned from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2134 * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2135 * and are valid indefinitely. The caller must free them with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2136 * av_frame_unref() when they are not needed anymore.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2137 * Otherwise, the decoded frames must not be freed by the caller and are
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2138 * only valid until the next decode call.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2139 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2140 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2141 * - decoding: set by the caller before avcodec_open2().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2142 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2143 int refcounted_frames;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2144
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2145 /* - encoding parameters */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2146 float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2147 float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2148
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2149 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2150 * minimum quantizer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2151 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2152 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2153 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2154 int qmin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2155
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2156 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2157 * maximum quantizer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2158 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2159 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2160 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2161 int qmax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2162
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2163 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2164 * maximum quantizer difference between frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2165 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2166 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2167 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2168 int max_qdiff;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2169
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2170 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2171 * ratecontrol qmin qmax limiting method
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2172 * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2173 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2174 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2175 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2176 float rc_qsquish;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2177
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2178 float rc_qmod_amp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2179 int rc_qmod_freq;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2180
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2181 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2182 * decoder bitstream buffer size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2183 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2184 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2185 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2186 int rc_buffer_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2187
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2188 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2189 * ratecontrol override, see RcOverride
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2190 * - encoding: Allocated/set/freed by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2191 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2192 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2193 int rc_override_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2194 RcOverride *rc_override;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2195
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2196 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2197 * rate control equation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2198 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2199 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2200 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2201 const char *rc_eq;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2202
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2203 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2204 * maximum bitrate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2205 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2206 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2207 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2208 int rc_max_rate;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2209
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2210 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2211 * minimum bitrate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2212 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2213 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2214 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2215 int rc_min_rate;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2216
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2217 float rc_buffer_aggressivity;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2218
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2219 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2220 * initial complexity for pass1 ratecontrol
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2221 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2222 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2223 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2224 float rc_initial_cplx;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2225
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2226 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2227 * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2228 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2229 * - decoding: unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2230 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2231 float rc_max_available_vbv_use;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2232
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2233 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2234 * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2235 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2236 * - decoding: unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2237 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2238 float rc_min_vbv_overflow_use;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2239
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2240 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2241 * Number of bits which should be loaded into the rc buffer before decoding starts.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2242 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2243 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2244 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2245 int rc_initial_buffer_occupancy;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2246
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2247 #define FF_CODER_TYPE_VLC 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2248 #define FF_CODER_TYPE_AC 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2249 #define FF_CODER_TYPE_RAW 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2250 #define FF_CODER_TYPE_RLE 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2251 #define FF_CODER_TYPE_DEFLATE 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2252 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2253 * coder type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2254 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2255 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2256 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2257 int coder_type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2258
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2259 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2260 * context model
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2261 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2262 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2263 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2264 int context_model;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2265
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2266 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2267 * minimum Lagrange multipler
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2268 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2269 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2270 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2271 int lmin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2272
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2273 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2274 * maximum Lagrange multipler
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2275 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2276 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2277 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2278 int lmax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2279
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2280 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2281 * frame skip threshold
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2282 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2283 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2284 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2285 int frame_skip_threshold;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2286
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2287 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2288 * frame skip factor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2289 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2290 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2291 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2292 int frame_skip_factor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2293
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2294 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2295 * frame skip exponent
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2296 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2297 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2298 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2299 int frame_skip_exp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2300
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2301 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2302 * frame skip comparison function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2303 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2304 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2305 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2306 int frame_skip_cmp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2307
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2308 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2309 * trellis RD quantization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2310 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2311 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2312 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2313 int trellis;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2314
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2315 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2316 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2317 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2318 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2319 int min_prediction_order;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2320
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2321 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2322 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2323 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2324 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2325 int max_prediction_order;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2326
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2327 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2328 * GOP timecode frame start number
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2329 * - encoding: Set by user, in non drop frame format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2330 * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2331 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2332 int64_t timecode_frame_start;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2333
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2334 /* The RTP callback: This function is called */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2335 /* every time the encoder has a packet to send. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2336 /* It depends on the encoder if the data starts */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2337 /* with a Start Code (it should). H.263 does. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2338 /* mb_nb contains the number of macroblocks */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2339 /* encoded in the RTP payload. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2340 void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2341
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2342 int rtp_payload_size; /* The size of the RTP payload: the coder will */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2343 /* do its best to deliver a chunk with size */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2344 /* below rtp_payload_size, the chunk will start */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2345 /* with a start code on some codecs like H.263. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2346 /* This doesn't take account of any particular */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2347 /* headers inside the transmitted RTP payload. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2348
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2349 /* statistics, used for 2-pass encoding */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2350 int mv_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2351 int header_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2352 int i_tex_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2353 int p_tex_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2354 int i_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2355 int p_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2356 int skip_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2357 int misc_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2358
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2359 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2360 * number of bits used for the previously encoded frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2361 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2362 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2363 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2364 int frame_bits;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2365
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2366 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2367 * pass1 encoding statistics output buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2368 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2369 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2370 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2371 char *stats_out;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2372
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2373 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2374 * pass2 encoding statistics input buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2375 * Concatenated stuff from stats_out of pass1 should be placed here.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2376 * - encoding: Allocated/set/freed by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2377 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2378 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2379 char *stats_in;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2380
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2381 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2382 * Work around bugs in encoders which sometimes cannot be detected automatically.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2383 * - encoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2384 * - decoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2385 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2386 int workaround_bugs;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2387 #define FF_BUG_AUTODETECT 1 ///< autodetection
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2388 #define FF_BUG_OLD_MSMPEG4 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2389 #define FF_BUG_XVID_ILACE 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2390 #define FF_BUG_UMP4 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2391 #define FF_BUG_NO_PADDING 16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2392 #define FF_BUG_AMV 32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2393 #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2394 #define FF_BUG_QPEL_CHROMA 64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2395 #define FF_BUG_STD_QPEL 128
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2396 #define FF_BUG_QPEL_CHROMA2 256
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2397 #define FF_BUG_DIRECT_BLOCKSIZE 512
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2398 #define FF_BUG_EDGE 1024
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2399 #define FF_BUG_HPEL_CHROMA 2048
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2400 #define FF_BUG_DC_CLIP 4096
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2401 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2402 #define FF_BUG_TRUNCATED 16384
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2403
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2404 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2405 * strictly follow the standard (MPEG4, ...).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2406 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2407 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2408 * Setting this to STRICT or higher means the encoder and decoder will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2409 * generally do stupid things, whereas setting it to unofficial or lower
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2410 * will mean the encoder might produce output that is not supported by all
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2411 * spec-compliant decoders. Decoders don't differentiate between normal,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2412 * unofficial and experimental (that is, they always try to decode things
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2413 * when they can) unless they are explicitly asked to behave stupidly
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2414 * (=strictly conform to the specs)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2415 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2416 int strict_std_compliance;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2417 #define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2418 #define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2419 #define FF_COMPLIANCE_NORMAL 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2420 #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2421 #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2422
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2423 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2424 * error concealment flags
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2425 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2426 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2427 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2428 int error_concealment;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2429 #define FF_EC_GUESS_MVS 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2430 #define FF_EC_DEBLOCK 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2431
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2432 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2433 * debug
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2434 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2435 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2436 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2437 int debug;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2438 #define FF_DEBUG_PICT_INFO 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2439 #define FF_DEBUG_RC 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2440 #define FF_DEBUG_BITSTREAM 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2441 #define FF_DEBUG_MB_TYPE 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2442 #define FF_DEBUG_QP 16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2443 #define FF_DEBUG_MV 32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2444 #define FF_DEBUG_DCT_COEFF 0x00000040
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2445 #define FF_DEBUG_SKIP 0x00000080
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2446 #define FF_DEBUG_STARTCODE 0x00000100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2447 #define FF_DEBUG_PTS 0x00000200
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2448 #define FF_DEBUG_ER 0x00000400
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2449 #define FF_DEBUG_MMCO 0x00000800
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2450 #define FF_DEBUG_BUGS 0x00001000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2451 #define FF_DEBUG_VIS_QP 0x00002000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2452 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2453 #define FF_DEBUG_BUFFERS 0x00008000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2454 #define FF_DEBUG_THREADS 0x00010000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2455
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2456 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2457 * debug
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2458 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2459 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2460 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2461 int debug_mv;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2462 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2463 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2464 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2465
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2466 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2467 * Error recognition; may misdetect some more or less valid parts as errors.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2468 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2469 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2470 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2471 int err_recognition;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2472 #define AV_EF_CRCCHECK (1<<0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2473 #define AV_EF_BITSTREAM (1<<1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2474 #define AV_EF_BUFFER (1<<2)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2475 #define AV_EF_EXPLODE (1<<3)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2476
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2477 #define AV_EF_CAREFUL (1<<16)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2478 #define AV_EF_COMPLIANT (1<<17)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2479 #define AV_EF_AGGRESSIVE (1<<18)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2480
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2481
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2482 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2483 * opaque 64bit number (generally a PTS) that will be reordered and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2484 * output in AVFrame.reordered_opaque
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2485 * @deprecated in favor of pkt_pts
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2486 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2487 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2488 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2489 int64_t reordered_opaque;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2490
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2491 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2492 * Hardware accelerator in use
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2493 * - encoding: unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2494 * - decoding: Set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2495 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2496 struct AVHWAccel *hwaccel;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2497
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2498 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2499 * Hardware accelerator context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2500 * For some hardware accelerators, a global context needs to be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2501 * provided by the user. In that case, this holds display-dependent
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2502 * data FFmpeg cannot instantiate itself. Please refer to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2503 * FFmpeg HW accelerator documentation to know how to fill this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2504 * is. e.g. for VA API, this is a struct vaapi_context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2505 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2506 * - decoding: Set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2507 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2508 void *hwaccel_context;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2509
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2510 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2511 * error
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2512 * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2513 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2514 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2515 uint64_t error[AV_NUM_DATA_POINTERS];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2516
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2517 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2518 * DCT algorithm, see FF_DCT_* below
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2519 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2520 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2521 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2522 int dct_algo;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2523 #define FF_DCT_AUTO 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2524 #define FF_DCT_FASTINT 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2525 #define FF_DCT_INT 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2526 #define FF_DCT_MMX 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2527 #define FF_DCT_ALTIVEC 5
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2528 #define FF_DCT_FAAN 6
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2529
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2530 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2531 * IDCT algorithm, see FF_IDCT_* below.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2532 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2533 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2534 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2535 int idct_algo;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2536 #define FF_IDCT_AUTO 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2537 #define FF_IDCT_INT 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2538 #define FF_IDCT_SIMPLE 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2539 #define FF_IDCT_SIMPLEMMX 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2540 #define FF_IDCT_ARM 7
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2541 #define FF_IDCT_ALTIVEC 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2542 #define FF_IDCT_SH4 9
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2543 #define FF_IDCT_SIMPLEARM 10
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2544 #define FF_IDCT_IPP 13
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2545 #define FF_IDCT_XVIDMMX 14
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2546 #define FF_IDCT_SIMPLEARMV5TE 16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2547 #define FF_IDCT_SIMPLEARMV6 17
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2548 #define FF_IDCT_SIMPLEVIS 18
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2549 #define FF_IDCT_FAAN 20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2550 #define FF_IDCT_SIMPLENEON 22
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2551 #define FF_IDCT_SIMPLEALPHA 23
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2552
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2553 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2554 * bits per sample/pixel from the demuxer (needed for huffyuv).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2555 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2556 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2557 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2558 int bits_per_coded_sample;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2559
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2560 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2561 * Bits per sample/pixel of internal libavcodec pixel/sample format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2562 * - encoding: set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2563 * - decoding: set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2564 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2565 int bits_per_raw_sample;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2566
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2567 #if FF_API_LOWRES
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2568 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2569 * low resolution decoding, 1-> 1/2 size, 2->1/4 size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2570 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2571 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2572 * Code outside libavcodec should access this field using:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2573 * av_codec_{get,set}_lowres(avctx)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2574 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2575 int lowres;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2576 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2577
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2578 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2579 * the picture in the bitstream
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2580 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2581 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2582 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2583 AVFrame *coded_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2584
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2585 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2586 * thread count
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2587 * is used to decide how many independent tasks should be passed to execute()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2588 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2589 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2590 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2591 int thread_count;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2592
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2593 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2594 * Which multithreading methods to use.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2595 * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2596 * so clients which cannot provide future frames should not use it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2597 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2598 * - encoding: Set by user, otherwise the default is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2599 * - decoding: Set by user, otherwise the default is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2600 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2601 int thread_type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2602 #define FF_THREAD_FRAME 1 ///< Decode more than one frame at once
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2603 #define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2604
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2605 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2606 * Which multithreading methods are in use by the codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2607 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2608 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2609 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2610 int active_thread_type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2611
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2612 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2613 * Set by the client if its custom get_buffer() callback can be called
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2614 * synchronously from another thread, which allows faster multithreaded decoding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2615 * draw_horiz_band() will be called from other threads regardless of this setting.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2616 * Ignored if the default get_buffer() is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2617 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2618 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2619 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2620 int thread_safe_callbacks;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2621
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2622 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2623 * The codec may call this to execute several independent things.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2624 * It will return only after finishing all tasks.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2625 * The user may replace this with some multithreaded implementation,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2626 * the default implementation will execute the parts serially.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2627 * @param count the number of things to execute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2628 * - encoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2629 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2630 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2631 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2632
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2633 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2634 * The codec may call this to execute several independent things.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2635 * It will return only after finishing all tasks.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2636 * The user may replace this with some multithreaded implementation,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2637 * the default implementation will execute the parts serially.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2638 * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2639 * @param c context passed also to func
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2640 * @param count the number of things to execute
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2641 * @param arg2 argument passed unchanged to func
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2642 * @param ret return values of executed functions, must have space for "count" values. May be NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2643 * @param func function that will be called count times, with jobnr from 0 to count-1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2644 * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2645 * two instances of func executing at the same time will have the same threadnr.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2646 * @return always 0 currently, but code should handle a future improvement where when any call to func
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2647 * returns < 0 no further calls to func may be done and < 0 is returned.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2648 * - encoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2649 * - decoding: Set by libavcodec, user can override.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2650 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2651 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2652
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2653 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2654 * thread opaque
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2655 * Can be used by execute() to store some per AVCodecContext stuff.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2656 * - encoding: set by execute()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2657 * - decoding: set by execute()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2658 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2659 void *thread_opaque;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2660
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2661 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2662 * noise vs. sse weight for the nsse comparsion function
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2663 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2664 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2665 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2666 int nsse_weight;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2667
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2668 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2669 * profile
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2670 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2671 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2672 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2673 int profile;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2674 #define FF_PROFILE_UNKNOWN -99
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2675 #define FF_PROFILE_RESERVED -100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2676
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2677 #define FF_PROFILE_AAC_MAIN 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2678 #define FF_PROFILE_AAC_LOW 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2679 #define FF_PROFILE_AAC_SSR 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2680 #define FF_PROFILE_AAC_LTP 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2681 #define FF_PROFILE_AAC_HE 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2682 #define FF_PROFILE_AAC_HE_V2 28
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2683 #define FF_PROFILE_AAC_LD 22
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2684 #define FF_PROFILE_AAC_ELD 38
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2685
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2686 #define FF_PROFILE_DTS 20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2687 #define FF_PROFILE_DTS_ES 30
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2688 #define FF_PROFILE_DTS_96_24 40
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2689 #define FF_PROFILE_DTS_HD_HRA 50
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2690 #define FF_PROFILE_DTS_HD_MA 60
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2691
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2692 #define FF_PROFILE_MPEG2_422 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2693 #define FF_PROFILE_MPEG2_HIGH 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2694 #define FF_PROFILE_MPEG2_SS 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2695 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2696 #define FF_PROFILE_MPEG2_MAIN 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2697 #define FF_PROFILE_MPEG2_SIMPLE 5
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2698
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2699 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2700 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2701
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2702 #define FF_PROFILE_H264_BASELINE 66
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2703 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2704 #define FF_PROFILE_H264_MAIN 77
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2705 #define FF_PROFILE_H264_EXTENDED 88
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2706 #define FF_PROFILE_H264_HIGH 100
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2707 #define FF_PROFILE_H264_HIGH_10 110
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2708 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2709 #define FF_PROFILE_H264_HIGH_422 122
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2710 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2711 #define FF_PROFILE_H264_HIGH_444 144
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2712 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2713 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2714 #define FF_PROFILE_H264_CAVLC_444 44
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2715
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2716 #define FF_PROFILE_VC1_SIMPLE 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2717 #define FF_PROFILE_VC1_MAIN 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2718 #define FF_PROFILE_VC1_COMPLEX 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2719 #define FF_PROFILE_VC1_ADVANCED 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2720
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2721 #define FF_PROFILE_MPEG4_SIMPLE 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2722 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2723 #define FF_PROFILE_MPEG4_CORE 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2724 #define FF_PROFILE_MPEG4_MAIN 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2725 #define FF_PROFILE_MPEG4_N_BIT 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2726 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2727 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2728 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2729 #define FF_PROFILE_MPEG4_HYBRID 8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2730 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2731 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2732 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2733 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2734 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2735 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2736 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2737
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2738 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2739 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2740 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2741 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2742 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2743
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2744 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2745 * level
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2746 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2747 * - decoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2748 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2749 int level;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2750 #define FF_LEVEL_UNKNOWN -99
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2751
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2752 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2753 * Skip loop filtering for selected frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2754 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2755 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2756 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2757 enum AVDiscard skip_loop_filter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2758
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2759 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2760 * Skip IDCT/dequantization for selected frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2761 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2762 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2763 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2764 enum AVDiscard skip_idct;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2765
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2766 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2767 * Skip decoding for selected frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2768 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2769 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2770 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2771 enum AVDiscard skip_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2772
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2773 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2774 * Header containing style information for text subtitles.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2775 * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2776 * [Script Info] and [V4+ Styles] section, plus the [Events] line and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2777 * the Format line following. It shouldn't include any Dialogue line.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2778 * - encoding: Set/allocated/freed by user (before avcodec_open2())
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2779 * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2780 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2781 uint8_t *subtitle_header;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2782 int subtitle_header_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2783
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2784 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2785 * Simulates errors in the bitstream to test error concealment.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2786 * - encoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2787 * - decoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2788 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2789 int error_rate;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2790
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2791 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2792 * Current packet as passed into the decoder, to avoid having
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2793 * to pass the packet into every function. Currently only valid
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2794 * inside lavc and get/release_buffer callbacks.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2795 * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2796 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2797 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2798 AVPacket *pkt;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2799
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2800 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2801 * VBV delay coded in the last frame (in periods of a 27 MHz clock).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2802 * Used for compliant TS muxing.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2803 * - encoding: Set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2804 * - decoding: unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2805 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2806 uint64_t vbv_delay;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2807
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2808 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2809 * Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2810 * Code outside libavcodec should access this field using:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2811 * av_codec_{get,set}_pkt_timebase(avctx)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2812 * - encoding unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2813 * - decodimg set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2814 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2815 AVRational pkt_timebase;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2816
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2817 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2818 * AVCodecDescriptor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2819 * Code outside libavcodec should access this field using:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2820 * av_codec_{get,set}_codec_descriptor(avctx)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2821 * - encoding: unused.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2822 * - decoding: set by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2823 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2824 const AVCodecDescriptor *codec_descriptor;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2825
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2826 #if !FF_API_LOWRES
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2827 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2828 * low resolution decoding, 1-> 1/2 size, 2->1/4 size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2829 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2830 * - decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2831 * Code outside libavcodec should access this field using:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2832 * av_codec_{get,set}_lowres(avctx)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2833 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2834 int lowres;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2835 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2836
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2837 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2838 * Current statistics for PTS correction.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2839 * - decoding: maintained and used by libavcodec, not intended to be used by user apps
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2840 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2841 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2842 int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2843 int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2844 int64_t pts_correction_last_pts; /// PTS of the last frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2845 int64_t pts_correction_last_dts; /// DTS of the last frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2846
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2847 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2848 * Character encoding of the input subtitles file.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2849 * - decoding: set by user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2850 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2851 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2852 char *sub_charenc;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2853
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2854 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2855 * Subtitles character encoding mode. Formats or codecs might be adjusting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2856 * this setting (if they are doing the conversion themselves for instance).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2857 * - decoding: set by libavcodec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2858 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2859 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2860 int sub_charenc_mode;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2861 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2862 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0 ///< libavcodec will select the mode itself
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2863 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2864
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2865 } AVCodecContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2866
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2867 AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2868 void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational val);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2869
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2870 const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2871 void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2872
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2873 int av_codec_get_lowres(const AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2874 void av_codec_set_lowres(AVCodecContext *avctx, int val);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2875
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2876 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2877 * AVProfile.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2878 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2879 typedef struct AVProfile {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2880 int profile;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2881 const char *name; ///< short name for the profile
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2882 } AVProfile;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2883
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2884 typedef struct AVCodecDefault AVCodecDefault;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2885
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2886 struct AVSubtitle;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2887
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2888 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2889 * AVCodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2890 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2891 typedef struct AVCodec {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2892 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2893 * Name of the codec implementation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2894 * The name is globally unique among encoders and among decoders (but an
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2895 * encoder and a decoder can share the same name).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2896 * This is the primary way to find a codec from the user perspective.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2897 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2898 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2899 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2900 * Descriptive name for the codec, meant to be more human readable than name.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2901 * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2902 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2903 const char *long_name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2904 enum AVMediaType type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2905 enum AVCodecID id;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2906 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2907 * Codec capabilities.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2908 * see CODEC_CAP_*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2909 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2910 int capabilities;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2911 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2912 const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2913 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2914 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2915 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2916 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2917 const AVClass *priv_class; ///< AVClass for the private context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2918 const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2919
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2920 /*****************************************************************
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2921 * No fields below this line are part of the public API. They
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2922 * may not be used outside of libavcodec and can be changed and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2923 * removed at will.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2924 * New public fields should be added right above.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2925 *****************************************************************
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2926 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2927 int priv_data_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2928 struct AVCodec *next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2929 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2930 * @name Frame-level threading support functions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2931 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2932 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2933 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2934 * If defined, called on thread contexts when they are created.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2935 * If the codec allocates writable tables in init(), re-allocate them here.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2936 * priv_data will be set to a copy of the original.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2937 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2938 int (*init_thread_copy)(AVCodecContext *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2939 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2940 * Copy necessary context variables from a previous thread context to the current one.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2941 * If not defined, the next thread will start automatically; otherwise, the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2942 * must call ff_thread_finish_setup().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2943 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2944 * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2945 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2946 int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2947 /** @} */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2948
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2949 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2950 * Private codec-specific defaults.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2951 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2952 const AVCodecDefault *defaults;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2953
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2954 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2955 * Initialize codec static data, called from avcodec_register().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2956 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2957 void (*init_static_data)(struct AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2958
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2959 int (*init)(AVCodecContext *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2960 int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2961 const struct AVSubtitle *sub);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2962 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2963 * Encode data to an AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2964 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2965 * @param avctx codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2966 * @param avpkt output AVPacket (may contain a user-provided buffer)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2967 * @param[in] frame AVFrame containing the raw data to be encoded
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2968 * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2969 * non-empty packet was returned in avpkt.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2970 * @return 0 on success, negative error code on failure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2971 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2972 int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2973 int *got_packet_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2974 int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2975 int (*close)(AVCodecContext *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2976 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2977 * Flush buffers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2978 * Will be called when seeking
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2979 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2980 void (*flush)(AVCodecContext *);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2981 } AVCodec;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2982
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2983 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2984 * AVHWAccel.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2985 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2986 typedef struct AVHWAccel {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2987 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2988 * Name of the hardware accelerated codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2989 * The name is globally unique among encoders and among decoders (but an
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2990 * encoder and a decoder can share the same name).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2991 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2992 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2993
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2994 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2995 * Type of codec implemented by the hardware accelerator.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2996 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2997 * See AVMEDIA_TYPE_xxx
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2998 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2999 enum AVMediaType type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3001 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3002 * Codec implemented by the hardware accelerator.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3003 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3004 * See AV_CODEC_ID_xxx
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3005 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3006 enum AVCodecID id;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3007
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3008 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3009 * Supported pixel format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3010 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3011 * Only hardware accelerated formats are supported here.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3012 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3013 enum AVPixelFormat pix_fmt;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3014
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3015 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3016 * Hardware accelerated codec capabilities.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3017 * see FF_HWACCEL_CODEC_CAP_*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3018 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3019 int capabilities;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3020
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3021 struct AVHWAccel *next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3022
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3023 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3024 * Called at the beginning of each frame or field picture.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3025 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3026 * Meaningful frame information (codec specific) is guaranteed to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3027 * be parsed at this point. This function is mandatory.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3028 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3029 * Note that buf can be NULL along with buf_size set to 0.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3030 * Otherwise, this means the whole frame is available at this point.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3031 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3032 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3033 * @param buf the frame data buffer base
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3034 * @param buf_size the size of the frame in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3035 * @return zero if successful, a negative value otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3036 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3037 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3038
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3039 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3040 * Callback for each slice.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3041 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3042 * Meaningful slice information (codec specific) is guaranteed to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3043 * be parsed at this point. This function is mandatory.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3044 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3045 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3046 * @param buf the slice data buffer base
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3047 * @param buf_size the size of the slice in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3048 * @return zero if successful, a negative value otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3049 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3050 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3051
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3052 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3053 * Called at the end of each frame or field picture.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3054 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3055 * The whole picture is parsed at this point and can now be sent
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3056 * to the hardware accelerator. This function is mandatory.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3057 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3058 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3059 * @return zero if successful, a negative value otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3060 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3061 int (*end_frame)(AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3062
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3063 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3064 * Size of HW accelerator private data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3065 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3066 * Private data is allocated with av_mallocz() before
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3067 * AVCodecContext.get_buffer() and deallocated after
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3068 * AVCodecContext.release_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3069 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3070 int priv_data_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3071 } AVHWAccel;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3072
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3073 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3074 * @defgroup lavc_picture AVPicture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3075 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3076 * Functions for working with AVPicture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3077 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3078 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3079
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3080 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3081 * four components are given, that's all.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3082 * the last component is alpha
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3083 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3084 typedef struct AVPicture {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3085 uint8_t *data[AV_NUM_DATA_POINTERS];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3086 int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3087 } AVPicture;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3088
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3089 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3090 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3091 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3092
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3093 enum AVSubtitleType {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3094 SUBTITLE_NONE,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3095
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3096 SUBTITLE_BITMAP, ///< A bitmap, pict will be set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3097
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3098 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3099 * Plain text, the text field must be set by the decoder and is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3100 * authoritative. ass and pict fields may contain approximations.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3101 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3102 SUBTITLE_TEXT,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3103
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3104 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3105 * Formatted text, the ass field must be set by the decoder and is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3106 * authoritative. pict and text fields may contain approximations.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3107 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3108 SUBTITLE_ASS,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3109 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3110
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3111 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3112
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3113 typedef struct AVSubtitleRect {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3114 int x; ///< top left corner of pict, undefined when pict is not set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3115 int y; ///< top left corner of pict, undefined when pict is not set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3116 int w; ///< width of pict, undefined when pict is not set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3117 int h; ///< height of pict, undefined when pict is not set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3118 int nb_colors; ///< number of colors in pict, undefined when pict is not set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3119
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3120 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3121 * data+linesize for the bitmap of this subtitle.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3122 * can be set for text/ass as well once they where rendered
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3123 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3124 AVPicture pict;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3125 enum AVSubtitleType type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3126
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3127 char *text; ///< 0 terminated plain UTF-8 text
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3128
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3129 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3130 * 0 terminated ASS/SSA compatible event line.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3131 * The presentation of this is unaffected by the other values in this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3132 * struct.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3133 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3134 char *ass;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3135
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3136 int flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3137 } AVSubtitleRect;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3138
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3139 typedef struct AVSubtitle {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3140 uint16_t format; /* 0 = graphics */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3141 uint32_t start_display_time; /* relative to packet pts, in ms */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3142 uint32_t end_display_time; /* relative to packet pts, in ms */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3143 unsigned num_rects;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3144 AVSubtitleRect **rects;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3145 int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3146 } AVSubtitle;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3147
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3148 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3149 * If c is NULL, returns the first registered codec,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3150 * if c is non-NULL, returns the next registered codec after c,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3151 * or NULL if c is the last one.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3152 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3153 AVCodec *av_codec_next(const AVCodec *c);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3154
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3155 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3156 * Return the LIBAVCODEC_VERSION_INT constant.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3157 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3158 unsigned avcodec_version(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3159
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3160 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3161 * Return the libavcodec build-time configuration.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3162 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3163 const char *avcodec_configuration(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3164
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3165 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3166 * Return the libavcodec license.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3167 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3168 const char *avcodec_license(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3169
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3170 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3171 * Register the codec codec and initialize libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3172 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3173 * @warning either this function or avcodec_register_all() must be called
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3174 * before any other libavcodec functions.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3175 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3176 * @see avcodec_register_all()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3177 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3178 void avcodec_register(AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3179
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3180 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3181 * Register all the codecs, parsers and bitstream filters which were enabled at
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3182 * configuration time. If you do not call this function you can select exactly
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3183 * which formats you want to support, by using the individual registration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3184 * functions.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3185 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3186 * @see avcodec_register
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3187 * @see av_register_codec_parser
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3188 * @see av_register_bitstream_filter
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3189 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3190 void avcodec_register_all(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3191
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3192
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3193 #if FF_API_ALLOC_CONTEXT
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3194 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3195 * Allocate an AVCodecContext and set its fields to default values. The
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3196 * resulting struct can be deallocated by simply calling av_free().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3197 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3198 * @return An AVCodecContext filled with default values or NULL on failure.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3199 * @see avcodec_get_context_defaults
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3200 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3201 * @deprecated use avcodec_alloc_context3()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3202 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3203 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3204 AVCodecContext *avcodec_alloc_context(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3205
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3206 /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3207 * we WILL change its arguments and name a few times! */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3208 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3209 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3210
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3211 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3212 * Set the fields of the given AVCodecContext to default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3213 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3214 * @param s The AVCodecContext of which the fields should be set to default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3215 * @deprecated use avcodec_get_context_defaults3
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3216 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3217 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3218 void avcodec_get_context_defaults(AVCodecContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3219
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3220 /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3221 * we WILL change its arguments and name a few times! */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3222 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3223 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3224 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3225
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3226 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3227 * Allocate an AVCodecContext and set its fields to default values. The
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3228 * resulting struct can be deallocated by calling avcodec_close() on it followed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3229 * by av_free().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3230 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3231 * @param codec if non-NULL, allocate private data and initialize defaults
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3232 * for the given codec. It is illegal to then call avcodec_open2()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3233 * with a different codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3234 * If NULL, then the codec-specific defaults won't be initialized,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3235 * which may result in suboptimal default settings (this is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3236 * important mainly for encoders, e.g. libx264).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3237 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3238 * @return An AVCodecContext filled with default values or NULL on failure.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3239 * @see avcodec_get_context_defaults
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3240 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3241 AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3242
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3243 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3244 * Set the fields of the given AVCodecContext to default values corresponding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3245 * to the given codec (defaults may be codec-dependent).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3246 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3247 * Do not call this function if a non-NULL codec has been passed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3248 * to avcodec_alloc_context3() that allocated this AVCodecContext.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3249 * If codec is non-NULL, it is illegal to call avcodec_open2() with a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3250 * different codec on this AVCodecContext.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3251 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3252 int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3253
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3254 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3255 * Get the AVClass for AVCodecContext. It can be used in combination with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3256 * AV_OPT_SEARCH_FAKE_OBJ for examining options.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3257 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3258 * @see av_opt_find().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3259 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3260 const AVClass *avcodec_get_class(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3261
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3262 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3263 * Get the AVClass for AVFrame. It can be used in combination with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3264 * AV_OPT_SEARCH_FAKE_OBJ for examining options.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3265 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3266 * @see av_opt_find().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3267 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3268 const AVClass *avcodec_get_frame_class(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3269
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3270 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3271 * Get the AVClass for AVSubtitleRect. It can be used in combination with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3272 * AV_OPT_SEARCH_FAKE_OBJ for examining options.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3273 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3274 * @see av_opt_find().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3275 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3276 const AVClass *avcodec_get_subtitle_rect_class(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3277
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3278 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3279 * Copy the settings of the source AVCodecContext into the destination
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3280 * AVCodecContext. The resulting destination codec context will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3281 * unopened, i.e. you are required to call avcodec_open2() before you
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3282 * can use this AVCodecContext to decode/encode video/audio data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3283 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3284 * @param dest target codec context, should be initialized with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3285 * avcodec_alloc_context3(), but otherwise uninitialized
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3286 * @param src source codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3287 * @return AVERROR() on error (e.g. memory allocation error), 0 on success
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3288 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3289 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3290
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3291 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3292 * Allocate an AVFrame and set its fields to default values. The resulting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3293 * struct must be freed using avcodec_free_frame().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3294 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3295 * @return An AVFrame filled with default values or NULL on failure.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3296 * @see avcodec_get_frame_defaults
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3297 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3298 AVFrame *avcodec_alloc_frame(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3299
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3300 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3301 * Set the fields of the given AVFrame to default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3302 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3303 * @param frame The AVFrame of which the fields should be set to default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3304 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3305 void avcodec_get_frame_defaults(AVFrame *frame);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3306
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3307 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3308 * Free the frame and any dynamically allocated objects in it,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3309 * e.g. extended_data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3310 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3311 * @param frame frame to be freed. The pointer will be set to NULL.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3312 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3313 * @warning this function does NOT free the data buffers themselves
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3314 * (it does not know how, since they might have been allocated with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3315 * a custom get_buffer()).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3316 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3317 void avcodec_free_frame(AVFrame **frame);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3318
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3319 #if FF_API_AVCODEC_OPEN
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3320 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3321 * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3322 * function the context has to be allocated.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3323 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3324 * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3325 * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3326 * retrieving a codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3327 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3328 * @warning This function is not thread safe!
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3329 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3330 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3331 * avcodec_register_all();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3332 * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3333 * if (!codec)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3334 * exit(1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3335 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3336 * context = avcodec_alloc_context3(codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3337 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3338 * if (avcodec_open(context, codec) < 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3339 * exit(1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3340 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3341 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3342 * @param avctx The context which will be set up to use the given codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3343 * @param codec The codec to use within the context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3344 * @return zero on success, a negative value on error
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3345 * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3346 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3347 * @deprecated use avcodec_open2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3348 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3349 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3350 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3351 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3352
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3353 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3354 * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3355 * function the context has to be allocated with avcodec_alloc_context3().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3356 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3357 * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3358 * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3359 * retrieving a codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3360 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3361 * @warning This function is not thread safe!
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3362 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3363 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3364 * avcodec_register_all();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3365 * av_dict_set(&opts, "b", "2.5M", 0);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3366 * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3367 * if (!codec)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3368 * exit(1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3369 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3370 * context = avcodec_alloc_context3(codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3371 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3372 * if (avcodec_open2(context, codec, opts) < 0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3373 * exit(1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3374 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3375 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3376 * @param avctx The context to initialize.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3377 * @param codec The codec to open this context for. If a non-NULL codec has been
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3378 * previously passed to avcodec_alloc_context3() or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3379 * avcodec_get_context_defaults3() for this context, then this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3380 * parameter MUST be either NULL or equal to the previously passed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3381 * codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3382 * @param options A dictionary filled with AVCodecContext and codec-private options.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3383 * On return this object will be filled with options that were not found.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3384 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3385 * @return zero on success, a negative value on error
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3386 * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3387 * av_dict_set(), av_opt_find().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3388 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3389 int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3390
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3391 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3392 * Close a given AVCodecContext and free all the data associated with it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3393 * (but not the AVCodecContext itself).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3394 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3395 * Calling this function on an AVCodecContext that hasn't been opened will free
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3396 * the codec-specific data allocated in avcodec_alloc_context3() /
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3397 * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3398 * do nothing.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3399 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3400 int avcodec_close(AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3401
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3402 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3403 * Free all allocated data in the given subtitle struct.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3404 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3405 * @param sub AVSubtitle to free.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3406 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3407 void avsubtitle_free(AVSubtitle *sub);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3408
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3409 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3410 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3411 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3412
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3413 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3414 * @addtogroup lavc_packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3415 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3416 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3417
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3418 #if FF_API_DESTRUCT_PACKET
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3419 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3420 * Default packet destructor.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3421 * @deprecated use the AVBuffer API instead
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3422 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3423 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3424 void av_destruct_packet(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3425 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3426
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3427 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3428 * Initialize optional fields of a packet with default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3429 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3430 * Note, this does not touch the data and size members, which have to be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3431 * initialized separately.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3432 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3433 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3434 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3435 void av_init_packet(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3436
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3437 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3438 * Allocate the payload of a packet and initialize its fields with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3439 * default values.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3440 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3441 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3442 * @param size wanted payload size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3443 * @return 0 if OK, AVERROR_xxx otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3444 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3445 int av_new_packet(AVPacket *pkt, int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3446
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3447 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3448 * Reduce packet size, correctly zeroing padding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3449 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3450 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3451 * @param size new size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3452 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3453 void av_shrink_packet(AVPacket *pkt, int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3454
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3455 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3456 * Increase packet size, correctly zeroing padding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3457 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3458 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3459 * @param grow_by number of bytes by which to increase the size of the packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3460 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3461 int av_grow_packet(AVPacket *pkt, int grow_by);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3462
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3463 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3464 * Initialize a reference-counted packet from av_malloc()ed data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3465 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3466 * @param pkt packet to be initialized. This function will set the data, size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3467 * buf and destruct fields, all others are left untouched.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3468 * @param data Data allocated by av_malloc() to be used as packet data. If this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3469 * function returns successfully, the data is owned by the underlying AVBuffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3470 * The caller may not access the data through other means.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3471 * @param size size of data in bytes, without the padding. I.e. the full buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3472 * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3473 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3474 * @return 0 on success, a negative AVERROR on error
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3475 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3476 int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3477
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3478 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3479 * @warning This is a hack - the packet memory allocation stuff is broken. The
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3480 * packet is allocated if it was not really allocated.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3481 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3482 int av_dup_packet(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3483
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3484 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3485 * Copy packet, including contents
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3486 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3487 * @return 0 on success, negative AVERROR on fail
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3488 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3489 int av_copy_packet(AVPacket *dst, AVPacket *src);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3490
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3491 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3492 * Copy packet side data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3493 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3494 * @return 0 on success, negative AVERROR on fail
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3495 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3496 int av_copy_packet_side_data(AVPacket *dst, AVPacket *src);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3497
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3498 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3499 * Free a packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3500 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3501 * @param pkt packet to free
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3502 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3503 void av_free_packet(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3504
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3505 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3506 * Allocate new information of a packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3507 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3508 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3509 * @param type side information type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3510 * @param size side information size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3511 * @return pointer to fresh allocated data or NULL otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3512 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3513 uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3514 int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3515
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3516 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3517 * Shrink the already allocated side data buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3518 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3519 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3520 * @param type side information type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3521 * @param size new side information size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3522 * @return 0 on success, < 0 on failure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3523 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3524 int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3525 int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3526
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3527 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3528 * Get side information from packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3529 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3530 * @param pkt packet
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3531 * @param type desired side information type
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3532 * @param size pointer for side information size to store (optional)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3533 * @return pointer to data if present or NULL otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3534 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3535 uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3536 int *size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3537
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3538 int av_packet_merge_side_data(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3539
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3540 int av_packet_split_side_data(AVPacket *pkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3541
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3542
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3543 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3544 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3545 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3546
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3547 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3548 * @addtogroup lavc_decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3549 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3550 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3551
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3552 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3553 * Find a registered decoder with a matching codec ID.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3554 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3555 * @param id AVCodecID of the requested decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3556 * @return A decoder if one was found, NULL otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3557 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3558 AVCodec *avcodec_find_decoder(enum AVCodecID id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3559
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3560 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3561 * Find a registered decoder with the specified name.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3562 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3563 * @param name name of the requested decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3564 * @return A decoder if one was found, NULL otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3565 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3566 AVCodec *avcodec_find_decoder_by_name(const char *name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3567
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3568 #if FF_API_GET_BUFFER
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3569 attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3570 attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3571 attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3572 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3573
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3574 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3575 * The default callback for AVCodecContext.get_buffer2(). It is made public so
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3576 * it can be called by custom get_buffer2() implementations for decoders without
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3577 * CODEC_CAP_DR1 set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3578 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3579 int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3580
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3581 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3582 * Return the amount of padding in pixels which the get_buffer callback must
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3583 * provide around the edge of the image for codecs which do not have the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3584 * CODEC_FLAG_EMU_EDGE flag.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3585 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3586 * @return Required padding in pixels.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3587 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3588 unsigned avcodec_get_edge_width(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3589
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3590 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3591 * Modify width and height values so that they will result in a memory
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3592 * buffer that is acceptable for the codec if you do not use any horizontal
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3593 * padding.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3594 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3595 * May only be used if a codec with CODEC_CAP_DR1 has been opened.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3596 * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3597 * according to avcodec_get_edge_width() before.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3598 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3599 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3600
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3601 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3602 * Modify width and height values so that they will result in a memory
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3603 * buffer that is acceptable for the codec if you also ensure that all
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3604 * line sizes are a multiple of the respective linesize_align[i].
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3605 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3606 * May only be used if a codec with CODEC_CAP_DR1 has been opened.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3607 * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3608 * according to avcodec_get_edge_width() before.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3609 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3610 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3611 int linesize_align[AV_NUM_DATA_POINTERS]);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3612
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3613 #if FF_API_OLD_DECODE_AUDIO
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3614 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3615 * Wrapper function which calls avcodec_decode_audio4.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3616 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3617 * @deprecated Use avcodec_decode_audio4 instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3618 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3619 * Decode the audio frame of size avpkt->size from avpkt->data into samples.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3620 * Some decoders may support multiple frames in a single AVPacket, such
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3621 * decoders would then just decode the first frame. In this case,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3622 * avcodec_decode_audio3 has to be called again with an AVPacket that contains
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3623 * the remaining data in order to decode the second frame etc.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3624 * If no frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3625 * could be outputted, frame_size_ptr is zero. Otherwise, it is the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3626 * decompressed frame size in bytes.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3627 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3628 * @warning You must set frame_size_ptr to the allocated size of the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3629 * output buffer before calling avcodec_decode_audio3().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3630 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3631 * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3632 * the actual read bytes because some optimized bitstream readers read 32 or 64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3633 * bits at once and could read over the end.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3634 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3635 * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3636 * no overreading happens for damaged MPEG streams.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3637 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3638 * @warning You must not provide a custom get_buffer() when using
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3639 * avcodec_decode_audio3(). Doing so will override it with
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3640 * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3641 * which does allow the application to provide a custom get_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3642 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3643 * @note You might have to align the input buffer avpkt->data and output buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3644 * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3645 * necessary at all, on others it won't work at all if not aligned and on others
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3646 * it will work but it will have an impact on performance.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3647 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3648 * In practice, avpkt->data should have 4 byte alignment at minimum and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3649 * samples should be 16 byte aligned unless the CPU doesn't need it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3650 * (AltiVec and SSE do).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3651 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3652 * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3653 * between input and output, these need to be fed with avpkt->data=NULL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3654 * avpkt->size=0 at the end to return the remaining frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3655 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3656 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3657 * @param[out] samples the output buffer, sample type in avctx->sample_fmt
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3658 * If the sample format is planar, each channel plane will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3659 * be the same size, with no padding between channels.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3660 * @param[in,out] frame_size_ptr the output buffer size in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3661 * @param[in] avpkt The input AVPacket containing the input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3662 * You can create such packet with av_init_packet() and by then setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3663 * data and size, some decoders might in addition need other fields.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3664 * All decoders are designed to use the least fields possible though.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3665 * @return On error a negative value is returned, otherwise the number of bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3666 * used or zero if no frame data was decompressed (used) from the input AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3667 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3668 attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3669 int *frame_size_ptr,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3670 AVPacket *avpkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3671 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3672
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3673 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3674 * Decode the audio frame of size avpkt->size from avpkt->data into frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3675 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3676 * Some decoders may support multiple frames in a single AVPacket. Such
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3677 * decoders would then just decode the first frame. In this case,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3678 * avcodec_decode_audio4 has to be called again with an AVPacket containing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3679 * the remaining data in order to decode the second frame, etc...
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3680 * Even if no frames are returned, the packet needs to be fed to the decoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3681 * with remaining data until it is completely consumed or an error occurs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3682 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3683 * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3684 * larger than the actual read bytes because some optimized bitstream
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3685 * readers read 32 or 64 bits at once and could read over the end.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3686 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3687 * @note You might have to align the input buffer. The alignment requirements
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3688 * depend on the CPU and the decoder.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3689 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3690 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3691 * @param[out] frame The AVFrame in which to store decoded audio samples.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3692 * The decoder will allocate a buffer for the decoded frame by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3693 * calling the AVCodecContext.get_buffer2() callback.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3694 * When AVCodecContext.refcounted_frames is set to 1, the frame is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3695 * reference counted and the returned reference belongs to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3696 * caller. The caller must release the frame using av_frame_unref()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3697 * when the frame is no longer needed. The caller may safely write
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3698 * to the frame if av_frame_is_writable() returns 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3699 * When AVCodecContext.refcounted_frames is set to 0, the returned
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3700 * reference belongs to the decoder and is valid only until the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3701 * next call to this function or until closing the decoder.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3702 * The caller may not write to it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3703 * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3704 * non-zero.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3705 * @param[in] avpkt The input AVPacket containing the input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3706 * At least avpkt->data and avpkt->size should be set. Some
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3707 * decoders might also require additional fields to be set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3708 * @return A negative error code is returned if an error occurred during
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3709 * decoding, otherwise the number of bytes consumed from the input
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3710 * AVPacket is returned.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3711 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3712 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3713 int *got_frame_ptr, const AVPacket *avpkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3714
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3715 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3716 * Decode the video frame of size avpkt->size from avpkt->data into picture.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3717 * Some decoders may support multiple frames in a single AVPacket, such
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3718 * decoders would then just decode the first frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3719 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3720 * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3721 * the actual read bytes because some optimized bitstream readers read 32 or 64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3722 * bits at once and could read over the end.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3723 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3724 * @warning The end of the input buffer buf should be set to 0 to ensure that
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3725 * no overreading happens for damaged MPEG streams.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3726 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3727 * @note You might have to align the input buffer avpkt->data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3728 * The alignment requirements depend on the CPU: on some CPUs it isn't
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3729 * necessary at all, on others it won't work at all if not aligned and on others
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3730 * it will work but it will have an impact on performance.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3731 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3732 * In practice, avpkt->data should have 4 byte alignment at minimum.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3733 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3734 * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3735 * between input and output, these need to be fed with avpkt->data=NULL,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3736 * avpkt->size=0 at the end to return the remaining frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3737 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3738 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3739 * @param[out] picture The AVFrame in which the decoded video frame will be stored.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3740 * Use av_frame_alloc() to get an AVFrame. The codec will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3741 * allocate memory for the actual bitmap by calling the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3742 * AVCodecContext.get_buffer2() callback.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3743 * When AVCodecContext.refcounted_frames is set to 1, the frame is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3744 * reference counted and the returned reference belongs to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3745 * caller. The caller must release the frame using av_frame_unref()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3746 * when the frame is no longer needed. The caller may safely write
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3747 * to the frame if av_frame_is_writable() returns 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3748 * When AVCodecContext.refcounted_frames is set to 0, the returned
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3749 * reference belongs to the decoder and is valid only until the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3750 * next call to this function or until closing the decoder. The
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3751 * caller may not write to it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3752 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3753 * @param[in] avpkt The input AVpacket containing the input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3754 * You can create such packet with av_init_packet() and by then setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3755 * data and size, some decoders might in addition need other fields like
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3756 * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3757 * fields possible.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3758 * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3759 * @return On error a negative value is returned, otherwise the number of bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3760 * used or zero if no frame could be decompressed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3761 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3762 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3763 int *got_picture_ptr,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3764 const AVPacket *avpkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3765
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3766 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3767 * Decode a subtitle message.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3768 * Return a negative value on error, otherwise return the number of bytes used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3769 * If no subtitle could be decompressed, got_sub_ptr is zero.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3770 * Otherwise, the subtitle is stored in *sub.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3771 * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3772 * simplicity, because the performance difference is expect to be negligible
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3773 * and reusing a get_buffer written for video codecs would probably perform badly
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3774 * due to a potentially very different allocation pattern.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3775 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3776 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3777 * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3778 freed with avsubtitle_free if *got_sub_ptr is set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3779 * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3780 * @param[in] avpkt The input AVPacket containing the input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3781 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3782 int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3783 int *got_sub_ptr,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3784 AVPacket *avpkt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3785
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3786 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3787 * @defgroup lavc_parsing Frame parsing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3788 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3789 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3790
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3791 typedef struct AVCodecParserContext {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3792 void *priv_data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3793 struct AVCodecParser *parser;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3794 int64_t frame_offset; /* offset of the current frame */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3795 int64_t cur_offset; /* current offset
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3796 (incremented by each av_parser_parse()) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3797 int64_t next_frame_offset; /* offset of the next frame */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3798 /* video info */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3799 int pict_type; /* XXX: Put it back in AVCodecContext. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3800 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3801 * This field is used for proper frame duration computation in lavf.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3802 * It signals, how much longer the frame duration of the current frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3803 * is compared to normal frame duration.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3804 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3805 * frame_duration = (1 + repeat_pict) * time_base
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3806 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3807 * It is used by codecs like H.264 to display telecined material.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3808 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3809 int repeat_pict; /* XXX: Put it back in AVCodecContext. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3810 int64_t pts; /* pts of the current frame */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3811 int64_t dts; /* dts of the current frame */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3812
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3813 /* private data */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3814 int64_t last_pts;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3815 int64_t last_dts;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3816 int fetch_timestamp;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3817
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3818 #define AV_PARSER_PTS_NB 4
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3819 int cur_frame_start_index;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3820 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3821 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3822 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3823
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3824 int flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3825 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3826 #define PARSER_FLAG_ONCE 0x0002
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3827 /// Set if the parser has a valid file offset
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3828 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3829 #define PARSER_FLAG_USE_CODEC_TS 0x1000
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3830
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3831 int64_t offset; ///< byte offset from starting packet start
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3832 int64_t cur_frame_end[AV_PARSER_PTS_NB];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3833
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3834 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3835 * Set by parser to 1 for key frames and 0 for non-key frames.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3836 * It is initialized to -1, so if the parser doesn't set this flag,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3837 * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3838 * will be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3839 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3840 int key_frame;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3841
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3842 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3843 * Time difference in stream time base units from the pts of this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3844 * packet to the point at which the output from the decoder has converged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3845 * independent from the availability of previous frames. That is, the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3846 * frames are virtually identical no matter if decoding started from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3847 * the very first frame or from this keyframe.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3848 * Is AV_NOPTS_VALUE if unknown.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3849 * This field is not the display duration of the current frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3850 * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3851 * set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3852 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3853 * The purpose of this field is to allow seeking in streams that have no
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3854 * keyframes in the conventional sense. It corresponds to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3855 * recovery point SEI in H.264 and match_time_delta in NUT. It is also
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3856 * essential for some types of subtitle streams to ensure that all
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3857 * subtitles are correctly displayed after seeking.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3858 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3859 int64_t convergence_duration;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3860
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3861 // Timestamp generation support:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3862 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3863 * Synchronization point for start of timestamp generation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3864 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3865 * Set to >0 for sync point, 0 for no sync point and <0 for undefined
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3866 * (default).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3867 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3868 * For example, this corresponds to presence of H.264 buffering period
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3869 * SEI message.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3870 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3871 int dts_sync_point;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3872
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3873 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3874 * Offset of the current timestamp against last timestamp sync point in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3875 * units of AVCodecContext.time_base.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3876 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3877 * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3878 * contain a valid timestamp offset.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3879 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3880 * Note that the timestamp of sync point has usually a nonzero
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3881 * dts_ref_dts_delta, which refers to the previous sync point. Offset of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3882 * the next frame after timestamp sync point will be usually 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3883 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3884 * For example, this corresponds to H.264 cpb_removal_delay.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3885 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3886 int dts_ref_dts_delta;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3887
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3888 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3889 * Presentation delay of current frame in units of AVCodecContext.time_base.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3890 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3891 * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3892 * contain valid non-negative timestamp delta (presentation time of a frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3893 * must not lie in the past).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3894 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3895 * This delay represents the difference between decoding and presentation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3896 * time of the frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3897 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3898 * For example, this corresponds to H.264 dpb_output_delay.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3899 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3900 int pts_dts_delta;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3901
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3902 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3903 * Position of the packet in file.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3904 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3905 * Analogous to cur_frame_pts/dts
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3906 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3907 int64_t cur_frame_pos[AV_PARSER_PTS_NB];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3908
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3909 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3910 * Byte position of currently parsed frame in stream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3911 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3912 int64_t pos;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3913
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3914 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3915 * Previous frame byte position.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3916 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3917 int64_t last_pos;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3918
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3919 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3920 * Duration of the current frame.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3921 * For audio, this is in units of 1 / AVCodecContext.sample_rate.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3922 * For all other types, this is in units of AVCodecContext.time_base.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3923 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3924 int duration;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3925
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3926 enum AVFieldOrder field_order;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3927 } AVCodecParserContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3928
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3929 typedef struct AVCodecParser {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3930 int codec_ids[5]; /* several codec IDs are permitted */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3931 int priv_data_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3932 int (*parser_init)(AVCodecParserContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3933 int (*parser_parse)(AVCodecParserContext *s,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3934 AVCodecContext *avctx,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3935 const uint8_t **poutbuf, int *poutbuf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3936 const uint8_t *buf, int buf_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3937 void (*parser_close)(AVCodecParserContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3938 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3939 struct AVCodecParser *next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3940 } AVCodecParser;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3941
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3942 AVCodecParser *av_parser_next(AVCodecParser *c);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3943
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3944 void av_register_codec_parser(AVCodecParser *parser);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3945 AVCodecParserContext *av_parser_init(int codec_id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3946
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3947 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3948 * Parse a packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3949 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3950 * @param s parser context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3951 * @param avctx codec context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3952 * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3953 * @param poutbuf_size set to size of parsed buffer or zero if not yet finished.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3954 * @param buf input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3955 * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3956 * @param pts input presentation timestamp.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3957 * @param dts input decoding timestamp.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3958 * @param pos input byte position in stream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3959 * @return the number of bytes of the input bitstream used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3960 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3961 * Example:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3962 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3963 * while(in_len){
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3964 * len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3965 * in_data, in_len,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3966 * pts, dts, pos);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3967 * in_data += len;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3968 * in_len -= len;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3969 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3970 * if(size)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3971 * decode_frame(data, size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3972 * }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3973 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3974 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3975 int av_parser_parse2(AVCodecParserContext *s,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3976 AVCodecContext *avctx,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3977 uint8_t **poutbuf, int *poutbuf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3978 const uint8_t *buf, int buf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3979 int64_t pts, int64_t dts,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3980 int64_t pos);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3981
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3982 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3983 * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3984 * @deprecated use AVBitStreamFilter
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3985 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3986 int av_parser_change(AVCodecParserContext *s,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3987 AVCodecContext *avctx,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3988 uint8_t **poutbuf, int *poutbuf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3989 const uint8_t *buf, int buf_size, int keyframe);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3990 void av_parser_close(AVCodecParserContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3991
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3992 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3993 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3994 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3995 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3996
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3997 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3998 * @addtogroup lavc_encoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3999 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4000 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4001
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4002 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4003 * Find a registered encoder with a matching codec ID.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4004 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4005 * @param id AVCodecID of the requested encoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4006 * @return An encoder if one was found, NULL otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4007 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4008 AVCodec *avcodec_find_encoder(enum AVCodecID id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4009
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4010 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4011 * Find a registered encoder with the specified name.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4012 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4013 * @param name name of the requested encoder
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4014 * @return An encoder if one was found, NULL otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4015 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4016 AVCodec *avcodec_find_encoder_by_name(const char *name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4017
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4018 #if FF_API_OLD_ENCODE_AUDIO
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4019 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4020 * Encode an audio frame from samples into buf.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4021 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4022 * @deprecated Use avcodec_encode_audio2 instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4023 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4024 * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4025 * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4026 * will know how much space is needed because it depends on the value passed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4027 * in buf_size as described below. In that case a lower value can be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4028 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4029 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4030 * @param[out] buf the output buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4031 * @param[in] buf_size the output buffer size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4032 * @param[in] samples the input buffer containing the samples
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4033 * The number of samples read from this buffer is frame_size*channels,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4034 * both of which are defined in avctx.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4035 * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4036 * samples read from samples is equal to:
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4037 * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4038 * This also implies that av_get_bits_per_sample() must not return 0 for these
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4039 * codecs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4040 * @return On error a negative value is returned, on success zero or the number
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4041 * of bytes used to encode the data read from the input buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4042 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4043 int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4044 uint8_t *buf, int buf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4045 const short *samples);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4046 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4047
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4048 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4049 * Encode a frame of audio.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4050 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4051 * Takes input samples from frame and writes the next output packet, if
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4052 * available, to avpkt. The output packet does not necessarily contain data for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4053 * the most recent frame, as encoders can delay, split, and combine input frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4054 * internally as needed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4055 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4056 * @param avctx codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4057 * @param avpkt output AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4058 * The user can supply an output buffer by setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4059 * avpkt->data and avpkt->size prior to calling the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4060 * function, but if the size of the user-provided data is not
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4061 * large enough, encoding will fail. If avpkt->data and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4062 * avpkt->size are set, avpkt->destruct must also be set. All
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4063 * other AVPacket fields will be reset by the encoder using
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4064 * av_init_packet(). If avpkt->data is NULL, the encoder will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4065 * allocate it. The encoder will set avpkt->size to the size
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4066 * of the output packet.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4067 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4068 * If this function fails or produces no output, avpkt will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4069 * freed using av_free_packet() (i.e. avpkt->destruct will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4070 * called to free the user supplied buffer).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4071 * @param[in] frame AVFrame containing the raw audio data to be encoded.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4072 * May be NULL when flushing an encoder that has the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4073 * CODEC_CAP_DELAY capability set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4074 * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4075 * can have any number of samples.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4076 * If it is not set, frame->nb_samples must be equal to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4077 * avctx->frame_size for all frames except the last.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4078 * The final frame may be smaller than avctx->frame_size.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4079 * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4080 * output packet is non-empty, and to 0 if it is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4081 * empty. If the function returns an error, the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4082 * packet can be assumed to be invalid, and the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4083 * value of got_packet_ptr is undefined and should
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4084 * not be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4085 * @return 0 on success, negative error code on failure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4086 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4087 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4088 const AVFrame *frame, int *got_packet_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4089
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4090 #if FF_API_OLD_ENCODE_VIDEO
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4091 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4092 * @deprecated use avcodec_encode_video2() instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4093 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4094 * Encode a video frame from pict into buf.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4095 * The input picture should be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4096 * stored using a specific format, namely avctx.pix_fmt.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4097 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4098 * @param avctx the codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4099 * @param[out] buf the output buffer for the bitstream of encoded frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4100 * @param[in] buf_size the size of the output buffer in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4101 * @param[in] pict the input picture to encode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4102 * @return On error a negative value is returned, on success zero or the number
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4103 * of bytes used from the output buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4104 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4105 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4106 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4107 const AVFrame *pict);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4108 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4109
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4110 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4111 * Encode a frame of video.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4112 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4113 * Takes input raw video data from frame and writes the next output packet, if
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4114 * available, to avpkt. The output packet does not necessarily contain data for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4115 * the most recent frame, as encoders can delay and reorder input frames
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4116 * internally as needed.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4117 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4118 * @param avctx codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4119 * @param avpkt output AVPacket.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4120 * The user can supply an output buffer by setting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4121 * avpkt->data and avpkt->size prior to calling the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4122 * function, but if the size of the user-provided data is not
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4123 * large enough, encoding will fail. All other AVPacket fields
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4124 * will be reset by the encoder using av_init_packet(). If
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4125 * avpkt->data is NULL, the encoder will allocate it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4126 * The encoder will set avpkt->size to the size of the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4127 * output packet. The returned data (if any) belongs to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4128 * caller, he is responsible for freeing it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4129 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4130 * If this function fails or produces no output, avpkt will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4131 * freed using av_free_packet() (i.e. avpkt->destruct will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4132 * called to free the user supplied buffer).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4133 * @param[in] frame AVFrame containing the raw video data to be encoded.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4134 * May be NULL when flushing an encoder that has the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4135 * CODEC_CAP_DELAY capability set.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4136 * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4137 * output packet is non-empty, and to 0 if it is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4138 * empty. If the function returns an error, the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4139 * packet can be assumed to be invalid, and the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4140 * value of got_packet_ptr is undefined and should
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4141 * not be used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4142 * @return 0 on success, negative error code on failure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4143 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4144 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4145 const AVFrame *frame, int *got_packet_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4146
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4147 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4148 const AVSubtitle *sub);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4149
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4150
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4151 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4152 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4153 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4154
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4155 #if FF_API_AVCODEC_RESAMPLE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4156 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4157 * @defgroup lavc_resample Audio resampling
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4158 * @ingroup libavc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4159 * @deprecated use libswresample instead
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4160 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4161 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4162 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4163 struct ReSampleContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4164 struct AVResampleContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4165
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4166 typedef struct ReSampleContext ReSampleContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4167
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4168 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4169 * Initialize audio resampling context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4170 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4171 * @param output_channels number of output channels
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4172 * @param input_channels number of input channels
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4173 * @param output_rate output sample rate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4174 * @param input_rate input sample rate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4175 * @param sample_fmt_out requested output sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4176 * @param sample_fmt_in input sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4177 * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4178 * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4179 * @param linear if 1 then the used FIR filter will be linearly interpolated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4180 between the 2 closest, if 0 the closest will be used
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4181 * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4182 * @return allocated ReSampleContext, NULL if error occurred
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4183 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4184 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4185 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4186 int output_rate, int input_rate,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4187 enum AVSampleFormat sample_fmt_out,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4188 enum AVSampleFormat sample_fmt_in,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4189 int filter_length, int log2_phase_count,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4190 int linear, double cutoff);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4191
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4192 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4193 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4194
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4195 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4196 * Free resample context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4197 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4198 * @param s a non-NULL pointer to a resample context previously
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4199 * created with av_audio_resample_init()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4200 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4201 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4202 void audio_resample_close(ReSampleContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4203
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4204
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4205 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4206 * Initialize an audio resampler.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4207 * Note, if either rate is not an integer then simply scale both rates up so they are.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4208 * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4209 * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4210 * @param linear If 1 then the used FIR filter will be linearly interpolated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4211 between the 2 closest, if 0 the closest will be used
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4212 * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4213 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4214 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4215 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4216
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4217 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4218 * Resample an array of samples using a previously configured context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4219 * @param src an array of unconsumed samples
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4220 * @param consumed the number of samples of src which have been consumed are returned here
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4221 * @param src_size the number of unconsumed samples available
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4222 * @param dst_size the amount of space in samples available in dst
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4223 * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4224 * @return the number of samples written in dst or -1 if an error occurred
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4225 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4226 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4227 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4228
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4229
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4230 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4231 * Compensate samplerate/timestamp drift. The compensation is done by changing
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4232 * the resampler parameters, so no audible clicks or similar distortions occur
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4233 * @param compensation_distance distance in output samples over which the compensation should be performed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4234 * @param sample_delta number of output samples which should be output less
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4235 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4236 * example: av_resample_compensate(c, 10, 500)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4237 * here instead of 510 samples only 500 samples would be output
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4238 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4239 * note, due to rounding the actual compensation might be slightly different,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4240 * especially if the compensation_distance is large and the in_rate used during init is small
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4241 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4242 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4243 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4244 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4245 void av_resample_close(struct AVResampleContext *c);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4246
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4247 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4248 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4249 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4250 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4251
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4252 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4253 * @addtogroup lavc_picture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4254 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4255 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4256
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4257 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4258 * Allocate memory for a picture. Call avpicture_free() to free it.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4259 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4260 * @see avpicture_fill()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4261 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4262 * @param picture the picture to be filled in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4263 * @param pix_fmt the format of the picture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4264 * @param width the width of the picture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4265 * @param height the height of the picture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4266 * @return zero if successful, a negative value if not
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4267 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4268 int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4269
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4270 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4271 * Free a picture previously allocated by avpicture_alloc().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4272 * The data buffer used by the AVPicture is freed, but the AVPicture structure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4273 * itself is not.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4274 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4275 * @param picture the AVPicture to be freed
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4276 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4277 void avpicture_free(AVPicture *picture);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4278
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4279 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4280 * Fill in the AVPicture fields, always assume a linesize alignment of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4281 * 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4282 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4283 * @see av_image_fill_arrays()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4284 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4285 int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4286 enum AVPixelFormat pix_fmt, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4287
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4288 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4289 * Copy pixel data from an AVPicture into a buffer, always assume a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4290 * linesize alignment of 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4291 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4292 * @see av_image_copy_to_buffer()
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4293 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4294 int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4295 int width, int height,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4296 unsigned char *dest, int dest_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4297
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4298 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4299 * Calculate the size in bytes that a picture of the given width and height
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4300 * would occupy if stored in the given picture format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4301 * Always assume a linesize alignment of 1.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4302 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4303 * @see av_image_get_buffer_size().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4304 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4305 int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4306
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4307 #if FF_API_DEINTERLACE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4308 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4309 * deinterlace - if not supported return -1
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4310 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4311 * @deprecated - use yadif (in libavfilter) instead
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4312 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4313 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4314 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4315 enum AVPixelFormat pix_fmt, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4316 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4317 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4318 * Copy image src to dst. Wraps av_image_copy().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4319 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4320 void av_picture_copy(AVPicture *dst, const AVPicture *src,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4321 enum AVPixelFormat pix_fmt, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4322
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4323 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4324 * Crop image top and left side.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4325 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4326 int av_picture_crop(AVPicture *dst, const AVPicture *src,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4327 enum AVPixelFormat pix_fmt, int top_band, int left_band);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4328
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4329 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4330 * Pad image.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4331 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4332 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4333 int padtop, int padbottom, int padleft, int padright, int *color);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4334
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4335 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4336 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4337 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4338
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4339 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4340 * @defgroup lavc_misc Utility functions
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4341 * @ingroup libavc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4342 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4343 * Miscellaneous utility functions related to both encoding and decoding
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4344 * (or neither).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4345 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4346 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4347
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4348 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4349 * @defgroup lavc_misc_pixfmt Pixel formats
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4350 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4351 * Functions for working with pixel formats.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4352 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4353 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4354
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4355 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4356 * Utility function to access log2_chroma_w log2_chroma_h from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4357 * the pixel format AVPixFmtDescriptor.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4358 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4359 * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4360 * for one that returns a failure code and continues in case of invalid
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4361 * pix_fmts.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4362 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4363 * @param[in] pix_fmt the pixel format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4364 * @param[out] h_shift store log2_chroma_w
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4365 * @param[out] v_shift store log2_chroma_h
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4366 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4367 * @see av_pix_fmt_get_chroma_sub_sample
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4368 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4369
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4370 void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4371
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4372 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4373 * Return a value representing the fourCC code associated to the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4374 * pixel format pix_fmt, or 0 if no associated fourCC code can be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4375 * found.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4376 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4377 unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4378
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4379 #define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4380 #define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4381 #define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4382 #define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4383 #define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4384 #define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4385
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4386 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4387 * Compute what kind of losses will occur when converting from one specific
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4388 * pixel format to another.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4389 * When converting from one pixel format to another, information loss may occur.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4390 * For example, when converting from RGB24 to GRAY, the color information will
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4391 * be lost. Similarly, other losses occur when converting from some formats to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4392 * other formats. These losses can involve loss of chroma, but also loss of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4393 * resolution, loss of color depth, loss due to the color space conversion, loss
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4394 * of the alpha bits or loss due to color quantization.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4395 * avcodec_get_fix_fmt_loss() informs you about the various types of losses
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4396 * which will occur when converting from one pixel format to another.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4397 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4398 * @param[in] dst_pix_fmt destination pixel format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4399 * @param[in] src_pix_fmt source pixel format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4400 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4401 * @return Combination of flags informing you what kind of losses will occur
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4402 * (maximum loss for an invalid dst_pix_fmt).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4403 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4404 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4405 int has_alpha);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4406
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4407 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4408 * Find the best pixel format to convert to given a certain source pixel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4409 * format. When converting from one pixel format to another, information loss
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4410 * may occur. For example, when converting from RGB24 to GRAY, the color
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4411 * information will be lost. Similarly, other losses occur when converting from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4412 * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4413 * the given pixel formats should be used to suffer the least amount of loss.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4414 * The pixel formats from which it chooses one, are determined by the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4415 * pix_fmt_list parameter.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4416 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4417 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4418 * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4419 * @param[in] src_pix_fmt source pixel format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4420 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4421 * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4422 * @return The best pixel format to convert to or -1 if none was found.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4423 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4424 enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4425 enum AVPixelFormat src_pix_fmt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4426 int has_alpha, int *loss_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4427
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4428 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4429 * Find the best pixel format to convert to given a certain source pixel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4430 * format and a selection of two destination pixel formats. When converting from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4431 * one pixel format to another, information loss may occur. For example, when converting
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4432 * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4433 * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4434 * the given pixel formats should be used to suffer the least amount of loss.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4435 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4436 * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4437 * returned.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4438 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4439 * @code
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4440 * src_pix_fmt = AV_PIX_FMT_YUV420P;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4441 * dst_pix_fmt1= AV_PIX_FMT_RGB24;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4442 * dst_pix_fmt2= AV_PIX_FMT_GRAY8;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4443 * dst_pix_fmt3= AV_PIX_FMT_RGB8;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4444 * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4445 * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4446 * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4447 * @endcode
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4448 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4449 * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4450 * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4451 * @param[in] src_pix_fmt Source pixel format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4452 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4453 * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4454 * NULL or value of zero means we care about all losses. Out: the loss
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4455 * that occurs when converting from src to selected dst pixel format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4456 * @return The best pixel format to convert to or -1 if none was found.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4457 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4458 enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4459 enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4460
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4461 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4462 #if AV_HAVE_INCOMPATIBLE_FORK_ABI
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4463 enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4464 enum AVPixelFormat src_pix_fmt,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4465 int has_alpha, int *loss_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4466 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4467 enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4468 enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4469 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4470
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4471
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4472 enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4473
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4474 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4475 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4476 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4477
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4478 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4479
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4480 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4481 * Put a string representing the codec tag codec_tag in buf.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4482 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4483 * @param buf_size size in bytes of buf
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4484 * @return the length of the string that would have been generated if
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4485 * enough space had been available, excluding the trailing null
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4486 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4487 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4488
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4489 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4490
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4491 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4492 * Return a name for the specified profile, if available.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4493 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4494 * @param codec the codec that is searched for the given profile
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4495 * @param profile the profile value for which a name is requested
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4496 * @return A name for the profile if found, NULL otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4497 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4498 const char *av_get_profile_name(const AVCodec *codec, int profile);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4499
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4500 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4501 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4502 //FIXME func typedef
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4503
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4504 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4505 * Fill AVFrame audio data and linesize pointers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4506 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4507 * The buffer buf must be a preallocated buffer with a size big enough
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4508 * to contain the specified samples amount. The filled AVFrame data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4509 * pointers will point to this buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4510 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4511 * AVFrame extended_data channel pointers are allocated if necessary for
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4512 * planar audio.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4513 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4514 * @param frame the AVFrame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4515 * frame->nb_samples must be set prior to calling the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4516 * function. This function fills in frame->data,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4517 * frame->extended_data, frame->linesize[0].
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4518 * @param nb_channels channel count
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4519 * @param sample_fmt sample format
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4520 * @param buf buffer to use for frame data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4521 * @param buf_size size of buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4522 * @param align plane size sample alignment (0 = default)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4523 * @return >=0 on success, negative error code on failure
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4524 * @todo return the size in bytes required to store the samples in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4525 * case of success, at the next libavutil bump
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4526 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4527 int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4528 enum AVSampleFormat sample_fmt, const uint8_t *buf,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4529 int buf_size, int align);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4530
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4531 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4532 * Flush buffers, should be called when seeking or when switching to a different stream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4533 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4534 void avcodec_flush_buffers(AVCodecContext *avctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4535
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4536 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4537 * Return codec bits per sample.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4538 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4539 * @param[in] codec_id the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4540 * @return Number of bits per sample or zero if unknown for the given codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4541 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4542 int av_get_bits_per_sample(enum AVCodecID codec_id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4543
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4544 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4545 * Return the PCM codec associated with a sample format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4546 * @param be endianness, 0 for little, 1 for big,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4547 * -1 (or anything else) for native
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4548 * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4549 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4550 enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4551
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4552 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4553 * Return codec bits per sample.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4554 * Only return non-zero if the bits per sample is exactly correct, not an
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4555 * approximation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4556 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4557 * @param[in] codec_id the codec
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4558 * @return Number of bits per sample or zero if unknown for the given codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4559 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4560 int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4561
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4562 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4563 * Return audio frame duration.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4564 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4565 * @param avctx codec context
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4566 * @param frame_bytes size of the frame, or 0 if unknown
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4567 * @return frame duration, in samples, if known. 0 if not able to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4568 * determine.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4569 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4570 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4571
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4572
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4573 typedef struct AVBitStreamFilterContext {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4574 void *priv_data;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4575 struct AVBitStreamFilter *filter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4576 AVCodecParserContext *parser;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4577 struct AVBitStreamFilterContext *next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4578 } AVBitStreamFilterContext;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4579
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4580
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4581 typedef struct AVBitStreamFilter {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4582 const char *name;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4583 int priv_data_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4584 int (*filter)(AVBitStreamFilterContext *bsfc,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4585 AVCodecContext *avctx, const char *args,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4586 uint8_t **poutbuf, int *poutbuf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4587 const uint8_t *buf, int buf_size, int keyframe);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4588 void (*close)(AVBitStreamFilterContext *bsfc);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4589 struct AVBitStreamFilter *next;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4590 } AVBitStreamFilter;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4591
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4592 void av_register_bitstream_filter(AVBitStreamFilter *bsf);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4593 AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4594 int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4595 AVCodecContext *avctx, const char *args,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4596 uint8_t **poutbuf, int *poutbuf_size,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4597 const uint8_t *buf, int buf_size, int keyframe);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4598 void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4599
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4600 AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4601
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4602 /* memory */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4603
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4604 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4605 * Reallocate the given block if it is not large enough, otherwise do nothing.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4606 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4607 * @see av_realloc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4608 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4609 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4610
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4611 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4612 * Allocate a buffer, reusing the given one if large enough.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4613 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4614 * Contrary to av_fast_realloc the current buffer contents might not be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4615 * preserved and on error the old buffer is freed, thus no special
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4616 * handling to avoid memleaks is necessary.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4617 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4618 * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4619 * @param size size of the buffer *ptr points to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4620 * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4621 * *size 0 if an error occurred.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4622 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4623 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4624
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4625 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4626 * Same behaviour av_fast_malloc but the buffer has additional
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4627 * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4628 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4629 * In addition the whole buffer will initially and after resizes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4630 * be 0-initialized so that no uninitialized data will ever appear.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4631 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4632 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4633
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4634 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4635 * Same behaviour av_fast_padded_malloc except that buffer will always
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4636 * be 0-initialized after call.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4637 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4638 void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4639
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4640 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4641 * Encode extradata length to a buffer. Used by xiph codecs.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4642 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4643 * @param s buffer to write to; must be at least (v/255+1) bytes long
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4644 * @param v size of extradata in bytes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4645 * @return number of bytes written to the buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4646 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4647 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4648
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4649 #if FF_API_MISSING_SAMPLE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4650 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4651 * Log a generic warning message about a missing feature. This function is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4652 * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4653 * only, and would normally not be used by applications.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4654 * @param[in] avc a pointer to an arbitrary struct of which the first field is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4655 * a pointer to an AVClass struct
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4656 * @param[in] feature string containing the name of the missing feature
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4657 * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4658 * If want_sample is non-zero, additional verbage will be added to the log
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4659 * message which tells the user how to report samples to the development
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4660 * mailing list.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4661 * @deprecated Use avpriv_report_missing_feature() instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4662 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4663 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4664 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4665
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4666 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4667 * Log a generic warning message asking for a sample. This function is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4668 * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4669 * only, and would normally not be used by applications.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4670 * @param[in] avc a pointer to an arbitrary struct of which the first field is
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4671 * a pointer to an AVClass struct
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4672 * @param[in] msg string containing an optional message, or NULL if no message
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4673 * @deprecated Use avpriv_request_sample() instead.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4674 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4675 attribute_deprecated
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4676 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4677 #endif /* FF_API_MISSING_SAMPLE */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4678
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4679 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4680 * Register the hardware accelerator hwaccel.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4681 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4682 void av_register_hwaccel(AVHWAccel *hwaccel);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4683
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4684 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4685 * If hwaccel is NULL, returns the first registered hardware accelerator,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4686 * if hwaccel is non-NULL, returns the next registered hardware accelerator
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4687 * after hwaccel, or NULL if hwaccel is the last one.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4688 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4689 AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4690
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4691
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4692 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4693 * Lock operation used by lockmgr
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4694 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4695 enum AVLockOp {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4696 AV_LOCK_CREATE, ///< Create a mutex
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4697 AV_LOCK_OBTAIN, ///< Lock the mutex
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4698 AV_LOCK_RELEASE, ///< Unlock the mutex
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4699 AV_LOCK_DESTROY, ///< Free mutex resources
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4700 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4701
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4702 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4703 * Register a user provided lock manager supporting the operations
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4704 * specified by AVLockOp. mutex points to a (void *) where the
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4705 * lockmgr should store/get a pointer to a user allocated mutex. It's
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4706 * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4707 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4708 * @param cb User defined callback. Note: FFmpeg may invoke calls to this
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4709 * callback during the call to av_lockmgr_register().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4710 * Thus, the application must be prepared to handle that.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4711 * If cb is set to NULL the lockmgr will be unregistered.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4712 * Also note that during unregistration the previously registered
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4713 * lockmgr callback may also be invoked.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4714 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4715 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4716
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4717 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4718 * Get the type of the given codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4719 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4720 enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4721
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4722 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4723 * Get the name of a codec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4724 * @return a static string identifying the codec; never NULL
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4725 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4726 const char *avcodec_get_name(enum AVCodecID id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4727
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4728 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4729 * @return a positive value if s is open (i.e. avcodec_open2() was called on it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4730 * with no corresponding avcodec_close()), 0 otherwise.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4731 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4732 int avcodec_is_open(AVCodecContext *s);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4733
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4734 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4735 * @return a non-zero number if codec is an encoder, zero otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4736 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4737 int av_codec_is_encoder(const AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4738
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4739 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4740 * @return a non-zero number if codec is a decoder, zero otherwise
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4741 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4742 int av_codec_is_decoder(const AVCodec *codec);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4743
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4744 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4745 * @return descriptor for given codec ID or NULL if no descriptor exists.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4746 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4747 const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4748
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4749 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4750 * Iterate over all codec descriptors known to libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4751 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4752 * @param prev previous descriptor. NULL to get the first descriptor.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4753 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4754 * @return next descriptor or NULL after the last descriptor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4755 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4756 const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4757
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4758 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4759 * @return codec descriptor with the given name or NULL if no such descriptor
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4760 * exists.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4761 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4762 const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4763
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4764 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4765 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4766 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4767
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4768 #endif /* AVCODEC_AVCODEC_H */