-
Notifications
You must be signed in to change notification settings - Fork 1
/
shared.h
67 lines (55 loc) · 1.89 KB
/
shared.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*****************************************************************************
AvsFilterRemoveGrain/Repair16
Author: Laurent de Soras, 2012
Modified for VapourSynth by Fredrik Mellbin 2013
--- Legal stuff ---
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
*Tab=3***********************************************************************/
#ifndef SHARED_H
#define SHARED_H
#include "VapourSynth.h"
#include "VSHelper.h"
#include <cstdint>
#include <algorithm>
#include <cstdlib>
#if defined(_MSC_VER)
#define _ALLOW_KEYWORD_MACROS
#define alignas(x) __declspec(align(x))
#define ALIGNED_ARRAY(decl, alignment) alignas(alignment) decl
#else
#ifndef __forceinline
#define __forceinline inline
#endif
#define ALIGNED_ARRAY(decl, alignment) __attribute__((aligned(16))) decl
#endif
template <class T>
static __forceinline T limit(T x, T mi, T ma)
{
return ((x < mi) ? mi : ((x > ma) ? ma : x));
}
class LineProcAll {
public:
static inline bool skip_line(int) { return (false); }
};
class LineProcEven {
public:
static inline bool skip_line(int y) { return ((y & 1) != 0); }
};
class LineProcOdd {
public:
static inline bool skip_line(int y) { return ((y & 1) == 0); }
};
enum cleanseMode {
cmNormal,
cmForward,
cmBackward
};
void VS_CC removeGrainCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
void VS_CC repairCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
void VS_CC verticalCleanerCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
void VS_CC clenseCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
#endif