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. |
![]() |
#1 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
AutoAdjust [v2.60 - Update 2015/11/15]
Code:
+---------------------------------------------------------------------------------+ | | | Automatic adjustement plugin: AutoAdjust() | | | | v2.60 by "LaTo INV." | | | | 15 November 2015 | | | +---------------------------------------------------------------------------------+ I. DESCRIPTION II. DISCLAIMER III. INSTALLATION IV. REQUIREMENTS V. MULTITHREADING VI. USAGE VII. GENERAL SETTINGS VIII. AUTOGAIN SETTINGS IX. AUTOBALANCE SETTINGS X. CHANGELOG I. DESCRIPTION : ================ AutoAdjust is an automatic adjustement filter. It calculates statistics of clip, stabilizes them temporally and uses them to adjust luminance gain & color balance. AutoAdjust have a smoothing & dithering algorithm to avoid banding issue. Calculations are made in 32bits float to avoid rounding errors and are internally multithreaded and SSE2/AVX2 optimized. For manual adjustments, see all plugins in "SmoothAdjust" package. II. DISCLAIMER : ================ This program is free for non-commercial use only and must be distributed in its original form without any modification, including this documentation file. This program is provided as-is in the hope it will be useful but without any warranty, including any hypothetical damages or issues. The official home page is "http://forum.doom9.org/showthread.php?t=167573", it always contains the latest version of this program. This page acts as the official support center, also the author is reachable through his member page: "http://forum.doom9.org/member.php?u=131032". This plugin has required a lot of work and much coding hours, so if you like it and feel the need to reward or inspire the author then please consider donating. Donations are a fast, easy and secure operation through Paypal: simply follow the link into the "Donate.url" shortcut (you do not need a Paypal account to donate). All donations will be very useful and I thank in advance all the generous people, also if you are on the doom9's forum please specify your nickname when donating. III. INSTALLATION : =================== There are different versions of AutoAdjust to suit all installations of Avisynth. - x86 builds are for Avisynth 32bits - x64 builds are for Avisynth 64bits IV. REQUIREMENTS : ================== - Avisynth v2.6.x or Avisynth Plus - YUV Planar (Y8, YV411, YV12, YV16, YV24) - 8bits or 16bits (MSB/LSB) V. MULTITHREADING : =================== AutoAdjust is internally multithreaded with official Avisynth version. If AvisynthPlus or AvisynthMT is detected, internal multithreading is automatically disabled even if external multithreading isn't used (this can be reactivated in parameters). AutoAdjust is designed to work with external multithreading, so fastest MT mode can be used. With AvisynthPlus, this plugin is a MT_NICE_FILTER (automatic register, no need to call SetFilterMtMode). With AvisynthMT, SetMtMode(1) must be called before AutoAdjust. VI. USAGE : =========== AutoAdjust ( [clip], external_clip, auto_gain, dark_limit, bright_limit, gamma_limit, dark_exclude, bright_exclude, gain_mode, chroma_process, avg_safety, input_tv, output_tv, auto_balance, chroma_limit, balance_str, scd_threshold, temporal_radius, change_status, use_interp, use_dither, high_quality, high_bitdepth, threads_count, asm_opt, debug_view ) Last version (2015/11/15): AutoAdjust v2.60 Old version (for Avs2.5 or WinXP or Wine): AutoAdjust v1.02 If you really like this filter, please consider donating... It will help me a lot to continue development and support. Thanks for all! (link in the .7z package) v2.60: updated for Avs v2.6.0 final fixed AVX2 crash with Win7 without SP1 v2.50: fixed crash with external_clip fixed chroma processing bug removed temporal_radius=-1 reintroduced internal caching v2.40: optimized frame access & frame cache fixed potential freeze with very slow source filter v2.20: optimized memory usage with very long clip fixed crash with ffdshow_source() and external MT v2.00: dropped Avs v2.5.x support added AVX2 code (40% faster) modified plugin to be thread-safe (MT_NICE_FILTER) removed internal caching added frame cache hints improved debug_view v1.90: changed name of plugin & parameters added color balance added C version fixed regression from v1.75 (bug at scenechange) v1.75: added avg_safety parameter fixed a minor bug in temporal averaging tweaked multi-threading code v1.60: split 'tv_range' into 'input_tv' & 'output_tv' fixed possible freeze in MT code added explicit error messages v1.45: fixed bugs inside multi-threading code removed user32 dependency added AVX2 detection (for future opt) v1.40: used new C++11 features rewritten multi-threading (native) speed optimization (10% faster) exception-safe code added a high quality interpolation mode improved core algorithm fixed various little things v1.02: fixed minor things & bugs dropped ICL builds support v1.00: first stable release _ Last edited by LaTo; 15th November 2015 at 16:52. |
![]() |
![]() |
![]() |
#3 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Early alpha development discussion is available on the SmoothAdjust's thread, development and support will now continue here...
Last edited by LaTo; 3rd April 2013 at 21:43. |
![]() |
![]() |
![]() |
#4 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
AutoGain beta1 update
/* Post from 01 april 2013 on SmoothAdjust's thread */
New AutoGain update: AutoGain-beta1. Big update, any inputs is appreciated ![]() Last edited by LaTo; 3rd April 2013 at 21:40. |
![]() |
![]() |
![]() |
#6 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
AutoGain beta3 update
New update: AutoGain-beta3.
The plugin seems pretty mature now... One thing to add to be complete is a debug view, but later ![]() |
![]() |
![]() |
![]() |
#7 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Hey LaTo, thanks for adding 16 bit support.
![]() The overall results are indeed very pleasing. I was testing it out and I noticed something odd. When I use 8 bit the histogram looks smooth but with 16 bit the histogram looks posterized (hope that's the right term). Here's the comparison. I use all default settings. Like AutoLevels, maybe you can also add a scene change indicator to the debug view? I had another idea but seems you got rid of the bright/dark_ignore parameters. ![]() |
![]() |
![]() |
![]() |
#8 | Link | |||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
Quote:
![]() Quote:
Maybe I should expose more parameters, and split them in "basic settings" and "advanced settings"... Don't know what is best. Also I will have a look at AutoLevels plugin, maybe I can pick some ideas from this one. Anyways, all ideas are welcome... So I want to hear your idea even if it's not realizable ![]() |
|||
![]() |
![]() |
![]() |
#9 | Link | |||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,675
|
Awesome.
Quote:
Quote:
![]() Also, frustum posted some interesting ideas regarding some of the shortcomings of AutoLevels. A little more information on that very topic can be found on his website. Quote:
For the bright/dark ignore parameters do something like ShowLevels plugin, where the ignored bright/dark pixels would get painted a certain color. For instance, purple is for bright_ignore and green for dark_ignore. Example and exaggerated example. Just in case this is not a good idea, please take it easy on me. ![]() |
|||
![]() |
![]() |
![]() |
#11 | Link | ||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
- chroma processing, but it's already on my todo list - frameOverrides string in AutoLevels Quote:
![]() No report from Didée since 2 weeks... Maybe in vacations ![]() |
||
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Apr 2008
Location: California, USA
Posts: 127
|
LaTo. This could be an extremely important asset for video forensic work. Over the next few days I will be testing it with several high-profile, low-resolution nighttime surveillance videos and report back my findings. Thank you for creating this tool.
|
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: Apr 2013
Posts: 3
|
Hello LaTo
Thanks for your efforts to create a REAL autolevels plugin. All the ones I tried till now suffered from crunching the whites... ![]() Also (f.i. the Avisynth one) they do not "obey" the requested outputlevels without clipping. I'm a noob on scripting but is it not possible to do the following: - get the brightest pixel in a frame and map it to, let's say 235 - get the darkest pixel and map it to 16 - interpolate the rest in between - add some averaging to avoid "pumping" The result should be as attached luminance waveform |
![]() |
![]() |
![]() |
#15 | Link | ||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
However, Autogain().ColorYUV(autowhite=true) will produce the same effect as before (I think). Quote:
AutoGain(adjust_mode=1,dark_exclude=0.00,bright_exclude=0.00) ![]() |
||
![]() |
![]() |
![]() |
#16 | Link | |
Registered User
Join Date: Apr 2013
Posts: 3
|
Quote:
![]() Well, I had some old 8mm films laser-scanned. The results are very good but I had a camera in 1978 with a miserable auto-exposure. So, in a lot of scenes the luminance is shifting back and forth and difficult to correct manually. That's the reason I tried some autolevel-filters. But all suffer from doing nothing in some (dark) scenes and/or blowing up the lights in other. Also, they do not "obey" my given output-levels (0-255, 16-235 or wathever). So I need something to produce a nice equal (given) lumi-level like the screenshot in my previous post and without clipping. Your autogain filter already comes near to that but with mode=1 I have to put some "brake" on the video (adding a small 4px white border) to reduce the gain-effect on the whites. This gives me a reasonable result so far: Code:
gained-gained.addborders(4,0,0,0,$FFFFFF) gained=gained.autogain(adjust_mode=1,bright_limit=100.0,dark_limit=1.5) gained=gained.crop(4,0,-0,-0) |
|
![]() |
![]() |
![]() |
#20 | Link | ||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|