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. |
|
|
Thread Tools | Search this Thread | Display Modes |
18th March 2011, 08:57 | #21 | Link |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
FWIW, most of these dithering algorithms are optimized for halftoning (8bit -> 1bit). I believe that for our use (high bitdepth -> 8bit) we have different needs. I would suggest to use the method proposed in the paper "Optimized Error Diffusion for Image Display" (PDF download available via google). This dithering method whitens the quantization error which should produce best results for our needs, IMHO.
But of course the optimal solution would be if AviSynth would be able to handle a full high bitdepth processing chain (16bit int or even 32bit float). This way dithering could be avoided altogether, or at least delayed to the very last step. E.g. dithering could be done to 10bit, with the final result fed to the new x264 10bit encoder. The current limitation of AviSynth to 8bit means that basically every processing step that internally produces higher bitdepth (resampling, color conversion, and many more) must do an internal dithering step for optimal results. If this is not done, rounding errors will add up. But even if it's done, dithering noise adds up. Having higher bitdepth support would be better in any case. |
18th March 2011, 17:29 | #22 | Link | |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
Quote:
I've been considering making a backwards-compatible extension to IClip -- it would have GetFrame16 and GetFrame32F member functions, and transparently down-convert if GetFrame was called by a legacy filter. All anyone would need to do is call dynamic_cast<IClipEx*>(clip) to test if a clip offers the extended formats. It'd be a fair amount of work, but I think rewarding in the end. Would people use this? |
|
19th March 2011, 20:35 | #23 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
Yes, I would use it. For now I'm using a script-compatible system where the extra low bits are in a separate clip. There's other filters that use deep color processing as well. Could you make it compatible to my tools for now? It would be the easiest approach.
http://forum.doom9.org/showthread.ph...07#post1467907 |
20th March 2011, 05:22 | #24 | Link |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
v3 is out. sub-pixel cropping, selectable resize kernels, and some small optimizations. big overhaul to support SSE touched a lot of code, so be on the lookout for bugs.
Download for 32-bit and 64-bit: http://sourceforge.net/projects/int6...3.zip/download Full documentation: http://svn.int64.org/viewvc/int64/re...l?revision=255 |
20th March 2011, 05:26 | #25 | Link | |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
Quote:
Given the amount of filters we have that haven't been updated in ages and have had their authors disappear, I don't really know how big of an impact it would be able to make. But I guess we have to start somewhere? Last edited by PhrostByte; 20th March 2011 at 05:31. |
|
20th March 2011, 07:25 | #26 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
Perceived bugs:
-Omitting or setting dither=false, causes a crash. -looks like dither only works when changing colorspace from yv12 to rgb (not on resizing etc) -Strange black artifacts around contrasty edges when DSTCOLORSPACE is RGB (independent of input) -Overall there's strong ringing, black outline plus bright ringing. Tell me if you want me to upload my tests.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
20th March 2011, 18:08 | #27 | Link | |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
Quote:
|
|
20th March 2011, 19:10 | #28 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
Dither=false crashes no matter what. I even emptied the plugin folder.
Here are my tests: http://www.mediafire.com/?l6t0pf2mfto32xg
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
20th March 2011, 20:23 | #29 | Link | |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
Quote:
The crashes were a bug from my SSE preparations, and the dithering artifacts were due to resizing creating out-of-range values (which is normal, I just didn't clamp them properly). I believe the extra ringing is merely a result of linear blending. Regular Spline36 has it too, just not as intense -- just like with other images, the sharp contrast is brought out more with linear blending. Download for 32-bit and 64-bit: http://sourceforge.net/projects/int6...4.zip/download Full documentation: http://svn.int64.org/viewvc/int64/re...l?revision=257 |
|
20th March 2011, 21:50 | #30 | Link | |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
Shrinking or downsizing an image is different because you have to low-pass filter the image before decimation (or interpolation) in order to avoid aliasing. It is the low-pass filtering step that requires working in linear space if you want to approximate an optical blur. Avisynth's resizing functions don't separate those two steps. The low-pass filtering is accomplished by increasing the support width of the resampling function by a factor of old_width/target_width. Obviously, the larger the downsizing ratio the stronger the low-pass filtering, and therefore the larger the difference between working with gamma-corrected versus linear values. Random thought: I don't know how flexible Avisynth's resampling code is, but it would be really nice if you could manually control the support width - maybe by supplying a user specified scaling factor >= 1.0 - instead of having it always scaled by a factor of max(old_width/target_width,1.0). Last edited by tritical; 21st March 2011 at 06:43. |
|
21st March 2011, 00:22 | #32 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Nice! It would be great if you could also add support for 16-bit data as output and/or input (for example, with the MSB part stacked onto the LSB), so the dithering could be done later.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
21st March 2011, 03:50 | #33 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
@PhrostByte: Yes, everything looks right now : D
Just a question, still images should be treated as... Rec.601? Also I made a funny experiment, ported resampleHQ to automttap3:
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
21st March 2011, 04:37 | #35 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
ay! yes, what I had been thinking...
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
21st March 2011, 06:51 | #36 | Link | |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
Last edited by tritical; 21st March 2011 at 06:55. |
|
21st March 2011, 07:52 | #37 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
Avisynths current method is naively theoretically correct for purposes of keeping the frequency response of the output as close to the input as can be done using the current resizing kernel. The only way to do better is to break out the non-linearity. Though, as you mentioned, there are other reasons to make it adjustable. I just don't want people to think that the avisynth interpolators are arbitrary.
|
21st March 2011, 17:12 | #38 | Link | |
Grand Fruitioner
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
|
Quote:
|
|
21st March 2011, 17:13 | #39 | Link | |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
|
|
|
|