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

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #25 on: January 12, 2014, 10:47:33 PM »
Do you have a tool that can plot a signal-noise graph like this?



I did this one a while ago by taking many pictures of a blank wall at different shutter speeds. I know darktable guys did such graphs from a single image, but they plotted it on linear axes, which is complete nonsense (they buried the midtones and shadows into a tiny corner and their graph covers well only the highlights).

If not, I can write a module that plots this kind of graphs directly in the camera, from a defocused test picture.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #26 on: January 12, 2014, 10:50:07 PM »
White level in LiveView is set to 15000 as a one-size-fits-all code. If the true white level is higher than that, it can't be wrong by more than 0.14 stops. If the true white is 15600, the error is roughly 0.07 stops.
1792 -> 15000 / 1024 -> 15600 => 1368 ADU reduction in the range; so more than 8% of reduction.

You can always squeeze this extra DR with exiftool.
Thanks for the tips, I'll see how to do that.

Actually I'm trying to produce a 'very' RAW for scientific imaging, astro-photography or other special imaging by record a RAW with the minimal operations done on. It means the best bias/offset matching for the RON + FPN sigma at the optimal analogic gain etc. (no multiple ISO choice in this case so no way for regular photography). I don't fully understand how to use datas in ADTG datasheet yet, but it looks we are just at the beginning of what we can do with ML!

If you want I can do test on 5D2, just ask.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #27 on: January 12, 2014, 10:52:46 PM »
1792 -> 15000 / 1024 -> 15600 => 1368 ADU reduction in the range; so more than 8% of reduction.

1792 is Canon's choice.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #28 on: January 12, 2014, 11:07:18 PM »
I've been trying to figure out how increasing the black level via that register is keeping a similar/smaller Standard Deviation.
(...)
Over all sigma ADU values on a short exposure is ≈ RON + FPN + offset.
So if offset > sigma/2 ; sigma will always be the same. You can change as you want the pedestal, it will not affect sigma.
And if offset <= sigma/2 ; sigma could be better but with information lost (low values clipping).
(I supposed a symmetric deviation for sigma here, to be simple)

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #29 on: January 12, 2014, 11:09:09 PM »
1792 is Canon's choice.
I confirm not.
Canon offset is 1024 ADU on 5D2.
Here is a RON + FPN profil:


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #30 on: January 12, 2014, 11:10:56 PM »
And if offset <= sigma/2 ; sigma could be better but with information lost (low values clipping).

I suppose you are talking about something else. We are changing the reference value for the black feedback loop (which is an analog bias), we are not changing black level in exiftool.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #31 on: January 12, 2014, 11:12:49 PM »
I confirm not.
Canon offset is 1024 ADU on 5D2.

LiveView is not the same as photo mode.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #32 on: January 12, 2014, 11:29:31 PM »
I suppose you are talking about something else. We are changing the reference value for the black feedback loop (which is an analog bias), we are not changing black level in exiftool.
Indeed, I speak about analogic bias. We are OK.

LiveView is not the same as photo mode.
Ah, I did not know there's specific pedestal config in LiveView. Au temps pour moi.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #33 on: January 12, 2014, 11:38:06 PM »
Okay, but the bias is around 1024...2048 and sigma is around 8.

I guess a larger bias could mean stronger signal for the amplifier that comes after the DAC that clamps black level. But if you raise the bias too much, you are forced to lower the ADTG gain, and this will introduce quantization noise. Probably there's a sweet spot somewhere.

poromaa

  • Member
  • ***
  • Posts: 139
  • Engineer by day James Cameron in my dreams
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #34 on: January 12, 2014, 11:55:56 PM »
interesting!

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #35 on: January 13, 2014, 01:27:26 AM »
(...)
I guess a larger bias could mean stronger signal for the amplifier that comes after the DAC that clamps black level. But if you raise the bias too much, you are forced to lower the ADTG gain, and this will introduce quantization noise. Probably there's a sweet spot somewhere.
Indeed again, as I said there's a relation between all these parameters.
The optimal config is easy to gess, on the paper, but hard to implement. I'm stuck at this point right now.

In a scientific view of all of this, the best choice will be:
_. the lower pedestal value where RON + FPN sigma is contained therein
[current original Canon bias is too high, because have to fit with all ISO; for example with 5D2 it could be N-times lower for ISO where gain <1 (in my graphic just up you can see it could be ~10x lower)]
_. the more closer analogic gain than 1
[but in real world and for usual photography, gain has to be <1 to equiv low ISO sensibility, so we should use a matrix for all ISO/gain/bias optimal values]
_. the lower digital gain
[in fact if we could have a matrix for all ISO up to gain <1 where DG is null it will be optimal, as it done for audio signal]

Please not that I ever do most of these optimizations in post for my work, I could demonstrate/detail/explain parts if need.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3454
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #36 on: January 13, 2014, 04:43:46 AM »
Do you have a tool that can plot a signal-noise graph like this?

I've been manually entering the numbers in a spreadsheet and using it to generate the graphs.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #37 on: January 13, 2014, 04:06:47 PM »
gnuplot is useful for that.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #38 on: January 13, 2014, 04:35:00 PM »
Made some progress in understanding how ISO 160x are implemented on 5D3 photo mode. This does not apply to LiveView / raw video.

I've looked at what DIGIC registers get changed between ISO 160 and 200 (you remember them from the good old digic poke, FPS override and all sorts of funky effects), and found this one: 0xc0f0819c = 0xC4C for full-stop ISOs and 250 multiples, and 0x8F0 for 160 multiples.

Code: [Select]
                                        black    stdev    white   DR
ADTG gains default:
ISO 160:                                2047     5.42     13307   11.02
ISO 200:                                2047     6.86     15283   10.91
ISO 200 with 0xc0f0819c = 0x8F0:        1187     6.80     15283   11.02
ISO 160 with 0xc0f0819c = 0xC4C:        2734     5.50     13307   10.91

ADTG gains changed to 0.85 x default (right above the point where white level begins to decrease):
ISO 160:                                2047     4.56     13307   11.27
ISO 200:                                2047     5.71     15283   11.18
ISO 200 with 0xc0f0819c = 0x8F0:        1187     5.71     15283   11.27
ISO 160 with 0xc0f0819c = 0xC4C:        2734     4.61     13307   11.16

Changed 8880 to 0xb04 to bring the black level back to 2047:
ISO 200 with 0xc0f0819c = 0x8F0:        2047     5.88     15283   11.14

You draw the conclusions.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #39 on: January 13, 2014, 10:10:03 PM »
Is it possible to set custom value for 0xc0f0819c ?
Ex.
ISO 200 with 0xc0f0819c = 0xAA4 => offset = 1024 ADU

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #40 on: January 13, 2014, 10:40:11 PM »
Yes, I can offset the black level all the way to 0 and even below. This register is called SaturateOffset in Canon firmware.

When changing this register, the image looks just as bright as the original ISO (unlike with ADTG gain, where overall brightness changes). Also, both dcraw/ufraw and Adobe DNG converter handle the modified black level properly.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #41 on: January 14, 2014, 12:25:30 AM »
Yes, I can offset the black level all the way to 0 and even below. This register is called SaturateOffset in Canon firmware.
Nice!

When changing this register, the image looks just as bright as the original ISO (unlike with ADTG gain, where overall brightness changes).
Agree, the overall brightness should not change.
In the same time pseudo-blacks should be less noisy because of lower RON levels and DR should be increased because of larger range between RON and max level.

Also, both dcraw/ufraw and Adobe DNG converter handle the modified black level properly.
Yes, but it's better to set that by analogic, at the source. Numerical post optimization with a single source frame is equivalent to stretch DR etc. Some informations are not record in the source so can't be restored after.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3454
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #42 on: January 14, 2014, 02:13:17 AM »
Yes, I can offset the black level all the way to 0 and even below. This register is called SaturateOffset in Canon firmware.

Changing 8880 to 0x0 produces this.


Clearly, it's having a bigger effect through the exposure on RB then G.

Agree, the overall brightness should not change.

Most software has enough controls over exposure, I don't see it would matter.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #43 on: January 14, 2014, 07:29:01 AM »
That's why I need a tool to plot the entire SNR curve, not just the black/noise/white levels.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3454
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #44 on: January 14, 2014, 08:24:00 AM »
I couldn't find anything with a google search.  The only one I know of is imatest, but it isn't cheap.

The trial version might be enough for what you need.

ilguercio

  • Hero Member
  • *****
  • Posts: 843
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #45 on: January 14, 2014, 10:29:01 AM »
I got my 6D and digic poke, if you need some data i can try and provide you some figures.
Just let me know the procedure.
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10724
  • 5D Mark Free
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #46 on: January 14, 2014, 11:02:27 AM »
Yes, the last graph from their page is what I'm looking for. If it runs on the camera from a defocused test image (without test charts or other special requirements), that's even better, since I can just tweak parameters and see the result right away.

So, I started to write my own module. @SpcCb, I bet you will like these graphs a lot (ISO 200 vs 160):



The histogram pattern does not change with either ADTG gains or SaturateOffset.

@ilguercio: for the beginning, you can start here and see if you can follow the discussion and arrive at similar numbers. So far, we are just tweaking parameters kinda blindly.

"If we knew what it was we were doing, it would not be called research, would it?"

ilguercio

  • Hero Member
  • *****
  • Posts: 843
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #47 on: January 14, 2014, 11:12:20 AM »
Damn, i haven't had a compiling environment since i bought this new laptop.
I'll try to get it running tomorrow and meanwhile i can try to understand what is exactly involved.
I need to learn all this stuff, so far what seems to be the trick?
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3454
  • Blunt and to the point
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #48 on: January 14, 2014, 01:30:40 PM »
http://www.microscopyu.com/tutorials/java/digitalimaging/signaltonoise/

Quote
Because photon noise is an inherent property of CCD signal detection, which cannot be reduced by camera design factors, it essentially represents a "noise floor" that is the minimum achievable noise level, diminishing in relative effect as photon flux increases. Consequently, it is desirable to operate an imaging system under conditions that are limited by photon noise, with other noise components being reduced to relative insignificance. Under low illumination level conditions (assuming dark noise is essentially eliminated by CCD cooling), read noise is greater than photon noise and the image signal is said to be read-noise limited. The camera exposure time (integration time) can be increased to collect more photons and increase SNR, until a point is reached at which photon noise exceeds both read noise and dark noise. Above this exposure time, the image is said to be photon-noise limited.

SpcCb

  • Member
  • ***
  • Posts: 205
Re: CMOS/ADTG/Digic register investigation on ISO
« Reply #49 on: January 14, 2014, 04:29:28 PM »
(...) If it runs on the camera from a defocused test image (without test charts or other special requirements), that's even better, since I can just tweak parameters and see the result right away.
Yes, it's better to run tests on a plain surface without shape because all variations will be include in sigma.

So, I started to write my own module. @SpcCb, I bet you will like these graphs a lot (ISO 200 vs 160):
(...)
Useful tool! (I dream to make tools like that!)
We can well see how is the population around the 2048 ADU pedestal. Is the vertical scale is the same?
If yes, for ISO 160 it clearly shows less population. Some vergences too; RON harmonics. I'll see to publish a RON map, sometimes it's more clear with grfx.

http://www.microscopyu.com/tutorials/java/digitalimaging/signaltonoise/
It confirms what I explained posts ago. ;)