Log in

View Full Version : Filters and YUV4:4:4


jollye
18th December 2009, 14:46
Hi all,

With the new Avisynth 2.6, some new colors spaces like YV24, YV16, Y8 have been introduced. I wanted to add YV24 support to some filters I'm developping for test purposes. First I wondered which version of avisynth.h to use. I used the one in the \FilterSDK\include (05/09/2009 23:06) folder.

However when I try to compile a working code with this new version of avisynth.h, I get plenty an error.
error C4716: 'XXX::SetCacheHints' : must return a value

If I fix it (badly), then plenty of link errors like:
XXX.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall IClip::~IClip(void)" (??1IClip@@UAE@XZ) referenced in function __unwindfunclet$??0GenericVideoFilter@@QAE@VPClip@@@Z$0

Any idea?
Thanks

Gavino
18th December 2009, 15:40
However when I try to compile a working code with this new version of avisynth.h, I get plenty an error.
error C4716: 'XXX::SetCacheHints' : must return a value
Don't know why you get this when SetCacheHints is defined in GenericVideoFilter as
void __stdcall SetCacheHints(int cachehints,int frame_range) { } ;
Have you declared a different version of it in your filter?
What did you do to fix it?
If I fix it (badly), then plenty of link errors like:
XXX.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall IClip::~IClip(void)" (??1IClip@@UAE@XZ) referenced in function __unwindfunclet$??0GenericVideoFilter@@QAE@VPClip@@@Z$0
I see that this version of avisynth.h has changed the IClip destructor from
virtual __stdcall ~IClip() {}
to
virtual __stdcall ~IClip();

which is somewhat strange. Perhaps it should be
virtual __stdcall ~IClip() = 0;

jollye
18th December 2009, 17:15
Actually my quick fix (for test) was to suppress it form avisynth.h and from my filter code.
(after a double check, the problem seems to be that I was not using the avisynth.h version I was referencing in my first message but another one).

I retested it now and there's no more an error related to SetCacheHints.

However I still get those:

XXX.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall IClip::~IClip(void)" (??1IClip@@UAE@XZ) referenced in function __unwindfunclet$??0GenericVideoFilter@@QAE@VPClip@@@Z$0
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall PClip::~PClip(void)" (??1PClip@@QAE@XZ) referenced in function "public: __thiscall GenericVideoFilter::GenericVideoFilter(class PClip)" (??0GenericVideoFilter@@QAE@VPClip@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: class IClip * __thiscall PClip::operator->(void)const " (??CPClip@@QBEPAVIClip@@XZ) referenced in function "public: __thiscall GenericVideoFilter::GenericVideoFilter(class PClip)" (??0GenericVideoFilter@@QAE@VPClip@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall PClip::PClip(class PClip const &)" (??0PClip@@QAE@ABV0@@Z) referenced in function "public: __thiscall GenericVideoFilter::GenericVideoFilter(class PClip)" (??0GenericVideoFilter@@QAE@VPClip@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall IClip::IClip(void)" (??0IClip@@QAE@XZ) referenced in function "public: __thiscall GenericVideoFilter::GenericVideoFilter(class PClip)" (??0GenericVideoFilter@@QAE@VPClip@@@Z)
XXX.obj : error LNK2001: unresolved external symbol "public: virtual int __stdcall IClip::GetVersion(void)" (?GetVersion@IClip@@UAGHXZ)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsBFF(void)const " (?IsBFF@VideoInfo@@QBE_NXZ) referenced in function "public: virtual bool __stdcall XXX::GetParity(int)" (?GetParity@XXX@@UAG_NH@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsFieldBased(void)const " (?IsFieldBased@VideoInfo@@QBE_NXZ) referenced in function "public: virtual bool __stdcall XXX::GetParity(int)" (?GetParity@XXX@@UAG_NH@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsTFF(void)const " (?IsTFF@VideoInfo@@QBE_NXZ) referenced in function "public: virtual bool __stdcall XXX::GetParity(int)" (?GetParity@XXX@@UAG_NH@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsYUY2(void)const " (?IsYUY2@VideoInfo@@QBE_NXZ) referenced in function "public: __thiscall YYY::YYY(class PClip,char const * const,class IScriptEnvironment *)" (??0YYY@@QAE@VPClip@@QBDPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsRGB32(void)const " (?IsRGB32@VideoInfo@@QBE_NXZ) referenced in function "public: __thiscall YYY::YYY(class PClip,char const * const,class IScriptEnvironment *)" (??0YYY@@QAE@VPClip@@QBDPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall PVideoFrame::~PVideoFrame(void)" (??1PVideoFrame@@QAE@XZ) referenced in function __unwindfunclet$?GetFrame@YYY@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z$0
XXX.obj : error LNK2019: unresolved external symbol "public: unsigned char const * __thiscall VideoFrame::GetReadPtr(int)const " (?GetReadPtr@VideoFrame@@QBEPBEH@Z) referenced in function "public: virtual class PVideoFrame __stdcall YYY::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@YYY@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: int __thiscall VideoFrame::GetPitch(int)const " (?GetPitch@VideoFrame@@QBEHH@Z) referenced in function "public: virtual class PVideoFrame __stdcall YYY::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@YYY@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: class VideoFrame * __thiscall PVideoFrame::operator->(void)const " (??CPVideoFrame@@QBEPAVVideoFrame@@XZ) referenced in function "public: virtual class PVideoFrame __stdcall YYY::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@YYY@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsYV12(void)const " (?IsYV12@VideoInfo@@QBE_NXZ) referenced in function "public: __thiscall ZZZ::ZZZ(class PClip,char const * const,bool,class IScriptEnvironment *)" (??0ZZZ@@QAE@VPClip@@QBD_NPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: int __thiscall VideoFrame::GetHeight(int)const " (?GetHeight@VideoFrame@@QBEHH@Z) referenced in function "public: virtual class PVideoFrame __stdcall ZZZ::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@ZZZ@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: int __thiscall VideoFrame::GetRowSize(int)const " (?GetRowSize@VideoFrame@@QBEHH@Z) referenced in function "public: virtual class PVideoFrame __stdcall ZZZ::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@ZZZ@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall AVSValue::~AVSValue(void)" (??1AVSValue@@QAE@XZ) referenced in function "class AVSValue __cdecl Create_YYY(class AVSValue,void *,class IScriptEnvironment *)" (?Create_YYY@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: __thiscall AVSValue::AVSValue(class IClip *)" (??0AVSValue@@QAE@PAVIClip@@@Z) referenced in function "class AVSValue __cdecl Create_YYY(class AVSValue,void *,class IScriptEnvironment *)" (?Create_YYY@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: class PClip __thiscall AVSValue::AsClip(void)const " (?AsClip@AVSValue@@QBE?AVPClip@@XZ) referenced in function "class AVSValue __cdecl Create_YYY(class AVSValue,void *,class IScriptEnvironment *)" (?Create_YYY@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: char const * __thiscall AVSValue::AsString(void)const " (?AsString@AVSValue@@QBEPBDXZ) referenced in function "class AVSValue __cdecl Create_YYY(class AVSValue,void *,class IScriptEnvironment *)" (?Create_YYY@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: class AVSValue const & __thiscall AVSValue::operator[](int)const " (??AAVSValue@@QBEABV0@H@Z) referenced in function "class AVSValue __cdecl Create_YYY(class AVSValue,void *,class IScriptEnvironment *)" (?Create_YYY@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall AVSValue::AsBool(bool)const " (?AsBool@AVSValue@@QBE_N_N@Z) referenced in function "class AVSValue __cdecl Create_ZZZ(class AVSValue,void *,class IScriptEnvironment *)" (?Create_ZZZ@@YA?AVAVSValue@@V1@PAXPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: void __thiscall VideoInfo::Set(int)" (?Set@VideoInfo@@QAEXH@Z) referenced in function "public: __thiscall XXX::XXX(char const * const,class IScriptEnvironment *)" (??0XXX@@QAE@QBDPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: void __thiscall VideoInfo::Clear(int)" (?Clear@VideoInfo@@QAEXH@Z) referenced in function "public: __thiscall XXX::XXX(char const * const,class IScriptEnvironment *)" (??0XXX@@QAE@QBDPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: void __thiscall VideoInfo::SetFieldBased(bool)" (?SetFieldBased@VideoInfo@@QAEX_N@Z) referenced in function "public: __thiscall XXX::XXX(char const * const,class IScriptEnvironment *)" (??0XXX@@QAE@QBDPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsYV24(void)const " (?IsYV24@VideoInfo@@QBE_NXZ) referenced in function "public: virtual class PVideoFrame __stdcall XXX::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@XXX@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: bool __thiscall VideoInfo::IsRGB24(void)const " (?IsRGB24@VideoInfo@@QBE_NXZ) referenced in function "public: virtual class PVideoFrame __stdcall XXX::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@XXX@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)
XXX.obj : error LNK2019: unresolved external symbol "public: unsigned char * __thiscall VideoFrame::GetWritePtr(int)const " (?GetWritePtr@VideoFrame@@QBEPAEH@Z) referenced in function "public: virtual class PVideoFrame __stdcall XXX::GetFrame(int,class IScriptEnvironment *)" (?GetFrame@XXX@@UAG?AVPVideoFrame@@HPAVIScriptEnvironment@@@Z)

There seems to be no more code associated to those methods in the new avisynth.h.

For example in the old version:
bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); }


Is now replaced by:
bool IsYV12() const;
Thanks for your help

IanB
18th December 2009, 22:41
Sorry, but the current 2.6 avisynth.h is only half there. All the baked code has been removed, I just haven't arranged the linkage component for external plugins yet.

And yes there may be a few declaration changes like SetCacheHints returning an int and AVSValue::AsFloat returning a float and taking a float as it's argument, AVSValue::AsDblDef takes a double and returns a double (AVSValues only hold floats).

As a temporary measure to complete the link you could include src/core/interface.cpp in your project, this is all the baked code. Be aware it is still in flux and will need to match the avisynth.dll you are using. Plugins will need a recompile as it changes and won't be compatible with the final plugin API.

jollye
21st December 2009, 10:35
Thanks for your answers.
I ended up using an old version of AviSynth.h and added the needed functions to support YV24. I know this is temporary but it will do the job for the moment.
Thanks again.
jollye