Some headroom test results
Just as a matter of curiosity, I did some very simplistic tests to look a little into the matter of the "headroom" of the raw output compared to the headroom of the JPEG output in my EOS 20D.
I used an admittedly special case (one that makes analysis simple, of course): a frame-filling uniformly-illuminated "uniform" reflectance neutral target (gray card). (We'll see later why I put "uniform" in quotes!)
The illumination was from a constellation of three flash units, at fixed output. I did a custom white balance with the setup and used CWB in the camera (pertains only to the JPEG output, of course).
I took exposures at different apertures at 1/3 stop spacing and for each, looked at the RGB values of the JPEG output (in my editor) and the values of the r, g1, and b channels of the raw output (with IRIS).
An interesting "point on the curve" was where the RGB values, averaged over a central part of the image, were 253/253/253. The histogram peaks were fairly broad (owing to the fact that the test target was not quite of uniform reflectance, having a noticeably mottled surface). The histogram showed that 17.6% of all pixels were above RGB 254/254/254 (and thus could be considered clipped) In terms of the JPEG output, this is really pretty "exposed to the right".
For the raw output, I was not able to conveniently get an average value but only a histogram per channel (r, g1, and b). Again, the peaks were of significant width.
The centers of the peaks of the histograms for the three raw channels (on a 4095-unit maximum scale, presumably with black at about 128 units) were at approximately:
r: 1900
g1: 3800 [but see below]
b: 2600
But a noticeable part of the upper skirt of the g1 channel peak would have been above 4095, and thus those pixel values were clipped to that level. So, for this particular uninteresting object, that exposure resulted in a little clipping of (the green component of) its highlight detail (such as it was).
Overall, for this particular contrived setup, "when the JPEG output was just out of headroom, the raw output was just out of headroom.
Now, in another test shot, 1/3 stop lower in exposure, the RGB averages were 244/244/244,with only 0.3% of the pixels above 253 (essentially no clipping). Then, for the raw output, the peaks of the channel histograms were at approximately:
r: 1500
g1: 2800
b: 2000
again, with essentially no clipping.
(Note that these are consistent, between the two tests, with the raw values being essentially linear with photometric exposure.)
Of course, all the relationships in the camera are so complicated that it is difficult to reliably extrapolate these findings, taken for an unrealistic, idealized situation, into cases involving real scenes.
Therefore, I emphasize that although these "idealized situation" tests give some useful insights into this matter, we cannot (necessarily) from these results develop any policies governing exposure planning for real scenes. It does, however, raise some questions about the notion that "in the raw context, there is significantly more headroom than in the JPEG context."
Best regards,
Doug