1793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/*
2793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
4793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * This file is part of FFmpeg.
5793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
6793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg is free software; you can redistribute it and/or
7793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * modify it under the terms of the GNU Lesser General Public
8793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * License as published by the Free Software Foundation; either
9793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * version 2.1 of the License, or (at your option) any later version.
10793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
11793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg is distributed in the hope that it will be useful,
12793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * but WITHOUT ANY WARRANTY; without even the implied warranty of
13793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Lesser General Public License for more details.
15793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
16793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * You should have received a copy of the GNU Lesser General Public
17793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * License along with FFmpeg; if not, write to the Free Software
18793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
20793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
21793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#ifndef AVUTIL_AVUTIL_H
22793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define AVUTIL_AVUTIL_H
23793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
24793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
25793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @file
26793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * external API header
27793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
28793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
29793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
30793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @mainpage
31793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
32793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @section ffmpeg_intro Introduction
33793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
34793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * This document describes the usage of the different libraries
35793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * provided by FFmpeg.
36793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
37793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref libavc "libavcodec" encoding/decoding library
38793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lavfi "libavfilter" graph-based frame editing library
39793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref libavf "libavformat" I/O and muxing/demuxing library
40793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lavd "libavdevice" special devices muxing/demuxing library
41793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lavu "libavutil" common utility library
42793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lswr "libswresample" audio resampling, format conversion and mixing
43793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lpp  "libpostproc" post processing library
44793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @li @ref lsws "libswscale" color conversion and scaling library
45793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
46793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @section ffmpeg_versioning Versioning and compatibility
47793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
48793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Each of the FFmpeg libraries contains a version.h header, which defines a
49793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * major, minor and micro version number with the
50793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
51793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * number is incremented with backward incompatible changes - e.g. removing
52793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * parts of the public API, reordering public struct members, etc. The minor
53793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * version number is incremented for backward compatible API changes or major
54793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * new features - e.g. adding a new public function or a new decoder. The micro
55793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * version number is incremented for smaller changes that a calling program
56793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * might still want to check for - e.g. changing behavior in a previously
57793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * unspecified situation.
58793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
59793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg guarantees backward API and ABI compatibility for each library as long
60793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * as its major version number is unchanged. This means that no public symbols
61793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * will be removed or renamed. Types and names of the public struct members and
62793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * values of public macros and enums will remain the same (unless they were
63793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * explicitly declared as not part of the public API). Documented behavior will
64793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * not change.
65793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
66793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * In other words, any correct program that works with a given FFmpeg snapshot
67793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * should work just as well without any changes with any later snapshot with the
68793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * same major versions. This applies to both rebuilding the program against new
69793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program
70793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * links against.
71793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
72793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * However, new public symbols may be added and new members may be appended to
73793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * public structs whose size is not part of public ABI (most public structs in
74793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg). New macros and enum values may be added. Behavior in undocumented
75793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * situations may change slightly (and be documented). All those are accompanied
76793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * by an entry in doc/APIchanges and incrementing either the minor or micro
77793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * version number.
78793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
79793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
80793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
81793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu Common utility functions
82793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
83793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @brief
84793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * libavutil contains the code shared across all the other FFmpeg
85793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * libraries
86793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
87793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @note In order to use the functions provided by avutil you must include
88793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * the specific header.
89793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
90793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
91793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
92793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_crypto Crypto and Hashing
93793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
94793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
95793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
96793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
97793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_math Maths
98793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
99793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
100793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
101793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
102793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_string String Manipulation
103793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
104793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
105793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
106793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
107793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
108793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_mem Memory Management
109793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
110793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
111793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
112793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
113793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
114793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_data Data Structures
115793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
116793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
117793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
118793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
119793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_audio Audio related
120793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
121793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
122793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
123793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
124793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
125793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_error Error Codes
126793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
127793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
128793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
129793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
130793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
131793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_misc Other
132793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
133793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
134793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
135793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_internal Internal
136793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
137793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Not exported functions, for internal usage only
138793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
139793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
140793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
141793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
142793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
143793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
144793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
145793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
146793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @addtogroup lavu_ver
147793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
148793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
149793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
150793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
151793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return the LIBAVUTIL_VERSION_INT constant.
152793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
153793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerunsigned avutil_version(void);
154793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
155793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
156793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return the libavutil build-time configuration.
157793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
158793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerconst char *avutil_configuration(void);
159793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
160793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
161793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return the libavutil license.
162793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
163793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerconst char *avutil_license(void);
164793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
165793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
166793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
167793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
168793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
169793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
170793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @addtogroup lavu_media Media Type
171793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @brief Media Type
172793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
173793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
174793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerenum AVMediaType {
175793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
176793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_VIDEO,
177793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_AUDIO,
178793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
179793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_SUBTITLE,
180793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
181793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AVMEDIA_TYPE_NB
182793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler};
183793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
184793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
185793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return a string describing the media_type enum, NULL if media_type
186793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * is unknown.
187793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
188793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerconst char *av_get_media_type_string(enum AVMediaType media_type);
189793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
190793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
191793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_const Constants
192793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
193793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
194793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_enc Encoding specific
195793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
196793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @note those definition should move to avcodec
197793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
198793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
199793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
200793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define FF_LAMBDA_SHIFT 7
201793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
202793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
203793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define FF_LAMBDA_MAX (256*128-1)
204793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
205793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
206793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
207793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
208793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
209793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_time Timestamp specific
210793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
211793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * FFmpeg internal timebase and timestamp definitions
212793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
213793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
214793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
215793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
216793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
217793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @brief Undefined timestamp value
218793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
219793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Usually reported by demuxer that work on containers that do not provide
220793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * either pts or dts.
221793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
222793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
223793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define AV_NOPTS_VALUE          ((int64_t)UINT64_C(0x8000000000000000))
224793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
225793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
226793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Internal time base represented as integer
227793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
228793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
229793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define AV_TIME_BASE            1000000
230793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
231793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
232793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Internal time base represented as fractional value
233793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
234793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
235793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
236793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
237793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
238793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
239793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
240793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @defgroup lavu_picture Image related
241793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
242793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * AVPicture types, pixel formats and basic image planes manipulation.
243793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
244793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @{
245793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
246793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
247793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerenum AVPictureType {
248793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_NONE = 0, ///< Undefined
249793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_I,     ///< Intra
250793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_P,     ///< Predicted
251793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
252793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
253793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_SI,    ///< Switching Intra
254793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
255793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    AV_PICTURE_TYPE_BI,    ///< BI type
256793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler};
257793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
258793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
259793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return a single letter to describe the given picture type
260793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * pict_type.
261793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
262793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param[in] pict_type the picture type @return a single character
263793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * representing the picture type, '?' if pict_type is unknown
264793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
265793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerchar av_get_picture_type_char(enum AVPictureType pict_type);
266793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
267793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
268793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
269793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
270793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
271793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "common.h"
272793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "error.h"
273793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "version.h"
274793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "mathematics.h"
275793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "rational.h"
276793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "intfloat_readwrite.h"
277793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "log.h"
278793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include "pixfmt.h"
279793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
280793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
281793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Return x default pointer in case p is NULL.
282793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
283793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerstatic inline void *av_x_if_null(const void *p, const void *x)
284793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler{
285793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    return (void *)(intptr_t)(p ? p : x);
286793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler}
287793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
288793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
289793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Compute the length of an integer list.
290793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
291793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param elsize  size in bytes of each list element (only 1, 2, 4 or 8)
292793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param term    list terminator (usually 0 or -1)
293793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param list    pointer to the list
294793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @return  length of the list, in elements, not counting the terminator
295793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
296793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerunsigned av_int_list_length_for_size(unsigned elsize,
297793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler                                     const void *list, uint64_t term) av_pure;
298793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
299793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
300793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Compute the length of an integer list.
301793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
302793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param term  list terminator (usually 0 or -1)
303793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @param list  pointer to the list
304793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @return  length of the list, in elements, not counting the terminator
305793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
306793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define av_int_list_length(list, term) \
307793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    av_int_list_length_for_size(sizeof(*(list)), list, term)
308793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
309793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**
310793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
311793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * @}
312793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler */
313793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
314793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#endif /* AVUTIL_AVUTIL_H */
315