34#define AVSC_NO_DECLSPEC
41 #define AVISYNTH_LIB "avisynth"
44 #define AVISYNTH_NAME "libavisynth"
45 #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF
50 #define PCM(format) (AV_CODEC_ID_PCM_ ## format ## BE)
52 #define PCM(format) (AV_CODEC_ID_PCM_ ## format ## LE)
55#include <avisynth/avisynth_c.h>
59#define AVSC_DECLARE_FUNC(name) name ## _func name
88#undef AVSC_DECLARE_FUNC
103 AVS_ScriptEnvironment *
env;
105 const AVS_VideoInfo *
vi;
127#define LOAD_AVS_FUNC(name, continue_on_fail) \
128 avs->avs_library.name = (name ## _func) \
129 dlsym(avs->avs_library.library, #name); \
130 if (!continue_on_fail && !avs->avs_library.name) \
210 const AVS_Map *avsmap;
211 AVS_VideoFrame *
frame;
217 static const int avs_planes_packed[1] = { 0 };
218 static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
219 static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
221 static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
223 static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
224 AVS_PLANAR_V, AVS_PLANAR_A };
225 static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
226 AVS_PLANAR_R, AVS_PLANAR_A };
234 avs->
vi->fps_denominator };
241 switch (avs->
vi->pixel_type) {
243 case AVS_CS_YUV444P10:
247 case AVS_CS_YUV422P10:
251 case AVS_CS_YUV420P10:
255 case AVS_CS_YUV444P12:
259 case AVS_CS_YUV422P12:
263 case AVS_CS_YUV420P12:
267 case AVS_CS_YUV444P14:
271 case AVS_CS_YUV422P14:
275 case AVS_CS_YUV420P14:
279 case AVS_CS_YUV444P16:
283 case AVS_CS_YUV422P16:
287 case AVS_CS_YUV420P16:
304 case AVS_CS_YUVA444P10:
308 case AVS_CS_YUVA422P10:
312 case AVS_CS_YUVA420P10:
316 case AVS_CS_YUVA422P12:
320 case AVS_CS_YUVA444P16:
324 case AVS_CS_YUVA422P16:
328 case AVS_CS_YUVA420P16:
446 "unknown AviSynth colorspace %d\n", avs->
vi->pixel_type);
454 avs->
planes = avs_planes_rgba;
458 avs->
planes = avs_planes_yuva;
462 avs->
planes = avs_planes_rgb;
466 avs->
planes = avs_planes_grey;
470 avs->
planes = avs_planes_yuv;
474 avs->
planes = avs_planes_packed;
493 if(avs->
avs_library.avs_prop_get_type(avs->
env, avsmap,
"_FieldBased") == AVS_PROPTYPE_UNSET) {
514 if(avs->
avs_library.avs_prop_get_type(avs->
env, avsmap,
"_ColorRange") == AVS_PROPTYPE_UNSET) {
635 if(avs->
avs_library.avs_prop_get_type(avs->
env, avsmap,
"_Matrix") == AVS_PROPTYPE_UNSET) {
689 if(avs->
avs_library.avs_prop_get_type(avs->
env, avsmap,
"_ChromaLocation") == AVS_PROPTYPE_UNSET) {
692 switch (avs->
avs_library.avs_prop_get_int(avs->
env, avsmap,
"_ChromaLocation", 0, &
error)) {
730 if (avs_is_field_based(avs->
vi) == 0) {
731 if (avs_is_tff(avs->
vi)) {
734 else if (avs_is_bff(avs->
vi)) {
757 switch (avs->
vi->sample_type) {
758 case AVS_SAMPLE_INT8:
761 case AVS_SAMPLE_INT16:
764 case AVS_SAMPLE_INT24:
767 case AVS_SAMPLE_INT32:
770 case AVS_SAMPLE_FLOAT:
775 "unknown AviSynth sample type %d\n", avs->
vi->sample_type);
789 if (avs_has_video(avs->
vi)) {
797 if (avs_has_audio(avs->
vi)) {
819 avs_new_value_string(
s->url),
820 avs_new_value_bool(1)
823 avs_new_value_array(args, 2), 0);
829 if (utf8toansi(
s->url, &filename_ansi)) {
833 arg = avs_new_value_string(filename_ansi);
835 arg = avs_new_value_string(
s->url);
843 if (avs_is_error(
val)) {
848 if (!avs_is_clip(
val)) {
863 "AviSynth version is too old. Please upgrade to either AviSynth 2.6 >= RC1 or AviSynth+ >= r1718.\n");
903 AVS_VideoFrame *
frame;
904 unsigned char *dst_p;
905 const unsigned char *src_p;
906 int n,
i, plane, rowsize, planeheight, pitch,
bits, ret;
953 if (avs->
avs_library.avs_is_color_space(avs->
vi, AVS_CS_BGR) ||
954 avs->
avs_library.avs_is_color_space(avs->
vi, AVS_CS_BGR48) ||
955 avs->
avs_library.avs_is_color_space(avs->
vi, AVS_CS_BGR64)) {
956 src_p = src_p + (planeheight - 1) * pitch;
960 avs->
avs_library.avs_bit_blt(avs->
env, dst_p, rowsize, src_p, pitch,
961 rowsize, planeheight);
962 dst_p += rowsize * planeheight;
981 fps.
num = avs->
vi->fps_numerator;
982 fps.
den = avs->
vi->fps_denominator;
983 samplerate.
num = avs->
vi->audio_samples_per_second;
986 if (avs_has_video(avs->
vi)) {
1003 if (avs->
curr_sample + samples > avs->
vi->num_audio_samples)
1012 pkt->size = avs_bytes_per_channel_sample(avs->
vi) *
1013 samples * avs->
vi->nchannels;
1022 pkt->duration = samples;
1099 avs->
vi->fps_denominator };
1100 samplerate = (
AVRational) { avs->
vi->audio_samples_per_second, 1 };
1102 st =
s->streams[stream_index];
1105 if ((timestamp >= avs->
vi->num_frames) ||
1106 (timestamp > INT_MAX) ||
1110 if (avs_has_audio(avs->
vi))
1113 if ((timestamp >= avs->
vi->num_audio_samples) || (timestamp < 0))
1116 if (avs_has_video(avs->
vi)) {
1127#define AVISYNTH_FRAMEPROP_DEFAULT AVISYNTH_FRAMEPROP_FIELD_ORDER | AVISYNTH_FRAMEPROP_RANGE | \
1128 AVISYNTH_FRAMEPROP_PRIMARIES | AVISYNTH_FRAMEPROP_TRANSFER | \
1129 AVISYNTH_FRAMEPROP_MATRIX | AVISYNTH_FRAMEPROP_CHROMA_LOCATION
1130#define OFFSET(x) offsetof(AviSynthContext, x)
1144 .class_name =
"AviSynth demuxer",
1151 .p.name =
"avisynth",
1153 .p.extensions =
"avs",
static double val(void *priv, double ch)
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(const uint8_t *) pi - 0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(const int16_t *) pi > >8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1<< 16)) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(const int16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(const int32_t *) pi > >24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(const int32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(const int64_t *) pi > >56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0f/(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(const float *) pi *(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(const double *) pi *(UINT64_C(1)<< 63))) #define FMT_PAIR_FUNC(out, in) static conv_func_type *const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={ FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64), };static void cpy1(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, len);} static void cpy2(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 2 *len);} static void cpy4(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 4 *len);} static void cpy8(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 8 *len);} AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags) { AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) return NULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) return NULL;if(channels==1){ in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);} ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map) { switch(av_get_bytes_per_sample(in_fmt)){ case 1:ctx->simd_f=cpy1;break;case 2:ctx->simd_f=cpy2;break;case 4:ctx->simd_f=cpy4;break;case 8:ctx->simd_f=cpy8;break;} } return ctx;} void swri_audio_convert_free(AudioConvert **ctx) { av_freep(ctx);} int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len) { int ch;int off=0;const int os=(out->planar ? 1 :out->ch_count) *out->bps;unsigned misaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask) { int planes=in->planar ? in->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;} if(ctx->out_simd_align_mask) { int planes=out->planar ? out->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;} if(ctx->simd_f &&!ctx->ch_map &&!misaligned){ off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){ if(out->planar==in->planar){ int planes=out->planar ? out->ch_count :1;for(ch=0;ch< planes;ch++){ ctx->simd_f(out->ch+ch,(const uint8_t **) in->ch+ch, off *(out-> planar
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static av_cold int avisynth_context_create(AVFormatContext *s)
#define AVISYNTH_FRAMEPROP_DEFAULT
static int avisynth_create_stream(AVFormatContext *s)
static int avisynth_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
#define LOAD_AVS_FUNC(name, continue_on_fail)
static av_cold int avisynth_read_header(AVFormatContext *s)
static void avisynth_next_stream(AVFormatContext *s, AVStream **st, AVPacket *pkt, int *discard)
static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, int discard)
static av_cold void avisynth_context_destroy(AviSynthContext *avs)
static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt)
static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st)
static const AVClass avisynth_demuxer_class
@ AVISYNTH_FRAMEPROP_PRIMARIES
@ AVISYNTH_FRAMEPROP_MATRIX
@ AVISYNTH_FRAMEPROP_FIELD_ORDER
@ AVISYNTH_FRAMEPROP_RANGE
@ AVISYNTH_FRAMEPROP_CHROMA_LOCATION
@ AVISYNTH_FRAMEPROP_TRANSFER
static av_cold int avisynth_read_close(AVFormatContext *s)
static av_cold int avisynth_load_library(AviSynthContext *avs)
static int avisynth_open_file(AVFormatContext *s)
static const AVOption avisynth_options[]
static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, int discard)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
@ AV_FIELD_TT
Top coded_first, top displayed first.
@ AV_FIELD_BB
Bottom coded first, bottom displayed first.
static const uint8_t bits[8]
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
@ AVDISCARD_ALL
discard all
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_EOF
End of file.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define LIBAVUTIL_VERSION_INT
Macro definitions for various function/variable attributes.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Memory handling functions.
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_GBRPF32
#define AV_PIX_FMT_YUV444P12
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
@ AVCHROMA_LOC_BOTTOMLEFT
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
@ AVCHROMA_LOC_UNSPECIFIED
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_GBRAP16
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_GRAYF32
#define AV_PIX_FMT_YUV420P14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GBRAP10
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_PRI_FILM
colour filters using Illuminant C
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_SMPTE240M
identical to above, also called "SMPTE C" even though it uses D65
@ AVCOL_PRI_EBU3213
EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors.
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
@ AVCOL_PRI_SMPTE428
SMPTE ST 428-1 (CIE 1931 XYZ)
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
@ AVCOL_PRI_BT2020
ITU-R BT2020.
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
@ AVCOL_TRC_BT709
also ITU-R BT1361
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P10
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
@ AVCOL_SPC_CHROMA_DERIVED_CL
Chromaticity-derived constant luminance system.
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
@ AVCOL_SPC_SMPTE2085
SMPTE 2085, Y'D'zD'x.
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
@ AVCOL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
@ AVCOL_SPC_CHROMA_DERIVED_NCL
Chromaticity-derived non-constant luminance system.
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
@ AVCOL_SPC_YCGCO
used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
@ AVCOL_SPC_ICTCP
ITU-R BT.2100-0, ICtCp.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
enum AVColorSpace color_space
enum AVFieldOrder field_order
The order of the fields in interlaced video.
int height
The height of the video frame in pixels.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
enum AVColorPrimaries color_primaries
int sample_rate
The number of audio samples per second.
enum AVColorTransferCharacteristic color_trc
enum AVChromaLocation chroma_location
enum AVColorRange color_range
Additional colorspace characteristics.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int id
Format-specific stream ID.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
AVRational avg_frame_rate
Average framerate.
AVS_ScriptEnvironment * env
struct AviSynthLibrary avs_library
AVSC_DECLARE_FUNC(avs_get_channel_mask)
AVSC_DECLARE_FUNC(avs_bits_per_pixel)
AVSC_DECLARE_FUNC(avs_get_video_info)
AVSC_DECLARE_FUNC(avs_get_read_ptr_p)
AVSC_DECLARE_FUNC(avs_is_planar_rgb)
AVSC_DECLARE_FUNC(avs_get_frame)
AVSC_DECLARE_FUNC(avs_release_video_frame)
AVSC_DECLARE_FUNC(avs_get_height_p)
AVSC_DECLARE_FUNC(avs_clip_get_error)
AVSC_DECLARE_FUNC(avs_prop_get_type)
AVSC_DECLARE_FUNC(avs_release_value)
AVSC_DECLARE_FUNC(avs_get_version)
AVSC_DECLARE_FUNC(avs_take_clip)
AVSC_DECLARE_FUNC(avs_is_planar_rgba)
AVSC_DECLARE_FUNC(avs_delete_script_environment)
AVSC_DECLARE_FUNC(avs_get_error)
AVSC_DECLARE_FUNC(avs_create_script_environment)
AVSC_DECLARE_FUNC(avs_get_frame_props_ro)
AVSC_DECLARE_FUNC(avs_get_env_property)
AVSC_DECLARE_FUNC(avs_check_version)
AVSC_DECLARE_FUNC(avs_invoke)
AVSC_DECLARE_FUNC(avs_prop_get_int)
AVSC_DECLARE_FUNC(avs_get_audio)
AVSC_DECLARE_FUNC(avs_get_pitch_p)
AVSC_DECLARE_FUNC(avs_is_color_space)
AVSC_DECLARE_FUNC(avs_bit_blt)
AVSC_DECLARE_FUNC(avs_release_clip)
AVSC_DECLARE_FUNC(avs_get_row_size_p)
static void error(const char *err)