Log in

View Full Version : Request: Can someone compile a RemoveDirt x64


poisondeathray
24th January 2018, 23:47
Request:

Can someone compile a 64bit RemoveDirt.dll ? The kassandro version with RestoreMotionBlocks

Background Info:
The x64 version at the bottom of this page does not work (and it says that)
avisynth.nl/index.php/RemoveDirt

wayback machine for removedirt kassandro page
http://web.archive.org/web/20140723074402/http://home.arcor.de/kassandro/RemoveDirt/RemoveDirt.htm


Thanks

johnmeyer
25th January 2018, 00:51
What advantage do you think you'll get with a 64-bit version? Can you not get the existing 32-bit version(s) to work at all in a Win 64-bit environment?

64-bit is not automatically "better" than 32-bit for many programs, applications, DLLs, etc.

poisondeathray
25th January 2018, 01:03
What advantage do you think you'll get with a 64-bit version? Can you not get the existing 32-bit version(s) to work at all in a Win 64-bit environment?

64-bit is not automatically "better" than 32-bit for many programs, applications, DLLs, etc.

Yes, it should work with mp_pipeline , but I haven't tested it yet

I expect it to be about 5-10% faster right off the bat for x64, and better for memory when using larger scripts

When you have 2K and 4K filmscans it's not fun working in x86

poisondeathray
25th January 2018, 01:21
The funny thing is there is a vapoursynth RemoveDirtVS x64 version based on the original kassandro plugin.... I thought surely someone has made one for avisynth already ?? My google kung fu skills are lacking and I couldn't find it

MysteryX
25th January 2018, 02:08
Plus it has the advantage of then integrating into an otherwise all x64 filter chain

real.finder
25th January 2018, 14:38
Plus it has the advantage of then integrating into an otherwise all x64 filter chain

yes and can use more than 2-4 G of ram, no headache (for many peoples) or/and overhead with mpp

pinterf
26th January 2018, 07:06
More than a year ago I gave it a try but it was too much work (goal: 2.6 header, remove mmx and inline asm, add new colorspaces). I think the backport from Vs is much much less pain. If there is no volunteer, I could look at it again.

real.finder
26th January 2018, 08:32
More than a year ago I gave it a try but it was too much work (goal: 2.6 header, remove mmx and inline asm, add new colorspaces). I think the backport from Vs is much much less pain. If there is no volunteer, I could look at it again.

this is vs source https://github.com/handaimaoh/removedirtvs

pinterf
26th January 2018, 08:52
Thanks, I know it, SCSelect, DupBlocks and RestoreMotionBlocks are ported. Those would be enough for me.
I was hoping to port all the other stuffs (without knowing if they are used by anyone) and there was a 0.9 and a half-ready 1.0 I think, then I stopped working on it.

StainlessS
26th January 2018, 16:05
Kassandro forum, no longer online:- http://videoprocessing.11.forumer.com

PAGE NOT FOUND

I did not look on waybackmachine for it.

silverwing
24th February 2019, 21:20
Thanks, I know it, SCSelect, DupBlocks and RestoreMotionBlocks are ported.

Hi!

Can anybody tell me where SCSelect is located in modern Avisynth (i.e. version 2.6+)?
Thank you for attention. :thanks:

StainlessS
24th February 2019, 22:02
SCSelect was from a Kassandro plugin.

Here an equivalent function in script:- https://forum.doom9.org/showthread.php?p=1633738#post1633738


Avisource("D:\avs\test.avi")

# RemoveDirt's SCSelect(clip input, clip scene_begin, clip scene_end, clip global_motion, float dfactor, bool debug, bool planar)

Function SCSelect_Like(clip dclip,clip Start,clip End,clip Motion, float "dfactor",bool "debug") {
# Start, End, Motion MUST all be same, dclip can be other colorspace/size (unlike SCSelect).
dfactor=Float(Default(dfactor,4.0))
debug=Default(debug,false)
Global SCM_A=0.0 Global SCM_B=0.0 Global SCM_SC=0 Global SCM_Prev=-1
Motion.ScriptClip("""
NotNext = (current_frame!=SCM_Prev+1)
Global SCM_A=(NotNext)? RT_LumaDifference(dclip,dclip,n=current_frame-1,n2=current_frame) : SCM_B
Global SCM_B= RT_LumaDifference(dclip,dclip,n=current_frame,n2=current_frame+1)
# 0 = Start of scene, 1 = End of scene, 2 = Global motion
Global SCM_SC=(current_frame==FrameCount-1)?1:(SCM_A>dfactor*SCM_B || current_frame==0)?0:(SCM_B>dfactor*SCM_A)?1:2
(SCM_SC==0) ? Start : (SCM_SC==1) ? End : Last # Choose Start, End or Motion(ie Last)
(debug)?RT_Subtitle("%d ] %6.2f %6.2f SC=%d",current_frame,SCM_A,SCM_B,SCM_SC):NOP
Global SCM_Prev=current_frame
Return Last
""",args="dfactor,Start,End,Dclip,debug") # Needs Grunt for args
return Last
}

Start=Subtitle("START OF SCENE",align=3,size=30)
End=Subtitle("END OF SCENE", align=1,size=30)
Motion=Subtitle("GLOBAL MOTION",align=5,size=30)
Return SCSelect(Last,Start,End,Motion)

EDITED ABOVE client script: Should not call two instances on function which uses global Vars.

EDIT:

Function EndOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at EOS, else 0
thSCD1=Default(thSCD1,400) thSCD2=Default(thSCD2,130)
sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
bv=sup.MAnalyse(isb=true, delta=1,blksize=16)
Return c.MSCDetection(bv,thSCD1=thSCD1,thSCD2=thSCD2)
}

Function StartOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at SOS, else 0
thSCD1=Default(thSCD1,400) thSCD2=Default(thSCD2,130)
sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
fv=sup.MAnalyse(isb=false,delta=1,blksize=16)
Return c.MSCDetection(fv,thSCD1=thSCD1,thSCD2=thSCD2)
}

Function SceneCutClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma pixel = 0 =Norm, 1=EOS, 2=SOS, 3=EOS & SOS
thSCD1=Default(thSCD1,400) thSCD2=Default(thSCD2,130)
Sup = c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
BvEos= Sup.MAnalyse(isb=True, delta=1,blksize=16)
FvSos= Sup.MAnalyse(isb=False, delta=1,blksize=16)
Eos = c.MSCDetection(BvEos,thSCD1=thSCD1,thSCD2=thSCD2)
Sos = c.MSCDetection(FvSos,thSCD1=thSCD1,thSCD2=thSCD2)
Return MT_Lutxy(Eos,Sos,yexpr="y 0 == x 0 == 0 1 ? x 0 == 2 3 ? ?",u=-128,v=-128)
}

silverwing
24th February 2019, 22:17
SCSelect was from a Kassandro plugin.

Yes I know. I'm already tired of trying to compile the SCSelect function (from RemoveGrainT source) as a separate plug-in, so that it works without a segmentation fault (in AVS+ MT). :(


Here an equivalent function in script:- https://forum.doom9.org/showthread.php?p=1633738#post1633738

Good idea! Thank you! I will try. :thanks:

StainlessS
24th February 2019, 22:34
In the SCSelect_Like thing,


# Add 1st line inside ScriptClip
n=current_frame

And change all other current_frame instances to n. Will maybe be a bit faster (n would be Local var, current_frame is Global, and a LOT SLOWER to access than Locals).
[at least in AVS standard, not sure in AVS+, think AVS+ added a hash table for local/global var access, so may make little difference in AVS+]

EDIT: Like so


# RemoveDirt's SCSelect(clip input, clip scene_begin, clip scene_end, clip global_motion, float dfactor, bool debug, bool planar)

Function SCSelect_Like(clip dclip,clip Start,clip End,clip Motion, float "dfactor",bool "debug") {
# Start, End, Motion MUST all be same, dclip can be other colorspace/size (unlike SCSelect).
dfactor=Float(Default(dfactor,4.0))
debug=Default(debug,false)
Global SCM_A=0.0 Global SCM_B=0.0 Global SCM_SC=0 Global SCM_Prev=-1
Motion.ScriptClip("""
n = current_frame
NotNext = (n!=SCM_Prev+1)
Global SCM_A=(NotNext)? RT_LumaDifference(dclip,dclip,n=n-1,n2=n) : SCM_B
Global SCM_B= RT_LumaDifference(dclip,dclip,n=n,n2=n+1)
# 0 = Start of scene, 1 = End of scene, 2 = Global motion
Global SCM_SC=(n==FrameCount-1)?1:(SCM_A>dfactor*SCM_B || n==0)?0:(SCM_B>dfactor*SCM_A)?1:2
(SCM_SC==0) ? Start : (SCM_SC==1) ? End : Last # Choose Start, End or Motion(ie Last)
(debug)?RT_Subtitle("%d ] %6.2f %6.2f SC=%d",n,SCM_A,SCM_B,SCM_SC):NOP
Global SCM_Prev=n
Return Last
""",args="dfactor,Start,End,Dclip,debug") # Needs Grunt for args
return Last
}

pinterf
25th February 2019, 09:25
There were always more important filters during the last year, maybe I can resurrect the work again this spring.

silverwing
25th February 2019, 17:24
maybe I can resurrect the work again this spring.
YES! Dear pinterf, You can make us happy. :goodpost:
RestoreMotionBlocks () and SCSelect () are very necessary functions.
Thank you!

silverwing
22nd March 2019, 07:14
Thank you pinterf! Now I run the function RemoveDirt (clip input, bool "_grey", int "repmode") in 64-bit avisynth. No segmentation fault. It's work normally.
This is a great job (SCSelect, RestoreMotionBlocks) (https://github.com/pinterf/RemoveDirt), many thanks! :thanks:

pinterf
22nd March 2019, 12:45
My pleasure. And as you'd notice from the git readme, many thing were done since this release, next version is coming soon.