View Single Post
Old 15th February 2004, 20:35   #1  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
iip: Integrated Image Processor, e.g. DVD -> 720p HDTV

Hello folks,

this is an early version of iip: integrated image processor. (I don't like the name too much, but didn't come up with a better one.)

Its main purpose is upconversion from DVD resolutions to (pseudo-) HDTV resolutions. It should work, however, also for just processing at native input resolution, or even for traditional downsizing. The default parameters are chosen for upconversion, and probably should be adopted for smaller resolutions.
This script aims at natural sources only! For animated/cartoon content, you are probably better of with mf's mftoon & sharpresize.

I wrote this script for the following reasons:
- after denoising a clip, much detail is attenuated also, or even gone away completely.
- DVB broadcasting in Germany is often very poor, and this script is just what I needed for these sources.
- plain fun of fiddling around

So, what does it do exactly?

- it will test your patience!

1. Basic denoising of the clip
2. Sharpen the picture up, excluding already hard edges to avoid oversharpening. This step can be done in a small supersampled stage, to get (a little) finer granularity.
3. Big Supersampling, applying Xsharpen for better edge definition.
4. Now search for edges again. Areas without edges get the original, denoised, not-sharpened picture applied. This should give the best relative compressability for any level of detail enhancement.


The denoising is currently hard-coded to PixieDust. If you want to try any other denoiser, you must change the function itself for now - no hard job, its only one line in the function.
However, in my opinion the dust filters still are offering the best ratio of "compressability/preserved detail", and that's why I've build the whole function around PixieDust.

The basic usage looks like this:
Code:
LoadPlugin("path\to\undot.dll")           #
LoadPlugin("path\to\MaskTools_v1.4.9.dll") # These plugins
LoadPlugin("path\to\WarpSharp.dll")        #
LoadPlugin("path\to\LoadPluginEx.dll")     # are required!
LoadPlugin("path\to\dustv5.dll")           #

Removed. See update on this thread's page 6!

#
As you see, there are quite some parameters to play around with. And you MUST play around with them.
Everything depends in the quality of the input, the final resolution, your taste regarding image quality, and the bitrate you are willing to spend


Parameter description

dest_x, dest_y [int],[int]
Obviously, these are specifying the final output resolution.

duststr, dustweight, antiflicker [int],[float 0.0~1.0],[bool]
duststr is the denoising level of PixieDust. default is 2, try 1~8 depending on how noisy the source is.
dustweight: instead of using the "dusted" clip, you can mix it back with the raw input image by a percentage of dustweight.
antiflicker: I had other plans for it. For now, it simply calms the picture further down by a weak temporalsoften(). See if you like it better on or off.

ss1_x, ss1_y [float],[float]
These are the supersampling factors for the following sharpening stage. Default is 1.4, try 1.0~2.0. With 1.0 the supersampling is discarded.

detailcontr, contrast_radius, PreSharp [int],[int],[float]
These are the values for detail enhancement.
detailcontr is the strength of unsharp masking. Default is 112, try 40~80~160~255~512, this depends on the source quality and your taste.
contrast_radius is the radius for unsharp masking. Default is 2, try 3 and 4 also. This correlated with the supersampling factors above.
PreSharp is simply the value for a sharpen()-command after unsharp masking. Default is 0.8, try 0.0~1.0.
NOTE: to completely disable detail enhancement, set detailcontr=0 and PreSharp=0.0

ss2_x, ss2_y [float],[float]
These are the supersampling factors for the following Xsharpening stage. Default is 3.5 . For downsizing, go not under 4.0. For upsizing, 3.0 might be sufficient.

Xstren, Xlimit [int],[int]
These are the strength and limit factors for Xsharpen(). Default is (255,255). If you don't have the patience for big enough supersampling, e.g. for 2* supersampling only, try something like (128,23).

do_subpel [bool]
This envokes a sharpen(1.0) on the flat areas, and a blur(1.0) on the edges of the supersampled image, prior to XSharpen().

flatweight [int]
At the very end, the denoised-but-not-sharpened original clip is copied back into the flat areas of the full-processed clip. Through flatweight you can control the strength of this copying process. "0" will return the calmest picture with best compressability. Try values 0~32~64~128.


So, I suggest you play around with all the knobs, and see if you like it.

AviSynth virtuosos might want to play with the levels() commands for the masks. In this area there is probably room for improvement - you are invited.

perhaps upcoming features:
- integrated deringing
- perhaps a better flicker reduction

Have fun


- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 22nd March 2005 at 12:50.
Didée is offline   Reply With Quote