digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   SansGrip Filters: Improve picture quality using "AddNoise" Filter (http://www.digitalfaq.com/archives/avisynth/1510-sansgrip-filters-improve.html)

SansGrip 11-13-2002 01:49 PM

Quote:

Originally Posted by kwag
Here's my latest test with Blockbuster AND NoMoSmooth filters, also from SansGrip. @SansGrip, I can't thank you enough ;)

And I in turn am very grateful for your extensive testing. I'm glad you're playing with NoMoSmooth now -- I think it's got great potential, even though I've not had much feedback on Doom9.

Quote:

Originally Posted by kwag
This is an excelent sample showing the removal of DCT blocks on the background. Look carefully at the background wall.

Yes, the filtered version is much better. I still find it a little too sharp on my monitor, but I'm guessing it's much less noticible when viewed on a TV. I'm going to have to burn a disc with these test clips of yours :).

Quote:

Originally Posted by kwag
Also, look at the file size difference after applying the NoMoSmooth filter.

In future tests would you be able to do one more encode, with just NoMoSmooth and no Blockbuster? I'm very curious to know how much NoMoSmooth helps compression.

Quote:

Originally Posted by kwag
It's a combination of Temporal and Spatial filter. So you may now discard TemporalSmoother and (probably) Convolution3D 8)

I've not used either since, though NoMoSmooth still has a way to go and needs a lot of testing to get it as good as possible with really useful parameters. It has its own Doom9 thread, in case people want to check it out.

Quote:

Originally Posted by kwag
I made some changes ( Expect many changes, until I find the optimal settings, but we're close ;) )

You'll want to play with the NoMoSmooth parameters some. Since it's received such little testing I don't even know how much the motion threshold needs to be varied from source to source, but I'm fairly sure the temporal_* and spatial_* parameters will need to be changed depending on the noise level of the source material.

I'm hoping that a set of "standard" values will be agreed upon which can then be incorporated into a C3D-style preset parameter.

Quote:

Originally Posted by kwag
I also used the default value of 1 for luminance, instead of 1.5, as I had posted before.

From the latest clip I'd say this is still a tiny bit too much, since there's still quite a bit of movement in the wall. I've found that with very careful tweaking of the variances one can eliminate the DCT blocks while minimizing noticible movement. But obviously this is something that depends very much on the source material.

Quote:

Originally Posted by kwag
Feedback welcome 8)

Very impressive stuff. I had no idea Blockbuster would be this effective when I started writing it :D.

Thanks again for your persistence. Testers like yourself really make it easier for the developer to improve the code, and knowing someone is testing the limits of the filter makes one actually want to stare at the source for a dozen more hours improving it :).

SansGrip 11-13-2002 01:57 PM

Quote:

Originally Posted by Holomatrix
Sorry to interject, but why do you use BiLinear resize and not the new Lanczos?

You might be interested in this post on Doom9, in which I compare the range compression of various resizers. These results suggest that it might be best always to use Lanczos then achieve the desired softening through a separate filter.

On the other hand I respect Kwag's opinion greatly, and I tend to believe him when he suggests that perceived quality is superior with bilinear and a selective sharpen.

Holomatrix 11-13-2002 01:58 PM

Ok, thanks. This is the script I am going to try in DVD2SVCD:
[AVISYNTH_BlockbusterBilinearResizeNoMoSmooth]
0=BilinearResize(^TargetWidth,^TargetHeight)
1=AddBorders(0,^BorderTop,0,^BorderBottom)
2=LoadPlugin(!Blockbuster.dll)
3=LoadPlugin(!NoMoSmooth.dll)
4=Blockbuster( method="noise", detail_min=1, detail_max=3, lv=1.5 )
5=Blockbuster( method="sharpen", detail_min=4, detail_max=99,
strength=^StrengthValue )
6=NoMoSmooth()
!Blockbuster.dll=C:\Program Files\DVD2SVCD\Blockbuster\Blockbuster.dll
^StrengthValue=20
!NoMoSmooth.dll=C:\Program Files\DVD2SVCD\NoMoSmooth\NoMoSmooth.dll

Should I put some values in for NoMoSmooth or just leave as is?
Thanks

SansGrip 11-13-2002 02:01 PM

Quote:

Originally Posted by black prince
I use lanczosResize and didn't realize this was happening. I am going to switch to bilinearResize. 8O

Lanczos provides the same kind of sharpness achieved with a bicubic 0/0.75 but mostly without the sometimes very evident artifacts. That said it can still be too much on occasion, especially when the source is very sharp to begin with.

You might also want to try a compromise, such as bicubic 0/0.5 or 0.33/0.33. The latter was declared "most preferred" after tests conducted by the algorithm designers on human subjects ;).

black prince 11-13-2002 02:47 PM

Hi SansGrip,

SansGrip wrote:
Quote:

Lanczos provides the same kind of sharpness achieved with a bicubic 0/0.75 but mostly without the sometimes very evident artifacts. That said it can still be too much on occasion, especially when the source is very sharp to begin with.

You might also want to try a compromise, such as bicubic 0/0.5 or 0.33/0.33. The latter was declared "most preferred" after tests conducted by the algorithm designers on human subjects .
My encodes with lanczosresize and blockbuster-noise-sharpen may be why
my picture quality seems too sharp. Since I encode from DVD source
720x480 shouldn't I use bilinearResize going to 352x240? I believe
bilinearResize and Blockbuster-noise-sharpen produce a more pleasing
picture image in my opinion. :) NoMoSmooth is using default settings, so
I'll wait for Kwag to tweak this filter. 8)

-black prince

Holomatrix 11-13-2002 03:05 PM

Ok, ran my test clip, looks good but I see to much Mosquito noise, should I make a change to my script? or add the UnDot filter?
Thanks

kwag 11-13-2002 03:55 PM

Quote:

Originally Posted by Holomatrix
Ok, ran my test clip, looks good but I see to much Mosquito noise, should I make a change to my script? or add the UnDot filter?
Thanks

What template did you use? What resolution? CQ_VBR value?

-kwag

Holomatrix 11-13-2002 05:45 PM

Shoot, sorry, I ran it through DVD2SVCD and used CCE, forgot to change the encoder to TMPEG. I will set it up using your LBR 352 X 480 (CVD) template settings and see how it goes. By the way would these settings work with your 1 CD 704 X 480 settings? I loved the sharpness and crispness I got with this template but ofcourse lots of blocks. Would these filters remove the blocks but keep the sharpness at this resoulution?
Thanks

kwag 11-13-2002 06:11 PM

Quote:

Originally Posted by Holomatrix
Shoot, sorry, I ran it through DVD2SVCD and used CCE, forgot to change the encoder to TMPEG. I will set it up using your LBR 352 X 480 (CVD) template settings and see how it goes. By the way would these settings work with your 1 CD 704 X 480 settings? I loved the sharpness and crispness I got with this template but ofcourse lots of blocks. Would these filters remove the blocks but keep the sharpness at this resoulution?
Thanks

You'll see blocks only on high speed scenes on the 704x480, depending on your source. But with the filter, it works a lot better. If your DVD player supports bitrates around 3,000Kbps, go ahead and change the MAX bitrate to 3,000-3,500 and you'll get a blockless picture. Maybe a tweak on the spatial parameters on the NoMoSmooth filter would help to blurr high speed motion, and make the blocks unnoticeable :idea:
I'm playing with that as we speak ;)

-kwag

jorel 11-13-2002 09:28 PM

@ Kwag:

Kwag wrote:

Here's the script I used for the sample:

LoadPlugin("C:\encoding\MPEG2DEC.dll")
LoadPlugin("C:\encoding\nomosmooth.dll")
LoadPlugin("C:\encoding\blockbuster.dll")
mpeg2source("K:\TEST\VIDEO_TS\movie.d2v")
BilinearResize(336,192,45,0,630,480)

NoMoSmooth()

######## Auto Strength, proportional strength depending on resolution #####
## Remove only one "#" on front of the resolution that matches your encoding.


BB_Resolution = 352*240
#BB_Resolution = 352*480
#BB_Resolution = 528*480
#BB_Resolution = 544*480
#BB_Resolution = 704*480

BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)
Blockbuster( method="noise", detail_min=1, detail_max=10, lv=1 ) # Apply noise if complexity is <= 10%.
Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue) # Sharpen only if complexity is >= 20% AND <=90%.

##
################## End Auto Strength ####################

AddBorders(8,24,8,24)


I made some changes ( Expect many changes, until I find the optimal settings, but we're close )
If you look at the script, I changed the "noise" method to feed noise up to a complexity level of 10. I also used the default value of 1 for luminance, instead of 1.5, as I had posted before. Then I changed the "sharpen" method to start at a complexity level of 20. Why?, because we don't want to sharpen low lit things close to the boundaries of the DCT blocks on dark scenes. So I started the sharpen filter from 20 up to 90, and left the last ~10% ( 91 to 99 ) untouched. Why?, so that the sharpest edges, highest frequencies, don't get sharpened at all. So this should kill some high frequency "Mosquito Effect"

Feedback welcome


how can i "turn" this to load in dvd2s(K)vcd?
and
how can i load the new templates in dvd2s(K)vcd?

:?
thanks in advance! :wink:

kwag 11-13-2002 10:03 PM

Quote:

Originally Posted by jorel
how can i "turn" this to load in dvd2s(K)vcd?
and
how can i load the new templates in dvd2s(K)vcd?

:?
thanks in advance! :wink:

Not sure if DVD2SVCD can do computations, like in avisynth. You're going to have to edit the "dvd2svcd.ini" file, and add a section for your filters.

-kwag

LadyMiles 11-13-2002 10:42 PM

For some reason I haven't been able to download your test samples. I keep getting bad link errors i.e. "The page cannot be displayed"

In any case are you using your monitor as the quality standard ? With one of your old scripts from yesterday, fiddler on the roof looked okay on my monitor but great on my tv, except in a few dark areas (a lot of blocks on a sun rising scene) . Also that annoying periodic speed up or slow down thing with my dvd player stopped, is that due to the new GOP structure ?
I think I am going to try your new filters on crouching tiger hidden dragon.

kwag 11-13-2002 10:49 PM

Hi LadyMiles,

Are you trying to download the samples from this thread? http://www.kvcd.net/forum/viewtopic....r=asc&start=30

I just tried, with "Right Click, save as..." on a link, and it works.

-kwag

jorel 11-13-2002 11:12 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by jorel
how can i "turn" this to load in dvd2s(K)vcd?
and
how can i load the new templates in dvd2s(K)vcd?

:?
thanks in advance! :wink:

Not sure if DVD2SVCD can do computations, like in avisynth. You're going to have to edit the "dvd2svcd.ini" file, and add a section for your filters.

-kwag

ok Kwag ,but
this script i can't make.
it's confuse for me.

VILLA21 11-14-2002 02:52 AM

jorel
"...ok Kwag ,but
this script i can't make.
it's confuse for me..."

It"s already posted by Dagaar on page 5 of this thread. Have a look there... :)

jorel 11-14-2002 06:02 AM

Quote:

Originally Posted by VILLA21
jorel
"...ok Kwag ,but
this script i can't make.
it's confuse for me..."

It"s already posted by Dagaar on page 5 of this thread. Have a look there... :)


ok,thanks,
but what about this posted by Kwag?

BB_Resolution = 352*240
#BB_Resolution = 352*480
#BB_Resolution = 528*480
#BB_Resolution = 544*480
#BB_Resolution = 704*480
BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)
Blockbuster( method="noise", detail_min=1, detail_max=10, lv=1 ) # Apply noise if complexity is <= 10%.
Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue) # Sharpen only if complexity is >= 20% AND <=90%.


how can i put this it in the script?
it's possible?
thanks in advance! :wink:

VILLA21 11-14-2002 08:31 AM

jorel,
BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)

The above 2 lines calculate the right Strength value for a given resolution.
Eg for 352x240 it"s 20.
Calculate this value manually for your resolution and set it in the Frameserver tab.

LadyMiles 11-14-2002 05:05 PM

anime
 
Is blockbuster good for anime ? If not what filters should be used.

SansGrip 11-14-2002 06:47 PM

Re: anime
 
Quote:

Originally Posted by LadyMiles
Is blockbuster good for anime ? If not what filters should be used.

I've never encoded anime, but my tentative guess is if there's blocks in the encode it might work -- maybe with different settings.

I have a pretty strong hunch it would work well on solid-colour cartoons, though.

Holomatrix 11-14-2002 11:08 PM

Quote:

Originally Posted by VILLA21
jorel,
BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)

The above 2 lines calculate the right Strength value for a given resolution.
Eg for 352x240 it"s 20.
Calculate this value manually for your resolution and set it in the Frameserver tab.

How do I Calculate the value? What would my script look like, using that whole script, for a 352 X 480 resolution?

jorel 11-15-2002 02:36 AM

Quote:

Originally Posted by VILLA21
jorel,
BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)

The above 2 lines calculate the right Strength value for a given resolution.
Eg for 352x240 it"s 20.
Calculate this value manually for your resolution and set it in the Frameserver tab.

:lol:
ok,thank you friend....
it was in front of my eyes and i don't see it!!

:lol:
thanks Villa21:!: :wink: :wink:

VILLA21 11-15-2002 04:55 AM

Holomatrix,
"...How do I Calculate the value? What would my script look like, using that whole script, for a 352 X 480 resolution?..."

(352*240*20) / (352*480) = 10

[AVISYNTH_BlockbusterBilinearResize]
0=BilinearResize(^TargetWidth,^TargetHeight)
1=AddBorders(0,^BorderTop,0,^BorderBottom)
2=LoadPlugin(!Blockbuster.dll)
3=Blockbuster( method="noise", detail_min=1, detail_max=10, lv=1 )
4=Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=^StrengthValue )
!Blockbuster.dll=C:\VideoTools\DVD2SVCD\Blockbuste r\Blockbuster.dll
^StrengthValue=10

Or alternatively set this value in the frameserver tab of DVD2SVCD.

Holomatrix 11-15-2002 10:35 AM

Ok, thanks.

Holomatrix 11-15-2002 11:53 AM

I can't seem to get DVD2SVCD accept 5823 P GOP"S. Is this amount nessessary?

ARAGORN 11-15-2002 12:11 PM

Hi Holomatrix

In dvd2svcd, put the following values:1,18,3,1,18 for ntsc or 1,15,3,1,15 for pal. :D

ARAGORN

Holomatrix 11-15-2002 12:36 PM

Ok, I'll put that. But was wondering why the KVCD LBR 352X240 template is using 1,5823,3,1,18 ?
Thanks

ARAGORN 11-15-2002 12:54 PM

5823 is like a signature in all the kvcd templates. It's there to show it's a kwag template. In dvd2svcd it doesn't work.

ARAGORN

SansGrip 11-19-2002 02:44 PM

Quick update:

I'm currently porting Blockbuster to YV12, which will be the 0.5 release. After that, are there any additions people would like to see? One thing I was considering is the addition of an unsharp mask method.

kwag 11-19-2002 03:40 PM

Hi SansGrip,

Can't think of anything right now. I'm having a good time with the filters as they are ;)

-kwag

SansGrip 11-19-2002 05:19 PM

New version 0.5
 
Here's 0.5 with minor changes for the Avisynth 2.0/YUY2 version but now includes an Avisynth 2.5/YUY2/YV12 version.

Changes:

* Removed chroma noising (and cm and cv parameters)
* Renamed lm and lv to mean and variance respectively
* Some small optimizations here and there

Even though not much has changed in the Avisynth 2.0/YUY2 version, I'd appreciate if everyone could upgrade in order to test this one works okay. You'll probably find it a bit faster too :).

Have fun.

kwag 11-19-2002 07:40 PM

@SansGrip,

I'm going to write a script to mirror your site every hour.
You're updates are coming in too fast :lol:
Count on it, in the next few minutes 8)

Edit:
I've added LegalClip() filter to my processing script.
Here's the latest script I'm using, with the change for Blockbuster version 0.5:

LegalClip() # Just in case, ensure TV Colorspace. ( Is this correct SansGrip ;) )
FluxSmooth()
NoMosmooth()

######## Auto Strength, proportional strength depending on resolution #####
## Remove only one "#" on front of the resolution that matches your encoding.

BB_Resolution = 352*240
#BB_Resolution = 352*480
#BB_Resolution = 528*480
#BB_Resolution = 544*480
#BB_Resolution = 704*480

BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1 ) # Apply noise if complexity is <= 10%.
Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue) # Sharpen only if complexity is >= 20% AND <=90%.

# The last ~10% is left untouched (pass-through), to avoid sharpening highest frequency components ( Peak artifacts, sharpest edge, etc. )
##
################## End Auto Strength ####################


-kwag

SansGrip 11-19-2002 07:58 PM

Quote:

Originally Posted by kwag
I'm going to write a script to mirror your site every hour.
You're updates are coming in too fast :lol:

heheh cool, thanks.

Quote:

LegalClip() # Just in case, ensure TV Colorspace. ( Is this correct SansGrip ;) )
Yep, I would use it right after the ...Source line, then again at the very end of the script to catch any strays that may have snuck in during filtering.

Quote:

FluxSmooth()
NoMosmooth()
I'm not sure you'll gain much by using Flux and NoMo together that couldn't be achieved by using just one with stronger settings. Personally I'd go with Flux, but that's just my opinion :).

kwag 11-19-2002 09:40 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
I'm going to write a script to mirror your site every hour.
You're updates are coming in too fast :lol:

heheh cool, thanks.

http://www.jungleweb.net/~sansgrip/avisynth is now mirrored ~5 minutes past every hour to http://www.kvcd.net/sansgrip/avisynth ;)

Quote:

FluxSmooth()
NoMosmooth()
Quote:

I'm not sure you'll gain much by using Flux and NoMo together that couldn't be achieved by using just one with stronger settings. Personally I'd go with Flux, but that's just my opinion :).
So NoMo is out of the script, for now ;)

-kwag

LadyMiles 11-20-2002 12:53 AM

Wow you go away for a couple of days and the revolution just rolls right pass you. So many new developments. Are there any new test clips Kwag ? Something that would show the sucess of your new script ?

kwag 11-20-2002 12:54 AM

Quote:

Originally Posted by LadyMiles
Wow you go away for a couple of days and the revolution just rolls right pass you. So many new developments. Are there any new test clips Kwag ? Something that would show the sucess of your new script ?

I'll make one up for you :wink: . Stand by .....

Edit:
Here it is: KVCD LBR CQ_VBR=35 ( which fits this particular 120 minute movie on one CD-R ) 47 seconds ~5MB : http://www.kvcd.net/latest.m1v

Script used:

LoadPlugin("C:\encoding\MPEG2DEC.dll")
LoadPlugin("C:\encoding\fluxsmooth.dll")
LoadPlugin("C:\encoding\blockbuster.dll")
LoadPlugin("C:\encoding\legalclip.dll")
mpeg2source("K:\TEST\VIDEO_TS\movie.d2v")
LegalClip()

BilinearResize(336,192,45,0,630,480)

FluxSmooth()

######## Auto Strength, proportional strength depending on resolution #####
## Remove only one "#" on front of the resolution that matches your encoding.


BB_Resolution = 352*240
#BB_Resolution = 352*480
#BB_Resolution = 528*480
#BB_Resolution = 544*480
#BB_Resolution = 704*480

BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round (BB_StrengthConstant / BB_Resolution)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1 ) # Apply noise if complexity is <= 10%.
Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue) # Sharpen only if complexity is >= 20% AND <=90%.

# The last ~10% is left untouched (pass-through), to avoid sharpening highest frequency components ( Peak artifacts, sharpest edge, etc. )
##
################## End Auto Strength ####################

AddBorders(8,24,8,24)
LegalClip()


-kwag

LadyMiles 11-20-2002 01:54 AM

Thanks Kwag. The clip helps to know what to expect and the quality looks great. Have you ever tried the script on "the Matrix" ?

I don't know if this has been answered but does this work on tv captures ?

BTW why two legal clips ?

black prince 11-21-2002 09:37 PM

Hi LadyMiles,

This is from the post above:

Quote:

Kwag Quote:
LegalClip() # Just in case, ensure TV Colorspace. ( Is this correct SansGrip )

SansGrip Quote:
Yep, I would use it right after the ...Source line, then again at the very end of the script to catch any strays that may have snuck in during filtering.
-black prince

KingTuk 11-22-2002 07:46 PM

Script Program
 
has anyone tried this?

http://tangentsoft.net/video/asynther/

I've used it to make several scripts of different movie sizes and now all I have to do is right click on the movie then send to Avisynthesizer and it makes a script for the movie.

SansGrip 12-19-2002 08:43 PM

New release 0.6
 
I just uploaded 0.6 to my site. Here's the changelog:

Quote:

0.6 - Added seed parameter. Fixed a bug that might have been responsible for the access violations when using with high resolutions and the default cache size.
This means you should now be able to drop the cache=1024 from your scripts, since I believe I have fixed the bug that caused the access violation.

The seed parameter allows one to specify the seed value for the pseudo-random number generator. If seed=0 (the default) it'll use the system's current time as in previous versions. If seed>0 it'll use that value for the seed, and there will be no variations in file size when run multiple times.

Hint: It doesn't really matter what number you choose for the seed. As long as it's the same for each run, the file size won't change. I used 1 for my tests, but hey, use your imagination ;).

Let me know how you find it.

black prince 12-19-2002 09:40 PM

Hi SansGrip,

Quote:

The seed parameter allows one to specify the seed value for the pseudo-random number generator. If seed=0 (the default) it'll use the system's current time as in previous versions. If seed>0 it'll use that value for the seed, and there will be no variations in file size when run multiple times.

Thank you, Thank you, thank you, thank you...... :D :D :D

-black prince


All times are GMT -5. The time now is 05:38 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.