Revision 64863965 libavcodec/avcodec.h

View differences:

libavcodec/avcodec.h
70 70
    CODEC_TYPE_AUDIO,
71 71
};
72 72

  
73
/**
74
 * Pixel format.
75
 */
73 76
enum PixelFormat {
74 77
    PIX_FMT_YUV420P,
75 78
    PIX_FMT_YUV422,
76
    PIX_FMT_RGB24,     /* 3 bytes, R is first */
77
    PIX_FMT_BGR24,     /* 3 bytes, B is first */
79
    PIX_FMT_RGB24,     ///< 3 bytes, R is first 
80
    PIX_FMT_BGR24,     ///< 3 bytes, B is first 
78 81
    PIX_FMT_YUV422P,
79 82
    PIX_FMT_YUV444P,
80
    PIX_FMT_RGBA32,    /* always stored in cpu endianness */
83
    PIX_FMT_RGBA32,    ///< always stored in cpu endianness 
81 84
    PIX_FMT_YUV410P,
82 85
    PIX_FMT_YUV411P,
83
    PIX_FMT_RGB565,    /* always stored in cpu endianness */
84
    PIX_FMT_RGB555,    /* always stored in cpu endianness, most significant bit to 1 */
86
    PIX_FMT_RGB565,    ///< always stored in cpu endianness 
87
    PIX_FMT_RGB555,    ///< always stored in cpu endianness, most significant bit to 1 
85 88
    PIX_FMT_GRAY8,
86
    PIX_FMT_MONOWHITE, /* 0 is white */
87
    PIX_FMT_MONOBLACK, /* 0 is black */
88
    PIX_FMT_PAL8,      /* 8 bit with RGBA palette */
89
    PIX_FMT_MONOWHITE, ///< 0 is white 
90
    PIX_FMT_MONOBLACK, ///< 0 is black 
91
    PIX_FMT_PAL8,      ///< 8 bit with RGBA palette 
89 92
    PIX_FMT_NB,
90 93
};
91 94

  
92 95
/* currently unused, may be used if 24/32 bits samples ever supported */
93 96
enum SampleFormat {
94
    SAMPLE_FMT_S16 = 0,         /* signed 16 bits */
97
    SAMPLE_FMT_S16 = 0,         ///< signed 16 bits 
95 98
};
96 99

  
97 100
/* in bytes */
......
135 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) */
139
#define CODEC_FLAG_QSCALE 0x0002  /* use fixed qscale */
140
#define CODEC_FLAG_4MV    0x0004  /* 4 MV per MB allowed */
141
#define CODEC_FLAG_QPEL   0x0010  /* use qpel MC */
142
#define CODEC_FLAG_GMC    0x0020  /* use GMC */
143
#define CODEC_FLAG_PART   0x0080  /* use data partitioning */
141
#define CODEC_FLAG_HQ     0x0001  ///< brute force MB-type decission mode (slow) 
142
#define CODEC_FLAG_QSCALE 0x0002  ///< use fixed qscale 
143
#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed 
144
#define CODEC_FLAG_QPEL   0x0010  ///< use qpel MC 
145
#define CODEC_FLAG_GMC    0x0020  ///< use GMC 
146
#define CODEC_FLAG_PART   0x0080  ///< use data partitioning 
144 147
/* parent program gurantees that the input for b-frame containing streams is not written to 
145 148
   for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */
146 149
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
147
#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 */
149
#define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */
150
#define CODEC_FLAG_GRAY  0x2000   /* only decode/encode grayscale */
151
#define CODEC_FLAG_EMU_EDGE 0x4000/* dont draw edges */
152
#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 
150
#define CODEC_FLAG_PASS1 0x0200   ///< use internal 2pass ratecontrol in first  pass mode 
151
#define CODEC_FLAG_PASS2 0x0400   ///< use internal 2pass ratecontrol in second pass mode 
152
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg) 
153
#define CODEC_FLAG_GRAY  0x2000   ///< only decode/encode grayscale 
154
#define CODEC_FLAG_EMU_EDGE 0x4000///< dont draw edges 
155
#define CODEC_FLAG_PSNR           0x8000 ///< error[?] variables will be set during encoding 
156
#define CODEC_FLAG_TRUNCATED  0x00010000 /** input bitstream might be truncated at a random location instead 
154 157
                                            of only at frame boundaries */
155
#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 /* normalize adaptive quantization */
156
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 /* use interlaced dct */
157
#define CODEC_FLAG_LOW_DELAY      0x00080000 /* force low delay / will fail on b frames */
158
#define CODEC_FLAG_ALT_SCAN       0x00100000 /* use alternate scan */
159
#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 */
161
#define CODEC_FLAG_BITEXACT       0x00800000 /* use only bitexact stuff (except (i)dct) */
158
#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< normalize adaptive quantization 
159
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct 
160
#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< force low delay / will fail on b frames 
161
#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< use alternate scan 
162
#define CODEC_FLAG_TRELLIS_QUANT  0x00200000 ///< use trellis quantization 
163
#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< place global headers in extradata instead of every keyframe 
164
#define CODEC_FLAG_BITEXACT       0x00800000 ///< use only bitexact stuff (except (i)dct) 
162 165
/* Fx : Flag for h263+ extra options */
163
#define CODEC_FLAG_H263P_AIC      0x01000000 /* Advanced intra coding */
164
#define CODEC_FLAG_H263P_UMV      0x02000000 /* Unlimited motion vector  */
166
#define CODEC_FLAG_H263P_AIC      0x01000000 ///< Advanced intra coding 
167
#define CODEC_FLAG_H263P_UMV      0x02000000 ///< Unlimited motion vector  
165 168
/* For advanced prediction mode, we reuse the 4MV flag */
166 169
/* Unsupported options :
167 170
 * 		Syntax Arithmetic coding (SAC)
......
174 177
/* /Fx */
175 178
/* codec capabilities */
176 179

  
177
#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 /* decoder can use draw_horiz_band callback */
178
#define CODEC_CAP_DR1             0x0002 /* direct rendering method 1 */
180
#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback 
181
#define CODEC_CAP_DR1             0x0002 ///< direct rendering method 1 
179 182
/* if 'parse_only' field is true, then avcodec_parse_frame() can be
180 183
   used */
181 184
#define CODEC_CAP_PARSE_ONLY      0x0004
......
189 192
    /**\
190 193
     * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
191 194
     * this isnt used by lavc unless the default get/release_buffer() is used\
192
     * encoding: \
193
     * decoding: \
195
     * - encoding: \
196
     * - decoding: \
194 197
     */\
195 198
    uint8_t *base[4];\
196 199
    /**\
197 200
     * 1 -> keyframe, 0-> not\
198
     * encoding: set by lavc\
199
     * decoding: set by lavc\
201
     * - encoding: set by lavc\
202
     * - decoding: set by lavc\
200 203
     */\
201 204
    int key_frame;\
202 205
\
203 206
    /**\
204 207
     * picture type of the frame, see ?_TYPE below\
205
     * encoding: set by lavc for coded_picture (and set by user for input)\
206
     * decoding: set by lavc\
208
     * - encoding: set by lavc for coded_picture (and set by user for input)\
209
     * - decoding: set by lavc\
207 210
     */\
208 211
    int pict_type;\
209 212
\
210 213
    /**\
211 214
     * presentation timestamp in micro seconds (time when frame should be shown to user)\
212 215
     * if 0 then the frame_rate will be used as reference\
213
     * encoding: MUST be set by user\
214
     * decoding: set by lavc\
216
     * - encoding: MUST be set by user\
217
     * - decoding: set by lavc\
215 218
     */\
216 219
    long long int pts;\
217 220
\
218 221
    /**\
219 222
     * picture number in bitstream order.\
220
     * encoding: set by\
221
     * decoding: set by lavc\
223
     * - encoding: set by\
224
     * - decoding: set by lavc\
222 225
     */\
223 226
    int coded_picture_number;\
224 227
    /**\
225
     * encoding: set by\
226
     * decoding: set by lavc\
227 228
     * picture number in display order.\
229
     * - encoding: set by\
230
     * - decoding: set by lavc\
228 231
     */\
229 232
    int display_picture_number;\
230 233
\
231 234
    /**\
232 235
     * quality (between 1 (good) and 31 (bad)) \
233
     * encoding: set by lavc for coded_picture (and set by user for input)\
234
     * decoding: set by lavc\
236
     * - encoding: set by lavc for coded_picture (and set by user for input)\
237
     * - decoding: set by lavc\
235 238
     */\
236 239
    float quality; \
237 240
\
238 241
    /**\
239 242
     * buffer age (1->was last buffer and dint change, 2->..., ...).\
240 243
     * set to something large if the buffer has not been used yet \
241
     * encoding: unused\
242
     * decoding: MUST be set by get_buffer()\
244
     * - encoding: unused\
245
     * - decoding: MUST be set by get_buffer()\
243 246
     */\
244 247
    int age;\
245 248
\
246 249
    /**\
247 250
     * is this picture used as reference\
248
     * encoding: unused\
249
     * decoding: set by lavc (before get_buffer() call))\
251
     * - encoding: unused\
252
     * - decoding: set by lavc (before get_buffer() call))\
250 253
     */\
251 254
    int reference;\
252 255
\
253 256
    /**\
254 257
     * QP table\
255
     * encoding: unused\
256
     * decoding: set by lavc\
258
     * - encoding: unused\
259
     * - decoding: set by lavc\
257 260
     */\
258 261
    int8_t *qscale_table;\
259 262
    /**\
260 263
     * QP store stride\
261
     * encoding: unused\
262
     * decoding: set by lavc\
264
     * - encoding: unused\
265
     * - decoding: set by lavc\
263 266
     */\
264 267
    int qstride;\
265 268
\
266 269
    /**\
267 270
     * mbskip_table[mb]>=1 if MB didnt change\
268 271
     * stride= mb_width = (width+15)>>4\
269
     * encoding: unused\
270
     * decoding: set by lavc\
272
     * - encoding: unused\
273
     * - decoding: set by lavc\
271 274
     */\
272 275
    uint8_t *mbskip_table;\
273 276
\
274 277
    /**\
275 278
     * for some private data of the user\
276
     * encoding: unused\
277
     * decoding: set by user\
279
     * - encoding: unused\
280
     * - decoding: set by user\
278 281
     */\
279 282
    void *opaque;\
280 283
\
281 284
    /**\
282 285
     * error\
283
     * encoding: set by lavc if flags&CODEC_FLAG_PSNR\
284
     * decoding: unused\
286
     * - encoding: set by lavc if flags&CODEC_FLAG_PSNR\
287
     * - decoding: unused\
285 288
     */\
286 289
    uint64_t error[4];\
287 290
\
288 291
    /**\
289 292
     * type of the buffer (to keep track of who has to dealloc data[*])\
290
     * encoding: set by the one who allocs it\
291
     * decoding: set by the one who allocs it\
293
     * - encoding: set by the one who allocs it\
294
     * - decoding: set by the one who allocs it\
292 295
     * Note: user allocated (direct rendering) & internal buffers can not coexist currently\ 
293 296
     */\
294 297
    int type;\
......
296 299
    /**\
297 300
     * when decoding, this signal how much the picture must be delayed.\
298 301
     * extra_delay = repeat_pict / (2*fps)\
299
     * encoding: unused\
300
     * decoding: set by lavc\
302
     * - encoding: unused\
303
     * - decoding: set by lavc\
301 304
     */\
302 305
    int repeat_pict;
303 306

  
......
322 325
 */
323 326
typedef struct AVCodecContext {
324 327
    /**
325
     * the average bitrate
326
     * 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 
328
     * the average bitrate.
329
     * - encoding: set by user. unused for constant quantizer encoding
330
     * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream 
328 331
     */
329 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 336
     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
334
     * encoding: set by user. unused for constant quantizer encoding
335
     * decoding: unused
337
     * - encoding: set by user. unused for constant quantizer encoding
338
     * - decoding: unused
336 339
     */
337 340
    int bit_rate_tolerance; 
338 341

  
339 342
    /**
340
     * CODEC_FLAG_*
341
     * encoding: set by user.
342
     * decoding: set by user.
343
     * CODEC_FLAG_*.
344
     * - encoding: set by user.
345
     * - decoding: set by user.
343 346
     */
344 347
    int flags;
345 348

  
346 349
    /**
347 350
     * some codecs needs additionnal format info. It is stored here
348
     * encoding: set by user. 
349
     * decoding: set by lavc. (FIXME is this ok?)
351
     * - encoding: set by user. 
352
     * - decoding: set by lavc. (FIXME is this ok?)
350 353
     */
351 354
    int sub_id;
352 355

  
353 356
    /**
354
     * motion estimation algorithm used for video coding
355
     * encoding: MUST be set by user.
356
     * decoding: unused
357
     * motion estimation algorithm used for video coding.
358
     * - encoding: MUST be set by user.
359
     * - decoding: unused
357 360
     */
358 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 365
     * mjpeg: huffman tables
363 366
     * rv10: additional flags
364 367
     * mpeg4: global headers (they can be in the bitstream or here)
365
     * encoding: set/allocated/freed by lavc.
366
     * decoding: set/allocated/freed by user.
368
     * - encoding: set/allocated/freed by lavc.
369
     * - decoding: set/allocated/freed by user.
367 370
     */
368 371
    void *extradata;
369 372
    int extradata_size;
370 373
    
371 374
    /* video only */
372 375
    /**
373
     * frames per sec multiplied by FRAME_RATE_BASE
376
     * frames per sec multiplied by FRAME_RATE_BASE.
374 377
     * for variable fps this is the precission, so if the timestamps 
375 378
     * can be specified in msec precssion then this is 1000*FRAME_RATE_BASE
376
     * encoding: MUST be set by user
377
     * decoding: set by lavc. 0 or the frame_rate if available
379
     * - encoding: MUST be set by user
380
     * - decoding: set by lavc. 0 or the frame_rate if available
378 381
     */
379 382
    int frame_rate;
380 383

  
381 384
    /**
382
     * encoding: MUST be set by user. 
383
     * decoding: set by user, some codecs might override / change it during playback
385
     * width / height.
386
     * - encoding: MUST be set by user. 
387
     * - decoding: set by user, some codecs might override / change it during playback
384 388
     */
385 389
    int width, height;
386 390
    
......
392 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
396
     * encoding: set by user.
397
     * decoding: unused
399
     * the number of pictures in a group of pitures, or 0 for intra_only.
400
     * - encoding: set by user.
401
     * - decoding: unused
398 402
     */
399 403
    int gop_size;
400 404

  
401 405
    /**
402
     * pixel format, see PIX_FMT_xxx
403
     * encoding: unused
404
     * decoding: set by lavc.
406
     * pixel format, see PIX_FMT_xxx.
407
     * - encoding: unused
408
     * - decoding: set by lavc.
405 409
     */
406 410
    enum PixelFormat pix_fmt;
407 411
        
......
410 414
     * decoder to draw an horizontal band. It improve cache usage. Not
411 415
     * all codecs can do that. You must check the codec capabilities
412 416
     * before
413
     * encoding: unused
414
     * decoding: set by user.
417
     * - encoding: unused
418
     * - decoding: set by user.
415 419
     */
416 420
    void (*draw_horiz_band)(struct AVCodecContext *s,
417 421
                            uint8_t **src_ptr, int linesize,
418 422
                            int y, int width, int height);
419 423

  
420 424
    /* audio only */
421
    int sample_rate; /* samples per sec */
425
    int sample_rate; ///< samples per sec 
422 426
    int channels;
423
    int sample_fmt;  /* sample format, currenly unused */
427
    int sample_fmt;  ///< sample format, currenly unused 
424 428

  
425 429
    /* the following data should not be initialized */
426
    int frame_size;     /* in samples, initialized when calling 'init' */
427
    int frame_number;   /* audio or video frame number */
428
    int real_pict_num;  /* returns the real picture number of
429
                           previous encoded frame */
430
    int frame_size;     ///< in samples, initialized when calling 'init' 
431
    int frame_number;   ///< audio or video frame number 
432
    int real_pict_num;  ///< returns the real picture number of previous encoded frame 
430 433
    
431 434
    /**
432 435
     * number of frames the decoded output will be delayed relative to 
433
     * the encoded input
434
     * encoding: set by lavc.
435
     * decoding: unused
436
     * the encoded input.
437
     * - encoding: set by lavc.
438
     * - decoding: unused
436 439
     */
437 440
    int delay;
438 441
    
439
    /* encoding parameters */
440
    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) */
442
    /* - encoding parameters */
443
    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
444
    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0) 
442 445
    
443 446
    /**
444
     * minimum quantizer
445
     * encoding: set by user.
446
     * decoding: unused
447
     * minimum quantizer.
448
     * - encoding: set by user.
449
     * - decoding: unused
447 450
     */
448 451
    int qmin;
449 452

  
450 453
    /**
451
     * maximum quantizer
452
     * encoding: set by user.
453
     * decoding: unused
454
     * maximum quantizer.
455
     * - encoding: set by user.
456
     * - decoding: unused
454 457
     */
455 458
    int qmax;
456 459

  
457 460
    /**
458
     * maximum quantizer difference etween frames
459
     * encoding: set by user.
460
     * decoding: unused
461
     * maximum quantizer difference etween frames.
462
     * - encoding: set by user.
463
     * - decoding: unused
461 464
     */
462 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 469
     * note: the output will be delayed by max_b_frames+1 relative to the input
467
     * encoding: set by user.
468
     * decoding: unused
470
     * - encoding: set by user.
471
     * - decoding: unused
469 472
     */
470 473
    int max_b_frames;
471 474

  
472 475
    /**
473
     * qscale factor between ip and b frames
474
     * encoding: set by user.
475
     * decoding: unused
476
     * qscale factor between ip and b frames.
477
     * - encoding: set by user.
478
     * - decoding: unused
476 479
     */
477 480
    float b_quant_factor;
478 481
    
......
481 484
    int b_frame_strategy;
482 485

  
483 486
    /**
484
     * encoding: unused
485
     * decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
487
     * hurry up amount.
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 491
    int hurry_up;
488 492
    
......
521 525
    int misc_bits;
522 526
    
523 527
    /**
524
     * number of bits used for the previously encoded frame
525
     * encoding: set by lavc
526
     * decoding: - for audio - bits_per_sample
528
     * number of bits used for the previously encoded frame.
529
     * - encoding: set by lavc
530
     * - decoding: - for audio - bits_per_sample
527 531
     */
528 532
    int frame_bits;
529 533
                 
530 534
    /**
531
     * private data of the user, can be used to carry app specific stuff
532
     * encoding: set by user
533
     * decoding: set by user
535
     * private data of the user, can be used to carry app specific stuff.
536
     * - encoding: set by user
537
     * - decoding: set by user
534 538
     */
535 539
    void *opaque;
536 540

  
537 541
    char codec_name[32];
538 542
    enum CodecType codec_type; /* see CODEC_TYPE_xxx */
539 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
544
     * encoding: unused
545
     * decoding: set by user
547
     * workaround bugs in encoders which sometimes cannot be detected automatically.
548
     * - encoding: unused
549
     * - decoding: set by user
546 550
     */
547 551
    int workaround_bugs;
548
#define FF_BUG_AUTODETECT       1  //autodetection
552
#define FF_BUG_AUTODETECT       1  ///< autodetection
549 553
#define FF_BUG_OLD_MSMPEG4      2
550 554
#define FF_BUG_XVID_ILACE       4
551 555
#define FF_BUG_UMP4             8
......
558 562
//#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
559 563
        
560 564
    /**
561
     * encoding: set by user
562
     * decoding: unused
565
     * luma single coeff elimination threshold.
566
     * - encoding: set by user
567
     * - decoding: unused
563 568
     */
564 569
    int luma_elim_threshold;
565 570
    
566 571
    /**
567
     * encoding: set by user
568
     * decoding: unused
572
     * chroma single coeff elimination threshold.
573
     * - encoding: set by user
574
     * - decoding: unused
569 575
     */
570 576
    int chroma_elim_threshold;
571 577
    
572 578
    /**
573
     * strictly follow the std (MPEG4, ...)
574
     * encoding: set by user
575
     * decoding: unused
579
     * strictly follow the std (MPEG4, ...).
580
     * - encoding: set by user
581
     * - decoding: unused
576 582
     */
577 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 587
     * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
582 588
     * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
583
     * encoding: set by user.
584
     * decoding: unused
589
     * - encoding: set by user.
590
     * - decoding: unused
585 591
     */
586 592
    float b_quant_offset;
587 593
    
588 594
    /**
589 595
     * error resilience higher values will detect more errors but may missdetect
590
     * some more or less valid parts as errors
591
     * encoding: unused
592
     * decoding: set by user
596
     * some more or less valid parts as errors.
597
     * - encoding: unused
598
     * - decoding: set by user
593 599
     */
594 600
    int error_resilience;
595 601
#define FF_ER_CAREFULL        1
......
600 606
    /**
601 607
     * called at the beginning of each frame to get a buffer for it.
602 608
     * if pic.reference is set then the frame will be read later by lavc
603
     * encoding: unused
604
     * decoding: set by lavc, user can override
609
     * - encoding: unused
610
     * - decoding: set by lavc, user can override
605 611
     */
606 612
    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
607 613
    
......
609 615
     * called to release buffers which where allocated with get_buffer.
610 616
     * a released buffer can be reused in get_buffer()
611 617
     * pic.data[*] must be set to NULL
612
     * encoding: unused
613
     * decoding: set by lavc, user can override
618
     * - encoding: unused
619
     * - decoding: set by lavc, user can override
614 620
     */
615 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
619
     * encoding: unused
620
     * decoding: set by lavc
624
     * is 1 if the decoded stream contains b frames, 0 otherwise.
625
     * - encoding: unused
626
     * - decoding: set by lavc
621 627
     */
622 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 633
                       (function avcodec_parse_frame()). The frame
628 634
                       data is returned. Only MPEG codecs support this now. */
629 635
    
630 636
    /**
631
     * 0-> h263 quant 1-> mpeg quant
632
     * encoding: set by user.
633
     * decoding: unused
637
     * 0-> h263 quant 1-> mpeg quant.
638
     * - encoding: set by user.
639
     * - decoding: unused
634 640
     */
635 641
    int mpeg_quant;
636 642
    
637 643
    /**
638
     * pass1 encoding statistics output buffer
639
     * encoding: set by lavc
640
     * decoding: unused
644
     * pass1 encoding statistics output buffer.
645
     * - encoding: set by lavc
646
     * - decoding: unused
641 647
     */
642
    char *stats_out; /* encoding statistics output buffer */
648
    char *stats_out;
643 649
    
644 650
    /**
645 651
     * pass2 encoding statistics input buffer.
646 652
     * concatenated stuff from stats_out of pass1 should be placed here
647
     * encoding: allocated/set/freed by user
648
     * decoding: unused
653
     * - encoding: allocated/set/freed by user
654
     * - decoding: unused
649 655
     */
650 656
    char *stats_in;
651 657
    
652 658
    /**
653
     * ratecontrol qmin qmax limiting method
659
     * ratecontrol qmin qmax limiting method.
654 660
     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax
655
     * encoding: set by user.
656
     * decoding: unused
661
     * - encoding: set by user.
662
     * - decoding: unused
657 663
     */
658 664
    float rc_qsquish;
659 665

  
......
661 667
    int rc_qmod_freq;
662 668
    
663 669
    /**
664
     * ratecontrol override, see RcOverride
665
     * encoding: allocated/set/freed by user.
666
     * decoding: unused
670
     * ratecontrol override, see RcOverride.
671
     * - encoding: allocated/set/freed by user.
672
     * - decoding: unused
667 673
     */
668 674
    RcOverride *rc_override;
669 675
    int rc_override_count;
670 676
    
671 677
    /**
672
     * rate control equation
673
     * encoding: set by user
674
     * decoding: unused
678
     * rate control equation.
679
     * - encoding: set by user
680
     * - decoding: unused
675 681
     */
676 682
    char *rc_eq;
677 683
    
678 684
    /**
679
     * maximum bitrate
680
     * encoding: set by user.
681
     * decoding: unused
685
     * maximum bitrate.
686
     * - encoding: set by user.
687
     * - decoding: unused
682 688
     */
683 689
    int rc_max_rate;
684 690
    
685 691
    /**
686
     * minimum bitrate
687
     * encoding: set by user.
688
     * decoding: unused
692
     * minimum bitrate.
693
     * - encoding: set by user.
694
     * - decoding: unused
689 695
     */
690 696
    int rc_min_rate;
691 697
    
692 698
    /**
693
     * decoder bitstream buffer size
694
     * encoding: set by user.
695
     * decoding: unused
699
     * decoder bitstream buffer size.
700
     * - encoding: set by user.
701
     * - decoding: unused
696 702
     */
697 703
    int rc_buffer_size;
698 704
    float rc_buffer_aggressivity;
699 705

  
700 706
    /**
701
     * qscale factor between p and i frames
702
     * encoding: set by user.
703
     * decoding: unused
707
     * qscale factor between p and i frames.
708
     * - encoding: set by user.
709
     * - decoding: unused
704 710
     */
705 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 715
     * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
710 716
     * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
711
     * encoding: set by user.
712
     * decoding: unused
717
     * - encoding: set by user.
718
     * - decoding: unused
713 719
     */
714 720
    float i_quant_offset;
715 721
    
716 722
    /**
717
     * initial complexity for pass1 ratecontrol
718
     * encoding: set by user.
719
     * decoding: unused
723
     * initial complexity for pass1 ratecontrol.
724
     * - encoding: set by user.
725
     * - decoding: unused
720 726
     */
721 727
    float rc_initial_cplx;
722 728

  
723 729
    /**
724
     * dct algorithm, see FF_DCT_* below
725
     * encoding: set by user
726
     * decoding: unused
730
     * dct algorithm, see FF_DCT_* below.
731
     * - encoding: set by user
732
     * - decoding: unused
727 733
     */
728 734
    int dct_algo;
729 735
#define FF_DCT_AUTO    0
......
734 740
#define FF_DCT_ALTIVEC 5
735 741
    
736 742
    /**
737
     * luminance masking (0-> disabled)
738
     * encoding: set by user
739
     * decoding: unused
743
     * luminance masking (0-> disabled).
744
     * - encoding: set by user
745
     * - decoding: unused
740 746
     */
741 747
    float lumi_masking;
742 748
    
743 749
    /**
744
     * temporary complexity masking (0-> disabled)
745
     * encoding: set by user
746
     * decoding: unused
750
     * temporary complexity masking (0-> disabled).
751
     * - encoding: set by user
752
     * - decoding: unused
747 753
     */
748 754
    float temporal_cplx_masking;
749 755
    
750 756
    /**
751
     * spatial complexity masking (0-> disabled)
752
     * encoding: set by user
753
     * decoding: unused
757
     * spatial complexity masking (0-> disabled).
758
     * - encoding: set by user
759
     * - decoding: unused
754 760
     */
755 761
    float spatial_cplx_masking;
756 762
    
757 763
    /**
758
     * p block masking (0-> disabled)
759
     * encoding: set by user
760
     * decoding: unused
764
     * p block masking (0-> disabled).
765
     * - encoding: set by user
766
     * - decoding: unused
761 767
     */
762 768
    float p_masking;
763 769

  
764 770
    /**
765
     * darkness masking (0-> disabled)
766
     * encoding: set by user
767
     * decoding: unused
771
     * darkness masking (0-> disabled).
772
     * - encoding: set by user
773
     * - decoding: unused
768 774
     */
769 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 779
     * this is used to workaround some encoder bugs
774
     * encoding: unused
775
     * decoding: set by user, will be converted to upper case by lavc during init
780
     * - encoding: unused
781
     * - decoding: set by user, will be converted to upper case by lavc during init
776 782
     */
777 783
    int fourcc;
778 784

  
779 785
    /**
780
     * idct algorithm, see FF_IDCT_* below
781
     * encoding: set by user
782
     * decoding: set by user
786
     * idct algorithm, see FF_IDCT_* below.
787
     * - encoding: set by user
788
     * - decoding: set by user
783 789
     */
784 790
    int idct_algo;
785 791
#define FF_IDCT_AUTO         0
......
793 799
#define FF_IDCT_ALTIVEC      8
794 800

  
795 801
    /**
796
     * slice count
797
     * encoding: set by lavc
798
     * decoding: set by user (or 0)
802
     * slice count.
803
     * - encoding: set by lavc
804
     * - decoding: set by user (or 0)
799 805
     */
800 806
    int slice_count;
801 807
    /**
802
     * slice offsets in the frame in bytes
803
     * encoding: set/allocated by lavc
804
     * decoding: set/allocated by user (or NULL)
808
     * slice offsets in the frame in bytes.
809
     * - encoding: set/allocated by lavc
810
     * - decoding: set/allocated by user (or NULL)
805 811
     */
806 812
    int *slice_offset;
807 813

  
808 814
    /**
809
     * error concealment flags
810
     * encoding: unused
811
     * decoding: set by user
815
     * error concealment flags.
816
     * - encoding: unused
817
     * - decoding: set by user
812 818
     */
813 819
    int error_concealment;
814 820
#define FF_EC_GUESS_MVS   1
......
821 827
     unsigned dsp_mask;
822 828

  
823 829
    /**
824
     * bits per sample/pixel from the demuxer (needed for huffyuv)
825
     * encoding: set by lavc
826
     * decoding: set by user
830
     * bits per sample/pixel from the demuxer (needed for huffyuv).
831
     * - encoding: set by lavc
832
     * - decoding: set by user
827 833
     */
828 834
     int bits_per_sample;
829 835
    
830 836
    /**
831
     * prediction method (needed for huffyuv)
832
     * encoding: set by user
833
     * decoding: unused
837
     * prediction method (needed for huffyuv).
838
     * - encoding: set by user
839
     * - decoding: unused
834 840
     */
835 841
     int prediction_method;
836 842
#define FF_PRED_LEFT   0
......
838 844
#define FF_PRED_MEDIAN 2
839 845
    
840 846
    /**
841
     * aspect ratio. (0 if unknown)
842
     * encoding: set by user.
843
     * decoding: set by lavc.
847
     * aspect ratio (0 if unknown).
848
     * - encoding: set by user.
849
     * - decoding: set by lavc.
844 850
     */
845 851
    float aspect_ratio;
846 852

  
847 853
    /**
848
     * the picture in the bitstream
849
     * encoding: set by lavc
850
     * decoding: set by lavc
854
     * the picture in the bitstream.
855
     * - encoding: set by lavc
856
     * - decoding: set by lavc
851 857
     */
852 858
    AVFrame *coded_frame;
853 859

  
854 860
    /**
855
     * debug 
856
     * encoding: set by user.
857
     * decoding: set by user.
861
     * debug.
862
     * - encoding: set by user.
863
     * - decoding: set by user.
858 864
     */
859 865
    int debug;
860 866
#define FF_DEBUG_PICT_INFO 1
......
869 875
#define FF_DEBUG_PTS       0x00000200
870 876
    
871 877
    /**
872
     * error
873
     * encoding: set by lavc if flags&CODEC_FLAG_PSNR
874
     * decoding: unused
878
     * error.
879
     * - encoding: set by lavc if flags&CODEC_FLAG_PSNR
880
     * - decoding: unused
875 881
     */
876 882
    uint64_t error[4];
877 883
    
878 884
    /**
879
     * minimum MB quantizer
880
     * encoding: set by user.
881
     * decoding: unused
885
     * minimum MB quantizer.
886
     * - encoding: set by user.
887
     * - decoding: unused
882 888
     */
883 889
    int mb_qmin;
884 890

  
885 891
    /**
886
     * maximum MB quantizer
887
     * encoding: set by user.
888
     * decoding: unused
892
     * maximum MB quantizer.
893
     * - encoding: set by user.
894
     * - decoding: unused
889 895
     */
890 896
    int mb_qmax;
891 897
    
892 898
    /**
893
     * motion estimation compare function
894
     * encoding: set by user.
895
     * decoding: unused
899
     * motion estimation compare function.
900
     * - encoding: set by user.
901
     * - decoding: unused
896 902
     */
897 903
    int me_cmp;
898 904
    /**
899
     * subpixel motion estimation compare function
900
     * encoding: set by user.
901
     * decoding: unused
905
     * subpixel motion estimation compare function.
906
     * - encoding: set by user.
907
     * - decoding: unused
902 908
     */
903 909
    int me_sub_cmp;
904 910
    /**
905
     * macroblock compare function (not supported yet)
906
     * encoding: set by user.
907
     * decoding: unused
911
     * macroblock compare function (not supported yet).
912
     * - encoding: set by user.
913
     * - decoding: unused
908 914
     */
909 915
    int mb_cmp;
910 916
#define FF_CMP_SAD  0
......
918 924
#define FF_CMP_CHROMA 256
919 925
    
920 926
    /**
921
     * ME diamond size & shape
922
     * encoding: set by user.
923
     * decoding: unused
927
     * ME diamond size & shape.
928
     * - encoding: set by user.
929
     * - decoding: unused
924 930
     */
925 931
    int dia_size;
926 932

  
927 933
    /**
928
     * amount of previous MV predictors (2a+1 x 2a+1 square)
929
     * encoding: set by user.
930
     * decoding: unused
934
     * amount of previous MV predictors (2a+1 x 2a+1 square).
935
     * - encoding: set by user.
936
     * - decoding: unused
931 937
     */
932 938
    int last_predictor_count;
933 939

  
934 940
    /**
935
     * pre pass for motion estimation
936
     * encoding: set by user.
937
     * decoding: unused
941
     * pre pass for motion estimation.
942
     * - encoding: set by user.
943
     * - decoding: unused
938 944
     */
939 945
    int pre_me;
940 946

  
941 947
    /**
942
     * motion estimation pre pass compare function
943
     * encoding: set by user.
944
     * decoding: unused
948
     * motion estimation pre pass compare function.
949
     * - encoding: set by user.
950
     * - decoding: unused
945 951
     */
946 952
    int me_pre_cmp;
947 953

  
948 954
    /**
949
     * ME pre pass diamond size & shape
950
     * encoding: set by user.
951
     * decoding: unused
955
     * ME pre pass diamond size & shape.
956
     * - encoding: set by user.
957
     * - decoding: unused
952 958
     */
953 959
    int pre_dia_size;
954 960

  
955 961
    /**
956
     * subpel ME quality
957
     * encoding: set by user.
958
     * decoding: unused
962
     * subpel ME quality.
963
     * - encoding: set by user.
964
     * - decoding: unused
959 965
     */
960 966
    int me_subpel_quality;
961 967

  
962 968
    /**
963
     * callback to negotiate the pixelFormat
969
     * callback to negotiate the pixelFormat.
964 970
     * @param fmt is the list of formats which are supported by the codec,
965 971
     * its terminated by -1 as 0 is a valid format, the formats are ordered by quality
966 972
     * the first is allways the native one
967 973
     * @return the choosen format
968
     * encoding: unused
969
     * decoding: set by user, if not set then the native format will always be choosen
974
     * - encoding: unused
975
     * - decoding: set by user, if not set then the native format will always be choosen
970 976
     */
971 977
    enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
972 978

  
......
975 981
     * information only used in DVB MPEG2 transport streams). 0 if
976 982
     * not set.
977 983
     * 
978
     * encoding: unused.
979
     * decoding: set by decoder 
984
     * - encoding: unused.
985
     * - decoding: set by decoder 
980 986
     */
981 987
    int dtg_active_format;
982 988
#define FF_DTG_AFD_SAME         8
......
992 998
     * Maximum motion estimation search range in subpel units.
993 999
     * if 0 then no limit
994 1000
     * 
995
     * encoding: set by user.
996
     * decoding: unused.
1001
     * - encoding: set by user.
1002
     * - decoding: unused.
997 1003
     */
998 1004

  
999 1005
} AVCodecContext;
1000 1006

  
1001 1007
//void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config);
1002 1008

  
1009
/**
1010
 * AVOption.
1011
 */
1003 1012
typedef struct AVOption {
1004 1013
    /** options' name */
1005 1014
    const char *name; /* if name is NULL, it indicates a link to next */
......
1009 1018
    int offset;
1010 1019
    /** options' type */
1011 1020
    int type;
1012
#define FF_OPT_TYPE_BOOL 1     // boolean - true,1,on  (or simply presence)
1013
#define FF_OPT_TYPE_DOUBLE 2   // double
1014
#define FF_OPT_TYPE_INT 3      // integer
1015
#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
1021
#define FF_OPT_TYPE_BOOL 1      ///< boolean - true,1,on  (or simply presence)
1022
#define FF_OPT_TYPE_DOUBLE 2    ///< double
1023
#define FF_OPT_TYPE_INT 3       ///< integer
1024
#define FF_OPT_TYPE_STRING 4    ///< string (finished with \0)
1025
#define FF_OPT_TYPE_MASK 0x1f	///< mask for types - upper bits are various flags
1017 1026
//#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option
1018 1027
#define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40)
1019 1028
#define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80)
......
1034 1043
#define FF_OPT_MAX_DEPTH 10
1035 1044
} AVOption;
1036 1045

  
1046
/**
1047
 * AVCodec.
1048
 */
1037 1049
typedef struct AVCodec {
1038 1050
    const char *name;
1039 1051
    int type;
......
1227 1239
 */
1228 1240

  
1229 1241
typedef struct {
1230
    // compressed size used from given memory buffer
1242
    /// compressed size used from given memory buffer
1231 1243
    int size;
1232 1244
    /// I/P/B frame type
1233 1245
    int frame_type;

Also available in: Unified diff