avutil.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /*
  2. * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVUTIL_AVUTIL_H
  21. #define AVUTIL_AVUTIL_H
  22. /**
  23. * @file
  24. * external API header
  25. */
  26. /**
  27. * @mainpage
  28. *
  29. * @section ffmpeg_intro Introduction
  30. *
  31. * This document describes the usage of the different libraries
  32. * provided by FFmpeg.
  33. *
  34. * @li @ref libavc "libavcodec" encoding/decoding library
  35. * @li @ref lavfi "libavfilter" graph based frame editing library
  36. * @li @ref libavf "libavformat" I/O and muxing/demuxing library
  37. * @li @ref lavd "libavdevice" special devices muxing/demuxing library
  38. * @li @ref lavu "libavutil" common utility library
  39. * @li @ref lswr "libswresample" audio resampling, format conversion and mixing
  40. * @li @ref lpp "libpostproc" post processing library
  41. * @li @ref lsws "libswscale" color conversion and scaling library
  42. */
  43. /**
  44. * @defgroup lavu Common utility functions
  45. *
  46. * @brief
  47. * libavutil contains the code shared across all the other FFmpeg
  48. * libraries
  49. *
  50. * @note In order to use the functions provided by avutil you must include
  51. * the specific header.
  52. *
  53. * @{
  54. *
  55. * @defgroup lavu_crypto Crypto and Hashing
  56. *
  57. * @{
  58. * @}
  59. *
  60. * @defgroup lavu_math Maths
  61. * @{
  62. *
  63. * @}
  64. *
  65. * @defgroup lavu_string String Manipulation
  66. *
  67. * @{
  68. *
  69. * @}
  70. *
  71. * @defgroup lavu_mem Memory Management
  72. *
  73. * @{
  74. *
  75. * @}
  76. *
  77. * @defgroup lavu_data Data Structures
  78. * @{
  79. *
  80. * @}
  81. *
  82. * @defgroup lavu_audio Audio related
  83. *
  84. * @{
  85. *
  86. * @}
  87. *
  88. * @defgroup lavu_error Error Codes
  89. *
  90. * @{
  91. *
  92. * @}
  93. *
  94. * @defgroup lavu_misc Other
  95. *
  96. * @{
  97. *
  98. * @defgroup lavu_internal Internal
  99. *
  100. * Not exported functions, for internal usage only
  101. *
  102. * @{
  103. *
  104. * @}
  105. */
  106. /**
  107. * @addtogroup lavu_ver
  108. * @{
  109. */
  110. /**
  111. * Return the LIBAVUTIL_VERSION_INT constant.
  112. */
  113. unsigned avutil_version(void);
  114. /**
  115. * Return the libavutil build-time configuration.
  116. */
  117. const char *avutil_configuration(void);
  118. /**
  119. * Return the libavutil license.
  120. */
  121. const char *avutil_license(void);
  122. /**
  123. * @}
  124. */
  125. /**
  126. * @addtogroup lavu_media Media Type
  127. * @brief Media Type
  128. */
  129. enum AVMediaType {
  130. AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA
  131. AVMEDIA_TYPE_VIDEO,
  132. AVMEDIA_TYPE_AUDIO,
  133. AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous
  134. AVMEDIA_TYPE_SUBTITLE,
  135. AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse
  136. AVMEDIA_TYPE_NB
  137. };
  138. /**
  139. * Return a string describing the media_type enum, NULL if media_type
  140. * is unknown.
  141. */
  142. const char *av_get_media_type_string(enum AVMediaType media_type);
  143. /**
  144. * @defgroup lavu_const Constants
  145. * @{
  146. *
  147. * @defgroup lavu_enc Encoding specific
  148. *
  149. * @note those definition should move to avcodec
  150. * @{
  151. */
  152. #define FF_LAMBDA_SHIFT 7
  153. #define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
  154. #define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
  155. #define FF_LAMBDA_MAX (256*128-1)
  156. #define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
  157. /**
  158. * @}
  159. * @defgroup lavu_time Timestamp specific
  160. *
  161. * FFmpeg internal timebase and timestamp definitions
  162. *
  163. * @{
  164. */
  165. /**
  166. * @brief Undefined timestamp value
  167. *
  168. * Usually reported by demuxer that work on containers that do not provide
  169. * either pts or dts.
  170. */
  171. #define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
  172. /**
  173. * Internal time base represented as integer
  174. */
  175. #define AV_TIME_BASE 1000000
  176. /**
  177. * Internal time base represented as fractional value
  178. */
  179. #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
  180. /**
  181. * @}
  182. * @}
  183. * @defgroup lavu_picture Image related
  184. *
  185. * AVPicture types, pixel formats and basic image planes manipulation.
  186. *
  187. * @{
  188. */
  189. enum AVPictureType {
  190. AV_PICTURE_TYPE_NONE = 0, ///< Undefined
  191. AV_PICTURE_TYPE_I, ///< Intra
  192. AV_PICTURE_TYPE_P, ///< Predicted
  193. AV_PICTURE_TYPE_B, ///< Bi-dir predicted
  194. AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4
  195. AV_PICTURE_TYPE_SI, ///< Switching Intra
  196. AV_PICTURE_TYPE_SP, ///< Switching Predicted
  197. AV_PICTURE_TYPE_BI, ///< BI type
  198. };
  199. /**
  200. * Return a single letter to describe the given picture type
  201. * pict_type.
  202. *
  203. * @param[in] pict_type the picture type @return a single character
  204. * representing the picture type, '?' if pict_type is unknown
  205. */
  206. char av_get_picture_type_char(enum AVPictureType pict_type);
  207. /**
  208. * @}
  209. */
  210. #include "common.h"
  211. #include "error.h"
  212. #include "version.h"
  213. #include "mathematics.h"
  214. #include "rational.h"
  215. #include "intfloat_readwrite.h"
  216. #include "log.h"
  217. #include "pixfmt.h"
  218. /**
  219. * Return x default pointer in case p is NULL.
  220. */
  221. static inline void *av_x_if_null(const void *p, const void *x)
  222. {
  223. return (void *)(intptr_t)(p ? p : x);
  224. }
  225. /**
  226. * @}
  227. * @}
  228. */
  229. #endif /* AVUTIL_AVUTIL_H */