Mercurial > libavcodec.hg
comparison avcodec.h @ 909:8ae1e4c24e91 libavcodec
new PSNR code (now works with chroma, b frames, ...)
rename *_TYPE to FF_*_TYPE for the external API
allow user specified pict_type
| author | michaelni |
|---|---|
| date | Wed, 04 Dec 2002 21:13:02 +0000 |
| parents | bbe0c99231a7 |
| children | 22cec68e6f01 |
comparison
equal
deleted
inserted
replaced
| 908:2ac4caad5ca6 | 909:8ae1e4c24e91 |
|---|---|
| 3 | 3 |
| 4 #include "common.h" | 4 #include "common.h" |
| 5 | 5 |
| 6 #define LIBAVCODEC_VERSION_INT 0x000406 | 6 #define LIBAVCODEC_VERSION_INT 0x000406 |
| 7 #define LIBAVCODEC_VERSION "0.4.6" | 7 #define LIBAVCODEC_VERSION "0.4.6" |
| 8 #define LIBAVCODEC_BUILD 4642 | 8 #define LIBAVCODEC_BUILD 4643 |
| 9 #define LIBAVCODEC_BUILD_STR "4642" | 9 #define LIBAVCODEC_BUILD_STR "4643" |
| 10 | 10 |
| 11 enum CodecID { | 11 enum CodecID { |
| 12 CODEC_ID_NONE, | 12 CODEC_ID_NONE, |
| 13 CODEC_ID_MPEG1VIDEO, | 13 CODEC_ID_MPEG1VIDEO, |
| 14 CODEC_ID_H263, | 14 CODEC_ID_H263, |
| 138 #define CODEC_FLAG_PASS1 0x0200 /* use internal 2pass ratecontrol in first pass mode */ | 138 #define CODEC_FLAG_PASS1 0x0200 /* use internal 2pass ratecontrol in first pass mode */ |
| 139 #define CODEC_FLAG_PASS2 0x0400 /* use internal 2pass ratecontrol in second pass mode */ | 139 #define CODEC_FLAG_PASS2 0x0400 /* use internal 2pass ratecontrol in second pass mode */ |
| 140 #define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */ | 140 #define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */ |
| 141 #define CODEC_FLAG_GRAY 0x2000 /* only decode/encode grayscale */ | 141 #define CODEC_FLAG_GRAY 0x2000 /* only decode/encode grayscale */ |
| 142 #define CODEC_FLAG_EMU_EDGE 0x4000/* dont draw edges */ | 142 #define CODEC_FLAG_EMU_EDGE 0x4000/* dont draw edges */ |
| 143 #define CODEC_FLAG_PSNR 0x8000 /* error[?] variables will be set during encoding */ | |
| 143 #define CODEC_FLAG_TRUNCATED 0x00010000 /* input bitstream might be truncated at a random location instead | 144 #define CODEC_FLAG_TRUNCATED 0x00010000 /* input bitstream might be truncated at a random location instead |
| 144 of only at frame boundaries */ | 145 of only at frame boundaries */ |
| 145 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 /* normalize adaptive quantization */ | 146 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 /* normalize adaptive quantization */ |
| 146 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 /* use interlaced dct */ | 147 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 /* use interlaced dct */ |
| 147 #define CODEC_FLAG_LOW_DELAY 0x00080000 /* force low delay / will fail on b frames */ | 148 #define CODEC_FLAG_LOW_DELAY 0x00080000 /* force low delay / will fail on b frames */ |
| 250 * for some private data of the user\ | 251 * for some private data of the user\ |
| 251 * encoding: unused\ | 252 * encoding: unused\ |
| 252 * decoding: set by user\ | 253 * decoding: set by user\ |
| 253 */\ | 254 */\ |
| 254 void *opaque;\ | 255 void *opaque;\ |
| 255 | 256 \ |
| 256 /* FIXME: these should have FF_ */ | 257 /**\ |
| 257 #define I_TYPE 1 // Intra | 258 * error\ |
| 258 #define P_TYPE 2 // Predicted | 259 * encoding: set by lavc if flags&CODEC_FLAG_PSNR\ |
| 259 #define B_TYPE 3 // Bi-dir predicted | 260 * decoding: unused\ |
| 260 #define S_TYPE 4 // S(GMC)-VOP MPEG4 | 261 */\ |
| 262 uint64_t error[4];\ | |
| 263 | |
| 264 #define FF_I_TYPE 1 // Intra | |
| 265 #define FF_P_TYPE 2 // Predicted | |
| 266 #define FF_B_TYPE 3 // Bi-dir predicted | |
| 267 #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4 | |
| 261 | 268 |
| 262 typedef struct AVVideoFrame { | 269 typedef struct AVVideoFrame { |
| 263 FF_COMMON_PICTURE | 270 FF_COMMON_PICTURE |
| 264 } AVVideoFrame; | 271 } AVVideoFrame; |
| 265 | 272 |
| 462 /* every time the encoder as a packet to send */ | 469 /* every time the encoder as a packet to send */ |
| 463 /* Depends on the encoder if the data starts */ | 470 /* Depends on the encoder if the data starts */ |
| 464 /* with a Start Code (it should) H.263 does */ | 471 /* with a Start Code (it should) H.263 does */ |
| 465 void (*rtp_callback)(void *data, int size, int packet_number); | 472 void (*rtp_callback)(void *data, int size, int packet_number); |
| 466 | 473 |
| 467 /** | |
| 468 * if you set get_psnr to 1 then after encoding you will have the | |
| 469 * PSNR on psnr_y/cb/cr | |
| 470 * encoding: set by user (1-> on, 0-> off) | |
| 471 * decoding: unused | |
| 472 */ | |
| 473 int get_psnr; | |
| 474 float psnr_y; | |
| 475 float psnr_cb; | |
| 476 float psnr_cr; | |
| 477 | |
| 478 /* statistics, used for 2-pass encoding */ | 474 /* statistics, used for 2-pass encoding */ |
| 479 int mv_bits; | 475 int mv_bits; |
| 480 int header_bits; | 476 int header_bits; |
| 481 int i_tex_bits; | 477 int i_tex_bits; |
| 482 int p_tex_bits; | 478 int p_tex_bits; |
| 824 #define FF_DEBUG_BITSTREAM 4 | 820 #define FF_DEBUG_BITSTREAM 4 |
| 825 #define FF_DEBUG_MB_TYPE 8 | 821 #define FF_DEBUG_MB_TYPE 8 |
| 826 #define FF_DEBUG_QP 16 | 822 #define FF_DEBUG_QP 16 |
| 827 #define FF_DEBUG_MV 32 | 823 #define FF_DEBUG_MV 32 |
| 828 #define FF_DEBUG_VIS_MV 64 | 824 #define FF_DEBUG_VIS_MV 64 |
| 825 | |
| 826 /** | |
| 827 * error | |
| 828 * encoding: set by lavc if flags&CODEC_FLAG_PSNR | |
| 829 * decoding: unused | |
| 830 */ | |
| 831 uint64_t error[4]; | |
| 829 } AVCodecContext; | 832 } AVCodecContext; |
| 830 | 833 |
| 831 typedef struct AVCodec { | 834 typedef struct AVCodec { |
| 832 const char *name; | 835 const char *name; |
| 833 int type; | 836 int type; |
