Davinci Resolve S-­Log2 Color Correction Workflow

Alright, this will be the first of a series of "international" articles, therefore I'm writing in English. I assume everyone interested in this toplic is capable of reading english. If not, let me know ;)

Overview

  • Best strategy on the A7s is to ETTR
  • Downside: Exposure adjustment needed in post
  • Converting to linear to correct most effective approach

Introduction

Being a software engineer with a big interest in photography, I was always interested how my cameras work internally. My interest in logarithmic tone mapping started while I was working with 5D mark III raw footage via the Magic Lantern hack. After some research in Sony’s S-Log whitepaper I was asking Andrew, the maintainer of MlRawViewer if it was possible to add various log curves, which ended up in a commit.
The goal of this article will be, to show you how you can build a setup around your S-Log footage, which mimics raw converters like “Adobe Camera Raw”. Raw converters operate in linear light, which is the reason why you can adjust exposure after taking a picture.
I’ll explain the (very) technical background why you can do that with log footage in the next section. If you just want to give this a try, you can skip the technical section and go straight to Resolve.

Technical Background

Lets go back to how our cameras work: They are photometric sensors that capture light “as it is”, that means in a linear way. Now light behaves in an exponential way but we as humans experience it in a logarithmic way.
Logarithmic tone mapping formats try to distribute the available bandwidth the way our perception works: Every stop gets a similar amount of code values. Art Adams has a good article about that with great charts for illustration.
An important fact is, that the log formats are not just a bunch of curves, they are mathematical functions which you can invert. This makes it possible to get back to the original “scene referred” linear values, where you can adjust exposure easily.
In case of S-Log, you can find the formula on page 10 in Sony’s whitepaper. S-Log2 uses the same formula, but the 18 % grey value is a bit lower, to gain more headroom for the highlights.
Log formats can also come in different “looks”. C-Log for example is more contrasty, Arri’s Log-C is really flat looking. They are still logarithmic though and can therefore be inverted or manipulated easily!

Now let’s take a (mathematical) deep dive into the topic of video bandwidth. One of the most interesting charts that I came across during my research was this:
chart displaying the code values per stop in S-Log2, S-Log3 and C-Log
With S-Log2 in 8 bit, we are not so far off from C-Log, which is, as mentioned earlier, more contrasty and doesn’t handle as much DR. S-Log2 uses about 28 to 25 code values per stop in the top range, while C-Log uses 35 to 25. As a reference Rec. 709 was designed to hold 6-7 stops of DR , which comes down to 36 to 42 code values.
This explains why the footage still looks very good and banding is only visible if you push it really hard. So combining all this and by looking at the waveform after the grading, you will notice, that we discard about 25 to 33 % of the 8 bit bandwidth by having the luxury of much more DR. But no worries, mathematically we still have a 7.5 bits left to play with (2^7.5 = 181), due to the log encoding.

The thing that is odd though, is, that Sony puts 18 % grey at -6 EV in their S-Log2 cameras. If you dig into raw files from stills cameras, you will see that mid grey is usually at -4 EV! Seems they really want to protect their highlights…
IMHO this is the reason why exposing the A7s at +2 is so popular and leads to great results. In other words, the A7s actually has a native ISO of 800, but they had to make it 3200 to comply with their S-Log2 standard.
chart showing dynamic range of S-Log2 vs S-Log3

Now the technician in me immediately says: “I want to put as much information as possible, into the stops right before clipping”. This is basically ETTR (expose to the right) but needs many adjustments in post. That’s why I usually stick with the “meter at ISO800” method.

But how do you correct the exposure efficiently in post?

Setting up Resolve

image showing the basic node structure in ResolveResolve VFX Luts


To color correct S-Log2 footage, I’ve come up with the following node structure, which follows the idea of the ACES workflow:

  1. S-Log2 => Linear LUT
  2. Exposure / WB correction
  3. Color Profile
  4. Linear => S-Log2 LUT
  5. S-Log2 => Rec709 LUT
  6. Knee to Simulate Sony’s Rec709-800 curve

If you’ve set it up like this, what do you do now? Well exposure adjustments in linear light are nothing more than multiplications. That means, you just need to select your exposure node and hit the “Gain” slider. If you want to change your footage 1 stop, you just have to double/half the values. That means a gain of 2 or 0.5.
Half and third stops are more tricky but you just need to calculate the square or cubic root of 2. I’ve done that for you and here are the values:

  • Half stop increment 1.414 or 0,707
  • Thrid stop increment 1.26 or 0,794

Exporting LUTs

export LUT

If you are working primarily in an editor and don’t want to round-trip to Resolve, you can build your own exposure compensation LUTs with Resolve. Just right-click on the thumbnail of the footage and select “Generate 3D LUT”. With a set of 1/3 stop LUTs you should be able to make quick and accurate adjustments in your editor.

Examples

S-Log2 uncorrected
PP7, S-Log2 with “color mode” Movie 

S-Log2 corrected
Corrected image with Rec709-800 curve.

Waveform before
Waveform after
Waveform before and after, to show how much bandwith is discarded / how much the values are stretched.

Did you like the article? Do you have questions or feedback?
Let me know via Facebook!