Monday, June 20, 2005

Tweaking Gamma on My Samsung DLP, Part II

In Tweaking Gamma on My Samsung DLP, Part I, I discussed changing the GAMMA parameter in the service-mode menu of my Samsung 61" DLP rear-projection TV. This in turn was based on my general discussion of (shall I call it) the gamma "concept" in HDTV Quirks, Part II, Gamma. Now I'd like to extend my earlier remarks to show why gamma in practice is much more complex than anything I've said thus far.

As a concept, gamma ought to be renamed "contrast tailoring," or, better still, "luminance tailoring." Once you've set the "black level" at which your TV reproduces a minimum-luminance 0-IRE input signal, and once, by means of the contrast control, you've set the "peak brightness" used for a maximum-luminance 100-IRE signal, the question becomes: at what levels will the TV reproduce all the various shades of gray in between?

Gamma is nominally the greater-than-1.0 exponent in a simple input-voltage-to-output-luminance function which determines the TV's response to various IRE levels, its "shades of gray" as it were:

(output luminance) = (input voltage)gamma

And that is what gamma is, on an old-fashioned "picture tube" — a CRT-based TV — with no digital circuitry.

But today's fancy TVs have digital circuitry. Whether they be plasma panels, LCDs, DLPs — or even CRT-based HDTVs, nowadays — they don't content themselves with such simple gamma functions as that one. They use their digital circuits to alter the "gamma curve" and thereby to custom-tailor the luminance response of their screens.

Boiling that down: any two pixels in a digital video image have discrete luminance (or Y) values. These can be stated either as volts or in IRE units between 0 IRE and 100 IRE. Let's say Pixel #1 has 20-IRE luminance, and Pixel #2 has 40-IRE luminance. How bright will the pixels appear to be on the screen, relative to one another and also to the 0-IRE and 100-IRE extremes?

We can ask the same sort of question when the two pixels are at, say, 70 IRE and 80 IRE, or at 45 IRE and 60 IRE. In fact, any two pixel luminance levels could be arbitrarily selected: 5 IRE and 95 IRE; 50 IRE and 51 IRE, etc. How such broad or subtle contrast gradations would be rendered on a TV screen was in the good old days mainly a function of one simple exponent called gamma. Now they're more likely a function of complex luminance tailoring.


When it comes to Samsung displays like my own, luminance tailoring is done in part by a digital circuit or chip called DNIe™. DNIe ("Digital Natural Image engine") is Samsung's elaborate melange of digital video signal processing algorithms. DNIe throws "multiple optimizers and enhancers" at the input signal, one of which is its vaunted "contrast enhancer."

The "Compare DNIe with Conventional" portion of the Samsung online presentation about DNIe which you can find here shows a simplified graph which seems to imply that the gamma curve selected via the service menu GAMMA parameter is intentionally "bent" by DNIe (unless, of course, the DNIe function is turned off in the user menu). According to the graph, light output is reduced at the lower IRE levels. At (let's say) 50 IRE, light output returns to "normal." Then at higher IRE levels light output is increased.

My interpretation: a 20-IRE signal is lowered to have a luminance output of maybe what a 10-IRE signal would ordinarily have. Meanwhile, 80-IRE output is boosted to the level of perhaps 90 IRE. This exaggerates highlights and compresses lowlights in the picture, and gives the picture more "snap."


DNIe also changes measurable gamma, at least insofar as gamma can be gauged by means of the Avia gamma chart, one of the test patterns provided on that handy setup-assist DVD. This chart juxtaposes a range of gray swatches of different IRE values against a background of fine black and white horizontal lines. When you squint, the lines merge into a level of gray, and you simply decide which gray swatch matches it in brightness. Then you read off the gamma value printed over the swatch.

With an old-style tube-type TV, that tells you the gamma of the picture tube ... which is all you really need to know.

With modern "digital" TVs, though, think again. When digital video processing makes the TV's "gamma curve" adhere to something other than the simple formula shown above, it's not quite clear what you're actually measuring with the Avia chart.


Be that as it may, I find I can make this Avia test pattern do some interesting "tricks" by tweaking various user adjustments on my Samsung DLP. What's more, the chart does more tricks when DNIe is on than when DNIe is off. In fact, Avia reports much higher gamma when DNIe is on than when it is off.

First of all, gamma as measured by the Avia chart goes up when the user brightness setting is lowered — and this is so whether or not DNIe is on. On a "regular" CRT, changes in brightness make no difference to gamma.

Next, lowering the user contrast setting increases Avia-measured gamma. CRT gammas don't change with altered contrast-control settings. This oddity likewise occurs independently of whether DNIe is on or off.

If and only if DNIe is on, increasing the user sharpness control on the Samsung causes Avia-measured gamma to go up a tad. Decreasing sharpness lowers measured gamma somewhat. (The sharpness control does not affect the dedicated Avia sharpness pattern, however, since it doesn't visibly increase the detail of the picture. Not does it affect measured gamma at all when DNIe is off. Go figure.)

All of the above applies to all of the Samsung's inputs — composite video, S-video, component video — except DVI. For its DVI input alone, one apparently can't turn off DNIe ... and so I find that Avia-measurable gamma changes not only with brightness and contrast adjustments, but also with sharpness tweaks in DVI mode.


I hasten to emphasize that it's not really clear what meaning, if any, Avia-measured gamma has under such circumstances. When the input-voltage-to-output-luminance function is not a simple curve with a single exponent called gamma, all bets are off. In a "digital" TV, the "gamma curve" is really a lookup table (or tables) used to translate any given input luminance value into an associated output luminance. Such an ersatz, table-based "gamma curve" may have all sorts of oddities which the designers of the Avia chart never envisioned.

Still and all, it's obvious that changes to user brightness, user contrast, and (with DNIe on) user sharpness do something to the way the Samsung tailors its contrast or luminance response. (And, by the way, changes to user color and tint controls have no such side effects.)

That means, for example, that when I go into the service menu and changed GAMMA 4, the factory setting, to what I imagine is a "higher" true-gamma value associated with GAMMA 5, then when I compensate for the change somewhat by increasing user brightness above the middle, or 50, position which I use with GAMMA 4, the increased brightness setting may lower overall gamma back closer to what it had been before.

If I go ahead and change contrast and/or sharpness, too — assuming DNIe is on — I now know that that will affect measurable gamma, too. Or, as I'd rather put it now, it will alter the way my TV tailors its contrast or luminance response.

It's all quite perplexing and bewildering, isn't it?

Furthermore, it makes me wonder about all those enthusiasts who post to various forums how they swear by GAMMA 0, or GAMMA 5, or GAMMA whatever, for Samsung DLPs. Well, what type of input connections were they using? What were the contrast, brightness, and sharpness settings? Was DNIe on? Though they don't affect Avia-measurable gamma, what color and tint settings were in use?


It gets even weirder. After much futzing around with service-menu GAMMA and the various user-menu settings, both with DNIe on and with DNIe off, I find I have something important to add to the above. I'm totally lost!

>Well, not quite lost, but close to it. The problem is that changing GAMMA also changes the overall brightness or dimness of the picture. I'm not just talking about those parts of the picture at relatively low IRE levels. I'm talking about the whole picture, from video black at 0 IRE right on up to 100-IRE peak white.

That's not "supposed" to happen. Changing the "true gamma" exponent of a TV's luminance-response curve is supposed to revise the extent to which the curve bends or sags at luminance levels between 0 IRE and 100 IRE. It's supposed to leave the TV's light output levels at those two endpoints of the luminance-response curve alone.

In reality, on a digital TV like my Samsung, that's not what happens.

The effect of altered GAMMA on light output at 0 IRE is slight, thank goodness. But the effect at the peak-white, 100-IRE level is pronounced. In general, changing to a service-menu GAMMA setting that gives a higher Avia-measured gamma reading lowers peak-white output. Changing to a service-menu GAMMA setting that gives a lower Avia-measured gamma reading raises peak-white output.

Thus, GAMMA 4 has a relatively low Avia gamma reading and a relatively high peak-white output. Changing to GAMMA 2 with it's increased Avia gamma reading reduces the TV's peak-white luminance output. It also reduces its luminance output across the entire tonal scale from 0 IRE on up. That's why the picture gets so much dimmer overall.


There is a way to counter that source of added confusion. I haven't tried it yet on a systematic basis, but I have fiddled with it briefly. In the service menu along with GAMMA are two settings that control the TV's "sub-brightness" and "sub-contrast." In theory, when I change GAMMA, I could also change S_BR(DDP) (for "sub-brightness") and S_CT(DDP) (for "sub-contrast").

Sub-brightness and sub-contrast do in the service menu roughly what the "main" brighntess and contrast controls in the user menu do. Respectively, they set black level and peak-white level (as "gain"). Once black level is anchored aright via main or sub-brightness, raising and lowering 100-IRE peak white via main or sub-contrast pulls all intermediate luminance levels up and down proportionately.

The main and sub- controls interact with one another, naturally. If you raise sub-contrast, for example, you can if you choose offset that by lowering main contrast. (But you do the former in the service menu; the latter is a user-menu function that cannot be accessed from the service menu.)

I gather that, just as you cannot raise main contrast above 100, there is some numeric value beyond which you cannot raise sub-contrast. I believe the top value may be 512, but I'm not sure of this. It may not matter, actually, because there is bound to be a practical top limit to peak-white output that you run into before reaching the theoretical limit.

This is because the "light engine" in a DLP-based TV can produce only so much light. Furthermore, the spectral composition of the illumination shed by the TV's internal lamp will dictate that pushing light output up too high will unbalance the TV's high-IRE grayscale, as one primary color (red, green, or blue) "runs out of steam" before the others do. So all I would really hope to do would be to recover the peak-white output sacrificed by changing to (say) GAMMA 2.


I may try that. Then again, I may not. Yesterday I experimented with setting GAMMA back to its factory value, 4, turning out the lights, and watching the Samsung in near-total darkness. Again, I was watching Vertigo ... it helps to be watching something you're so familiar with, you can't get distracted by the plot. This time I was watching it on DVD, since I was trying to calibrate my user settings with the Avia disc.

After twiddling with contrast, brightness, sharpness, and color settings (tint is unavailable on a component video input such as I use from my DVD player) I came to certain conclusions.

One, it's pretty easy to set the TV's color intensity by eyeball alone, Avia be damned. The point, after all, is to please the eye, not some engineer's notion of "correct."

Two, things look much beter with DNIe on than with it off. It makes "specular highlights" in the scene jump out at you in a way I consider comparable to those in the theatrically projected film I recently saw, Ladies in Lavender. It also enhances detail and visual sharpness in a mostly unobtrusive way, though it can sometimes make vertical (and horizontal?) edges a tad too "hard." And it makes colors somewhat more vivid, but not garish.

Three, the Samsung's sharpness control does nothing at all. With DNIe on, it made no difference to anything I could detect with my eye ... much less gamma per se. That it changes Avia-measured gamma remains something of a mystery, for it does nada to shadow detail in an actual picture.

Four, the absence of a component-video tint control on the TV presents no problem whatever.

Five, getting the brightness control set just right is extremely important. I find the Avia test patterns inadequate for this, for some reason. It's easier to have my DVD player "pillarbox" a 4:3 DVD that contains a "letterboxed" widescreen image — à la Vertigo. Then I find a place in the movie where there is a complete fade to black, and I hit pause to freeze it on the screen. Finally, I adjust the set's brightness until the inset 4:3 "black" frame just blends into the level of the black pillarboxes on the screen. At this point, when I resume playing the movie, the letterboxing bars above and below the actual image cannot be distinguished from the pillarbox bars at its sides. This procedure is extremely easy to do exactly right when I am watching the TV in near-total darkness.

Six, the contrast control can be set at its maximum value, 100 ... or it can be reduced somewhat if bright scenes hurt the eyes.

Doing the above results in what I think is a very good, quite cinema-like picture using the nominal GAMMA 4 setting in the service menu.


Since I wrote the above, I've decided to try GAMMA 0 with boosted service-menu sub-contrast ... and it seems to be giving me the best picture yet.

The rap against GAMMA 0 before was that it dims the picture, overall, even as it raises "true gamma." This was because it lowers the level at which the Samsung TV displays a peak-white, 100-IRE signal, thereby reducing luminance output at all other levels, too.

Raising sub-contrast — called S_CT(DDP) in the service menu — offsets that. I raised sub-contrast to 150, the point at which further increases seem to have no effect. It was at 115 for 480p component video input, 102 for DVI input, since some time ago I raised the two values from their respective "factory" settings of 90 and 82.

So raising sub-contrast to its effective maximum restored the "snap" or "punch" to a GAMMA 0 picture.

What is the "true gamma" of GAMMA 0? It's hard to say, since it's not clear that the Avia Gamma chart reports true gamma for this TV (see above). I can say that toggling among the various GAMMA settings while in the service menu reveals that they do affect Avia-reported gamma.

Remember that when the service mode is active, you are effectively using the TV's Dynamic user preset mode with DNIe on. Given that, GAMMA 0 gives the highest Avia gamma reading, followed by (in descending order) GAMMA 2, GAMMA 1, GAMMA 5, GAMMA 4 (the "factory" setting, giving the set's lowest true gamma over 1.0) ... and, bringing up the rear, GAMMA 3, which I believe implements a true gamma of 1.0.

When I exit the service menu and go back to user mode, GAMMA 0 registers at 1.8 on the Avia gamma chart with DNIe off, 2.8 with it on. These measurements were taken after I had changed away from Dynamic into the Custom preset, set the user contrast control at its maximum of 100 (where it already was), and set user brightness up to about 58 out of 100. The lower (50) brightness of Dynamic mode gives higher Avia gamma readings.

Because user contrast, user brightness, and the enabling/disabling of DNIe change the Avia gamma readings, I imagine the actual readings are unreliable with this TV. Still, I think the direction in which the readings move as service-menu GAMMA is changed are meaningful. I therefore feel safe in concluding that the factory GAMMA 4 setting gives a true gamma much lower than most experts would consider "correct." I imagine moving from GAMMA 4 to 5, then to 1, then to 2, and finally to 0 successively raises true gamma step by step. I'm thinking that GAMMA 0 gets you nearest of all to the "industry standard."

I say that bearing in mind that the TV's luminance response, especially with DNIe on, manifestly distorts what I assume to be an underlying true-gamma curve, à la:

(output luminance) = (input voltage)gamma

There's no other way to explain why user contrast and brightness settings, not to mention toggling DNIe, alter the Avia gamma reading. A distorted underlying curve does not, however, mean that there's no underlying curve at all. Changing GAMMA in the service menu does in fact change the gamma exponent of the underlying curve — that's something I'm taking on faith.

Changing from GAMMA 4 to GAMMA 0 accordingly raises underlying gamma. When sub-contrast is boosted to compensate for the overall dimming of the picture, the result is a picture with deeper shadows ... though it has just as much shadow detail, if user brightness is set properly.


Is there a downside? And why doesn't Samsung set the TV up this way to begin with? These are questions I can't answer definitively. But I'll try anyway ...

Why doesn't Samsung set the TV up this way to begin with? Maybe the "too low" factory gamma choice is intended to open up shadow detail in brightly lit video stores where customers' eye pupils are contracted against all the high-wattage fluorescent lighting. Or something.

As for a technically compelling downside to what I've done, I haven't found one yet. You might wonder (I did) whether boosting sub-contrast so high "crushes" near-peak whites. The relevant Avia test patterns say no. You might also wonder whether it tints the grayscale, particularly in the high-IRE range near peak white. Again, the relevant Avia test patterns say no.

Does it boost video noise? No, not that I can see.

Does it have any negative side effect whatsoever on the picture? I haven't found one as yet. But, as usual, stay tuned.

***

After all that, I just looked at the Star Wars I: The Phantom Menace DVD ... and hopped right back to GAMMA 4.

All the diddling and twiddling I described above seems to have optimized gamma for a dark room, at night, with no outside or inside illumination. Only trouble is, I was just watching the Star Wars DVD in the afternoon, with lots of light coming in through the windows.

GAMMA 0, with its relatively high "true gamma," wasn't cutting it. Too much of what George Lucas put on the screen was getting lost in shadow. My pupil-contracted eyes couldn't see it.

So I went back into the service menu and summoned up the original factory gamma setting, GAMMA 4. At the same time, I left sub-contrast effectively maxed out at 150. Then I exited the service menu and watched Star Wars I in Dynamic mode, with color saturation set significantly higher than Avia says it ought to be.

Dy-no-mite!

Then I made things even better by tweaking the user sharpness setting down from 57 or whatever to 20. Yes ... sharpness, that user-menu control I said before had no visible effect! Turns out it does: a subtle one which tones down the "busyness" that appears at sharp edges when DNIe is on and the sharpness control is set fairly high.

I noticed this "busyness" on the ultra-bright scenes in which Qui-Gon Jinn (Liam Neeson) and company have landed on Tatooine and are walking across the arid landscape toward the city. Their figures as set against the backdrop of the sky had "busy" outlines, possibly related in part to the "edge enhancement" that has been applied to the image on DVD. Phooey on that, I said, and bethought me to try lowering sharpness to get rid of it. I set sharpness at 0, and the "busyness" miraculously disappeared!

The picture even looked a little too soft at that point, so I boosted sharpness back up to 20. The result was about as perfect an image as you could get from a DVD. The pod race sequence looked fantastic.


So. I seem to be proving (at least, to myself) that the true gamma which the textbooks say is "right" — the one associated with GAMMA 0 is pretty close to it — is indeed right for a darkened viewing environment. But GAMMA 4 is right for a sunlit room.

Notably, my Samsung DLP-based rear-projector's Achilles' heel is its relatively high minimum black level. A 0-IRE signal can't produce a truly black screen, only dark gray. This has to do with how the DLP light engine works. White light from an internal lamp bounces off an array of ultra-tiny "micromirrors." Each micromirror swivels independently of the others. The amount of swivel determines the brightness of the pixel associated with any given micromirror. The reflected light passes through a translucent color wheel which spins super-fast. It's red, green, and blue segments color in the image.

Now, if the micromirrors could swivel enough off-axis — which they can't — they might in theory reflect no light whatever, and the image could become truly black. In the real world, some light does bounce off the mirrors and through the color wheel, even for a 0-IRE signal. Plus, the light that hits the swiveled mirrors and doesn't pass through the color wheel scatters, some of it, within the housing of the TV and winds up passing through the viewing screen anyway. That's another reason the screen can't go fully black.

As a result, watching my Samsung DLP RPTV in a fully darkened room shows up its poor-black-level Achilles' heel to an extent not evident when there is a goodly amount of ambient light. With a lot of light elsewhere in the viewing environment, the eye adapts in such a way as to reduce its sensitivity to the small amount of light leakage the TV exhibits with a 0-IRE signal.

In other words, a DLP-based HDTV such as my Samsung doesn't really "want" to be watched in the dark. That may be the real reason why Samsung uses a factory setting, GAMMA 4, whose "true gamma" is unconscionably low. It's as if Samsung is saying, "Forget the old-style rule that TVs ought to be viewed in a dim-lit room. Forget the fact that 'home theater' demands near-total darkness. This TV is for light, airy, multipurpose environments. This TV wants to produce a super-bright, retina-searing, maximully colorful image ... one we think will thrill most consumers, textbooks be damned."

1 comment:

Sean said...

Hey... I have an HLT5689S LED DLP. I've been struggling with the gamma/brighness/contrast dilemma myself. I find the whites are "blown out". When I put a gray scale test pattern up, the three white blocks to the right all look the same. I am going to try your suggestions to see how they work out. You might want to search over at avsforums.com for a service menu setting called db aperture. Good luck!