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. |
25th April 2005, 22:11 | #1 | Link |
Registered User
Join Date: Mar 2005
Location: Poland
Posts: 85
|
Hdr Agc 1.8.7 - 10.09.2006
HDR AGC version 1.8.7
More info and download at my homepage ----- MODERATOR Note: This link is dead. Use this one: https://web.archive.org/web/20131018...iko/hdragc.htm ----- High Dynamic Range Automatic Gain Control - this plugin increase dynamic range of video clips (enhance shadows). It's "simply" gaining (brightening) dark areas of image without causing blow of highlights and is doing it by simulating the work of our eyes. Amount of gain is calculated automatically but you can also influence on it by parameters. This plugin support YV12 and YUY2 color sprace. Usage: AVISource(...) SeparateFields() # if content is interlaced HDRAGC() Weave() # if content is interlaced MOST IMPORTANT PARAMETERS: coef_gain (default 1.0) - increase parameter to get brighter image, decrease to limit auto brightening coef_sat (1.0) - incerease to bring more saturation TODO for 2.0 version - MMX, SSE, SSE2 optimization Tips: 1. I'd like to have brigther results. Try increasing coef_gain and/or min_gain 2. Image lacks colours saturation after brightening Try increasing coef_sat parameter 3. I would like to operate only in luma (without changing chrominance channels) Set max_sat to 1.0 4. When I set coef_sat lower that 1.0, bright area of image are loosing saturation Set min_sat to 1.0 (default value id 0.0) 5. Bright areas of image are too much gained Try corrector parameter - recommended values are (0.8 - 1.0), the lower value then less gain is applied to brighter part of image 6. Gained parts have too much noise Try increasing reducer parameter. Default value is 0.5, max is 2.0 Last edited by Guest; 23rd May 2014 at 15:38. Reason: New version |
26th April 2005, 13:47 | #3 | Link |
Registered User
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
|
Congratulations!
This filter looks very, very promising. Could this be a real auto-levels filter at last? Is it possible to add an auto-gamma setting too? Fred.
__________________
About 8mm film: http://www.super-8.be Film Transfer Tutorial and example clips: https://www.youtube.com/watch?v=W4QBsWXKuV8 More Example clips: http://www.vimeo.com/user678523/videos/sort:newest |
26th April 2005, 16:53 | #4 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
kickass! this could really help with the Zion scenes in the matrix trilogy (baaad lighting ratio right thurr).
not sure if it'll help on some grainy-as-hell and dark DV footage i have, but i don't expect anything to save that. i think i'll wait for some optimization - i'm running a 5 year old machine, so every cycle is sacred. [edit] i can see this becoming very useful for avisynth 3, if it ends up supporting 16bpc video - HDR is best suited to more-than-8-bits. hehe. i'm a bit of an HDR fan - i've even got one of those mirror-ball light-probe things, though i hardly use it anymore (it's warped at the seam...).
__________________
sucking the life out of your videos since 2004 Last edited by Mug Funky; 26th April 2005 at 16:56. |
26th April 2005, 17:58 | #5 | Link | ||||
Registered User
Join Date: Mar 2005
Location: Poland
Posts: 85
|
@videoFred
Quote:
Gamma is causing some contrast loss, that's why HDR technics were invented to overcome this. But maybe it can be usefull. Could you describe in more detail how you imagine the gamma control? Of course the best would be image examples showing diffrent situations @Mug Funky Quote:
Quote:
Those examples posted by me are from Panasonic GS200, Sony PC350 and Sony PC85. Quote:
Regards |
||||
27th April 2005, 06:18 | #7 | Link |
Registered User
Join Date: Nov 2004
Location: Spain
Posts: 408
|
Felicitations. This is an superb filter.
I've done a benchmark with virtualdub's filter "MSU Smart Brightness & Contrast" and the result is favourable to your filter. Your image has no halos, better contrast and less pixelation in dark areas. Only one doubt. I've tried with different values (from 16 to 255) for avg_lum but with no visual changes at all. ¿Do this parameter depend on others? I often process VHS captures (YUY2 colorspace). I can accept promote to RGB. The return to YUY2 is almost lossless. The return from YV12 isn`t lossless. Despite the evolution to YV12 ¿It will be possible to preserve RGB processing in future releases?. Thanks. |
27th April 2005, 07:24 | #8 | Link | |
Registered User
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
|
Quote:
Fred.
__________________
About 8mm film: http://www.super-8.be Film Transfer Tutorial and example clips: https://www.youtube.com/watch?v=W4QBsWXKuV8 More Example clips: http://www.vimeo.com/user678523/videos/sort:newest |
|
27th April 2005, 14:14 | #9 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
paviko, this is very nice work. A little sluggish , but results are really impressing!
It reminded me of the fact that in one of my postponed scripting projects, there is some code gathering dust for half a year now, that tries to do something rather similar. (Namely: the "contrast booster" feature of "LimitedSharpen-EX".) The principle of operation is less sophisticated and precise (general limitations of AviSynth scripting). In exchange, it runs somewhat faster than HDRAGC() ... 10 times, or more. Result when feeding the "lowlight" JPEG from above as input, via imagereader: If someone is interested in the (unfinished) AVS code, drop a line here. Basically, an ultra-wide gaussian blur is done, then the difference to the original is square-rooted, and fed into a modified multiplication/hardlight routine. (Should I think about writing PDF whitepapers ...)
__________________
- 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!) |
27th April 2005, 14:48 | #10 | Link |
Registered User
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
|
Didee I am interested. I am also interested in LimitedSharpen-EX ;-).
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE. |
27th April 2005, 18:12 | #11 | Link | |||||
Registered User
Join Date: Mar 2005
Location: Poland
Posts: 85
|
Thank you all for your replies.
@AVIL Quote:
Quote:
@videoFred Thanks, waiting for your reports @Didée Quote:
Quote:
Quote:
Regards |
|||||
28th April 2005, 00:15 | #12 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
paviko: I took a look at you code and did a little profiling on it. it seems if it's this loop that's taking about 75% of the time:
Code:
for (h=0; h < src_height;h++) { // Loop from bottom line to top line. for (w = 0; w < src_width/4; w++) { // and from leftmost pixel to rightmost one. int miny = h - circle; if (miny < 0) miny = 0; int maxy = h + circle; if (maxy > src_height - 1) maxy = src_height - 1; int minx = w - circle; if (minx < 0) minx = 0; int maxx = w + circle; if (maxx > src_width / 4 - 1) maxx = src_width / 4 - 1; y_local[h][w] = 0.0f; float w_sum = 0.0f; for (int y = miny; y <= maxy; y++) for (int x = minx; x <= maxx; x++){ if (circleMat[w - x + circle][h - y + circle]){ float weight = weights[y_lum[y][x]][y_lum[h][w]]; w_sum += weight; y_local[h][w] += weight * y_lum[y][x]; } } y_local[h][w] /= w_sum; } } Code:
for (h=0; h < src_height;h++) { // Loop from bottom line to top line. int miny = h - circle; if (miny < 0) miny = 0; int maxy = h + circle; if (maxy > src_height - 1) maxy = src_height - 1; for (w = 0; w < src_width/4; w++) { // and from leftmost pixel to rightmost one. int minx = w - circle; if (minx < 0) minx = 0; int maxx = w + circle; if (maxx > src_width / 4 - 1) maxx = src_width / 4 - 1; //y_local[h][w] = 0.0f; float y_local_h_w=0.0f; float w_sum = 0.0f; int y_lum_hw=y_lum[h][w]; for (int y = miny; y <= maxy; y++) for (int x = minx; x <= maxx; x++){ if (circleMat[w - x + circle][h - y + circle]){ int y_lum_xy=y_lum[y][x]; float weight = weights[y_lum_xy][y_lum_hw]; w_sum += weight; y_local_h_w += weight * y_lum_xy; } } y_local[h][w] = y_local_h_w/w_sum; } } Last edited by tsp; 28th April 2005 at 15:41. |
28th April 2005, 18:33 | #16 | Link |
Registered User
Join Date: Jan 2003
Posts: 62
|
@paviko, very nice and promising filter
Just a thought, if by using AVISource(...) DV codec opens avi file in YUY2 space, the next line ConvertToRGB32() will expand luma from 16-235 range to 0-255. All details below 16 and above 235 will be lost. We know that most of miniDV cams have overshoots in luma up to 255. Would it be better use: ConvertToRGB(matrix="PC.601") and have a full luma range? It might be stupid question, but I am just curious, is this filter is interlaced aware, does not require those SeparateFields() Weave() type of things? Last edited by Bordo32; 28th April 2005 at 18:44. |
28th April 2005, 19:34 | #17 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Quote:
|
||
28th April 2005, 22:19 | #18 | Link | ||
Registered User
Join Date: Mar 2005
Location: Poland
Posts: 85
|
@backwoods
I've looked closer to your frame grab and I'd like to have you camcorder It's perfectly keeping colour information in dark areas. Is it a professional camcorder? The best result with such a good devices can be obtained when max_sat parameter is set to 1.0. Otherwise colours can be boosted too much. @tsp Thank you very much for your help, it definately should be like you posted. @Bordo32 Quote:
Thanks for pointing it, I'll addres the issue with the range 16-235 when YUY2 support will be added. Quote:
Regards |
||
29th April 2005, 00:22 | #19 | Link | ||
ReMember
Join Date: Nov 2003
Posts: 416
|
Quote:
Quote:
|
||
29th April 2005, 09:24 | #20 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|