| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @file libavcodec/avcodec.h | 25 * @file libavcodec/avcodec.h |
| 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 | 31 |
| 32 #define LIBAVCODEC_VERSION_MAJOR 52 | 32 #define LIBAVCODEC_VERSION_MAJOR 52 |
| 33 #define LIBAVCODEC_VERSION_MINOR 52 | 33 #define LIBAVCODEC_VERSION_MINOR 59 |
| 34 #define LIBAVCODEC_VERSION_MICRO 0 | 34 #define LIBAVCODEC_VERSION_MICRO 0 |
| 35 | 35 |
| 36 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 36 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 37 LIBAVCODEC_VERSION_MINOR, \ | 37 LIBAVCODEC_VERSION_MINOR, \ |
| 38 LIBAVCODEC_VERSION_MICRO) | 38 LIBAVCODEC_VERSION_MICRO) |
| 39 #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ | 39 #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ |
| 40 LIBAVCODEC_VERSION_MINOR, \ | 40 LIBAVCODEC_VERSION_MINOR, \ |
| 41 LIBAVCODEC_VERSION_MICRO) | 41 LIBAVCODEC_VERSION_MICRO) |
| 42 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT | 42 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT |
| 43 | 43 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 CODEC_ID_TMV, | 197 CODEC_ID_TMV, |
| 198 CODEC_ID_V210, | 198 CODEC_ID_V210, |
| 199 CODEC_ID_DPX, | 199 CODEC_ID_DPX, |
| 200 CODEC_ID_MAD, | 200 CODEC_ID_MAD, |
| 201 CODEC_ID_FRWU, | 201 CODEC_ID_FRWU, |
| 202 CODEC_ID_FLASHSV2, | 202 CODEC_ID_FLASHSV2, |
| 203 CODEC_ID_CDGRAPHICS, | 203 CODEC_ID_CDGRAPHICS, |
| 204 CODEC_ID_R210, | 204 CODEC_ID_R210, |
| 205 CODEC_ID_ANM, | 205 CODEC_ID_ANM, |
| 206 CODEC_ID_BINKVIDEO, | 206 CODEC_ID_BINKVIDEO, |
| 207 CODEC_ID_IFF_ILBM, |
| 208 CODEC_ID_IFF_BYTERUN1, |
| 209 CODEC_ID_KGV1, |
| 207 | 210 |
| 208 /* various PCM "codecs" */ | 211 /* various PCM "codecs" */ |
| 209 CODEC_ID_PCM_S16LE= 0x10000, | 212 CODEC_ID_PCM_S16LE= 0x10000, |
| 210 CODEC_ID_PCM_S16BE, | 213 CODEC_ID_PCM_S16BE, |
| 211 CODEC_ID_PCM_U16LE, | 214 CODEC_ID_PCM_U16LE, |
| 212 CODEC_ID_PCM_U16BE, | 215 CODEC_ID_PCM_U16BE, |
| 213 CODEC_ID_PCM_S8, | 216 CODEC_ID_PCM_S8, |
| 214 CODEC_ID_PCM_U8, | 217 CODEC_ID_PCM_U8, |
| 215 CODEC_ID_PCM_MULAW, | 218 CODEC_ID_PCM_MULAW, |
| 216 CODEC_ID_PCM_ALAW, | 219 CODEC_ID_PCM_ALAW, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 #define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGH
T) | 418 #define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGH
T) |
| 416 #define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\ | 419 #define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\ |
| 417 CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT
_OF_CENTER) | 420 CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT
_OF_CENTER) |
| 418 #define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT) | 421 #define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT) |
| 419 | 422 |
| 420 /* in bytes */ | 423 /* in bytes */ |
| 421 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio | 424 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio |
| 422 | 425 |
| 423 /** | 426 /** |
| 424 * Required number of additionally allocated bytes at the end of the input bitst
ream for decoding. | 427 * Required number of additionally allocated bytes at the end of the input bitst
ream for decoding. |
| 425 * This is mainly needed because some optimized bitstream readers read | 428 * The first 8 bytes are needed because some optimized bitstream readers read |
| 426 * 32 or 64 bit at once and could read over the end.<br> | 429 * 32 or 64 bit at once and could read over the end. The remainder is to give |
| 430 * decoders a reasonable amount of distance to work with before checking for |
| 431 * buffer overreads.<br> |
| 427 * Note: If the first 23 bits of the additional bytes are not 0, then damaged | 432 * Note: If the first 23 bits of the additional bytes are not 0, then damaged |
| 428 * MPEG bitstreams could cause overread and segfault. | 433 * MPEG bitstreams could cause overread and segfault. |
| 429 */ | 434 */ |
| 430 #define FF_INPUT_BUFFER_PADDING_SIZE 8 | 435 #define FF_INPUT_BUFFER_PADDING_SIZE 64 |
| 431 | 436 |
| 432 /** | 437 /** |
| 433 * minimum encoding buffer size | 438 * minimum encoding buffer size |
| 434 * Used to avoid some checks during header writing. | 439 * Used to avoid some checks during header writing. |
| 435 */ | 440 */ |
| 436 #define FF_MIN_BUFFER_SIZE 16384 | 441 #define FF_MIN_BUFFER_SIZE 16384 |
| 437 | 442 |
| 438 | 443 |
| 439 /** | 444 /** |
| 440 * motion estimation type. | 445 * motion estimation type. |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 int buffer_hints;\ | 893 int buffer_hints;\ |
| 889 \ | 894 \ |
| 890 /**\ | 895 /**\ |
| 891 * DCT coefficients\ | 896 * DCT coefficients\ |
| 892 * - encoding: unused\ | 897 * - encoding: unused\ |
| 893 * - decoding: Set by libavcodec.\ | 898 * - decoding: Set by libavcodec.\ |
| 894 */\ | 899 */\ |
| 895 short *dct_coeff;\ | 900 short *dct_coeff;\ |
| 896 \ | 901 \ |
| 897 /**\ | 902 /**\ |
| 898 * motion referece frame index\ | 903 * motion reference frame index\ |
| 904 * the order in which these are stored can depend on the codec.\ |
| 899 * - encoding: Set by user.\ | 905 * - encoding: Set by user.\ |
| 900 * - decoding: Set by libavcodec.\ | 906 * - decoding: Set by libavcodec.\ |
| 901 */\ | 907 */\ |
| 902 int8_t *ref_index[2];\ | 908 int8_t *ref_index[2];\ |
| 903 \ | 909 \ |
| 904 /**\ | 910 /**\ |
| 905 * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reord
ered_opaque\ | 911 * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reord
ered_opaque\ |
| 906 * output in AVFrame.reordered_opaque\ | 912 * output in AVFrame.reordered_opaque\ |
| 907 * - encoding: unused\ | 913 * - encoding: unused\ |
| 908 * - decoding: Read by user.\ | 914 * - decoding: Read by user.\ |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 #define FF_BUG_AMV 32 | 1322 #define FF_BUG_AMV 32 |
| 1317 #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now hand
le these non-compliant files by default. | 1323 #define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now hand
le these non-compliant files by default. |
| 1318 #define FF_BUG_QPEL_CHROMA 64 | 1324 #define FF_BUG_QPEL_CHROMA 64 |
| 1319 #define FF_BUG_STD_QPEL 128 | 1325 #define FF_BUG_STD_QPEL 128 |
| 1320 #define FF_BUG_QPEL_CHROMA2 256 | 1326 #define FF_BUG_QPEL_CHROMA2 256 |
| 1321 #define FF_BUG_DIRECT_BLOCKSIZE 512 | 1327 #define FF_BUG_DIRECT_BLOCKSIZE 512 |
| 1322 #define FF_BUG_EDGE 1024 | 1328 #define FF_BUG_EDGE 1024 |
| 1323 #define FF_BUG_HPEL_CHROMA 2048 | 1329 #define FF_BUG_HPEL_CHROMA 2048 |
| 1324 #define FF_BUG_DC_CLIP 4096 | 1330 #define FF_BUG_DC_CLIP 4096 |
| 1325 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft'
s broken decoders. | 1331 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft'
s broken decoders. |
| 1332 #define FF_BUG_TRUNCATED 16384 |
| 1326 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%. | 1333 //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%. |
| 1327 | 1334 |
| 1328 /** | 1335 /** |
| 1329 * luma single coefficient elimination threshold | 1336 * luma single coefficient elimination threshold |
| 1330 * - encoding: Set by user. | 1337 * - encoding: Set by user. |
| 1331 * - decoding: unused | 1338 * - decoding: unused |
| 1332 */ | 1339 */ |
| 1333 int luma_elim_threshold; | 1340 int luma_elim_threshold; |
| 1334 | 1341 |
| 1335 /** | 1342 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 */ | 1380 */ |
| 1374 int error_recognition; | 1381 int error_recognition; |
| 1375 #define FF_ER_CAREFUL 1 | 1382 #define FF_ER_CAREFUL 1 |
| 1376 #define FF_ER_COMPLIANT 2 | 1383 #define FF_ER_COMPLIANT 2 |
| 1377 #define FF_ER_AGGRESSIVE 3 | 1384 #define FF_ER_AGGRESSIVE 3 |
| 1378 #define FF_ER_VERY_AGGRESSIVE 4 | 1385 #define FF_ER_VERY_AGGRESSIVE 4 |
| 1379 | 1386 |
| 1380 /** | 1387 /** |
| 1381 * Called at the beginning of each frame to get a buffer for it. | 1388 * Called at the beginning of each frame to get a buffer for it. |
| 1382 * If pic.reference is set then the frame will be read later by libavcodec. | 1389 * If pic.reference is set then the frame will be read later by libavcodec. |
| 1383 * avcodec_align_dimensions() should be used to find the required width and | 1390 * avcodec_align_dimensions2() should be used to find the required width and |
| 1384 * height, as they normally need to be rounded up to the next multiple of 16
. | 1391 * height, as they normally need to be rounded up to the next multiple of 16
. |
| 1385 * if CODEC_CAP_DR1 is not set then get_buffer() must call | 1392 * if CODEC_CAP_DR1 is not set then get_buffer() must call |
| 1386 * avcodec_default_get_buffer() instead of providing buffers allocated by | 1393 * avcodec_default_get_buffer() instead of providing buffers allocated by |
| 1387 * some other means. May be called from a different thread if FF_THREAD_FRAM
E | 1394 * some other means. May be called from a different thread if FF_THREAD_FRAM
E |
| 1388 * is set, but does not need to be reentrant. | 1395 * is set, but does not need to be reentrant. |
| 1389 * - encoding: unused | 1396 * - encoding: unused |
| 1390 * - decoding: Set by libavcodec., user can override. | 1397 * - decoding: Set by libavcodec., user can override. |
| 1391 */ | 1398 */ |
| 1392 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); | 1399 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); |
| 1393 | 1400 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 #define FF_IDCT_XVIDMMX 14 | 1592 #define FF_IDCT_XVIDMMX 14 |
| 1586 #define FF_IDCT_CAVS 15 | 1593 #define FF_IDCT_CAVS 15 |
| 1587 #define FF_IDCT_SIMPLEARMV5TE 16 | 1594 #define FF_IDCT_SIMPLEARMV5TE 16 |
| 1588 #define FF_IDCT_SIMPLEARMV6 17 | 1595 #define FF_IDCT_SIMPLEARMV6 17 |
| 1589 #define FF_IDCT_SIMPLEVIS 18 | 1596 #define FF_IDCT_SIMPLEVIS 18 |
| 1590 #define FF_IDCT_WMV2 19 | 1597 #define FF_IDCT_WMV2 19 |
| 1591 #define FF_IDCT_FAAN 20 | 1598 #define FF_IDCT_FAAN 20 |
| 1592 #define FF_IDCT_EA 21 | 1599 #define FF_IDCT_EA 21 |
| 1593 #define FF_IDCT_SIMPLENEON 22 | 1600 #define FF_IDCT_SIMPLENEON 22 |
| 1594 #define FF_IDCT_SIMPLEALPHA 23 | 1601 #define FF_IDCT_SIMPLEALPHA 23 |
| 1602 #define FF_IDCT_BINK 24 |
| 1595 | 1603 |
| 1596 /** | 1604 /** |
| 1597 * slice count | 1605 * slice count |
| 1598 * - encoding: Set by libavcodec. | 1606 * - encoding: Set by libavcodec. |
| 1599 * - decoding: Set by user (or 0). | 1607 * - decoding: Set by user (or 0). |
| 1600 */ | 1608 */ |
| 1601 int slice_count; | 1609 int slice_count; |
| 1602 /** | 1610 /** |
| 1603 * slice offsets in the frame in bytes | 1611 * slice offsets in the frame in bytes |
| 1604 * - encoding: Set/allocated by libavcodec. | 1612 * - encoding: Set/allocated by libavcodec. |
| (...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3283 * struct can be deallocated by simply calling av_free(). | 3291 * struct can be deallocated by simply calling av_free(). |
| 3284 * | 3292 * |
| 3285 * @return An AVFrame filled with default values or NULL on failure. | 3293 * @return An AVFrame filled with default values or NULL on failure. |
| 3286 * @see avcodec_get_frame_defaults | 3294 * @see avcodec_get_frame_defaults |
| 3287 */ | 3295 */ |
| 3288 AVFrame *avcodec_alloc_frame(void); | 3296 AVFrame *avcodec_alloc_frame(void); |
| 3289 | 3297 |
| 3290 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); | 3298 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); |
| 3291 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); | 3299 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); |
| 3292 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic); | 3300 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic); |
| 3301 /** |
| 3302 * Modifies width and height values so that they will result in a memory |
| 3303 * buffer that is acceptable for the codec if you do not use any horizontal |
| 3304 * padding. |
| 3305 */ |
| 3293 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); | 3306 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); |
| 3307 /** |
| 3308 * Modifies width and height values so that they will result in a memory |
| 3309 * buffer that is acceptable for the codec if you also ensure that all |
| 3310 * line sizes are a multiple of the respective linesize_align[i]. |
| 3311 */ |
| 3312 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, |
| 3313 int linesize_align[4]); |
| 3294 | 3314 |
| 3295 /** | 3315 /** |
| 3296 * Checks if the given dimension of a picture is valid, meaning that all | 3316 * Checks if the given dimension of a picture is valid, meaning that all |
| 3297 * bytes of the picture can be addressed with a signed int. | 3317 * bytes of the picture can be addressed with a signed int. |
| 3298 * | 3318 * |
| 3299 * @param[in] w Width of the picture. | 3319 * @param[in] w Width of the picture. |
| 3300 * @param[in] h Height of the picture. | 3320 * @param[in] h Height of the picture. |
| 3301 * @return Zero if valid, a negative value if invalid. | 3321 * @return Zero if valid, a negative value if invalid. |
| 3302 */ | 3322 */ |
| 3303 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h); | 3323 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3936 * @param cb User defined callback. Note: FFmpeg may invoke calls to this | 3956 * @param cb User defined callback. Note: FFmpeg may invoke calls to this |
| 3937 * callback during the call to av_lockmgr_register(). | 3957 * callback during the call to av_lockmgr_register(). |
| 3938 * Thus, the application must be prepared to handle that. | 3958 * Thus, the application must be prepared to handle that. |
| 3939 * If cb is set to NULL the lockmgr will be unregistered. | 3959 * If cb is set to NULL the lockmgr will be unregistered. |
| 3940 * Also note that during unregistration the previously registered | 3960 * Also note that during unregistration the previously registered |
| 3941 * lockmgr callback may also be invoked. | 3961 * lockmgr callback may also be invoked. |
| 3942 */ | 3962 */ |
| 3943 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); | 3963 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); |
| 3944 | 3964 |
| 3945 #endif /* AVCODEC_AVCODEC_H */ | 3965 #endif /* AVCODEC_AVCODEC_H */ |
| OLD | NEW |