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 10th April 2011, 16:01   #81  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
The artifacts don't come from DitherPost, the denoising stage is clearly the cause here... Try to keep a or h at its original value, or even both? I don't know exactly how these parameters affect the algorithm.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 10th April 2011, 19:49   #82  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
New Dither version (1.6), some important changes :
  • Masktools 2 a48 is now the minimum requirement because some Dither functions use the new bitwise operators. I don't know how to automatically detect the Masktools version, so be sure to update your Masktools before installing this Dither version.
  • Renamed the rem parameters into clsb in DitherPost and SmoothGrad functions
  • Changed the default for the stacked (now true) and prot (now false) parameters.
  • The modified MVTools2 have been synchronised with the latest official release (2.5.11.2 beta)
  • Added various utility functions, mainly Dither_lut8, Dither_lut16, Dither_add16 and Dither_merge16.
  • Some documentation improvements
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding

Last edited by cretindesalpes; 10th April 2011 at 20:01.
cretindesalpes is offline   Reply With Quote
Old 10th April 2011, 22:40   #83  |  Link
Heaud
Registered User
 
Join Date: Apr 2008
Posts: 58
Great to see an update!

I have a question on the new utility functions. Would dither_convert_8_to_16 be able to replace the blank clip + stackvertical inside of gradfun3? Is there any other ways to improve gradfun3? I added a custom smoothgrad since I did not like the results of the orignal smoothgrad inside of the script (it was causing weird banding halos).
Heaud is offline   Reply With Quote
Old 10th April 2011, 23:43   #84  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Quote:
Originally Posted by Heaud View Post
I have a question on the new utility functions. Would dither_convert_8_to_16 be able to replace the blank clip + stackvertical inside of gradfun3?
Yes, that's exactly what it does. But it's just a convenient way to write it in a script, it gives the same result and won't improve anything in GradFun3.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 11th April 2011, 03:59   #85  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
I did a few dozen tests, tweaking sx,sy,bx,by,a and h, even removing MT(). None of them sort the artifact, furthermore I tried dither2pre to "gain" more accuracy but what I got were more artifacts, check the lineart. (h is quadrupled according.)

old-workflow
dither1pre
dither2pre

Im gonna test dither 1.6 now so I can tell you. edit: same results
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 12th April 2011 at 04:53.
Dogway is offline   Reply With Quote
Old 11th April 2011, 08:45   #86  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Thank you very much for testing and helping me to improve the functions. I'm going to rewrite Dither1Pre to make the "slices" overlap, you'll tell me if it works better when it's ready.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 15th April 2011, 05:39   #87  |  Link
TheProfosist
Registered User
 
TheProfosist's Avatar
 
Join Date: Aug 2009
Posts: 136
to me "Dither+SmoothGrad" seems like the best option. i would like to use it but cant determine from the help file what exactly you used/did. if it helps i usually denoise using fft3dgpu/fft3dfilter and sharpen using LSFmod before debanding.
TheProfosist is offline   Reply With Quote
Old 16th April 2011, 21:45   #88  |  Link
HymmexyLeadia
Registered User
 
Join Date: Mar 2011
Posts: 1
Color banding and noise removal

im using a condensor mic to record samples, and theres a bit of noise in the background, i use audacity, but the noise removal algorithm isnt very good.
is there any software that does this better? thanks.
_________________
God rest ye, little children; let nothing you affright, For Jesus Christ, your Saviour, was born this happy night; Along the hills of Galilee the white flocks sleeping lay, When Christ, the Child of Nazareth, was born on Christmas day.
http://www.chung-sim.com/omron.3g3jv.html
HymmexyLeadia is offline   Reply With Quote
Old 27th April 2011, 22:51   #89  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Dither upgraded to v1.7. Changes:
  • Slightly improved Dither1Pre and Dither2Pre functions, added the overlap and tvopt parameters.
  • People complained about GradFun3 being too strong and washing fine shades away, so I changed the default parameter values for a better match with the gradfun2db default settings. thr is now set to 0.35 and radius to 12.
_____________________________________________________________________

Quote:
Originally Posted by TheProfosist
to me "Dither+SmoothGrad" seems like the best option. i would like to use it but cant determine from the help file what exactly you used/did. if it helps i usually denoise using fft3dgpu/fft3dfilter and sharpen using LSFmod before debanding.
See: http://forum.doom9.org/showthread.ph...94#post1390594
but replace DitherPost (mode=2) with SmoothGrad (radius=16, thr=0.25, elast=2).DitherPost ()
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding

Last edited by cretindesalpes; 27th April 2011 at 23:27.
cretindesalpes is offline   Reply With Quote
Old 29th April 2011, 03:47   #90  |  Link
coolguy89
Registered User
 
Join Date: Feb 2011
Posts: 4
Hi,
I tried your example above, but, the resolution changed from 720x480 to 720x240. Did I do something wrong?
coolguy89 is offline   Reply With Quote
Old 29th April 2011, 12:52   #91  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
You probably have a DitherPost() too many. Also make sure you have the latest Dither version. A few default parameters have changed recently and I updated the script in the post #8 accordingly.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 29th April 2011, 17:17   #92  |  Link
coolguy89
Registered User
 
Join Date: Feb 2011
Posts: 4
This is what I use

Code:
FFT3DGpu (Sigma=1)
DitherPost (mode=2)

Function zzz_denoise (clip src, float "sigma", int "thr", bool "mask", int "sad")
{
	sigma = Default (sigma,    16)
	thr   = Default (thr,       5)
	mask  = Default (mask,  False)
	sad   = Default (sad,     200)

	w = src.Width ()
	h = src.Height ()

	# Motion analysis
	super   = MSuper (src)
	super_a = MSuper (src.TTempSmooth ().RemoveGrain (12))

	fwd_vect_3 = super_a.MAnalyse (isb=false, delta=3, overlap=4)
	fwd_vect_2 = super_a.MAnalyse (isb=false, delta=2, overlap=4)
	fwd_vect_1 = super_a.MAnalyse (isb=false, delta=1, overlap=4)
	bck_vect_1 = super_a.MAnalyse (isb=true,  delta=1, overlap=4)
	bck_vect_2 = super_a.MAnalyse (isb=true,  delta=2, overlap=4)
	bck_vect_3 = super_a.MAnalyse (isb=true,  delta=3, overlap=4)

	fwd_comp_2 = src.MCompensate (super, fwd_vect_2, thSAD=sad)
	fwd_comp_1 = src.MCompensate (super, fwd_vect_1, thSAD=sad)
	bck_comp_1 = src.MCompensate (super, bck_vect_1, thSAD=sad)
	bck_comp_2 = src.MCompensate (super, bck_vect_2, thSAD=sad)

	# Spatio-temporal denoising using modified dfttest
	c_dft = Interleave (fwd_comp_2, fwd_comp_1, src, bck_comp_1, bck_comp_2)
	c_dft = c_dft.dfttest (sigma=sigma, lsb=true)	# Double height
	c_dft = c_dft.SelectEvery (5, 2)

	# Temporal-only denoising using modified MDegrain
	c_deg = src.MDegrain3 (super, bck_vect_1, fwd_vect_1, bck_vect_2, fwd_vect_2, bck_vect_3, fwd_vect_3, thSAD=sad, lsb=true)	# Double height

	# Spatio-temporal denoising smoothes too much the details,
	# therefore we use pure temporal denoising on edges or detailed areas.
	edge_src = c_deg.Crop (0, 0, w, h)
	edge_mask = edge_src.mt_edge (mode="prewitt", thY1=thr, thY2=thr)
	edge_mask = edge_mask.mt_expand ()
	edge_mask = StackVertical (edge_mask, edge_mask)	# Double height
	c_hyb = mt_merge (c_dft, c_deg, edge_mask, luma=true, y=3, u=3, v=3)

	return (mask ? edge_mask.GreyScale () : c_hyb)
}
I'm using the latest Dither btw.
coolguy89 is offline   Reply With Quote
Old 29th April 2011, 18:33   #93  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Use zzz_denoise(). This function does almost all the job, with SmoothGrad. DitherPost only converts the 16-bit result into a regular 8-bit dithered clip.
Code:
zzz_denoise()
SmoothGrad (radius=16, thr=0.25, elast=2)
DitherPost ()
If you want to keep FFT3DGpu as denoising filter, just do :
Code:
FFT3DGpu (Sigma=1)
GradFun3 ()
or
Code:
Dither2Pre (flt="FFT3DGpu(Sigma=4)")
SmoothGrad (radius=16, thr=0.25, elast=2)
DitherPost ()
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 30th April 2011, 01:26   #94  |  Link
coolguy89
Registered User
 
Join Date: Feb 2011
Posts: 4
It works! Thanks .

One more question, if I only want to deband, I only need the GradFun3, right? Or is there any other way in the dither packages that can improve debanding process.
coolguy89 is offline   Reply With Quote
Old 30th April 2011, 09:53   #95  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Yes, use GradFun3 to deband only.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 30th April 2011, 18:37   #96  |  Link
coolguy89
Registered User
 
Join Date: Feb 2011
Posts: 4
Thank you for your support and your awesome script.
coolguy89 is offline   Reply With Quote
Old 3rd May 2011, 19:07   #97  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
cretin, the error I was having was caused by MT inside dither1pre. I had to change splitvertical to true also to make it aware dither was changing the size.
On a note, before this I tried stacked=false and it gave me temporal artifacts. Finally after an afternoon battle it seems this code is what it works, no problems for encoding either.
Code:
MT("""Dither1Pre(flt="tnlmeans()",stacked=true)""",2,2,true)
DitherPost(stacked=true,prot=false)
You could also add it to documentation for reference.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 10th May 2011, 21:54   #98  |  Link
SSH4
Registered User
 
Join Date: Nov 2006
Posts: 90
cretindesalpes can you check your mod16 of Mvtools?
Looks like all (latest mvtools-2.5.11.2-mod16a.zip and previous) version have some bug with tsadc. tsadc always == tsad.
you can check it if you made big tsad (about 600 or more) and try low tsadc. UV channel will be bad
on original mvtools-2.5.11.2 all work well.

thanx!
SSH4 is offline   Reply With Quote
Old 11th May 2011, 08:03   #99  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Indeed there was a bug, thanks for the report. I'll release a fixed version soon.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 11th May 2011, 22:10   #100  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Dither 1.7.1 update. Changes:
  • Dither.avsi doesn't use Max() anymore, so it can now run on Avisynth 2.5.7 or earlier.
  • Bugfix in modified MVTools2: the thSADC argument was ignored in MDegrain1/2/3.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
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 10:55.


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