Steven Abrams wrote:Eddie Barton wrote:I can show you the math if you'd like.
Yes please!
So I'm just gonna go through the thought and mathematical process I went through to come up with these charts.
I'll start off looking at the metadata of a BMCC DNG. The value we're interested in right now that allows the exposure compensation to happen is BaselineExposure. From the DNG specification, "BaselineExposure specifies by how much (in EV units) to move the zero point." The zero point being the value that middle gray falls at after the DNG data has been linearized and scaled according to the LinearizationTable, WhiteLevel, and BlackLevel (also found in DNG spec). What BaselineExposure does is tell Resolve, ACR, etc. how many stops to push or pull the data by in order to make a middle gray chart exposed at the selected EI give a value of 0.18.
Now the important thing is how we get this value. Okay, now lets assume we've taken our BMCC and shot a perfectly exposed middle gray card. We bring our DNG file into a program that allows us to view the untouched, unlinearized data. We apply our linearization table and scale the data. Now we have our 16b linear values. Let's say that our middle gray chart gives us an average value of 2235 on our 16b scale. And let's say that when we exposed the chart, we set the meter to EI 800 (not exactly important just yet, but will be in a moment).
So, our middle gray is 2235 / 65535. Now we want middle gray to be 0.18 (the rock of this system) to get scene referred linear data. So we set up our function such that we have our target of 0.18 on one side and our known value with some adjustment variable to make the mathematical statement true:
0.18 = (2235 / 65535) * q
Where "q" is our variable that represents the exposure adjustment as a linear multiplier. We find q with some simple algebra and get:
q = 0.18 * (65535 / 2235) ≈ 5.278
Now, to get our multiplier in the unit of photographic stops (EV), we have to take the base-2 logarithm of q.
log2(5.278) ≈ 2.39999 EV ≈ 2.4 EV
Now, if I remember correctly, BaselineExposure in an EI 800 file from the BMCC is 2.4. For EI 400 and 1600 we would expect the values to be 1.4 and 3.4, respectively, because they are one stop differences. To confirm this we do our test again, and we know exposing for a one stop lower ISO means we have twice the light. So our middle gray chart comes up with an average value of around 4470 / 65535. We apply our formula again:
q = 0.18 * (65535 / 4470) ≈ 2.639
If you multiply it by two, you'll see that it is 5.278; so we know we're on the right track. Now we take the base-2 logarithm and get:
log2(2.639) ≈ 1.39999 EV ≈ 1.4 EV
And a similar process would happen for 1600, except we would get half the linear middle gray value to being with, 1118. This would result in the multiplier being double and the EV adjustment value being one stop greater than what we had for 800, as expected.
Of course this only makes sense when you do correct exposure. So, now we know that shooting at EI 200 on the BMCC is effectively the same as shooting EI 800, exposing to the right by two stops, and dropping the "Exposure" slider to -2.00 in Resolve. Now the question posed to us is: "how do these various exposure settings affect our dynamic range distribution?"
Well, we know that BM claims a 13 stop dynamic range for the BMCC. We also know that highlight range is related to the ratio of light between clipping and middle gray. With these two pieces of knowledge, we can come up with distribution for a certain EI. The inverse LUT for BMD Film that BMD includes with Resolve also helps us set our upper limit for highlight range is. Let's return to our middle gray value for EI 800 that we got before, 2235 on a 16b scale. We know that clipping occurs at a linear value of 1.0, or 65535 on a 16b scale. The highlight range is defined as the base-2 logarithm of the ratio between the saturation point (clipping) and the middle gray value. So we get:
log2(65535 / 2235) ≈ 4.874 EV
So why is it not reaching 5 stops like we expected? Well, these calculations don't take highlight reconstruction (HLR) into account. Once HLR has its way with the image, we get linear values above the conventional clipping point of 1.0. This means our highlight range is going to be 5 stops plus a little. So around 5.1 - 5.2 ish. Now, why didn't I put 5.1 or 5.2 as the upper limit on the BMCC chart for 800? This comes from the BMD Film to Linear LUT included in Resolve. What I was looking for was the maximum scene referred linear value that BMD Film could encode before clipping. In other words I want to know what scene reffered linear value corresponds to a BMD Film value of 1.0.
In the 12b LUT we see the maximum value is 5.7661304310. Now we can apply the same formula to find the maximum highlight range BMD Film can store, since it was developed for the native EI.
log2(5.7661304310 / 0.18) ≈ 5.00 EV
And the shadow range must be the difference between the total and the highlight range.
13.0 EV - 5.0 EV = 8.0 EV
So there's our dynamic range distribution for EI 800, and we already proved that exposing for another EI shifts our middle gray point by the expected amount of stops. Since exposing for EI 400 set our middle gray point as twice of what it was at 800, that means we have half the amount of light we can record in the highlights, or one stop less, and twice the amount of light recorded in the shadows, or one stop more. Therefore, lowering the EI shifts the distribution down, and in the case of EI 400, it shifts by one stop, and similar for the opposite direction.
The values for 1600 should show an equal amount of highlight range since BMD Film can't encode that high before clipping, but I decided to put what the reasonable expected value for the raw data would be, 6.0 EV. And that is what you'll see if you test it. And if you try using another color space option via Resolve's color management or the color space plugin they include, you can use BMD Film as the input space and something like Log-C as your output. All of your highlight detail will come back for you to use. There's also the option of using the highlight slider in Resolve; I prefer not to because that causes nonlinearity in the underlying data.
I think I covered everything. If I missed something or if you have any questions, please feel free to ask. I'll answer to the best of my ability.