comparison avcodec.h @ 2637:ef44d24680d1 libavcodec

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents eaa57c3336fc
children d1609cfeb1d0
comparison
equal deleted inserted replaced
2636:2344c6713011 2637:ef44d24680d1
15 #include "rational.h" 15 #include "rational.h"
16 #include <sys/types.h> /* size_t */ 16 #include <sys/types.h> /* size_t */
17 17
18 #define FFMPEG_VERSION_INT 0x000409 18 #define FFMPEG_VERSION_INT 0x000409
19 #define FFMPEG_VERSION "0.4.9-pre1" 19 #define FFMPEG_VERSION "0.4.9-pre1"
20 #define LIBAVCODEC_BUILD 4753 20 #define LIBAVCODEC_BUILD 4754
21 21
22 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT 22 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
23 #define LIBAVCODEC_VERSION FFMPEG_VERSION 23 #define LIBAVCODEC_VERSION FFMPEG_VERSION
24 24
25 #define AV_STRINGIFY(s) AV_TOSTRING(s) 25 #define AV_STRINGIFY(s) AV_TOSTRING(s)
26 #define AV_TOSTRING(s) #s 26 #define AV_TOSTRING(s) #s
27 #define LIBAVCODEC_IDENT "FFmpeg" LIBAVCODEC_VERSION "b" AV_STRINGIFY(LIBAVCODEC_BUILD) 27 #define LIBAVCODEC_IDENT "FFmpeg" LIBAVCODEC_VERSION "b" AV_STRINGIFY(LIBAVCODEC_BUILD)
28 28
29 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000) 29 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000)
30 #define AV_TIME_BASE 1000000 30 #define AV_TIME_BASE 1000000
31 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
31 32
32 enum CodecID { 33 enum CodecID {
33 CODEC_ID_NONE, 34 CODEC_ID_NONE,
34 CODEC_ID_MPEG1VIDEO, 35 CODEC_ID_MPEG1VIDEO,
35 CODEC_ID_MPEG2VIDEO, /* prefered ID for MPEG Video 1 or 2 decoding */ 36 CODEC_ID_MPEG2VIDEO, /* prefered ID for MPEG Video 1 or 2 decoding */
440 * - decoding: set by lavc\ 441 * - decoding: set by lavc\
441 */\ 442 */\
442 int pict_type;\ 443 int pict_type;\
443 \ 444 \
444 /**\ 445 /**\
445 * presentation timestamp in AV_TIME_BASE (=micro seconds currently) (time when frame should be shown to user)\ 446 * presentation timestamp in time_base units (time when frame should be shown to user)\
446 * if AV_NOPTS_VALUE then the frame_rate will be used as reference\ 447 * if AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed\
447 * - encoding: MUST be set by user\ 448 * - encoding: MUST be set by user\
448 * - decoding: set by lavc\ 449 * - decoding: set by lavc\
449 */\ 450 */\
450 int64_t pts;\ 451 int64_t pts;\
451 \ 452 \
719 void *extradata; 720 void *extradata;
720 int extradata_size; 721 int extradata_size;
721 722
722 /* video only */ 723 /* video only */
723 /** 724 /**
724 * frames per sec multiplied by frame_rate_base. 725 * time base in which the timestamps are specified.
725 * for variable fps this is the precission, so if the timestamps
726 * can be specified in msec precssion then this is 1000*frame_rate_base
727 * - encoding: MUST be set by user 726 * - encoding: MUST be set by user
728 * - decoding: set by lavc. 0 or the frame_rate if available 727 * - decoding: set by lavc.
729 */ 728 */
730 int frame_rate; 729 AVRational time_base;
731 730
732 /** 731 /**
733 * picture width / height. 732 * picture width / height.
734 * - encoding: MUST be set by user. 733 * - encoding: MUST be set by user.
735 * - decoding: set by lavc. 734 * - decoding: set by lavc.
1418 * - encoding: set by user. 1417 * - encoding: set by user.
1419 * - decoding: unused. 1418 * - decoding: unused.
1420 */ 1419 */
1421 int me_range; 1420 int me_range;
1422 1421
1423 /**
1424 * frame_rate_base.
1425 * for variable fps this is 1
1426 * - encoding: set by user.
1427 * - decoding: set by lavc.
1428 * @todo move this after frame_rate
1429 */
1430
1431 int frame_rate_base;
1432 /** 1422 /**
1433 * intra quantizer bias. 1423 * intra quantizer bias.
1434 * - encoding: set by user. 1424 * - encoding: set by user.
1435 * - decoding: unused 1425 * - decoding: unused
1436 */ 1426 */
2242 * rescale a 64bit integer with specified rounding. 2232 * rescale a 64bit integer with specified rounding.
2243 * a simple a*b/c isnt possible as it can overflow 2233 * a simple a*b/c isnt possible as it can overflow
2244 */ 2234 */
2245 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding); 2235 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
2246 2236
2237 /**
2238 * rescale a 64bit integer by 2 rational numbers.
2239 */
2240 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
2241
2247 /* frame parsing */ 2242 /* frame parsing */
2248 typedef struct AVCodecParserContext { 2243 typedef struct AVCodecParserContext {
2249 void *priv_data; 2244 void *priv_data;
2250 struct AVCodecParser *parser; 2245 struct AVCodecParser *parser;
2251 int64_t frame_offset; /* offset of the current frame */ 2246 int64_t frame_offset; /* offset of the current frame */