Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Hardware & Software > Software players

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 23rd December 2008, 17:38   #1  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,647
FAQ: How to correct luminance levels

Wrong levels is a common playback problem. It is a subject that gets discussed over and over again. The purpose of this topic is to centralize the collective knowledge of the Doom9 community regarding this subject. Everyone please share you knowledge. I'll update the information below to include your wisdom.


What are luminance levels?

Digital video is typically encoded in a YUV format. YUV is a family of color spaces (YV12, YUY2, etc), that encode color information (chroma) separately from brightness information (luma).

There are two standards for the encoding of luma. For standard-definition TV the standard is BT.601. For high-definition TV the standard is BT.709.

Luma values fall in a range. Unfortunately this range is not always the same. There are two commonly used ranges: 0-255 (aka PC levels) and 16-235 (aka TV levels).

When converting a YUV colorspace to RGB, the correct standard (BT.601 or BT.709) must be used and the correct range (TV or PC levels) must be used.

The above is not always done correctly. It can go wrong with certain combinations of video renderers, video resolutions, and graphics driver settings.

How can I see if the level is wrong?

The video looks washed out and the colors are not vivid. Black is displayed as dark gray. White is displayed as light gray.

The opposite is also possible, but more rare. In that case dark colors are displayed too dark, and light colors are displayed too bright.

Which combinations give wrong levels?

Many factors play a role, so it is not possible to give a list of combinations that always gives wrong levels for everyone. In general, just trust your eyes.

Levels are usually wrong when using the VMR-9 or EVR CP renderers. For most people only when playing low resolution videos.

How can I correct the levels?

The methods below assume that you are outputting the video to a PC monitor or LCD TV, meaning a device that needs full range luminance (0-255). If you are using a CRT TV, then read the comments at methods 2 and 3.

Method #1: Adjusting graphics driver settings

NVIDIA

Since version 177.84, the NVIDIA drivers have an option for configuring the luma range.

You can find the option here:
NVIDIA Control Panel -> Video & Television -> Adjust video color settings -> Select "With the NVIDIA settings" -> Advanced tab -> Set Dynamic Range to "Full (0-255)".

screenshot

ATI

The ATI driver requires a Registry tweak. With the tweak applied, the driver will convert TV levels to PC levels for SD resolution video. It already does that by default for HD video.

Several ATI driver tweaks can be found here:
http://www.avsforum.com/avs-vb/showp...postcount=2011
Te UseBT601CSC setting is the one related to luminance levels.

Note: the tweak only works with driver version 9.1 and older. ATI removed it in 9.2 and newer.

Method #2: Convert to RGB32 with ffdshow

Forcing ffdshow to output RGB32 can help prevent luminance level issues. Downside of this method is that doing this conversion in software increases CPU usage.

To force RGB32 output in ffdshow, you should uncheck all colorspaces except RGB32 on the Output page in ffdshow configuration. It is also recommended to enable "High quality YV12 to RGB conversion".
There are additional options on the RGB conversion page. Recent versions of ffdshow will automatically use the correct settings, so you don't need to worry about them.

If you are outputting to a CRT TV or projector (or any other device that expects TV levels as input), then you need to adjust the setting under Output levels on the RGB conversion page. It is configured by default to output to a computer monitor. LCD TVs usually expect PC levels, just like a computer monitor. Some TVs have an option to choose between Full and Reduced range.

Tip: the Profiles/Presets feature in ffdshow can be used to create different sets of settings. You can even auto-load profiles based on conditions like resolution of video format. You could for example create a profile specifically for HD resolution video, and use the 'standard' profile for low resolution videos.

Method #3: Levels filter in ffdshow video decoder

ffdshow has a special filter for adjusting (luminance) levels. To correct wrong luminance levels for a PC monitor or LCD TV you usually need to convert to PC levels. To correct wrong levels for a CRT TV, you usually need to convert to TV levels.

To convert from TV levels to PC levels use 16-235 as input range and 0-255 as output range. To convert from PC levels to TV levels use 0-255 as input range and 16-235 as output range.

Method #4: Pixelshader in Media Player Classic

A pixelshader is a small program that runs on your graphics card and processes some graphic data. In this case each frame of your video.

Media Player Classic has a special pixelshader called "16-235 -> 0-255" for converting TV levels to PC levels. This shader only adjusts luma values.

There also is a shader called "BT.601 -> BT.709". That one adjusts chroma values.

Some requirements for the pixelshaders in MPC:
- You need to use a compatible video renderer: VMR-7 (renderless), VMR-9 (renderless), or EVR Custom Presenter.
- Surface setting must be set to "3D surfaces".
- It requires some DirectX components that are not included with a default Windows installation. Run the DirectX Web Installer to get the required DirectX updates.

Method #5: Use AviSynth script in ffdshow video decoder

Adjusting levels or conversion to RGB32 can also be done though an AviSynth script in ffdshow. This is for advanced users. Seach the AviSynth subforum if you want to learn more about writing AviSynth scripts.

Method #6: Monitor settings

Some monitors can be calibrated to assume a certain luminance level as input.

Method #7: Resize in software

If wrong levels occur only with SD video resolutions and not with high resolutions, then another solution would be to resize the video in software. For example ffdshow can be used for resizing the video.

Test files

Here are some nice test clips to test your setup:
Test clips
(thanks to littleD for making them)

Some more advanced test clips can be found here:
http://www.avsforum.com/avs-vb/showthread.php?t=948496
(get the MP4 ones)
__________________
MPC-HC 2.2.1

Last edited by clsid; 6th July 2009 at 18:39.
clsid is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.