| OLD | NEW |
| 1 /* | 1 /* |
| 2 * copyright (c) 2001 Fabrice Bellard | 2 * copyright (c) 2001 Fabrice Bellard |
| 3 * | 3 * |
| 4 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
| 5 * | 5 * |
| 6 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2.1 of the License, or (at your option) any later version. | 9 * version 2.1 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #ifndef AVCODEC_AVCODEC_H | 21 #ifndef AVCODEC_AVCODEC_H |
| 22 #define AVCODEC_AVCODEC_H | 22 #define AVCODEC_AVCODEC_H |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @file | 25 * @file |
| 26 * external API header | 26 * external API header |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include <errno.h> | 29 #include <errno.h> |
| 30 #include "libavutil/avutil.h" | 30 #include "libavutil/avutil.h" |
| 31 #include "libavutil/cpu.h" |
| 31 | 32 |
| 32 #define LIBAVCODEC_VERSION_MAJOR 52 | 33 #define LIBAVCODEC_VERSION_MAJOR 52 |
| 33 #define LIBAVCODEC_VERSION_MINOR 85 | 34 #define LIBAVCODEC_VERSION_MINOR 89 |
| 34 #define LIBAVCODEC_VERSION_MICRO 0 | 35 #define LIBAVCODEC_VERSION_MICRO 0 |
| 35 | 36 |
| 36 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 37 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 37 LIBAVCODEC_VERSION_MINOR, \ | 38 LIBAVCODEC_VERSION_MINOR, \ |
| 38 LIBAVCODEC_VERSION_MICRO) | 39 LIBAVCODEC_VERSION_MICRO) |
| 39 #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ | 40 #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ |
| 40 LIBAVCODEC_VERSION_MINOR, \ | 41 LIBAVCODEC_VERSION_MINOR, \ |
| 41 LIBAVCODEC_VERSION_MICRO) | 42 LIBAVCODEC_VERSION_MICRO) |
| 42 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT | 43 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT |
| 43 | 44 |
| 44 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) | 45 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) |
| 45 | 46 |
| 47 /** |
| 48 * Those FF_API_* defines are not part of public API. |
| 49 * They may change, break or disappear at any time. |
| 50 */ |
| 51 #ifndef FF_API_PALETTE_CONTROL |
| 52 #define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54) |
| 53 #endif |
| 54 #ifndef FF_API_MM_FLAGS |
| 55 #define FF_API_MM_FLAGS (LIBAVCODEC_VERSION_MAJOR < 53) |
| 56 #endif |
| 57 |
| 46 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) | 58 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) |
| 47 #define AV_TIME_BASE 1000000 | 59 #define AV_TIME_BASE 1000000 |
| 48 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} | 60 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} |
| 49 | 61 |
| 50 /** | 62 /** |
| 51 * Identify the syntax and semantics of the bitstream. | 63 * Identify the syntax and semantics of the bitstream. |
| 52 * The principle is roughly: | 64 * The principle is roughly: |
| 53 * Two decoders with the same ID can decode the same streams. | 65 * Two decoders with the same ID can decode the same streams. |
| 54 * Two encoders with the same ID can encode compatible streams. | 66 * Two encoders with the same ID can encode compatible streams. |
| 55 * There may be slight deviations from the principle due to implementation | 67 * There may be slight deviations from the principle due to implementation |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 CODEC_ID_R210, | 218 CODEC_ID_R210, |
| 207 CODEC_ID_ANM, | 219 CODEC_ID_ANM, |
| 208 CODEC_ID_BINKVIDEO, | 220 CODEC_ID_BINKVIDEO, |
| 209 CODEC_ID_IFF_ILBM, | 221 CODEC_ID_IFF_ILBM, |
| 210 CODEC_ID_IFF_BYTERUN1, | 222 CODEC_ID_IFF_BYTERUN1, |
| 211 CODEC_ID_KGV1, | 223 CODEC_ID_KGV1, |
| 212 CODEC_ID_YOP, | 224 CODEC_ID_YOP, |
| 213 CODEC_ID_VP8, | 225 CODEC_ID_VP8, |
| 214 CODEC_ID_PICTOR, | 226 CODEC_ID_PICTOR, |
| 215 CODEC_ID_ANSI, | 227 CODEC_ID_ANSI, |
| 228 CODEC_ID_A64_MULTI, |
| 229 CODEC_ID_A64_MULTI5, |
| 216 | 230 |
| 217 /* various PCM "codecs" */ | 231 /* various PCM "codecs" */ |
| 218 CODEC_ID_PCM_S16LE= 0x10000, | 232 CODEC_ID_PCM_S16LE= 0x10000, |
| 219 CODEC_ID_PCM_S16BE, | 233 CODEC_ID_PCM_S16BE, |
| 220 CODEC_ID_PCM_U16LE, | 234 CODEC_ID_PCM_U16LE, |
| 221 CODEC_ID_PCM_U16BE, | 235 CODEC_ID_PCM_U16BE, |
| 222 CODEC_ID_PCM_S8, | 236 CODEC_ID_PCM_S8, |
| 223 CODEC_ID_PCM_U8, | 237 CODEC_ID_PCM_U8, |
| 224 CODEC_ID_PCM_MULAW, | 238 CODEC_ID_PCM_MULAW, |
| 225 CODEC_ID_PCM_ALAW, | 239 CODEC_ID_PCM_ALAW, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 CODEC_ID_ADPCM_THP, | 277 CODEC_ID_ADPCM_THP, |
| 264 CODEC_ID_ADPCM_IMA_AMV, | 278 CODEC_ID_ADPCM_IMA_AMV, |
| 265 CODEC_ID_ADPCM_EA_R1, | 279 CODEC_ID_ADPCM_EA_R1, |
| 266 CODEC_ID_ADPCM_EA_R3, | 280 CODEC_ID_ADPCM_EA_R3, |
| 267 CODEC_ID_ADPCM_EA_R2, | 281 CODEC_ID_ADPCM_EA_R2, |
| 268 CODEC_ID_ADPCM_IMA_EA_SEAD, | 282 CODEC_ID_ADPCM_IMA_EA_SEAD, |
| 269 CODEC_ID_ADPCM_IMA_EA_EACS, | 283 CODEC_ID_ADPCM_IMA_EA_EACS, |
| 270 CODEC_ID_ADPCM_EA_XAS, | 284 CODEC_ID_ADPCM_EA_XAS, |
| 271 CODEC_ID_ADPCM_EA_MAXIS_XA, | 285 CODEC_ID_ADPCM_EA_MAXIS_XA, |
| 272 CODEC_ID_ADPCM_IMA_ISS, | 286 CODEC_ID_ADPCM_IMA_ISS, |
| 287 CODEC_ID_ADPCM_G722, |
| 273 | 288 |
| 274 /* AMR */ | 289 /* AMR */ |
| 275 CODEC_ID_AMR_NB= 0x12000, | 290 CODEC_ID_AMR_NB= 0x12000, |
| 276 CODEC_ID_AMR_WB, | 291 CODEC_ID_AMR_WB, |
| 277 | 292 |
| 278 /* RealAudio codecs*/ | 293 /* RealAudio codecs*/ |
| 279 CODEC_ID_RA_144= 0x13000, | 294 CODEC_ID_RA_144= 0x13000, |
| 280 CODEC_ID_RA_288, | 295 CODEC_ID_RA_288, |
| 281 | 296 |
| 282 /* various DPCM codecs */ | 297 /* various DPCM codecs */ |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 | 1675 |
| 1661 /** | 1676 /** |
| 1662 * dsp_mask could be add used to disable unwanted CPU features | 1677 * dsp_mask could be add used to disable unwanted CPU features |
| 1663 * CPU features (i.e. MMX, SSE. ...) | 1678 * CPU features (i.e. MMX, SSE. ...) |
| 1664 * | 1679 * |
| 1665 * With the FORCE flag you may instead enable given CPU features. | 1680 * With the FORCE flag you may instead enable given CPU features. |
| 1666 * (Dangerous: Usable in case of misdetection, improper usage however will | 1681 * (Dangerous: Usable in case of misdetection, improper usage however will |
| 1667 * result into program crash.) | 1682 * result into program crash.) |
| 1668 */ | 1683 */ |
| 1669 unsigned dsp_mask; | 1684 unsigned dsp_mask; |
| 1670 #define FF_MM_FORCE 0x80000000 /* Force usage of selected flags (OR) */ | 1685 |
| 1671 /* lower 16 bits - CPU features */ | 1686 #if FF_API_MM_FLAGS |
| 1672 #define FF_MM_MMX 0x0001 ///< standard MMX | 1687 #define FF_MM_FORCE AV_CPU_FLAG_FORCE |
| 1673 #define FF_MM_3DNOW 0x0004 ///< AMD 3DNOW | 1688 #define FF_MM_MMX AV_CPU_FLAG_MMX |
| 1674 #if LIBAVCODEC_VERSION_MAJOR < 53 | 1689 #define FF_MM_3DNOW AV_CPU_FLAG_3DNOW |
| 1675 #define FF_MM_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext | 1690 #define FF_MM_MMXEXT AV_CPU_FLAG_MMX2 |
| 1691 #define FF_MM_MMX2 AV_CPU_FLAG_MMX2 |
| 1692 #define FF_MM_SSE AV_CPU_FLAG_SSE |
| 1693 #define FF_MM_SSE2 AV_CPU_FLAG_SSE2 |
| 1694 #define FF_MM_SSE2SLOW AV_CPU_FLAG_SSE2SLOW |
| 1695 #define FF_MM_3DNOWEXT AV_CPU_FLAG_3DNOWEXT |
| 1696 #define FF_MM_SSE3 AV_CPU_FLAG_SSE3 |
| 1697 #define FF_MM_SSE3SLOW AV_CPU_FLAG_SSE3SLOW |
| 1698 #define FF_MM_SSSE3 AV_CPU_FLAG_SSSE3 |
| 1699 #define FF_MM_SSE4 AV_CPU_FLAG_SSE4 |
| 1700 #define FF_MM_SSE42 AV_CPU_FLAG_SSE42 |
| 1701 #define FF_MM_IWMMXT AV_CPU_FLAG_IWMMXT |
| 1702 #define FF_MM_ALTIVEC AV_CPU_FLAG_ALTIVEC |
| 1676 #endif | 1703 #endif |
| 1677 #define FF_MM_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext | |
| 1678 #define FF_MM_SSE 0x0008 ///< SSE functions | |
| 1679 #define FF_MM_SSE2 0x0010 ///< PIV SSE2 functions | |
| 1680 #define FF_MM_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster | |
| 1681 ///< than regular MMX/SSE (e.g. Core1) | |
| 1682 #define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt | |
| 1683 #define FF_MM_SSE3 0x0040 ///< Prescott SSE3 functions | |
| 1684 #define FF_MM_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster | |
| 1685 ///< than regular MMX/SSE (e.g. Core1) | |
| 1686 #define FF_MM_SSSE3 0x0080 ///< Conroe SSSE3 functions | |
| 1687 #define FF_MM_SSE4 0x0100 ///< Penryn SSE4.1 functions | |
| 1688 #define FF_MM_SSE42 0x0200 ///< Nehalem SSE4.2 functions | |
| 1689 #define FF_MM_IWMMXT 0x0100 ///< XScale IWMMXT | |
| 1690 #define FF_MM_ALTIVEC 0x0001 ///< standard AltiVec | |
| 1691 | 1704 |
| 1692 /** | 1705 /** |
| 1693 * bits per sample/pixel from the demuxer (needed for huffyuv). | 1706 * bits per sample/pixel from the demuxer (needed for huffyuv). |
| 1694 * - encoding: Set by libavcodec. | 1707 * - encoding: Set by libavcodec. |
| 1695 * - decoding: Set by user. | 1708 * - decoding: Set by user. |
| 1696 */ | 1709 */ |
| 1697 int bits_per_coded_sample; | 1710 int bits_per_coded_sample; |
| 1698 | 1711 |
| 1699 /** | 1712 /** |
| 1700 * prediction method (needed for huffyuv) | 1713 * prediction method (needed for huffyuv) |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 */ | 2050 */ |
| 2038 int lmin; | 2051 int lmin; |
| 2039 | 2052 |
| 2040 /** | 2053 /** |
| 2041 * maximum Lagrange multipler | 2054 * maximum Lagrange multipler |
| 2042 * - encoding: Set by user. | 2055 * - encoding: Set by user. |
| 2043 * - decoding: unused | 2056 * - decoding: unused |
| 2044 */ | 2057 */ |
| 2045 int lmax; | 2058 int lmax; |
| 2046 | 2059 |
| 2060 #if FF_API_PALETTE_CONTROL |
| 2047 /** | 2061 /** |
| 2048 * palette control structure | 2062 * palette control structure |
| 2049 * - encoding: ??? (no palette-enabled encoder yet) | 2063 * - encoding: ??? (no palette-enabled encoder yet) |
| 2050 * - decoding: Set by user. | 2064 * - decoding: Set by user. |
| 2051 */ | 2065 */ |
| 2052 struct AVPaletteControl *palctrl; | 2066 struct AVPaletteControl *palctrl; |
| 2067 #endif |
| 2053 | 2068 |
| 2054 /** | 2069 /** |
| 2055 * noise reduction strength | 2070 * noise reduction strength |
| 2056 * - encoding: Set by user. | 2071 * - encoding: Set by user. |
| 2057 * - decoding: unused | 2072 * - decoding: unused |
| 2058 */ | 2073 */ |
| 2059 int noise_reduction; | 2074 int noise_reduction; |
| 2060 | 2075 |
| 2061 /** | 2076 /** |
| 2062 * Called at the beginning of a frame to get cr buffer for it. | 2077 * Called at the beginning of a frame to get cr buffer for it. |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 | 2927 |
| 2913 /** | 2928 /** |
| 2914 * four components are given, that's all. | 2929 * four components are given, that's all. |
| 2915 * the last component is alpha | 2930 * the last component is alpha |
| 2916 */ | 2931 */ |
| 2917 typedef struct AVPicture { | 2932 typedef struct AVPicture { |
| 2918 uint8_t *data[4]; | 2933 uint8_t *data[4]; |
| 2919 int linesize[4]; ///< number of bytes per line | 2934 int linesize[4]; ///< number of bytes per line |
| 2920 } AVPicture; | 2935 } AVPicture; |
| 2921 | 2936 |
| 2922 #if LIBAVCODEC_VERSION_MAJOR < 53 | 2937 #if FF_API_PALETTE_CONTROL |
| 2923 /** | 2938 /** |
| 2924 * AVPaletteControl | 2939 * AVPaletteControl |
| 2925 * This structure defines a method for communicating palette changes | 2940 * This structure defines a method for communicating palette changes |
| 2926 * between and demuxer and a decoder. | 2941 * between and demuxer and a decoder. |
| 2927 * | 2942 * |
| 2928 * @deprecated Use AVPacket to send palette changes instead. | 2943 * @deprecated Use AVPacket to send palette changes instead. |
| 2929 * This is totally broken. | 2944 * This is totally broken. |
| 2930 */ | 2945 */ |
| 2931 #define AVPALETTE_SIZE 1024 | 2946 #define AVPALETTE_SIZE 1024 |
| 2932 #define AVPALETTE_COUNT 256 | 2947 #define AVPALETTE_COUNT 256 |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3998 * preserved and on error the old buffer is freed, thus no special | 4013 * preserved and on error the old buffer is freed, thus no special |
| 3999 * handling to avoid memleaks is necessary. | 4014 * handling to avoid memleaks is necessary. |
| 4000 * | 4015 * |
| 4001 * @param ptr pointer to pointer to already allocated buffer, overwritten with p
ointer to new buffer | 4016 * @param ptr pointer to pointer to already allocated buffer, overwritten with p
ointer to new buffer |
| 4002 * @param size size of the buffer *ptr points to | 4017 * @param size size of the buffer *ptr points to |
| 4003 * @param min_size minimum size of *ptr buffer after returning, *ptr will be NUL
L and | 4018 * @param min_size minimum size of *ptr buffer after returning, *ptr will be NUL
L and |
| 4004 * *size 0 if an error occurred. | 4019 * *size 0 if an error occurred. |
| 4005 */ | 4020 */ |
| 4006 void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size); | 4021 void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size); |
| 4007 | 4022 |
| 4023 #if LIBAVCODEC_VERSION_MAJOR < 53 |
| 4008 /** | 4024 /** |
| 4009 * Copy image 'src' to 'dst'. | 4025 * @deprecated Deprecated in favor of av_image_copy(). |
| 4026 */ |
| 4027 attribute_deprecated |
| 4028 void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4], |
| 4029 uint8_t *src_data[4], int src_linesize[4], |
| 4030 enum PixelFormat pix_fmt, int width, int height); |
| 4031 #endif |
| 4032 |
| 4033 /** |
| 4034 * Copy image src to dst. Wraps av_picture_data_copy() above. |
| 4010 */ | 4035 */ |
| 4011 void av_picture_copy(AVPicture *dst, const AVPicture *src, | 4036 void av_picture_copy(AVPicture *dst, const AVPicture *src, |
| 4012 enum PixelFormat pix_fmt, int width, int height); | 4037 enum PixelFormat pix_fmt, int width, int height); |
| 4013 | 4038 |
| 4014 /** | 4039 /** |
| 4015 * Crop image top and left side. | 4040 * Crop image top and left side. |
| 4016 */ | 4041 */ |
| 4017 int av_picture_crop(AVPicture *dst, const AVPicture *src, | 4042 int av_picture_crop(AVPicture *dst, const AVPicture *src, |
| 4018 enum PixelFormat pix_fmt, int top_band, int left_band); | 4043 enum PixelFormat pix_fmt, int top_band, int left_band); |
| 4019 | 4044 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4104 * @param cb User defined callback. Note: FFmpeg may invoke calls to this | 4129 * @param cb User defined callback. Note: FFmpeg may invoke calls to this |
| 4105 * callback during the call to av_lockmgr_register(). | 4130 * callback during the call to av_lockmgr_register(). |
| 4106 * Thus, the application must be prepared to handle that. | 4131 * Thus, the application must be prepared to handle that. |
| 4107 * If cb is set to NULL the lockmgr will be unregistered. | 4132 * If cb is set to NULL the lockmgr will be unregistered. |
| 4108 * Also note that during unregistration the previously registered | 4133 * Also note that during unregistration the previously registered |
| 4109 * lockmgr callback may also be invoked. | 4134 * lockmgr callback may also be invoked. |
| 4110 */ | 4135 */ |
| 4111 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); | 4136 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); |
| 4112 | 4137 |
| 4113 #endif /* AVCODEC_AVCODEC_H */ | 4138 #endif /* AVCODEC_AVCODEC_H */ |
| OLD | NEW |