319
389
typedef struct RcOverride{
322
int qscale; // if this is 0 then quality_factor will be used instead
392
int qscale; // If this is 0 then quality_factor will be used instead.
323
393
float quality_factor;
326
396
#define FF_MAX_B_FRAMES 16
328
398
/* encoding support
329
these flags can be passed in AVCodecContext.flags before initing
330
Note: not everything is supported yet.
399
These flags can be passed in AVCodecContext.flags before initialization.
400
Note: Not everything is supported yet.
333
#define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
334
#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / Advanced prediction for H263
335
#define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC
336
#define CODEC_FLAG_GMC 0x0020 ///< use GMC
337
#define CODEC_FLAG_MV0 0x0040 ///< always try a MB with MV=<0,0>
338
#define CODEC_FLAG_PART 0x0080 ///< use data partitioning
339
/* parent program guarantees that the input for b-frame containing streams is not written to
340
for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */
403
#define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
404
#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
405
#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
406
#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
407
#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
408
#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
410
* The parent program guarantees that the input for B-frames containing
411
* streams is not written to for at least s->max_b_frames+1 frames, if
412
* this is not set the input will be copied.
341
414
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
342
#define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode
343
#define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
344
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
345
#define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
346
#define CODEC_FLAG_EMU_EDGE 0x4000///< don't draw edges
347
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
348
#define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
349
of only at frame boundaries */
350
#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization
351
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct
352
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< force low delay
353
#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan
354
#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization
355
#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe
356
#define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct)
415
#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
416
#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
417
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG).
418
#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
419
#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges.
420
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
421
#define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
422
location instead of only at frame boundaries. */
423
#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization.
424
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
425
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
426
#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
427
#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< Use trellis quantization.
428
#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
429
#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
357
430
/* Fx : Flag for h263+ extra options */
358
431
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
359
#define CODEC_FLAG_H263P_AIC 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction (remove this)
432
#define CODEC_FLAG_H263P_AIC 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction (remove this)
361
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction
362
#define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector
363
#define CODEC_FLAG_CBP_RD 0x04000000 ///< use rate distortion optimization for cbp
364
#define CODEC_FLAG_QP_RD 0x08000000 ///< use rate distortion optimization for qp selectioon
365
#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H263 Alternative inter vlc
434
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
435
#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
436
#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
437
#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
438
#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC
366
439
#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
367
440
#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
368
441
#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
369
442
#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
370
#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data
371
#define CODEC_FLAG_CLOSED_GOP ((int)0x80000000)
372
#define CODEC_FLAG2_FAST 0x00000001 ///< allow non spec compliant speedup tricks
373
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< strictly enforce GOP size
374
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< skip bitstream encoding
375
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< place global headers at every keyframe instead of in extradata
376
#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow b-frames to be used as references
377
#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for b-frames
443
#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
444
#define CODEC_FLAG_CLOSED_GOP 0x80000000
445
#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
446
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.
447
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
448
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
449
#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references.
450
#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames
378
451
#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
379
452
#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform
380
453
#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
381
454
#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
382
#define CODEC_FLAG2_BRDO 0x00000400 ///< b-frame rate-distortion optimization
383
#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< use MPEG-2 intra VLC table
384
#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< only do ME/MC (I frames -> ref, P frame -> ME+MC)
385
#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format
386
#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skiping
455
#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization
456
#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table.
457
#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC).
458
#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
459
#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
460
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
461
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
462
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
388
464
/* Unsupported options :
389
465
* Syntax Arithmetic coding (SAC)
470
546
#define FF_COMMON_FRAME \
472
548
* pointer to the picture planes.\
473
* this might be different from the first allocated byte\
549
* This might be different from the first allocated byte\
477
553
uint8_t *data[4];\
478
554
int linesize[4];\
480
* pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
481
* this isn't used by lavc unless the default get/release_buffer() is used\
556
* pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\
557
* This isn't used by libavcodec unless the default get/release_buffer() is used.\
485
561
uint8_t *base[4];\
487
563
* 1 -> keyframe, 0-> not\
488
* - encoding: set by lavc\
489
* - decoding: set by lavc\
564
* - encoding: Set by libavcodec.\
565
* - decoding: Set by libavcodec.\
494
* picture type of the frame, see ?_TYPE below.\
495
* - encoding: set by lavc for coded_picture (and set by user for input)\
496
* - decoding: set by lavc\
570
* Picture type of the frame, see ?_TYPE below.\
571
* - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
572
* - decoding: Set by libavcodec.\
501
577
* presentation timestamp in time_base units (time when frame should be shown to user)\
502
* if AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed\
503
* - encoding: MUST be set by user\
504
* - decoding: set by lavc\
578
* If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\
579
* - encoding: MUST be set by user.\
580
* - decoding: Set by libavcodec.\
509
* picture number in bitstream order.\
585
* picture number in bitstream order\
510
586
* - encoding: set by\
511
* - decoding: set by lavc\
587
* - decoding: Set by libavcodec.\
513
589
int coded_picture_number;\
515
* picture number in display order.\
591
* picture number in display order\
516
592
* - encoding: set by\
517
* - decoding: set by lavc\
593
* - decoding: Set by libavcodec.\
519
595
int display_picture_number;\
522
598
* quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
523
* - encoding: set by lavc for coded_picture (and set by user for input)\
524
* - decoding: set by lavc\
599
* - encoding: Set by libavcodec. for coded_picture (and set by user for input).\
600
* - decoding: Set by libavcodec.\
529
605
* buffer age (1->was last buffer and dint change, 2->..., ...).\
530
* set to INT_MAX if the buffer has not been used yet \
606
* Set to INT_MAX if the buffer has not been used yet.\
531
607
* - encoding: unused\
532
* - decoding: MUST be set by get_buffer()\
608
* - decoding: MUST be set by get_buffer().\
537
613
* is this picture used as reference\
614
* The values for this are the same as the MpegEncContext.picture_structure\
615
* variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
538
616
* - encoding: unused\
539
* - decoding: set by lavc (before get_buffer() call))\
617
* - decoding: Set by libavcodec. (before get_buffer() call)).\
545
623
* - encoding: unused\
546
* - decoding: set by lavc\
624
* - decoding: Set by libavcodec.\
548
626
int8_t *qscale_table;\
550
628
* QP store stride\
551
629
* - encoding: unused\
552
* - decoding: set by lavc\
630
* - decoding: Set by libavcodec.\
557
* mbskip_table[mb]>=1 if MB didnt change\
635
* mbskip_table[mb]>=1 if MB didn't change\
558
636
* stride= mb_width = (width+15)>>4\
559
637
* - encoding: unused\
560
* - decoding: set by lavc\
638
* - decoding: Set by libavcodec.\
562
640
uint8_t *mbskip_table;\
565
* Motion vector table.\
643
* motion vector table\
568
646
* int mv_sample_log2= 4 - motion_subsample_log2;\
989
1088
#define FF_BUG_EDGE 1024
990
1089
#define FF_BUG_HPEL_CHROMA 2048
991
1090
#define FF_BUG_DC_CLIP 4096
992
#define FF_BUG_MS 8192 ///< workaround various bugs in microsofts broken decoders
993
//#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
1091
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
1092
//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
996
* luma single coeff elimination threshold.
997
* - encoding: set by user
1095
* luma single coefficient elimination threshold
1096
* - encoding: Set by user.
998
1097
* - decoding: unused
1000
1099
int luma_elim_threshold;
1003
* chroma single coeff elimination threshold.
1004
* - encoding: set by user
1102
* chroma single coeff elimination threshold
1103
* - encoding: Set by user.
1005
1104
* - decoding: unused
1007
1106
int chroma_elim_threshold;
1010
* strictly follow the std (MPEG4, ...).
1011
* - encoding: set by user
1109
* strictly follow the standard (MPEG4, ...).
1110
* - encoding: Set by user.
1012
1111
* - decoding: unused
1014
1113
int strict_std_compliance;
1015
#define FF_COMPLIANCE_VERY_STRICT 2 ///< strictly conform to a older more strict version of the spec or reference software
1016
#define FF_COMPLIANCE_STRICT 1 ///< strictly conform to all the things in the spec no matter what consequences
1114
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to a older more strict version of the spec or reference software.
1115
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
1017
1116
#define FF_COMPLIANCE_NORMAL 0
1018
#define FF_COMPLIANCE_INOFFICIAL -1 ///< allow inofficial extensions
1019
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< allow non standarized experimental things
1117
#define FF_COMPLIANCE_INOFFICIAL -1 ///< Allow inofficial extensions.
1118
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
1022
* qscale offset between ip and b frames.
1023
* if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
1024
* if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
1025
* - encoding: set by user.
1121
* qscale offset between IP and B-frames
1122
* If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
1123
* If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
1124
* - encoding: Set by user.
1026
1125
* - decoding: unused
1028
1127
float b_quant_offset;
1031
* error resilience higher values will detect more errors but may missdetect
1032
* some more or less valid parts as errors.
1130
* Error resilience; higher values will detect more errors but may
1131
* misdetect some more or less valid parts as errors.
1033
1132
* - encoding: unused
1034
* - decoding: set by user
1133
* - decoding: Set by user.
1036
1135
int error_resilience;
1037
1136
#define FF_ER_CAREFUL 1
1040
1139
#define FF_ER_VERY_AGGRESSIVE 4
1043
* called at the beginning of each frame to get a buffer for it.
1044
* if pic.reference is set then the frame will be read later by lavc
1142
* Called at the beginning of each frame to get a buffer for it.
1143
* If pic.reference is set then the frame will be read later by libavcodec.
1045
1144
* avcodec_align_dimensions() should be used to find the required width and
1046
* height, as they normally need to be rounded up to the next multiple of 16
1145
* height, as they normally need to be rounded up to the next multiple of 16.
1047
1146
* - encoding: unused
1048
* - decoding: set by lavc, user can override
1147
* - decoding: Set by libavcodec., user can override.
1050
1149
int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
1053
* called to release buffers which where allocated with get_buffer.
1054
* a released buffer can be reused in get_buffer()
1055
* pic.data[*] must be set to NULL
1152
* Called to release buffers which were allocated with get_buffer.
1153
* A released buffer can be reused in get_buffer().
1154
* pic.data[*] must be set to NULL.
1056
1155
* - encoding: unused
1057
* - decoding: set by lavc, user can override
1156
* - decoding: Set by libavcodec., user can override.
1059
1158
void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
1062
* if 1 the stream has a 1 frame delay during decoding.
1063
* - encoding: set by lavc
1064
* - decoding: set by lavc
1161
* If 1 the stream has a 1 frame delay during decoding.
1162
* - encoding: Set by libavcodec.
1163
* - decoding: Set by libavcodec.
1066
1165
int has_b_frames;
1069
1168
* number of bytes per packet if constant and known or 0
1070
* used by some WAV based audio codecs
1169
* Used by some WAV based audio codecs.
1072
1171
int block_align;
1074
int parse_only; /* - decoding only: if true, only parsing is done
1173
int parse_only; /* - decoding only: If true, only parsing is done
1075
1174
(function avcodec_parse_frame()). The frame
1076
1175
data is returned. Only MPEG codecs support this now. */
1079
* 0-> h263 quant 1-> mpeg quant.
1080
* - encoding: set by user.
1178
* 0-> h263 quant 1-> mpeg quant
1179
* - encoding: Set by user.
1081
1180
* - decoding: unused
1083
1182
int mpeg_quant;
1086
* pass1 encoding statistics output buffer.
1087
* - encoding: set by lavc
1185
* pass1 encoding statistics output buffer
1186
* - encoding: Set by libavcodec.
1088
1187
* - decoding: unused
1090
1189
char *stats_out;
1093
* pass2 encoding statistics input buffer.
1094
* concatenated stuff from stats_out of pass1 should be placed here
1095
* - encoding: allocated/set/freed by user
1192
* pass2 encoding statistics input buffer
1193
* Concatenated stuff from stats_out of pass1 should be placed here.
1194
* - encoding: Allocated/set/freed by user.
1096
1195
* - decoding: unused
1098
1197
char *stats_in;
1101
* ratecontrol qmin qmax limiting method.
1102
* 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax
1103
* - encoding: set by user.
1200
* ratecontrol qmin qmax limiting method
1201
* 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
1202
* - encoding: Set by user.
1104
1203
* - decoding: unused
1106
1205
float rc_qsquish;
1183
1282
#define FF_DCT_FAAN 6
1186
* luminance masking (0-> disabled).
1187
* - encoding: set by user
1285
* luminance masking (0-> disabled)
1286
* - encoding: Set by user.
1188
1287
* - decoding: unused
1190
1289
float lumi_masking;
1193
* temporary complexity masking (0-> disabled).
1194
* - encoding: set by user
1292
* temporary complexity masking (0-> disabled)
1293
* - encoding: Set by user.
1195
1294
* - decoding: unused
1197
1296
float temporal_cplx_masking;
1200
* spatial complexity masking (0-> disabled).
1201
* - encoding: set by user
1299
* spatial complexity masking (0-> disabled)
1300
* - encoding: Set by user.
1202
1301
* - decoding: unused
1204
1303
float spatial_cplx_masking;
1207
* p block masking (0-> disabled).
1208
* - encoding: set by user
1306
* p block masking (0-> disabled)
1307
* - encoding: Set by user.
1209
1308
* - decoding: unused
1211
1310
float p_masking;
1214
* darkness masking (0-> disabled).
1215
* - encoding: set by user
1313
* darkness masking (0-> disabled)
1314
* - encoding: Set by user.
1216
1315
* - decoding: unused
1218
1317
float dark_masking;
1320
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
1221
1321
/* for binary compatibility */
1225
* idct algorithm, see FF_IDCT_* below.
1226
* - encoding: set by user
1227
* - decoding: set by user
1326
* IDCT algorithm, see FF_IDCT_* below.
1327
* - encoding: Set by user.
1328
* - decoding: Set by user.
1230
#define FF_IDCT_AUTO 0
1231
#define FF_IDCT_INT 1
1232
#define FF_IDCT_SIMPLE 2
1233
#define FF_IDCT_SIMPLEMMX 3
1234
#define FF_IDCT_LIBMPEG2MMX 4
1235
#define FF_IDCT_PS2 5
1236
#define FF_IDCT_MLIB 6
1237
#define FF_IDCT_ARM 7
1238
#define FF_IDCT_ALTIVEC 8
1239
#define FF_IDCT_SH4 9
1240
#define FF_IDCT_SIMPLEARM 10
1241
#define FF_IDCT_H264 11
1242
#define FF_IDCT_VP3 12
1243
#define FF_IDCT_IPP 13
1244
#define FF_IDCT_XVIDMMX 14
1245
#define FF_IDCT_CAVS 15
1331
#define FF_IDCT_AUTO 0
1332
#define FF_IDCT_INT 1
1333
#define FF_IDCT_SIMPLE 2
1334
#define FF_IDCT_SIMPLEMMX 3
1335
#define FF_IDCT_LIBMPEG2MMX 4
1336
#define FF_IDCT_PS2 5
1337
#define FF_IDCT_MLIB 6
1338
#define FF_IDCT_ARM 7
1339
#define FF_IDCT_ALTIVEC 8
1340
#define FF_IDCT_SH4 9
1341
#define FF_IDCT_SIMPLEARM 10
1342
#define FF_IDCT_H264 11
1343
#define FF_IDCT_VP3 12
1344
#define FF_IDCT_IPP 13
1345
#define FF_IDCT_XVIDMMX 14
1346
#define FF_IDCT_CAVS 15
1246
1347
#define FF_IDCT_SIMPLEARMV5TE 16
1247
#define FF_IDCT_SIMPLEARMV6 17
1348
#define FF_IDCT_SIMPLEARMV6 17
1349
#define FF_IDCT_SIMPLEVIS 18
1350
#define FF_IDCT_WMV2 19
1351
#define FF_IDCT_FAAN 20
1251
* - encoding: set by lavc
1252
* - decoding: set by user (or 0)
1355
* - encoding: Set by libavcodec.
1356
* - decoding: Set by user (or 0).
1254
1358
int slice_count;
1256
* slice offsets in the frame in bytes.
1257
* - encoding: set/allocated by lavc
1258
* - decoding: set/allocated by user (or NULL)
1360
* slice offsets in the frame in bytes
1361
* - encoding: Set/allocated by libavcodec.
1362
* - decoding: Set/allocated by user (or NULL).
1260
1364
int *slice_offset;
1263
* error concealment flags.
1367
* error concealment flags
1264
1368
* - encoding: unused
1265
* - decoding: set by user
1369
* - decoding: Set by user.
1267
1371
int error_concealment;
1268
1372
#define FF_EC_GUESS_MVS 1
1309
1411
#define FF_PRED_MEDIAN 2
1312
* sample aspect ratio (0 if unknown).
1313
* numerator and denominator must be relative prime and smaller then 256 for some video standards
1314
* - encoding: set by user.
1315
* - decoding: set by lavc.
1414
* sample aspect ratio (0 if unknown)
1415
* Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
1416
* - encoding: Set by user.
1417
* - decoding: Set by libavcodec.
1317
1419
AVRational sample_aspect_ratio;
1320
* the picture in the bitstream.
1321
* - encoding: set by lavc
1322
* - decoding: set by lavc
1422
* the picture in the bitstream
1423
* - encoding: Set by libavcodec.
1424
* - decoding: Set by libavcodec.
1324
1426
AVFrame *coded_frame;
1328
* - encoding: set by user.
1329
* - decoding: set by user.
1430
* - encoding: Set by user.
1431
* - decoding: Set by user.
1332
#define FF_DEBUG_PICT_INFO 1
1333
#define FF_DEBUG_RC 2
1334
#define FF_DEBUG_BITSTREAM 4
1335
#define FF_DEBUG_MB_TYPE 8
1336
#define FF_DEBUG_QP 16
1337
#define FF_DEBUG_MV 32
1338
#define FF_DEBUG_DCT_COEFF 0x00000040
1339
#define FF_DEBUG_SKIP 0x00000080
1340
#define FF_DEBUG_STARTCODE 0x00000100
1341
#define FF_DEBUG_PTS 0x00000200
1342
#define FF_DEBUG_ER 0x00000400
1343
#define FF_DEBUG_MMCO 0x00000800
1344
#define FF_DEBUG_BUGS 0x00001000
1345
#define FF_DEBUG_VIS_QP 0x00002000
1434
#define FF_DEBUG_PICT_INFO 1
1435
#define FF_DEBUG_RC 2
1436
#define FF_DEBUG_BITSTREAM 4
1437
#define FF_DEBUG_MB_TYPE 8
1438
#define FF_DEBUG_QP 16
1439
#define FF_DEBUG_MV 32
1440
#define FF_DEBUG_DCT_COEFF 0x00000040
1441
#define FF_DEBUG_SKIP 0x00000080
1442
#define FF_DEBUG_STARTCODE 0x00000100
1443
#define FF_DEBUG_PTS 0x00000200
1444
#define FF_DEBUG_ER 0x00000400
1445
#define FF_DEBUG_MMCO 0x00000800
1446
#define FF_DEBUG_BUGS 0x00001000
1447
#define FF_DEBUG_VIS_QP 0x00002000
1346
1448
#define FF_DEBUG_VIS_MB_TYPE 0x00004000
1350
* - encoding: set by user.
1351
* - decoding: set by user.
1452
* - encoding: Set by user.
1453
* - decoding: Set by user.
1354
1456
#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
1356
1458
#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
1360
* - encoding: set by lavc if flags&CODEC_FLAG_PSNR
1462
* - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
1361
1463
* - decoding: unused
1363
1465
uint64_t error[4];
1366
* minimum MB quantizer.
1468
* minimum MB quantizer
1367
1469
* - encoding: unused
1368
1470
* - decoding: unused
1373
* maximum MB quantizer.
1475
* maximum MB quantizer
1374
1476
* - encoding: unused
1375
1477
* - decoding: unused
1380
* motion estimation compare function.
1381
* - encoding: set by user.
1482
* motion estimation comparison function
1483
* - encoding: Set by user.
1382
1484
* - decoding: unused
1386
* subpixel motion estimation compare function.
1387
* - encoding: set by user.
1488
* subpixel motion estimation comparison function
1489
* - encoding: Set by user.
1388
1490
* - decoding: unused
1390
1492
int me_sub_cmp;
1392
* macroblock compare function (not supported yet).
1393
* - encoding: set by user.
1494
* macroblock comparison function (not supported yet)
1495
* - encoding: Set by user.
1394
1496
* - decoding: unused
1398
* interlaced dct compare function
1399
* - encoding: set by user.
1500
* interlaced DCT comparison function
1501
* - encoding: Set by user.
1400
1502
* - decoding: unused
1403
#define FF_CMP_SAD 0
1404
#define FF_CMP_SSE 1
1405
#define FF_CMP_SATD 2
1406
#define FF_CMP_DCT 3
1407
#define FF_CMP_PSNR 4
1408
#define FF_CMP_BIT 5
1410
#define FF_CMP_ZERO 7
1411
#define FF_CMP_VSAD 8
1412
#define FF_CMP_VSSE 9
1413
#define FF_CMP_NSSE 10
1414
#define FF_CMP_W53 11
1415
#define FF_CMP_W97 12
1505
#define FF_CMP_SAD 0
1506
#define FF_CMP_SSE 1
1507
#define FF_CMP_SATD 2
1508
#define FF_CMP_DCT 3
1509
#define FF_CMP_PSNR 4
1510
#define FF_CMP_BIT 5
1512
#define FF_CMP_ZERO 7
1513
#define FF_CMP_VSAD 8
1514
#define FF_CMP_VSSE 9
1515
#define FF_CMP_NSSE 10
1516
#define FF_CMP_W53 11
1517
#define FF_CMP_W97 12
1416
1518
#define FF_CMP_DCTMAX 13
1417
1519
#define FF_CMP_DCT264 14
1418
1520
#define FF_CMP_CHROMA 256
1421
* ME diamond size & shape.
1422
* - encoding: set by user.
1523
* ME diamond size & shape
1524
* - encoding: Set by user.
1423
1525
* - decoding: unused
1428
* amount of previous MV predictors (2a+1 x 2a+1 square).
1429
* - encoding: set by user.
1530
* amount of previous MV predictors (2a+1 x 2a+1 square)
1531
* - encoding: Set by user.
1430
1532
* - decoding: unused
1432
1534
int last_predictor_count;
1435
* pre pass for motion estimation.
1436
* - encoding: set by user.
1537
* prepass for motion estimation
1538
* - encoding: Set by user.
1437
1539
* - decoding: unused
1442
* motion estimation pre pass compare function.
1443
* - encoding: set by user.
1544
* motion estimation prepass comparison function
1545
* - encoding: Set by user.
1444
1546
* - decoding: unused
1446
1548
int me_pre_cmp;
1449
* ME pre pass diamond size & shape.
1450
* - encoding: set by user.
1551
* ME prepass diamond size & shape
1552
* - encoding: Set by user.
1451
1553
* - decoding: unused
1453
1555
int pre_dia_size;
1456
* subpel ME quality.
1457
* - encoding: set by user.
1559
* - encoding: Set by user.
1458
1560
* - decoding: unused
1460
1562
int me_subpel_quality;
1463
* callback to negotiate the pixelFormat.
1565
* callback to negotiate the pixelFormat
1464
1566
* @param fmt is the list of formats which are supported by the codec,
1465
* its terminated by -1 as 0 is a valid format, the formats are ordered by quality
1466
* the first is allways the native one
1467
* @return the choosen format
1567
* it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
1568
* The first is always the native one.
1569
* @return the chosen format
1468
1570
* - encoding: unused
1469
* - decoding: set by user, if not set then the native format will always be choosen
1571
* - decoding: Set by user, if not set the native format will be chosen.
1471
1573
enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
1474
* DTG active format information (additionnal aspect ratio
1475
* information only used in DVB MPEG2 transport streams). 0 if
1576
* DTG active format information (additional aspect ratio
1577
* information only used in DVB MPEG-2 transport streams)
1478
* - encoding: unused.
1479
* - decoding: set by decoder
1580
* - encoding: unused
1581
* - decoding: Set by decoder.
1481
1583
int dtg_active_format;
1482
1584
#define FF_DTG_AFD_SAME 8
1590
1695
* macroblock decision mode
1591
* - encoding: set by user.
1696
* - encoding: Set by user.
1592
1697
* - decoding: unused
1594
1699
int mb_decision;
1595
1700
#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
1596
1701
#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
1597
#define FF_MB_DECISION_RD 2 ///< rate distoration
1702
#define FF_MB_DECISION_RD 2 ///< rate distortion
1600
1705
* custom intra quantization matrix
1601
* - encoding: set by user, can be NULL
1602
* - decoding: set by lavc
1706
* - encoding: Set by user, can be NULL.
1707
* - decoding: Set by libavcodec.
1604
1709
uint16_t *intra_matrix;
1607
1712
* custom inter quantization matrix
1608
* - encoding: set by user, can be NULL
1609
* - decoding: set by lavc
1713
* - encoding: Set by user, can be NULL.
1714
* - decoding: Set by libavcodec.
1611
1716
uint16_t *inter_matrix;
1614
1719
* fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
1615
* this is used to workaround some encoder bugs
1720
* This is used to work around some encoder bugs.
1616
1721
* - encoding: unused
1617
* - decoding: set by user, will be converted to upper case by lavc during init
1722
* - decoding: Set by user, will be converted to uppercase by libavcodec during init.
1619
1724
unsigned int stream_codec_tag;
1622
* scene change detection threshold.
1623
* 0 is default, larger means fewer detected scene changes
1624
* - encoding: set by user.
1727
* scene change detection threshold
1728
* 0 is default, larger means fewer detected scene changes.
1729
* - encoding: Set by user.
1625
1730
* - decoding: unused
1627
1732
int scenechange_threshold;
1630
* minimum lagrange multipler
1631
* - encoding: set by user.
1735
* minimum Lagrange multipler
1736
* - encoding: Set by user.
1632
1737
* - decoding: unused
1637
* maximum lagrange multipler
1638
* - encoding: set by user.
1742
* maximum Lagrange multipler
1743
* - encoding: Set by user.
1639
1744
* - decoding: unused
1644
* Palette control structure
1749
* palette control structure
1645
1750
* - encoding: ??? (no palette-enabled encoder yet)
1646
* - decoding: set by user.
1751
* - decoding: Set by user.
1648
1753
struct AVPaletteControl *palctrl;
1651
1756
* noise reduction strength
1652
* - encoding: set by user.
1757
* - encoding: Set by user.
1653
1758
* - decoding: unused
1655
1760
int noise_reduction;
1658
* called at the beginning of a frame to get cr buffer for it.
1659
* buffer type (size, hints) must be the same. lavc won't check it.
1660
* lavc will pass previous buffer in pic, function should return
1763
* Called at the beginning of a frame to get cr buffer for it.
1764
* Buffer type (size, hints) must be the same. libavcodec won't check it.
1765
* libavcodec will pass previous buffer in pic, function should return
1661
1766
* same buffer or new buffer with old frame "painted" into it.
1662
* if pic.data[0] == NULL must behave like get_buffer().
1767
* If pic.data[0] == NULL must behave like get_buffer().
1663
1768
* - encoding: unused
1664
* - decoding: set by lavc, user can override
1769
* - decoding: Set by libavcodec., user can override
1666
1771
int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
1669
* number of bits which should be loaded into the rc buffer before decoding starts
1670
* - encoding: set by user.
1774
* Number of bits which should be loaded into the rc buffer before decoding starts.
1775
* - encoding: Set by user.
1671
1776
* - decoding: unused
1673
1778
int rc_initial_buffer_occupancy;
1677
* - encoding: set by user.
1782
* - encoding: Set by user.
1678
1783
* - decoding: unused
1680
1785
int inter_threshold;
1684
* - encoding: set by user.
1685
* - decoding: set by user.
1789
* - encoding: Set by user.
1790
* - decoding: Set by user.
1690
* simulates errors in the bitstream to test error concealment.
1691
* - encoding: set by user.
1692
* - decoding: unused.
1795
* Simulates errors in the bitstream to test error concealment.
1796
* - encoding: Set by user.
1797
* - decoding: unused
1694
1799
int error_rate;
1697
1802
* MP3 antialias algorithm, see FF_AA_* below.
1698
1803
* - encoding: unused
1699
* - decoding: set by user
1804
* - decoding: Set by user.
1701
1806
int antialias_algo;
1702
1807
#define FF_AA_AUTO 0
1704
1809
#define FF_AA_INT 2
1705
1810
#define FF_AA_FLOAT 3
1707
* Quantizer noise shaping.
1708
* - encoding: set by user
1812
* quantizer noise shaping
1813
* - encoding: Set by user.
1709
1814
* - decoding: unused
1711
1816
int quantizer_noise_shaping;
1715
1820
* is used to decide how many independent tasks should be passed to execute()
1716
* - encoding: set by user
1717
* - decoding: set by user
1821
* - encoding: Set by user.
1822
* - decoding: Set by user.
1719
1824
int thread_count;
1722
* the codec may call this to execute several independent things. it will return only after
1723
* finishing all tasks, the user may replace this with some multithreaded implementation, the
1724
* default implementation will execute the parts serially
1827
* The codec may call this to execute several independent things.
1828
* It will return only after finishing all tasks.
1829
* The user may replace this with some multithreaded implementation,
1830
* the default implementation will execute the parts serially.
1725
1831
* @param count the number of things to execute
1726
* - encoding: set by lavc, user can override
1727
* - decoding: set by lavc, user can override
1832
* - encoding: Set by libavcodec, user can override.
1833
* - decoding: Set by libavcodec, user can override.
1729
1835
int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
1733
* can be used by execute() to store some per AVCodecContext stuff.
1839
* Can be used by execute() to store some per AVCodecContext stuff.
1734
1840
* - encoding: set by execute()
1735
1841
* - decoding: set by execute()
1737
1843
void *thread_opaque;
1740
* Motion estimation threshold. under which no motion estimation is
1741
* performed, but instead the user specified motion vectors are used
1846
* Motion estimation threshold below which no motion estimation is
1847
* performed, but instead the user specified motion vectors are used.
1743
* - encoding: set by user
1849
* - encoding: Set by user.
1744
1850
* - decoding: unused
1746
1852
int me_threshold;
1749
* Macroblock threshold. under which the user specified macroblock types will be used
1750
* - encoding: set by user
1855
* Macroblock threshold below which the user specified macroblock types will be used.
1856
* - encoding: Set by user.
1751
1857
* - decoding: unused
1753
1859
int mb_threshold;
1756
* precision of the intra dc coefficient - 8.
1757
* - encoding: set by user
1862
* precision of the intra DC coefficient - 8
1863
* - encoding: Set by user.
1758
1864
* - decoding: unused
1760
1866
int intra_dc_precision;
1763
* noise vs. sse weight for the nsse comparsion function.
1764
* - encoding: set by user
1869
* noise vs. sse weight for the nsse comparsion function
1870
* - encoding: Set by user.
1765
1871
* - decoding: unused
1767
1873
int nsse_weight;
1770
* number of macroblock rows at the top which are skipped.
1876
* Number of macroblock rows at the top which are skipped.
1771
1877
* - encoding: unused
1772
* - decoding: set by user
1878
* - decoding: Set by user.
1777
* number of macroblock rows at the bottom which are skipped.
1883
* Number of macroblock rows at the bottom which are skipped.
1778
1884
* - encoding: unused
1779
* - decoding: set by user
1885
* - decoding: Set by user.
1781
1887
int skip_bottom;
1785
* - encoding: set by user
1786
* - decoding: set by lavc
1891
* - encoding: Set by user.
1892
* - decoding: Set by libavcodec.
1789
1895
#define FF_PROFILE_UNKNOWN -99
1896
#define FF_PROFILE_AAC_MAIN 0
1897
#define FF_PROFILE_AAC_LOW 1
1898
#define FF_PROFILE_AAC_SSR 2
1899
#define FF_PROFILE_AAC_LTP 3
1793
* - encoding: set by user
1794
* - decoding: set by lavc
1903
* - encoding: Set by user.
1904
* - decoding: Set by libavcodec.
1797
1907
#define FF_LEVEL_UNKNOWN -99
1800
* low resolution decoding. 1-> 1/2 size, 2->1/4 size
1910
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
1801
1911
* - encoding: unused
1802
* - decoding: set by user
1912
* - decoding: Set by user.
1807
* bitsream width / height. may be different from width/height if lowres
1808
* or other things are used
1917
* Bitstream width / height, may be different from width/height if lowres
1918
* or other things are used.
1809
1919
* - encoding: unused
1810
* - decoding: set by user before init if known, codec should override / dynamically change if needed
1920
* - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
1812
1922
int coded_width, coded_height;
1815
1925
* frame skip threshold
1816
* - encoding: set by user
1926
* - encoding: Set by user.
1817
1927
* - decoding: unused
1819
1929
int frame_skip_threshold;
1822
1932
* frame skip factor
1823
* - encoding: set by user
1933
* - encoding: Set by user.
1824
1934
* - decoding: unused
1826
1936
int frame_skip_factor;
1829
1939
* frame skip exponent
1830
* - encoding: set by user
1940
* - encoding: Set by user.
1831
1941
* - decoding: unused
1833
1943
int frame_skip_exp;
1836
* frame skip comparission function
1837
* - encoding: set by user.
1946
* frame skip comparison function
1947
* - encoding: Set by user.
1838
1948
* - decoding: unused
1840
1950
int frame_skip_cmp;
1843
* border processing masking. raises the quantizer for mbs on the borders
1953
* Border processing masking, raises the quantizer for mbs on the borders
1844
1954
* of the picture.
1845
* - encoding: set by user
1955
* - encoding: Set by user.
1846
1956
* - decoding: unused
1848
1958
float border_masking;
1851
* minimum MB lagrange multipler.
1852
* - encoding: set by user.
1961
* minimum MB lagrange multipler
1962
* - encoding: Set by user.
1853
1963
* - decoding: unused
1858
* maximum MB lagrange multipler.
1859
* - encoding: set by user.
1968
* maximum MB lagrange multipler
1969
* - encoding: Set by user.
1860
1970
* - decoding: unused
1866
* - encoding: set by user.
1976
* - encoding: Set by user.
1867
1977
* - decoding: unused
1869
1979
int me_penalty_compensation;
1971
2081
* in-loop deblocking filter beta parameter
1972
2082
* beta is in the range -6...6
1973
* - encoding: set by user.
2083
* - encoding: Set by user.
1974
2084
* - decoding: unused
1976
2086
int deblockbeta;
1979
2089
* macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
1980
* - encoding: set by user.
2090
* - encoding: Set by user.
1981
2091
* - decoding: unused
1983
2093
int partitions;
1984
#define X264_PART_I4X4 0x001 /* Analyse i4x4 */
1985
#define X264_PART_I8X8 0x002 /* Analyse i8x8 (requires 8x8 transform) */
1986
#define X264_PART_P8X8 0x010 /* Analyse p16x8, p8x16 and p8x8 */
1987
#define X264_PART_P4X4 0x020 /* Analyse p8x4, p4x8, p4x4 */
1988
#define X264_PART_B8X8 0x100 /* Analyse b16x8, b8x16 and b8x8 */
2094
#define X264_PART_I4X4 0x001 /* Analyze i4x4 */
2095
#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */
2096
#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */
2097
#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */
2098
#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */
1991
* direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal)
1992
* - encoding: set by user.
2101
* direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal)
2102
* - encoding: Set by user.
1993
2103
* - decoding: unused
1995
2105
int directpred;
1998
* audio cutoff bandwidth (0 means "automatic") . Currently used only by FAAC
1999
* - encoding: set by user.
2108
* Audio cutoff bandwidth (0 means "automatic")
2109
* - encoding: Set by user.
2000
2110
* - decoding: unused
2005
* multiplied by qscale for each frame and added to scene_change_score
2006
* - encoding: set by user.
2115
* Multiplied by qscale for each frame and added to scene_change_score.
2116
* - encoding: Set by user.
2007
2117
* - decoding: unused
2009
2119
int scenechange_factor;
2013
* note: value depends upon the compare functin used for fullpel ME
2014
* - encoding: set by user.
2123
* Note: Value depends upon the compare function used for fullpel ME.
2124
* - encoding: Set by user.
2015
2125
* - decoding: unused
2017
2127
int mv0_threshold;
2020
* adjusts sensitivity of b_frame_strategy 1
2021
* - encoding: set by user.
2130
* Adjusts sensitivity of b_frame_strategy 1.
2131
* - encoding: Set by user.
2022
2132
* - decoding: unused
2024
2134
int b_sensitivity;
2027
* - encoding: set by user.
2137
* - encoding: Set by user.
2028
2138
* - decoding: unused
2030
2140
int compression_level;
2031
2141
#define FF_COMPRESSION_DEFAULT -1
2034
* sets whether to use LPC mode - used by FLAC encoder
2035
* - encoding: set by user.
2036
* - decoding: unused.
2144
* Sets whether to use LPC mode - used by FLAC encoder.
2145
* - encoding: Set by user.
2146
* - decoding: unused
2041
2151
* LPC coefficient precision - used by FLAC encoder
2042
* - encoding: set by user.
2043
* - decoding: unused.
2152
* - encoding: Set by user.
2153
* - decoding: unused
2045
2155
int lpc_coeff_precision;
2048
* - encoding: set by user.
2049
* - decoding: unused.
2158
* - encoding: Set by user.
2159
* - decoding: unused
2051
2161
int min_prediction_order;
2054
* - encoding: set by user.
2055
* - decoding: unused.
2164
* - encoding: Set by user.
2165
* - decoding: unused
2057
2167
int max_prediction_order;
2060
2170
* search method for selecting prediction order
2061
* - encoding: set by user.
2062
* - decoding: unused.
2171
* - encoding: Set by user.
2172
* - decoding: unused
2064
2174
int prediction_order_method;
2067
* - encoding: set by user.
2068
* - decoding: unused.
2177
* - encoding: Set by user.
2178
* - decoding: unused
2070
2180
int min_partition_order;
2073
* - encoding: set by user.
2074
* - decoding: unused.
2183
* - encoding: Set by user.
2184
* - decoding: unused
2076
2186
int max_partition_order;
2079
2189
* GOP timecode frame start number, in non drop frame format
2080
* - encoding: set by user.
2081
* - decoding: unused.
2190
* - encoding: Set by user.
2191
* - decoding: unused
2083
2193
int64_t timecode_frame_start;
2196
* Decoder should decode to this many channels if it can (0 for default)
2197
* - encoding: unused
2198
* - decoding: Set by user.
2200
int request_channels;
2203
* Percentage of dynamic range compression to be applied by the decoder.
2204
* The default value is 1.0, corresponding to full compression.
2205
* - encoding: unused
2206
* - decoding: Set by user.
2084
2209
} AVCodecContext;
2089
2214
typedef struct AVCodec {
2216
* Name of the codec implementation.
2217
* The name is globally unique among encoders and among decoders (but an
2218
* encoder and a decoder can share the same name).
2219
* This is the primary way to find a codec from the user perspective.
2090
2221
const char *name;
2091
2222
enum CodecType type;
2092
2223
enum CodecID id;
2153
2296
AVSubtitleRect *rects;
2156
extern AVCodec ac3_encoder;
2157
extern AVCodec amr_nb_encoder;
2158
extern AVCodec amr_wb_encoder;
2159
extern AVCodec asv1_encoder;
2160
extern AVCodec asv2_encoder;
2161
extern AVCodec bmp_encoder;
2162
extern AVCodec dvvideo_encoder;
2163
extern AVCodec faac_encoder;
2164
extern AVCodec ffv1_encoder;
2165
extern AVCodec ffvhuff_encoder;
2166
extern AVCodec flac_encoder;
2167
extern AVCodec flashsv_encoder;
2168
extern AVCodec flv_encoder;
2169
extern AVCodec gif_encoder;
2170
extern AVCodec h261_encoder;
2171
extern AVCodec h263_encoder;
2172
extern AVCodec h263p_encoder;
2173
extern AVCodec h264_encoder;
2174
extern AVCodec huffyuv_encoder;
2175
extern AVCodec jpegls_encoder;
2176
extern AVCodec libgsm_encoder;
2177
extern AVCodec libgsm_ms_encoder;
2178
extern AVCodec libtheora_encoder;
2179
extern AVCodec ljpeg_encoder;
2180
extern AVCodec mdec_encoder;
2181
extern AVCodec mjpeg_encoder;
2182
extern AVCodec mp2_encoder;
2183
extern AVCodec mp3lame_encoder;
2184
extern AVCodec mpeg1video_encoder;
2185
extern AVCodec mpeg2video_encoder;
2186
extern AVCodec mpeg4_encoder;
2187
extern AVCodec msmpeg4v1_encoder;
2188
extern AVCodec msmpeg4v2_encoder;
2189
extern AVCodec msmpeg4v3_encoder;
2190
extern AVCodec oggvorbis_encoder;
2191
extern AVCodec pam_encoder;
2192
extern AVCodec pbm_encoder;
2193
extern AVCodec pgm_encoder;
2194
extern AVCodec pgmyuv_encoder;
2195
extern AVCodec png_encoder;
2196
extern AVCodec ppm_encoder;
2197
extern AVCodec rv10_encoder;
2198
extern AVCodec rv20_encoder;
2199
extern AVCodec snow_encoder;
2200
extern AVCodec sonic_encoder;
2201
extern AVCodec sonic_ls_encoder;
2202
extern AVCodec svq1_encoder;
2203
extern AVCodec vcr1_encoder;
2204
extern AVCodec vorbis_encoder;
2205
extern AVCodec wmav1_encoder;
2206
extern AVCodec wmav2_encoder;
2207
extern AVCodec wmv1_encoder;
2208
extern AVCodec wmv2_encoder;
2209
extern AVCodec x264_encoder;
2210
extern AVCodec xvid_encoder;
2211
extern AVCodec zlib_encoder;
2212
extern AVCodec zmbv_encoder;
2214
extern AVCodec aac_decoder;
2215
extern AVCodec aasc_decoder;
2216
extern AVCodec alac_decoder;
2217
extern AVCodec amr_nb_decoder;
2218
extern AVCodec amr_wb_decoder;
2219
extern AVCodec asv1_decoder;
2220
extern AVCodec asv2_decoder;
2221
extern AVCodec avs_decoder;
2222
extern AVCodec bmp_decoder;
2223
extern AVCodec cavs_decoder;
2224
extern AVCodec cinepak_decoder;
2225
extern AVCodec cljr_decoder;
2226
extern AVCodec cook_decoder;
2227
extern AVCodec cscd_decoder;
2228
extern AVCodec cyuv_decoder;
2229
extern AVCodec dca_decoder;
2230
extern AVCodec dsicinaudio_decoder;
2231
extern AVCodec dsicinvideo_decoder;
2232
extern AVCodec dvvideo_decoder;
2233
extern AVCodec eightbps_decoder;
2234
extern AVCodec ffv1_decoder;
2235
extern AVCodec ffvhuff_decoder;
2236
extern AVCodec flac_decoder;
2237
extern AVCodec flashsv_decoder;
2238
extern AVCodec flic_decoder;
2239
extern AVCodec flv_decoder;
2240
extern AVCodec fourxm_decoder;
2241
extern AVCodec fraps_decoder;
2242
extern AVCodec gif_decoder;
2243
extern AVCodec h261_decoder;
2244
extern AVCodec h263_decoder;
2245
extern AVCodec h263i_decoder;
2246
extern AVCodec h264_decoder;
2247
extern AVCodec huffyuv_decoder;
2248
extern AVCodec idcin_decoder;
2249
extern AVCodec imc_decoder;
2250
extern AVCodec indeo2_decoder;
2251
extern AVCodec indeo3_decoder;
2252
extern AVCodec interplay_dpcm_decoder;
2253
extern AVCodec interplay_video_decoder;
2254
extern AVCodec kmvc_decoder;
2255
extern AVCodec libgsm_decoder;
2256
extern AVCodec libgsm_ms_decoder;
2257
extern AVCodec loco_decoder;
2258
extern AVCodec mace3_decoder;
2259
extern AVCodec mace6_decoder;
2260
extern AVCodec mdec_decoder;
2261
extern AVCodec mjpeg_decoder;
2262
extern AVCodec mjpegb_decoder;
2263
extern AVCodec mmvideo_decoder;
2264
extern AVCodec mp2_decoder;
2265
extern AVCodec mp3_decoder;
2266
extern AVCodec mp3adu_decoder;
2267
extern AVCodec mp3on4_decoder;
2268
extern AVCodec mpc7_decoder;
2269
extern AVCodec mpeg1video_decoder;
2270
extern AVCodec mpeg2video_decoder;
2271
extern AVCodec mpeg4_decoder;
2272
extern AVCodec mpeg4aac_decoder;
2273
extern AVCodec mpeg_xvmc_decoder;
2274
extern AVCodec mpegvideo_decoder;
2275
extern AVCodec msmpeg4v1_decoder;
2276
extern AVCodec msmpeg4v2_decoder;
2277
extern AVCodec msmpeg4v3_decoder;
2278
extern AVCodec msrle_decoder;
2279
extern AVCodec msvideo1_decoder;
2280
extern AVCodec mszh_decoder;
2281
extern AVCodec nuv_decoder;
2282
extern AVCodec oggvorbis_decoder;
2283
extern AVCodec png_decoder;
2284
extern AVCodec qdm2_decoder;
2285
extern AVCodec qdraw_decoder;
2286
extern AVCodec qpeg_decoder;
2287
extern AVCodec qtrle_decoder;
2288
extern AVCodec ra_144_decoder;
2289
extern AVCodec ra_288_decoder;
2290
extern AVCodec roq_decoder;
2291
extern AVCodec roq_dpcm_decoder;
2292
extern AVCodec rpza_decoder;
2293
extern AVCodec rv10_decoder;
2294
extern AVCodec rv20_decoder;
2295
extern AVCodec rv30_decoder;
2296
extern AVCodec rv40_decoder;
2297
extern AVCodec shorten_decoder;
2298
extern AVCodec smackaud_decoder;
2299
extern AVCodec smacker_decoder;
2300
extern AVCodec smc_decoder;
2301
extern AVCodec snow_decoder;
2302
extern AVCodec sol_dpcm_decoder;
2303
extern AVCodec sonic_decoder;
2304
extern AVCodec sp5x_decoder;
2305
extern AVCodec svq1_decoder;
2306
extern AVCodec svq3_decoder;
2307
extern AVCodec targa_decoder;
2308
extern AVCodec theora_decoder;
2309
extern AVCodec tiertexseqvideo_decoder;
2310
extern AVCodec tiff_decoder;
2311
extern AVCodec truemotion1_decoder;
2312
extern AVCodec truemotion2_decoder;
2313
extern AVCodec truespeech_decoder;
2314
extern AVCodec tscc_decoder;
2315
extern AVCodec tta_decoder;
2316
extern AVCodec ulti_decoder;
2317
extern AVCodec vc1_decoder;
2318
extern AVCodec vcr1_decoder;
2319
extern AVCodec vmdaudio_decoder;
2320
extern AVCodec vmdvideo_decoder;
2321
extern AVCodec vmnc_decoder;
2322
extern AVCodec vorbis_decoder;
2323
extern AVCodec vp3_decoder;
2324
extern AVCodec vp5_decoder;
2325
extern AVCodec vp6_decoder;
2326
extern AVCodec vp6f_decoder;
2327
extern AVCodec vqa_decoder;
2328
extern AVCodec wavpack_decoder;
2329
extern AVCodec wmav1_decoder;
2330
extern AVCodec wmav2_decoder;
2331
extern AVCodec wmv1_decoder;
2332
extern AVCodec wmv2_decoder;
2333
extern AVCodec wmv3_decoder;
2334
extern AVCodec wnv1_decoder;
2335
extern AVCodec ws_snd1_decoder;
2336
extern AVCodec xan_dpcm_decoder;
2337
extern AVCodec xan_wc3_decoder;
2338
extern AVCodec xl_decoder;
2339
extern AVCodec zlib_decoder;
2340
extern AVCodec zmbv_decoder;
2343
#define PCM_CODEC(id, name) \
2344
extern AVCodec name ## _decoder; \
2345
extern AVCodec name ## _encoder
2347
PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
2348
PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
2349
PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
2350
PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
2351
PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
2352
PCM_CODEC(CODEC_ID_PCM_S24BE, pcm_s24be);
2353
PCM_CODEC(CODEC_ID_PCM_S24DAUD, pcm_s24daud);
2354
PCM_CODEC(CODEC_ID_PCM_S24LE, pcm_s24le);
2355
PCM_CODEC(CODEC_ID_PCM_S32BE, pcm_s32be);
2356
PCM_CODEC(CODEC_ID_PCM_S32LE, pcm_s32le);
2357
PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
2358
PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
2359
PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
2360
PCM_CODEC(CODEC_ID_PCM_U24BE, pcm_u24be);
2361
PCM_CODEC(CODEC_ID_PCM_U24LE, pcm_u24le);
2362
PCM_CODEC(CODEC_ID_PCM_U32BE, pcm_u32be);
2363
PCM_CODEC(CODEC_ID_PCM_U32LE, pcm_u32le);
2367
PCM_CODEC(CODEC_ID_ADPCM_4XM, adpcm_4xm);
2368
PCM_CODEC(CODEC_ID_ADPCM_ADX, adpcm_adx);
2369
PCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
2370
PCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
2371
PCM_CODEC(CODEC_ID_ADPCM_G726, adpcm_g726);
2372
PCM_CODEC(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3);
2373
PCM_CODEC(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4);
2374
PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
2375
PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
2376
PCM_CODEC(CODEC_ID_ADPCM_IMA_WS, adpcm_ima_ws);
2377
PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
2378
PCM_CODEC(CODEC_ID_ADPCM_SBPRO_2, adpcm_sbpro_2);
2379
PCM_CODEC(CODEC_ID_ADPCM_SBPRO_3, adpcm_sbpro_3);
2380
PCM_CODEC(CODEC_ID_ADPCM_SBPRO_4, adpcm_sbpro_4);
2381
PCM_CODEC(CODEC_ID_ADPCM_SMJPEG, adpcm_ima_smjpeg);
2382
PCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
2383
PCM_CODEC(CODEC_ID_ADPCM_XA, adpcm_xa);
2384
PCM_CODEC(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha);
2388
/* dummy raw video codec */
2389
extern AVCodec rawvideo_decoder;
2390
extern AVCodec rawvideo_encoder;
2392
/* the following codecs use external GPL libs */
2393
extern AVCodec dts_decoder;
2394
extern AVCodec liba52_decoder;
2397
extern AVCodec dvbsub_decoder;
2398
extern AVCodec dvbsub_encoder;
2399
extern AVCodec dvdsub_decoder;
2400
extern AVCodec dvdsub_encoder;
2402
2300
/* resample.c */
2800
2738
* Encodes an audio frame from \p samples into \p buf.
2801
* The avcodec_encode_audio() function encodes a frame of audio from the input
2802
* buffer \p samples. To encode it, it makes use of the audiocodec which was
2739
* The avcodec_encode_audio() function encodes an audio frame from the input
2740
* buffer \p samples. To encode it, it makes use of the audio codec which was
2803
2741
* coupled with \p avctx using avcodec_open(). The resulting encoded frame is
2804
2742
* stored in output buffer \p buf.
2806
2744
* @note The output buffer should be at least \c FF_MIN_BUFFER_SIZE bytes large.
2808
* @param avctx The codec context.
2809
* @param[out] buf The output buffer.
2810
* @param[in] buf_size The output buffer size.
2811
* @param[in] samples The input buffer containing the samples.
2812
* @return On error a negative value is returned, on succes zero or the number
2813
* of bytes used from the input buffer.
2746
* @param avctx the codec context
2747
* @param[out] buf the output buffer
2748
* @param[in] buf_size the output buffer size
2749
* @param[in] samples the input buffer containing the samples
2750
* The number of samples read from this buffer is frame_size*channels,
2751
* both of which are defined in \p avctx.
2752
* @return On error a negative value is returned, on success zero or the number
2753
* of bytes used to encode the data read from the input buffer.
2815
2755
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
2816
2756
const short *samples);
2819
2759
* Encodes a video frame from \p pict into \p buf.
2820
* The avcodec_encode_video() function encodes a frame of video from the input
2821
* \p pict. To encode it, it makes use of the videocodec which was coupled with
2760
* The avcodec_encode_video() function encodes a video frame from the input
2761
* \p pict. To encode it, it makes use of the video codec which was coupled with
2822
2762
* \p avctx using avcodec_open(). The resulting encoded bytes representing the
2823
2763
* frame are stored in the output buffer \p buf. The input picture should be
2824
2764
* stored using a specific format, namely \c avctx.pix_fmt.
2826
* @param avctx The codec context.
2827
* @param[out] buf The output buffer for the bitstream of encoded frame.
2828
* @param[in] buf_size The size of the outputbuffer in bytes.
2829
* @param[in] pict The input picture to encode.
2766
* @param avctx the codec context
2767
* @param[out] buf the output buffer for the bitstream of encoded frame
2768
* @param[in] buf_size the size of the output buffer in bytes
2769
* @param[in] pict the input picture to encode
2830
2770
* @return On error a negative value is returned, on success zero or the number
2831
2771
* of bytes used from the input buffer.
2998
2933
* @warning Do not use for normal allocation.
3000
2935
* @param[in] size The amount of memory you need in bytes.
3001
* @return Block of memory of the requested size.
2936
* @return block of memory of the requested size
2937
* @deprecated. Code which uses av_mallocz_static is broken/misdesigned
2938
* and should correctly use static arrays
2940
attribute_deprecated av_malloc_attrib av_alloc_size(1)
3003
2941
void *av_mallocz_static(unsigned int size);
3006
2944
* Copy image 'src' to 'dst'.
3008
void img_copy(AVPicture *dst, const AVPicture *src,
3009
int pix_fmt, int width, int height);
3012
* Crop image top and left side
3014
int img_crop(AVPicture *dst, const AVPicture *src,
3015
int pix_fmt, int top_band, int left_band);
3020
int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
3021
int padtop, int padbottom, int padleft, int padright, int *color);
2946
void av_picture_copy(AVPicture *dst, const AVPicture *src,
2947
int pix_fmt, int width, int height);
2950
* Crop image top and left side.
2952
int av_picture_crop(AVPicture *dst, const AVPicture *src,
2953
int pix_fmt, int top_band, int left_band);
2958
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
2959
int padtop, int padbottom, int padleft, int padright, int *color);
2961
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
2963
* @deprecated Use the software scaler (swscale) instead.
2965
attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
2966
int pix_fmt, int width, int height);
2969
* @deprecated Use the software scaler (swscale) instead.
2971
attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
2972
int pix_fmt, int top_band, int left_band);
2975
* @deprecated Use the software scaler (swscale) instead.
2977
attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
2978
int padtop, int padbottom, int padleft, int padright, int *color);
3023
2981
extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
2984
* Parses \p str and put in \p width_ptr and \p height_ptr the detected values.
2986
* @return 0 in case of a successful parsing, a negative value otherwise
2987
* @param[in] str the string to parse: it has to be a string in the format
2988
* <width>x<height> or a valid video frame size abbreviation.
2989
* @param[in,out] width_ptr pointer to the variable which will contain the detected
2991
* @param[in,out] height_ptr pointer to the variable which will contain the detected
2992
* frame height value
2994
int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
2997
* Parses \p str and put in \p frame_rate the detected values.
2999
* @return 0 in case of a successful parsing, a negative value otherwise
3000
* @param[in] str the string to parse: it has to be a string in the format
3001
* <frame_rate_nom>/<frame_rate_den>, a float number or a valid video rate abbreviation
3002
* @param[in,out] frame_rate pointer to the AVRational which will contain the detected
3005
int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
3025
3007
/* error handling */
3027
#define AVERROR(e) (-(e)) /**< returns a negative error code from a POSIX error code, to return from library functions. */
3028
#define AVUNERROR(e) (-(e)) /**< returns a POSIX error code from a library function error return value. */
3009
#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
3010
#define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
3030
/* some platforms have E* and errno already negated. */
3012
/* Some platforms have E* and errno already negated. */
3031
3013
#define AVERROR(e) (e)
3032
3014
#define AVUNERROR(e) (e)
3034
3016
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
3035
#define AVERROR_IO AVERROR(EIO) /**< i/o error */
3036
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< number syntax expected in filename */
3017
#define AVERROR_IO AVERROR(EIO) /**< I/O error */
3018
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
3037
3019
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
3038
3020
#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
3039
3021
#define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
3040
#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< operation not supported */
3046
#endif /* AVCODEC_H */
3022
#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
3023
#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
3024
#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
3026
#endif /* FFMPEG_AVCODEC_H */