Why gain is bad for your dynamic range.

One way to reduce the noise in a video camera image is to reduce the cameras gain. One way to increase the brightness of the image is to add gain.

We all know that increasing the gain to lets say +6db will increase noise and generally the reverse holds true when you reduce the gain, the noise typically reduces and this may be helpful if you are going to do a lot of effects work, or just want a clean image.

However in most cases adding or removing gain reduces the cameras dynamic range as it will artificially clip or limit your low key or high key parts of the image. The maximum illumination level that a camera can capture is limited by the sensor or the gamma curves that the camera has. The black level or darkest part of the image is the point where the actual image signal compared to the sensor noise level is high enough to allow you to see some actual picture information (also known as noise floor). So the dynamic range of the camera is normally the range between the sensors noise floor and recording or sensor clipping point.

To maximise the cameras dynamic range the designers will have carefully set the nominal zero db gain point (native ISO) so that the noise floor is at or very close to black and the peak recording level is reached at the point where the sensor itself starts to clip.

The gain of the camera controls the video output and recording level, relative to the sensors signal level. If you use -3db gain you attenuate (reduce) the relative output signal. The highlight handling doesn’t change (governed by the sensor clipping or gamma curve mapping) but your entire image output level gets shifted down in brightness and as a result you will clip off or loose some of your shadow and dark information, so your overall dynamic range is also reduced as you can’t “see” so far into the shadows. Dynamic range is not just highlight handling, it is the entire range from dark to light. 3db is half a stop (6db = 1 stop) so -3db gain reduces the dynamic range by half a stop, reducing the cameras underexposure range without (in most cases) any change to the over exposure range, so overall the total dynamic range is reduced.

gain-curves-1 Why gain is bad for your dynamic range.

When you add gain the reverse happens. Generally how far the sensor can see into the shadows is limited by the sensors noise floor. Add 6db of gain and you will make the darkest parts of the image brighter by 6db, but you will also raise the noise level by the same amount. So while you do end up with brighter shadow details you can’t actually see any more picture information because the noise level has increased by the same amount. At the top end as the brightest sensor output is mapped to the maximum recording level at 0db, when you add gain this pushes the recording level beyond what can be recorded, so you loose 6db off the top end of your recordings because the recordings and output clips 6db earlier. So positive gain maintains the same shadow range but reduces the highlight recording range by 6db.

However you use it gain tends to reduce your dynamic range. Adding gain to cope with poor lighting tends to be the lesser of the two evils as generally if your struggling for light then overexposure and blown out highlights is often the last of your worries.

Negative gain is sometimes used in camera to try to reduce noise, but the reality is that you are loosing dynamic range. Really a better solution would be to expose just a tiny bit brighter and then bring your levels down a bit in post production.

Advertisements

16 thoughts on “Why gain is bad for your dynamic range.”

  1. Could you cite any sources or tests? The article seems pretty vague without addressing any particular camera’s implementation and without mentioning likely DR limitations imposed by the ADC versus the sensor, which is common in cameras with adjustable gain. The sensor itself is an analog device and has a fixed DR, gain generally only is used to workaround the downside of a DR-limited ADC. At least that is my understanding for most common implementations.

    1. It’s basic SNR theory. Gain doesn’t change SNR and as there is a finite recording range additional gain will push your levels beyond the design recording range so DR is reduced. If the original is 0 to 100% then adding gain will make the new signal bigger than 100%. We can’t record more than 100% so the signal is lost and dynamic range is reduced.
      Generally the DR of a camera is limited by either the sensor or A to D’s. So if a system is operating at it’s maximum DR, subtracting gain will reduce the DR as you will make small values too small to be useful.

      It’s easy enough to test for yourself with a camera and waveform monitor. You can even see this with most cameras with a histogram. Use negative agin and you’ll see the peak recording level drop and some shadow detail become clipped. Add gain and you’ll see the noise floor come up and highlights clip earlier.

  2. Perhaps what you are saying is over my head but it sounds like you are saying the DR is limited by the recording range? Why wouldn’t they be able to take whatever values come out of the ADC and map them to fit the recording range if it is designed properly? They are presumably doing lots of other processing to the ADC output: debayering, applying gamma, matrix, bit downsampling, etc…

  3. Noah, A good way to think of it is like a glass of water.

    Imagine you have a glass of water that is full to the brim. You then place an object in the bottom of the glass to boost the level and the water level rises and you lose some water out of the top of the glass.

    It might be possible for some remapping to be done, similar to the active knee that is often on ENG style cameras. However you would still increase the noise, and you would perform such remapping at the expense of tonal range because you would have to compress the highlights, and possibly end up affecting other parts of the image.

  4. Assuming I’ve calibrated my zebras correctly to the right gamma / paint settings with the intention of using them to expose on bright whites, is it safe to say I’ll often need to bump up my ISO / db settings until a seemingly “bright white” is covered in stripes? Essentially, with video, I’m always reluctant to change out of the native ISO of a camera at the expense of dynamic range. However, I’m unaware of what else to change given lower-light conditions. I don’t want to alter shutter speed, obviously, and if my lens is already as open as possible – how else can I get the right exposure?

    Thanks in advance.

    1. Well if you are underexposed, dynamic range is the least of your worries, so don’t worry about adding gain or increasing the ISO if it’s the ONLY way you can increase your exposure.

  5. But how far can the exposure increased?, how much can i push the iso,
    if i have to shoot in low light situations?

    Thanks!

    1. How long is a piece of string? ISO is not exposure, ISO is gain and brightness, how much you can raise the gain depends on how much noise you are prepared to accept.

  6. Excuse my bad English

    Your gain curves are not correct: they start all at 0 IRE. It’s the Setup Level or the Pedestal wich adjust the black level. If you lower the gain, the dynamic of your image is exactly the same with the same percentage of noise but, because your image is darker, you lose bit depth wich is a whole other issue. If you shoot in Rec.709, wich has low dynamic for the sensor, set the gain to a negative values and set the zebra at 109 IRE. Doing so, you lower the noise and use the max. bit depth. Downgrading to the very bad broadcast safe range must be the last step.

    Jean

    1. If you lower the gain, yes all you would do is decrease the the amplitude of the signal. But negative gain in many cameras is subtractive and this pulls the sensors minimum output below zero. -3dB and -6dB is very often not just less gain but subtracts from the already processed sensor output so shadows go into negative values and are never seen. Plus very often the output then never reaches 109/100 IRE. You can clearly see this behaviour in the XDCAM EX, PMW and PDW series cameras as well as many others. Selecting negative gain will prevent full output from being reached even if the sensor DR exceeds the recording gamma. Not all cameras exhibit this behaviour but it is very common and results in reduced dynamic range.

  7. Hi Alisterchapman,

    Thank you for your reply. I give more precision but I think that the point 4 speaking over a big color issue is the most important and I have not found where to put it on your site.

    The 8 (10) bit values of the luminance signal (Y) is 16-235 (64-959) if you shoot at 100 IRE and 16-255 (64-1023) if you shoot at

    109 IRE to better use the whole bit depth and thus reduce the banding artifacts. Now what happens exactly if you modify the Gain

    but let the exposure to Auto: in a properly disinged camcorder, nothing happens to the frame, only the noise level changes. For

    ex.: Gain at -6dB = noise reduced by 2, Gain at +6db = noise x 2, but there are side effects. The gain circuitry woks often as

    follow: the pixels of the sensor deliver an analog voltage that is feed to the input of analog amplifier. The gain button acts on

    the gain of this amplifier. Exemple: suppose a sensor capable of delivering max. 1 volt at full illumination, after what the

    signal is clipped. On a black image, this sensor delivers ~0 volts (~ because there is noise). The following stage is an Analog to

    Digital converter (AD) wich converts black (0 volts) to byte values centered on 16 (16 is black and “centered on” because there is

    noise). Assume also that the 0.6 volts sensor signal is converted to the byte value 255. Then, the 0.6 to 1 volt range is the room

    which is reserved to support negative gain values. Examine the following case assuming that the aperture is set to auto and the

    shutter speed is fixed.

    1) You lower the gain (-3db)
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The automatic exposure circuitry opens the diaphragm to admit 3db more light on the sensor wich delivers now 0,6 volts x 1.41253 =

    0,847418 volts. At the same time, the gain of the analog amplifier is reduced by the same proportion. Now black 0 volt is always

    converted to 16 and 0,847418 vots is converted to 255 by the AD circuit. This is OK and the noise is reduched by 3db

    2) You lower the gain (-6db)
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The aperture is open to admit 1.9952 x more light and the gain of the analog amplifier is lowered by the same amount. For this to

    work without an issue, the sensor must be capable of delivering 0.6 x 1.9952 volts = 1.19721 volts but in my example, he is

    saturated at 1 volt (the input stage of the analog amplifier can also be saturated). Your highlights are thus clipped, the camera

    design is bad.

    3) You increase the gain by 6db
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The gain of the analog amplifier is increased by 1.9952 and the aperture is closed by the same amount to compensate. The output of

    the sensor is now 0 to 0.3007 volts (= 0.6/1.9952). But the noise level of the sensor is constant. Because you have the same noise

    in a half the voltage, the proportion of the noise is multiplyed by 6db

    Hi Alisterchapman,

    Thank you for your reply. I give more precision but I think that the point 4 speaking over a big color issue is the most important.

    The 8 (10) bit values of the luminance signal (Y) is 16-235 (64-959) if you shoot at 100 IRE and 16-255 (64-1023) if you shoot at

    109 IRE to better use the whole bit depth and thus reduce the banding artifacts. Now what happens exactly if you modify the Gain

    but let the exposure to Auto: in a properly disinged camcorder, nothing happens to the frame, only the noise level changes. For

    ex.: Gain at -6dB = noise reduced by 2, Gain at +6db = noise x 2, but there are side effects. The gain circuitry woks often as

    follow: the pixels of the sensor deliver an analog voltage that is feed to the input of analog amplifier. The gain button acts on

    the gain of this amplifier. Exemple: suppose a sensor capable of delivering max. 1 volt at full illumination, after what the

    signal is clipped. On a black image, this sensor delivers ~0 volts (~ because there is noise). The following stage is an Analog to

    Digital converter (AD) wich converts black (0 volts) to byte values centered on 16 (16 is black and “centered on” because there is

    noise). Assume also that the 0.6 volts sensor signal is converted to the byte value 255. Then, the 0.6 to 1 volt range is the room

    which is reserved to support negative gain values. Examine the following case assuming that the aperture is set to auto and the

    shutter speed is fixed.

    1) You lower the gain (-3db)
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The automatic exposure circuitry opens the diaphragm to admit 3db more light on the sensor wich delivers now 0,6 volts x 1.41253 =

    0,847418 volts. At the same time, the gain of the analog amplifier is reduced by the same proportion. Now black 0 volt is always

    converted to 16 and 0,847418 vots is converted to 255 by the AD circuit. This is OK and the noise is reduched by 3db

    2) You lower the gain (-6db)
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The aperture is open to admit 1.9952 x more light and the gain of the analog amplifier is lowered by the same amount. For this to

    work without an issue, the sensor must be capable of delivering 0.6 x 1.9952 volts = 1.19721 volts but in my example, he is

    saturated at 1 volt (the input stage of the analog amplifier can also be saturated). Your highlights are thus clipped, the camera

    design is bad.

    3) You increase the gain by 6db
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
    The gain of the analog amplifier is increased by 1.9952 and the aperture is closed by the same amount to compensate. The output of

    the sensor is now 0 to 0.3007 volts (= 0.6/1.9952). But the noise level of the sensor is constant. Because you have the same noise

    in a half the voltage, the proportion of the noise is multiplyed by 6db

    The situation is in fact more complicated and it is possible that the clipping will not be present in case 2 if you chose an other

    shutter speed/aperture ratio because this changes the max saturation voltage of the sensor. On the other hand, at high gain values,

    the deep shadows are disolved in the noise of the sensor and the noise of the analog amplifier. What you see in dark shadows is the

    noise modulated by the light of the frame and this cause an over exposure of this deep shadows because the positive brightness peeks

    of the noise are much higher than the shadows. To minimise this issue, the input of the analog amplifier is adapted (little positive

    lift) to clip voltages that are under a certain level. The noise is less visible but the gamma of the shadows is now distorded.

    The gain does not alter the black level which is always black = byte 16 if the Black Level is set at 0 in the menu. The Black Level

    button changes de byte value output by the AD converter that codes for Black but does not alter the quality of the recording. If you

    set it to -15, you record in the 0-255 space, very usefull if the goal is to convert your video to RGB photos, which can be done as

    is in EDIUS wich clips nothing or in Resolve with all the data levels set to FULL. It’s also usefull to increase the very low bit

    depth of a 8 bit camcoder shooting in HDR (grather bit depth to reduce the banding artifacts) but the clip nust then be converted to

    64-1023 in a 10 bit NLE project. Increasing the black level has no sence. If you set it for ex. at +15, you have all your image

    datas above 27 and no any information under 27(on my camcorder), it’s the same as doing a LIFT in Resolve.

    4) Catasrophic clipping issue
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°°
    I just said that you can lossless convert Rec.709 0-255 YCbCr to sRGB. This is in fact not true because the 65536 colors levels that

    can be encoded in full range YUV have noting to see with the 65536 levels that can be encoded in RGB because the encoding math is

    totaly different: the color lavels that are encoded in YUV are not the same as in RGB. This is sadly not know by almost all the

    technical directors. If you think YUV is the same as RGB because they have the same bit depth, you are not right! Only a gray image

    has a direct byte to byte correspondance. It’s simple to fast understand what happens with the YUV coding: if Y=255 and Cb=Cr=128 (8

    bit example), then there is no color and the resulting RGB is 255,255,255. Now, if Y=255 and Cb and/or Cr are not 128, then you have

    the maximum luminance but colored, that will say an RGB value where minimum one color must be higher than 255, wich is not possible

    to encode in RGB. The Edius eyedropper reads the exact RGB values and I have the same result when picking the YUV values in the

    camcorder file and do the conconversion with the YUV to RGB Rec.709 conversion math. It’s so that my Sony has shoot Rec.709

    YCbCr=244, 63, 207 (bright red part in a lava flow) = RGB 365.63!!, 219.75, 126.08. I have very often G or B=290. This values are

    above 1023 in the Resolve RGB parade/histogram/Wave Form. This is a conversion to RGB assuming that my YUV is 16-255 for Y, but if I

    assume it is 16-235, such as interpreded by many NLE’s, then the resulting RGB values are scaled a lot higher due to the conversion

    from 16-235 to RGB 0-255. The YUV coding has more dynamic than RGB in the colors, not in the gray scale, but more banding artifacts.

    Due to the math, the 3 colors of a pixel can not be above 255 at the same time. A program like After Effects has an RGB core and

    clips all the YUV levels at 235 at import time. Then, he scales this clipped signal up to 0-255 what is catastrophic. Resolve

    imports the values as is and the levels above 235 or 255 (depending on the way Resolve is setup) are above 1023 on t

    1. You are making far to many assumptions about exactly how every camera processes the image.

      You should try looking at the actual output of many cameras. 0dB = unity gain, nominally nothing being added to the sensors output. -6dB is not less gain (you can’t have less gain than unity), 6dB is subtracted from the signal after the A to D. As a result the darkest parts of the image are no longer visible. This is easily measurable and this is the way many cameras actually behave.

      Most sensors only have 2 or 3 carefully set analog gain levels. Most gain changes in a video camera are applied after the sensors A to D with just 1 or 2 coarser gain range changes prior to the A to D. Negative gain is almost always applied after the A to D and this is why the blacks end up clipped.

      The maximum values in YCbCr are normally 235,235,235 (or in some cases such as many forms of MPEG 235,240,240). This would be white, but it’s white because when Cb and Cr are 235(240) this means there is no difference between. I don’t understand why you are denoting the CbCr components as having a maximum value of 128, this is incorrect. Generally any chroma subsampling takes the form of less samples rather than reduced bit depth.

      I don’t think you understand how component works. You seem to be forgetting that what Cb and Cr represent is Blue MINUS Luma or Red MINUS luma. They are the DIFFERENCE between Luma and Chroma, Sometimes CbCr are called the “Colour difference components” because they describe how the colour differs from the brightness.

      So if we start with YCbCr at 235,235,235. if you do reduce Y from lets say 235 down to 200, so we have 200,235,235 there would be very little saturation because the difference between the luma and Cb or Cr is only 35 and this can also be represented just the same in RGB as R, G, and B will all be less than 255,255,255. YCbCr does not contain more colour information than RGB, it is simply represented in a manner that more closely resembles human vision and allows the less visually important chroma elements to be recorded with reduced resolution to save bandwidth.

  8. Hi Allsterchapman,

    If have made an error whyle copy/pasting the above post and it needs deletion. I tryed to add the correct version but the site says that “It seems that you have already posted the same”. Please correct the situation.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.