View Full Version : Reverse autogain?
mf
18th February 2004, 20:38
I just had an idea. It would be very nice if there would be a reverse version of ColorYUV(autogain=true). Don't get me wrong here, I'm not expecting any magic, just something (frame hints?) so I can autogain, then do some filtering, and then put back the levels again. Kind of like enforcing luma weighting for denoisers that don't have it implemented (the only one afaik is SSHiQ).
Edit: the luma fluctuations could cause denoisers to behave weird though - so to be on the safe side also implement a gain smoothing that makes sure there isn't too much flickering :D.
Richard Berg
18th February 2004, 22:08
I don't think that's possible without a log file.
mf
18th February 2004, 22:37
Could you then explain to me what exactly is possible using Decomb-like frame hints? :)
Didée
18th February 2004, 23:20
Heya mf,
one more time, parallel ideas :)
By the time I brainstormed about that problem, I thought of a procedure like this:
1. put a reference border at one side of the frame.
In case you're going to reduce gammut, that should be e.g. a 255-white cross (or box) on a 127-grey border. In the opposite case you need a dark reference, e.g. a 32-grey cross (box) on a black border.
These values might be different, depending on where you start and where you go ;)
2. Then do the desired gaining - and here comes the tricky part: somehow you must get colorYUV to ignore the reference area while *sampling* the frame's levels range, but to include the reference area when applying the gaining.
3. Then, it would be possible to restore the original range again afterwards, since you know the levels range that originally was covered by the reference.
So far for the idea - should work in principle. But how to actually do it ... ?
However, when I thought about that, I had another starting point: I was trying to restore the full levels range of a grey edgemask after strongly blurring it. But this, in detail, raises different problems to solve than your task - and I didn't tackle mine, up to now.
- Didée
mf
19th February 2004, 13:09
Your plan is probably easier, mine is more "integrated". :)
Didée
19th February 2004, 14:03
Integrated !
/ shakes finger, making an earnest face
:)
sh0dan
19th February 2004, 17:20
You could use the new ConditionalReader to import per frame variables.
For example:
ScriptClip("coloryuv(gain_y=CV_ygain)")
ConditionalReader("gain_y.txt", "CV_ygain")
gain_y.txt:Type int
Default 0
0 10
1 15
2 50
r 5 50 -20
.. or something similar with levels. You are smart - figure it out :)
mf
19th February 2004, 18:10
I'm new to this conditional filtering stuff - where does CV_ygain come from?
sh0dan
19th February 2004, 20:17
The value of the variable "CV_ygain" is updated every frame by conditionalreader, depending on what you define in the text file it loads.
Try having a look at the examples in the ConditionalReader documentation (http://www.avisynth.org/index.php?page=ConditionalReader).
mf
19th February 2004, 21:52
Yeah, but where do I get the values in the textfile from.. ;)
Mug Funky
20th February 2004, 09:39
what would be REALLY cool for some of this stuff is something like attack and release times in frames (or fractions of frames, but this would lead to VHS-like gradients).
i've tried autogaining in filters, and often when the picture fades to black a denoiser becomes completely useless as all there is is noise. with attack and release, or some kind of controls over autogain it would be much more usable.
(note to self... i could possibly use conditional scripts and levels to handle this, but i'm not too savvy with conditionals yet)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.