Mercurial > libavcodec.hg
comparison avcodec.h @ 1112:54be6aece1be libavcodec
more cosmetics so that doxygen output is readable ...
| author | michaelni |
|---|---|
| date | Thu, 06 Mar 2003 15:56:56 +0000 |
| parents | b773f9d23236 |
| children | bbcb4fda2b86 |
comparison
equal
deleted
inserted
replaced
| 1111:54dc72414a69 | 1112:54be6aece1be |
|---|---|
| 68 CODEC_TYPE_UNKNOWN = -1, | 68 CODEC_TYPE_UNKNOWN = -1, |
| 69 CODEC_TYPE_VIDEO, | 69 CODEC_TYPE_VIDEO, |
| 70 CODEC_TYPE_AUDIO, | 70 CODEC_TYPE_AUDIO, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 /** | |
| 74 * Pixel format. | |
| 75 */ | |
| 73 enum PixelFormat { | 76 enum PixelFormat { |
| 74 PIX_FMT_YUV420P, | 77 PIX_FMT_YUV420P, |
| 75 PIX_FMT_YUV422, | 78 PIX_FMT_YUV422, |
| 76 PIX_FMT_RGB24, /* 3 bytes, R is first */ | 79 PIX_FMT_RGB24, ///< 3 bytes, R is first |
| 77 PIX_FMT_BGR24, /* 3 bytes, B is first */ | 80 PIX_FMT_BGR24, ///< 3 bytes, B is first |
| 78 PIX_FMT_YUV422P, | 81 PIX_FMT_YUV422P, |
| 79 PIX_FMT_YUV444P, | 82 PIX_FMT_YUV444P, |
| 80 PIX_FMT_RGBA32, /* always stored in cpu endianness */ | 83 PIX_FMT_RGBA32, ///< always stored in cpu endianness |
| 81 PIX_FMT_YUV410P, | 84 PIX_FMT_YUV410P, |
| 82 PIX_FMT_YUV411P, | 85 PIX_FMT_YUV411P, |
| 83 PIX_FMT_RGB565, /* always stored in cpu endianness */ | 86 PIX_FMT_RGB565, ///< always stored in cpu endianness |
| 84 PIX_FMT_RGB555, /* always stored in cpu endianness, most significant bit to 1 */ | 87 PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1 |
| 85 PIX_FMT_GRAY8, | 88 PIX_FMT_GRAY8, |
| 86 PIX_FMT_MONOWHITE, /* 0 is white */ | 89 PIX_FMT_MONOWHITE, ///< 0 is white |
| 87 PIX_FMT_MONOBLACK, /* 0 is black */ | 90 PIX_FMT_MONOBLACK, ///< 0 is black |
| 88 PIX_FMT_PAL8, /* 8 bit with RGBA palette */ | 91 PIX_FMT_PAL8, ///< 8 bit with RGBA palette |
| 89 PIX_FMT_NB, | 92 PIX_FMT_NB, |
| 90 }; | 93 }; |
| 91 | 94 |
| 92 /* currently unused, may be used if 24/32 bits samples ever supported */ | 95 /* currently unused, may be used if 24/32 bits samples ever supported */ |
| 93 enum SampleFormat { | 96 enum SampleFormat { |
| 94 SAMPLE_FMT_S16 = 0, /* signed 16 bits */ | 97 SAMPLE_FMT_S16 = 0, ///< signed 16 bits |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 /* in bytes */ | 100 /* in bytes */ |
| 98 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 131072 | 101 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 131072 |
| 99 | 102 |
| 133 /* encoding support | 136 /* encoding support |
| 134 these flags can be passed in AVCodecContext.flags before initing | 137 these flags can be passed in AVCodecContext.flags before initing |
| 135 Note: note not everything is supported yet | 138 Note: note not everything is supported yet |
| 136 */ | 139 */ |
| 137 | 140 |
| 138 #define CODEC_FLAG_HQ 0x0001 /* brute force MB-type decission mode (slow) */ | 141 #define CODEC_FLAG_HQ 0x0001 ///< brute force MB-type decission mode (slow) |
| 139 #define CODEC_FLAG_QSCALE 0x0002 /* use fixed qscale */ | 142 #define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale |
| 140 #define CODEC_FLAG_4MV 0x0004 /* 4 MV per MB allowed */ | 143 #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed |
| 141 #define CODEC_FLAG_QPEL 0x0010 /* use qpel MC */ | 144 #define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC |
| 142 #define CODEC_FLAG_GMC 0x0020 /* use GMC */ | 145 #define CODEC_FLAG_GMC 0x0020 ///< use GMC |
| 143 #define CODEC_FLAG_PART 0x0080 /* use data partitioning */ | 146 #define CODEC_FLAG_PART 0x0080 ///< use data partitioning |
| 144 /* parent program gurantees that the input for b-frame containing streams is not written to | 147 /* parent program gurantees that the input for b-frame containing streams is not written to |
| 145 for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */ | 148 for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */ |
| 146 #define CODEC_FLAG_INPUT_PRESERVED 0x0100 | 149 #define CODEC_FLAG_INPUT_PRESERVED 0x0100 |
| 147 #define CODEC_FLAG_PASS1 0x0200 /* use internal 2pass ratecontrol in first pass mode */ | 150 #define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode |
| 148 #define CODEC_FLAG_PASS2 0x0400 /* use internal 2pass ratecontrol in second pass mode */ | 151 #define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode |
| 149 #define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */ | 152 #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg) |
| 150 #define CODEC_FLAG_GRAY 0x2000 /* only decode/encode grayscale */ | 153 #define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale |
| 151 #define CODEC_FLAG_EMU_EDGE 0x4000/* dont draw edges */ | 154 #define CODEC_FLAG_EMU_EDGE 0x4000///< dont draw edges |
| 152 #define CODEC_FLAG_PSNR 0x8000 /* error[?] variables will be set during encoding */ | 155 #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding |
| 153 #define CODEC_FLAG_TRUNCATED 0x00010000 /* input bitstream might be truncated at a random location instead | 156 #define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead |
| 154 of only at frame boundaries */ | 157 of only at frame boundaries */ |
| 155 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 /* normalize adaptive quantization */ | 158 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization |
| 156 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 /* use interlaced dct */ | 159 #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct |
| 157 #define CODEC_FLAG_LOW_DELAY 0x00080000 /* force low delay / will fail on b frames */ | 160 #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< force low delay / will fail on b frames |
| 158 #define CODEC_FLAG_ALT_SCAN 0x00100000 /* use alternate scan */ | 161 #define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan |
| 159 #define CODEC_FLAG_TRELLIS_QUANT 0x00200000 /* use trellis quantization */ | 162 #define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization |
| 160 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 /* place global headers in extradata instead of every keyframe */ | 163 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe |
| 161 #define CODEC_FLAG_BITEXACT 0x00800000 /* use only bitexact stuff (except (i)dct) */ | 164 #define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct) |
| 162 /* Fx : Flag for h263+ extra options */ | 165 /* Fx : Flag for h263+ extra options */ |
| 163 #define CODEC_FLAG_H263P_AIC 0x01000000 /* Advanced intra coding */ | 166 #define CODEC_FLAG_H263P_AIC 0x01000000 ///< Advanced intra coding |
| 164 #define CODEC_FLAG_H263P_UMV 0x02000000 /* Unlimited motion vector */ | 167 #define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector |
| 165 /* For advanced prediction mode, we reuse the 4MV flag */ | 168 /* For advanced prediction mode, we reuse the 4MV flag */ |
| 166 /* Unsupported options : | 169 /* Unsupported options : |
| 167 * Syntax Arithmetic coding (SAC) | 170 * Syntax Arithmetic coding (SAC) |
| 168 * Deblocking filter internal loop | 171 * Deblocking filter internal loop |
| 169 * Slice structured | 172 * Slice structured |
| 172 * Alternative Inter * VLC | 175 * Alternative Inter * VLC |
| 173 * Modified Quantization */ | 176 * Modified Quantization */ |
| 174 /* /Fx */ | 177 /* /Fx */ |
| 175 /* codec capabilities */ | 178 /* codec capabilities */ |
| 176 | 179 |
| 177 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 /* decoder can use draw_horiz_band callback */ | 180 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback |
| 178 #define CODEC_CAP_DR1 0x0002 /* direct rendering method 1 */ | 181 #define CODEC_CAP_DR1 0x0002 ///< direct rendering method 1 |
| 179 /* if 'parse_only' field is true, then avcodec_parse_frame() can be | 182 /* if 'parse_only' field is true, then avcodec_parse_frame() can be |
| 180 used */ | 183 used */ |
| 181 #define CODEC_CAP_PARSE_ONLY 0x0004 | 184 #define CODEC_CAP_PARSE_ONLY 0x0004 |
| 182 #define CODEC_CAP_TRUNCATED 0x0008 | 185 #define CODEC_CAP_TRUNCATED 0x0008 |
| 183 | 186 |
| 187 uint8_t *data[4];\ | 190 uint8_t *data[4];\ |
| 188 int linesize[4];\ | 191 int linesize[4];\ |
| 189 /**\ | 192 /**\ |
| 190 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\ | 193 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\ |
| 191 * this isnt used by lavc unless the default get/release_buffer() is used\ | 194 * this isnt used by lavc unless the default get/release_buffer() is used\ |
| 192 * encoding: \ | 195 * - encoding: \ |
| 193 * decoding: \ | 196 * - decoding: \ |
| 194 */\ | 197 */\ |
| 195 uint8_t *base[4];\ | 198 uint8_t *base[4];\ |
| 196 /**\ | 199 /**\ |
| 197 * 1 -> keyframe, 0-> not\ | 200 * 1 -> keyframe, 0-> not\ |
| 198 * encoding: set by lavc\ | 201 * - encoding: set by lavc\ |
| 199 * decoding: set by lavc\ | 202 * - decoding: set by lavc\ |
| 200 */\ | 203 */\ |
| 201 int key_frame;\ | 204 int key_frame;\ |
| 202 \ | 205 \ |
| 203 /**\ | 206 /**\ |
| 204 * picture type of the frame, see ?_TYPE below\ | 207 * picture type of the frame, see ?_TYPE below\ |
| 205 * encoding: set by lavc for coded_picture (and set by user for input)\ | 208 * - encoding: set by lavc for coded_picture (and set by user for input)\ |
| 206 * decoding: set by lavc\ | 209 * - decoding: set by lavc\ |
| 207 */\ | 210 */\ |
| 208 int pict_type;\ | 211 int pict_type;\ |
| 209 \ | 212 \ |
| 210 /**\ | 213 /**\ |
| 211 * presentation timestamp in micro seconds (time when frame should be shown to user)\ | 214 * presentation timestamp in micro seconds (time when frame should be shown to user)\ |
| 212 * if 0 then the frame_rate will be used as reference\ | 215 * if 0 then the frame_rate will be used as reference\ |
| 213 * encoding: MUST be set by user\ | 216 * - encoding: MUST be set by user\ |
| 214 * decoding: set by lavc\ | 217 * - decoding: set by lavc\ |
| 215 */\ | 218 */\ |
| 216 long long int pts;\ | 219 long long int pts;\ |
| 217 \ | 220 \ |
| 218 /**\ | 221 /**\ |
| 219 * picture number in bitstream order.\ | 222 * picture number in bitstream order.\ |
| 220 * encoding: set by\ | 223 * - encoding: set by\ |
| 221 * decoding: set by lavc\ | 224 * - decoding: set by lavc\ |
| 222 */\ | 225 */\ |
| 223 int coded_picture_number;\ | 226 int coded_picture_number;\ |
| 224 /**\ | 227 /**\ |
| 225 * encoding: set by\ | |
| 226 * decoding: set by lavc\ | |
| 227 * picture number in display order.\ | 228 * picture number in display order.\ |
| 229 * - encoding: set by\ | |
| 230 * - decoding: set by lavc\ | |
| 228 */\ | 231 */\ |
| 229 int display_picture_number;\ | 232 int display_picture_number;\ |
| 230 \ | 233 \ |
| 231 /**\ | 234 /**\ |
| 232 * quality (between 1 (good) and 31 (bad)) \ | 235 * quality (between 1 (good) and 31 (bad)) \ |
| 233 * encoding: set by lavc for coded_picture (and set by user for input)\ | 236 * - encoding: set by lavc for coded_picture (and set by user for input)\ |
| 234 * decoding: set by lavc\ | 237 * - decoding: set by lavc\ |
| 235 */\ | 238 */\ |
| 236 float quality; \ | 239 float quality; \ |
| 237 \ | 240 \ |
| 238 /**\ | 241 /**\ |
| 239 * buffer age (1->was last buffer and dint change, 2->..., ...).\ | 242 * buffer age (1->was last buffer and dint change, 2->..., ...).\ |
| 240 * set to something large if the buffer has not been used yet \ | 243 * set to something large if the buffer has not been used yet \ |
| 241 * encoding: unused\ | 244 * - encoding: unused\ |
| 242 * decoding: MUST be set by get_buffer()\ | 245 * - decoding: MUST be set by get_buffer()\ |
| 243 */\ | 246 */\ |
| 244 int age;\ | 247 int age;\ |
| 245 \ | 248 \ |
| 246 /**\ | 249 /**\ |
| 247 * is this picture used as reference\ | 250 * is this picture used as reference\ |
| 248 * encoding: unused\ | 251 * - encoding: unused\ |
| 249 * decoding: set by lavc (before get_buffer() call))\ | 252 * - decoding: set by lavc (before get_buffer() call))\ |
| 250 */\ | 253 */\ |
| 251 int reference;\ | 254 int reference;\ |
| 252 \ | 255 \ |
| 253 /**\ | 256 /**\ |
| 254 * QP table\ | 257 * QP table\ |
| 255 * encoding: unused\ | 258 * - encoding: unused\ |
| 256 * decoding: set by lavc\ | 259 * - decoding: set by lavc\ |
| 257 */\ | 260 */\ |
| 258 int8_t *qscale_table;\ | 261 int8_t *qscale_table;\ |
| 259 /**\ | 262 /**\ |
| 260 * QP store stride\ | 263 * QP store stride\ |
| 261 * encoding: unused\ | 264 * - encoding: unused\ |
| 262 * decoding: set by lavc\ | 265 * - decoding: set by lavc\ |
| 263 */\ | 266 */\ |
| 264 int qstride;\ | 267 int qstride;\ |
| 265 \ | 268 \ |
| 266 /**\ | 269 /**\ |
| 267 * mbskip_table[mb]>=1 if MB didnt change\ | 270 * mbskip_table[mb]>=1 if MB didnt change\ |
| 268 * stride= mb_width = (width+15)>>4\ | 271 * stride= mb_width = (width+15)>>4\ |
| 269 * encoding: unused\ | 272 * - encoding: unused\ |
| 270 * decoding: set by lavc\ | 273 * - decoding: set by lavc\ |
| 271 */\ | 274 */\ |
| 272 uint8_t *mbskip_table;\ | 275 uint8_t *mbskip_table;\ |
| 273 \ | 276 \ |
| 274 /**\ | 277 /**\ |
| 275 * for some private data of the user\ | 278 * for some private data of the user\ |
| 276 * encoding: unused\ | 279 * - encoding: unused\ |
| 277 * decoding: set by user\ | 280 * - decoding: set by user\ |
| 278 */\ | 281 */\ |
| 279 void *opaque;\ | 282 void *opaque;\ |
| 280 \ | 283 \ |
| 281 /**\ | 284 /**\ |
| 282 * error\ | 285 * error\ |
| 283 * encoding: set by lavc if flags&CODEC_FLAG_PSNR\ | 286 * - encoding: set by lavc if flags&CODEC_FLAG_PSNR\ |
| 284 * decoding: unused\ | 287 * - decoding: unused\ |
| 285 */\ | 288 */\ |
| 286 uint64_t error[4];\ | 289 uint64_t error[4];\ |
| 287 \ | 290 \ |
| 288 /**\ | 291 /**\ |
| 289 * type of the buffer (to keep track of who has to dealloc data[*])\ | 292 * type of the buffer (to keep track of who has to dealloc data[*])\ |
| 290 * encoding: set by the one who allocs it\ | 293 * - encoding: set by the one who allocs it\ |
| 291 * decoding: set by the one who allocs it\ | 294 * - decoding: set by the one who allocs it\ |
| 292 * Note: user allocated (direct rendering) & internal buffers can not coexist currently\ | 295 * Note: user allocated (direct rendering) & internal buffers can not coexist currently\ |
| 293 */\ | 296 */\ |
| 294 int type;\ | 297 int type;\ |
| 295 \ | 298 \ |
| 296 /**\ | 299 /**\ |
| 297 * when decoding, this signal how much the picture must be delayed.\ | 300 * when decoding, this signal how much the picture must be delayed.\ |
| 298 * extra_delay = repeat_pict / (2*fps)\ | 301 * extra_delay = repeat_pict / (2*fps)\ |
| 299 * encoding: unused\ | 302 * - encoding: unused\ |
| 300 * decoding: set by lavc\ | 303 * - decoding: set by lavc\ |
| 301 */\ | 304 */\ |
| 302 int repeat_pict; | 305 int repeat_pict; |
| 303 | 306 |
| 304 | 307 |
| 305 #define FF_BUFFER_TYPE_INTERNAL 1 | 308 #define FF_BUFFER_TYPE_INTERNAL 1 |
| 320 /** | 323 /** |
| 321 * main external api structure. | 324 * main external api structure. |
| 322 */ | 325 */ |
| 323 typedef struct AVCodecContext { | 326 typedef struct AVCodecContext { |
| 324 /** | 327 /** |
| 325 * the average bitrate | 328 * the average bitrate. |
| 326 * encoding: set by user. unused for constant quantizer encoding | 329 * - encoding: set by user. unused for constant quantizer encoding |
| 327 * decoding: set by lavc. 0 or some bitrate if this info is available in the stream | 330 * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream |
| 328 */ | 331 */ |
| 329 int bit_rate; | 332 int bit_rate; |
| 330 | 333 |
| 331 /** | 334 /** |
| 332 * number of bits the bitstream is allowed to diverge from the reference | 335 * number of bits the bitstream is allowed to diverge from the reference. |
| 333 * the reference can be CBR (for CBR pass1) or VBR (for pass2) | 336 * the reference can be CBR (for CBR pass1) or VBR (for pass2) |
| 334 * encoding: set by user. unused for constant quantizer encoding | 337 * - encoding: set by user. unused for constant quantizer encoding |
| 335 * decoding: unused | 338 * - decoding: unused |
| 336 */ | 339 */ |
| 337 int bit_rate_tolerance; | 340 int bit_rate_tolerance; |
| 338 | 341 |
| 339 /** | 342 /** |
| 340 * CODEC_FLAG_* | 343 * CODEC_FLAG_*. |
| 341 * encoding: set by user. | 344 * - encoding: set by user. |
| 342 * decoding: set by user. | 345 * - decoding: set by user. |
| 343 */ | 346 */ |
| 344 int flags; | 347 int flags; |
| 345 | 348 |
| 346 /** | 349 /** |
| 347 * some codecs needs additionnal format info. It is stored here | 350 * some codecs needs additionnal format info. It is stored here |
| 348 * encoding: set by user. | 351 * - encoding: set by user. |
| 349 * decoding: set by lavc. (FIXME is this ok?) | 352 * - decoding: set by lavc. (FIXME is this ok?) |
| 350 */ | 353 */ |
| 351 int sub_id; | 354 int sub_id; |
| 352 | 355 |
| 353 /** | 356 /** |
| 354 * motion estimation algorithm used for video coding | 357 * motion estimation algorithm used for video coding. |
| 355 * encoding: MUST be set by user. | 358 * - encoding: MUST be set by user. |
| 356 * decoding: unused | 359 * - decoding: unused |
| 357 */ | 360 */ |
| 358 int me_method; | 361 int me_method; |
| 359 | 362 |
| 360 /** | 363 /** |
| 361 * some codecs need / can use extra-data like huffman tables | 364 * some codecs need / can use extra-data like huffman tables. |
| 362 * mjpeg: huffman tables | 365 * mjpeg: huffman tables |
| 363 * rv10: additional flags | 366 * rv10: additional flags |
| 364 * mpeg4: global headers (they can be in the bitstream or here) | 367 * mpeg4: global headers (they can be in the bitstream or here) |
| 365 * encoding: set/allocated/freed by lavc. | 368 * - encoding: set/allocated/freed by lavc. |
| 366 * decoding: set/allocated/freed by user. | 369 * - decoding: set/allocated/freed by user. |
| 367 */ | 370 */ |
| 368 void *extradata; | 371 void *extradata; |
| 369 int extradata_size; | 372 int extradata_size; |
| 370 | 373 |
| 371 /* video only */ | 374 /* video only */ |
| 372 /** | 375 /** |
| 373 * frames per sec multiplied by FRAME_RATE_BASE | 376 * frames per sec multiplied by FRAME_RATE_BASE. |
| 374 * for variable fps this is the precission, so if the timestamps | 377 * for variable fps this is the precission, so if the timestamps |
| 375 * can be specified in msec precssion then this is 1000*FRAME_RATE_BASE | 378 * can be specified in msec precssion then this is 1000*FRAME_RATE_BASE |
| 376 * encoding: MUST be set by user | 379 * - encoding: MUST be set by user |
| 377 * decoding: set by lavc. 0 or the frame_rate if available | 380 * - decoding: set by lavc. 0 or the frame_rate if available |
| 378 */ | 381 */ |
| 379 int frame_rate; | 382 int frame_rate; |
| 380 | 383 |
| 381 /** | 384 /** |
| 382 * encoding: MUST be set by user. | 385 * width / height. |
| 383 * decoding: set by user, some codecs might override / change it during playback | 386 * - encoding: MUST be set by user. |
| 387 * - decoding: set by user, some codecs might override / change it during playback | |
| 384 */ | 388 */ |
| 385 int width, height; | 389 int width, height; |
| 386 | 390 |
| 387 #define FF_ASPECT_SQUARE 1 | 391 #define FF_ASPECT_SQUARE 1 |
| 388 #define FF_ASPECT_4_3_625 2 | 392 #define FF_ASPECT_4_3_625 2 |
| 390 #define FF_ASPECT_16_9_625 4 | 394 #define FF_ASPECT_16_9_625 4 |
| 391 #define FF_ASPECT_16_9_525 5 | 395 #define FF_ASPECT_16_9_525 5 |
| 392 #define FF_ASPECT_EXTENDED 15 | 396 #define FF_ASPECT_EXTENDED 15 |
| 393 | 397 |
| 394 /** | 398 /** |
| 395 * the number of pictures in a group of pitures, or 0 for intra_only | 399 * the number of pictures in a group of pitures, or 0 for intra_only. |
| 396 * encoding: set by user. | 400 * - encoding: set by user. |
| 397 * decoding: unused | 401 * - decoding: unused |
| 398 */ | 402 */ |
| 399 int gop_size; | 403 int gop_size; |
| 400 | 404 |
| 401 /** | 405 /** |
| 402 * pixel format, see PIX_FMT_xxx | 406 * pixel format, see PIX_FMT_xxx. |
| 403 * encoding: unused | 407 * - encoding: unused |
| 404 * decoding: set by lavc. | 408 * - decoding: set by lavc. |
| 405 */ | 409 */ |
| 406 enum PixelFormat pix_fmt; | 410 enum PixelFormat pix_fmt; |
| 407 | 411 |
| 408 /** | 412 /** |
| 409 * if non NULL, 'draw_horiz_band' is called by the libavcodec | 413 * if non NULL, 'draw_horiz_band' is called by the libavcodec |
| 410 * decoder to draw an horizontal band. It improve cache usage. Not | 414 * decoder to draw an horizontal band. It improve cache usage. Not |
| 411 * all codecs can do that. You must check the codec capabilities | 415 * all codecs can do that. You must check the codec capabilities |
| 412 * before | 416 * before |
| 413 * encoding: unused | 417 * - encoding: unused |
| 414 * decoding: set by user. | 418 * - decoding: set by user. |
| 415 */ | 419 */ |
| 416 void (*draw_horiz_band)(struct AVCodecContext *s, | 420 void (*draw_horiz_band)(struct AVCodecContext *s, |
| 417 uint8_t **src_ptr, int linesize, | 421 uint8_t **src_ptr, int linesize, |
| 418 int y, int width, int height); | 422 int y, int width, int height); |
| 419 | 423 |
| 420 /* audio only */ | 424 /* audio only */ |
| 421 int sample_rate; /* samples per sec */ | 425 int sample_rate; ///< samples per sec |
| 422 int channels; | 426 int channels; |
| 423 int sample_fmt; /* sample format, currenly unused */ | 427 int sample_fmt; ///< sample format, currenly unused |
| 424 | 428 |
| 425 /* the following data should not be initialized */ | 429 /* the following data should not be initialized */ |
| 426 int frame_size; /* in samples, initialized when calling 'init' */ | 430 int frame_size; ///< in samples, initialized when calling 'init' |
| 427 int frame_number; /* audio or video frame number */ | 431 int frame_number; ///< audio or video frame number |
| 428 int real_pict_num; /* returns the real picture number of | 432 int real_pict_num; ///< returns the real picture number of previous encoded frame |
| 429 previous encoded frame */ | |
| 430 | 433 |
| 431 /** | 434 /** |
| 432 * number of frames the decoded output will be delayed relative to | 435 * number of frames the decoded output will be delayed relative to |
| 433 * the encoded input | 436 * the encoded input. |
| 434 * encoding: set by lavc. | 437 * - encoding: set by lavc. |
| 435 * decoding: unused | 438 * - decoding: unused |
| 436 */ | 439 */ |
| 437 int delay; | 440 int delay; |
| 438 | 441 |
| 439 /* encoding parameters */ | 442 /* - encoding parameters */ |
| 440 float qcompress; /* amount of qscale change between easy & hard scenes (0.0-1.0)*/ | 443 float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) |
| 441 float qblur; /* amount of qscale smoothing over time (0.0-1.0) */ | 444 float qblur; ///< amount of qscale smoothing over time (0.0-1.0) |
| 442 | 445 |
| 443 /** | 446 /** |
| 444 * minimum quantizer | 447 * minimum quantizer. |
| 445 * encoding: set by user. | 448 * - encoding: set by user. |
| 446 * decoding: unused | 449 * - decoding: unused |
| 447 */ | 450 */ |
| 448 int qmin; | 451 int qmin; |
| 449 | 452 |
| 450 /** | 453 /** |
| 451 * maximum quantizer | 454 * maximum quantizer. |
| 452 * encoding: set by user. | 455 * - encoding: set by user. |
| 453 * decoding: unused | 456 * - decoding: unused |
| 454 */ | 457 */ |
| 455 int qmax; | 458 int qmax; |
| 456 | 459 |
| 457 /** | 460 /** |
| 458 * maximum quantizer difference etween frames | 461 * maximum quantizer difference etween frames. |
| 459 * encoding: set by user. | 462 * - encoding: set by user. |
| 460 * decoding: unused | 463 * - decoding: unused |
| 461 */ | 464 */ |
| 462 int max_qdiff; | 465 int max_qdiff; |
| 463 | 466 |
| 464 /** | 467 /** |
| 465 * maximum number of b frames between non b frames | 468 * maximum number of b frames between non b frames. |
| 466 * note: the output will be delayed by max_b_frames+1 relative to the input | 469 * note: the output will be delayed by max_b_frames+1 relative to the input |
| 467 * encoding: set by user. | 470 * - encoding: set by user. |
| 468 * decoding: unused | 471 * - decoding: unused |
| 469 */ | 472 */ |
| 470 int max_b_frames; | 473 int max_b_frames; |
| 471 | 474 |
| 472 /** | 475 /** |
| 473 * qscale factor between ip and b frames | 476 * qscale factor between ip and b frames. |
| 474 * encoding: set by user. | 477 * - encoding: set by user. |
| 475 * decoding: unused | 478 * - decoding: unused |
| 476 */ | 479 */ |
| 477 float b_quant_factor; | 480 float b_quant_factor; |
| 478 | 481 |
| 479 /** obsolete FIXME remove */ | 482 /** obsolete FIXME remove */ |
| 480 int rc_strategy; | 483 int rc_strategy; |
| 481 int b_frame_strategy; | 484 int b_frame_strategy; |
| 482 | 485 |
| 483 /** | 486 /** |
| 484 * encoding: unused | 487 * hurry up amount. |
| 485 * decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header | 488 * - encoding: unused |
| 489 * - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header | |
| 486 */ | 490 */ |
| 487 int hurry_up; | 491 int hurry_up; |
| 488 | 492 |
| 489 struct AVCodec *codec; | 493 struct AVCodec *codec; |
| 490 | 494 |
| 519 int p_count; | 523 int p_count; |
| 520 int skip_count; | 524 int skip_count; |
| 521 int misc_bits; | 525 int misc_bits; |
| 522 | 526 |
| 523 /** | 527 /** |
| 524 * number of bits used for the previously encoded frame | 528 * number of bits used for the previously encoded frame. |
| 525 * encoding: set by lavc | 529 * - encoding: set by lavc |
| 526 * decoding: - for audio - bits_per_sample | 530 * - decoding: - for audio - bits_per_sample |
| 527 */ | 531 */ |
| 528 int frame_bits; | 532 int frame_bits; |
| 529 | 533 |
| 530 /** | 534 /** |
| 531 * private data of the user, can be used to carry app specific stuff | 535 * private data of the user, can be used to carry app specific stuff. |
| 532 * encoding: set by user | 536 * - encoding: set by user |
| 533 * decoding: set by user | 537 * - decoding: set by user |
| 534 */ | 538 */ |
| 535 void *opaque; | 539 void *opaque; |
| 536 | 540 |
| 537 char codec_name[32]; | 541 char codec_name[32]; |
| 538 enum CodecType codec_type; /* see CODEC_TYPE_xxx */ | 542 enum CodecType codec_type; /* see CODEC_TYPE_xxx */ |
| 539 enum CodecID codec_id; /* see CODEC_ID_xxx */ | 543 enum CodecID codec_id; /* see CODEC_ID_xxx */ |
| 540 unsigned int codec_tag; /* codec tag, only used if unknown codec */ | 544 unsigned int codec_tag; ///< codec tag, only used if unknown codec |
| 541 | 545 |
| 542 /** | 546 /** |
| 543 * workaround bugs in encoders which sometimes cannot be detected automatically | 547 * workaround bugs in encoders which sometimes cannot be detected automatically. |
| 544 * encoding: unused | 548 * - encoding: unused |
| 545 * decoding: set by user | 549 * - decoding: set by user |
| 546 */ | 550 */ |
| 547 int workaround_bugs; | 551 int workaround_bugs; |
| 548 #define FF_BUG_AUTODETECT 1 //autodetection | 552 #define FF_BUG_AUTODETECT 1 ///< autodetection |
| 549 #define FF_BUG_OLD_MSMPEG4 2 | 553 #define FF_BUG_OLD_MSMPEG4 2 |
| 550 #define FF_BUG_XVID_ILACE 4 | 554 #define FF_BUG_XVID_ILACE 4 |
| 551 #define FF_BUG_UMP4 8 | 555 #define FF_BUG_UMP4 8 |
| 552 #define FF_BUG_NO_PADDING 16 | 556 #define FF_BUG_NO_PADDING 16 |
| 553 #define FF_BUG_AC_VLC 32 | 557 #define FF_BUG_AC_VLC 32 |
| 556 #define FF_BUG_QPEL_CHROMA2 256 | 560 #define FF_BUG_QPEL_CHROMA2 256 |
| 557 #define FF_BUG_DIRECT_BLOCKSIZE 512 | 561 #define FF_BUG_DIRECT_BLOCKSIZE 512 |
| 558 //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100% | 562 //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100% |
| 559 | 563 |
| 560 /** | 564 /** |
| 561 * encoding: set by user | 565 * luma single coeff elimination threshold. |
| 562 * decoding: unused | 566 * - encoding: set by user |
| 567 * - decoding: unused | |
| 563 */ | 568 */ |
| 564 int luma_elim_threshold; | 569 int luma_elim_threshold; |
| 565 | 570 |
| 566 /** | 571 /** |
| 567 * encoding: set by user | 572 * chroma single coeff elimination threshold. |
| 568 * decoding: unused | 573 * - encoding: set by user |
| 574 * - decoding: unused | |
| 569 */ | 575 */ |
| 570 int chroma_elim_threshold; | 576 int chroma_elim_threshold; |
| 571 | 577 |
| 572 /** | 578 /** |
| 573 * strictly follow the std (MPEG4, ...) | 579 * strictly follow the std (MPEG4, ...). |
| 574 * encoding: set by user | 580 * - encoding: set by user |
| 575 * decoding: unused | 581 * - decoding: unused |
| 576 */ | 582 */ |
| 577 int strict_std_compliance; | 583 int strict_std_compliance; |
| 578 | 584 |
| 579 /** | 585 /** |
| 580 * qscale offset between ip and b frames | 586 * qscale offset between ip and b frames. |
| 581 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) | 587 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) |
| 582 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) | 588 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
| 583 * encoding: set by user. | 589 * - encoding: set by user. |
| 584 * decoding: unused | 590 * - decoding: unused |
| 585 */ | 591 */ |
| 586 float b_quant_offset; | 592 float b_quant_offset; |
| 587 | 593 |
| 588 /** | 594 /** |
| 589 * error resilience higher values will detect more errors but may missdetect | 595 * error resilience higher values will detect more errors but may missdetect |
| 590 * some more or less valid parts as errors | 596 * some more or less valid parts as errors. |
| 591 * encoding: unused | 597 * - encoding: unused |
| 592 * decoding: set by user | 598 * - decoding: set by user |
| 593 */ | 599 */ |
| 594 int error_resilience; | 600 int error_resilience; |
| 595 #define FF_ER_CAREFULL 1 | 601 #define FF_ER_CAREFULL 1 |
| 596 #define FF_ER_COMPLIANT 2 | 602 #define FF_ER_COMPLIANT 2 |
| 597 #define FF_ER_AGGRESSIVE 3 | 603 #define FF_ER_AGGRESSIVE 3 |
| 598 #define FF_ER_VERY_AGGRESSIVE 4 | 604 #define FF_ER_VERY_AGGRESSIVE 4 |
| 599 | 605 |
| 600 /** | 606 /** |
| 601 * called at the beginning of each frame to get a buffer for it. | 607 * called at the beginning of each frame to get a buffer for it. |
| 602 * if pic.reference is set then the frame will be read later by lavc | 608 * if pic.reference is set then the frame will be read later by lavc |
| 603 * encoding: unused | 609 * - encoding: unused |
| 604 * decoding: set by lavc, user can override | 610 * - decoding: set by lavc, user can override |
| 605 */ | 611 */ |
| 606 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); | 612 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); |
| 607 | 613 |
| 608 /** | 614 /** |
| 609 * called to release buffers which where allocated with get_buffer. | 615 * called to release buffers which where allocated with get_buffer. |
| 610 * a released buffer can be reused in get_buffer() | 616 * a released buffer can be reused in get_buffer() |
| 611 * pic.data[*] must be set to NULL | 617 * pic.data[*] must be set to NULL |
| 612 * encoding: unused | 618 * - encoding: unused |
| 613 * decoding: set by lavc, user can override | 619 * - decoding: set by lavc, user can override |
| 614 */ | 620 */ |
| 615 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); | 621 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); |
| 616 | 622 |
| 617 /** | 623 /** |
| 618 * is 1 if the decoded stream contains b frames, 0 otherwise | 624 * is 1 if the decoded stream contains b frames, 0 otherwise. |
| 619 * encoding: unused | 625 * - encoding: unused |
| 620 * decoding: set by lavc | 626 * - decoding: set by lavc |
| 621 */ | 627 */ |
| 622 int has_b_frames; | 628 int has_b_frames; |
| 623 | 629 |
| 624 int block_align; /* used by some WAV based audio codecs */ | 630 int block_align; ///< used by some WAV based audio codecs |
| 625 | 631 |
| 626 int parse_only; /* decoding only: if true, only parsing is done | 632 int parse_only; /* - decoding only: if true, only parsing is done |
| 627 (function avcodec_parse_frame()). The frame | 633 (function avcodec_parse_frame()). The frame |
| 628 data is returned. Only MPEG codecs support this now. */ | 634 data is returned. Only MPEG codecs support this now. */ |
| 629 | 635 |
| 630 /** | 636 /** |
| 631 * 0-> h263 quant 1-> mpeg quant | 637 * 0-> h263 quant 1-> mpeg quant. |
| 632 * encoding: set by user. | 638 * - encoding: set by user. |
| 633 * decoding: unused | 639 * - decoding: unused |
| 634 */ | 640 */ |
| 635 int mpeg_quant; | 641 int mpeg_quant; |
| 636 | 642 |
| 637 /** | 643 /** |
| 638 * pass1 encoding statistics output buffer | 644 * pass1 encoding statistics output buffer. |
| 639 * encoding: set by lavc | 645 * - encoding: set by lavc |
| 640 * decoding: unused | 646 * - decoding: unused |
| 641 */ | 647 */ |
| 642 char *stats_out; /* encoding statistics output buffer */ | 648 char *stats_out; |
| 643 | 649 |
| 644 /** | 650 /** |
| 645 * pass2 encoding statistics input buffer. | 651 * pass2 encoding statistics input buffer. |
| 646 * concatenated stuff from stats_out of pass1 should be placed here | 652 * concatenated stuff from stats_out of pass1 should be placed here |
| 647 * encoding: allocated/set/freed by user | 653 * - encoding: allocated/set/freed by user |
| 648 * decoding: unused | 654 * - decoding: unused |
| 649 */ | 655 */ |
| 650 char *stats_in; | 656 char *stats_in; |
| 651 | 657 |
| 652 /** | 658 /** |
| 653 * ratecontrol qmin qmax limiting method | 659 * ratecontrol qmin qmax limiting method. |
| 654 * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax | 660 * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax |
| 655 * encoding: set by user. | 661 * - encoding: set by user. |
| 656 * decoding: unused | 662 * - decoding: unused |
| 657 */ | 663 */ |
| 658 float rc_qsquish; | 664 float rc_qsquish; |
| 659 | 665 |
| 660 float rc_qmod_amp; | 666 float rc_qmod_amp; |
| 661 int rc_qmod_freq; | 667 int rc_qmod_freq; |
| 662 | 668 |
| 663 /** | 669 /** |
| 664 * ratecontrol override, see RcOverride | 670 * ratecontrol override, see RcOverride. |
| 665 * encoding: allocated/set/freed by user. | 671 * - encoding: allocated/set/freed by user. |
| 666 * decoding: unused | 672 * - decoding: unused |
| 667 */ | 673 */ |
| 668 RcOverride *rc_override; | 674 RcOverride *rc_override; |
| 669 int rc_override_count; | 675 int rc_override_count; |
| 670 | 676 |
| 671 /** | 677 /** |
| 672 * rate control equation | 678 * rate control equation. |
| 673 * encoding: set by user | 679 * - encoding: set by user |
| 674 * decoding: unused | 680 * - decoding: unused |
| 675 */ | 681 */ |
| 676 char *rc_eq; | 682 char *rc_eq; |
| 677 | 683 |
| 678 /** | 684 /** |
| 679 * maximum bitrate | 685 * maximum bitrate. |
| 680 * encoding: set by user. | 686 * - encoding: set by user. |
| 681 * decoding: unused | 687 * - decoding: unused |
| 682 */ | 688 */ |
| 683 int rc_max_rate; | 689 int rc_max_rate; |
| 684 | 690 |
| 685 /** | 691 /** |
| 686 * minimum bitrate | 692 * minimum bitrate. |
| 687 * encoding: set by user. | 693 * - encoding: set by user. |
| 688 * decoding: unused | 694 * - decoding: unused |
| 689 */ | 695 */ |
| 690 int rc_min_rate; | 696 int rc_min_rate; |
| 691 | 697 |
| 692 /** | 698 /** |
| 693 * decoder bitstream buffer size | 699 * decoder bitstream buffer size. |
| 694 * encoding: set by user. | 700 * - encoding: set by user. |
| 695 * decoding: unused | 701 * - decoding: unused |
| 696 */ | 702 */ |
| 697 int rc_buffer_size; | 703 int rc_buffer_size; |
| 698 float rc_buffer_aggressivity; | 704 float rc_buffer_aggressivity; |
| 699 | 705 |
| 700 /** | 706 /** |
| 701 * qscale factor between p and i frames | 707 * qscale factor between p and i frames. |
| 702 * encoding: set by user. | 708 * - encoding: set by user. |
| 703 * decoding: unused | 709 * - decoding: unused |
| 704 */ | 710 */ |
| 705 float i_quant_factor; | 711 float i_quant_factor; |
| 706 | 712 |
| 707 /** | 713 /** |
| 708 * qscale offset between p and i frames | 714 * qscale offset between p and i frames. |
| 709 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) | 715 * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) |
| 710 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) | 716 * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset) |
| 711 * encoding: set by user. | 717 * - encoding: set by user. |
| 712 * decoding: unused | 718 * - decoding: unused |
| 713 */ | 719 */ |
| 714 float i_quant_offset; | 720 float i_quant_offset; |
| 715 | 721 |
| 716 /** | 722 /** |
| 717 * initial complexity for pass1 ratecontrol | 723 * initial complexity for pass1 ratecontrol. |
| 718 * encoding: set by user. | 724 * - encoding: set by user. |
| 719 * decoding: unused | 725 * - decoding: unused |
| 720 */ | 726 */ |
| 721 float rc_initial_cplx; | 727 float rc_initial_cplx; |
| 722 | 728 |
| 723 /** | 729 /** |
| 724 * dct algorithm, see FF_DCT_* below | 730 * dct algorithm, see FF_DCT_* below. |
| 725 * encoding: set by user | 731 * - encoding: set by user |
| 726 * decoding: unused | 732 * - decoding: unused |
| 727 */ | 733 */ |
| 728 int dct_algo; | 734 int dct_algo; |
| 729 #define FF_DCT_AUTO 0 | 735 #define FF_DCT_AUTO 0 |
| 730 #define FF_DCT_FASTINT 1 | 736 #define FF_DCT_FASTINT 1 |
| 731 #define FF_DCT_INT 2 | 737 #define FF_DCT_INT 2 |
| 732 #define FF_DCT_MMX 3 | 738 #define FF_DCT_MMX 3 |
| 733 #define FF_DCT_MLIB 4 | 739 #define FF_DCT_MLIB 4 |
| 734 #define FF_DCT_ALTIVEC 5 | 740 #define FF_DCT_ALTIVEC 5 |
| 735 | 741 |
| 736 /** | 742 /** |
| 737 * luminance masking (0-> disabled) | 743 * luminance masking (0-> disabled). |
| 738 * encoding: set by user | 744 * - encoding: set by user |
| 739 * decoding: unused | 745 * - decoding: unused |
| 740 */ | 746 */ |
| 741 float lumi_masking; | 747 float lumi_masking; |
| 742 | 748 |
| 743 /** | 749 /** |
| 744 * temporary complexity masking (0-> disabled) | 750 * temporary complexity masking (0-> disabled). |
| 745 * encoding: set by user | 751 * - encoding: set by user |
| 746 * decoding: unused | 752 * - decoding: unused |
| 747 */ | 753 */ |
| 748 float temporal_cplx_masking; | 754 float temporal_cplx_masking; |
| 749 | 755 |
| 750 /** | 756 /** |
| 751 * spatial complexity masking (0-> disabled) | 757 * spatial complexity masking (0-> disabled). |
| 752 * encoding: set by user | 758 * - encoding: set by user |
| 753 * decoding: unused | 759 * - decoding: unused |
| 754 */ | 760 */ |
| 755 float spatial_cplx_masking; | 761 float spatial_cplx_masking; |
| 756 | 762 |
| 757 /** | 763 /** |
| 758 * p block masking (0-> disabled) | 764 * p block masking (0-> disabled). |
| 759 * encoding: set by user | 765 * - encoding: set by user |
| 760 * decoding: unused | 766 * - decoding: unused |
| 761 */ | 767 */ |
| 762 float p_masking; | 768 float p_masking; |
| 763 | 769 |
| 764 /** | 770 /** |
| 765 * darkness masking (0-> disabled) | 771 * darkness masking (0-> disabled). |
| 766 * encoding: set by user | 772 * - encoding: set by user |
| 767 * decoding: unused | 773 * - decoding: unused |
| 768 */ | 774 */ |
| 769 float dark_masking; | 775 float dark_masking; |
| 770 | 776 |
| 771 /** | 777 /** |
| 772 * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A') | 778 * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). |
| 773 * this is used to workaround some encoder bugs | 779 * this is used to workaround some encoder bugs |
| 774 * encoding: unused | 780 * - encoding: unused |
| 775 * decoding: set by user, will be converted to upper case by lavc during init | 781 * - decoding: set by user, will be converted to upper case by lavc during init |
| 776 */ | 782 */ |
| 777 int fourcc; | 783 int fourcc; |
| 778 | 784 |
| 779 /** | 785 /** |
| 780 * idct algorithm, see FF_IDCT_* below | 786 * idct algorithm, see FF_IDCT_* below. |
| 781 * encoding: set by user | 787 * - encoding: set by user |
| 782 * decoding: set by user | 788 * - decoding: set by user |
| 783 */ | 789 */ |
| 784 int idct_algo; | 790 int idct_algo; |
| 785 #define FF_IDCT_AUTO 0 | 791 #define FF_IDCT_AUTO 0 |
| 786 #define FF_IDCT_INT 1 | 792 #define FF_IDCT_INT 1 |
| 787 #define FF_IDCT_SIMPLE 2 | 793 #define FF_IDCT_SIMPLE 2 |
| 791 #define FF_IDCT_MLIB 6 | 797 #define FF_IDCT_MLIB 6 |
| 792 #define FF_IDCT_ARM 7 | 798 #define FF_IDCT_ARM 7 |
| 793 #define FF_IDCT_ALTIVEC 8 | 799 #define FF_IDCT_ALTIVEC 8 |
| 794 | 800 |
| 795 /** | 801 /** |
| 796 * slice count | 802 * slice count. |
| 797 * encoding: set by lavc | 803 * - encoding: set by lavc |
| 798 * decoding: set by user (or 0) | 804 * - decoding: set by user (or 0) |
| 799 */ | 805 */ |
| 800 int slice_count; | 806 int slice_count; |
| 801 /** | 807 /** |
| 802 * slice offsets in the frame in bytes | 808 * slice offsets in the frame in bytes. |
| 803 * encoding: set/allocated by lavc | 809 * - encoding: set/allocated by lavc |
| 804 * decoding: set/allocated by user (or NULL) | 810 * - decoding: set/allocated by user (or NULL) |
| 805 */ | 811 */ |
| 806 int *slice_offset; | 812 int *slice_offset; |
| 807 | 813 |
| 808 /** | 814 /** |
| 809 * error concealment flags | 815 * error concealment flags. |
| 810 * encoding: unused | 816 * - encoding: unused |
| 811 * decoding: set by user | 817 * - decoding: set by user |
| 812 */ | 818 */ |
| 813 int error_concealment; | 819 int error_concealment; |
| 814 #define FF_EC_GUESS_MVS 1 | 820 #define FF_EC_GUESS_MVS 1 |
| 815 #define FF_EC_DEBLOCK 2 | 821 #define FF_EC_DEBLOCK 2 |
| 816 | 822 |
| 819 * CPU features (i.e. MMX, SSE. ...) | 825 * CPU features (i.e. MMX, SSE. ...) |
| 820 */ | 826 */ |
| 821 unsigned dsp_mask; | 827 unsigned dsp_mask; |
| 822 | 828 |
| 823 /** | 829 /** |
| 824 * bits per sample/pixel from the demuxer (needed for huffyuv) | 830 * bits per sample/pixel from the demuxer (needed for huffyuv). |
| 825 * encoding: set by lavc | 831 * - encoding: set by lavc |
| 826 * decoding: set by user | 832 * - decoding: set by user |
| 827 */ | 833 */ |
| 828 int bits_per_sample; | 834 int bits_per_sample; |
| 829 | 835 |
| 830 /** | 836 /** |
| 831 * prediction method (needed for huffyuv) | 837 * prediction method (needed for huffyuv). |
| 832 * encoding: set by user | 838 * - encoding: set by user |
| 833 * decoding: unused | 839 * - decoding: unused |
| 834 */ | 840 */ |
| 835 int prediction_method; | 841 int prediction_method; |
| 836 #define FF_PRED_LEFT 0 | 842 #define FF_PRED_LEFT 0 |
| 837 #define FF_PRED_PLANE 1 | 843 #define FF_PRED_PLANE 1 |
| 838 #define FF_PRED_MEDIAN 2 | 844 #define FF_PRED_MEDIAN 2 |
| 839 | 845 |
| 840 /** | 846 /** |
| 841 * aspect ratio. (0 if unknown) | 847 * aspect ratio (0 if unknown). |
| 842 * encoding: set by user. | 848 * - encoding: set by user. |
| 843 * decoding: set by lavc. | 849 * - decoding: set by lavc. |
| 844 */ | 850 */ |
| 845 float aspect_ratio; | 851 float aspect_ratio; |
| 846 | 852 |
| 847 /** | 853 /** |
| 848 * the picture in the bitstream | 854 * the picture in the bitstream. |
| 849 * encoding: set by lavc | 855 * - encoding: set by lavc |
| 850 * decoding: set by lavc | 856 * - decoding: set by lavc |
| 851 */ | 857 */ |
| 852 AVFrame *coded_frame; | 858 AVFrame *coded_frame; |
| 853 | 859 |
| 854 /** | 860 /** |
| 855 * debug | 861 * debug. |
| 856 * encoding: set by user. | 862 * - encoding: set by user. |
| 857 * decoding: set by user. | 863 * - decoding: set by user. |
| 858 */ | 864 */ |
| 859 int debug; | 865 int debug; |
| 860 #define FF_DEBUG_PICT_INFO 1 | 866 #define FF_DEBUG_PICT_INFO 1 |
| 861 #define FF_DEBUG_RC 2 | 867 #define FF_DEBUG_RC 2 |
| 862 #define FF_DEBUG_BITSTREAM 4 | 868 #define FF_DEBUG_BITSTREAM 4 |
| 867 #define FF_DEBUG_SKIP 0x00000080 | 873 #define FF_DEBUG_SKIP 0x00000080 |
| 868 #define FF_DEBUG_STARTCODE 0x00000100 | 874 #define FF_DEBUG_STARTCODE 0x00000100 |
| 869 #define FF_DEBUG_PTS 0x00000200 | 875 #define FF_DEBUG_PTS 0x00000200 |
| 870 | 876 |
| 871 /** | 877 /** |
| 872 * error | 878 * error. |
| 873 * encoding: set by lavc if flags&CODEC_FLAG_PSNR | 879 * - encoding: set by lavc if flags&CODEC_FLAG_PSNR |
| 874 * decoding: unused | 880 * - decoding: unused |
| 875 */ | 881 */ |
| 876 uint64_t error[4]; | 882 uint64_t error[4]; |
| 877 | 883 |
| 878 /** | 884 /** |
| 879 * minimum MB quantizer | 885 * minimum MB quantizer. |
| 880 * encoding: set by user. | 886 * - encoding: set by user. |
| 881 * decoding: unused | 887 * - decoding: unused |
| 882 */ | 888 */ |
| 883 int mb_qmin; | 889 int mb_qmin; |
| 884 | 890 |
| 885 /** | 891 /** |
| 886 * maximum MB quantizer | 892 * maximum MB quantizer. |
| 887 * encoding: set by user. | 893 * - encoding: set by user. |
| 888 * decoding: unused | 894 * - decoding: unused |
| 889 */ | 895 */ |
| 890 int mb_qmax; | 896 int mb_qmax; |
| 891 | 897 |
| 892 /** | 898 /** |
| 893 * motion estimation compare function | 899 * motion estimation compare function. |
| 894 * encoding: set by user. | 900 * - encoding: set by user. |
| 895 * decoding: unused | 901 * - decoding: unused |
| 896 */ | 902 */ |
| 897 int me_cmp; | 903 int me_cmp; |
| 898 /** | 904 /** |
| 899 * subpixel motion estimation compare function | 905 * subpixel motion estimation compare function. |
| 900 * encoding: set by user. | 906 * - encoding: set by user. |
| 901 * decoding: unused | 907 * - decoding: unused |
| 902 */ | 908 */ |
| 903 int me_sub_cmp; | 909 int me_sub_cmp; |
| 904 /** | 910 /** |
| 905 * macroblock compare function (not supported yet) | 911 * macroblock compare function (not supported yet). |
| 906 * encoding: set by user. | 912 * - encoding: set by user. |
| 907 * decoding: unused | 913 * - decoding: unused |
| 908 */ | 914 */ |
| 909 int mb_cmp; | 915 int mb_cmp; |
| 910 #define FF_CMP_SAD 0 | 916 #define FF_CMP_SAD 0 |
| 911 #define FF_CMP_SSE 1 | 917 #define FF_CMP_SSE 1 |
| 912 #define FF_CMP_SATD 2 | 918 #define FF_CMP_SATD 2 |
| 916 #define FF_CMP_RD 6 | 922 #define FF_CMP_RD 6 |
| 917 #define FF_CMP_ZERO 7 | 923 #define FF_CMP_ZERO 7 |
| 918 #define FF_CMP_CHROMA 256 | 924 #define FF_CMP_CHROMA 256 |
| 919 | 925 |
| 920 /** | 926 /** |
| 921 * ME diamond size & shape | 927 * ME diamond size & shape. |
| 922 * encoding: set by user. | 928 * - encoding: set by user. |
| 923 * decoding: unused | 929 * - decoding: unused |
| 924 */ | 930 */ |
| 925 int dia_size; | 931 int dia_size; |
| 926 | 932 |
| 927 /** | 933 /** |
| 928 * amount of previous MV predictors (2a+1 x 2a+1 square) | 934 * amount of previous MV predictors (2a+1 x 2a+1 square). |
| 929 * encoding: set by user. | 935 * - encoding: set by user. |
| 930 * decoding: unused | 936 * - decoding: unused |
| 931 */ | 937 */ |
| 932 int last_predictor_count; | 938 int last_predictor_count; |
| 933 | 939 |
| 934 /** | 940 /** |
| 935 * pre pass for motion estimation | 941 * pre pass for motion estimation. |
| 936 * encoding: set by user. | 942 * - encoding: set by user. |
| 937 * decoding: unused | 943 * - decoding: unused |
| 938 */ | 944 */ |
| 939 int pre_me; | 945 int pre_me; |
| 940 | 946 |
| 941 /** | 947 /** |
| 942 * motion estimation pre pass compare function | 948 * motion estimation pre pass compare function. |
| 943 * encoding: set by user. | 949 * - encoding: set by user. |
| 944 * decoding: unused | 950 * - decoding: unused |
| 945 */ | 951 */ |
| 946 int me_pre_cmp; | 952 int me_pre_cmp; |
| 947 | 953 |
| 948 /** | 954 /** |
| 949 * ME pre pass diamond size & shape | 955 * ME pre pass diamond size & shape. |
| 950 * encoding: set by user. | 956 * - encoding: set by user. |
| 951 * decoding: unused | 957 * - decoding: unused |
| 952 */ | 958 */ |
| 953 int pre_dia_size; | 959 int pre_dia_size; |
| 954 | 960 |
| 955 /** | 961 /** |
| 956 * subpel ME quality | 962 * subpel ME quality. |
| 957 * encoding: set by user. | 963 * - encoding: set by user. |
| 958 * decoding: unused | 964 * - decoding: unused |
| 959 */ | 965 */ |
| 960 int me_subpel_quality; | 966 int me_subpel_quality; |
| 961 | 967 |
| 962 /** | 968 /** |
| 963 * callback to negotiate the pixelFormat | 969 * callback to negotiate the pixelFormat. |
| 964 * @param fmt is the list of formats which are supported by the codec, | 970 * @param fmt is the list of formats which are supported by the codec, |
| 965 * its terminated by -1 as 0 is a valid format, the formats are ordered by quality | 971 * its terminated by -1 as 0 is a valid format, the formats are ordered by quality |
| 966 * the first is allways the native one | 972 * the first is allways the native one |
| 967 * @return the choosen format | 973 * @return the choosen format |
| 968 * encoding: unused | 974 * - encoding: unused |
| 969 * decoding: set by user, if not set then the native format will always be choosen | 975 * - decoding: set by user, if not set then the native format will always be choosen |
| 970 */ | 976 */ |
| 971 enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt); | 977 enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt); |
| 972 | 978 |
| 973 /** | 979 /** |
| 974 * DTG active format information (additionnal aspect ratio | 980 * DTG active format information (additionnal aspect ratio |
| 975 * information only used in DVB MPEG2 transport streams). 0 if | 981 * information only used in DVB MPEG2 transport streams). 0 if |
| 976 * not set. | 982 * not set. |
| 977 * | 983 * |
| 978 * encoding: unused. | 984 * - encoding: unused. |
| 979 * decoding: set by decoder | 985 * - decoding: set by decoder |
| 980 */ | 986 */ |
| 981 int dtg_active_format; | 987 int dtg_active_format; |
| 982 #define FF_DTG_AFD_SAME 8 | 988 #define FF_DTG_AFD_SAME 8 |
| 983 #define FF_DTG_AFD_4_3 9 | 989 #define FF_DTG_AFD_4_3 9 |
| 984 #define FF_DTG_AFD_16_9 10 | 990 #define FF_DTG_AFD_16_9 10 |
| 990 int me_range; | 996 int me_range; |
| 991 /** | 997 /** |
| 992 * Maximum motion estimation search range in subpel units. | 998 * Maximum motion estimation search range in subpel units. |
| 993 * if 0 then no limit | 999 * if 0 then no limit |
| 994 * | 1000 * |
| 995 * encoding: set by user. | 1001 * - encoding: set by user. |
| 996 * decoding: unused. | 1002 * - decoding: unused. |
| 997 */ | 1003 */ |
| 998 | 1004 |
| 999 } AVCodecContext; | 1005 } AVCodecContext; |
| 1000 | 1006 |
| 1001 //void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config); | 1007 //void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config); |
| 1002 | 1008 |
| 1009 /** | |
| 1010 * AVOption. | |
| 1011 */ | |
| 1003 typedef struct AVOption { | 1012 typedef struct AVOption { |
| 1004 /** options' name */ | 1013 /** options' name */ |
| 1005 const char *name; /* if name is NULL, it indicates a link to next */ | 1014 const char *name; /* if name is NULL, it indicates a link to next */ |
| 1006 /** short English text help */ | 1015 /** short English text help */ |
| 1007 const char *help; | 1016 const char *help; |
| 1008 /** offset to context structure where the parsed value should be stored */ | 1017 /** offset to context structure where the parsed value should be stored */ |
| 1009 int offset; | 1018 int offset; |
| 1010 /** options' type */ | 1019 /** options' type */ |
| 1011 int type; | 1020 int type; |
| 1012 #define FF_OPT_TYPE_BOOL 1 // boolean - true,1,on (or simply presence) | 1021 #define FF_OPT_TYPE_BOOL 1 ///< boolean - true,1,on (or simply presence) |
| 1013 #define FF_OPT_TYPE_DOUBLE 2 // double | 1022 #define FF_OPT_TYPE_DOUBLE 2 ///< double |
| 1014 #define FF_OPT_TYPE_INT 3 // integer | 1023 #define FF_OPT_TYPE_INT 3 ///< integer |
| 1015 #define FF_OPT_TYPE_STRING 4 // string (finished with \0) | 1024 #define FF_OPT_TYPE_STRING 4 ///< string (finished with \0) |
| 1016 #define FF_OPT_TYPE_MASK 0x1f // mask for types - upper bits are various flags | 1025 #define FF_OPT_TYPE_MASK 0x1f ///< mask for types - upper bits are various flags |
| 1017 //#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option | 1026 //#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option |
| 1018 #define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40) | 1027 #define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40) |
| 1019 #define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80) | 1028 #define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80) |
| 1020 /** min value (min == max -> no limits) */ | 1029 /** min value (min == max -> no limits) */ |
| 1021 double min; | 1030 double min; |
| 1032 const struct AVOption *sub; /* used when name is NULL */ | 1041 const struct AVOption *sub; /* used when name is NULL */ |
| 1033 /* when it's NULL return to previous level (or finish reading) */ | 1042 /* when it's NULL return to previous level (or finish reading) */ |
| 1034 #define FF_OPT_MAX_DEPTH 10 | 1043 #define FF_OPT_MAX_DEPTH 10 |
| 1035 } AVOption; | 1044 } AVOption; |
| 1036 | 1045 |
| 1046 /** | |
| 1047 * AVCodec. | |
| 1048 */ | |
| 1037 typedef struct AVCodec { | 1049 typedef struct AVCodec { |
| 1038 const char *name; | 1050 const char *name; |
| 1039 int type; | 1051 int type; |
| 1040 int id; | 1052 int id; |
| 1041 int priv_data_size; | 1053 int priv_data_size; |
| 1225 * | 1237 * |
| 1226 * do not even think about it's usage for this moment | 1238 * do not even think about it's usage for this moment |
| 1227 */ | 1239 */ |
| 1228 | 1240 |
| 1229 typedef struct { | 1241 typedef struct { |
| 1230 // compressed size used from given memory buffer | 1242 /// compressed size used from given memory buffer |
| 1231 int size; | 1243 int size; |
| 1232 /// I/P/B frame type | 1244 /// I/P/B frame type |
| 1233 int frame_type; | 1245 int frame_type; |
| 1234 } avc_enc_result_t; | 1246 } avc_enc_result_t; |
| 1235 | 1247 |
