Audacity 3.2.0
ffmpeg-5.0.1-single-header.h
Go to the documentation of this file.
1// This header was generated from the FFMPEG headers
2#pragma once
3
4#include <stdlib.h>
5#include <stdarg.h>
6#include <limits.h>
7#include <stdint.h>
8#include <inttypes.h>
9#include <time.h>
10#include <stddef.h>
11#include <math.h>
12#include <string.h>
13#include <errno.h>
14#include <stdio.h>
15
16#define AVCODEC_AVCODEC_H
17
18#define AVUTIL_SAMPLEFMT_H
19
20#define AVUTIL_AVUTIL_H
21
22unsigned avutil_version(void);
23
24const char *av_version_info(void);
25
26const char *avutil_configuration(void);
27
28const char *avutil_license(void);
29
38};
39
40const char *av_get_media_type_string(enum AVMediaType media_type);
41
42#define FF_LAMBDA_SHIFT 7
43#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
44#define FF_QP2LAMBDA 118
45#define FF_LAMBDA_MAX (256*128-1)
46
47#define FF_QUALITY_SCALE FF_LAMBDA_SCALE
48
49#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
50
51#define AV_TIME_BASE 1000000
52
53#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
54
64};
65
67
68#define AVUTIL_COMMON_H
69
70#define AVUTIL_ATTRIBUTES_H
71
72# define AV_GCC_VERSION_AT_LEAST(x,y) 0
73# define AV_GCC_VERSION_AT_MOST(x,y) 0
74
75# define AV_HAS_BUILTIN(x) 0
76
77# define av_always_inline inline
78
79# define av_extern_inline inline
80
81# define av_warn_unused_result
82
83# define av_noinline
84
85# define av_pure
86
87# define av_const
88
89# define av_cold
90
91# define av_flatten
92
93# define attribute_deprecated
94
95# define AV_NOWARN_DEPRECATED(code) code
96
97# define av_unused
98
99# define av_used
100
101# define av_alias
102
103# define av_uninit(x) x
104
105# define av_builtin_constant_p(x) 0
106# define av_printf_format(fmtpos, attrpos)
107
108# define av_noreturn
109
110#define AVUTIL_MACROS_H
111
112# define AV_NE(be, le) (le)
113
114#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
115
116#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
117#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
118#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
119#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
120
121#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
122#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
123
124#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
125#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
126
127#define AV_STRINGIFY(s) AV_TOSTRING(s)
128#define AV_TOSTRING(s) #s
129
130#define AV_GLUE(a, b) a ## b
131#define AV_JOIN(a, b) AV_GLUE(a, b)
132
133#define AV_PRAGMA(s) _Pragma(#s)
134
135#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
136
137#define AVUTIL_VERSION_H
138
139#define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
140#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
141#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
142
143#define AV_VERSION_MAJOR(a) ((a) >> 16)
144#define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8)
145#define AV_VERSION_MICRO(a) ((a) & 0xFF)
146
147#define LIBAVUTIL_VERSION_MAJOR 57
148#define LIBAVUTIL_VERSION_MINOR 17
149#define LIBAVUTIL_VERSION_MICRO 100
150
151#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
152 LIBAVUTIL_VERSION_MINOR, \
153 LIBAVUTIL_VERSION_MICRO)
154#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
155 LIBAVUTIL_VERSION_MINOR, \
156 LIBAVUTIL_VERSION_MICRO)
157#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
158
159#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
160
161#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58)
162#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58)
163#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
164#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
165
166#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
167
168#define ROUNDED_DIV(a,b) (((a)>=0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
169
170#define AV_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
171 : ((a) + (1<<(b)) - 1) >> (b))
172
173#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT
174
175#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
176#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
177
178#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
179#define FFSIGN(a) ((a) > 0 ? 1 : -1)
180
181#define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
182
183#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
184#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))
185
186# define av_ceil_log2 av_ceil_log2_c
187# define av_clip av_clip_c
188# define av_clip64 av_clip64_c
189# define av_clip_uint8 av_clip_uint8_c
190# define av_clip_int8 av_clip_int8_c
191# define av_clip_uint16 av_clip_uint16_c
192# define av_clip_int16 av_clip_int16_c
193# define av_clipl_int32 av_clipl_int32_c
194# define av_clip_intp2 av_clip_intp2_c
195# define av_clip_uintp2 av_clip_uintp2_c
196# define av_mod_uintp2 av_mod_uintp2_c
197# define av_sat_add32 av_sat_add32_c
198# define av_sat_dadd32 av_sat_dadd32_c
199# define av_sat_sub32 av_sat_sub32_c
200# define av_sat_dsub32 av_sat_dsub32_c
201# define av_sat_add64 av_sat_add64_c
202# define av_sat_sub64 av_sat_sub64_c
203# define av_clipf av_clipf_c
204# define av_clipd av_clipd_c
205# define av_popcount av_popcount_c
206# define av_popcount64 av_popcount64_c
207# define av_parity av_parity_c
208
209av_const int av_log2(unsigned v);
210
211av_const int av_log2_16bit(unsigned v);
212
213static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
214{
215 if (a < amin) return amin;
216 else if (a > amax) return amax;
217 else return a;
218}
219
220static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
221{
222 if (a < amin) return amin;
223 else if (a > amax) return amax;
224 else return a;
225}
226
228{
229 if (a&(~0xFF)) return (~a)>>31;
230 else return a;
231}
232
234{
235 if ((a+0x80U) & ~0xFF) return (a>>31) ^ 0x7F;
236 else return a;
237}
238
240{
241 if (a&(~0xFFFF)) return (~a)>>31;
242 else return a;
243}
244
246{
247 if ((a+0x8000U) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
248 else return a;
249}
250
252{
253 if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
254 else return (int32_t)a;
255}
256
258{
259 if (((unsigned)a + (1 << p)) & ~((2 << p) - 1))
260 return (a >> 31) ^ ((1 << p) - 1);
261 else
262 return a;
263}
264
265static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
266{
267 if (a & ~((1<<p) - 1)) return (~a) >> 31 & ((1<<p) - 1);
268 else return a;
269}
270
271static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p)
272{
273 return a & ((1U << p) - 1);
274}
275
276static av_always_inline int av_sat_add32_c(int a, int b)
277{
278 return av_clipl_int32((int64_t)a + b);
279}
280
281static av_always_inline int av_sat_dadd32_c(int a, int b)
282{
283 return av_sat_add32(a, av_sat_add32(b, b));
284}
285
286static av_always_inline int av_sat_sub32_c(int a, int b)
287{
288 return av_clipl_int32((int64_t)a - b);
289}
290
291static av_always_inline int av_sat_dsub32_c(int a, int b)
292{
293 return av_sat_sub32(a, av_sat_add32(b, b));
294}
295
296static av_always_inline int64_t av_sat_add64_c(int64_t a, int64_t b) {
297 int64_t s = a+(uint64_t)b;
298 if ((int64_t)(a^b | ~s^b) >= 0)
299 return INT64_MAX ^ (b >> 63);
300 return s;
301}
302
303static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) {
304 if (b <= 0 && a >= INT64_MAX + b)
305 return INT64_MAX;
306 if (b >= 0 && a <= INT64_MIN + b)
307 return INT64_MIN;
308 return a - b;
309}
310
311static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
312{
313 return FFMIN(FFMAX(a, amin), amax);
314}
315
316static av_always_inline av_const double av_clipd_c(double a, double amin, double amax)
317{
318 return FFMIN(FFMAX(a, amin), amax);
319}
320
322{
323 return av_log2((x - 1U) << 1);
324}
325
327{
328 x -= (x >> 1) & 0x55555555;
329 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
330 x = (x + (x >> 4)) & 0x0F0F0F0F;
331 x += x >> 8;
332 return (x + (x >> 16)) & 0x3F;
333}
334
336{
337 return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
338}
339
341{
342 return av_popcount(v) & 1;
343}
344
345#define GET_UTF8(val, GET_BYTE, ERROR)\
346 val= (GET_BYTE);\
347 {\
348 uint32_t top = (val & 128) >> 1;\
349 if ((val & 0xc0) == 0x80 || val >= 0xFE)\
350 {ERROR}\
351 while (val & top) {\
352 unsigned int tmp = (GET_BYTE) - 128;\
353 if(tmp>>6)\
354 {ERROR}\
355 val= (val<<6) + tmp;\
356 top <<= 5;\
357 }\
358 val &= (top << 1) - 1;\
359 }
360
361#define GET_UTF16(val, GET_16BIT, ERROR)\
362 val = (GET_16BIT);\
363 {\
364 unsigned int hi = val - 0xD800;\
365 if (hi < 0x800) {\
366 val = (GET_16BIT) - 0xDC00;\
367 if (val > 0x3FFU || hi > 0x3FFU)\
368 {ERROR}\
369 val += (hi<<10) + 0x10000;\
370 }\
371 }\
372
373#define PUT_UTF8(val, tmp, PUT_BYTE)\
374 {\
375 int bytes, shift;\
376 uint32_t in = val;\
377 if (in < 0x80) {\
378 tmp = in;\
379 PUT_BYTE\
380 } else {\
381 bytes = (av_log2(in) + 4) / 5;\
382 shift = (bytes - 1) * 6;\
383 tmp = (256 - (256 >> bytes)) | (in >> shift);\
384 PUT_BYTE\
385 while (shift >= 6) {\
386 shift -= 6;\
387 tmp = 0x80 | ((in >> shift) & 0x3f);\
388 PUT_BYTE\
389 }\
390 }\
391 }
392
393#define PUT_UTF16(val, tmp, PUT_16BIT)\
394 {\
395 uint32_t in = val;\
396 if (in < 0x10000) {\
397 tmp = in;\
398 PUT_16BIT\
399 } else {\
400 tmp = 0xD800 | ((in - 0x10000) >> 10);\
401 PUT_16BIT\
402 tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
403 PUT_16BIT\
404 }\
405 }\
406
407#define AVUTIL_MEM_H
408
409 #define DECLARE_ALIGNED(n,t,v) t v
410 #define DECLARE_ASM_ALIGNED(n,t,v) t v
411 #define DECLARE_ASM_CONST(n,t,v) static const t v
412
413 #define av_malloc_attrib
414
415 #define av_alloc_size(...)
416
418
420
421av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
422
424
427
428void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
429
431int av_reallocp(void *ptr, size_t size);
432
433void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
434
435av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
436
437int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
438
439void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
440
441void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
442
443void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size);
444
445void av_free(void *ptr);
446
447void av_freep(void *ptr);
448
449char *av_strdup(const char *s) av_malloc_attrib;
450
451char *av_strndup(const char *s, size_t len) av_malloc_attrib;
452
453void *av_memdup(const void *p, size_t size);
454
455void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
456
457void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
458
460int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem);
461
462void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
463 const uint8_t *elem_data);
464
465int av_size_mult(size_t a, size_t b, size_t *r);
466
467void av_max_alloc(size_t max);
468
469#define AVUTIL_ERROR_H
470
471#define AVERROR(e) (e)
472#define AVUNERROR(e) (e)
473
474#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
475
476#define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F')
477#define AVERROR_BUG FFERRTAG( 'B','U','G','!')
478#define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S')
479#define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C')
480#define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M')
481#define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C')
482#define AVERROR_EOF FFERRTAG( 'E','O','F',' ')
483#define AVERROR_EXIT FFERRTAG( 'E','X','I','T')
484#define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ')
485#define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L')
486#define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A')
487#define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X')
488#define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T')
489#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E')
490#define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O')
491
492#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R')
493
494#define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
495#define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N')
496#define AVERROR_EXPERIMENTAL (-0x2bb2afa8)
497#define AVERROR_INPUT_CHANGED (-0x636e6701)
498#define AVERROR_OUTPUT_CHANGED (-0x636e6702)
499
500#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8,'4','0','0')
501#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1')
502#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3')
503#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4')
504#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X')
505#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X')
506
507#define AV_ERROR_MAX_STRING_SIZE 64
508
509int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
510
511static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
512{
513 av_strerror(errnum, errbuf, errbuf_size);
514 return errbuf;
515}
516
517#define av_err2str(errnum) \
518 av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
519
520#define AVUTIL_RATIONAL_H
521
522typedef struct AVRational{
523 int num;
524 int den;
526
527static inline AVRational av_make_q(int num, int den)
528{
529 AVRational r = { num, den };
530 return r;
531}
532
533static inline int av_cmp_q(AVRational a, AVRational b){
534 const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
535
536 if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1;
537 else if(b.den && a.den) return 0;
538 else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
539 else return INT_MIN;
540}
541
542static inline double av_q2d(AVRational a){
543 return a.num / (double) a.den;
544}
545
546int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
547
549
551
553
555
557{
558 AVRational r = { q.den, q.num };
559 return r;
560}
561
562AVRational av_d2q(double d, int max) av_const;
563
565
567
569
571
572#define AVUTIL_MATHEMATICS_H
573
574#define AVUTIL_INTFLOAT_H
575
576union av_intfloat32 {
577 uint32_t i;
578 float f;
579};
580
581union av_intfloat64 {
582 uint64_t i;
583 double f;
584};
585
586static av_always_inline float av_int2float(uint32_t i)
587{
588 union av_intfloat32 v;
589 v.i = i;
590 return v.f;
591}
592
593static av_always_inline uint32_t av_float2int(float f)
594{
595 union av_intfloat32 v;
596 v.f = f;
597 return v.i;
598}
599
600static av_always_inline double av_int2double(uint64_t i)
601{
602 union av_intfloat64 v;
603 v.i = i;
604 return v.f;
605}
606
607static av_always_inline uint64_t av_double2int(double f)
608{
609 union av_intfloat64 v;
610 v.f = f;
611 return v.i;
612}
613
614#define M_E 2.7182818284590452354
615#define M_LN2 0.69314718055994530942
616#define M_LN10 2.30258509299404568402
617#define M_LOG2_10 3.32192809488736234787
618#define M_PHI 1.61803398874989484820
619#define M_PI 3.14159265358979323846
620#define M_PI_2 1.57079632679489661923
621#define M_SQRT1_2 0.70710678118654752440
622#define M_SQRT2 1.41421356237309504880
623#define NAN av_int2float(0x7fc00000)
624#define INFINITY av_int2float(0x7f800000)
625
632
634};
635
636int64_t av_const av_gcd(int64_t a, int64_t b);
637
638int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
639
640int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) av_const;
641
642int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
643
644int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
645 enum AVRounding rnd) av_const;
646
647int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
648
649int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
650
651int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
652
653int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc);
654
655#define AVUTIL_LOG_H
656
657typedef enum {
677
678#define AV_IS_INPUT_DEVICE(category) \
679 (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \
680 ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \
681 ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT))
682
683#define AV_IS_OUTPUT_DEVICE(category) \
684 (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \
685 ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \
686 ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT))
687
688struct AVOptionRanges;
689
690typedef struct AVClass {
691
692 const char* class_name;
693
694 const char* (*item_name)(void* ctx);
695
696 const struct AVOption *option;
697
698 int version;
699
701
703
705
706 AVClassCategory (*get_category)(void* ctx);
707
708 int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
709
710 void* (*child_next)(void *obj, void *prev);
711
712 const struct AVClass* (*child_class_iterate)(void **iter);
714
715#define AV_LOG_QUIET -8
716
717#define AV_LOG_PANIC 0
718
719#define AV_LOG_FATAL 8
720
721#define AV_LOG_ERROR 16
722
723#define AV_LOG_WARNING 24
724
725#define AV_LOG_INFO 32
726
727#define AV_LOG_VERBOSE 40
728
729#define AV_LOG_DEBUG 48
730
731#define AV_LOG_TRACE 56
732
733#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET)
734
735#define AV_LOG_C(x) ((x) << 8)
736
737void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
738
739void av_log_once(void* avcl, int initial_level, int subsequent_level, int *state, const char *fmt, ...) av_printf_format(5, 6);
740
741void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
742
744
745void av_log_set_level(int level);
746
747void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
748
749void av_log_default_callback(void *avcl, int level, const char *fmt,
750 va_list vl);
751
752const char* av_default_item_name(void* ctx);
754
755void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
756 char *line, int line_size, int *print_prefix);
757
758int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
759 char *line, int line_size, int *print_prefix);
760
761#define AV_LOG_SKIP_REPEATED 1
762
763#define AV_LOG_PRINT_LEVEL 2
764
765void av_log_set_flags(int arg);
767
768#define AVUTIL_PIXFMT_H
769
770#define AVPALETTE_SIZE 1024
771#define AVPALETTE_COUNT 256
772
800
805
813
818
823
825
833
839
842
845
886
888
894
899
901
904
908
910
912
914
916
921
939
952
954
961
963
966
969
972
974
979
982
984
987
992
994
996
999
1002
1007
1010
1012
1015
1020
1023
1026
1029
1032
1035
1036# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
1037
1038#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA)
1039#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
1040#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA)
1041#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
1042#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0)
1043#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0)
1044
1045#define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE)
1046#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE)
1047#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE)
1048#define AV_PIX_FMT_GRAY14 AV_PIX_FMT_NE(GRAY14BE, GRAY14LE)
1049#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
1050#define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE)
1051#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE)
1052#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
1053#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
1054#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
1055#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE)
1056#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE)
1057#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
1058#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
1059#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
1060#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE)
1061
1062#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
1063#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
1064#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
1065#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
1066#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
1067#define AV_PIX_FMT_YUV440P10 AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE)
1068#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
1069#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
1070#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
1071#define AV_PIX_FMT_YUV440P12 AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE)
1072#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE)
1073#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE)
1074#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE)
1075#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE)
1076#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
1077#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
1078#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
1079
1080#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE)
1081#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
1082#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE)
1083#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE)
1084#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE)
1085#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE)
1086#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE)
1087#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE)
1088
1089#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE)
1090#define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE)
1091#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE)
1092#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE)
1093
1094#define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE)
1095#define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
1096
1097#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE)
1098
1099#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
1100#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
1101#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
1102#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
1103#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
1104#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
1105#define AV_PIX_FMT_YUVA422P12 AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE)
1106#define AV_PIX_FMT_YUVA444P12 AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE)
1107#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
1108#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
1109#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
1110
1111#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
1112#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE)
1113#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE)
1114#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE)
1115#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE)
1116
1117#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
1118#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
1119#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
1120
1121#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE)
1122#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE)
1123#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
1124#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
1125
1132
1146
1171
1191
1194
1196
1200
1211
1212static inline void *av_x_if_null(const void *p, const void *x)
1213{
1214 return (void *)(intptr_t)(p ? p : x);
1215}
1216
1217unsigned av_int_list_length_for_size(unsigned elsize,
1218 const void *list, uint64_t term) av_pure;
1219
1220#define av_int_list_length(list, term) \
1221 av_int_list_length_for_size(sizeof(*(list)), list, term)
1222
1223FILE *av_fopen_utf8(const char *path, const char *mode);
1224
1226
1227#define AV_FOURCC_MAX_STRING_SIZE 32
1228
1229#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
1230
1231char *av_fourcc_make_string(char *buf, uint32_t fourcc);
1232
1240
1248
1251
1252const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
1253
1255
1256enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
1257
1259
1261
1262char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
1263
1265
1267
1268int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
1269 enum AVSampleFormat sample_fmt, int align);
1270
1271int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
1272 const uint8_t *buf,
1273 int nb_channels, int nb_samples,
1274 enum AVSampleFormat sample_fmt, int align);
1275
1276int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
1277 int nb_samples, enum AVSampleFormat sample_fmt, int align);
1278
1279int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels,
1280 int nb_samples, enum AVSampleFormat sample_fmt, int align);
1281
1282int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
1283 int src_offset, int nb_samples, int nb_channels,
1284 enum AVSampleFormat sample_fmt);
1285
1286int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
1287 int nb_channels, enum AVSampleFormat sample_fmt);
1288
1289#define AVUTIL_BUFFER_H
1290
1291typedef struct AVBuffer AVBuffer;
1292
1293typedef struct AVBufferRef {
1295
1296 uint8_t *data;
1297
1298 size_t size;
1300
1302
1304
1305#define AV_BUFFER_FLAG_READONLY (1 << 0)
1306
1307AVBufferRef *av_buffer_create(uint8_t *data, size_t size,
1308 void (*free)(void *opaque, uint8_t *data),
1309 void *opaque, int flags);
1310
1311void av_buffer_default_free(void *opaque, uint8_t *data);
1312
1314
1316
1318
1320
1322
1324
1326
1328
1330
1332
1334 AVBufferRef* (*alloc)(void *opaque, size_t size),
1335 void (*pool_free)(void *opaque));
1336
1338
1340
1342
1343#define AVUTIL_DICT_H
1344
1345#define AV_DICT_MATCH_CASE 1
1346#define AV_DICT_IGNORE_SUFFIX 2
1347
1348#define AV_DICT_DONT_STRDUP_KEY 4
1349
1350#define AV_DICT_DONT_STRDUP_VAL 8
1351
1352#define AV_DICT_DONT_OVERWRITE 16
1353#define AV_DICT_APPEND 32
1354
1355#define AV_DICT_MULTIKEY 64
1356
1357typedef struct AVDictionaryEntry {
1358 char *key;
1359 char *value;
1361
1363
1365 const AVDictionaryEntry *prev, int flags);
1366
1368
1369int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
1370
1371int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags);
1372
1374 const char *key_val_sep, const char *pairs_sep,
1375 int flags);
1376
1377int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
1378
1380
1381int av_dict_get_string(const AVDictionary *m, char **buffer,
1382 const char key_val_sep, const char pairs_sep);
1383
1384#define AVUTIL_FRAME_H
1385
1387
1389
1391
1393
1395
1397
1399
1401
1403
1405
1407
1409
1411
1413
1415
1417
1419
1421
1423
1425
1427
1429
1431
1433
1435
1437};
1438
1447};
1448
1449typedef struct AVFrameSideData {
1451 uint8_t *data;
1452 size_t size;
1456
1457typedef struct AVRegionOfInterest {
1458
1459 uint32_t self_size;
1460
1461 int top;
1462 int bottom;
1463 int left;
1464 int right;
1465
1468
1469typedef struct AVFrame {
1470#define AV_NUM_DATA_POINTERS 8
1471
1472 uint8_t *data[AV_NUM_DATA_POINTERS];
1473
1475
1476 uint8_t **extended_data;
1477
1478 int width, height;
1479
1480 int nb_samples;
1481
1482 int format;
1483
1484 int key_frame;
1485
1487
1489
1490 int64_t pts;
1491
1492 int64_t pkt_dts;
1493
1495
1497
1499
1500 int quality;
1501
1502 void *opaque;
1503
1504 int repeat_pict;
1505
1506 int interlaced_frame;
1507
1508 int top_field_first;
1509
1511
1512 int64_t reordered_opaque;
1513
1514 int sample_rate;
1515
1516 uint64_t channel_layout;
1517
1519
1521
1522 int nb_extended_buf;
1523
1525 int nb_side_data;
1526
1527#define AV_FRAME_FLAG_CORRUPT (1 << 0)
1528
1529#define AV_FRAME_FLAG_DISCARD (1 << 2)
1530
1531 int flags;
1532
1534
1536
1538
1540
1542
1543 int64_t best_effort_timestamp;
1544
1545 int64_t pkt_pos;
1546
1547 int64_t pkt_duration;
1548
1550
1552#define FF_DECODE_ERROR_INVALID_BITSTREAM 1
1553#define FF_DECODE_ERROR_MISSING_REFERENCE 2
1554#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
1555#define FF_DECODE_ERROR_DECODE_SLICES 8
1556
1557 int channels;
1558
1559 int pkt_size;
1560
1562
1564
1565 size_t crop_top;
1566 size_t crop_bottom;
1567 size_t crop_left;
1568 size_t crop_right;
1569
1572
1575
1577
1579
1580int av_frame_ref(AVFrame *dst, const AVFrame *src);
1581
1583
1585
1587
1588int av_frame_get_buffer(AVFrame *frame, int align);
1589
1591
1593
1594int av_frame_copy(AVFrame *dst, const AVFrame *src);
1595
1597
1599
1601 enum AVFrameSideDataType type,
1602 size_t size);
1603
1605 enum AVFrameSideDataType type,
1606 AVBufferRef *buf);
1607
1609 enum AVFrameSideDataType type);
1610
1612
1613enum {
1614
1616};
1617
1618int av_frame_apply_cropping(AVFrame *frame, int flags);
1619
1621
1622#define AVCODEC_CODEC_H
1623
1624#define AVUTIL_HWCONTEXT_H
1625
1639};
1640
1642
1643typedef struct AVHWDeviceContext {
1644
1645 const AVClass *av_class;
1646
1648
1649 enum AVHWDeviceType type;
1650
1651 void *hwctx;
1652
1653 void (*free)(struct AVHWDeviceContext *ctx);
1654
1655 void *user_opaque;
1657
1659
1660typedef struct AVHWFramesContext {
1661
1662 const AVClass *av_class;
1663
1665
1667
1669
1670 void *hwctx;
1671
1672 void (*free)(struct AVHWFramesContext *ctx);
1673
1674 void *user_opaque;
1675
1677
1679
1680 enum AVPixelFormat format;
1681
1683
1684 int width, height;
1686
1688
1690
1692
1694
1696
1698 const char *device, AVDictionary *opts, int flags);
1699
1701 enum AVHWDeviceType type,
1702 AVBufferRef *src_ctx, int flags);
1703
1705 enum AVHWDeviceType type,
1706 AVBufferRef *src_ctx,
1707 AVDictionary *options, int flags);
1708
1710
1712
1713int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, AVFrame *frame, int flags);
1714
1715int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags);
1716
1718
1720
1722};
1723
1726 enum AVPixelFormat **formats, int flags);
1727
1728typedef struct AVHWFramesConstraints {
1729
1731
1733
1734 int min_width;
1735 int min_height;
1736
1737 int max_width;
1738 int max_height;
1740
1742
1744 const void *hwconfig);
1745
1747
1748enum {
1749
1751
1753
1755
1757};
1758
1759int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
1760
1762 enum AVPixelFormat format,
1763 AVBufferRef *derived_device_ctx,
1764 AVBufferRef *source_frame_ctx,
1765 int flags);
1766
1767#define AVCODEC_CODEC_ID_H
1768
1771
1908#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM
1946#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
1970#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
2032
2071
2123
2126
2129
2137
2234
2262
2265
2276
2278
2280
2282
2285};
2286
2288
2289const char *avcodec_get_name(enum AVCodecID id);
2290
2292
2294
2295const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
2296
2298
2299#define AVCODEC_VERSION_H
2300
2301#define LIBAVCODEC_VERSION_MAJOR 59
2302#define LIBAVCODEC_VERSION_MINOR 18
2303#define LIBAVCODEC_VERSION_MICRO 100
2304
2305#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
2306 LIBAVCODEC_VERSION_MINOR, \
2307 LIBAVCODEC_VERSION_MICRO)
2308#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
2309 LIBAVCODEC_VERSION_MINOR, \
2310 LIBAVCODEC_VERSION_MICRO)
2311#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
2312
2313#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
2314
2315#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60)
2316#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60)
2317#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60)
2318#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
2319#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
2320#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
2321#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
2322#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
2323#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60)
2324#define FF_API_MPEGVIDEO_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
2325#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
2326#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
2327
2328#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
2329
2330#define AV_CODEC_CAP_DR1 (1 << 1)
2331
2332#define AV_CODEC_CAP_TRUNCATED (1 << 3)
2333
2334#define AV_CODEC_CAP_DELAY (1 << 5)
2335
2336#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
2337
2338#define AV_CODEC_CAP_SUBFRAMES (1 << 8)
2339
2340#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
2341
2342#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
2343
2344#define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
2345
2346#define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
2347
2348#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
2349
2350#define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
2351#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS
2352
2353#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
2354
2355#define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
2356
2357#define AV_CODEC_CAP_INTRA_ONLY 0x40000000
2358
2359#define AV_CODEC_CAP_LOSSLESS 0x80000000
2360
2361#define AV_CODEC_CAP_HARDWARE (1 << 18)
2362
2363#define AV_CODEC_CAP_HYBRID (1 << 19)
2364
2365#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
2366
2367#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
2368
2369typedef struct AVProfile {
2370 int profile;
2371 const char *name;
2373
2375
2376struct AVCodecContext;
2377struct AVSubtitle;
2378struct AVPacket;
2379
2380typedef struct AVCodec {
2381
2382 const char *name;
2383
2384 const char *long_name;
2385 enum AVMediaType type;
2386 enum AVCodecID id;
2387
2388 int capabilities;
2389 uint8_t max_lowres;
2391 const enum AVPixelFormat *pix_fmts;
2392 const int *supported_samplerates;
2393 const enum AVSampleFormat *sample_fmts;
2394 const uint64_t *channel_layouts;
2395 const AVClass *priv_class;
2396 const AVProfile *profiles;
2397
2398 const char *wrapper_name;
2399
2400 int caps_internal;
2401
2402 int priv_data_size;
2403
2404 int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
2405
2406 int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
2407
2408 const AVCodecDefault *defaults;
2409
2410 void (*init_static_data)(struct AVCodec *codec);
2411
2412 int (*init)(struct AVCodecContext *);
2413 int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size,
2414 const struct AVSubtitle *sub);
2415
2416 int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
2417 const struct AVFrame *frame, int *got_packet_ptr);
2418
2419 int (*decode)(struct AVCodecContext *avctx, void *outdata,
2420 int *got_frame_ptr, struct AVPacket *avpkt);
2421 int (*close)(struct AVCodecContext *);
2422
2423 int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt);
2424
2425 int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame);
2426
2427 void (*flush)(struct AVCodecContext *);
2428
2429 const char *bsfs;
2430
2431 const struct AVCodecHWConfigInternal *const *hw_configs;
2432
2433 const uint32_t *codec_tags;
2435
2436const AVCodec *av_codec_iterate(void **opaque);
2437
2439
2441
2443
2445
2447
2449
2450const char *av_get_profile_name(const AVCodec *codec, int profile);
2451
2452enum {
2453
2455
2457
2459
2461};
2462
2463typedef struct AVCodecHWConfig {
2464
2466
2467 int methods;
2468
2471
2472const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
2473
2474#define AVCODEC_CODEC_DESC_H
2475
2476typedef struct AVCodecDescriptor {
2477 enum AVCodecID id;
2478 enum AVMediaType type;
2479
2480 const char *name;
2481
2482 const char *long_name;
2483
2484 int props;
2485
2486 const char *const *mime_types;
2487
2488 const struct AVProfile *profiles;
2490
2491#define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
2492
2493#define AV_CODEC_PROP_LOSSY (1 << 1)
2494
2495#define AV_CODEC_PROP_LOSSLESS (1 << 2)
2496
2497#define AV_CODEC_PROP_REORDER (1 << 3)
2498
2499#define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
2500
2501#define AV_CODEC_PROP_TEXT_SUB (1 << 17)
2502
2504
2506
2508
2509#define AVCODEC_CODEC_PAR_H
2510
2518};
2519
2520typedef struct AVCodecParameters {
2521
2523
2524 enum AVCodecID codec_id;
2525
2526 uint32_t codec_tag;
2527
2528 uint8_t *extradata;
2529
2530 int extradata_size;
2531
2532 int format;
2533
2534 int64_t bit_rate;
2535
2537
2539
2540 int profile;
2541 int level;
2542
2543 int width;
2544 int height;
2545
2547
2549
2555
2556 int video_delay;
2557
2558 uint64_t channel_layout;
2559
2560 int channels;
2561
2562 int sample_rate;
2563
2564 int block_align;
2565
2566 int frame_size;
2567
2568 int initial_padding;
2569
2570 int trailing_padding;
2571
2572 int seek_preroll;
2574
2576
2578
2580
2582
2583#define AVCODEC_DEFS_H
2584
2585#define AV_INPUT_BUFFER_PADDING_SIZE 64
2586
2588
2596};
2597
2609};
2610
2611typedef struct AVPanScan {
2612
2613 int id;
2614
2615 int width;
2616 int height;
2617
2618 int16_t position[3][2];
2620
2621typedef struct AVCPBProperties {
2622
2624
2626
2628
2630
2631 uint64_t vbv_delay;
2633
2635
2637
2638 int64_t wallclock;
2641
2642unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
2643
2644#define AVCODEC_PACKET_H
2645
2647
2649
2651
2653
2655
2657
2659
2661
2663
2665
2667
2669
2671
2673
2675
2677
2679
2681
2683
2685
2687
2689
2691
2693
2695
2697
2699
2701
2703
2705
2707
2709
2711
2714
2715#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS
2716
2717typedef struct AVPacketSideData {
2718 uint8_t *data;
2719 size_t size;
2722
2723typedef struct AVPacket {
2724
2726
2727 int64_t pts;
2728
2729 int64_t dts;
2730 uint8_t *data;
2731 int size;
2732 int stream_index;
2733
2734 int flags;
2735
2737 int side_data_elems;
2738
2739 int64_t duration;
2740
2741 int64_t pos;
2742
2743 void *opaque;
2744
2746
2749
2751typedef struct AVPacketList {
2752 AVPacket pkt;
2753 struct AVPacketList *next;
2755
2756#define AV_PKT_FLAG_KEY 0x0001
2757#define AV_PKT_FLAG_CORRUPT 0x0002
2758
2759#define AV_PKT_FLAG_DISCARD 0x0004
2760
2761#define AV_PKT_FLAG_TRUSTED 0x0008
2762
2763#define AV_PKT_FLAG_DISPOSABLE 0x0010
2764
2770};
2771
2773
2775
2777
2780
2782
2784
2785int av_grow_packet(AVPacket *pkt, int grow_by);
2786
2787int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
2788
2790 size_t size);
2791
2793 uint8_t *data, size_t size);
2794
2796 size_t size);
2797
2799 size_t *size);
2800
2802
2804
2805int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
2806 AVDictionary **dict);
2807
2809
2810int av_packet_ref(AVPacket *dst, const AVPacket *src);
2811
2813
2815
2817
2819
2821
2823
2824#define AV_INPUT_BUFFER_MIN_SIZE 16384
2825
2826typedef struct RcOverride{
2827 int start_frame;
2828 int end_frame;
2829 int qscale;
2830 float quality_factor;
2832
2833#define AV_CODEC_FLAG_UNALIGNED (1 << 0)
2834
2835#define AV_CODEC_FLAG_QSCALE (1 << 1)
2836
2837#define AV_CODEC_FLAG_4MV (1 << 2)
2838
2839#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3)
2840
2841#define AV_CODEC_FLAG_QPEL (1 << 4)
2842
2843#define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
2844
2845#define AV_CODEC_FLAG_PASS1 (1 << 9)
2846
2847#define AV_CODEC_FLAG_PASS2 (1 << 10)
2848
2849#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11)
2850
2851#define AV_CODEC_FLAG_GRAY (1 << 13)
2852
2853#define AV_CODEC_FLAG_PSNR (1 << 15)
2854
2855#define AV_CODEC_FLAG_TRUNCATED (1 << 16)
2856
2857#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18)
2858
2859#define AV_CODEC_FLAG_LOW_DELAY (1 << 19)
2860
2861#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
2862
2863#define AV_CODEC_FLAG_BITEXACT (1 << 23)
2864
2865#define AV_CODEC_FLAG_AC_PRED (1 << 24)
2866
2867#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29)
2868#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31)
2869
2870#define AV_CODEC_FLAG2_FAST (1 << 0)
2871
2872#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2)
2873
2874#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
2875
2876#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13)
2877
2878#define AV_CODEC_FLAG2_CHUNKS (1 << 15)
2879
2880#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16)
2881
2882#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22)
2883
2884#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28)
2885
2886#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29)
2887
2888#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30)
2889
2890#define AV_CODEC_EXPORT_DATA_MVS (1 << 0)
2891
2892#define AV_CODEC_EXPORT_DATA_PRFT (1 << 1)
2893
2894#define AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS (1 << 2)
2895
2896#define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3)
2897
2898#define AV_GET_BUFFER_FLAG_REF (1 << 0)
2899
2900#define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0)
2901
2902struct AVCodecInternal;
2903
2904typedef struct AVCodecContext {
2905
2906 const AVClass *av_class;
2907 int log_level_offset;
2908
2910 const struct AVCodec *codec;
2911 enum AVCodecID codec_id;
2912
2913 unsigned int codec_tag;
2914
2915 void *priv_data;
2916
2917 struct AVCodecInternal *internal;
2918
2919 void *opaque;
2920
2921 int64_t bit_rate;
2922
2924
2925 int global_quality;
2926
2928#define FF_COMPRESSION_DEFAULT -1
2929
2930 int flags;
2931
2932 int flags2;
2933
2934 uint8_t *extradata;
2935 int extradata_size;
2936
2938
2939 int ticks_per_frame;
2940
2941 int delay;
2942
2943 int width, height;
2944
2946
2947 int gop_size;
2948
2950
2951 void (*draw_horiz_band)(struct AVCodecContext *s,
2952 const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
2953 int y, int type, int height);
2954
2955 enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
2956
2957 int max_b_frames;
2958
2959 float b_quant_factor;
2960
2961 float b_quant_offset;
2962
2963 int has_b_frames;
2964
2965 float i_quant_factor;
2966
2967 float i_quant_offset;
2968
2969 float lumi_masking;
2970
2972
2974
2975 float p_masking;
2976
2977 float dark_masking;
2978
2979 int slice_count;
2980
2981 int *slice_offset;
2982
2984
2985 int me_cmp;
2986
2987 int me_sub_cmp;
2988
2989 int mb_cmp;
2990
2991 int ildct_cmp;
2992#define FF_CMP_SAD 0
2993#define FF_CMP_SSE 1
2994#define FF_CMP_SATD 2
2995#define FF_CMP_DCT 3
2996#define FF_CMP_PSNR 4
2997#define FF_CMP_BIT 5
2998#define FF_CMP_RD 6
2999#define FF_CMP_ZERO 7
3000#define FF_CMP_VSAD 8
3001#define FF_CMP_VSSE 9
3002#define FF_CMP_NSSE 10
3003#define FF_CMP_W53 11
3004#define FF_CMP_W97 12
3005#define FF_CMP_DCTMAX 13
3006#define FF_CMP_DCT264 14
3007#define FF_CMP_MEDIAN_SAD 15
3008#define FF_CMP_CHROMA 256
3009
3010 int dia_size;
3011
3013
3014 int me_pre_cmp;
3015
3016 int pre_dia_size;
3017
3019
3020 int me_range;
3021
3022 int slice_flags;
3023#define SLICE_FLAG_CODED_ORDER 0x0001
3024#define SLICE_FLAG_ALLOW_FIELD 0x0002
3025#define SLICE_FLAG_ALLOW_PLANE 0x0004
3026
3027 int mb_decision;
3028#define FF_MB_DECISION_SIMPLE 0
3029#define FF_MB_DECISION_BITS 1
3030#define FF_MB_DECISION_RD 2
3031
3032 uint16_t *intra_matrix;
3033
3034 uint16_t *inter_matrix;
3035
3037
3038 int skip_top;
3039
3040 int skip_bottom;
3041
3042 int mb_lmin;
3043
3044 int mb_lmax;
3045
3046 int bidir_refine;
3047
3048 int keyint_min;
3049
3050 int refs;
3051
3052 int mv0_threshold;
3053
3055
3057
3059
3061
3063
3064 int slices;
3065
3067
3068 int sample_rate;
3069 int channels;
3070
3072
3073 int frame_size;
3074
3075 int frame_number;
3076
3077 int block_align;
3078
3079 int cutoff;
3080
3081 uint64_t channel_layout;
3082
3083 uint64_t request_channel_layout;
3084
3086
3088
3089 int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
3090
3091 float qcompress;
3092 float qblur;
3093
3094 int qmin;
3095
3096 int qmax;
3097
3098 int max_qdiff;
3099
3100 int rc_buffer_size;
3101
3104
3105 int64_t rc_max_rate;
3106
3107 int64_t rc_min_rate;
3108
3110
3112
3114
3115 int trellis;
3116
3117 char *stats_out;
3118
3119 char *stats_in;
3120
3121 int workaround_bugs;
3122#define FF_BUG_AUTODETECT 1
3123#define FF_BUG_XVID_ILACE 4
3124#define FF_BUG_UMP4 8
3125#define FF_BUG_NO_PADDING 16
3126#define FF_BUG_AMV 32
3127#define FF_BUG_QPEL_CHROMA 64
3128#define FF_BUG_STD_QPEL 128
3129#define FF_BUG_QPEL_CHROMA2 256
3130#define FF_BUG_DIRECT_BLOCKSIZE 512
3131#define FF_BUG_EDGE 1024
3132#define FF_BUG_HPEL_CHROMA 2048
3133#define FF_BUG_DC_CLIP 4096
3134#define FF_BUG_MS 8192
3135#define FF_BUG_TRUNCATED 16384
3136#define FF_BUG_IEDGE 32768
3137
3139#define FF_COMPLIANCE_VERY_STRICT 2
3140#define FF_COMPLIANCE_STRICT 1
3141#define FF_COMPLIANCE_NORMAL 0
3142#define FF_COMPLIANCE_UNOFFICIAL -1
3143#define FF_COMPLIANCE_EXPERIMENTAL -2
3144
3146#define FF_EC_GUESS_MVS 1
3147#define FF_EC_DEBLOCK 2
3148#define FF_EC_FAVOR_INTER 256
3149
3150 int debug;
3151#define FF_DEBUG_PICT_INFO 1
3152#define FF_DEBUG_RC 2
3153#define FF_DEBUG_BITSTREAM 4
3154#define FF_DEBUG_MB_TYPE 8
3155#define FF_DEBUG_QP 16
3156#define FF_DEBUG_DCT_COEFF 0x00000040
3157#define FF_DEBUG_SKIP 0x00000080
3158#define FF_DEBUG_STARTCODE 0x00000100
3159#define FF_DEBUG_ER 0x00000400
3160#define FF_DEBUG_MMCO 0x00000800
3161#define FF_DEBUG_BUGS 0x00001000
3162#define FF_DEBUG_BUFFERS 0x00008000
3163#define FF_DEBUG_THREADS 0x00010000
3164#define FF_DEBUG_GREEN_MD 0x00800000
3165#define FF_DEBUG_NOMC 0x01000000
3166
3167 int err_recognition;
3168
3169#define AV_EF_CRCCHECK (1<<0)
3170#define AV_EF_BITSTREAM (1<<1)
3171#define AV_EF_BUFFER (1<<2)
3172#define AV_EF_EXPLODE (1<<3)
3173
3174#define AV_EF_IGNORE_ERR (1<<15)
3175#define AV_EF_CAREFUL (1<<16)
3176#define AV_EF_COMPLIANT (1<<17)
3177#define AV_EF_AGGRESSIVE (1<<18)
3178
3179 int64_t reordered_opaque;
3180
3181 const struct AVHWAccel *hwaccel;
3182
3183 void *hwaccel_context;
3184
3185 uint64_t error[AV_NUM_DATA_POINTERS];
3186
3187 int dct_algo;
3188#define FF_DCT_AUTO 0
3189#define FF_DCT_FASTINT 1
3190#define FF_DCT_INT 2
3191#define FF_DCT_MMX 3
3192#define FF_DCT_ALTIVEC 5
3193#define FF_DCT_FAAN 6
3194
3195 int idct_algo;
3196#define FF_IDCT_AUTO 0
3197#define FF_IDCT_INT 1
3198#define FF_IDCT_SIMPLE 2
3199#define FF_IDCT_SIMPLEMMX 3
3200#define FF_IDCT_ARM 7
3201#define FF_IDCT_ALTIVEC 8
3202#define FF_IDCT_SIMPLEARM 10
3203#define FF_IDCT_XVID 14
3204#define FF_IDCT_SIMPLEARMV5TE 16
3205#define FF_IDCT_SIMPLEARMV6 17
3206#define FF_IDCT_FAAN 20
3207#define FF_IDCT_SIMPLENEON 22
3208#define FF_IDCT_NONE 24
3209#define FF_IDCT_SIMPLEAUTO 128
3210
3212
3214
3215 int lowres;
3216
3217 int thread_count;
3218
3219 int thread_type;
3220#define FF_THREAD_FRAME 1
3221#define FF_THREAD_SLICE 2
3222
3224
3227
3228 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
3229
3230 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
3231
3232 int nsse_weight;
3233
3234 int profile;
3235#define FF_PROFILE_UNKNOWN -99
3236#define FF_PROFILE_RESERVED -100
3237
3238#define FF_PROFILE_AAC_MAIN 0
3239#define FF_PROFILE_AAC_LOW 1
3240#define FF_PROFILE_AAC_SSR 2
3241#define FF_PROFILE_AAC_LTP 3
3242#define FF_PROFILE_AAC_HE 4
3243#define FF_PROFILE_AAC_HE_V2 28
3244#define FF_PROFILE_AAC_LD 22
3245#define FF_PROFILE_AAC_ELD 38
3246#define FF_PROFILE_MPEG2_AAC_LOW 128
3247#define FF_PROFILE_MPEG2_AAC_HE 131
3248
3249#define FF_PROFILE_DNXHD 0
3250#define FF_PROFILE_DNXHR_LB 1
3251#define FF_PROFILE_DNXHR_SQ 2
3252#define FF_PROFILE_DNXHR_HQ 3
3253#define FF_PROFILE_DNXHR_HQX 4
3254#define FF_PROFILE_DNXHR_444 5
3255
3256#define FF_PROFILE_DTS 20
3257#define FF_PROFILE_DTS_ES 30
3258#define FF_PROFILE_DTS_96_24 40
3259#define FF_PROFILE_DTS_HD_HRA 50
3260#define FF_PROFILE_DTS_HD_MA 60
3261#define FF_PROFILE_DTS_EXPRESS 70
3262
3263#define FF_PROFILE_MPEG2_422 0
3264#define FF_PROFILE_MPEG2_HIGH 1
3265#define FF_PROFILE_MPEG2_SS 2
3266#define FF_PROFILE_MPEG2_SNR_SCALABLE 3
3267#define FF_PROFILE_MPEG2_MAIN 4
3268#define FF_PROFILE_MPEG2_SIMPLE 5
3269
3270#define FF_PROFILE_H264_CONSTRAINED (1<<9)
3271#define FF_PROFILE_H264_INTRA (1<<11)
3272
3273#define FF_PROFILE_H264_BASELINE 66
3274#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
3275#define FF_PROFILE_H264_MAIN 77
3276#define FF_PROFILE_H264_EXTENDED 88
3277#define FF_PROFILE_H264_HIGH 100
3278#define FF_PROFILE_H264_HIGH_10 110
3279#define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
3280#define FF_PROFILE_H264_MULTIVIEW_HIGH 118
3281#define FF_PROFILE_H264_HIGH_422 122
3282#define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
3283#define FF_PROFILE_H264_STEREO_HIGH 128
3284#define FF_PROFILE_H264_HIGH_444 144
3285#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
3286#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
3287#define FF_PROFILE_H264_CAVLC_444 44
3288
3289#define FF_PROFILE_VC1_SIMPLE 0
3290#define FF_PROFILE_VC1_MAIN 1
3291#define FF_PROFILE_VC1_COMPLEX 2
3292#define FF_PROFILE_VC1_ADVANCED 3
3293
3294#define FF_PROFILE_MPEG4_SIMPLE 0
3295#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
3296#define FF_PROFILE_MPEG4_CORE 2
3297#define FF_PROFILE_MPEG4_MAIN 3
3298#define FF_PROFILE_MPEG4_N_BIT 4
3299#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
3300#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
3301#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
3302#define FF_PROFILE_MPEG4_HYBRID 8
3303#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
3304#define FF_PROFILE_MPEG4_CORE_SCALABLE 10
3305#define FF_PROFILE_MPEG4_ADVANCED_CODING 11
3306#define FF_PROFILE_MPEG4_ADVANCED_CORE 12
3307#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
3308#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
3309#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
3310
3311#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
3312#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
3313#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
3314#define FF_PROFILE_JPEG2000_DCINEMA_2K 3
3315#define FF_PROFILE_JPEG2000_DCINEMA_4K 4
3316
3317#define FF_PROFILE_VP9_0 0
3318#define FF_PROFILE_VP9_1 1
3319#define FF_PROFILE_VP9_2 2
3320#define FF_PROFILE_VP9_3 3
3321
3322#define FF_PROFILE_HEVC_MAIN 1
3323#define FF_PROFILE_HEVC_MAIN_10 2
3324#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
3325#define FF_PROFILE_HEVC_REXT 4
3326
3327#define FF_PROFILE_VVC_MAIN_10 1
3328#define FF_PROFILE_VVC_MAIN_10_444 33
3329
3330#define FF_PROFILE_AV1_MAIN 0
3331#define FF_PROFILE_AV1_HIGH 1
3332#define FF_PROFILE_AV1_PROFESSIONAL 2
3333
3334#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
3335#define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
3336#define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
3337#define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
3338#define FF_PROFILE_MJPEG_JPEG_LS 0xf7
3339
3340#define FF_PROFILE_SBC_MSBC 1
3341
3342#define FF_PROFILE_PRORES_PROXY 0
3343#define FF_PROFILE_PRORES_LT 1
3344#define FF_PROFILE_PRORES_STANDARD 2
3345#define FF_PROFILE_PRORES_HQ 3
3346#define FF_PROFILE_PRORES_4444 4
3347#define FF_PROFILE_PRORES_XQ 5
3348
3349#define FF_PROFILE_ARIB_PROFILE_A 0
3350#define FF_PROFILE_ARIB_PROFILE_C 1
3351
3352#define FF_PROFILE_KLVA_SYNC 0
3353#define FF_PROFILE_KLVA_ASYNC 1
3354
3355 int level;
3356#define FF_LEVEL_UNKNOWN -99
3357
3359
3360 enum AVDiscard skip_idct;
3361
3362 enum AVDiscard skip_frame;
3363
3364 uint8_t *subtitle_header;
3366
3367 int initial_padding;
3368
3370
3372
3374
3376
3381
3382 char *sub_charenc;
3383
3384 int sub_charenc_mode;
3385#define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3386#define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3387#define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3388#define FF_SUB_CHARENC_MODE_IGNORE 2
3389
3390 int skip_alpha;
3391
3392 int seek_preroll;
3393
3396#define FF_DEBUG_VIS_MV_P_FOR 0x00000001
3397#define FF_DEBUG_VIS_MV_B_FOR 0x00000002
3398#define FF_DEBUG_VIS_MV_B_BACK 0x00000004
3399
3400 uint16_t *chroma_intra_matrix;
3401
3402 uint8_t *dump_separator;
3403
3404 char *codec_whitelist;
3405
3406 unsigned properties;
3407#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001
3408#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
3409#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004
3410
3413
3415
3418#define FF_SUB_TEXT_FMT_ASS 0
3419
3420 int trailing_padding;
3421
3422 int64_t max_pixels;
3423
3425
3426 int hwaccel_flags;
3427
3428 int apply_cropping;
3429
3430 int extra_hw_frames;
3431
3433
3435
3437
3440
3441struct MpegEncContext;
3442
3443typedef struct AVHWAccel {
3444
3445 const char *name;
3446
3447 enum AVMediaType type;
3448
3449 enum AVCodecID id;
3450
3452
3453 int capabilities;
3454
3455 int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame);
3456
3457 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3458
3459 int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size);
3460
3461 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3462
3463 int (*end_frame)(AVCodecContext *avctx);
3464
3466
3467 void (*decode_mb)(struct MpegEncContext *s);
3468
3469 int (*init)(AVCodecContext *avctx);
3470
3471 int (*uninit)(AVCodecContext *avctx);
3472
3473 int priv_data_size;
3474
3475 int caps_internal;
3476
3477 int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx);
3479
3480#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200
3481
3482#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
3483
3484#define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1)
3485
3486#define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2)
3487
3490
3492
3494
3496};
3497
3498#define AV_SUBTITLE_FLAG_FORCED 0x00000001
3499
3500typedef struct AVSubtitleRect {
3501 int x;
3502 int y;
3503 int w;
3504 int h;
3505 int nb_colors;
3506
3507 uint8_t *data[4];
3508 int linesize[4];
3509
3510 enum AVSubtitleType type;
3511
3512 char *text;
3513
3514 char *ass;
3515
3516 int flags;
3518
3519typedef struct AVSubtitle {
3520 uint16_t format;
3521 uint32_t start_display_time;
3522 uint32_t end_display_time;
3523 unsigned num_rects;
3525 int64_t pts;
3527
3528unsigned avcodec_version(void);
3529
3530const char *avcodec_configuration(void);
3531
3532const char *avcodec_license(void);
3533
3535
3537
3539
3542
3544
3546 const AVCodecContext *codec);
3547
3549 const AVCodecParameters *par);
3550
3551int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
3552
3554
3556
3558
3560
3561void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
3562
3563void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
3564 int linesize_align[AV_NUM_DATA_POINTERS]);
3565
3566int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
3567
3569
3571 int *got_sub_ptr,
3572 AVPacket *avpkt);
3573
3575
3577
3579
3581
3583 AVBufferRef *device_ref,
3584 enum AVPixelFormat hw_pix_fmt,
3585 AVBufferRef **out_frames_ref);
3586
3592};
3593
3594typedef struct AVCodecParserContext {
3595 void *priv_data;
3596 const struct AVCodecParser *parser;
3597 int64_t frame_offset;
3598 int64_t cur_offset;
3599
3600 int64_t next_frame_offset;
3601
3602 int pict_type;
3603
3604 int repeat_pict;
3605 int64_t pts;
3606 int64_t dts;
3607
3608 int64_t last_pts;
3609 int64_t last_dts;
3610 int fetch_timestamp;
3611
3612#define AV_PARSER_PTS_NB 4
3617
3618 int flags;
3619#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
3620#define PARSER_FLAG_ONCE 0x0002
3621
3622#define PARSER_FLAG_FETCHED_OFFSET 0x0004
3623#define PARSER_FLAG_USE_CODEC_TS 0x1000
3624
3625 int64_t offset;
3627
3628 int key_frame;
3629
3630 int dts_sync_point;
3631
3633
3634 int pts_dts_delta;
3635
3637
3638 int64_t pos;
3639
3640 int64_t last_pos;
3641
3642 int duration;
3643
3645
3647
3649
3650 int width;
3651 int height;
3652
3653 int coded_width;
3654 int coded_height;
3655
3656 int format;
3658
3659typedef struct AVCodecParser {
3660 int codec_ids[7];
3661 int priv_data_size;
3663
3665 AVCodecContext *avctx,
3666 const uint8_t **poutbuf, int *poutbuf_size,
3667 const uint8_t *buf, int buf_size);
3669 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
3671
3672const AVCodecParser *av_parser_iterate(void **opaque);
3673
3675
3677 AVCodecContext *avctx,
3678 uint8_t **poutbuf, int *poutbuf_size,
3679 const uint8_t *buf, int buf_size,
3680 int64_t pts, int64_t dts,
3681 int64_t pos);
3682
3684
3685int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
3686 const AVSubtitle *sub);
3687
3689
3691 enum AVPixelFormat src_pix_fmt,
3692 int has_alpha, int *loss_ptr);
3693
3695
3696void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
3697
3698int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
3699int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
3700
3701int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
3702 enum AVSampleFormat sample_fmt, const uint8_t *buf,
3703 int buf_size, int align);
3704
3706
3707int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
3708
3709void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
3710
3711void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size);
3712
3714
3715#define AVFORMAT_AVFORMAT_H
3716
3717#define AVFORMAT_AVIO_H
3718
3719#define AVFORMAT_VERSION_H
3720
3721#define LIBAVFORMAT_VERSION_MAJOR 59
3722#define LIBAVFORMAT_VERSION_MINOR 16
3723#define LIBAVFORMAT_VERSION_MICRO 100
3724
3725#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3726 LIBAVFORMAT_VERSION_MINOR, \
3727 LIBAVFORMAT_VERSION_MICRO)
3728#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
3729 LIBAVFORMAT_VERSION_MINOR, \
3730 LIBAVFORMAT_VERSION_MICRO)
3731#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
3732
3733#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
3734
3735#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60)
3736#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
3737#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
3738#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
3739#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
3740#define FF_HTTP_CACHE_REDIRECT_DEFAULT (LIBAVFORMAT_VERSION_MAJOR < 60)
3741
3742#define FF_API_R_FRAME_RATE 1
3743
3744#define AVIO_SEEKABLE_NORMAL (1 << 0)
3745
3746#define AVIO_SEEKABLE_TIME (1 << 1)
3747
3748typedef struct AVIOInterruptCB {
3749 int (*callback)(void*);
3750 void *opaque;
3752
3765};
3766
3767typedef struct AVIODirEntry {
3768 char *name;
3769 int type;
3770 int utf8;
3771
3772 int64_t size;
3773 int64_t modification_timestamp;
3774
3775 int64_t access_timestamp;
3776
3778
3779 int64_t user_id;
3780 int64_t group_id;
3781 int64_t filemode;
3783
3784typedef struct AVIODirContext {
3785 struct URLContext *url_context;
3787
3789
3791
3793
3795
3797
3799
3801};
3802
3803typedef struct AVIOContext {
3804
3805 const AVClass *av_class;
3806
3807 unsigned char *buffer;
3808 int buffer_size;
3809 unsigned char *buf_ptr;
3810 unsigned char *buf_end;
3811
3812 void *opaque;
3813
3814 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
3815 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
3816 int64_t (*seek)(void *opaque, int64_t offset, int whence);
3817 int64_t pos;
3818 int eof_reached;
3819 int error;
3820 int write_flag;
3821 int max_packet_size;
3822 int min_packet_size;
3823
3824 unsigned long checksum;
3825 unsigned char *checksum_ptr;
3826 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
3827
3828 int (*read_pause)(void *opaque, int pause);
3829
3830 int64_t (*read_seek)(void *opaque, int stream_index,
3831 int64_t timestamp, int flags);
3832
3833 int seekable;
3834
3835 int direct;
3836
3837 const char *protocol_whitelist;
3838
3839 const char *protocol_blacklist;
3840
3841 int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size,
3842 enum AVIODataMarkerType type, int64_t time);
3843
3845
3847 int64_t written;
3848
3849 unsigned char *buf_ptr_max;
3850
3851 int64_t bytes_read;
3852
3855
3856const char *avio_find_protocol_name(const char *url);
3857
3858int avio_check(const char *url, int flags);
3859
3860int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options);
3861
3863
3865
3867
3869 unsigned char *buffer,
3870 int buffer_size,
3871 int write_flag,
3872 void *opaque,
3873 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
3874 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
3875 int64_t (*seek)(void *opaque, int64_t offset, int whence));
3876
3878
3879void avio_w8(AVIOContext *s, int b);
3880void avio_write(AVIOContext *s, const unsigned char *buf, int size);
3881void avio_wl64(AVIOContext *s, uint64_t val);
3882void avio_wb64(AVIOContext *s, uint64_t val);
3883void avio_wl32(AVIOContext *s, unsigned int val);
3884void avio_wb32(AVIOContext *s, unsigned int val);
3885void avio_wl24(AVIOContext *s, unsigned int val);
3886void avio_wb24(AVIOContext *s, unsigned int val);
3887void avio_wl16(AVIOContext *s, unsigned int val);
3888void avio_wb16(AVIOContext *s, unsigned int val);
3889
3890int avio_put_str(AVIOContext *s, const char *str);
3891
3892int avio_put_str16le(AVIOContext *s, const char *str);
3893
3894int avio_put_str16be(AVIOContext *s, const char *str);
3895
3896void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type);
3897
3898#define AVSEEK_SIZE 0x10000
3899
3900#define AVSEEK_FORCE 0x20000
3901
3902int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
3903
3904int64_t avio_skip(AVIOContext *s, int64_t offset);
3905
3907{
3908 return avio_seek(s, 0, SEEK_CUR);
3909}
3910
3912
3914
3915int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
3916
3917void avio_print_string_array(AVIOContext *s, const char *strings[]);
3918
3919#define avio_print(s, ...) \