Danne's crop_rec_4k, 5DIII

Started by Danne, November 09, 2018, 05:11:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Danne

Moved builds and to first post instead from today 20210127:

Latest:
https://bitbucket.org/Dannephoto/magic-lantern_dannephoto_git/downloads/

Source atm before leaving bitbucket:
https://bitbucket.org/Dannephoto/magic-lantern_dannephoto_git/src/master/


Worked on my 5D3 crop_rec.c code in this branch:
https://bitbucket.org/Dannephoto/magic-lantern_dannephoto_git/src/master/


- Refined anamorphic presets so it now gives continuous:
1808x2300(2:35.1) = 5425 x 2300
1360x2300(16:9)    = 4080 x 2300

- Also adressed the battery pull issue happening when in 48fps or mv720p 3x3 mode. Workaround allows for looping through x5,x10 and back into x1 mode.

- cine.lua included
- set_25fps in crop mode sub menu working with anamorphic mode
- bitdepth modes in crop mode sub menu working for all presets
- not included sd_uhs(don´t see why sd patching would be needed with mlv_lite anyway)

In terms of image quality and performance the anamorphic mode on this camera outruns anything coming from eosm, 100d etc...

EDIT:
sd_uhs module:
Included as a module. Enable it in Modules tab. Beware that this module is extremely experimental. Use at own risk.





























Below info saved for future/historical reference
Due to misassumptions let us move on!
https://www.magiclantern.fm/forum/index.php?topic=23041.msg208432#msg208432

From crop_rec thread:
https://www.magiclantern.fm/forum/index.php?topic=19300.msg208429#msg208429



In case anyone missed this:
https://www.magiclantern.fm/forum/index.php?topic=10111.msg208136#msg208136

A special ML build here for 5D3113:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3113_presets.zip

build for 5D3123(Not tested! bleeding edge, be careful)
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3123_presets.zip

commit:
https://bitbucket.org/Dannephoto/magic-lantern/commits/75b6e5aedbbb23c22b5055ddea6712f662681955

I added a few items to the crop_rec menu and also rearranged a few things which makes it possible to get cleaner output. Thanks to a1ex crop_rec.c code it´s possible for a player like myself to get some decent workflow out of this.

How does it work?
Pretty straight forward. If you want to shoot regular 14bit or use the regular 12/10 bit menu in RAW video you can use Crop mode menu as before. However, if you want to get cleaner iso and lowering analog gain to get 12/10bit output a different way do following:

1 - Enable crop rec and select any setting in Crop mode menu. Be sure to start off in 14bit-lossless



2 - Press q on Crop mode menu and select any iso in there. This will result in a 13bit iso which will get you cleaner files than the regular iso. You won´t see the change by eye in liveview but comparing files recorded you´ll see the difference in shadows. By enabling iso in this submenu you will override any analog iso already set before. Set chosen iso to off if you want to get back to old iso settings



3 - You can now choose to add 12bit or 10bit on top of your chosen iso to further lower analog gain registers



Original iso 100


10bit iso 100 More or less same as iso 1600. Let´s work the other bits if you not after lowering bitrate.


12bit iso 100


13bit iso 100


Have fun! And be careful. It´s bleeding edge...


Noticed two bugs on the way when testing:
1 - When 1080p45/1080p48 3x3 is set you will get stuck in 10x zoom mode if you go there.
2 - adtg_gui.mo will interfere with slowish "framing" previewing. You need to disable adtg_gui.mo altogether to have framing mode working again.

Thanks A1ex, Levas, bilal, 70MM13 and others for contributions.



jimiz

5D3-123

a1ex

Quote from: Danne on November 09, 2018, 05:11:37 PM
10bit iso 100

This is actually about ISO 1500. Try comparing it with Canon's ISO 1600, in both highlights and shadows.

Yes, it's slightly better than Canon's 1600, but labeling it as ISO 100 is plain misleading, sorry to say that.





Edit: further test reveals the actual ISO is actually *above* 1600. Test files (white level tweaked manually, right before the last histogram peak):
iso1600.DNG (unmodified Canon ISO, assumed exact)
iso100-cmos0-443.DNG (estimated ISO 1527)
iso100-cmos0-443-adtg-888x-low.DNG (estimated ISO 1491)
danne-iso100-10bit.DNG (estimated ISO 2043)

ISO estimation method in octave, from median value in the raw file, normalized with black and white levels (not 100% right; estimation should be done from clipping point):

[a,ea] = read_raw('iso1600.DNG'); a = a - ea.black_level; a = a / (ea.white_level - ea.black_level); median(a(:))
ans =  0.33647

[a,ea] = read_raw('iso100-cmos0-443.DNG'); a = a - ea.black_level; a = a / (ea.white_level - ea.black_level); median(a(:))
ans =  0.32112
# 1600 * 0.32112 / 0.33647 = 1527

[a,ea] = read_raw('iso100-cmos0-443-adtg-888x-low.DNG'); a = a - ea.black_level; a = a / (ea.white_level - ea.black_level); median(a(:))
ans =  0.31355
# 1600 * 0.31355 / 0.33647 = 1491

[a,ea] = read_raw('danne-iso100-10bit.DNG'); a = a - ea.black_level; a = a / (ea.white_level - ea.black_level); median(a(:))
ans =  0.42959
# 1600 * 0.42959 / 0.33647 = 2043





Edit2: further testing to figure out why Danne's picture is brighter reveals a different shutter speed when crop_rec with the "iso 100 10-bit" preset active: rather than 1/100 as dialed in Canon menu, after enabling crop_rec, shutter speed becomes 1/73.31 (as read from the Expo menu or from the DNG metadata). This gives a resulting ISO of 2043 * 73.31 / 100 = 1498, i.e. as expected.

QED, initial hypothesis confirmed.

Danne

Oh, quite so. Same quality more or less. Tested. 10bit a no go. Thanks for pointing out. 10bit could still be useful for lower bitrates with modes not working with anything else than 14bit lossless.

@jimiz
Updated build for 5D3123 in my above post. Not tested so please report how it works.


EDIT:
QuoteEdit: further test reveals the actual ISO is actually *above* 1600. Test files (white level tweaked manually, right before the last histogram peak):
iso1600.DNG
iso100-cmos0-443.DNG
iso100-cmos0-443-adtg-888x-low-iso1500.DNG
danne-iso100-10bit.DNG
Confirmed, slightly above 1600iso comparing your files.
That octave image analysing is really something else.

EDIT 2:
So conclusion is I have been simply rearranging the signal pushing down for instance iso 400 to iso 100(12bit setting)
200 to 100(13bit). Fools gold  8).
Well, now I pragmatically now what´s going on and had a good c code practice...

70MM13

Ok guys, here's the proof everyone needs...

I used a manual aperture lens and made absolutely sure that both exposures are identical.  This is a serious stress test.

See for yourself.

There's a bit of loss of highlights, but for practical purposes it is negligible.

I've been doing this by hand for all of my videos for the last year, and I am overjoyed to be able to do it so easily now.

Overwhelming thanks to Danne!

And of course to the wizard a1ex!




Danne

Thanks for sharing. Well, it goes like this. If you shoot at iso 100 then set it to iso 100 with gain drop you could actually then switch again to regular canon iso 200 and it should give you the same result as the one with the gain drop. Just keep the same settings, aperture, shutter(iso 200 will become brighter and classic ettr will take place). So what´s really happening here is that I have set iso hundred but in reality we are shooting iso 200. Conclusion. Fools gold  8).

One sidequestion. I know the question was asked that dual iso could be disabled for previewing purposes when entering 10xzoom mode. How would it work if dualiso previewing could act like HDR showing alternating iso image on display, high low with intervals? When hitting record dualiso should be enabled like before so it would only be a previewing feature. Even showing only base iso could be really useful, maybe even better than alternating isos.
Now that 1x3 recording is possible it´s even more useful with dualiso but previewing is a bit problematic.

70MM13

200 stock ISO, same exposure...

The proof is in practice.


a1ex



jimiz

Quote from: Danne on November 09, 2018, 05:41:39 PM

@jimiz
Updated build for 5D3123 in my above post. Not tested so please report how it works.





THANKS I will try!!!  ;)
5D3-123

a1ex

Quote from: 70MM13 on November 10, 2018, 12:31:54 PM
All three tests, zipped DNG.

Clip areas:
- 0446: 0.0863% (WL=16381)
- 0447: 0.1373% (WL=9138)
- 0618: 0.1101% (WL=16381)

Pretty sure 0447 was based on ISO 400 or greater, possibly 1600; please compare with these.

Additionally, your clipped area is extremely small. If you use a higher stock ISO, the highlight difference in the final output will be negligible. Please try.

Please consider using a lamp shining into some large flat area (such as a white wall); look at my test scene a few posts above. There, even a tiny change in ISO (e.g. from 1600 to 1500) is noticeable in clip areas, which are pretty large, btw:

iso1600.DNG: 15.34% (WL=16381)
iso100-cmos0-443.DNG: 13.98% (WL=16381)
iso100-cmos0-443-adtg-888x-low.DNG: 13.53% (WL=6040)
danne-iso100-10bit.DNG: 23.39% (WL=2885) [note: different exposure time on this one]

TLDR: please compare with stock ISO 400 and 1600.

70MM13

At these exposures, stock 400 and especially 1600 are just a pile of noise when the shadows are lifted to my liking.

Maybe this isn't for everyone, but it sure works for me!

I'm a happy camper getting excellent results, and the last time I checked, that's what really matters...

a1ex

Please post the DNGs.

At these exposures, stock 400 and especially 1600 have much cleaner shadows than stock 100 or 200. Please try them.

70MM13

Stock 400 did surprisingly well, but not as good as Danne 100.

Stock 1600 was unusable when pushed.  Not worth the data...

For me, 100 with clean shadows is heaven :)

Here's the DNG:

https://drive.google.com/file/d/1htZlLLEZTsXqRujzj7SV90sP1GcxzrxC/view?usp=drivesdk

a1ex

Please make sure you use the same shutter speed, aperture, scene light and so on. Otherwise, the test is not relevant.

This last file shows 1/1000 exposure time; previous ones were at 1/62.5.

If scene light is no longer the same as in the original test, please capture the entire sequence again, at stock ISO 100, 200, 400, 800 and 1600, and at whatever settings you have used for Danne's ISO 100 (not known to me at the time of writing). Also, please minimize the camera movement (not with subpixel accuracy, but the test images should have the same framing).

Anyway, crop area in the last file is 0.1349%; not sure whether to consider it or not, given the different exposure time.

70MM13

I did a bunch of tests and found that the benefits are primarily for 100, falling off to equal by 400.

I was exposing to the right in the tests, using the bulb as the reference point by eye at 10X zoom, adjusting first by increasing the f stop and then by shutter speed when I hit the aperture limit.

I also don't know what Danne has done "under the hood", and so it may be that the test is invalid for actual ISO comparison.

Until today, I've been doing this by hand with the iso registers using your modules, knowing for example that I'm dropping 200 to 109, my most common setting.

I know exactly how well that works for me in extremely challenging circumstances, and I know that the iso 109 I am using really acts like 109 but with cleaner shadows.

I have to get back to the editor.  Hopefully something good will come from this, I know that I will be using it!

Danne

Not by my computer atm. If running yesterday build I think stock iso 400 equals to setting iso to 100 in submenu. Leave out 12/10 bit.
If running todays build I am now focusing on getting continuous shooting rather than trying move isos around.
A1ex is right. Lowering analog gains compensating with pushing higher isos will only move base iso etc to another place. Getting cleaner files will need tweaking of other registers. The analog gains however is still a major player when getting continuous to 1x3 modes and modes that doesn't work with regular 10-14bits workflows.

a1ex

Quote from: 70MM13 on November 10, 2018, 03:21:01 PM
I also don't know what Danne has done "under the hood", and so it may be that the test is invalid for actual ISO comparison.

Analog gain lowered and CMOS[0] overridden for higher ISOs; see his commit.

For example, ISO 100 presets are:
- with his "iso100" option enabled: CMOS[0] as for ISO 200, analog gain 512
- with "iso100" + "12-bit": CMOS[0] as for ISO 400, analog gain 250
- with "iso100" + "10-bit": CMOS[0] as for ISO 1600, analog gain 60

I believe you have use one of the last two presets, just not sure which one.

In my tests, reducing analog gain only improves things by about 0.1 EV.

In other words, I'm pretty sure the results you were getting were 0.1 EV actual improvements, and 1.5 ... 3 stops were misunderstandings (possibly coming from the mislabeled ISO values in crop_rec menu). I wanted to prove it on your own images, but that requires identical test conditions for each setting (which you did not provide).

You made a very strong statement:

Quote from: 70MM13 on November 10, 2018, 11:09:20 AM
Ok guys, here's the proof everyone needs...

yet, you did not provide a valid proof.

Quote from: 70MM13 on November 10, 2018, 01:40:24 PM
I'm a happy camper getting excellent results, and the last time I checked, that's what really matters...

Yet, this particular topic (ISO tweaks) was about getting results *better* than with stock Canon ISOs.

My argument is that, in Danne's build, the improvement is about 0.1 EV over stock Canon ISOs (according to my measurements). In your example, the shadow difference is much stronger than that, but I'm pretty sure that difference is *not* an improvement over stock Canon ISOs (except for that 0.1 EV, which is not going to be noticeable without careful examination).

Quote from: 70MM13 on November 10, 2018, 11:09:20 AM
There's a bit of loss of highlights, but for practical purposes it is negligible.

Pretty sure the loss is about 1.9 EV if you have used the 12-bit "iso100", or 3.9 EV if you have used 10-bit "iso100". Clearly negligible ;)

70MM13

My statements were not in the right context.  My fault.

I was referring to my experiences with reduced gain by hand, not with Danne's experiment.  I have only used it to take those test shots.  It seemed like it was behaving the same way, which it may indeed, but I was going by my impression of how it behaves the same way under the familiar test conditions.

It may be that on a statistical level, the reduced gain is only marginally better, but in practice, I find it vastly superior.  There's still noise in the shadows, but it's more like film grain, and it is usable when pushed hard.  I can't do the same with stock ISO.

It works for me.

a1ex

Quote from: 70MM13 on November 11, 2018, 01:30:53 PM
I was referring to my experiences with reduced gain by hand, not with Danne's experiment.  I have only used it to take those test shots.  It seemed like it was behaving the same way [...]

No, it does not.

Besides, your test scene is not ideal for comparing different ISOs, simply because the clipped area is extremely small. On your test image, whether you use ISO 100 or 400, it doesn't make a big difference in highlights (the clipped area was close to 0.1% in both cases). This is exactly why you said:
Quote
There's a bit of loss of highlights, but for practical purposes it is negligible.

Yet, the difference in highlights between these two ISOs is 2 full stops. In your test scene, these two stops are on the tiny light bulb; that's why you found the highlight difference to be negligible. In other scenes, the last 2 stops may cover a very large area of the image.

I'm still asking you to capture a full set of DNG images, with the same exposure time, on your test scene, at the following settings:
- stock ISO 100
- stock ISO 200
- stock ISO 400
- stock ISO 1600
- Danne's ISO 100 (all 3 flavors)
- the preset you use with manual tweaking from iso_regs

I bet you'll have a little surprise at ISO 1600. You'll be tempted to try 3200 and 6400. Not joking.

Caveats:
- enabling both crop_rec and iso_regs at the same time does not work; if you enable both and then disable one of them, it won't work either.
- enabling Danne's crop_rec will alter the shutter speed; to cross-check with iso_regs you may have to use the shutter fine-tuning feature.
  Just make sure shutter speed is set to Original (not Full Range) in crop_rec menu.



Levas

Quote from: a1ex on November 11, 2018, 02:01:07 PM
- enabling Danne's crop_rec will alter the shutter speed; to cross-check with iso_regs you may have to use the shutter fine-tuning feature.

I wonder why it messes with the shutter speed and was wondering if it could be the case that if 'full range' option is selected in crop_rec, it messes with shutter time. And could it be that if this option is set to 'original' it won't mess with shutter speed ?


Danne

Since there is still some interest in doing tests around my lowering gain builds I reupload them as they were published a few posts back:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3113_presets.zip
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3123_presets.zip

Feel free to do the tests suggested by a1ex two posts above but be sure to use the builds above. No time personally atm for testing.

I also uploaded two other versions which works pretty similar but with a few personal rearrangements which are to be considered a work in progress:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3113_presets-ver2.zip
https://bitbucket.org/Dannephoto/magic-lantern/downloads/crop_rec_4k_mlv_snd_isogain_1x3_5D3123_presets-ver2.zip

On a sidenote it would be cool if we now could continue testing pregain etc and see if we could get it rightly done. I have to little experience in this field but got a few hints and pointers here:
https://www.magiclantern.fm/forum/index.php?topic=10111.msg208037#msg208037

a1ex

Quote from: Levas on November 11, 2018, 02:44:25 PM
I wonder why it messes with the shutter speed and was wondering if it could be the case that if 'full range' option is selected in crop_rec, it messes with shutter time. And could it be that if this option is set to 'original' it won't mess with shutter speed ?

That's correct. My bad, forgot this setting enabled.

Quote from: Danne on November 11, 2018, 02:56:12 PM
On a sidenote it would be cool if we now could continue testing pregain etc and see if we could get it rightly done.

Keep an eye on the iso-research branch.

My experimental modules (iso_regs, raw_diag and adtg_gui) are compatible with crop_rec_4k and derived builds (including Danne's build), btw.

Danne

Have been trying to get 1x3 binning mode to work with increased height on the 100D the but have been running out of ideas. No matter how I tweak registers I cannot move above 1736x1188 before I get either corrupted recordings, every other white, the next contains image content or if going higher I get completely white live view image.

Commit here:
https://bitbucket.org/Dannephoto/magic-lantern/commits/a6170f148121d281b9b17a807f264f7afce038d3?at=crop_rec_4k_mlv_snd_isogain_1x3_presets

Now I tried changing around a lot in raw.c. Testing excluding height-- among other stuff but this don´t seem to help.

Is there anything in the timing registers that could be tweaked or did I hit roof at height 1188?

nikfreak

Unsure if it could help but you might try to define  timer A+B to it's orig value. Maybe my customisations interfere somehow.
[size=8pt]70D.112 & 100D.101[/size]