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. |
12th September 2004, 00:29 | #1 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,370
|
ColorMatrix v2.3
ColorMatrix corrects the colors of mpeg2 streams of dvds. More correctly, those mpeg2 streams are encoded using a different set of coefficients as used by AviSynth's color conversion routines or by the XviD/DivX decoders, with the result that DivX/XviD clips or mpeg2 clips encoded by TMPGEnc/CCE using AviSynth or VirtualDub are displayed with slighty off colors (which looks like a small difference in brightness[*]). This can be checked by opening the mpeg2 stream directly in VDubMod. More info can be found in the readme.
This filter recalculates the yuv values assuming the coefficients which are used by AviSynth/VDub/DivX/XviD, with the consequence that your final encoding (mpeg2 or mpeg4) is displayed correctly. [*] http://forum.doom9.org/showthread.ph...595#post514595 Changelog v2.3 (by tritical), Code:
- Calculate conversion coefficients for PB/PR rows from luma coefficients - Added inputFR and outputFR parameters allowing for YUV range expansion/contraction - Changed the clamp parameter from bool to int to allow specifying only pre clipping or only post clipping or both http://web.missouri.edu/~kes25c/ Last edited by Wilbert; 17th August 2008 at 20:58. |
12th September 2004, 01:31 | #2 | Link |
Registered User
Join Date: Feb 2004
Posts: 156
|
Wilbert, if this filter does indeed perform as you intended it, I would like to express some gratitude for future encodes....
Now should I run limiter() before or after colormatrix() ? Last edited by malkion; 12th September 2004 at 01:33. |
12th September 2004, 11:46 | #3 | Link |
Moderator, Ex(viD)-Mascot
Join Date: Oct 2001
Posts: 2,564
|
I've waited for this a long time! If only I had time right now to try it out...
A heartfelt 'thank you'.
__________________
It's a man's life in Doom9's 52nd MPEG division. "The cat sat on the mat." ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl! |
12th September 2004, 13:44 | #5 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,370
|
Quote:
|
|
12th September 2004, 19:09 | #6 | Link |
Retired AviSynth Dev ;)
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
Made a few (easy) speedups - it should be a couple of times faster now.
Updated source. - Use float instead of double. They have enough precision and are much faster. It can however be changed back by changing the typedef in ColorMatrix.h - Simpler algorithms. - Use internal limiter for output also, instead of very slow if-then. - Better rounding (adding 0.5 for more exact float to int conversion) No SSE/MMX this tim, though.
__________________
Regards, sh0dan // VoxPod |
13th September 2004, 02:44 | #11 | Link |
Registered User
Join Date: Feb 2002
Posts: 1,195
|
very nice work
just by curiosity does it will harm the final output if u apply this filter on HDTV source or on some raw avi input ? ++
__________________
AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec. AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles. |
13th September 2004, 20:24 | #12 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,370
|
Quote:
However, a few of them uses mpeg1 coefficients. You shouldn't apply the filter on those. Quote:
edit: btw, hdtv is YUV [0,255] of course. So you need to use ColorYUV("PC->TV") first. Last edited by Wilbert; 14th September 2004 at 09:17. |
||
3rd October 2004, 12:10 | #13 | Link |
TotalEclipseOfTheBrain
Join Date: Sep 2002
Posts: 347
|
I have a question about colormatrix and speed. I use colormatrix() 1.2 and get the following results
with colormatrix : 16.5 fps without colormatrix : 44.5 fps should such a difference be expected or is there any problem ? My script (source is 720x576) : LoadPlugin("D:\video\avsfilters\yv12\DGDecode.dll") LoadPlugin("D:\video\avsfilters\yv12\colormatrix.dll") mpeg2source("d:\test\test.d2v",idct=6) trim(30000,33000) colormatrix() FuPP |
4th October 2004, 21:02 | #15 | Link |
Registered User
Join Date: Jan 2002
Location: France
Posts: 2,856
|
I added other easy optimisations ( no more float computations, only integer one ). Results *should* be the same as those given by sh0dan's version. It should be almost twice as fast.
http://jourdan.madism.org/~manao/ColorMatrix.zip |
8th October 2004, 17:51 | #20 | Link |
Registered User
Join Date: Jul 2004
Posts: 6
|
How to properly use this filter?
Say if I want to re-encode a DVD to DVD-R for TV playing. I assume I should use YUV and TV scale in DVD2AVI. I can find the original matrix coefficient with GSpot which has following type: I709 = type 1 = MPEG2 default FCC = type 4 = FCC standard I470 = type 5 = MPEG1 default S170 = type 6 = SMPTE 1700M standard S240 = type 7 = SMPTE 240M standard I have some DVDs which has S170 coefficient. Should I use ColorMatrix before converting to ConvertToYUY2 for CCE and ConvertToRGB24 for TMPGE? Some of my encodes are brighter than original. Could it be because I accidentally used RGB PC scale? Last edited by ltc; 8th October 2004 at 17:53. |
Tags |
colormatrix |
Thread Tools | Search this Thread |
Display Modes | |
|
|