AVS › AVS Forum › Video Components › Home Theater Computers › Color Correction with a HTPC - Simpler solution and now it really works!
New Posts  All Forums:Forum Nav:

Color Correction with a HTPC - Simpler solution and now it really works! - Page 2

post #31 of 462
Thread Starter 
Quote:
Originally Posted by nm88 View Post

Now, if there were some way of automatically adjusting the output independent of software, that would be the ticket.

For that, I think the only solution would be the adoption of an ICC profile at the graphics card driver, kind of the profiles now available, but better. I think that is the only place where you could correct all output images without adding more cpu load. I believe it could also be done at the OS level, but then you would use more cpu...
post #32 of 462
Just to throw an idea out, but how about the colour profiles in Powerstrip? Could this be used/adapted?

BTW, great work yesgrey3. I have both the RS1 and a JVC M15 if you want any testing done?
post #33 of 462
Thread Starter 
Thanks for your suggestion, but currently, the colour profiles in powerstrip work the same way as in the drivers. Each input color channel (R, G, B) only affects the respective output color channel. For performing the color correction considered here, we need that all input color channels affect each output color channel. This is accomplished, mathematically, by a multiplication of the input channels by a 3x3 matrix. Like this:
Code:
[Ro] = [. . .] * [Ri]
[Go] = [. . .] * [Gi]
[Bo] = [. . .] * [Bi]
I could talk with powerstrip developers to see if this kind of functionality could be added, but I think they only use what's already in the graphics card drivers...

About the testing... It would be great if you could post some pictures of images that show the bad colors due to the oversaturated primaries. With and without the color correction applied. This way, we could see if this solution give good results. I think it would be preferable using the RS1, because the M15 is a bit outdated (but still gives a good image! Now with the HD formats, mine has gained a few more hours of life!...)
There is a sticky thread in the LCOS forum about this subject where they have posted some pics with problematic images...
post #34 of 462
Quote:
Originally Posted by yesgrey3 View Post

Thanks for your suggestion, but currently, the colour profiles in powerstrip work the same way as in the drivers. Each input color channel (R, G, B) only affects the respective output color channel. For performing the color correction considered here, we need that all input color channels affect each output color channel. This is accomplished, mathematically, by a multiplication of the input channels by a 3x3 matrix. L

Yesgrey3 is exactly correct here. Many of these profiles are just values for R, G, B.

These are equivalent to a 3x3 DIAGONAL matrix:
Code:
[Ro] = [R 0 0] * [Ri]
[Go] = [0 G 0] * [Gi]
[Bo] = [0 0 B] * [Bi]
The transformation that is really needed, since the color space is a non-orthogonal system
is a transformation by a FULL [ not diagonal ] matrix:
Code:
[Ro] = [Rr Rg Rb] * [Ri]
[Go] = [Gr Gg Gb] * [Gi]
[Bo] = [Br Bg Bb] * [Bi]
Where the capiltalized index gives the output channel and the lower case is the input
channel. The full matrix 3x3 transform spans the space; so it has the most complete
flexibility.
post #35 of 462
Realtime color correction with a 3d lookup table can be performed with OpenGL. Apple describes the process in this technical note.

The example application, ColorWhirled, is no longer included with Xcode. I made an Apple Developer Connection account and downloaded Xcode version 1.0, which does contain it(I opened the archive directly and extracted the example, rather than running the installer and trashing my current Xcode install).

I haven't done any testing(other than verifying it runs on my laptop display, the only thing with me at the moment). The Scarse Project has various ICC profiles available for download. You'd probably be interested in SMPTE-C and HDTV6522. The ipb utility from the Scarse Project should let you generate an ICC profile for your display based on custom primaries if you don't have a colorimeter around, although it would probably be a lot better to use one and get perfect grayscale tracking thrown in for free .

This are other CMS's around(many open source), so it's possible that someone could hack one up with some video player and OpenGL on some other OS.
post #36 of 462
This ffdshow approach is interesting.
To color correct my Plasma I used a free French software HFCR with my colorimeter and the service menu.
The next step is to correct the HTPC output via an ICC profile using the Plasma as monitor. I think this is transparent to the playback software and no CPU processing is required. I have no deep technical knowledge but this changes some sort of lookup table the graphics card uses. This would even bypass some problems in the drivers that show full RGB (0,225) instead of (16,255).

In short if you have the colorimeter, maybe it is better than ffdshow since you have to measure anyway how far off specs the monitor is before changing the parameters in ffdshow.
post #37 of 462
Thread Starter 
I don't know if it will work... according to some ot the posts above, the ICC profile has to be called by all the applications that want to use it. It seems it's not implemented at the drivers level, which would affect all output images.

Let us know if you see any differences with the ICC profile.
post #38 of 462
Quote:
Originally Posted by eagleone View Post

The next step is to correct the HTPC output via an ICC profile using the Plasma as monitor. I think this is transparent to the playback software and no CPU processing is required.

Installing an ICC profile is meaningless unless the software is color managed and makes use of it (e.g., Photoshop).
post #39 of 462
I'm still learning about color management, but this is what I can gather...

Yes, the application must be color managed(usually by some external library, or in some cases, the OS itself) in order to take full advantage of an ICC profile.

On the other hand, many display profiles contain video card lookup tables that will smooth out the response of the entire video output on a system-wide basis. The profile may, for example, state that the monitor has a gamma of 2.2 on all three channels. In practice, this isn't that likely to happen, so a correction table is loaded into the video card from the ICC profile, typically at system startup. These are per-channel(1D) lookup tables. This should have the effect of correcting grayscale tracking(the chromaticity of a gray ramp will be constant, and will have a response(most likely a gamma response) specified in the profile after the correction tables are applied). This may or may not give you a specific white point, depending on how the profile was generated(for example, the correction tables may give you a D65 whitepoint, or they may leave your display at its native whitepoint; all that matters is that your display's whitepoint matches the one in the profile). It's then intended that the color managed application will match the grayscale response, primaries, and possibly whitepoint(depending on rendering intent) to the values recored in the profile. If the application isn't color managed, it will still likely be affected by the video card lookup tables, but will not get the full benefit.

So in short, loading a system wide ICC profile and playing back video might give you corrected grayscale tracking, and could give you a corrected white point. It will not correct for inaccurate primaries or other distortions. If you have a color corrected video player, full color management should become available.

I've never really investigated how color management and TV color decoders get along. It would probably depend on how the ICC profile was generated. I'm not sure what display profiling packages do what, although correcting for a bad color decoder probably takes many more measurement points than would be required for a simple RGB device. It would be more like building a profile for an exotic printer than a typical monitor. Unless your display has perfect color decoding, an RGB input would probably be better. If it has bad color decoding and no RGB input, a very good ICC profile would likely be required.

There seems to be lots of wiggle room from what can be included in an ICC display profile. Some profiles may simply specify a white point, black point, per channel response, primary colorants and a video card lookup table. This seems to work well for standard RGB displays. Others may include a full 3d lookup table between a standard color space and the device color space. This may work better for something with a crazy color decoder.

I don't know too much about the topic, so I'd love it if someone with more experience could chime in!
post #40 of 462
Quote:
Originally Posted by Mikenet View Post

So in short, loading a system wide ICC profile and playing back video might give you corrected grayscale tracking, and could give you a corrected white point. It will not correct for inaccurate primaries or other distortions. If you have a color corrected video player, full color management should become available.

I calibrate my displays for Photoshop for photography work (using a Gretag Macbeth Eye-One v2), but all other software completely ignores the ICC profile. It does nothing at all unless the software is set up to use it.

I wish there were a video player that understood ICC profiles. Trying to calibrate colors using crude hue and saturation controls feels like performing brain surgery with a chainsaw.
post #41 of 462
Quote:
Originally Posted by nm88 View Post

Installing an ICC profile is meaningless unless the software is color managed and makes use of it (e.g., Photoshop).

FYI I have color corrected my LCD monitor with an ICC profile with a colorimeter and the changes are visible even on windows desktop without any other software running. The monitor profile is loaded at startup. I have also used color correction via ICC profile for my secondary CRT monitor.
post #42 of 462
Quote:
Originally Posted by eagleone View Post

FYI I have color corrected my LCD monitor with an ICC profile with a colorimeter and the changes are visible even on windows desktop without any other software running.

Whatever you ran, it might have installed software to alter the display properties on startup (similar to Adobe Gamma), or altered the desktop parameters.

ICM is a Windows API, but the specific software still needs to make use of the API.

For example, I can load Photoshop and just a plain image browser in side-by-side windows, and my photo will look perfect on the Photoshop window and like **** on the other.
post #43 of 462
The changes you see on startup are due to the video card correction table. If you make use of display profiles with such a table, it is assumed the video card is applying them on a system wide level. Some profiles will include these tables, others won't. If the response of the display is recorded exactly in the profile, such correction tables aren't required. But if the recorded response differs from the display(for example, if a perfect gamma is recorded in the profile), such a correction table is needed. Windows does not support loading them on its own, so some 3rd party LUT loader is needed(Adobe Gamma is one such program).

If your display profiling software has the option to meet a target gamma and white point(rather than using the native response of your display), a video card lookup table will be generated. This kind of blurs the line between calibration(generating a lookup table for correction) and profiling(simply recording the device's response, so a full color managed application can translate colors for it). While this isn't full color management, it can get you accurate grayscale tracking and spot on whitepoint. You have to know what you're doing though; you need to make sure your profiling application is calibrating for a specific gamma and whitepoint with the video card correction tables, you need to be sure it's being loaded at startup, and then you should measure some video test patterns to make sure your video player, video drivers, and video card haven't altered the response themselves(there may be interactions due to gamma correction, the the different level ranges used by video and PC displays, etc).

For example, my Macbook Pro here came with a factory ICC profile(I have no idea how accurate it is, but it does make up for some weird non-linearities in the blue channel). MacOS always loads the correction tables if they are present in the current display's profile(you can see this effect by selecting different monitor profiles; the effect takes place immediately). If I load some generic profile without a table, the display just looks wrong, and I can identify a shifting color cast in a gray ramp. If I boot into Windows, I get the same effect, since it doesn't load the tables automatically. I simply copied the ICC profile from MacOS, and load it with xcalib, a free LUT loader for X and Windows. This gives me a gray ramp without color shifts, and makes the display look MUCH better, even though I don't have full color calibration.

There's a shareware program called SuperCal for MacOS that will let you determine your display's response visually. It does the standard solid gray vs line pattern gamma test, but at many selectable points for each channel, rather than the standard method that assumes your display has a smooth gamma curve(almost never the case for non-CRT devices), and that all 3 channels have the same response. It doesn't give anything near real color management, but it does give you decent grayscale tracking(albeit with an unknown white point). I've used it to take an external monitor I use sometimes from horribly unusable(it was a great monitor, but it just looks wrong compared to my laptop display) to acceptable as a second monitor. I've moved the profiles over to Windows too .

So running a LUT loader can give you a corrected grayscale and/or whitepoint, depending on how your profile was constructed. This may be all you need(especially with CRT-based devices). On the other hand, it WILL NOT give you full color correction. The primary color issues that were discussed at the beginning of this thread would not be improved.
post #44 of 462
yesgray3,

I'm trying to test your solution on my display and have gotten ffdshow+avisynth working with stock avisynth.dll (using media player classic) but it crashes using any of your dll's, any suggestions?

edit: chromiticities I am trying to correct are:

R:0.658 0.329
G:0.268 0.659
B:0.148 0.069
W:0.313 0.334
post #45 of 462
Thread Starter 
zoyd,
As I said in my instructions, my dll's are based on Avisynth 2.6, which is currently still in a pre-alpha stage, so it could be very unstable. With some ffdshow settings it could not work. Have you tryed only with the ones I suggested?
With me, I had crashes when I used ffdshow resize and Avisynth's FlipVertical as the first instruction. If I used it as the last instruction it worked ok. Try to disable it or using Avisynth's Resize instead of ffdshow.
If this not works, please tell me your ffdshow settings so I could test it in my PC.

Please tell me the brand, model and type of display you have, so I can update my web page with specific dll's for correcting it.
post #46 of 462
Quote:
Originally Posted by yesgrey3 View Post

zoyd,
As I said in my instructions, my dll's are based on Avisynth 2.6, which is currently still in a pre-alpha stage, so it could be very unstable. With some ffdshow settings it could not work. Have you tryed only with the ones I suggested?

yes, I set it using your screenshots to the same values. It doesn't matter which functions I try in the avisynth box, initially I just used info() to set things up with the 2.5 dll which worked fine. It might be an incompatibility with mpc, I'll see if I can find another player to try it with.

Quote:


Please tell me the brand, model and type of display you have, so I can update my web page with specific dll's for correcting it.

Panasonic TH-42PX600U plasma.


edit: Tried it out with zoom and had the same problem.
post #47 of 462
Thread Starter 
Quote:
Originally Posted by zoyd View Post

yes, I set it using your screenshots to the same values. It doesn't matter which functions I try in the avisynth box, initially I just used info() to set things up with the 2.5 dll which worked fine. It might be an incompatibility with mpc, I'll see if I can find another player to try it with.

I also use mpc and Zoomplayer. It works with both.
Which ffdshow version are you using?
Which Avisynth stable version are you using, 2.5.7?
Which renderer are you using? VMR9, Overlay, Haali?
What are you trying to see? DVD, Xvid, something else?
Which OS? XP, Vista? I only have XP.

Give me more info so I could try to reproduce it with my PC.
post #48 of 462
Thread Starter 
Quote:
Originally Posted by Mikenet View Post

So running a LUT loader can give you a corrected grayscale and/or whitepoint, depending on how your profile was constructed. This may be all you need(especially with CRT-based devices). On the other hand, it WILL NOT give you full color correction. The primary color issues that were discussed at the beginning of this thread would not be improved.

The solution I propose also could correct the display's white point. You just need to supply it's coordinates. See zoyd's display, which have a white point slightly off the D65 (it could be just a measure precision difference). With this solution he could get real accurate colors, because for that not only the primaries should be the same as the source, but also the white point. (but first I need to help him making it work...)

I will edit my first post to add this.
post #49 of 462
For colour correction I would have though you were better off playing with the pixel shaders in media player classic. For example I've simplified the supplied procamp shader to do the matrix calculation, all you need to do is put in the correct values for the transformation you want.

John

Code:
sampler s0 : register(s0);
float4 p0 : register(c0);

static float4x4 r2r =
{
        1.0, 0, 0, 0,
        0.0, 1.0, 0, 0,
        0, 0, 1.0, 0,
        0, 0, 0, 0
};

float4 main(float2 tex : TEXCOORD0) : COLOR
{
        float4 c0 = tex2D(s0, tex);
        c0 = mul(r2r, c0);
        return c0;
}
post #50 of 462
Quote:
Originally Posted by yesgrey3 View Post

I also use mpc and Zoomplayer. It works with both.
Which ffdshow version are you using?
Which Avisynth stable version are you using, 2.5.7?
Which renderer are you using? VMR9, Overlay, Haali?
What are you trying to see? DVD, Xvid, something else?
Which OS? XP, Vista? I only have XP.

Give me more info so I could try to reproduce it with my PC.

-ffdshow build 2007_1017_clsid (I also tried "stable" clsid build)
-Avisynth 2.5.7
-In mpc I tried all the available render options, in zoom I tried overlay mixer and VMR9 windowed.
-Material used was DVD via video_ts folder on computer (dvd drive is broken). I also tried a downloaded mpeg and avi clip.
-windows xp

The error reported is an access violation at address 00000000 which is not too informative. I'm afraid it's something more generic like a conflict with the video card or directshow subsystem. I can try a different computer tomorrow.

thanks for the help!
post #51 of 462
Quote:
Originally Posted by yesgrey3 View Post

The solution I propose also could correct the display's white point. You just need to supply it's coordinates. See zoyd's display, which have a white point slightly off the D65 (it could be just a measure precision difference). With this solution he could get real accurate colors, because for that not only the primaries should be the same as the source, but also the white point. (but first I need to help him making it work...)

I will edit my first post to add this.

The white point is not a problem since I can easily adjust that in my display once the primaries are correct.
post #52 of 462
Thread Starter 
zoid,
Which dvd decoder? I use DScaler5.
Which cpu do you have? Could be my compiler options... I have an E2160.
post #53 of 462
Thread Starter 
JohnAd,
Thank you very much for your contribution! That would be great! I will take a look at it.
One question: the shaders affect the image before any kind of processing in the VMR9 or affect the image after VMR9 processing but before the output to the screen?

This is good because all the processing could be done in the GPU, the downside is that you only could use VMR9...
It's also good because, since there is a toggle option, we can activate/deactivate the color correction in real time and see if it's effect.
post #54 of 462
Quote:
Originally Posted by yesgrey3 View Post

zoid,
Which dvd decoder? I use DScaler5.
Which cpu do you have? Could be my compiler options... I have an E2160.

pentium M 735. I didn't see where you specify a dvd decoder although Dscaler5 is installed. Anyway it happens with other sources too, I tried one .avi clip and got the same error.
post #55 of 462
Thread Starter 
zoid,
Try the method suggested by JohnAd.

-In MPC View->Options->Output select VMR9 Renderless (Keep D3D Fullscreen unchecked)
-Select MPC View->Shader Editor
-Select wave in the drop down list
-Overwrite the code in the top box with this:
Code:
sampler s0 : register(s0);
float4 p0 : register(c0);

static float4x4 r2r =
{
        0.8634, 0.1515, -0.0149, 0,
        -0.0083, 0.9484, 0.0599, 0,
        0.02446, 0.0312, 0.9444, 0,
        0, 0, 0, 0
};

float4 main(float2 tex : TEXCOORD0) : COLOR
{
        float4 c0 = tex2D(s0, tex);
        c0 = mul(r2r, c0);
        return c0;
}
-When viewing go to Play->Shaders and select the wave. In the same menu is the shortcut to toggle the shader On/Off.

Let me know if it works...
post #56 of 462
Quote:
Originally Posted by yesgrey3 View Post

zoid,
Try the method suggested by JohnAd.

-In MPC View->Options->Output select VMR9 Renderless (Keep D3D Fullscreen unchecked)
-Select MPC View->Shader Editor
-Select wave in the drop down list
-Overwrite the code in the top box with this:


-When viewing go to Play->Shaders and select the wave. In the same menu is the shortcut to toggle the shader On/Off.

Let me know if it works...

ok, which version of MPC? I've got the standard 6.4.9.0 but I have seen "patched" versions also. My version will not load any of the shaders and I don't see any D3D fullscreen option to uncheck in the output settings.


nevermind, I needed to download a dll that is not included in the original package.
post #57 of 462
Thread Starter 
I use the MPC Homecinema version. You can download it here.
post #58 of 462
Quote:
Originally Posted by yesgrey3 View Post

I use the MPC Homecinema version. You can download it here.

Thanks, that one works well. I'll fire up my probe tonight and see how well your matrix works.
post #59 of 462
Thread Starter 
Please talk about your results.
It's a little frustrating that anyone has yet talked about it. It gives the idea no one tested it but me...
post #60 of 462
Quote:
Originally Posted by yesgrey3 View Post

Please talk about your results.
It's a little frustrating that anyone has yet talked about it. It gives the idea no one tested it but me...

ok, here are my results:

matrix_off
R G B
x 0.659 0.269 0.148
y 0.329 0.658 0.070
Y14.588 40.490 5.070

matrix_on
R G B
x 0.656 0.275 0.148
y 0.329 0.651 0.070
Y10.693 35.746 4.487

There was a very small shift in the correct direction for the chromaticities and a significant drop in luminance for the RG channels. I played around with manually changing some of the off-diagonal elements of the matrix and I could shift the x,y locations quite a bit so I think this technique will work but the matrix you suggested does not move the primaries far enough.



The X's are with the shader turned off, circles on. It had the largest effect on magenta.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Home Theater Computers
AVS › AVS Forum › Video Components › Home Theater Computers › Color Correction with a HTPC - Simpler solution and now it really works!