FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
avisynth_c.h
Go to the documentation of this file.
1 // Avisynth C Interface Version 0.20
2 // Copyright 2003 Kevin Atkinson
3 
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 // MA 02110-1301 USA, or visit
18 // http://www.gnu.org/copyleft/gpl.html .
19 //
20 // As a special exception, I give you permission to link to the
21 // Avisynth C interface with independent modules that communicate with
22 // the Avisynth C interface solely through the interfaces defined in
23 // avisynth_c.h, regardless of the license terms of these independent
24 // modules, and to copy and distribute the resulting combined work
25 // under terms of your choice, provided that every copy of the
26 // combined work is accompanied by a complete copy of the source code
27 // of the Avisynth C interface and Avisynth itself (with the version
28 // used to produce the combined work), being distributed under the
29 // terms of the GNU General Public License plus this exception. An
30 // independent module is a module which is not derived from or based
31 // on Avisynth C Interface, such as 3rd-party filters, import and
32 // export plugins, or graphical user interfaces.
33 
34 // NOTE: this is a partial update of the Avisynth C interface to recognize
35 // new color spaces added in Avisynth 2.60. By no means is this document
36 // completely Avisynth 2.60 compliant.
37 
38 #ifndef __AVISYNTH_C__
39 #define __AVISYNTH_C__
40 
41 #include "avs/config.h"
42 #include "avs/capi.h"
43 #include "avs/types.h"
44 
45 
46 /////////////////////////////////////////////////////////////////////
47 //
48 // Constants
49 //
50 
51 #ifndef __AVISYNTH_6_H__
53 #endif
54 
55 enum {AVS_SAMPLE_INT8 = 1<<0,
60 
61 enum {AVS_PLANAR_Y=1<<0,
76 
77  // Colorspace properties.
78 enum {
79  AVS_CS_YUVA = 1 << 27,
80  AVS_CS_BGR = 1 << 28,
81  AVS_CS_YUV = 1 << 29,
82  AVS_CS_INTERLEAVED = 1 << 30,
83  AVS_CS_PLANAR = 1 << 31,
84 
88 
91  AVS_CS_SUB_WIDTH_2 = 0 << AVS_CS_SHIFT_SUB_WIDTH, // YV12, I420, YV16
93 
94  AVS_CS_VPLANEFIRST = 1 << 3, // YV12, YV16, YV24, YV411, YUV9
95  AVS_CS_UPLANEFIRST = 1 << 4, // I420
96 
98  AVS_CS_SUB_HEIGHT_1 = 3 << AVS_CS_SHIFT_SUB_HEIGHT, // YV16, YV24, YV411
101 
109 
112 
113  AVS_CS_RGB_TYPE = 1 << 0,
115 
125 
126 
127  // Specific colorformats
128 enum {
133  // AVS_CS_YV12 = 1<<3 Reserved
134  // AVS_CS_I420 = 1<<4 Reserved
136 
145 
146  //-------------------------
147  // AVS16: new planar constants go live! Experimental PF 160613
148  // 10-12-14 bit + planar RGB + BRG48/64 160725
152  AVS_CS_Y10 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_10, // Y 4:0:0 10bit samples
153 
157  AVS_CS_Y12 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_12, // Y 4:0:0 12bit samples
158 
162  AVS_CS_Y14 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_14, // Y 4:0:0 14bit samples
163 
167  AVS_CS_Y16 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_16, // Y 4:0:0 16bit samples
168 
169  // 32 bit samples (float)
173  AVS_CS_Y32 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_32, // Y 4:0:0 32bit samples
174 
175  // RGB packed
178  // no packed 32 bit (float) support for these legacy types
179 
180  // RGB planar
181  AVS_CS_RGBP = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_8, // Planar RGB 8 bit samples
182  AVS_CS_RGBP10 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_10, // Planar RGB 10bit samples
183  AVS_CS_RGBP12 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_12, // Planar RGB 12bit samples
184  AVS_CS_RGBP14 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_14, // Planar RGB 14bit samples
185  AVS_CS_RGBP16 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_16, // Planar RGB 16bit samples
186  AVS_CS_RGBPS = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_32, // Planar RGB 32bit samples
187 
188  // RGBA planar
189  AVS_CS_RGBAP = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_8, // Planar RGBA 8 bit samples
194  AVS_CS_RGBAPS = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_32, // Planar RGBA 32bit samples
195 
196  // Planar YUVA
200 
204 
208 
212 
216 
220 
221 };
222 
223 enum {
224  AVS_IT_BFF = 1<<0,
225  AVS_IT_TFF = 1<<1,
227 
228 enum {
239 
240 enum { //SUBTYPES
245 
246 enum {
247  // New 2.6 explicitly defined cache hints.
248  AVS_CACHE_NOTHING=10, // Do not cache video.
249  AVS_CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N.
250  AVS_CACHE_GENERIC=12, // LRU cache upto X frames.
251  AVS_CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW.
252 
253  AVS_CACHE_GET_POLICY=30, // Get the current policy.
254  AVS_CACHE_GET_WINDOW=31, // Get the current window h_span.
255  AVS_CACHE_GET_RANGE=32, // Get the current generic frame range.
256 
257  AVS_CACHE_AUDIO=50, // Explicitly do cache audio, X byte cache.
258  AVS_CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio.
259  AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache.
260  AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache.
261 
262  AVS_CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy.
263  AVS_CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size.
264 
265  AVS_CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N.
266  AVS_CACHE_PREFETCH_GO=101, // Action video prefetches.
267 
268  AVS_CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section).
269  AVS_CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start.
270  AVS_CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start.
271  AVS_CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length.
272  AVS_CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section).
273  AVS_CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches.
274 
275  AVS_CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode.
276  AVS_CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size.
277  AVS_CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode.
278  AVS_CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size.
279 
280  AVS_CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost.
281  AVS_CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only).
282  AVS_CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit).
283  AVS_CACHE_COST_LOW=223, // Child response of light cost. (Fast)
284  AVS_CACHE_COST_MED=224, // Child response of medium cost. (Real time)
285  AVS_CACHE_COST_HI=225, // Child response of heavy cost. (Slow)
286 
287  AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness.
288  AVS_CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default!
289  AVS_CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default!
290  AVS_CACHE_THREAD_SAFE=243, // Allow all threads in any instance.
291  AVS_CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded.
292 
293  AVS_CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern.
294  AVS_CACHE_ACCESS_RAND=261, // Filter is access order agnostic.
295  AVS_CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost)
296  AVS_CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost)
297  };
298 
299 #ifdef BUILDING_AVSCORE
300 struct AVS_ScriptEnvironment {
301  IScriptEnvironment * env;
302  const char * error;
303  AVS_ScriptEnvironment(IScriptEnvironment * e = 0)
304  : env(e), error(0) {}
305 };
306 #endif
307 
308 typedef struct AVS_Clip AVS_Clip;
310 
311 /////////////////////////////////////////////////////////////////////
312 //
313 // AVS_VideoInfo
314 //
315 
316 // AVS_VideoInfo is layed out identicly to VideoInfo
317 typedef struct AVS_VideoInfo {
318  int width, height; // width=0 means no video
321 
323 
324  int audio_samples_per_second; // 0 means no audio
328 
329  // Imagetype properties
330 
332 } AVS_VideoInfo;
333 
334 // useful functions of the above
336  { return (p->width!=0); }
337 
339  { return (p->audio_samples_per_second!=0); }
340 
342  { return !!(p->pixel_type&AVS_CS_BGR); }
343 
346 
349 
351  { return !!(p->pixel_type&AVS_CS_YUV ); }
352 
354  { return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
355 
356 AVSC_API(int, avs_is_rgb48)(const AVS_VideoInfo * p);
357 
358 AVSC_API(int, avs_is_rgb64)(const AVS_VideoInfo * p);
359 
360 AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p);
361 
362 AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p);
363 
364 AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ;
365 
366 AVSC_API(int, avs_is_yv411)(const AVS_VideoInfo * p);
367 
368 AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p);
369 
370 AVSC_API(int, avs_is_yuv444p16)(const AVS_VideoInfo * p);
371 
372 AVSC_API(int, avs_is_yuv422p16)(const AVS_VideoInfo * p);
373 
374 AVSC_API(int, avs_is_yuv420p16)(const AVS_VideoInfo * p);
375 
376 AVSC_API(int, avs_is_y16)(const AVS_VideoInfo * p);
377 
378 AVSC_API(int, avs_is_yuv444ps)(const AVS_VideoInfo * p);
379 
380 AVSC_API(int, avs_is_yuv422ps)(const AVS_VideoInfo * p);
381 
382 AVSC_API(int, avs_is_yuv420ps)(const AVS_VideoInfo * p);
383 
384 AVSC_API(int, avs_is_y32)(const AVS_VideoInfo * p);
385 
386 AVSC_API(int, avs_is_444)(const AVS_VideoInfo * p);
387 
388 AVSC_API(int, avs_is_422)(const AVS_VideoInfo * p);
389 
390 AVSC_API(int, avs_is_420)(const AVS_VideoInfo * p);
391 
392 AVSC_API(int, avs_is_y)(const AVS_VideoInfo * p);
393 
394 AVSC_API(int, avs_is_yuva)(const AVS_VideoInfo * p);
395 
396 AVSC_API(int, avs_is_planar_rgb)(const AVS_VideoInfo * p);
397 
398 AVSC_API(int, avs_is_planar_rgba)(const AVS_VideoInfo * p);
399 
400 
401 
402 AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
403  { return ((p->image_type & property)==property ); }
404 
406  { return !!(p->pixel_type & AVS_CS_PLANAR); }
407 
409 
411  { return !!(p->image_type & AVS_IT_FIELDBASED); }
412 
414  { return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); }
415 
417  { return !!(p->image_type & AVS_IT_BFF); }
418 
420  { return !!(p->image_type & AVS_IT_TFF); }
421 
422 AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane);
423 
424 AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane);
425 
426 
427 AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p);
428 
430 
431 AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane);
432 
433 AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi);
434 
436  { return p->audio_samples_per_second; }
437 
438 
440 {
441  switch (p->sample_type) {
442  case AVS_SAMPLE_INT8: return sizeof(signed char);
443  case AVS_SAMPLE_INT16: return sizeof(signed short);
444  case AVS_SAMPLE_INT24: return 3;
445  case AVS_SAMPLE_INT32: return sizeof(signed int);
446  case AVS_SAMPLE_FLOAT: return sizeof(float);
447  default: return 0;
448  }
449 }
451  { return p->nchannels*avs_bytes_per_channel_sample(p);}
452 
454  { return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); }
455 
457  { return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); }
458 
460  { return bytes / avs_bytes_per_audio_sample(p); }
461 
463  { return samples * avs_bytes_per_audio_sample(p); }
464 
466  { return p->nchannels; }
467 
469  { return p->sample_type;}
470 
471 // useful mutator
473  { p->image_type|=property; }
474 
476  { p->image_type&=~property; }
477 
478 AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased)
479  { if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; }
480 
481 AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator)
482 {
483  unsigned x=numerator, y=denominator;
484  while (y) { // find gcd
485  unsigned t = x%y; x = y; y = t;
486  }
487  p->fps_numerator = numerator/x;
488  p->fps_denominator = denominator/x;
489 }
490 
491 #ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
493 {
494  return (x->pixel_type == y->pixel_type)
495  || (avs_is_yv12(x) && avs_is_yv12(y));
496 }
497 #endif
498 
499 AVSC_API(int, avs_num_components)(const AVS_VideoInfo * p);
500 
501 AVSC_API(int, avs_component_size)(const AVS_VideoInfo * p);
502 
503 AVSC_API(int, avs_bits_per_component)(const AVS_VideoInfo * p);
504 
505 /////////////////////////////////////////////////////////////////////
506 //
507 // AVS_VideoFrame
508 //
509 
510 // VideoFrameBuffer holds information about a memory block which is used
511 // for video data. For efficiency, instances of this class are not deleted
512 // when the refcount reaches zero; instead they're stored in a linked list
513 // to be reused. The instances are deleted when the corresponding AVS
514 // file is closed.
515 
516 // AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer
517 // DO NOT USE THIS STRUCTURE DIRECTLY
518 typedef struct AVS_VideoFrameBuffer {
521  // sequence_number is incremented every time the buffer is changed, so
522  // that stale views can tell they're no longer valid.
523  volatile long sequence_number;
524 
525  volatile long refcount;
527 
528 // VideoFrame holds a "window" into a VideoFrameBuffer.
529 
530 // AVS_VideoFrame is layed out identicly to IVideoFrame
531 // DO NOT USE THIS STRUCTURE DIRECTLY
532 typedef struct AVS_VideoFrame {
533  volatile long refcount;
535  int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
538 
539 // Access functions for AVS_VideoFrame
540 AVSC_API(int, avs_get_pitch_p)(const AVS_VideoFrame * p, int plane);
541 
542 #ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
544  return avs_get_pitch_p(p, 0);}
545 #endif
546 
547 AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane);
548 
550  return p->row_size; }
551 
552 AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane);
553 
555  return p->height;}
556 
557 AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane);
558 
559 #ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
561  return avs_get_read_ptr_p(p, 0);}
562 #endif
563 
564 AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p);
565 
567 
568 #ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
570  return avs_get_write_ptr_p(p, 0);}
571 #endif
572 
573 AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
574 // makes a shallow copy of a video frame
575 AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
576 
577 #ifndef AVSC_NO_DECLSPEC
579  {avs_release_video_frame(f);}
581  {return avs_copy_video_frame(f);}
582 #endif
583 
584 /////////////////////////////////////////////////////////////////////
585 //
586 // AVS_Value
587 //
588 
589 // Treat AVS_Value as a fat pointer. That is use avs_copy_value
590 // and avs_release_value appropiaty as you would if AVS_Value was
591 // a pointer.
592 
593 // To maintain source code compatibility with future versions of the
594 // avisynth_c API don't use the AVS_Value directly. Use the helper
595 // functions below.
596 
597 // AVS_Value is layed out identicly to AVSValue
598 typedef struct AVS_Value AVS_Value;
599 struct AVS_Value {
600  short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
601  // for some function e'rror
602  short array_size;
603  union {
604  void * clip; // do not use directly, use avs_take_clip
605  char boolean;
606  int integer;
607  float floating_pt;
608  const char * string;
609  const AVS_Value * array;
610  } d;
611 };
612 
613 // AVS_Value should be initilized with avs_void.
614 // Should also set to avs_void after the value is released
615 // with avs_copy_value. Consider it the equalvent of setting
616 // a pointer to NULL
617 static const AVS_Value avs_void = {'v'};
618 
619 AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src);
620 AVSC_API(void, avs_release_value)(AVS_Value);
621 
622 AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; }
623 AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; }
624 AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; }
625 AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; }
626 AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; }
627 AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; }
628 AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; }
629 AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; }
630 
631 AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
632 AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
633 
635  { return v.d.boolean; }
637  { return v.d.integer; }
639  { return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; }
641  { return avs_is_int(v) ? v.d.integer : v.d.floating_pt; }
643  { return avs_is_error(v) ? v.d.string : 0; }
645  { return v.d.array; }
647  { return avs_is_array(v) ? v.array_size : 1; }
649  { return avs_is_array(v) ? v.d.array[index] : v; }
650 
651 // only use these functions on an AVS_Value that does not already have
652 // an active value. Remember, treat AVS_Value as a fat pointer.
654  { AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
656  { AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; }
658  { AVS_Value v; v.type = 's'; v.d.string = v0; return v; }
660  { AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;}
662  { AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
663 #ifndef AVSC_NO_DECLSPEC
665  { AVS_Value v; avs_set_to_clip(&v, v0); return v; }
666 #endif
668  { AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = (short)size; return v; }
669 
670 /////////////////////////////////////////////////////////////////////
671 //
672 // AVS_Clip
673 //
674 
675 AVSC_API(void, avs_release_clip)(AVS_Clip *);
676 AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *);
677 
678 AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error
679 
680 AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *);
681 
682 AVSC_API(int, avs_get_version)(AVS_Clip *);
683 
684 AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n);
685 // The returned video frame must be released with avs_release_video_frame
686 
687 AVSC_API(int, avs_get_parity)(AVS_Clip *, int n);
688 // return field parity if field_based, else parity of first field in frame
689 
690 AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf,
692 // start and count are in samples
693 
694 AVSC_API(int, avs_set_cache_hints)(AVS_Clip *,
696 
697 // This is the callback type used by avs_add_function
698 typedef AVS_Value (AVSC_CC * AVS_ApplyFunc)
700 
701 typedef struct AVS_FilterInfo AVS_FilterInfo;
703 {
704  // these members should not be modified outside of the AVS_ApplyFunc callback
709  int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n);
710  int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf,
712  int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints,
713  int frame_range);
714  void (AVSC_CC * free_filter)(AVS_FilterInfo *);
715 
716  // Should be set when ever there is an error to report.
717  // It is cleared before any of the above methods are called
718  const char * error;
719  // this is to store whatever and may be modified at will
720  void * user_data;
721 };
722 
723 // Create a new filter
724 // fi is set to point to the AVS_FilterInfo so that you can
725 // modify it once it is initilized.
726 // store_child should generally be set to true. If it is not
727 // set than ALL methods (the function pointers) must be defined
728 // If it is set than you do not need to worry about freeing the child
729 // clip.
730 AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e,
733 
734 /////////////////////////////////////////////////////////////////////
735 //
736 // AVS_ScriptEnvironment
737 //
738 
739 // For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
740 enum {
741  /* slowest CPU to support extension */
742  AVS_CPU_FORCE = 0x01, // N/A
743  AVS_CPU_FPU = 0x02, // 386/486DX
744  AVS_CPU_MMX = 0x04, // P55C, K6, PII
745  AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon
746  AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP
747  AVS_CPU_SSE2 = 0x20, // PIV, Hammer
748  AVS_CPU_3DNOW = 0x40, // K6-2
749  AVS_CPU_3DNOW_EXT = 0x80, // Athlon
750  AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2,
751  // which only Hammer will have anyway)
752  AVS_CPUF_SSE3 = 0x100, // PIV+, K8 Venice
753  AVS_CPUF_SSSE3 = 0x200, // Core 2
754  AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield
756 //AVS_CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer
757  AVS_CPUF_SSE4_2 = 0x1000, // Nehalem
758 //AVS_CPUF_AVX2 = 0x2000, // Haswell
759 //AVS_CPUF_AVX512 = 0x4000, // Knights Landing
760 };
761 
762 
763 AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
764 
765 AVSC_API(int, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
766 AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
767 
768 AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
769 AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...);
770 
771 AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, void* val);
772  // note: val is really a va_list; I hope everyone typedefs va_list to a pointer
773 
774 AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *,
775  const char * name, const char * params,
776  AVS_ApplyFunc apply, void * user_data);
777 
778 AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name);
779 
780 AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name,
781  AVS_Value args, const char** arg_names);
782 // The returned value must be be released with avs_release_value
783 
784 AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name);
785 // The returned value must be be released with avs_release_value
786 
787 AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val);
788 
789 AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val);
790 
791 //void avs_push_context(AVS_ScriptEnvironment *, int level=0);
792 //void avs_pop_context(AVS_ScriptEnvironment *);
793 
794 AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
795  const AVS_VideoInfo * vi, int align);
796 // align should be at least 16
797 
798 #ifndef AVSC_NO_DECLSPEC
801  const AVS_VideoInfo * vi)
802  {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
803 
806  const AVS_VideoInfo * vi)
807  {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
808 #endif
809 
810 
811 AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf);
812 
813 AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height);
814 
816 AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data);
817 
819 // The returned video frame must be be released
820 
821 AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem);
822 
823 AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir);
824 
825 // avisynth.dll exports this; it's a way to use it as a library, without
826 // writing an AVS script or without going through AVIFile.
827 AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version);
828 
829 // this symbol is the entry point for the plugin and must
830 // be defined
833 
834 
835 AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *);
836 
837 
839 // The returned video frame must be be released
840 
841 #ifdef AVSC_NO_DECLSPEC
842 // use LoadLibrary and related functions to dynamically load Avisynth instead of declspec(dllimport)
843 /*
844  The following functions needs to have been declared, probably from windows.h
845 
846  void* malloc(size_t)
847  void free(void*);
848 
849  HMODULE LoadLibrary(const char*);
850  void* GetProcAddress(HMODULE, const char*);
851  FreeLibrary(HMODULE);
852 */
853 
854 
855 typedef struct AVS_Library AVS_Library;
856 
857 #define AVSC_DECLARE_FUNC(name) name##_func name
858 
859 struct AVS_Library {
860  HMODULE handle;
861 
862  AVSC_DECLARE_FUNC(avs_add_function);
863  AVSC_DECLARE_FUNC(avs_at_exit);
864  AVSC_DECLARE_FUNC(avs_bit_blt);
865  AVSC_DECLARE_FUNC(avs_check_version);
866  AVSC_DECLARE_FUNC(avs_clip_get_error);
867  AVSC_DECLARE_FUNC(avs_copy_clip);
868  AVSC_DECLARE_FUNC(avs_copy_value);
869  AVSC_DECLARE_FUNC(avs_copy_video_frame);
870  AVSC_DECLARE_FUNC(avs_create_script_environment);
871  AVSC_DECLARE_FUNC(avs_delete_script_environment);
872  AVSC_DECLARE_FUNC(avs_function_exists);
873  AVSC_DECLARE_FUNC(avs_get_audio);
874  AVSC_DECLARE_FUNC(avs_get_cpu_flags);
875  AVSC_DECLARE_FUNC(avs_get_frame);
876  AVSC_DECLARE_FUNC(avs_get_parity);
877  AVSC_DECLARE_FUNC(avs_get_var);
878  AVSC_DECLARE_FUNC(avs_get_version);
879  AVSC_DECLARE_FUNC(avs_get_video_info);
880  AVSC_DECLARE_FUNC(avs_invoke);
881  AVSC_DECLARE_FUNC(avs_make_writable);
882  AVSC_DECLARE_FUNC(avs_new_c_filter);
883  AVSC_DECLARE_FUNC(avs_new_video_frame_a);
884  AVSC_DECLARE_FUNC(avs_release_clip);
885  AVSC_DECLARE_FUNC(avs_release_value);
886  AVSC_DECLARE_FUNC(avs_release_video_frame);
887  AVSC_DECLARE_FUNC(avs_save_string);
888  AVSC_DECLARE_FUNC(avs_set_cache_hints);
889  AVSC_DECLARE_FUNC(avs_set_global_var);
890  AVSC_DECLARE_FUNC(avs_set_memory_max);
891  AVSC_DECLARE_FUNC(avs_set_to_clip);
892  AVSC_DECLARE_FUNC(avs_set_var);
893  AVSC_DECLARE_FUNC(avs_set_working_dir);
894  AVSC_DECLARE_FUNC(avs_sprintf);
895  AVSC_DECLARE_FUNC(avs_subframe);
896  AVSC_DECLARE_FUNC(avs_subframe_planar);
897  AVSC_DECLARE_FUNC(avs_take_clip);
898  AVSC_DECLARE_FUNC(avs_vsprintf);
899 
900  AVSC_DECLARE_FUNC(avs_get_error);
901  AVSC_DECLARE_FUNC(avs_is_rgb48);
902  AVSC_DECLARE_FUNC(avs_is_rgb64);
903  AVSC_DECLARE_FUNC(avs_is_yv24);
904  AVSC_DECLARE_FUNC(avs_is_yv16);
906  AVSC_DECLARE_FUNC(avs_is_yv411);
907  AVSC_DECLARE_FUNC(avs_is_y8);
908  AVSC_DECLARE_FUNC(avs_is_yuv444p16);
909  AVSC_DECLARE_FUNC(avs_is_yuv422p16);
910  AVSC_DECLARE_FUNC(avs_is_yuv420p16);
911  AVSC_DECLARE_FUNC(avs_is_y16);
912  AVSC_DECLARE_FUNC(avs_is_yuv444ps);
913  AVSC_DECLARE_FUNC(avs_is_yuv422ps);
914  AVSC_DECLARE_FUNC(avs_is_yuv420ps);
915  AVSC_DECLARE_FUNC(avs_is_y32);
916  AVSC_DECLARE_FUNC(avs_is_444);
917  AVSC_DECLARE_FUNC(avs_is_422);
918  AVSC_DECLARE_FUNC(avs_is_420);
919  AVSC_DECLARE_FUNC(avs_is_y);
920  AVSC_DECLARE_FUNC(avs_is_yuva);
921  AVSC_DECLARE_FUNC(avs_is_planar_rgb);
922  AVSC_DECLARE_FUNC(avs_is_planar_rgba);
924 
925  AVSC_DECLARE_FUNC(avs_get_plane_width_subsampling);
926  AVSC_DECLARE_FUNC(avs_get_plane_height_subsampling);
937 
938  AVSC_DECLARE_FUNC(avs_num_components);
939  AVSC_DECLARE_FUNC(avs_component_size);
940  AVSC_DECLARE_FUNC(avs_bits_per_component);
941 
942 };
943 
944 #undef AVSC_DECLARE_FUNC
945 
946 
947 AVSC_INLINE AVS_Library * avs_load_library() {
948  AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
949  if (library == NULL)
950  return NULL;
951  library->handle = LoadLibrary("avisynth");
952  if (library->handle == NULL)
953  goto fail;
954 
955 #define __AVSC_STRINGIFY(x) #x
956 #define AVSC_STRINGIFY(x) __AVSC_STRINGIFY(x)
957 #define AVSC_LOAD_FUNC(name) {\
958  library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\
959  if (library->name == NULL)\
960  goto fail;\
961 }
962 
963  AVSC_LOAD_FUNC(avs_add_function);
964  AVSC_LOAD_FUNC(avs_at_exit);
965  AVSC_LOAD_FUNC(avs_bit_blt);
966  AVSC_LOAD_FUNC(avs_check_version);
967  AVSC_LOAD_FUNC(avs_clip_get_error);
968  AVSC_LOAD_FUNC(avs_copy_clip);
969  AVSC_LOAD_FUNC(avs_copy_value);
970  AVSC_LOAD_FUNC(avs_copy_video_frame);
971  AVSC_LOAD_FUNC(avs_create_script_environment);
972  AVSC_LOAD_FUNC(avs_delete_script_environment);
973  AVSC_LOAD_FUNC(avs_function_exists);
974  AVSC_LOAD_FUNC(avs_get_audio);
975  AVSC_LOAD_FUNC(avs_get_cpu_flags);
976  AVSC_LOAD_FUNC(avs_get_frame);
977  AVSC_LOAD_FUNC(avs_get_parity);
978  AVSC_LOAD_FUNC(avs_get_var);
979  AVSC_LOAD_FUNC(avs_get_version);
980  AVSC_LOAD_FUNC(avs_get_video_info);
981  AVSC_LOAD_FUNC(avs_invoke);
982  AVSC_LOAD_FUNC(avs_make_writable);
983  AVSC_LOAD_FUNC(avs_new_c_filter);
984  AVSC_LOAD_FUNC(avs_new_video_frame_a);
985  AVSC_LOAD_FUNC(avs_release_clip);
986  AVSC_LOAD_FUNC(avs_release_value);
987  AVSC_LOAD_FUNC(avs_release_video_frame);
988  AVSC_LOAD_FUNC(avs_save_string);
989  AVSC_LOAD_FUNC(avs_set_cache_hints);
990  AVSC_LOAD_FUNC(avs_set_global_var);
991  AVSC_LOAD_FUNC(avs_set_memory_max);
992  AVSC_LOAD_FUNC(avs_set_to_clip);
993  AVSC_LOAD_FUNC(avs_set_var);
994  AVSC_LOAD_FUNC(avs_set_working_dir);
995  AVSC_LOAD_FUNC(avs_sprintf);
996  AVSC_LOAD_FUNC(avs_subframe);
997  AVSC_LOAD_FUNC(avs_subframe_planar);
998  AVSC_LOAD_FUNC(avs_take_clip);
999  AVSC_LOAD_FUNC(avs_vsprintf);
1000 
1001  AVSC_LOAD_FUNC(avs_get_error);
1002  AVSC_LOAD_FUNC(avs_is_rgb48);
1003  AVSC_LOAD_FUNC(avs_is_rgb64);
1004  AVSC_LOAD_FUNC(avs_is_yv24);
1005  AVSC_LOAD_FUNC(avs_is_yv16);
1006  AVSC_LOAD_FUNC(avs_is_yv12);
1007  AVSC_LOAD_FUNC(avs_is_yv411);
1008  AVSC_LOAD_FUNC(avs_is_y8);
1009  AVSC_LOAD_FUNC(avs_is_yuv444p16);
1010  AVSC_LOAD_FUNC(avs_is_yuv422p16);
1011  AVSC_LOAD_FUNC(avs_is_yuv420p16);
1012  AVSC_LOAD_FUNC(avs_is_y16);
1013  AVSC_LOAD_FUNC(avs_is_yuv444ps);
1014  AVSC_LOAD_FUNC(avs_is_yuv422ps);
1015  AVSC_LOAD_FUNC(avs_is_yuv420ps);
1016  AVSC_LOAD_FUNC(avs_is_y32);
1017  AVSC_LOAD_FUNC(avs_is_444);
1018  AVSC_LOAD_FUNC(avs_is_422);
1019  AVSC_LOAD_FUNC(avs_is_420);
1020  AVSC_LOAD_FUNC(avs_is_y);
1021  AVSC_LOAD_FUNC(avs_is_yuva);
1022  AVSC_LOAD_FUNC(avs_is_planar_rgb);
1023  AVSC_LOAD_FUNC(avs_is_planar_rgba);
1024  AVSC_LOAD_FUNC(avs_is_color_space);
1025 
1026  AVSC_LOAD_FUNC(avs_get_plane_width_subsampling);
1027  AVSC_LOAD_FUNC(avs_get_plane_height_subsampling);
1028  AVSC_LOAD_FUNC(avs_bits_per_pixel);
1029  AVSC_LOAD_FUNC(avs_bytes_from_pixels);
1030  AVSC_LOAD_FUNC(avs_row_size);
1031  AVSC_LOAD_FUNC(avs_bmp_size);
1032  AVSC_LOAD_FUNC(avs_get_pitch_p);
1033  AVSC_LOAD_FUNC(avs_get_row_size_p);
1034  AVSC_LOAD_FUNC(avs_get_height_p);
1035  AVSC_LOAD_FUNC(avs_get_read_ptr_p);
1036  AVSC_LOAD_FUNC(avs_is_writable);
1037  AVSC_LOAD_FUNC(avs_get_write_ptr_p);
1038 
1039  AVSC_LOAD_FUNC(avs_num_components);
1040  AVSC_LOAD_FUNC(avs_component_size);
1041  AVSC_LOAD_FUNC(avs_bits_per_component);
1042 
1043 
1044 
1045 #undef __AVSC_STRINGIFY
1046 #undef AVSC_STRINGIFY
1047 #undef AVSC_LOAD_FUNC
1048 
1049  return library;
1050 
1051 fail:
1052  free(library);
1053  return NULL;
1054 }
1055 
1056 AVSC_INLINE void avs_free_library(AVS_Library *library) {
1057  if (library == NULL)
1058  return;
1059  FreeLibrary(library->handle);
1060  free(library);
1061 }
1062 #endif
1063 
1064 #endif
void INT64 INT64 count
Definition: avisynth_c.h:710
int plane
Definition: avisynth_c.h:422
int cachehints
Definition: avisynth_c.h:695
#define NULL
Definition: coverity.c:32
const char const char void * val
Definition: avisynth_c.h:771
const char * s
Definition: avisynth_c.h:768
AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo *p)
Definition: avisynth_c.h:347
BYTE int const BYTE int int row_size
Definition: avisynth_c.h:813
AVSC_INLINE AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment *env, const AVS_VideoInfo *vi)
Definition: avisynth_c.h:800
volatile long sequence_number
Definition: avisynth_c.h:523
BYTE int const BYTE int src_pitch
Definition: avisynth_c.h:813
AVS_Value src
Definition: avisynth_c.h:619
AVS_VideoFrame *AVSC_CC * get_frame(AVS_FilterInfo *, int n)
AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v)
Definition: avisynth_c.h:644
const char AVS_Value const char ** arg_names
Definition: avisynth_c.h:780
const char * fmt
Definition: avisynth_c.h:769
AVSC_INLINE const char * avs_as_string(AVS_Value v)
Definition: avisynth_c.h:638
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo *p)
Definition: avisynth_c.h:419
short array_size
Definition: avisynth_c.h:602
AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo *p)
Definition: avisynth_c.h:450
AVS_VideoFrame int int int int int int rel_offsetV
Definition: avisynth_c.h:838
AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame *f)
Definition: avisynth_c.h:580
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo *p, int pixels)
Definition: avxsynth_c.h:232
AVSC_INLINE AVS_Value avs_new_value_error(const char *v0)
Definition: avisynth_c.h:661
char boolean
Definition: avisynth_c.h:605
static const AVS_Value avs_void
Definition: avisynth_c.h:617
AVS_VideoFrame int int int int new_height
Definition: avisynth_c.h:818
int version
Definition: avisynth_c.h:766
AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo *p, INT64 bytes)
Definition: avisynth_c.h:459
GLfloat v0
Definition: opengl_enc.c:107
AVSC_INLINE void avs_set_fps(AVS_VideoInfo *p, unsigned numerator, unsigned denominator)
Definition: avisynth_c.h:481
AVSC_INLINE AVS_Value avs_new_value_int(int v0)
Definition: avisynth_c.h:655
const char * string
Definition: avisynth_c.h:608
long long int INT64
Definition: types.h:46
AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo *p)
Definition: avisynth_c.h:413
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo *vi)
Definition: avxsynth_c.h:238
BYTE int const BYTE * srcp
Definition: avisynth_c.h:813
short type
Definition: avisynth_c.h:600
#define AVSC_EXPORT
Definition: capi.h:54
typedef AVS_Value(AVSC_CC *AVS_ApplyFunc)(AVS_ScriptEnvironment *
int mem
Definition: avisynth_c.h:821
AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo *p)
Definition: avisynth_c.h:465
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo *p)
Definition: avisynth_c.h:435
#define f(width, name)
Definition: cbs_vp9.c:255
AVS_FilterInfo AVS_Value child
Definition: avisynth_c.h:731
#define AVSC_DECLARE_FUNC(name)
Definition: avisynth.c:50
AVSC_INLINE int avs_is_property(const AVS_VideoInfo *p, int property)
Definition: avisynth_c.h:402
const AVS_Value * array
Definition: avisynth_c.h:609
AVS_VideoFrame int int int int int rel_offsetU
Definition: avisynth_c.h:838
AVS_ScriptEnvironment * env
Definition: avisynth_c.h:707
AVSC_INLINE int avs_is_int(AVS_Value v)
Definition: avisynth_c.h:625
const char * newdir
Definition: avisynth_c.h:823
AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo *p)
Definition: avisynth_c.h:341
AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
Definition: avisynth_c.h:648
AVSC_INLINE int avs_array_size(AVS_Value v)
Definition: avisynth_c.h:646
AVSC_INLINE int avs_as_int(AVS_Value v)
Definition: avisynth_c.h:636
AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo *p, INT64 samples)
Definition: avisynth_c.h:462
volatile long refcount
Definition: avisynth_c.h:533
void * clip
Definition: avisynth_c.h:604
AVSC_INLINE int avs_is_array(AVS_Value v)
Definition: avisynth_c.h:628
volatile long refcount
Definition: avisynth_c.h:525
ptrdiff_t size
Definition: opengl_enc.c:101
AVSC_INLINE int avs_is_bool(AVS_Value v)
Definition: avisynth_c.h:624
AVSC_INLINE int avs_get_height(const AVS_VideoFrame *p)
Definition: avisynth_c.h:554
int int frame_range
Definition: avisynth_c.h:695
AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame *p, int plane)
Definition: avxsynth_c.h:340
AVSC_INLINE int avs_is_float(AVS_Value v)
Definition: avisynth_c.h:626
INT64 num_audio_samples
Definition: avisynth_c.h:326
AVSC_INLINE AVS_Value avs_new_value_float(float v0)
Definition: avisynth_c.h:659
AVS_Clip * child
Definition: avisynth_c.h:705
AVS_FilterInfo ** fi
Definition: avisynth_c.h:731
const AVS_VideoInfo * vi
Definition: avisynth_c.h:795
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo *p)
Definition: avisynth_c.h:405
AVSC_EXPORT const char *AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment *env)
AVSC_INLINE void avs_set_property(AVS_VideoInfo *p, int property)
Definition: avisynth_c.h:472
BYTE * dstp
Definition: avisynth_c.h:813
void * HMODULE
AVSC_INLINE const unsigned char * avs_get_read_ptr(const AVS_VideoFrame *p)
Definition: avxsynth_c.h:381
AVS_Value void * user_data
Definition: avisynth_c.h:699
AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo *p)
Definition: avisynth_c.h:344
AVSC_INLINE int avs_has_video(const AVS_VideoInfo *p)
Definition: avisynth_c.h:335
struct AVS_Clip AVS_Clip
Definition: avisynth_c.h:308
AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo *p, int c_space)
Definition: avxsynth_c.h:200
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame *p)
Definition: avxsynth_c.h:337
#define fail()
Definition: checkasm.h:117
const char * name
Definition: avisynth_c.h:775
unsigned fps_numerator
Definition: avisynth_c.h:319
AVSC_INLINE int avs_defined(AVS_Value v)
Definition: avisynth_c.h:622
AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
Definition: avisynth_c.h:653
int int frame_range
Definition: avisynth_c.h:712
AVSC_INLINE int avs_is_clip(AVS_Value v)
Definition: avisynth_c.h:623
AVSC_INLINE unsigned char * avs_get_write_ptr_p(const AVS_VideoFrame *p, int plane)
Definition: avxsynth_c.h:404
AVSC_INLINE AVS_Value avs_new_value_string(const char *v0)
Definition: avisynth_c.h:657
AVSC_INLINE const char * avs_as_error(AVS_Value v)
Definition: avisynth_c.h:642
union AVS_Value::@10 d
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
AVS_Value args
Definition: avisynth_c.h:699
AVS_VideoInfo vi
Definition: avisynth_c.h:706
AVSC_INLINE int avs_is_bff(const AVS_VideoInfo *p)
Definition: avisynth_c.h:416
int n
Definition: avisynth_c.h:684
int frames
Definition: movenc.c:65
static void error(const char *err)
AVSC_INLINE double avs_as_float(AVS_Value v)
Definition: avisynth_c.h:640
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame *p)
Definition: avisynth_c.h:549
AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo *p)
Definition: avxsynth_c.h:221
const AVS_VideoInfo int align
Definition: avisynth_c.h:795
void INT64 start
Definition: avisynth_c.h:710
unsigned char BYTE
Definition: types.h:40
AVSC_INLINE const unsigned char * avs_get_read_ptr_p(const AVS_VideoFrame *p, int plane)
Definition: avxsynth_c.h:384
AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo *p)
Definition: avxsynth_c.h:197
AVSC_INLINE int avs_is_error(AVS_Value v)
Definition: avisynth_c.h:629
int(AVSC_CC *get_parity)(AVS_FilterInfo *
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo *p)
Definition: avisynth_c.h:410
const char * error
Definition: avisynth_c.h:718
void * buf
Definition: avisynth_c.h:690
AVS_VideoFrame int rel_offset
Definition: avisynth_c.h:818
BYTE int const BYTE int int int height
Definition: avisynth_c.h:813
#define FRAME_ALIGN
Definition: config.h:45
#define AVSC_INLINE
Definition: capi.h:48
AVS_VideoFrame ** pvf
Definition: avisynth_c.h:811
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value *v0, int size)
Definition: avisynth_c.h:667
int index
Definition: gxfenc.c:89
void(AVSC_CC * AVS_ShutdownFunc)(void *user_data, AVS_ScriptEnvironment *env)
Definition: avisynth_c.h:815
AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo *p)
Definition: avisynth_c.h:439
AVSC_INLINE void avs_set_field_based(AVS_VideoInfo *p, int isfieldbased)
Definition: avisynth_c.h:478
AVS_VideoFrame int int int new_row_size
Definition: avisynth_c.h:818
void(AVSC_CC *free_filter)(AVS_FilterInfo *)
AVS_VideoFrameBuffer * vfb
Definition: avisynth_c.h:534
AVS_ScriptEnvironment AVS_Clip *AVSC_INLINE int avs_as_bool(AVS_Value v)
Definition: avisynth_c.h:634
#define AVSC_CC
Definition: capi.h:43
AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo *p)
Definition: avisynth_c.h:350
AVSC_INLINE void avs_clear_property(AVS_VideoInfo *p, int property)
Definition: avisynth_c.h:475
AVSC_INLINE AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment *env, const AVS_VideoInfo *vi)
Definition: avisynth_c.h:805
const char const char * params
Definition: avisynth_c.h:775
struct AVS_ScriptEnvironment AVS_ScriptEnvironment
Definition: avisynth_c.h:309
int
AVSC_INLINE void avs_release_frame(AVS_VideoFrame *f)
Definition: avisynth_c.h:578
float floating_pt
Definition: avisynth_c.h:607
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo *x, AVS_VideoInfo *y)
Definition: avxsynth_c.h:297
AVS_VideoFrame int int new_pitch
Definition: avisynth_c.h:818
int integer
Definition: avisynth_c.h:606
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip *v0)
Definition: avisynth_c.h:664
AVSC_INLINE int avs_is_string(AVS_Value v)
Definition: avisynth_c.h:627
AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame *p, int plane)
Definition: avxsynth_c.h:373
AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo *p, INT64 samples)
Definition: avisynth_c.h:456
int pixels
Definition: avisynth_c.h:429
int c_space
Definition: avisynth_c.h:408
AVSC_INLINE int avs_sample_type(const AVS_VideoInfo *p)
Definition: avisynth_c.h:468
AVSC_INLINE int avs_row_size(const AVS_VideoInfo *p)
Definition: avxsynth_c.h:235
AVS_VideoFrame int int int int int int int new_pitchUV
Definition: avisynth_c.h:838
unsigned fps_denominator
Definition: avisynth_c.h:319
AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo *p, INT64 frames)
Definition: avisynth_c.h:453
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo *p)
Definition: avisynth_c.h:353
AVSC_API(int, avs_is_rgb48)(const AVS_VideoInfo *p)
void INT64 INT64 count
Definition: avisynth_c.h:690
void INT64 start
Definition: avisynth_c.h:690
void * user_data
Definition: avisynth_c.h:720
const char int length
Definition: avisynth_c.h:768
BYTE int dst_pitch
Definition: avisynth_c.h:813
const char const char AVS_ApplyFunc apply
Definition: avisynth_c.h:775
AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame *p, int plane)
Definition: avxsynth_c.h:348
AVS_FilterInfo AVS_Value int store_child
Definition: avisynth_c.h:731
AVSC_INLINE unsigned char * avs_get_write_ptr(const AVS_VideoFrame *p)
Definition: avxsynth_c.h:395
AVSC_INLINE int avs_is_writable(const AVS_VideoFrame *p)
Definition: avxsynth_c.h:392
AVSC_INLINE int avs_has_audio(const AVS_VideoInfo *p)
Definition: avisynth_c.h:338
int audio_samples_per_second
Definition: avisynth_c.h:324