Author Topic: CMOS/ADTG/Digic register investigation on ISO  (Read 589908 times)

Sganzerla

  • New to the forum
  • *
  • Posts: 43
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1100 on: April 26, 2019, 11:05:37 PM »
I'm interested in this technique to make my low light footage 'cleaner' so made 3 tests without any conclusion of the real benefits with my 5D MKIII, no crop mode.

The last test I made (ISO 3200) was puting ADTG Preamp to 2 (Default is 85 in my camera and not 52 as in the video) and ADTG 0xFE to 3 resulting ISO 1648. When exporting the .mlv and using ACR to make the adjustments I found no improvement after matching the brightness of both files - normal and with iso_reg.
If I turn camera off and on again, the resulting ISO changes to 1923 without touching anything!

My questions are:
 - Is this the right way to test this module?
 - Is the turn off/on 'resulting ISO' change expected?
 - I haven't touched the shutter/aperture dials in my latest test, they were the same, was it the wrong approach?

PS: If there was a video showing how to use dual iso the proper way as @70MM13 video showed how to use this module, it would be very cool.

70MM13

  • Senior
  • ****
  • Posts: 334
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1101 on: April 27, 2019, 01:12:56 AM »
the settings i use are strictly for iso 200.  it won't be optimal for any other iso.

i have a feeling that there will be no benefit for iso 3200, but you will have to experiment to find any setting that helps.

good luck!

Luther

  • Senior
  • ****
  • Posts: 256
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1102 on: April 27, 2019, 04:46:42 AM »
i have a feeling that there will be no benefit for iso 3200, but you will have to experiment to find any setting that helps.

I think Canon's ISO goes from range 100 to 1600. Above that it uses digital push. @a1ex could correct me if am wrong here.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3584
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1103 on: April 27, 2019, 01:06:54 PM »
- I haven't touched the shutter/aperture dials in my latest test, they were the same, was it the wrong approach?

These registers predominately affect highlights.  You gain highlight headroom.  If you don't change exposure settings, you simply increase the space between signal max and sensor saturation.

I think Canon's ISO goes from range 100 to 1600. Above that it uses digital push.

Depends entirely on the camera.  5DIII is good to ISO 3200.

Luther

  • Senior
  • ****
  • Posts: 256
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1104 on: April 27, 2019, 01:48:00 PM »
Depends entirely on the camera.  5DIII is good to ISO 3200.

Couldn't understand the Table A2. Can you explain? From 1600 to 3200 it has a drop in DR and double more noise, from what I got from this table...

Code: [Select]
  noise           (electrons)  (e/DN)    ISO
 16.86                2.655    0.157    3200
 31.76                2.501    0.079    6400

Sganzerla

  • New to the forum
  • *
  • Posts: 43
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1105 on: April 28, 2019, 07:18:49 AM »
Thanks for the insights guys, will take a more refined closer look at this topic again.
English is not my native language so sometimes the technical aspects are harder to understand.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3584
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1106 on: April 28, 2019, 11:00:54 AM »
Can you explain?

Table 1

Code: [Select]
  ISO   Apparent   Maximum   DR
         Read      Signal
         Noise

  1600   3.6        4050    10.1
  3200   2.7        2030     9.6
  6400   2.5        1000     8.6

Apparent Read Noise.

From ISO 1600 to ISO 3200 (one full stop), the DR only decreases by 0.5EV.  Thus, you throw away the full stop of highlights from the ISO bump, but you gain 0.5EV in the shadows.  Backed up visually in table 2a and 2b.

From ISO 3200 to ISO 6400, you don't gain anything (except more accurate exposure in camera).  A full stop of highlights has been thrown away, but the DR has also reduced by one full stop.  You didn't gain any signal in the shadows (the entire point of bumping ISO).


histor

  • Freshman
  • **
  • Posts: 57
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1107 on: June 09, 2019, 09:00:15 PM »
This month I was testing reduced analog gains on 5d2 while everyday shooting and results look great. In short: it looks like we can pull down iso100 to something about iso20-25 (upd: lets's say about 50) still having full dynamic range (up to 11.6).

Setup.
Reddeercity’s builds for 5d2 + raw_diag.mo

As Alex once reported, it’s reasonable to pull these DFE values from 48x down to 250 – until vertical banding becomes very noticeable. I’ve tried lower values and subtracted darkframes in post. Luckily vertical banding stays constant for the same ISO and DFE values. I don’t know whether it is important or not, but I used CMOS[0]=0x200, 0x204, 0x208 to get the darkframes (for iso 100, 200 and 400 respectively). Either it’s some physically stable bias (hard to believe that) or just the factory calibration playing against us. I keep just 3 master-darks, they work without a problem. Final images after subtraction show no FPN and very low random noise (reason 1 - analog amplifiers may generate a lot of noise themselves; reason 2 – longer exposure gives larger number of photons).

At DFE values about 100 raw_diag reports worse DR. We can see shadow clipping (posterised green shadows) in post. 111 was just my safe random choice. It turns selecting of iso 100-200-400 to something about iso 20-40-80. All look unbelievably clean. Iso800 is out of use here (it’s produced with DFE values 0x8xx). Iso1600 is a digital push.
SHAD_GAIN (c0f08030) set to 0xfff disables digital push for wide apertures. Not a great change, but still useful.
 
Attaching 2  samples of processed images (shadows lifted a lot) and some raws to play with. “-df” in filenames means that I’ve already subtracted blacks with Pixelfixer (I like its CR2-IN > CR2-OUT approach).

Known problems.
The only way to see overexposure is looking for pink highlights. Auto-ETTR can’t catch it but raw_diag.mo works perfectly.
Low analog gains may be used with Dual-ISO module (or simply patching CMOS[0]=0x343 for iso100/400). But final images are not always recognized by cr2hdr-20bit. Using –force gives processed images with striped lights. Attaching samples, didn’t tried it much.
Works also with Reddeercity’s video hacks (14bit raw, don’t forget darkframes) but adtg_gui.mo is an overkill here – it takes a lot of resources (and power?) and a lot of time for setup. No way to save its settings. Not a run-and-gun tool. What we need to emploi low iso range is a tiny separate module, patching DFE values at start. Maybe just on/of and a choice of value for them. Unfortunately I’m not the one to write it.

Checked the same approach with 600d. It gives something, but nothing groundbreaking yet.

Test raw files - https://app.box.com/s/d7i3qj09pc300ffb73sgrtnj7totjc7i

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3584
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1108 on: June 12, 2019, 01:20:39 AM »
In short: it looks like we can pull down iso100 to something about iso20-25 still having full dynamic range (up to 11.6).

This can be thought as a digital reduction of ISO.  Yes, you have used an analog amplifier, but you haven't increased the cameras ability to capture more photons.

To determine if there is any positive effect to reducing the analog gain this much, you would need to measure the signal to noise ratio of the resulting images.  Did you reduce the noise in the ouput (increase SNR), or did you simply turn the volume knob down and create a bunch of known problems processing the resulting files?

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1109 on: October 29, 2019, 04:03:44 PM »
For those still interested in the controversial reduced gain/low-noise-shadows debate/saga!

I could have *sworn-blind* that when I did my initial (very positive) iso_regs / iso experiments some months ago that they all worked nicely with iso_regs.mo and crop_rec.mo ON at the extended resolutions (UHD, 3K, Anamorphic).

But then it just appeared to stop working on a recent build.

To put my mind (and memory) at ease I tested several different builds and discovered that on all of them – with the exception of the 3.5K 1:1 centered (x5) mode – the crop resolutions (UHD, 3K, Anam.) do not work with iso_regs ON. If you try this the resolution will simply jump back to native each time you record.

I tested:

Alex's builds from Jenkins:

crop_rec_4K Dec09_2017
crop_rec_4K Feb05_2018
crop_rec_4K Jul09_2018


Danne's builds from his repo:

crop_rec_4k_mlv_snd_isogain_1x3_presets Jun28_2018
crop_rec_4k_mlv_snd_isogain_1x3_presets Jul25_2019
crop_rec_4k_mlv_snd_isogain_1x3_presets Oct29_2019

All tested on 5D3_1.1.3

If anyone following the reduced gain/low-noise-shadows saga knows better, please feel free to put me right! Do you have a build version/crop_rec setting that works with iso_regs ON?

Can anyone techy explain why iso_regs.mo and crop_rec.mo won't play nicely together at extended resolutions? – it's way beyond my code skills to understand at the moment.

It would be great it could be made to work!

Thanks!
5D3 1.1.3
5D2 2.1.2

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12360
  • Quarantined
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1110 on: October 29, 2019, 05:03:31 PM »
Short answer: reply #999 addresses exactly this issue. Both iso_regs and crop_rec need to adjust the same set of registers (ADTG and CMOS), but the current backend only allows one piece of code to work at a time. In the same group of conflicting items, you will find adtg_gui and the plain old FPS override.

Currently, the above is just a proposed specification, nothing more. I do not have any working code, not even on my PC.

It would probably take me about one week of full-time work to implement it, or maybe 1-2 months it I were to work on it for one day (8 hours) per week. I'm unable to make any meaningful progress on this particular topic in say 30-minute or even 1 hour slices, as it requires highly skilled and focused work. Back in 2014, while I was actively researching this topic, I was probably spending more than 8 hours per day on ML on average, as I had a very relaxed schedule at job, and very little else to do at home. Now, with a nearly full-time job + family, even one day per week fully dedicated to hobbies would already disrupt my schedule. Just in case anyone is wondering why the progress slowed down so much lately.

So, unless (until?) I'll manage to get my time back, all I can say is... good luck figuring it out!

Quote
controversial reduced gain/low-noise-shadows debate/saga

FYI, I don't see this topic controversial at all; I only want to make sure these improvements are real and measurable. Other things were controversial to me in the past - such as mislabeling ISO 1500 to ISO 100 and claiming massive shadow improvements from that. Of course, ISO 1600 is going to be much cleaner in shadows, compared to ISO 100, all other variables being equal, and ISO 1500 is not going to be much different ;)

Of course, this requires a reasonably solid method for evaluating a sensor response, including measurements of the actual ISO, besides noise levels, and I'm no expert here. I tried to come up with a theory, apparently working reasonably well; the procedure still needs to be automated, the repeatability needs to be evaluated, and one important missing bit is the estimation of sensor response curve, i.e. how linear it actually is. Long answer in previous posts, such as this one.

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1111 on: October 29, 2019, 07:16:33 PM »
@a1ex Many thanks for the study material! I think I see where the challenge lies more clearly now – at least in abstract. Life will have a habit of getting in the way… :P


FYI, I don't see this topic controversial at all; I only want to make sure these improvements are real and measurable.

Aren't the eyes the final judge? *Ducks for cover*…  ;)
5D3 1.1.3
5D2 2.1.2

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1112 on: October 30, 2019, 10:00:15 AM »
I've noted this behaviour – not sure whether it is useful:

With iso_regs and crop_rec ON. In iso_regs: If I go through the procedure of 'Take a picture first' > 'Copy Camera settings', almost always not all the list populates with settings. It often takes restarts/menu/trash can button pushes to fill out all the values below:

CMOS Gain
ADTG Gain
Saturation Offset
Digital Gain
Black/White Offset
Black Reference
ADTG Preamp
ADTG 0XFE
Top OB Size

The odd thing is that when only CMOS Gain, ADTG Preamp ADTG 0FXE, Top OB Size are populated , crop_rec extended resolutions (UHD, 3K et al) function correctly! It's only when all values are finally populated that crop_rec breaks.


Just saying…
5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1113 on: October 30, 2019, 10:07:29 AM »
I think adding the used iso_regs in crop_rec and work them in there with the other regs will solve the issue with conflicting modules. Would take a while and not a priority of mine but still...

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1114 on: October 30, 2019, 10:14:36 AM »
@Danne  :o Where would I start with that? Needle in a haystack… Didn't you include your own iso_gain presets in a build at one time? Did they work in crop_rec rezs?

5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1115 on: October 30, 2019, 10:21:25 AM »
Well yes. And that was the placebo of the century. Line up the regs you want to include for the eosm and I will take a look, at least point where to start.
...- such as mislabeling ISO 1500 to ISO 100 and claiming massive shadow improvements from that. Of course, ISO 1600 is going to be much cleaner in shadows, compared to ISO 100, all other variables being equal, and ISO 1500 is not going to be much different ;)

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1116 on: October 30, 2019, 10:32:13 AM »
Ah yes, Placebogate.  8) Bar the preset labels themselves – the results looked great to my eyes!  :)

Line up the regs you want to include for the eosm and I will take a look, at least point where to start.

Not sure what this request means. Me, I'm 5D2 and 5D3 only (but I'm sure would be awesome for EOS-M also… !)
5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1117 on: October 30, 2019, 10:35:00 AM »
Ok, line up regs for 5d3 then.

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1118 on: October 30, 2019, 10:46:45 AM »
Ok, line up regs for 5d3 then.

Sorry, I'm being dense. ::) I don't know what 'line up' means in this context. ?
5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1119 on: October 30, 2019, 11:15:22 AM »
I assume you are using certain registers that modifies recordings. You need to specify what registers. You can find them with adtg_gui.

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1120 on: October 30, 2019, 11:41:08 AM »
Oh, I see.

In the iso_regs.mo the only ones I have ever touched are:

ADTG Preamp: 2
ADTG 0XFE: 0

I can't seem to make adtg_gui work without turning the image into two-strip technicolor!
5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1121 on: October 30, 2019, 11:59:45 AM »
Yeah, I can't work with that info so unless adtg_gui is fired up etc I'm out  8)

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1122 on: October 30, 2019, 12:21:12 PM »
I'll have another look at adtg_gui and see if I can persuade you back in…  ;D
5D3 1.1.3
5D2 2.1.2

timbytheriver

  • Senior
  • ****
  • Posts: 439
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1123 on: October 30, 2019, 01:15:53 PM »
@Danne Tried atdg_gui with your latest build 2019Otc15.

ISO 200

Modified:

CMOS[0] 0x333
CMOS[6] 0x170 /* seemed to help pink highlights? */

ADTG2 [8882] 0x19a 
ADTG2 [8884] 0x19a
ADTG2 [8886] 0x19a
ADTG2 [8888] 0x19a

ADTG4 [8882] 0x19a
ADTG4 [8884] 0x19a
ADTG4 [8886] 0x19a
ADTG4 [8888] 0x19a

Had to modify Raw White level in MLVApp to 5000 to control pink highlights.

Result was that crop_rec UHD 3072x1536 was [still] made non-functional e.g. actually recorded 1928x964 with atdg_gui enabled. Crop_rec resolutions return after atdg_gui is disabled & restart applied.

PS Is copy/paste available between reg values? My wrist hurts…  :o

5D3 1.1.3
5D2 2.1.2

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6273
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #1124 on: October 30, 2019, 01:52:42 PM »
Getting closer :). The regs referred to can be reached already. Not sure about cmos0, it´s iso right? If so you can select your iso in cam instead and start modifying the other regs.

In crop mode sub menu look for reg_gain You then select either 12bit or 10bit in crop mode sub menu, NOT under RAW video menu, and your gain regs are active(not active with 14bit). See below:
12bit = {6, 0x8882, 250 + reg_gain};
10bit = {6, 0x8882, 60 + reg_gain};

As you can see these analog gain registers are already used to get into 10bit and 12bit.

Code: [Select]
            if (bitdepth == 0x3)
            {
                /* 10bit roundtrip only not applied here with following set ups */
                adtg_new[13] = (struct adtg_new) {6, 0x8882, 60 + reg_gain};
                adtg_new[14] = (struct adtg_new) {6, 0x8884, 60 + reg_gain};
                adtg_new[15] = (struct adtg_new) {6, 0x8886, 60 + reg_gain};
                adtg_new[16] = (struct adtg_new) {6, 0x8888, 60 + reg_gain};
            }
           
            if (bitdepth == 0x4)
            {
                /* 12bit roundtrip only not applied here with following set ups */
                adtg_new[13] = (struct adtg_new) {6, 0x8882, 250 + reg_gain};
                adtg_new[14] = (struct adtg_new) {6, 0x8884, 250 + reg_gain};
                adtg_new[15] = (struct adtg_new) {6, 0x8886, 250 + reg_gain};
                adtg_new[16] = (struct adtg_new) {6, 0x8888, 250 + reg_gain};
            }

cmos6 can be reached in crop mode sub menu already so test from there.