Author Topic: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView  (Read 339021 times)

Danne

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1925 on: November 09, 2018, 08:30:52 AM »
@mothaibaphoto
What happens if you do changes straight in crop_rec.c code like here?
https://www.magiclantern.fm/forum/index.php?topic=19300.msg208153#msg208153

mothaibaphoto

  • Senior
  • ****
  • Posts: 375
  • pesky kid
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1926 on: November 09, 2018, 12:09:01 PM »
Same s**t:
Code: [Select]
ML ASSERT:
0
at mlv_lite.c:2723 (compress_task), task compress_task
lv:1 mode:3

compress_task stack: 1ae538 [1ae5c0-1ad5c0]
0x0006A030 @ ae1174:1ae568
0x00069868 @ 6a09c:1ae538

Magic Lantern version : Nightly.2018Oct09.5D3113
Mercurial changeset   : 41153b1177ce+ (crop_rec_4k_mlv_snd) tip
Built on 2018-10-09 14:52:06 UTC by [email protected]
Free Memory  : 211K + 2983K
By the way, your code example with error: 1048 instead of 1080 in preset. But your repo code is correct.

Danne

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1927 on: November 09, 2018, 05:11:37 PM »
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

  • New to the forum
  • *
  • Posts: 39
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1928 on: November 09, 2018, 05:29:33 PM »
for 5D3123 , nothing ?  :-\

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1929 on: November 09, 2018, 05:33:45 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):
Code: [Select]
[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

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1930 on: November 09, 2018, 05:41:39 PM »
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:
Quote
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
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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1931 on: November 10, 2018, 11:09:20 AM »
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

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1932 on: November 10, 2018, 11:24:03 AM »
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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1933 on: November 10, 2018, 11:59:49 AM »
200 stock ISO, same exposure...

The proof is in practice.


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1934 on: November 10, 2018, 12:03:30 PM »
DNG, please.

70MM13

  • Freshman
  • **
  • Posts: 95

jimiz

  • New to the forum
  • *
  • Posts: 39
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1936 on: November 10, 2018, 12:37:11 PM »

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





THANKS I will try!!!  ;)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1937 on: November 10, 2018, 01:09:03 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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1938 on: November 10, 2018, 01:40:24 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1939 on: November 10, 2018, 01:45:03 PM »
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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1940 on: November 10, 2018, 02:13:28 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1941 on: November 10, 2018, 02:58:37 PM »
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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1942 on: November 10, 2018, 03:21:01 PM »
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

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1943 on: November 10, 2018, 03:47:13 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1944 on: November 10, 2018, 03:48:34 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:

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

yet, you did not provide a valid proof.

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).

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

  • Freshman
  • **
  • Posts: 95
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1945 on: November 11, 2018, 01:30:53 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1946 on: November 11, 2018, 02:01:07 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

  • Hero Member
  • *****
  • Posts: 1307
  • 6d - Nightly build user
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1947 on: November 11, 2018, 02:44:25 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

  • Hero Member
  • *****
  • Posts: 4530
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1948 on: November 11, 2018, 02:56:12 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 11792
  • 5D Mark Free
Re: crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView
« Reply #1949 on: November 11, 2018, 03:17:05 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.

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.