Log in

View Full Version : New Sharpening Function from Didée -'SeeSaw'


Pages : 1 2 3 [4] 5 6 7 8 9 10 11 12 13

Boulder
14th August 2006, 20:56
If you don't specify the a- and b-clips in SeeSaw, the function does some denoising on its own because SeeSaw would be totally useless if there wasn't a denoised clip available for it to use. You can affect the output greatly by using an appropriate denoiser.

This snippet shows you what it does to create a denoised clip:
mt_lutxy(clp,clp.removegrain(4),"x "+NRL+" + y < x "+NRL+" + x "+NRL+" - y > x "+NRL+" - y ? ?",U=2,V=2)

SeeSaw often does a better job than LSF but it depends on the material, good quality source is the most important thing. And there is a price to pay - encoding time.

shaolin95
14th August 2006, 21:06
I just think seesaw looks a bit soft compared to LSF... I know the strenght parameter we shouldnt play with it so what else can I change to make it a bit sharper?

Boulder
14th August 2006, 21:14
By raising SLimit? The docs say that you shouldn't touch the sharpening strength too much

BigDid
14th August 2006, 21:39
I just think seesaw looks a bit soft compared to LSF... I know the strenght parameter we shouldnt play with it so what else can I change to make it a bit sharper?
Hi,

If Spresso is involved (like here: SPresso(2, 20, 4) ), you might want to know that removegrain mode=4 (last param) is one of the strongest compression mode available in RMG; and it soften a lot!. Other modes can also be used like mode=17 or less compressible like mod 8 or 9; same use: SPresso(2, 25, 17)

Did

shaolin95
15th August 2006, 02:34
I dont use Spresso, I use degrainmedian(mode=2). Still LSF gives me better results.

Jeremy Duncan
15th August 2006, 02:46
Hi,

If Spresso is involved (like here: SPresso(2, 20, 4) ), you might want to know that removegrain mode=4 (last param) is one of the strongest compression mode available in RMG; and it soften a lot!. Other modes can also be used like mode=17 or less compressible like mod 8 or 9; same use: SPresso(2, 25, 17)

Did

I tried SPresso(2, 25, 17) vs SPresso(2, 20, 4).
I see the spresso is a little less sharp than either hqdn3d(0.0, 2.0, 0.0, 4.0) or denoise3d; 0.0, 2.0, 4.0, HQ checked.
But the mode 4 is no different to my eye and screenshot comparison than mode 17.

BigDid
15th August 2006, 03:03
I tried SPresso(2, 25, 17) vs SPresso(2, 20, 4).
I see the spresso is a little less sharp than either hqdn3d(0.0, 2.0, 0.0, 4.0) or denoise3d; 0.0, 2.0, 4.0, HQ checked.
But the mode 4 is no different to my eye and screenshot comparison than mode 17.
Hi,

Defaut given by Didée is 2 for limit ; 25 for strength and 4 for removegrain mode: http://forum.doom9.org/showthread.php?p=743559#post743559

Please compare at equal strength:
2, 25, 4 against
2, 25, 17

Or at 30/33 strength which seems (for me) the compromise between compressibility (file size) and strength (softening) and I do see some differences between the mode 4 and 17 (a little sharper, a little less compressible).

Lots of tools actually available, pick your own :)

Did

Jeremy Duncan
15th August 2006, 07:34
I looked at screenshots that shows loss/gain between 2 pictures quality.

I saw what looked like a little better sharpness using 2, 25, 17
But it was so faint that it might have been my imagination.

I used;
2, 25, 4
vs
2, 25, 17

Jeremy Duncan
15th August 2006, 08:17
Ok. So this is what I'm using for seesaw. Is this right Boulder ?

SeeSaw(NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=16, Spower=10, Sdamplo=6, Szp=16)

Boulder
15th August 2006, 08:19
Yes, if you don't wish to use any denoised clip of your own.

Jeremy Duncan
15th August 2006, 09:01
Dideé,

I understand from your first post in this thread that Pookie released Seesaw without your permission.

My question is when will you officially release Seesaw ?
I don't want to use the one Pookie released.

Didée
15th August 2006, 09:23
No reason to flinch from using it. Pookie had my OK to post it, and after all, there even were quite a few updates since the first post ... ;)

One of the main reasons to hold SeeSaw back was that I wanted to include a tailored halo-protection. Currently, if the source already has slight halos, there is danger that they will be emphasised. (In the script there's a commented "head=head.maskedmerge(..." line, which will help for the problem when it's uncommented. Not the perfect solution, but it's not bad, either.)

Jeremy Duncan
15th August 2006, 09:47
No reason to flinch from using it. Pookie had my OK to post it, and after all, there even were quite a few updates since the first post ... ;)

One of the main reasons to hold SeeSaw back was that I wanted to include a tailored halo-protection. Currently, if the source already has slight halos, there is danger that they will be emphasised. (In the script there's a commented "head=head.maskedmerge(..." line, which will help for the problem when it's uncommented. Not the perfect solution, but it's not bad, either.)

Ok. I'll use Seesaw then.
Thank you for building it.

Pookie
15th August 2006, 09:58
Dideé,

I understand from your first post in this thread that Pookie released Seesaw without your permission.

My question is when will you officially release Seesaw ?
I don't want to use the one Pookie released.


http://wilstar.com/midi/twilzone.wav :D

BigDid
15th August 2006, 18:46
I saw what looked like a little better sharpness using 2, 25, 17
But it was so faint that it might have been my imagination.

I used;
2, 25, 4
vs
2, 25, 17
Hi,

I noticed (and indicated) more differences in
2, 33, 4 -> softer, more compressible
vs
2, 33, 17-> sharper, less compressible

Did

Facct
15th August 2006, 22:06
No reason to flinch from using it. Pookie had my OK to post it, and after all, there even were quite a few updates since the first post ... ;)

One of the main reasons to hold SeeSaw back was that I wanted to include a tailored halo-protection. Currently, if the source already has slight halos, there is danger that they will be emphasised. (In the script there's a commented "head=head.maskedmerge(..." line, which will help for the problem when it's uncommented. Not the perfect solution, but it's not bad, either.)

Dideé, do you have any ideas re the real-time NTSC playback problem? (http://forum.doom9.org/showthread.php?p=862776#post862776)

Jeremy Duncan
16th August 2006, 04:01
Hi BigDid,

I tried;
2, 33, 4
vs
2, 33, 17

I compared frames.
When I do this I can see minut changes in the picture.
I use Windows picture and fax viewer.

There was no difference between these two settings.

I can see a different between;
SPresso(2, 20, 4)
hqdn3d(0.0, 2.0, 0.0, 4.0)
denoised3d; 0.00, 2.00, 4.00, HQ checked.

Mug Funky
16th August 2006, 04:21
@ facct:

seesaw doesn't cause dupe-frames. that'll most likely be nvidia doing that.

Facct
17th August 2006, 01:42
I see, but there is no problem with IVTC with any other combination of source/filtering, only SeeSaw manages to break it!

Pookie
17th August 2006, 03:05
Facct - Do you have the PureVideo 1.02-223 from June 28th?
http://www.nvidia.com/object/dvd_decoder_1.02-223-retail.html

That seems to be the latest.

You can also try the Dscaler decoder with IVTC from -

http://www.avsforum.com/avs-vb/showthread.php?t=596942&page=4&pp=30&highlight=1080i+dscaler5

Another possible workaround might be using Tom Barry's Uncomb filter, which is supposed to be a fast IVTC filter for Avisynth.
http://mywebpages.comcast.net/trbarry/downloads.htm

Also, there may be a bug in the Avisynth plugin for FFdshow - purely guessing, but it could be something to check.

Finally, there's always LimitedSharpen, which could be an interesting test to see if the issue persists.

I think I recall Dideé mentioning that he doesn't use his functions for playback on his system, and SeeSaw.avs has the "Consider this Alpha" disclaimer, so you may have to address the issue from other angles.

Encode a clip of data with SeeSaw and go frame by frame through the target, looking for interlace/Telecine artifacts.

BTW, I liked your settings with SeeSaw that you posted. Looks nice on a lot of different sources.:)

shaolin95
17th August 2006, 17:13
I cant seem to make my mind between LSF and Seesaw. I thought LSF was sharper and better but yesterday I tried seesaw and tweaked some more and now it seems bring out small detail better than LSF. Gonna have to sit down and take lots of screenshots with different settings to compare. Any reference scenes that will help pinpoint artifacts easier?

foxyshadis
17th August 2006, 20:25
Anything with DCT artifacts ("mosquito noise"), anything with a lot of banding.

Jeremy Duncan
18th August 2006, 16:40
SeeSaw(NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=16, Spower=10, Sdamplo=6, Szp=16)

This new SeeSaw script is easier on the cpu, but not as detailed as the quoted one.

SeeSaw(NRlimit=2, NRlimit2=2, Sstr=1.0, Slimit=16, Spower=4, Sdamplo=6, Szp=16, bias=49)

Jeremy Duncan
19th August 2006, 14:16
a= last
b=a.SPresso(2, 20, 4)
SeeSaw(a, b, NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=16, Spower=4, Sdamplo=6, SdampHi=15, Szp=16, bias=50, sootheT=1)

Here's another SeeSaw script to try.

:helpful:

ARL67
19th August 2006, 18:17
Just an FYI:
I agree with Jeremy that putting a & b in the SeeSaw call makes things very grainy, regardless of what b might be.

- Andy

Jeremy Duncan
20th August 2006, 00:12
Decent results;
SetMTMode(2)
MT("SeeSaw(NRlimit=2, NRlimit2=2, Sstr=1.0, Slimit=16, Spower=4, Sdamplo=6, Szp=16, bias=49)")

Better Results;
SetMTMode(2)
MT("SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.0, Slimit=16, Spower=4, Sdamplo=6, SdampHi=15, Szp=16, bias=50, sootheT=1)")

Best Results;
SetMTMode(2)
MT("SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=16, Spower=4, Sdamplo=6, SdampHi=15, Szp=16, bias=50, sootheT=1)")

I removed the a,b in the SeeSaw script.

shaolin95
20th August 2006, 23:06
Do you mind trying this and seeing how it compares in your opinion, to your seesaw results?

SetMTMode(2)


MT("HQDN3D(2)")

MT("LimitedSharpenFaster(ss_x=1.5,ss_y=1.5,Smode=3,lmode=2,strength=200,wide=true, overshoot=0)")

Gonna do the same now but need to get some window sun blocker for my room.

Jeremy Duncan
21st August 2006, 03:54
Do you mind trying this and seeing how it compares in your opinion, to your seesaw results?

SetMTMode(2)


MT("HQDN3D(2)")

MT("LimitedSharpenFaster(ss_x=1.5,ss_y=1.5,Smode=3,lmode=2,strength=200,wide=true, overshoot=0)")


The quoted settings are better than my "Decent" and "Better" settings.
But my "Best" settings show more detail than the quoted settings.

shaolin95
21st August 2006, 05:46
It does have more detail but unfortunately also a lot of artifacts. What is your display? You can try strength 300 with my script to achieve a sharper image and still not get the artifacts I got with the seesaw call. Maybe you are resizing before or something else I am not doing.
Like this:
SetMTMode(2)


MT("HQDN3D(1)")

MT("LimitedSharpenFaster(ss_x=1.5,ss_y=1.5,Smode=3,lmode=2,strength=300,wide=true, overshoot=0)")
Regards

frednerk33
21st August 2006, 10:55
Amazing Pookie strong denoising magic ... SeeSaw combined with MVDegrain2 and DeGrainMedian ...

Samples in http://forum.doom9.org/showthread.php?p=865872#post865872

Code in http://forum.doom9.org/showthread.php?p=865906#post865906

Couldn't believe my eyes.

Jeremy Duncan
21st August 2006, 12:53
The Plugin's you'll need to run the tests.

http://img244.imageshack.us/img244/7937/pluginsic6.jpg

http://avisynth.org.ru/mvtools/mvtools-v1.4.10.zip
http://avisynth.org.ru/degrain/degrainmedian081.zip
http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar
http://manao4.free.fr/MaskTools-v1.5.8.zip
http://home.arcor.de/dhanselmann/_stuff/SeeSaw_2006.01.02.rar
http://manao4.free.fr/masktools-v2.0a28.zip

Pookies
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )

Mine
SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=16, Spower=4, Sdamplo=6, SdampHi=15, Szp=16, bias=50, sootheT=1)

shaolin95
LimitedSharpenFaster(ss_x=1.5,ss_y=1.5,Smode=3,lmode=2,strength=300,wide=true, overshoot=0)

Order of Pictures from Left to right; Pookie, Me, shaolin95 (http://upload.enetation.co.uk/uploads/7fd134cd48.png)
Order of Pictures from Left to right; Pookie, Me, shaolin95 (http://upload.enetation.co.uk/uploads/95dd396b0d.png)

Jeremy Duncan
21st August 2006, 12:57
It does have more detail but unfortunately also a lot of artifacts. What is your display? You can try strength 300 with my script to achieve a sharper image and still not get the artifacts I got with the seesaw call. Maybe you are resizing before or something else I am not doing.

Regards

I resize after Avisynth. My Monitor is a Samsung 793df.

frednerk33
21st August 2006, 13:44
Very Subjectively, to me, Pookie's seems nice, then Jeremy's, then shaolin95 ... how does one ask for a poll (you may consider one if it's easy) ?

PS I'm not sure how much diff the SeeSaw settings make if you fiddle with them for this source...

shaolin95
21st August 2006, 16:03
I resize after Avisynth. My Monitor is a Samsung 793df.
Perhaps in the smaller display is not visible but I get very bad artifacts (easy to see in motion) with your seesaw script with my front projector. I am gonna play with it to see which paramater is causing that.

Pookie
21st August 2006, 17:09
Just to demonstrate that the source file dictates which type of script to use - Here's a noisy, grainy source image

Source Frame
http://fileserver2.jpghosting.com/images/tn_Source-0059_35d3e1ca7105175cb9bbfc5e19eb8b80.png (http://fileserver2.jpghosting.com/images/Source-0059_35d3e1ca7105175cb9bbfc5e19eb8b80.png)

Jeremy's Script
http://fileserver2.jpghosting.com/images/tn_Jeremy-0059_635ac67e2911e40ddccb0c85030c714e.png (http://fileserver2.jpghosting.com/images/Jeremy-0059_635ac67e2911e40ddccb0c85030c714e.png)

Shaolin's Script
http://fileserver2.jpghosting.com/images/tn_Shaolin-0059_e3d64aaf7f7e5013659d5f4a2e5bd355.png (http://fileserver2.jpghosting.com/images/Shaolin-0059_e3d64aaf7f7e5013659d5f4a2e5bd355.png)

Pookie's Script
http://fileserver2.jpghosting.com/images/tn_MVdegrain-0059_84af7bd165aed6a1b0ef29af7cd42376.png (http://fileserver2.jpghosting.com/images/MVdegrain-0059_84af7bd165aed6a1b0ef29af7cd42376.png)

Conversely, it would be silly to use MVdegrain with SeeSaw on a great quality source.

shaolin95
22nd August 2006, 05:29
Agree just noticed that my call really looks bad for some dvds and good for others. I am now trying this one and seem to like it:

MT("colormatrix",3)
MT("a = last

b=a
SeeSaw(a,b, NRlimit=1, NRlimit2=4, Sstr=1.5, Slimit=16, Spower=10, SdampLo=6, Szp=16)",3)
NOTE: resize 1.5 lanczos 4 BEFORE the avisynth

Jeremy Duncan
22nd August 2006, 18:48
Pookies; Top Left Picture.
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )

Mine; Top Right Picture.
MT("SeeSaw(NRlimit=2, NRlimit2=1, Sstr=1.4, Slimit=16, Spower=4, Sdamplo=6, SdampHi=15, Szp=16, bias=50, sootheT=1)",3)

Shaolin95; Bottom Left Picture.
MT("colormatrix",3)
MT("SeeSaw(NRlimit=1, NRlimit2=4, Sstr=1.5, Slimit=16, Spower=10, SdampLo=6, Szp=16)",3)

Mine; Bottom Right Picture.
MT("SPresso(2, 20, 4)
LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,Smode=3,strength=100,overshoot=1)",3)

Link to Picture (http://fileserver2.jpghosting.com/images/PookieMeShaolinMe_948017e3ec8418fb8af48e8852590cbf.PNG)

Jeremy Duncan
22nd August 2006, 18:50
Pookie,
I tried to use MT on your script.
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )

It would not play using MT. I tried just the Seesaw, just the Seesaw and denoise, and the entire script.
I got 3fps not using any MT.

Boulder
22nd August 2006, 18:54
Any MVTools-related function doesn't work with multithreading (MT or SetMTMode) and MVDegrain is one of those. Leave the a-clip out of the MT call and it should work.

Jeremy Duncan
22nd August 2006, 19:33
Any MVTools-related function doesn't work with multithreading (MT or SetMTMode) and MVDegrain is one of those. Leave the a-clip out of the MT call and it should work.

MT("backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
SeeSaw( NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )",3)

This one can use MT. It goes from 3fps not using MT, to 14fps using MT.

shaolin95
22nd August 2006, 19:36
Nice comparison Jeremy. I think mine shows more "detail" followed by your top right one show better detail but I am not sure if I like what colormatrix does to mine. Are you using Theater Tek? If you are try this, take a screen shot using nvidia AND ffdshow processing and then using only ffdshow. For some reason I get a color change (basically reds) when trying these two settings.

Boulder
22nd August 2006, 19:42
MT("backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
SeeSaw( NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )",3)

This one can use MT. It goes from 3fps not using MT, to 14fps using MT.
No, it will be screwed up one way or the other. MVTools is not multithread friendly at the moment, if you don't believe me, just take a look at the MVTools thread.

Jeremy Duncan
22nd August 2006, 20:01
No, it will be screwed up one way or the other. MVTools is not multithread friendly at the moment, if you don't believe me, just take a look at the MVTools thread.

To use MT;
This must be changed...
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )

To this
MT("SeeSaw(NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )",3)

shaolin95
22nd August 2006, 23:25
Newer and slightly better (I hope) call:

resize 1.5x lanc4
then:
MT("SeeSaw(NRlimit=0, NRlimit2=4, Sstr=1.5, Slimit=56, Spower=10, SdampLo=6,Szp=16,bias=50,soothet=60)",3)
MT("ColorMatrix()",3)

bkman
23rd August 2006, 01:31
Any MVTools-related function doesn't work with multithreading (MT or SetMTMode) and MVDegrain is one of those. Leave the a-clip out of the MT call and it should work.

I've gotten it to work on my single-core. See: http://forum.doom9.org/showthread.php?p=866343#post866343

Does it suddenly fail on an actual dual-core?

Boulder
23rd August 2006, 05:10
It shouldn't just fail but it may cause some weird behaviour and artefacts. This is what tsp (the author of multithreaded Avisynth) said:
Mvtools is not coded with multithreading in mind as there are many places in the code that could cause trouble with multithreading(like global motion getting estimated by two different frames at the same time making it rather random witch value will be used).So I really wouldn't use any multithreading for the MVTools-related part of the script. You can use SetMTMode if you add SetMTMode(5) right before those MVTools parts and then re-enable multithreading by adding SetMTMode(2) (or whatever mode you use) after them.

Backwoods
23rd August 2006, 05:18
EDIT: Nevermind, I see that MVTools wasn't called in the changed script. MVTools doesn't work with MT in my test scripts.

bkman
23rd August 2006, 08:11
It shouldn't just fail but it may cause some weird behaviour and artefacts. This is what tsp (the author of multithreaded Avisynth) said:
So I really wouldn't use any multithreading for the MVTools-related part of the script. You can use SetMTMode if you add SetMTMode(5) right before those MVTools parts and then re-enable multithreading by adding SetMTMode(2) (or whatever mode you use) after them.

That's odd. I've tested pookie's script that uses MVAnalyse and MVDegrain with two threads, and it works without errors or corrupted output in modes 2 and 5/6 (though all others fail or result in corrupt output). Mode 2 was quite a bit slower than the mode 5/6, however.

Would it behave differently on a dual-core CPU vs a single-core using two threads?

Boulder
23rd August 2006, 08:16
Post the scripts you used..

If you read the quote I posted, you see it may or may not work but MVTools is not multithread friendly. You might not see the artefacts in one frame but they may appear in the other.

It doesn't matter whether you have one or two cores because the principle is the same.

bkman
23rd August 2006, 08:37
The script was basically this:
SetMTmode(2,2)
loadplugin("removegrainsse2.dll")
loadplugin("masktools.dll")
loadplugin("mvtools.dll")
loadplugin("repairsse2.dll")
import("seesaw.avs")

DGDecode_mpeg2source("VTS_11.d2v",info=3)
ColorMatrix(hints=true)
crop( 8, 16, -8, -16)
deblock()

backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = last.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = last.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)

b = a.RemoveGrain(mode=11)
SeeSaw(a,b, NRlimit=5, NRlimit2=6,Sstr=1.5, Slimit=8, Spower=8, Szp=16,soothet=80)

I encoded 300 frames and compared against the single-threaded output. It was bit-identical.

Btw, I realize now that mode 5 disables multi-threading (though it's not documented) so I didn't post that.