diff --git a/nnedi3/PlanarFrame.h b/nnedi3/PlanarFrame.h index 2f00928..8a8bb06 100644 --- a/nnedi3/PlanarFrame.h +++ b/nnedi3/PlanarFrame.h @@ -90,11 +90,11 @@ class PlanarFrame int GetPitch(uint8_t plane); int getCPUFlags(void) {return cpu;} inline void BitBlt(uint8_t *dstp,int dst_pitch,const uint8_t *srcp,int src_pitch,int row_size,int height); - PlanarFrame& PlanarFrame::operator=(PlanarFrame &ob2); + PlanarFrame& operator=(PlanarFrame &ob2); void convYUY2to422(const uint8_t *src,uint8_t *py,uint8_t *pu,uint8_t *pv,int pitch1,int pitch2Y,int pitch2UV, int width,int height); void convRGB24to444(const uint8_t *src,uint8_t *py,uint8_t *pu,uint8_t *pv,int pitch1,int pitch2Y,int pitch2UV, int width,int height); }; -#endif \ No newline at end of file +#endif diff --git a/nnedi3/ThreadPool.h b/nnedi3/ThreadPool.h index e8cc7cd..b0abd56 100644 --- a/nnedi3/ThreadPool.h +++ b/nnedi3/ThreadPool.h @@ -23,7 +23,7 @@ #ifndef __ThreadPool_H__ #define __ThreadPool_H__ -#include +#include #include "./ThreadPoolDef.h" diff --git a/nnedi3/ThreadPoolInterface.h b/nnedi3/ThreadPoolInterface.h index 006a33c..8ee0a2b 100644 --- a/nnedi3/ThreadPoolInterface.h +++ b/nnedi3/ThreadPoolInterface.h @@ -23,7 +23,7 @@ #ifndef __ThreadPoolInterface_H__ #define __ThreadPoolInterface_H__ -#include +#include #include #include "./ThreadPoolDef.h" diff --git a/nnedi3/internal.h b/nnedi3/internal.h index e2b93e5..9aa9ba2 100644 --- a/nnedi3/internal.h +++ b/nnedi3/internal.h @@ -37,7 +37,7 @@ #define __Internal_H__ #define AVS_VERSION 2.56 -#define AVS_VERSTR "AviSynth 2.56, build:"__DATE__" ["__TIME__"]" +#define AVS_VERSTR "AviSynth 2.56, build:\"__DATE__\" [\"__TIME__\"]" // env->ManageCache() Non user keys definition @@ -47,7 +47,7 @@ #include "./avisynth.h" - +#include int RGB2YUV(int rgb); diff --git a/nnedi3/nnedi3.cpp b/nnedi3/nnedi3.cpp index f85fb4f..0b75dda 100644 --- a/nnedi3/nnedi3.cpp +++ b/nnedi3/nnedi3.cpp @@ -20,7 +20,7 @@ ** Modified by JPSDR */ -#include "./nnedi3.h" +#include "nnedi3.h" #if _MSC_VER >= 1900 #define AVX2_BUILD_POSSIBLE @@ -427,7 +427,7 @@ nnedi3::nnedi3(PClip _child,int _field,bool _dh,bool _Y,bool _U,bool _V,bool _A, #endif char buf[512]; - sprintf_s(buf,512,"nnedi3: auto-detected opt setting = %d (%d)\n",opt,CPUF); + snprintf(buf,512,"nnedi3: auto-detected opt setting = %d (%d)\n",opt,CPUF); OutputDebugString(buf); } @@ -554,7 +554,7 @@ nnedi3::nnedi3(PClip _child,int _field,bool _dh,bool _Y,bool _U,bool _V,bool _A, } // 16 bit pixels will be shifted by 1 for the prescreener. - const int prescreener_bits = min(bits_per_pixel,15); + const int prescreener_bits = min((int)bits_per_pixel,15); const double half = (((int)1 << prescreener_bits)-1)/2.0; // Factor mean removal and 1.0/half scaling @@ -598,7 +598,7 @@ nnedi3::nnedi3(PClip _child,int _field,bool _dh,bool _Y,bool _U,bool _V,bool _A, float *wf = (float *)&ws[4*48]; // 16 bit pixels will be shifted by 1 for the prescreener. - const int prescreener_bits = min(bits_per_pixel,15); + const int prescreener_bits = min((int)bits_per_pixel,15); const double half = (((int)1 << prescreener_bits)-1)/2.0; // Factor mean removal and 1.0/half scaling @@ -4708,8 +4708,13 @@ AVSValue __cdecl Create_nnedi3_rpow2(AVSValue args, void* user_data, IScriptEnvi const AVS_Linkage *AVS_linkage = nullptr; +#ifdef _MSC_VER +#define EXPORT extern "C" __declspec(dllexport) +#else +#define EXPORT extern "C" __stdcall +#endif -extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) +EXPORT const char* AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) { AVS_linkage = vectors; diff --git a/nnedi3/nnedi3.h b/nnedi3/nnedi3.h index 22f9bff..b968e97 100644 --- a/nnedi3/nnedi3.h +++ b/nnedi3/nnedi3.h @@ -27,6 +27,19 @@ #include "./avisynth.h" #include "./PlanarFrame.h" #include "./ThreadPoolInterface.h" +#ifndef _MSC_VER +#define _strnicmp strncasecmp +#endif + +#include + +using namespace std; + +#ifndef _MSC_VER +#define _aligned_malloc(size, alignment) aligned_alloc(size, alignment) +// Note: This is safe on Unix. see `man 3 aligned_alloc` +#define _aligned_free(m) free(m) +#endif #define NUM_NSIZE 7 #define NUM_NNS 5 @@ -99,7 +112,7 @@ class nnedi3 : public GenericVideoFilter nnedi3(PClip _child,int _field,bool _dh,bool _Y,bool _U,bool _V,bool _A,int _nsize,int _nns,int _qual,int _etype, int _pscrn,uint8_t _threads,int _opt,int _fapprox,bool _sleep,int range_mode, bool negativePrefetch,bool _asvp,IScriptEnvironment *env); virtual ~nnedi3(); - PVideoFrame __stdcall nnedi3::GetFrame(int n,IScriptEnvironment *env); + PVideoFrame __stdcall GetFrame(int n,IScriptEnvironment *env); int __stdcall SetCacheHints(int cachehints, int frame_range); };