I originally started with lots of ifs like this.
According to some experiences, I now understand what you mean. The adaptation of overexposure I first abandoned.
I then concentrated only on the oscillation at constant lighting condition.
When I run rawopint with constant lighting condition (same like isoinc), it was pretty easy to generate oscillation. How do you run isoinc.lua? Also like you describe for drtest.lua against a monitor?
First I analyzed the smooth stuff in rawopint and I can say, the smooth stuff did already a good job. Without smooth it gets even worse.
Then I added only the following code on the end of the smooth stuff. I tried other functions like ev_change^2 but this was even harder. This code only reduces changes. So ev_change 3 goes to 2, 2 to 1 and 1 to 0.
if (ev_change >= -3 and ev_change <= -1) then
ev_change_mod = ev_change + 1
end
if (ev_change >= 1 and ev_change <= 3) then
ev_change_mod = ev_change - 1
end
Yes of course, this helps for oscillation at constant lighting condition.
When you see the ‘rawopint_compare3’ plot, you see 100 shots with my code changes and 100 with your original code on constant lighting condition. So you don’t see oscillation produced by the code anymore. Yes meter96 stays I little bit more far away from 0, but this should be Ok.
Then I run the changes under real condition.
http://youtu.be/T5YagfYfPA0The plot ‘JCrawopint_test3’ shows you the result. Meter96 is now above or under 0. There is no up and down more in d_ev but you can still see parts of oscillation. Around picture 420 you see even oscillation, when rawopint made no changes. But this might be come from the scene. I think the changes are not really a improvement.
I saw in your comments, to make smoothed fraction be configurable. This might be a good idea.
My understanding about meter and meter96 was, that meter has a high resolution. So it may be helpful, not to work with a meter96 value, and to work with a meter96*100 internal. Also to work with a smoothed fraction it would be helpful, to work with an ev_change *100 value internal, and only change this value when it is set to the cam.
At the end of the day I definitely now much more understood by the algorithm in rawopint...