Audacity 3.2.0
ffmpeg-6.0.0-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 <string.h>
5#include <math.h>
6#include <time.h>
7#include <stddef.h>
8#include <limits.h>
9#include <errno.h>
10#include <stdlib.h>
11#include <inttypes.h>
12#include <stdint.h>
13#include <stdio.h>
14#include <stdarg.h>
15
16#define AVCODEC_AVCODEC_H
17
18#define AVUTIL_SAMPLEFMT_H
19
27
35
37};
38
39const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
40
42
43enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
44
46
48
49char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
50
52
54
55int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
56 enum AVSampleFormat sample_fmt, int align);
57
58int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
59 const uint8_t *buf,
60 int nb_channels, int nb_samples,
61 enum AVSampleFormat sample_fmt, int align);
62
63int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
64 int nb_samples, enum AVSampleFormat sample_fmt, int align);
65
66int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels,
67 int nb_samples, enum AVSampleFormat sample_fmt, int align);
68
69int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
70 int src_offset, int nb_samples, int nb_channels,
71 enum AVSampleFormat sample_fmt);
72
73int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
74 int nb_channels, enum AVSampleFormat sample_fmt);
75
76#define AVUTIL_ATTRIBUTES_H
77
78# define AV_GCC_VERSION_AT_LEAST(x,y) 0
79# define AV_GCC_VERSION_AT_MOST(x,y) 0
80
81# define AV_HAS_BUILTIN(x) 0
82
83# define av_always_inline inline
84
85# define av_extern_inline inline
86
87# define av_warn_unused_result
88
89# define av_noinline
90
91# define av_pure
92
93# define av_const
94
95# define av_cold
96
97# define av_flatten
98
99# define attribute_deprecated
100
101# define AV_NOWARN_DEPRECATED(code) code
102
103# define av_unused
104
105# define av_used
106
107# define av_alias
108
109# define av_uninit(x) x
110
111# define av_builtin_constant_p(x) 0
112# define av_printf_format(fmtpos, attrpos)
113
114# define av_noreturn
115
116#define AVUTIL_AVUTIL_H
117
118unsigned avutil_version(void);
119
120const char *av_version_info(void);
121
122const char *avutil_configuration(void);
123
124const char *avutil_license(void);
125
135
136const char *av_get_media_type_string(enum AVMediaType media_type);
137
138#define FF_LAMBDA_SHIFT 7
139#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
140#define FF_QP2LAMBDA 118
141#define FF_LAMBDA_MAX (256*128-1)
142
143#define FF_QUALITY_SCALE FF_LAMBDA_SCALE
144
145#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
146
147#define AV_TIME_BASE 1000000
148
149#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
150
160};
161
163
164#define AVUTIL_COMMON_H
165
166#define AVUTIL_MACROS_H
167
168# define AV_NE(be, le) (le)
169
170#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
171
172#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
173#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
174#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
175#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
176
177#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
178#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
179
180#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
181#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
182
183#define AV_STRINGIFY(s) AV_TOSTRING(s)
184#define AV_TOSTRING(s) #s
185
186#define AV_GLUE(a, b) a ## b
187#define AV_JOIN(a, b) AV_GLUE(a, b)
188
189#define AV_PRAGMA(s) _Pragma(#s)
190
191#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
192
193#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
194
195#define ROUNDED_DIV(a,b) (((a)>=0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
196
197#define AV_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
198 : ((a) + (1<<(b)) - 1) >> (b))
199
200#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT
201
202#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
203#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
204
205#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
206#define FFSIGN(a) ((a) > 0 ? 1 : -1)
207
208#define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
209
210#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
211#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))
212
213# define av_ceil_log2 av_ceil_log2_c
214# define av_clip av_clip_c
215# define av_clip64 av_clip64_c
216# define av_clip_uint8 av_clip_uint8_c
217# define av_clip_int8 av_clip_int8_c
218# define av_clip_uint16 av_clip_uint16_c
219# define av_clip_int16 av_clip_int16_c
220# define av_clipl_int32 av_clipl_int32_c
221# define av_clip_intp2 av_clip_intp2_c
222# define av_clip_uintp2 av_clip_uintp2_c
223# define av_mod_uintp2 av_mod_uintp2_c
224# define av_sat_add32 av_sat_add32_c
225# define av_sat_dadd32 av_sat_dadd32_c
226# define av_sat_sub32 av_sat_sub32_c
227# define av_sat_dsub32 av_sat_dsub32_c
228# define av_sat_add64 av_sat_add64_c
229# define av_sat_sub64 av_sat_sub64_c
230# define av_clipf av_clipf_c
231# define av_clipd av_clipd_c
232# define av_popcount av_popcount_c
233# define av_popcount64 av_popcount64_c
234# define av_parity av_parity_c
235
236av_const int av_log2(unsigned v);
237
238av_const int av_log2_16bit(unsigned v);
239
240static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
241{
242 if (a < amin) return amin;
243 else if (a > amax) return amax;
244 else return a;
245}
246
247static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
248{
249 if (a < amin) return amin;
250 else if (a > amax) return amax;
251 else return a;
252}
253
255{
256 if (a&(~0xFF)) return (~a)>>31;
257 else return a;
258}
259
261{
262 if ((a+0x80U) & ~0xFF) return (a>>31) ^ 0x7F;
263 else return a;
264}
265
267{
268 if (a&(~0xFFFF)) return (~a)>>31;
269 else return a;
270}
271
273{
274 if ((a+0x8000U) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
275 else return a;
276}
277
279{
280 if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
281 else return (int32_t)a;
282}
283
285{
286 if (((unsigned)a + (1 << p)) & ~((2 << p) - 1))
287 return (a >> 31) ^ ((1 << p) - 1);
288 else
289 return a;
290}
291
292static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
293{
294 if (a & ~((1<<p) - 1)) return (~a) >> 31 & ((1<<p) - 1);
295 else return a;
296}
297
298static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p)
299{
300 return a & ((1U << p) - 1);
301}
302
303static av_always_inline int av_sat_add32_c(int a, int b)
304{
305 return av_clipl_int32((int64_t)a + b);
306}
307
308static av_always_inline int av_sat_dadd32_c(int a, int b)
309{
310 return av_sat_add32(a, av_sat_add32(b, b));
311}
312
313static av_always_inline int av_sat_sub32_c(int a, int b)
314{
315 return av_clipl_int32((int64_t)a - b);
316}
317
318static av_always_inline int av_sat_dsub32_c(int a, int b)
319{
320 return av_sat_sub32(a, av_sat_add32(b, b));
321}
322
323static av_always_inline int64_t av_sat_add64_c(int64_t a, int64_t b) {
324 int64_t s = a+(uint64_t)b;
325 if ((int64_t)(a^b | ~s^b) >= 0)
326 return INT64_MAX ^ (b >> 63);
327 return s;
328}
329
330static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) {
331 if (b <= 0 && a >= INT64_MAX + b)
332 return INT64_MAX;
333 if (b >= 0 && a <= INT64_MIN + b)
334 return INT64_MIN;
335 return a - b;
336}
337
338static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
339{
340 return FFMIN(FFMAX(a, amin), amax);
341}
342
343static av_always_inline av_const double av_clipd_c(double a, double amin, double amax)
344{
345 return FFMIN(FFMAX(a, amin), amax);
346}
347
349{
350 return av_log2((x - 1U) << 1);
351}
352
354{
355 x -= (x >> 1) & 0x55555555;
356 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
357 x = (x + (x >> 4)) & 0x0F0F0F0F;
358 x += x >> 8;
359 return (x + (x >> 16)) & 0x3F;
360}
361
363{
364 return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
365}
366
368{
369 return av_popcount(v) & 1;
370}
371
372#define GET_UTF8(val, GET_BYTE, ERROR)\
373 val= (GET_BYTE);\
374 {\
375 uint32_t top = (val & 128) >> 1;\
376 if ((val & 0xc0) == 0x80 || val >= 0xFE)\
377 {ERROR}\
378 while (val & top) {\
379 unsigned int tmp = (GET_BYTE) - 128;\
380 if(tmp>>6)\
381 {ERROR}\
382 val= (val<<6) + tmp;\
383 top <<= 5;\
384 }\
385 val &= (top << 1) - 1;\
386 }
387
388#define GET_UTF16(val, GET_16BIT, ERROR)\
389 val = (GET_16BIT);\
390 {\
391 unsigned int hi = val - 0xD800;\
392 if (hi < 0x800) {\
393 val = (GET_16BIT) - 0xDC00;\
394 if (val > 0x3FFU || hi > 0x3FFU)\
395 {ERROR}\
396 val += (hi<<10) + 0x10000;\
397 }\
398 }\
399
400#define PUT_UTF8(val, tmp, PUT_BYTE)\
401 {\
402 int bytes, shift;\
403 uint32_t in = val;\
404 if (in < 0x80) {\
405 tmp = in;\
406 PUT_BYTE\
407 } else {\
408 bytes = (av_log2(in) + 4) / 5;\
409 shift = (bytes - 1) * 6;\
410 tmp = (256 - (256 >> bytes)) | (in >> shift);\
411 PUT_BYTE\
412 while (shift >= 6) {\
413 shift -= 6;\
414 tmp = 0x80 | ((in >> shift) & 0x3f);\
415 PUT_BYTE\
416 }\
417 }\
418 }
419
420#define PUT_UTF16(val, tmp, PUT_16BIT)\
421 {\
422 uint32_t in = val;\
423 if (in < 0x10000) {\
424 tmp = in;\
425 PUT_16BIT\
426 } else {\
427 tmp = 0xD800 | ((in - 0x10000) >> 10);\
428 PUT_16BIT\
429 tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
430 PUT_16BIT\
431 }\
432 }\
433
434#define AVUTIL_MEM_H
435
436#define AVUTIL_VERSION_H
437
438#define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
439#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
440#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
441
442#define AV_VERSION_MAJOR(a) ((a) >> 16)
443#define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8)
444#define AV_VERSION_MICRO(a) ((a) & 0xFF)
445
446#define LIBAVUTIL_VERSION_MAJOR 58
447#define LIBAVUTIL_VERSION_MINOR 2
448#define LIBAVUTIL_VERSION_MICRO 100
449
450#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
451 LIBAVUTIL_VERSION_MINOR, \
452 LIBAVUTIL_VERSION_MICRO)
453#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
454 LIBAVUTIL_VERSION_MINOR, \
455 LIBAVUTIL_VERSION_MICRO)
456#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
457
458#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
459
460#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 59)
461#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 59)
462#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 59)
463#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 59)
464#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 59)
465#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 59)
466#define FF_API_REORDERED_OPAQUE (LIBAVUTIL_VERSION_MAJOR < 59)
467#define FF_API_FRAME_PICTURE_NUMBER (LIBAVUTIL_VERSION_MAJOR < 59)
468
469 #define av_malloc_attrib
470
471 #define av_alloc_size(...)
472
474
476
477av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
478
480
481void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
482
484int av_reallocp(void *ptr, size_t size);
485
486void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
487
488av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
489
490int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
491
492void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
493
494void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
495
496void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size);
497
498void av_free(void *ptr);
499
500void av_freep(void *ptr);
501
502char *av_strdup(const char *s) av_malloc_attrib;
503
504char *av_strndup(const char *s, size_t len) av_malloc_attrib;
505
506void *av_memdup(const void *p, size_t size);
507
508void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
509
510void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
511
513int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem);
514
515void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
516 const uint8_t *elem_data);
517
518int av_size_mult(size_t a, size_t b, size_t *r);
519
520void av_max_alloc(size_t max);
521
522#define AVUTIL_ERROR_H
523
524#define AVERROR(e) (e)
525#define AVUNERROR(e) (e)
526
527#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
528
529#define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F')
530#define AVERROR_BUG FFERRTAG( 'B','U','G','!')
531#define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S')
532#define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C')
533#define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M')
534#define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C')
535#define AVERROR_EOF FFERRTAG( 'E','O','F',' ')
536#define AVERROR_EXIT FFERRTAG( 'E','X','I','T')
537#define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ')
538#define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L')
539#define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A')
540#define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X')
541#define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T')
542#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E')
543#define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O')
544
545#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R')
546
547#define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
548#define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N')
549#define AVERROR_EXPERIMENTAL (-0x2bb2afa8)
550#define AVERROR_INPUT_CHANGED (-0x636e6701)
551#define AVERROR_OUTPUT_CHANGED (-0x636e6702)
552
553#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8,'4','0','0')
554#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1')
555#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3')
556#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4')
557#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X')
558#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X')
559
560#define AV_ERROR_MAX_STRING_SIZE 64
561
562int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
563
564static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
565{
566 av_strerror(errnum, errbuf, errbuf_size);
567 return errbuf;
568}
569
570#define av_err2str(errnum) \
571 av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
572
573#define AVUTIL_RATIONAL_H
574
575typedef struct AVRational{
576 int num;
577 int den;
579
580static inline AVRational av_make_q(int num, int den)
581{
582 AVRational r = { num, den };
583 return r;
584}
585
586static inline int av_cmp_q(AVRational a, AVRational b){
587 const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
588
589 if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1;
590 else if(b.den && a.den) return 0;
591 else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
592 else return INT_MIN;
593}
594
595static inline double av_q2d(AVRational a){
596 return a.num / (double) a.den;
597}
598
599int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
600
602
604
606
608
610{
611 AVRational r = { q.den, q.num };
612 return r;
613}
614
615AVRational av_d2q(double d, int max) av_const;
616
618
620
622
624
625#define AVUTIL_MATHEMATICS_H
626
627#define AVUTIL_INTFLOAT_H
628
629union av_intfloat32 {
630 uint32_t i;
631 float f;
632};
633
634union av_intfloat64 {
635 uint64_t i;
636 double f;
637};
638
639static av_always_inline float av_int2float(uint32_t i)
640{
641 union av_intfloat32 v;
642 v.i = i;
643 return v.f;
644}
645
646static av_always_inline uint32_t av_float2int(float f)
647{
648 union av_intfloat32 v;
649 v.f = f;
650 return v.i;
651}
652
653static av_always_inline double av_int2double(uint64_t i)
654{
655 union av_intfloat64 v;
656 v.i = i;
657 return v.f;
658}
659
660static av_always_inline uint64_t av_double2int(double f)
661{
662 union av_intfloat64 v;
663 v.f = f;
664 return v.i;
665}
666
667#define M_E 2.7182818284590452354
668#define M_LN2 0.69314718055994530942
669#define M_LN10 2.30258509299404568402
670#define M_LOG2_10 3.32192809488736234787
671#define M_PHI 1.61803398874989484820
672#define M_PI 3.14159265358979323846
673#define M_PI_2 1.57079632679489661923
674#define M_SQRT1_2 0.70710678118654752440
675#define M_SQRT2 1.41421356237309504880
676#define NAN av_int2float(0x7fc00000)
677#define INFINITY av_int2float(0x7f800000)
678
685
687};
688
689int64_t av_const av_gcd(int64_t a, int64_t b);
690
691int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
692
693int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) av_const;
694
695int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
696
697int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
698 enum AVRounding rnd) av_const;
699
700int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
701
702int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
703
704int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
705
706int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc);
707
708#define AVUTIL_LOG_H
709
710typedef enum {
730
731#define AV_IS_INPUT_DEVICE(category) \
732 (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \
733 ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \
734 ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT))
735
736#define AV_IS_OUTPUT_DEVICE(category) \
737 (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \
738 ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \
739 ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT))
740
741struct AVOptionRanges;
742
743typedef struct AVClass {
744
745 const char* class_name;
746
747 const char* (*item_name)(void* ctx);
748
749 const struct AVOption *option;
750
751 int version;
752
754
756
758
759 AVClassCategory (*get_category)(void* ctx);
760
761 int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
762
763 void* (*child_next)(void *obj, void *prev);
764
765 const struct AVClass* (*child_class_iterate)(void **iter);
767
768#define AV_LOG_QUIET -8
769
770#define AV_LOG_PANIC 0
771
772#define AV_LOG_FATAL 8
773
774#define AV_LOG_ERROR 16
775
776#define AV_LOG_WARNING 24
777
778#define AV_LOG_INFO 32
779
780#define AV_LOG_VERBOSE 40
781
782#define AV_LOG_DEBUG 48
783
784#define AV_LOG_TRACE 56
785
786#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET)
787
788#define AV_LOG_C(x) ((x) << 8)
789
790void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
791
792void av_log_once(void* avcl, int initial_level, int subsequent_level, int *state, const char *fmt, ...) av_printf_format(5, 6);
793
794void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
795
797
798void av_log_set_level(int level);
799
800void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
801
802void av_log_default_callback(void *avcl, int level, const char *fmt,
803 va_list vl);
804
805const char* av_default_item_name(void* ctx);
807
808void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
809 char *line, int line_size, int *print_prefix);
810
811int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
812 char *line, int line_size, int *print_prefix);
813
814#define AV_LOG_SKIP_REPEATED 1
815
816#define AV_LOG_PRINT_LEVEL 2
817
818void av_log_set_flags(int arg);
820
821#define AVUTIL_PIXFMT_H
822
823#define AVPALETTE_SIZE 1024
824#define AVPALETTE_COUNT 256
825
853
858
866
871
876
878
886
892
895
898
939
941
947
952
954
957
961
963
965
967
969
974
992
1005
1007
1014
1016
1019
1022
1025
1027
1032
1035
1037
1040
1045
1047
1049
1052
1055
1060
1063
1065
1068
1073
1076
1079
1082
1085
1087
1090
1092
1095
1098
1101
1104
1107
1110
1113
1114# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
1115
1116#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA)
1117#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
1118#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA)
1119#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
1120#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0)
1121#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0)
1122
1123#define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE)
1124#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE)
1125#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE)
1126#define AV_PIX_FMT_GRAY14 AV_PIX_FMT_NE(GRAY14BE, GRAY14LE)
1127#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
1128#define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE)
1129#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE)
1130#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
1131#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
1132#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
1133#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE)
1134#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE)
1135#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
1136#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
1137#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
1138#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE)
1139
1140#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
1141#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
1142#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
1143#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
1144#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
1145#define AV_PIX_FMT_YUV440P10 AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE)
1146#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
1147#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
1148#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
1149#define AV_PIX_FMT_YUV440P12 AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE)
1150#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE)
1151#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE)
1152#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE)
1153#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE)
1154#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
1155#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
1156#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
1157
1158#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE)
1159#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
1160#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE)
1161#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE)
1162#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE)
1163#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE)
1164#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE)
1165#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE)
1166
1167#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE)
1168#define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE)
1169#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE)
1170#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE)
1171
1172#define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE)
1173#define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
1174
1175#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE)
1176
1177#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
1178#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
1179#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
1180#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
1181#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
1182#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
1183#define AV_PIX_FMT_YUVA422P12 AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE)
1184#define AV_PIX_FMT_YUVA444P12 AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE)
1185#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
1186#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
1187#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
1188
1189#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
1190#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE)
1191#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE)
1192#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE)
1193#define AV_PIX_FMT_P012 AV_PIX_FMT_NE(P012BE, P012LE)
1194#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE)
1195
1196#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
1197#define AV_PIX_FMT_Y212 AV_PIX_FMT_NE(Y212BE, Y212LE)
1198#define AV_PIX_FMT_XV30 AV_PIX_FMT_NE(XV30BE, XV30LE)
1199#define AV_PIX_FMT_XV36 AV_PIX_FMT_NE(XV36BE, XV36LE)
1200#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
1201#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
1202
1203#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE)
1204#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE)
1205#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
1206#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
1207
1208#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE)
1209
1210#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)
1211#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)
1212
1219
1233
1258
1278
1281
1283
1287
1298
1299static inline void *av_x_if_null(const void *p, const void *x)
1300{
1301 return (void *)(intptr_t)(p ? p : x);
1302}
1303
1304unsigned av_int_list_length_for_size(unsigned elsize,
1305 const void *list, uint64_t term) av_pure;
1306
1307#define av_int_list_length(list, term) \
1308 av_int_list_length_for_size(sizeof(*(list)), list, term)
1309
1311FILE *av_fopen_utf8(const char *path, const char *mode);
1312
1314
1315#define AV_FOURCC_MAX_STRING_SIZE 32
1316
1317#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
1318
1319char *av_fourcc_make_string(char *buf, uint32_t fourcc);
1320
1321#define AVUTIL_BUFFER_H
1322
1323typedef struct AVBuffer AVBuffer;
1324
1325typedef struct AVBufferRef {
1327
1328 uint8_t *data;
1329
1330 size_t size;
1332
1334
1336
1337#define AV_BUFFER_FLAG_READONLY (1 << 0)
1338
1339AVBufferRef *av_buffer_create(uint8_t *data, size_t size,
1340 void (*free)(void *opaque, uint8_t *data),
1341 void *opaque, int flags);
1342
1343void av_buffer_default_free(void *opaque, uint8_t *data);
1344
1346
1348
1350
1352
1354
1356
1358
1360
1362
1364
1366 AVBufferRef* (*alloc)(void *opaque, size_t size),
1367 void (*pool_free)(void *opaque));
1368
1370
1372
1374
1375#define AVUTIL_DICT_H
1376
1377#define AV_DICT_MATCH_CASE 1
1378#define AV_DICT_IGNORE_SUFFIX 2
1379
1380#define AV_DICT_DONT_STRDUP_KEY 4
1381
1382#define AV_DICT_DONT_STRDUP_VAL 8
1383
1384#define AV_DICT_DONT_OVERWRITE 16
1385#define AV_DICT_APPEND 32
1386
1387#define AV_DICT_MULTIKEY 64
1388
1389typedef struct AVDictionaryEntry {
1390 char *key;
1391 char *value;
1393
1395
1397 const AVDictionaryEntry *prev, int flags);
1398
1400 const AVDictionaryEntry *prev);
1401
1403
1404int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
1405
1406int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags);
1407
1409 const char *key_val_sep, const char *pairs_sep,
1410 int flags);
1411
1412int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
1413
1415
1416int av_dict_get_string(const AVDictionary *m, char **buffer,
1417 const char key_val_sep, const char pairs_sep);
1418
1419#define AVUTIL_FRAME_H
1420
1421#define AVUTIL_CHANNEL_LAYOUT_H
1422
1424
1444
1446
1458
1460
1462
1464
1466};
1467
1469
1471
1473
1475
1477};
1478
1479#define AV_CH_FRONT_LEFT (1ULL << AV_CHAN_FRONT_LEFT )
1480#define AV_CH_FRONT_RIGHT (1ULL << AV_CHAN_FRONT_RIGHT )
1481#define AV_CH_FRONT_CENTER (1ULL << AV_CHAN_FRONT_CENTER )
1482#define AV_CH_LOW_FREQUENCY (1ULL << AV_CHAN_LOW_FREQUENCY )
1483#define AV_CH_BACK_LEFT (1ULL << AV_CHAN_BACK_LEFT )
1484#define AV_CH_BACK_RIGHT (1ULL << AV_CHAN_BACK_RIGHT )
1485#define AV_CH_FRONT_LEFT_OF_CENTER (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER )
1486#define AV_CH_FRONT_RIGHT_OF_CENTER (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER)
1487#define AV_CH_BACK_CENTER (1ULL << AV_CHAN_BACK_CENTER )
1488#define AV_CH_SIDE_LEFT (1ULL << AV_CHAN_SIDE_LEFT )
1489#define AV_CH_SIDE_RIGHT (1ULL << AV_CHAN_SIDE_RIGHT )
1490#define AV_CH_TOP_CENTER (1ULL << AV_CHAN_TOP_CENTER )
1491#define AV_CH_TOP_FRONT_LEFT (1ULL << AV_CHAN_TOP_FRONT_LEFT )
1492#define AV_CH_TOP_FRONT_CENTER (1ULL << AV_CHAN_TOP_FRONT_CENTER )
1493#define AV_CH_TOP_FRONT_RIGHT (1ULL << AV_CHAN_TOP_FRONT_RIGHT )
1494#define AV_CH_TOP_BACK_LEFT (1ULL << AV_CHAN_TOP_BACK_LEFT )
1495#define AV_CH_TOP_BACK_CENTER (1ULL << AV_CHAN_TOP_BACK_CENTER )
1496#define AV_CH_TOP_BACK_RIGHT (1ULL << AV_CHAN_TOP_BACK_RIGHT )
1497#define AV_CH_STEREO_LEFT (1ULL << AV_CHAN_STEREO_LEFT )
1498#define AV_CH_STEREO_RIGHT (1ULL << AV_CHAN_STEREO_RIGHT )
1499#define AV_CH_WIDE_LEFT (1ULL << AV_CHAN_WIDE_LEFT )
1500#define AV_CH_WIDE_RIGHT (1ULL << AV_CHAN_WIDE_RIGHT )
1501#define AV_CH_SURROUND_DIRECT_LEFT (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT )
1502#define AV_CH_SURROUND_DIRECT_RIGHT (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT)
1503#define AV_CH_LOW_FREQUENCY_2 (1ULL << AV_CHAN_LOW_FREQUENCY_2 )
1504#define AV_CH_TOP_SIDE_LEFT (1ULL << AV_CHAN_TOP_SIDE_LEFT )
1505#define AV_CH_TOP_SIDE_RIGHT (1ULL << AV_CHAN_TOP_SIDE_RIGHT )
1506#define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER )
1507#define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT )
1508#define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT )
1509
1510#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
1511
1512#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
1513#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
1514#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
1515#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
1516#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
1517#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
1518#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
1519#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
1520#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
1521#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
1522#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
1523#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
1524#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
1525#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
1526#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
1527#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
1528#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
1529#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
1530#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
1531#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
1532#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
1533#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
1534#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
1535#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
1536#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
1537#define AV_CH_LAYOUT_7POINT1_TOP_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
1538#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
1539#define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
1540#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
1541#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
1542#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
1543
1554
1555typedef struct AVChannelCustom {
1557 char name[16];
1558 void *opaque;
1560
1561typedef struct AVChannelLayout {
1562
1564
1566
1567 union {
1568
1569 uint64_t mask;
1570
1572 } u;
1573
1574 void *opaque;
1576
1577#define AV_CHANNEL_LAYOUT_MASK(nb, m) \
1578 { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }}
1579
1580#define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO)
1581#define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO)
1582#define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1)
1583#define AV_CHANNEL_LAYOUT_2_1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2_1)
1584#define AV_CHANNEL_LAYOUT_SURROUND AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_SURROUND)
1585#define AV_CHANNEL_LAYOUT_3POINT1 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_3POINT1)
1586#define AV_CHANNEL_LAYOUT_4POINT0 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_4POINT0)
1587#define AV_CHANNEL_LAYOUT_4POINT1 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_4POINT1)
1588#define AV_CHANNEL_LAYOUT_2_2 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_2_2)
1589#define AV_CHANNEL_LAYOUT_QUAD AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_QUAD)
1590#define AV_CHANNEL_LAYOUT_5POINT0 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0)
1591#define AV_CHANNEL_LAYOUT_5POINT1 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1)
1592#define AV_CHANNEL_LAYOUT_5POINT0_BACK AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0_BACK)
1593#define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK)
1594#define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0)
1595#define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT)
1596#define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL)
1597#define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1)
1598#define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK)
1599#define AV_CHANNEL_LAYOUT_6POINT1_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_FRONT)
1600#define AV_CHANNEL_LAYOUT_7POINT0 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0)
1601#define AV_CHANNEL_LAYOUT_7POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0_FRONT)
1602#define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1)
1603#define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE)
1604#define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK)
1605#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_TOP_BACK)
1606#define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL)
1607#define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE)
1608#define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
1609#define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX)
1610#define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
1611#define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
1612 { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }}
1613
1614struct AVBPrint;
1615
1617uint64_t av_get_channel_layout(const char *name);
1618
1620int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels);
1621
1623void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
1624
1626void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
1627
1629int av_get_channel_layout_nb_channels(uint64_t channel_layout);
1630
1632int64_t av_get_default_channel_layout(int nb_channels);
1633
1635int av_get_channel_layout_channel_index(uint64_t channel_layout,
1636 uint64_t channel);
1637
1639uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
1640
1642const char *av_get_channel_name(uint64_t channel);
1643
1645const char *av_get_channel_description(uint64_t channel);
1646
1648int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
1649 const char **name);
1650
1651int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel);
1652
1653void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
1654
1655int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel);
1656
1657void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
1658
1660
1661int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask);
1662
1664 const char *str);
1665
1666void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels);
1667
1669
1671
1673
1675 char *buf, size_t buf_size);
1676
1678 struct AVBPrint *bp);
1679
1680enum AVChannel
1681av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx);
1682
1684 enum AVChannel channel);
1685
1687 const char *name);
1688
1689enum AVChannel
1691 const char *name);
1692
1693uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout,
1694 uint64_t mask);
1695
1696int av_channel_layout_check(const AVChannelLayout *channel_layout);
1697
1699
1701
1703
1705
1707
1709
1711
1713
1715
1717
1719
1721
1723
1725
1727
1729
1731
1733
1735
1737
1739
1741
1743
1745
1747
1749
1751
1753
1755};
1756
1765};
1766
1767typedef struct AVFrameSideData {
1769 uint8_t *data;
1770 size_t size;
1774
1775typedef struct AVRegionOfInterest {
1776
1777 uint32_t self_size;
1778
1779 int top;
1780 int bottom;
1781 int left;
1782 int right;
1783
1786
1787typedef struct AVFrame {
1788#define AV_NUM_DATA_POINTERS 8
1789
1790 uint8_t *data[AV_NUM_DATA_POINTERS];
1791
1793
1794 uint8_t **extended_data;
1795
1796 int width, height;
1797
1798 int nb_samples;
1799
1800 int format;
1801
1802 int key_frame;
1803
1805
1807
1808 int64_t pts;
1809
1810 int64_t pkt_dts;
1811
1813
1816
1819
1820 int quality;
1821
1822 void *opaque;
1823
1824 int repeat_pict;
1825
1826 int interlaced_frame;
1827
1828 int top_field_first;
1829
1831
1834
1835 int sample_rate;
1836
1839
1841
1843
1844 int nb_extended_buf;
1845
1847 int nb_side_data;
1848
1849#define AV_FRAME_FLAG_CORRUPT (1 << 0)
1850
1851#define AV_FRAME_FLAG_DISCARD (1 << 2)
1852
1853 int flags;
1854
1856
1858
1860
1862
1864
1865 int64_t best_effort_timestamp;
1866
1867 int64_t pkt_pos;
1868
1871
1873
1875#define FF_DECODE_ERROR_INVALID_BITSTREAM 1
1876#define FF_DECODE_ERROR_MISSING_REFERENCE 2
1877#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
1878#define FF_DECODE_ERROR_DECODE_SLICES 8
1879
1882
1883 int pkt_size;
1884
1886
1888
1889 size_t crop_top;
1890 size_t crop_bottom;
1891 size_t crop_left;
1892 size_t crop_right;
1893
1895
1897
1898 int64_t duration;
1900
1902
1904
1905int av_frame_ref(AVFrame *dst, const AVFrame *src);
1906
1908
1910
1912
1913int av_frame_get_buffer(AVFrame *frame, int align);
1914
1916
1918
1919int av_frame_copy(AVFrame *dst, const AVFrame *src);
1920
1922
1924
1926 enum AVFrameSideDataType type,
1927 size_t size);
1928
1930 enum AVFrameSideDataType type,
1931 AVBufferRef *buf);
1932
1934 enum AVFrameSideDataType type);
1935
1937
1938enum {
1939
1941};
1942
1943int av_frame_apply_cropping(AVFrame *frame, int flags);
1944
1946
1947#define AVCODEC_CODEC_H
1948
1949#define AVUTIL_HWCONTEXT_H
1950
1964};
1965
1967
1968typedef struct AVHWDeviceContext {
1969
1970 const AVClass *av_class;
1971
1973
1974 enum AVHWDeviceType type;
1975
1976 void *hwctx;
1977
1978 void (*free)(struct AVHWDeviceContext *ctx);
1979
1980 void *user_opaque;
1982
1984
1985typedef struct AVHWFramesContext {
1986
1987 const AVClass *av_class;
1988
1990
1992
1994
1995 void *hwctx;
1996
1997 void (*free)(struct AVHWFramesContext *ctx);
1998
1999 void *user_opaque;
2000
2002
2004
2005 enum AVPixelFormat format;
2006
2008
2009 int width, height;
2011
2013
2015
2017
2019
2021
2023 const char *device, AVDictionary *opts, int flags);
2024
2026 enum AVHWDeviceType type,
2027 AVBufferRef *src_ctx, int flags);
2028
2030 enum AVHWDeviceType type,
2031 AVBufferRef *src_ctx,
2032 AVDictionary *options, int flags);
2033
2035
2037
2038int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, AVFrame *frame, int flags);
2039
2040int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags);
2041
2043
2045
2047};
2048
2051 enum AVPixelFormat **formats, int flags);
2052
2053typedef struct AVHWFramesConstraints {
2054
2056
2058
2059 int min_width;
2060 int min_height;
2061
2062 int max_width;
2063 int max_height;
2065
2067
2069 const void *hwconfig);
2070
2072
2073enum {
2074
2076
2078
2080
2082};
2083
2084int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
2085
2087 enum AVPixelFormat format,
2088 AVBufferRef *derived_device_ctx,
2089 AVBufferRef *source_frame_ctx,
2090 int flags);
2091
2092#define AVCODEC_CODEC_ID_H
2093
2094#define AVCODEC_VERSION_MAJOR_H
2095
2096#define LIBAVCODEC_VERSION_MAJOR 60
2097
2098#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61)
2099#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61)
2100#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61)
2101#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61)
2102#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61)
2103#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61)
2104#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61)
2105#define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61)
2106
2107#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
2108
2111
2248#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM
2286#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
2310#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
2380
2419
2472
2475
2478
2488
2592
2620
2623
2634
2636
2638
2640
2643
2645
2647};
2648
2650
2651const char *avcodec_get_name(enum AVCodecID id);
2652
2654
2656
2657const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
2658
2660
2661#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
2662
2663#define AV_CODEC_CAP_DR1 (1 << 1)
2664
2665#define AV_CODEC_CAP_DELAY (1 << 5)
2666
2667#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
2668
2669#define AV_CODEC_CAP_SUBFRAMES (1 << 8)
2670
2671#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
2672
2673#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
2674
2675#define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
2676
2677#define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
2678
2679#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
2680
2681#define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
2682
2683#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
2684
2685#define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
2686
2687#define AV_CODEC_CAP_HARDWARE (1 << 18)
2688
2689#define AV_CODEC_CAP_HYBRID (1 << 19)
2690
2691#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
2692
2693#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
2694
2695#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22)
2696
2697typedef struct AVProfile {
2698 int profile;
2699 const char *name;
2701
2702typedef struct AVCodec {
2703
2704 const char *name;
2705
2706 const char *long_name;
2707 enum AVMediaType type;
2708 enum AVCodecID id;
2709
2710 int capabilities;
2711 uint8_t max_lowres;
2713 const enum AVPixelFormat *pix_fmts;
2714 const int *supported_samplerates;
2715 const enum AVSampleFormat *sample_fmts;
2716
2718 const uint64_t *channel_layouts;
2719 const AVClass *priv_class;
2720 const AVProfile *profiles;
2721
2722 const char *wrapper_name;
2723
2726
2727const AVCodec *av_codec_iterate(void **opaque);
2728
2730
2732
2734
2736
2738
2740
2741const char *av_get_profile_name(const AVCodec *codec, int profile);
2742
2743enum {
2744
2746
2748
2750
2752};
2753
2754typedef struct AVCodecHWConfig {
2755
2757
2758 int methods;
2759
2762
2763const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
2764
2765#define AVCODEC_CODEC_DESC_H
2766
2767typedef struct AVCodecDescriptor {
2768 enum AVCodecID id;
2769 enum AVMediaType type;
2770
2771 const char *name;
2772
2773 const char *long_name;
2774
2775 int props;
2776
2777 const char *const *mime_types;
2778
2779 const struct AVProfile *profiles;
2781
2782#define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
2783
2784#define AV_CODEC_PROP_LOSSY (1 << 1)
2785
2786#define AV_CODEC_PROP_LOSSLESS (1 << 2)
2787
2788#define AV_CODEC_PROP_REORDER (1 << 3)
2789
2790#define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
2791
2792#define AV_CODEC_PROP_TEXT_SUB (1 << 17)
2793
2795
2797
2799
2800#define AVCODEC_CODEC_PAR_H
2801
2809};
2810
2811typedef struct AVCodecParameters {
2812
2814
2815 enum AVCodecID codec_id;
2816
2817 uint32_t codec_tag;
2818
2819 uint8_t *extradata;
2820
2821 int extradata_size;
2822
2823 int format;
2824
2825 int64_t bit_rate;
2826
2828
2830
2831 int profile;
2832 int level;
2833
2834 int width;
2835 int height;
2836
2838
2840
2846
2847 int video_delay;
2848
2851
2854
2855 int sample_rate;
2856
2857 int block_align;
2858
2859 int frame_size;
2860
2861 int initial_padding;
2862
2863 int trailing_padding;
2864
2865 int seek_preroll;
2866
2869
2871
2873
2875
2877
2878#define AVCODEC_DEFS_H
2879
2880#define AV_INPUT_BUFFER_PADDING_SIZE 64
2881
2882#define AV_EF_CRCCHECK (1<<0)
2883#define AV_EF_BITSTREAM (1<<1)
2884#define AV_EF_BUFFER (1<<2)
2885#define AV_EF_EXPLODE (1<<3)
2886
2887#define AV_EF_IGNORE_ERR (1<<15)
2888#define AV_EF_CAREFUL (1<<16)
2889#define AV_EF_COMPLIANT (1<<17)
2890#define AV_EF_AGGRESSIVE (1<<18)
2891
2892#define FF_COMPLIANCE_VERY_STRICT 2
2893#define FF_COMPLIANCE_STRICT 1
2894#define FF_COMPLIANCE_NORMAL 0
2895#define FF_COMPLIANCE_UNOFFICIAL -1
2896#define FF_COMPLIANCE_EXPERIMENTAL -2
2897
2899
2907};
2908
2920};
2921
2922typedef struct AVPanScan {
2923
2924 int id;
2925
2926 int width;
2927 int height;
2928
2929 int16_t position[3][2];
2931
2932typedef struct AVCPBProperties {
2933
2934 int64_t max_bitrate;
2935
2936 int64_t min_bitrate;
2937
2938 int64_t avg_bitrate;
2939
2940 int64_t buffer_size;
2941
2942 uint64_t vbv_delay;
2944
2946
2947typedef struct AVProducerReferenceTime {
2948
2949 int64_t wallclock;
2950 int flags;
2952
2953unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
2954
2955#define AVCODEC_PACKET_H
2956
2958
2960
2962
2964
2966
2968
2970
2972
2974
2976
2978
2980
2982
2984
2986
2988
2990
2992
2994
2996
2998
3000
3002
3004
3006
3008
3010
3012
3014
3016
3018
3020
3022
3025
3026#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS
3027
3028typedef struct AVPacketSideData {
3029 uint8_t *data;
3030 size_t size;
3033
3034typedef struct AVPacket {
3035
3037
3038 int64_t pts;
3039
3040 int64_t dts;
3041 uint8_t *data;
3042 int size;
3043 int stream_index;
3044
3045 int flags;
3046
3048 int side_data_elems;
3049
3050 int64_t duration;
3051
3052 int64_t pos;
3053
3054 void *opaque;
3055
3057
3060
3062typedef struct AVPacketList {
3063 AVPacket pkt;
3064 struct AVPacketList *next;
3066
3067#define AV_PKT_FLAG_KEY 0x0001
3068#define AV_PKT_FLAG_CORRUPT 0x0002
3069
3070#define AV_PKT_FLAG_DISCARD 0x0004
3071
3072#define AV_PKT_FLAG_TRUSTED 0x0008
3073
3074#define AV_PKT_FLAG_DISPOSABLE 0x0010
3075
3077
3082};
3083
3085
3087
3089
3092
3094
3096
3097int av_grow_packet(AVPacket *pkt, int grow_by);
3098
3099int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
3100
3102 size_t size);
3103
3105 uint8_t *data, size_t size);
3106
3108 size_t size);
3109
3111 size_t *size);
3112
3114
3116
3117int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
3118 AVDictionary **dict);
3119
3121
3122int av_packet_ref(AVPacket *dst, const AVPacket *src);
3123
3125
3127
3129
3131
3133
3135
3136#define AVCODEC_VERSION_H
3137
3138#define LIBAVCODEC_VERSION_MINOR 3
3139#define LIBAVCODEC_VERSION_MICRO 100
3140
3141#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3142 LIBAVCODEC_VERSION_MINOR, \
3143 LIBAVCODEC_VERSION_MICRO)
3144#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
3145 LIBAVCODEC_VERSION_MINOR, \
3146 LIBAVCODEC_VERSION_MICRO)
3147#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
3148
3149#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
3150
3151#define AV_INPUT_BUFFER_MIN_SIZE 16384
3152
3153typedef struct RcOverride{
3154 int start_frame;
3155 int end_frame;
3156 int qscale;
3157 float quality_factor;
3159
3160#define AV_CODEC_FLAG_UNALIGNED (1 << 0)
3161
3162#define AV_CODEC_FLAG_QSCALE (1 << 1)
3163
3164#define AV_CODEC_FLAG_4MV (1 << 2)
3165
3166#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3)
3167
3168#define AV_CODEC_FLAG_QPEL (1 << 4)
3169
3170#define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
3171
3172#define AV_CODEC_FLAG_RECON_FRAME (1 << 6)
3173
3174#define AV_CODEC_FLAG_COPY_OPAQUE (1 << 7)
3175
3176#define AV_CODEC_FLAG_FRAME_DURATION (1 << 8)
3177
3178#define AV_CODEC_FLAG_PASS1 (1 << 9)
3179
3180#define AV_CODEC_FLAG_PASS2 (1 << 10)
3181
3182#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11)
3183
3184#define AV_CODEC_FLAG_GRAY (1 << 13)
3185
3186#define AV_CODEC_FLAG_PSNR (1 << 15)
3187
3188#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18)
3189
3190#define AV_CODEC_FLAG_LOW_DELAY (1 << 19)
3191
3192#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
3193
3194#define AV_CODEC_FLAG_BITEXACT (1 << 23)
3195
3196#define AV_CODEC_FLAG_AC_PRED (1 << 24)
3197
3198#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29)
3199#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31)
3200
3201#define AV_CODEC_FLAG2_FAST (1 << 0)
3202
3203#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2)
3204
3205#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
3206
3207#define AV_CODEC_FLAG2_CHUNKS (1 << 15)
3208
3209#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16)
3210
3211#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22)
3212
3213#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28)
3214
3215#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29)
3216
3217#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30)
3218
3219#define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31)
3220
3221#define AV_CODEC_EXPORT_DATA_MVS (1 << 0)
3222
3223#define AV_CODEC_EXPORT_DATA_PRFT (1 << 1)
3224
3225#define AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS (1 << 2)
3226
3227#define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3)
3228
3229#define AV_GET_BUFFER_FLAG_REF (1 << 0)
3230
3231#define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0)
3232
3233struct AVCodecInternal;
3234
3235typedef struct AVCodecContext {
3236
3237 const AVClass *av_class;
3238 int log_level_offset;
3239
3240 enum AVMediaType codec_type;
3241 const struct AVCodec *codec;
3242 enum AVCodecID codec_id;
3243
3244 unsigned int codec_tag;
3245
3246 void *priv_data;
3247
3248 struct AVCodecInternal *internal;
3249
3250 void *opaque;
3251
3252 int64_t bit_rate;
3253
3255
3256 int global_quality;
3257
3259#define FF_COMPRESSION_DEFAULT -1
3260
3261 int flags;
3262
3263 int flags2;
3264
3265 uint8_t *extradata;
3266 int extradata_size;
3267
3269
3270 int ticks_per_frame;
3271
3272 int delay;
3273
3274 int width, height;
3275
3277
3278 int gop_size;
3279
3281
3282 void (*draw_horiz_band)(struct AVCodecContext *s,
3283 const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
3284 int y, int type, int height);
3285
3286 enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
3287
3288 int max_b_frames;
3289
3290 float b_quant_factor;
3291
3292 float b_quant_offset;
3293
3294 int has_b_frames;
3295
3296 float i_quant_factor;
3297
3298 float i_quant_offset;
3299
3300 float lumi_masking;
3301
3303
3305
3306 float p_masking;
3307
3308 float dark_masking;
3309
3310 int slice_count;
3311
3312 int *slice_offset;
3313
3315
3316 int me_cmp;
3317
3318 int me_sub_cmp;
3319
3320 int mb_cmp;
3321
3322 int ildct_cmp;
3323#define FF_CMP_SAD 0
3324#define FF_CMP_SSE 1
3325#define FF_CMP_SATD 2
3326#define FF_CMP_DCT 3
3327#define FF_CMP_PSNR 4
3328#define FF_CMP_BIT 5
3329#define FF_CMP_RD 6
3330#define FF_CMP_ZERO 7
3331#define FF_CMP_VSAD 8
3332#define FF_CMP_VSSE 9
3333#define FF_CMP_NSSE 10
3334#define FF_CMP_W53 11
3335#define FF_CMP_W97 12
3336#define FF_CMP_DCTMAX 13
3337#define FF_CMP_DCT264 14
3338#define FF_CMP_MEDIAN_SAD 15
3339#define FF_CMP_CHROMA 256
3340
3341 int dia_size;
3342
3344
3345 int me_pre_cmp;
3346
3347 int pre_dia_size;
3348
3350
3351 int me_range;
3352
3353 int slice_flags;
3354#define SLICE_FLAG_CODED_ORDER 0x0001
3355#define SLICE_FLAG_ALLOW_FIELD 0x0002
3356#define SLICE_FLAG_ALLOW_PLANE 0x0004
3357
3358 int mb_decision;
3359#define FF_MB_DECISION_SIMPLE 0
3360#define FF_MB_DECISION_BITS 1
3361#define FF_MB_DECISION_RD 2
3362
3363 uint16_t *intra_matrix;
3364
3365 uint16_t *inter_matrix;
3366
3368
3369 int skip_top;
3370
3371 int skip_bottom;
3372
3373 int mb_lmin;
3374
3375 int mb_lmax;
3376
3377 int bidir_refine;
3378
3379 int keyint_min;
3380
3381 int refs;
3382
3383 int mv0_threshold;
3384
3386
3388
3390
3392
3394
3395 int slices;
3396
3398
3399 int sample_rate;
3400
3403
3405
3406 int frame_size;
3407
3410
3411 int block_align;
3412
3413 int cutoff;
3414
3417
3420
3422
3424
3425 int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
3426
3427 float qcompress;
3428 float qblur;
3429
3430 int qmin;
3431
3432 int qmax;
3433
3434 int max_qdiff;
3435
3436 int rc_buffer_size;
3437
3440
3441 int64_t rc_max_rate;
3442
3443 int64_t rc_min_rate;
3444
3446
3448
3450
3451 int trellis;
3452
3453 char *stats_out;
3454
3455 char *stats_in;
3456
3457 int workaround_bugs;
3458#define FF_BUG_AUTODETECT 1
3459#define FF_BUG_XVID_ILACE 4
3460#define FF_BUG_UMP4 8
3461#define FF_BUG_NO_PADDING 16
3462#define FF_BUG_AMV 32
3463#define FF_BUG_QPEL_CHROMA 64
3464#define FF_BUG_STD_QPEL 128
3465#define FF_BUG_QPEL_CHROMA2 256
3466#define FF_BUG_DIRECT_BLOCKSIZE 512
3467#define FF_BUG_EDGE 1024
3468#define FF_BUG_HPEL_CHROMA 2048
3469#define FF_BUG_DC_CLIP 4096
3470#define FF_BUG_MS 8192
3471#define FF_BUG_TRUNCATED 16384
3472#define FF_BUG_IEDGE 32768
3473
3475
3477#define FF_EC_GUESS_MVS 1
3478#define FF_EC_DEBLOCK 2
3479#define FF_EC_FAVOR_INTER 256
3480
3481 int debug;
3482#define FF_DEBUG_PICT_INFO 1
3483#define FF_DEBUG_RC 2
3484#define FF_DEBUG_BITSTREAM 4
3485#define FF_DEBUG_MB_TYPE 8
3486#define FF_DEBUG_QP 16
3487#define FF_DEBUG_DCT_COEFF 0x00000040
3488#define FF_DEBUG_SKIP 0x00000080
3489#define FF_DEBUG_STARTCODE 0x00000100
3490#define FF_DEBUG_ER 0x00000400
3491#define FF_DEBUG_MMCO 0x00000800
3492#define FF_DEBUG_BUGS 0x00001000
3493#define FF_DEBUG_BUFFERS 0x00008000
3494#define FF_DEBUG_THREADS 0x00010000
3495#define FF_DEBUG_GREEN_MD 0x00800000
3496#define FF_DEBUG_NOMC 0x01000000
3497
3498 int err_recognition;
3499
3502
3503 const struct AVHWAccel *hwaccel;
3504
3505 void *hwaccel_context;
3506
3507 uint64_t error[AV_NUM_DATA_POINTERS];
3508
3509 int dct_algo;
3510#define FF_DCT_AUTO 0
3511#define FF_DCT_FASTINT 1
3512#define FF_DCT_INT 2
3513#define FF_DCT_MMX 3
3514#define FF_DCT_ALTIVEC 5
3515#define FF_DCT_FAAN 6
3516
3517 int idct_algo;
3518#define FF_IDCT_AUTO 0
3519#define FF_IDCT_INT 1
3520#define FF_IDCT_SIMPLE 2
3521#define FF_IDCT_SIMPLEMMX 3
3522#define FF_IDCT_ARM 7
3523#define FF_IDCT_ALTIVEC 8
3524#define FF_IDCT_SIMPLEARM 10
3525#define FF_IDCT_XVID 14
3526#define FF_IDCT_SIMPLEARMV5TE 16
3527#define FF_IDCT_SIMPLEARMV6 17
3528#define FF_IDCT_FAAN 20
3529#define FF_IDCT_SIMPLENEON 22
3530
3531#define FF_IDCT_NONE 24
3532#define FF_IDCT_SIMPLEAUTO 128
3533
3535
3537
3538 int lowres;
3539
3540 int thread_count;
3541
3542 int thread_type;
3543#define FF_THREAD_FRAME 1
3544#define FF_THREAD_SLICE 2
3545
3547
3548 int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
3549
3550 int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
3551
3552 int nsse_weight;
3553
3554 int profile;
3555#define FF_PROFILE_UNKNOWN -99
3556#define FF_PROFILE_RESERVED -100
3557
3558#define FF_PROFILE_AAC_MAIN 0
3559#define FF_PROFILE_AAC_LOW 1
3560#define FF_PROFILE_AAC_SSR 2
3561#define FF_PROFILE_AAC_LTP 3
3562#define FF_PROFILE_AAC_HE 4
3563#define FF_PROFILE_AAC_HE_V2 28
3564#define FF_PROFILE_AAC_LD 22
3565#define FF_PROFILE_AAC_ELD 38
3566#define FF_PROFILE_MPEG2_AAC_LOW 128
3567#define FF_PROFILE_MPEG2_AAC_HE 131
3568
3569#define FF_PROFILE_DNXHD 0
3570#define FF_PROFILE_DNXHR_LB 1
3571#define FF_PROFILE_DNXHR_SQ 2
3572#define FF_PROFILE_DNXHR_HQ 3
3573#define FF_PROFILE_DNXHR_HQX 4
3574#define FF_PROFILE_DNXHR_444 5
3575
3576#define FF_PROFILE_DTS 20
3577#define FF_PROFILE_DTS_ES 30
3578#define FF_PROFILE_DTS_96_24 40
3579#define FF_PROFILE_DTS_HD_HRA 50
3580#define FF_PROFILE_DTS_HD_MA 60
3581#define FF_PROFILE_DTS_EXPRESS 70
3582
3583#define FF_PROFILE_MPEG2_422 0
3584#define FF_PROFILE_MPEG2_HIGH 1
3585#define FF_PROFILE_MPEG2_SS 2
3586#define FF_PROFILE_MPEG2_SNR_SCALABLE 3
3587#define FF_PROFILE_MPEG2_MAIN 4
3588#define FF_PROFILE_MPEG2_SIMPLE 5
3589
3590#define FF_PROFILE_H264_CONSTRAINED (1<<9)
3591#define FF_PROFILE_H264_INTRA (1<<11)
3592
3593#define FF_PROFILE_H264_BASELINE 66
3594#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
3595#define FF_PROFILE_H264_MAIN 77
3596#define FF_PROFILE_H264_EXTENDED 88
3597#define FF_PROFILE_H264_HIGH 100
3598#define FF_PROFILE_H264_HIGH_10 110
3599#define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
3600#define FF_PROFILE_H264_MULTIVIEW_HIGH 118
3601#define FF_PROFILE_H264_HIGH_422 122
3602#define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
3603#define FF_PROFILE_H264_STEREO_HIGH 128
3604#define FF_PROFILE_H264_HIGH_444 144
3605#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
3606#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
3607#define FF_PROFILE_H264_CAVLC_444 44
3608
3609#define FF_PROFILE_VC1_SIMPLE 0
3610#define FF_PROFILE_VC1_MAIN 1
3611#define FF_PROFILE_VC1_COMPLEX 2
3612#define FF_PROFILE_VC1_ADVANCED 3
3613
3614#define FF_PROFILE_MPEG4_SIMPLE 0
3615#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
3616#define FF_PROFILE_MPEG4_CORE 2
3617#define FF_PROFILE_MPEG4_MAIN 3
3618#define FF_PROFILE_MPEG4_N_BIT 4
3619#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
3620#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
3621#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
3622#define FF_PROFILE_MPEG4_HYBRID 8
3623#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
3624#define FF_PROFILE_MPEG4_CORE_SCALABLE 10
3625#define FF_PROFILE_MPEG4_ADVANCED_CODING 11
3626#define FF_PROFILE_MPEG4_ADVANCED_CORE 12
3627#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
3628#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
3629#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
3630
3631#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
3632#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
3633#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
3634#define FF_PROFILE_JPEG2000_DCINEMA_2K 3
3635#define FF_PROFILE_JPEG2000_DCINEMA_4K 4
3636
3637#define FF_PROFILE_VP9_0 0
3638#define FF_PROFILE_VP9_1 1
3639#define FF_PROFILE_VP9_2 2
3640#define FF_PROFILE_VP9_3 3
3641
3642#define FF_PROFILE_HEVC_MAIN 1
3643#define FF_PROFILE_HEVC_MAIN_10 2
3644#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
3645#define FF_PROFILE_HEVC_REXT 4
3646
3647#define FF_PROFILE_VVC_MAIN_10 1
3648#define FF_PROFILE_VVC_MAIN_10_444 33
3649
3650#define FF_PROFILE_AV1_MAIN 0
3651#define FF_PROFILE_AV1_HIGH 1
3652#define FF_PROFILE_AV1_PROFESSIONAL 2
3653
3654#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
3655#define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
3656#define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
3657#define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
3658#define FF_PROFILE_MJPEG_JPEG_LS 0xf7
3659
3660#define FF_PROFILE_SBC_MSBC 1
3661
3662#define FF_PROFILE_PRORES_PROXY 0
3663#define FF_PROFILE_PRORES_LT 1
3664#define FF_PROFILE_PRORES_STANDARD 2
3665#define FF_PROFILE_PRORES_HQ 3
3666#define FF_PROFILE_PRORES_4444 4
3667#define FF_PROFILE_PRORES_XQ 5
3668
3669#define FF_PROFILE_ARIB_PROFILE_A 0
3670#define FF_PROFILE_ARIB_PROFILE_C 1
3671
3672#define FF_PROFILE_KLVA_SYNC 0
3673#define FF_PROFILE_KLVA_ASYNC 1
3674
3675 int level;
3676#define FF_LEVEL_UNKNOWN -99
3677
3679
3680 enum AVDiscard skip_idct;
3681
3682 enum AVDiscard skip_frame;
3683
3684 uint8_t *subtitle_header;
3686
3687 int initial_padding;
3688
3690
3692
3694
3696
3699 int64_t pts_correction_last_pts;
3700 int64_t pts_correction_last_dts;
3701
3702 char *sub_charenc;
3703
3704 int sub_charenc_mode;
3705#define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3706#define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3707#define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3708#define FF_SUB_CHARENC_MODE_IGNORE 2
3709
3710 int skip_alpha;
3711
3712 int seek_preroll;
3713
3714 uint16_t *chroma_intra_matrix;
3715
3716 uint8_t *dump_separator;
3717
3718 char *codec_whitelist;
3719
3720 unsigned properties;
3721#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001
3722#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
3723#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004
3724
3727
3729
3730 int trailing_padding;
3731
3732 int64_t max_pixels;
3733
3735
3736 int hwaccel_flags;
3737
3738 int apply_cropping;
3739
3740 int extra_hw_frames;
3741
3743
3744 int64_t max_samples;
3745
3746 int export_side_data;
3747
3748 int (*get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int flags);
3749
3751
3752 int64_t frame_num;
3754
3755typedef struct AVHWAccel {
3756
3757 const char *name;
3758
3759 enum AVMediaType type;
3760
3761 enum AVCodecID id;
3762
3764
3765 int capabilities;
3766
3767 int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame);
3768
3769 int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3770
3771 int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size);
3772
3773 int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3774
3775 int (*end_frame)(AVCodecContext *avctx);
3776
3778
3779 int (*init)(AVCodecContext *avctx);
3780
3781 int (*uninit)(AVCodecContext *avctx);
3782
3783 int priv_data_size;
3784
3785 int caps_internal;
3786
3787 int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx);
3789
3790#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200
3791
3792#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
3793
3794#define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1)
3795
3796#define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2)
3797
3798#define AV_HWACCEL_FLAG_UNSAFE_OUTPUT (1 << 3)
3799
3802
3804
3806
3808};
3809
3810#define AV_SUBTITLE_FLAG_FORCED 0x00000001
3811
3812typedef struct AVSubtitleRect {
3813 int x;
3814 int y;
3815 int w;
3816 int h;
3817 int nb_colors;
3818
3819 uint8_t *data[4];
3820 int linesize[4];
3821
3822 enum AVSubtitleType type;
3823
3824 char *text;
3825
3826 char *ass;
3827
3828 int flags;
3830
3831typedef struct AVSubtitle {
3832 uint16_t format;
3833 uint32_t start_display_time;
3834 uint32_t end_display_time;
3835 unsigned num_rects;
3837 int64_t pts;
3839
3840unsigned avcodec_version(void);
3841
3842const char *avcodec_configuration(void);
3843
3844const char *avcodec_license(void);
3845
3847
3849
3851
3853
3855 const AVCodecContext *codec);
3856
3858 const AVCodecParameters *par);
3859
3860int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
3861
3863
3865
3867
3869
3870void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);