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 21st June 2010, 09:16   #21  |  Link
Jawed
Registered User
 
Join Date: Jan 2008
Location: London
Posts: 156
Quote:
Originally Posted by Gavino View Post
An innovative use of quotes.
Why not use a real comment /* ..... */ which can span multiple lines.
Not on my system.

If Avisynth allows that, now, then

I'm using 2.57 tsp MT version 5, built March 1 2007 - it works for the things I do - so I have no interest in spending time debugging anything newer.
Jawed is offline   Reply With Quote
Old 22nd June 2010, 05:11   #22  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 295
Quote:
Originally Posted by foxyshadis View Post
Replace your version of the script with the one in the zip file. Yours might be modified or corrupted.
That is the version I'm using...
Floatingshed is offline   Reply With Quote
Old 16th July 2010, 22:29   #23  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
The dither package has been updated to version 1.3.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding

Last edited by cretindesalpes; 16th July 2010 at 22:33.
cretindesalpes is offline   Reply With Quote
Old 8th September 2010, 09:05   #24  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
Do you plan to release a x64 aware version?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 8th September 2010, 11:11   #25  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
I don't know. I will release soon an additional function to smooth the low gradients in the 16-bit world, and a derived function roughly equivalent to gradfun2db(). Then, I'll try to port the whole thing to x64, but only if I can obtain the source code for the x64 ports of dfttest and MVTools2. Currently, I have no news from JoshyD on this topic.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 8th September 2010, 13:28   #26  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
However, thanks
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 12th September 2010, 12:02   #27  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
I am trying to use your package but I keep on getting VirtualDub crashing when opening the file. Please, tell me a simple, stupid denoise script you get working. =P
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 12th September 2010, 22:46   #28  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
Quote:
Originally Posted by tormento View Post
I am trying to use your package but I keep on getting VirtualDub crashing when opening the file.
"Crashing" is very vague and I cannot do anything with only this bit of information. Please copy the crash error message and the script you tried to open.

Quote:
Please, tell me a simple, stupid denoise script you get working. =P
This is taken from the dither.avsi documentation:

Code:
h = Height ()
w = Width ()
dfttest (lsb=true)
msb = last.Crop (0, 0, w, h)
lsb = last.Crop (0, h, w, h)
DitherPost (msb, lsb)
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 13th September 2010, 08:08   #29  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
Quote:
Originally Posted by cretindesalpes View Post
Please copy the crash error message and the script you tried to open.
I always use the word crash when I have nothing to report, i.e. the error is so severe the program simply hangs or outputs a stupid meaningless hex error.
Quote:
Originally Posted by cretindesalpes View Post
This is taken from the dither.avsi documentation:
Mm.. the script I tried to wrote was even simpler but took in account both pre and post. Wait a couple of hours, I'll arrive at office and try again, now I'm on a sluggish train..
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th September 2010, 16:30   #30  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
Ok, I had some spare time to play with dither but I can't see any difference between the results of these 2 scripts:

PHP Code:
super   MSuper(pel=2sharp=1)
bv3     MAnalyse(superisb truedelta 3overlap=8blksize=16)
bv2     MAnalyse(superisb truedelta 2overlap=8blksize=16)
bv1     MAnalyse(superisb truedelta 1overlap=8blksize=16)
fv1     MAnalyse(superisb falsedelta 1overlap=8blksize=16)
fv2     MAnalyse(superisb falsedelta 2overlap=8blksize=16)
fv3     MAnalyse(superisb falsedelta 3overlap=8blksize=16)

MDegrain3(superbv1fv1bv2fv2bv3fv3thSAD=400
PHP Code:
Height ()
Width ()

super   MSuper(pel=2sharp=1)
bv3     MAnalyse(superisb truedelta 3overlap=8blksize=16)
bv2     MAnalyse(superisb truedelta 2overlap=8blksize=16)
bv1     MAnalyse(superisb truedelta 1overlap=8blksize=16)
fv1     MAnalyse(superisb falsedelta 1overlap=8blksize=16)
fv2     MAnalyse(superisb falsedelta 2overlap=8blksize=16)
fv3     MAnalyse(superisb falsedelta 3overlap=8blksize=16)

MDegrain3(superbv1fv1bv2fv2bv3fv3thSAD=400lsb=true)

msb last.Crop (00wh)
lsb last.Crop (0hwh)
DitherPost (msblsb
Am I doing something wrong?

P.S: The purpose is to degrain without too much banding.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th September 2010, 22:09   #31  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
Quote:
Originally Posted by tormento View Post
Am I doing something wrong
This looks correct. Anyway, the result will really depend on your source. If the noise you try to remove has nothing to do with dithering of a high-bitdepth master or is not related to film grain, and if your source already has banding, the MDegrain won't fix anything.

You'll have probably more success with a spatio-temporal denoiser, dfttest for instance. I generally use a combination of both MDegrain for the detailed areas, and dfttest for low gradient and flat areas. See my post #8 on this thread.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 19th September 2010, 03:11   #32  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 976
Well, a lsb enabled version of fft3dfilter and fft3dgpu (perhaps this is more difficult) would be nice
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 21st September 2010, 18:18   #33  |  Link
james99
Registered User
 
Join Date: Nov 2007
Posts: 1
It increases the FPS of progressive Blu ray video from 24fps to 48fps during my test
I do believe it is
Interleave (base, rem) that is doubling the fps in the Dither2Pre function.

can be fixed using
assumefps(24) to change the fps back to 24.

Last edited by james99; 21st September 2010 at 18:23.
james99 is offline   Reply With Quote
Old 21st September 2010, 22:00   #34  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
Quote:
Originally Posted by james99 View Post
It increases the FPS of progressive Blu ray video from 24fps to 48fps during my test
You're right. But put the AssumeFps after the DitherPost call. This will be fixed in the next release.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 25th September 2010, 01:48   #35  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
I released a new version of the Dither tools (1.4).

I added SmoothGrad, a smoothing function to get the gradients clean where it low frequency noise or color-banding steps remain after denoising. From this, I built GradFun3, a function intended to smooth sources containing banding and already denoised. This is very similar to GradFun2db.

Here are some examples, comparing several denoising+debanding methods:


Original / Filtered

GradFun2db / GradFun3

Dither / Dither+SmoothGrad

From the previous pictures, I magnified and amplified several zones in order to show the differences more clearly:

Still the same order:
Original / Filtered
GradFun2db / GradFun3
Dither / Dither+SmoothGrad

One can see that both GradFun function perform poorly near the edges. This is because they are based on massive box filtering and have to stop as soon as the box overlaps an area of a different color. Ideally, these function would use a large bilateral filter, but this would be really overkill and much much slower.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding

Last edited by cretindesalpes; 25th September 2010 at 02:01.
cretindesalpes is offline   Reply With Quote
Old 25th September 2010, 02:36   #36  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 295
I'm struggling to understand how to use this. Some examples don't use dither2pre others do.
This is what I've been trying, every odd frame is all green noise, and the framerate has doubled:


Code:
LoadPlugin("D:\Avisynth scripts\best_dither\dither.dll")
Import("D:\Avisynth scripts\dither.avs")
LoadPlugin("D:\Avisynth scripts\dfttest-1.8mod16a\dfttest.dll")
LoadPlugin("D:\Avisynth scripts\mvtools-2.5.10.1-mod16a\mvtools2.dll")

Dither2pre()

h = Height ()
w = Width ()

super   = MSuper(pel=2, sharp=1)
bv3     = MAnalyse(super, isb = true, delta = 3, overlap=8, blksize=16)
bv2     = MAnalyse(super, isb = true, delta = 2, overlap=8, blksize=16)
bv1     = MAnalyse(super, isb = true, delta = 1, overlap=8, blksize=16)
fv1     = MAnalyse(super, isb = false, delta = 1, overlap=8, blksize=16)
fv2     = MAnalyse(super, isb = false, delta = 2, overlap=8, blksize=16)
fv3     = MAnalyse(super, isb = false, delta = 3, overlap=8, blksize=16)

MDegrain3(super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=400, lsb=true)

msb = last.Crop (0, 0, w, h)
lsb = last.Crop (0, h, w, h)
DitherPost (msb, lsb)

Last edited by Floatingshed; 25th September 2010 at 02:48.
Floatingshed is offline   Reply With Quote
Old 25th September 2010, 09:53   #37  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
Either use Dither1Pre/Dither2Pre, either the modified MDegrain or dfttest, but not both. The only purpose of DitherXPre is to give the possibility to use a specific denoiser which hasn't been modified to output 16 bit data. For example :

Code:
# (Put your source here)
Dither2Pre (flt="TTempSmoothF(lthresh=4*4,cthresh=5*4).frfun7(Lambda=1.1*4)")
DitherPost ()
Without Dither2Pre, your script becomes:

Code:
# (Import scripts, plug-ins and input clip here)

h = Height ()
w = Width ()

super   = MSuper(pel=2, sharp=1)
bv3     = MAnalyse(super, isb = true, delta = 3, overlap=8, blksize=16)
bv2     = MAnalyse(super, isb = true, delta = 2, overlap=8, blksize=16)
bv1     = MAnalyse(super, isb = true, delta = 1, overlap=8, blksize=16)
fv1     = MAnalyse(super, isb = false, delta = 1, overlap=8, blksize=16)
fv2     = MAnalyse(super, isb = false, delta = 2, overlap=8, blksize=16)
fv3     = MAnalyse(super, isb = false, delta = 3, overlap=8, blksize=16)

MDegrain3(super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=400, lsb=true)

msb = last.Crop (0, 0, w, h)
lsb = last.Crop (0, h, w, h)
DitherPost (msb, lsb)
With the latest version, the three last lines can just be replaced with DitherPost (stacked=true) and you don't need to collect w and h.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding

Last edited by cretindesalpes; 25th September 2010 at 09:56.
cretindesalpes is offline   Reply With Quote
Old 25th September 2010, 19:37   #38  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 295
Now its making sense and working. Many thanks.
Floatingshed is offline   Reply With Quote
Old 27th September 2010, 12:36   #39  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Quote:
Originally Posted by cretindesalpes View Post
From the previous pictures, I magnified and amplified several zones in order to show the differences more clearly:

Still the same order:
Original / Filtered
GradFun2db / GradFun3
Dither / Dither+SmoothGrad

One can see that both GradFun function perform poorly near the edges. This is because they are based on massive box filtering and have to stop as soon as the box overlaps an area of a different color. Ideally, these function would use a large bilateral filter, but this would be really overkill and much much slower.
Every single one there except gradfun looks utterly terrible. Why? Because they use ordered dither. Use error diffusion, for the sake of your eyes.
Dark Shikari is offline   Reply With Quote
Old 27th September 2010, 17:32   #40  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 610
Quote:
Originally Posted by Dark Shikari View Post
Every single one there except gradfun looks utterly terrible. Why? Because they use ordered dither. Use error diffusion, for the sake of your eyes.
This topic is about noise removal and color banding, not converting a 16M color picture in 256 colors. In actual use, you should never really see the patterns you quoted. I HSV-stretched these excerpts of the previous pictures in GIMP just to show what the plug-in does without having to push the contrast & gamma of your monitor. Also, keep in mind that these patterns have a temporal component.

I used ordered dither instead of a 3D-version of the Floyd-Steinberg algorithm to give a chance to the dither to resist better to the video compression.

Here [dead link, sorry] is a comparison of a standard dither from a high-quality picture (direct bluray rip) compressed @ 6 Mbps and the same movie, re-dithered and compressed with the same settings.
__________________
dither 1.27.2 for AviSynth | avstp 1.0.3 for AviSynth development | fmtconv r19 for Vapoursynth | trimx264opt segmented encoding

Last edited by cretindesalpes; 7th November 2010 at 18:27. Reason: Dead link
cretindesalpes is offline   Reply With Quote
Reply

Tags
color banding, deblocking, noise reduction

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 05:05.


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