Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th January 2018, 23:47   #1  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Request: Can someone compile a RemoveDirt x64

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/201407230...RemoveDirt.htm


Thanks
poisondeathray is offline   Reply With Quote
Old 25th January 2018, 00:51   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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.
johnmeyer is offline   Reply With Quote
Old 25th January 2018, 01:03   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Quote:
Originally Posted by johnmeyer View Post
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 is offline   Reply With Quote
Old 25th January 2018, 01:21   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
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
poisondeathray is offline   Reply With Quote
Old 25th January 2018, 02:08   #5  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Plus it has the advantage of then integrating into an otherwise all x64 filter chain
MysteryX is offline   Reply With Quote
Old 25th January 2018, 14:38   #6  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by MysteryX View Post
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
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th January 2018, 07:06   #7  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
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.
pinterf is offline   Reply With Quote
Old 26th January 2018, 08:32   #8  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
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
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th January 2018, 08:52   #9  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
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.
pinterf is offline   Reply With Quote
Old 26th January 2018, 16:05   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Kassandro forum, no longer online:- http://videoprocessing.11.forumer.com

PAGE NOT FOUND

I did not look on waybackmachine for it.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 24th February 2019, 21:20   #11  |  Link
silverwing
Registered User
 
Join Date: Nov 2017
Location: Russia, Nizhny Novgorod
Posts: 25
Quote:
Originally Posted by pinterf View Post
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.
silverwing is offline   Reply With Quote
Old 24th February 2019, 22:02   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SCSelect was from a Kassandro plugin.

Here an equivalent function in script:- https://forum.doom9.org/showthread.p...38#post1633738

Code:
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:
Code:
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)
}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 24th February 2019 at 23:03.
StainlessS is offline   Reply With Quote
Old 24th February 2019, 22:17   #13  |  Link
silverwing
Registered User
 
Join Date: Nov 2017
Location: Russia, Nizhny Novgorod
Posts: 25
Quote:
Originally Posted by StainlessS View Post
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).

Quote:
Originally Posted by StainlessS View Post
Here an equivalent function in script:- https://forum.doom9.org/showthread.p...38#post1633738
Good idea! Thank you! I will try.
silverwing is offline   Reply With Quote
Old 24th February 2019, 22:34   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
In the SCSelect_Like thing,

Code:
# 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
Code:
# 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
}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 24th February 2019 at 23:06.
StainlessS is offline   Reply With Quote
Old 25th February 2019, 09:25   #15  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
There were always more important filters during the last year, maybe I can resurrect the work again this spring.
pinterf is offline   Reply With Quote
Old 25th February 2019, 17:24   #16  |  Link
silverwing
Registered User
 
Join Date: Nov 2017
Location: Russia, Nizhny Novgorod
Posts: 25
Quote:
Originally Posted by pinterf View Post
maybe I can resurrect the work again this spring.
YES! Dear pinterf, You can make us happy.
RestoreMotionBlocks () and SCSelect () are very necessary functions.
Thank you!
silverwing is offline   Reply With Quote
Old 22nd March 2019, 07:14   #17  |  Link
silverwing
Registered User
 
Join Date: Nov 2017
Location: Russia, Nizhny Novgorod
Posts: 25
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), many thanks!
silverwing is offline   Reply With Quote
Old 22nd March 2019, 12:45   #18  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
My pleasure. And as you'd notice from the git readme, many thing were done since this release, next version is coming soon.
pinterf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.