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. |
1st August 2011, 14:34 | #241 | Link |
Oz of the zOo
Join Date: May 2005
Posts: 208
|
well it might need some tweaking to make it usable for your type of content, but even in this state it might be handy to conceal dither pattern of GradFun3 in default mode=0. Requires variableblur plugin.
#your GradFun3 settings |
3rd August 2011, 16:09 | #243 | Link |
zj262144
Join Date: Sep 2010
Posts: 105
|
Excuse me
Does dither.dll & dither.avsi support x64 now? It's pretty tools and I want to use it for 10-bit x264 encoding
__________________
MPC-HC 1.7.8 / LAV Filters 0.64+ (tMod) / XySubFilter 3.1.0.705 / madVR 0.87.14 Direct264 Mod (src & win32 builds): code.google.com/p/direct264umod (maybe outdated) |
6th August 2011, 21:46 | #244 | Link | |
Registered User
Join Date: Jul 2011
Posts: 32
|
Quote:
The live video problem was 16mm grain. I would use ttempsmoothf but I see banding in the motion parts (in 8bit land). I tried all kinds of denoisers but I won't accept softening instead of grain. I usually deblock live stuff with cpu=6 or cpu2 on just the luma but this also leads to banding and what would I use on that? haha |
|
8th August 2011, 19:14 | #245 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
In tone of my last post.
I haven't done any tests still but Im sketching some theories to put in practice later and see the results. edit: updated with results. This is against ffv1 lossless codec, Im unsure if ordered dithering is rather targeted to h.264 encodings but results are more or less the expected. EX01 ditherpost(mode=6) + mdegrain in mode=0 theory = consumes lots of bitrates because of mode=6 left overs result = to my surprise this one was the best in compressibility o_O! clip = 48.37Mb EX02 ditherpost(mode=0) + mdegrain in mode=0 theory = motion estimation is(could be) altered result = This was the worst for compressibility. It showed heavy overlapping ordered dithering clip = 50.49Mb EX03 ditherpost(mode=0) + motion estimation of ditherpost(mode=6) and mdegrain in mode=0 theory = ideal but probably overlapping ordered dithering, plus denoising "ordered dither" which is not recommended. result = Looks like motion estimation has some effect when mode=0, so this compresses better than EX02. Actually results or more towards EX01 than EX02 !O_o clip = 49.08Mb EX04 ditherpost(mode=0) + mdegrain in mode=0 over mode=6 dummy + Ditherbuildmask workaround theory = paired with motion estimation over the mode=6 dummy this could work. result = The thinking behind stays true but the code is a bit different, see the code box below. clip = 48.4Mb Code:
o=dfttest(tbsize=1,sigma=10,lsb=true) la2=o.DitherPost(mode=6) la1=o.DitherPost(mode=-1) super = la2.MSuper(pel=2, sharp=2) #hpad=0,vpad=0, para +velocidad b3vec = super.MAnalyse(isb = true, delta = 3, overlap=2, blksize=8, search=4) b2vec = super.MAnalyse(isb = true, delta = 2, overlap=2, blksize=8, search=4) b1vec = super.MAnalyse(isb = true, delta = 1, overlap=2, blksize=8, search=4) f1vec = super.MAnalyse(isb = false, delta = 1, overlap=2, blksize=8, search=4) f2vec = super.MAnalyse(isb = false, delta = 2, overlap=2, blksize=8, search=4) f3vec = super.MAnalyse(isb = false, delta = 3, overlap=2, blksize=8, search=4) ms=la1.MDegrain3(super, b1vec, f1vec, b2vec, f2vec , b3vec, f3vec, thSAD=400, limit=255, limitc=255,lsb=true) ms2=la2.MDegrain3(super, b1vec, f1vec, b2vec, f2vec , b3vec, f3vec, thSAD=400, limit=255, limitc=255,lsb=true) msk=DitherBuildMask(la1,ms.ditherpost(mode=-1)) Dither_merge16_8(o,ms2,msk) DitherPost(mode=0) I decided to spatially analyse the dither, checking with the used masks: What I see: This would probably not be the best example as there is little motion (showed by the mdegrain mask). The relevant "mask" to check out is the one in 2nd picture, the enclosed regions belongs to the pure dfttest parts, where the rest is mdegrain. Here you can see, specially on the cloak how error diffusion changes to ordered dithering, making it ideal for encoding.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 12th August 2011 at 19:13. Reason: Updated EX04 code & clip |
10th August 2011, 23:25 | #247 | Link |
Registered User
Join Date: Nov 2006
Posts: 90
|
I thought about upscaling some source after dfttest 16bit mod. So i thought that will be great dither 16 bit data after upscaling, this must not upscale ditherings.
I was play a little bit with 16 bit MSB/LSB data and upscale with nnedi3. And found that not good idea for this moment. LSB part have aliased edges when value drop from 255 to 0. and nnedi and most of other scalers smooth them, so in result after ditherpost() we have worst result Is there any another way for simulate 16 bit data in avisinth but without MSB/LSB and sharp edges in LSB? My brain not work and i cant imagine anything %) |
11th August 2011, 01:18 | #248 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
You can resize stacked 16-bit MSB/LSB data with Dither_resize16(). Probably not as sharp as nnedi3, but it works.
It's also possible to combine 8-bit nnedi3 with Dither_resize16(). For example: Code:
# 16 bit input nw = 1280 # new width nh = 960 # new height upnn8 = DitherPost (mode=-1) upnn8 = upnn8.nnedi3_rpow2 (rfactor=2, fwidth=nw, fheight=nh, cshift="Spline36Resize") upnn16 = upnn8.Dither_convert_8_to_16 () Dither_resize16 (nw, nh, kernel="bicubic") last.Dither_limit_dif16 (upnn16, thr=1.0, elast=2.0) 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; 11th August 2011 at 01:33. |
11th August 2011, 18:45 | #249 | Link |
Registered User
Join Date: Aug 2009
Posts: 136
|
right now im trying to use:
Dither2Pre (flt="FFT3DGpu(Sigma=4)") SmoothGrad (radius=16, thr=0.25, elast=2) DitherPost () but it it throws a error that asks me to debug: i would like to use dither+smoothgrad with the current plugins as best as possible. current sample of the filters i normally use in a script. Code:
#RemoveGrain() #RemoveGrainHD() #crop(0,0,-0,-0,align=true) #FFT3dGPU(sigma=0.2, precision=2) #FFT3DFilter(sigma=0.2, ncpu=4) #EdgeCleaner() #DAA() #MAA() #LSFmod(strength=20, preblur="OFF", ss_x=2.0, defaults="slow") #DeHalo_alpha(darkstr=1.0, brightstr=1.0, ss=2.0) #GradFun2DBmod() i would like the script to be able to output 16bit for 10bit x264 but also be possible to output 8bit for 8bit x264 (should be 1 line of code difference DitherPost()?) Since i dont think anyone would want to work on the whole script i plan to work on getting one filter at a time as i need them. For now i just need Dither+SmoothGrad to output 8bit&16bit to 8bit&10bit x264 respectively. |
11th August 2011, 19:44 | #250 | Link | ||
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
Quote:
Edit: A more general way to insert 8-bit processing between 16-bit filters is the following: Code:
dfttest (lsb=true) # or whatever generating stack16 data # Insert 16-bit filters here s16 = last DitherPost (mode=-1) # Insert 8-bit filters here Dither_convert_8_to_16 () s16.Dither_limit_dif16 (last, thr=1.0, elast=2.0) # Insert 16-bits filters again... # Finally DitherPost () # or Dither_convey_yuv4xxp16_on_yvxx () Set thr and elast according to taste. You can also use masking instead of Dither_limit_dif16(), but this is a bit more work.
__________________
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; 11th August 2011 at 20:01. |
||
13th August 2011, 15:53 | #252 | Link | |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
Edit: rewritten, and made a function of it (but it's still a suboptimal hack) Code:
# n = target bitdepth (8–14) # outn = true : output is scaled to the specified bitdepth # = false: output is kept in 16 bits, the lowest bits are set to 0 after dithering. # other parameters: transmitted to DitherPost(). # # Example: # # .avs: # ... # GradFun3(lsb=true) # Stack16 clip # fslg_dither_to_n_bits (10, outn=true) # Dither_convey_yuv4xxp16_on_yvxx () # # .bat: # avs2yuv -raw script.avs -o - | x264-10bit --demuxer raw --input-depth 10 --input-res 1280x720 --fps 24000/1001 --output video.mkv - Function fslg_dither_to_n_bits (clip o, int n, bool "outn", int "mode", int "ampo", int "ampn", bool "dyn") { outn = Default (outn, false) o msb = Dither_get_msb () lsb = Dither_get_lsb () hr = 2 m = String (Round (Pow (2, 16 - hr - n)) - 1) l = msb.mt_lut ("x "+m+" &u", y=3, u=3, v=3) h = msb.mt_lut ("x 255 "+m+" - &u", y=3, u=3, v=3) s1 = String (n - 8) ofs = String (Round (Pow (2, 7 - hr))) a = StackVertical (l, lsb) a = a.Dither_lut16 ("x "+s1+" <<u "+ofs+" 256 * +", y=3, u=3, v=3) b = a.DitherPost (mode=mode, ampo=ampo, ampn=ampn, dyn=dyn) (outn) \ ? fslg_dither_to_n_bits_out_n (b, h, n, hr, s1, ofs, m) \ : fslg_dither_to_n_bits_out_16 (b, h, n, hr, s1, ofs) } Function fslg_dither_to_n_bits_out_16 (clip b, clip h, int n, int hr, string s1, string ofs) { s2 = String (16 - n) ofs2 = String (Round (Pow (2, 15 - hr - n))) b_msb = b.mt_lut ("x "+s1+" >>u 255 &u "+ofs2+" - 128 +", y=3, u=3, v=3) b_lsb = b.mt_lut ("x "+ofs+" - "+s2+" <<u 255 &u", y=3, u=3, v=3) c = mt_adddiff (h, b_msb, y=3, u=3, v=3) StackVertical (c, b_lsb) } Function fslg_dither_to_n_bits_out_n (clip b, clip h, int n, int hr, string s1, string ofs, string m) { ofs2 = String (Round (Pow (2, 7 - (n-8) - hr))) b2 = b.mt_lut ("x "+s1+" >>u "+ofs2+" - 128 + 255 "+m+" - &u", y=3, u=3, v=3) h2 = mt_adddiff (h, b2, y=3, u=3, v=3) msb = h2.mt_lut ("x "+String(16-n)+" >>u", y=3, u=3, v=3) m2 = String (Round (Pow (2, 8 - hr)) - 1) lsb = mt_lutxy (h2, b, "x "+s1+" <<u 255 "+m2+" - &u y "+ofs+" - "+m2+" &u +", y=3, u=3, v=3) StackVertical (msb, lsb) } Note 2: scaling issue mentioned in the previous note is now solved in the official x264 build (from r2164).
__________________
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; 13th February 2012 at 09:14. Reason: Added note 2 |
|
15th August 2011, 21:11 | #253 | Link | ||
Registered User
Join Date: Sep 2009
Posts: 378
|
Quote:
Quote:
Last edited by Yellow_; 15th August 2011 at 21:15. |
||
16th August 2011, 09:21 | #254 | Link |
Two bit encoder
Join Date: May 2005
Location: England, UK
Posts: 157
|
I downloaded and placed the dither package in the plugins directory and all the 16 bit stuff seems to be working fine, however I can not get gradfun3 to work (in normal YV12). I simply just get a green screen. I've deleted a bunch of plugins in an attempt to troubleshoot and this is what I'm left with:
15/05/2011 21:14 192,512 dfttest.dll 21/12/2008 22:46 26,624 DirectShowSource.dll 20/07/2011 22:03 44,994 dither.avsi 21/07/2011 08:18 233,472 dither.dll 21/06/2010 11:12 1,527,650 libfftw3f-3.dll 31/12/2010 18:13 966,144 mt_masktools-25.dll 31/12/2010 18:12 966,656 mt_masktools-26.dll 19/03/2006 20:56 430,080 mt_masktools.dll 11/09/2010 14:39 2,787 mt_xxpand_multi.avsi 20/01/2005 21:58 212,992 MVTools.dll 11/05/2011 22:09 753,664 mvtools2.dll 01/08/2005 00:08 65,536 RemoveGrainS.dll I'm using avisynth 2.5.8. Any ideas? Last edited by Zero1; 16th August 2011 at 09:33. |
16th August 2011, 12:19 | #256 | Link | |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
Zero1 wrote he was using 2.5.8, so it's the other way round: keep mt_masktools-25 (alpha 48) and remove mt_masktools-26.dll
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
16th August 2011, 16:26 | #257 | Link |
Two bit encoder
Join Date: May 2005
Location: England, UK
Posts: 157
|
Thanks for the info. I think I have inadvertantly found out what is going wrong. I tried to run dfttest() earlier and it returns and error saying it cannot load libfftw3f-3.dll.
When I moved it to another directory and used loadplugin, it tells me that it is not an Avisynth 2.5 pluginr?! Edit I googled and found that I needed to put that in my syswow64 dir, so now dfttest works. Also after deleting the numerous masktools dlls, gradfun3 appears to work too. Much thanks guys, these are really going to come in handy. Last edited by Zero1; 16th August 2011 at 16:35. |
16th August 2011, 23:27 | #258 | Link |
Registered User
Join Date: Sep 2009
Posts: 378
|
I've looked through dither.avsi at the above functions and quite simply I'm lost, so thanks anyway, think I'll just look out for the BT709 mode in some future version of Dither and find an alternative route for the linearizing bit in the meantime.
|
19th August 2011, 00:39 | #259 | Link |
Registered User
Join Date: Nov 2007
Posts: 54
|
Hi,
I fed an 8-bit source to x264-10bit, and I converted the 8-bit to 16 bit (using dither scripts) then fed it to x264-10bit. However color wise, I noticed that the 1st encoding is fine and looks like the 8-bit source, while the later encoding is overlayed with greenish color. So which one is correct? |
19th August 2011, 03:59 | #260 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Is this related with this issue? But the difference should be hardly noticeable. If you really have a green tint, first check your masktools version (must be alpha 48 or later), then post your script and encoding command.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
Tags |
color banding, deblocking, noise reduction |
|
|