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

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th September 2008, 12:42   #21  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
well from my tests with the 720p red credits, converttorgb32/rgb32hq look identical.

even the CRC32 sum is identical.

you said you have some DVD that looks better with AVS than with ffdshow, and you would be willing to make a sample ?

Last edited by pitch.fr; 17th September 2008 at 12:58.
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 13:30   #22  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
well from my tests with the 720p red credits, converttorgb32/rgb32hq look identical.
I thought you wanted to compare those two with my pixel shader? That's what I meant when I was wondering what was keeping you from doing it...
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 17th September 2008, 14:29   #23  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
well I do

any chance for that sample please ?
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 14:49   #24  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
well I do

any chance for that sample please ?
Anything with big red letters on a black background should do - in my case it was the big fat "WARNING" message at the beginning of the UK DVDs for "Terminator: Sarah Connor Chronicles" season one - which I've lent to a friend so I won't get them back before Friday...

As for testing the shader while I threw it together I just fired up GIMP, created an 800x600 image of big honking red letters (and a few small ones) on a black background, imported that image into AviSynth and turned it into a 10 second 25fps video, encoded it to XviD via VirtualDub and played the result in MPC-HC - I'll post that video when I get home.

But yeah, doing a "ConvertToRGB32()" via the AviSynth filter in ffdshow-tryouts beta 5 looked better while doing the RGB32HQ conversion still looked blocky - I'll re-test that when I get home.
__________________
now playing: [artist] - [track] ([album])

Last edited by Leak; 17th September 2008 at 14:52.
Leak is offline   Reply With Quote
Old 17th September 2008, 15:13   #25  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
OK, this is LSF + ConvertToRGB32(matrix="rec709") :



now LSF + ffdshow RGB32HQ BT.709 "standard" :



right off the bat, you can see that they don't use the same levels mapping ?
god knows which does it the "proper" way ?! ffdshow does look better

this is LSF + Ulevels(tv2pc) + ConvertToRGB32(matrix="PC.709") :



now LSF + Ulevels(tv2pc) + ffdshow RGB32(BT.709 full range) :



they look identical this time, but each time ConvertToRGB32 yields 10% bigger PNG files...
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 15:19   #26  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
OK, this is LSF + ConvertToRGB32(matrix="rec709") :
now LSF + ffdshow RGB32HQ BT.709 "standard" :

right off the bat, you can see that they don't use the same levels mapping ?
god knows which does it the "proper" way ?! ffdshow does look better
No offense, but other than a slight difference in levels they look exactly identical to me - and I couldn't care less about that, to be honest...

Also, I thought this thread was about pixelated/blocky chroma upsampling?
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 17th September 2008, 15:28   #27  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
Quote:
Originally Posted by Leak View Post
No offense, but other than a slight difference in levels they look exactly identical to me - and I couldn't care less about that, to be honest...

Also, I thought this thread was about pixelated/blocky chroma upsampling?
well yeah, there's a level difference.....which one does it right ? ffd or AVS ?

well I ran a compare on the red stuff :

ConvertToRGB32 rec709 :



ffdshow RGB32HQ BT709 standard :



CRC is identical.

you said you had some sample where it wasn't, so I was surprised ?!

then I made these screenshots, where they look identical in real life examples(0-255 only)......yet AVS yields 10% bigger .PNG files

still hoping for your sample(s) that show a visible improvement of AVS over ffdshow at this point

Last edited by pitch.fr; 17th September 2008 at 15:35.
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 16:46   #28  |  Link
CruNcher
Registered User
 
CruNcher's Avatar
 
Join Date: Apr 2002
Location: Germany
Posts: 4,926
When you do these comparisons with Windows you have to take care of all the colorspace and level conversions that can occur in it's chain of vfw/directshow Rendering those are Decoder->Colorpsace input Renderer (without it nothing works and different colorspace renderer can have their own pros/cons ffdshow,xvid,divx,helix,microsoft (default),mainconcept and many more)-> the main output Renderer (which behavior can be influenced by the driver).
if they don't work hand in hand you can get different results for different inputs so first of all it's important to show of your complete chain of how you took these screens and from where
__________________
all my compares are riddles so please try to decipher them yourselves :)

It is about Time

Join the Revolution NOW before it is to Late !

http://forum.doom9.org/showthread.php?t=168004

Last edited by CruNcher; 17th September 2008 at 17:23.
CruNcher is offline   Reply With Quote
Old 17th September 2008, 17:05   #29  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
Quote:
Originally Posted by CruNcher View Post
When you do these comparisons with Windows you have to take care of all the colorspace conversions that can occur in it's chain of vfw/directshow Rendering those are Colorpsace input Renderer (without it nothing works and different colorspace renderer have their own pros/cons ffdshow,xvid,divx,helix,microsoft,mainconcept and many more)->Decoder-> the main output Renderer (which behavior can be influenced by the driver).
if they don't work hand in hand you can get different results for different inputs so first of all it's important to show of your complete chain of how you took these screens and from where
no sh*t ?

well it's BT.709 YV12 h264 in all cases.

for the conversions, I've given all the details already.

I didn't use DDCC gamut conversions in these screenshots
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 17:08   #30  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
still hoping for your sample(s) that show a visible improvement of AVS over ffdshow at this point
Gah... I think I know what's going on here...

Here's the FBI warning from Planetes Vol. 5, converted with ffdshow's HQ RGB conversion:



Using ConvertToRGB32() in AviSynth looks totally the same, I agree... but!


(note the red parts on the emblem and the "WARNING"...)

I think we can agree that this looks better - and it's the output of ConvertToRGB32(interlaced=false)...

It seems as if ffdshow somehow always does interlaced upsampling with DVDs, even though progressive would look better with most PAL stuff and of course with stuff that's been IVTCed via AviSynth - maybe there should be an option for interlaced/progressive chroma conversion?

EDIT: Yeah, it seems as if ffdshow only considers DVDs (or at least MPEG2 video) to be interlaced, as this AVI I talked about in my last post gets upsampled progressively and looks pretty bad when using ConvertToRGB32(interlaced=true) instead...

Here's the result using my shader...



I guess I should shift the chroma down and right by a pixel or so... (EDIT: Okay, make that half a pixel...)

np: Bomb The Bass - So Special (feat. Paul Conboy) (Future Chaos)
__________________
now playing: [artist] - [track] ([album])

Last edited by Leak; 17th September 2008 at 17:20.
Leak is offline   Reply With Quote
Old 17th September 2008, 17:20   #31  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
how would ffdshow know that the source is DVD ?

is there some cases when interlaced chroma upsampling works better than progressive ?

I've tried your AVI sample and it looks better progressively than interlaced, as intended.

indeed an option to force progressive upsampling in ffdshow would be a good idea...I thought that was already the case, actually

still doesn't explain why Convert yields 10% bigger .PNG's than ffdshow

Last edited by pitch.fr; 17th September 2008 at 17:28.
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 17:46   #32  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Okay, so my shader was off by 0.5 pixels - here's a corrected version:

Code:
/*
YV12 chroma upsampling fixer
by Kurt Bernhard 'Leak' Pruenner

Use with YV12 output if the half-resolution chroma 
gets upsampled in hardware by doubling the values
instead of interpolating between them.

(i.e. if you're getting blocky red edges on dark 
backgrounds...)
*/

sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])

float4 getPixel(float2 tex, float dx, float dy)
{
	tex.x+=dx;
	tex.y+=dy;
	
	return tex2D(s0, tex);
}

float4 rgb2yuv(float4 rgb)
{
	float4x4 coeffs=
		{
			 0.299, 0.587, 0.114, 0.000,
			-0.147,-0.289, 0.436, 0.000,
			 0.615,-0.515,-0.100, 0.000,
			 0.000, 0.000, 0.000, 0.000
		};
		
	return mul(coeffs,rgb);
}

float4 yuv2rgb(float4 yuv)
{
	float4x4 coeffs=
		{
			 1.000, 0.000, 1.140, 0.000,
			 1.000,-0.395,-0.581, 0.000,
			 1.000, 2.032, 0.000, 0.000,
			 0.000, 0.000, 0.000, 0.000
		};
	
	return mul(coeffs,yuv);
}

float4 main(float2 tex : TEXCOORD0) : COLOR
{
	float dx=1/width;
	float dy=1/height;
	
	float4 yuv00=rgb2yuv(getPixel(tex,-dx,-dy));
	float4 yuv01=rgb2yuv(getPixel(tex,-dx,  0));
	float4 yuv02=rgb2yuv(getPixel(tex,-dx, dy));
	float4 yuv10=rgb2yuv(getPixel(tex,  0,-dy));
	float4 yuv11=rgb2yuv(getPixel(tex,  0,  0));
	float4 yuv12=rgb2yuv(getPixel(tex,  0, dy));
	float4 yuv20=rgb2yuv(getPixel(tex, dx,-dy));
	float4 yuv21=rgb2yuv(getPixel(tex, dx,  0));
	float4 yuv22=rgb2yuv(getPixel(tex, dx, dy));

	float4 yuv=
		(yuv00*1+yuv01*2+yuv02*1+
		 yuv10*2+yuv11*4+yuv12*2+
		 yuv20*1+yuv21*2+yuv22*1)/16;
	
	yuv.r=yuv11.r;

	return yuv2rgb(yuv);
}
(I also had the genius idea of using matrix calculations, which helps to keep the instruction count down and is a forte of shader units anyway... )

np: Bomb The Bass - Burn The Bunker (Toob's Whatgoesoninhemsbystaysinhemsby Mix) (Future Chaos Remixes)
__________________
now playing: [artist] - [track] ([album])

Last edited by Leak; 17th September 2008 at 18:15.
Leak is offline   Reply With Quote
Old 17th September 2008, 17:50   #33  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
how would ffdshow know that the source is DVD ?
Because DVDs are usually MPEG2 streams which can flag interlaced encoding?

Quote:
is there some cases when interlaced chroma upsampling works better than progressive ?
Well, definitely on already deinterlaced material - and I don't think ffdshow's deinterlacers (or the AviSynth filter) discards any indication that the video is interlaced...

Quote:
still doesn't explain why Convert yields 10% bigger .PNG's than ffdshow
Don't get so hung up on PNG size - maybe Convert just rounds more accurate than ffdshow; you'd also get smaller PNGs if you reduced the bit depth from 8 to 7 bits per channel, but quality would surely suffer...

np: Bomb The Bass - So Special (Specialized By Michael Fakesch) (Future Chaos Remixes)
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 17th September 2008, 17:59   #34  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
Quote:
Originally Posted by Leak View Post
Because DVDs are usually MPEG2 streams which can flag interlaced encoding?

Well, definitely on already deinterlaced material - and I don't think ffdshow's deinterlacers (or the AviSynth filter) discards any indication that the video is interlaced...

Don't get so hung up on PNG size - maybe Convert just rounds more accurate than ffdshow; you'd also get smaller PNGs if you reduced the bit depth from 8 to 7 bits per channel, but quality would surely suffer...
yeah I also think that this is a possible indication that Convert rounds more accurately than ffdshow ?!

yeah, OK if you deinterlace 29.97 NTSC DVD in ffdshow with TomsMoComp....then the stream still has the "interlaced" flag ?

but you said interlaced chroma upsampling works better then ?

I use Convert() in all cases, so my TomsMoComp'ed DVD's suffer from progressive chroma upsampling then ? they would look better in interlaced ?

I think I misunderstood what you said..and that for progressive native/deinterlaced output, progressive chroma should be used ?!
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 18:03   #35  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by pitch.fr View Post
but you said interlaced chroma upsampling works better then ?
No, why would it?

The deinterlacer should have already converted the interlaced chroma to progressive chroma while doing it's work (which is creating progressive frames) - after all, you're taking the odd lines (and then the even lines in case of bobbing) and calculating new values for where the other field was, so you'll also have to make the chroma progressive.

And that's when interlaced chroma upsampling gets ugly, as the vertical position of each line of chroma differs between interlaced and progressive video...

Just try both ways with ConvertToRGB32(interlaced=true/false) on progressive and interlaced material and you'll see the quality depends on using the correct upsampling method...

Interlaced conversion is for converting interlaced YUV images to interlaced RGB images; but if the interlacing is already gone you need to convert progressive YUV images to progressive RGB images...

np: Bomb The Bass - Star (Future Chaos Remixes)
__________________
now playing: [artist] - [track] ([album])

Last edited by Leak; 17th September 2008 at 18:17.
Leak is offline   Reply With Quote
Old 17th September 2008, 18:16   #36  |  Link
CruNcher
Registered User
 
CruNcher's Avatar
 
Join Date: Apr 2002
Location: Germany
Posts: 4,926
@ptch.fr
So the chain for this was, Source H264 YV12 BT709 input->ffmpegsource/dgavcdecode/ConverttoRGB32 respectively ffdshow hq rgb32->VMR??? 7 renderless or 9 renderless ? and you took them via MPC as BMP and converted them to PNG ?
__________________
all my compares are riddles so please try to decipher them yourselves :)

It is about Time

Join the Revolution NOW before it is to Late !

http://forum.doom9.org/showthread.php?t=168004

Last edited by CruNcher; 17th September 2008 at 18:23.
CruNcher is offline   Reply With Quote
Old 17th September 2008, 18:18   #37  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by CruNcher View Post
@ptch.fr
So the chain for this was, Source H264 YV12 BT709 input->ffmpegsource/dgavcindex/ffdshow->ConverttoRGB32->VMR??? 7 renderless or 9 renderless ? and you took them via MPC as BMP and converted them to PNG ?
I think we're talking about using "ConvertToRGB32()" inside of ffdshow directly when playing back the video in a media player here...

BTW - have you tried my shader with YV12 directly instead of converting to RGB?

np: Tocotronic - Hier Ist Der Beweis (Tocotronic)
__________________
now playing: [artist] - [track] ([album])
Leak is offline   Reply With Quote
Old 17th September 2008, 18:29   #38  |  Link
CruNcher
Registered User
 
CruNcher's Avatar
 
Join Date: Apr 2002
Location: Germany
Posts: 4,926
Leak nope not yet normally i use Nvidias Hardware Decoding it does that Chroma upsampling internally for all supported formats for both cases interlaced/progressive correct, you can also see that in my very old decoder compare i made (with Nvidias 1st Generation Hardware Decoder) if you find it
__________________
all my compares are riddles so please try to decipher them yourselves :)

It is about Time

Join the Revolution NOW before it is to Late !

http://forum.doom9.org/showthread.php?t=168004

Last edited by CruNcher; 17th September 2008 at 18:44.
CruNcher is offline   Reply With Quote
Old 17th September 2008, 18:36   #39  |  Link
pitch.fr
Didée 4 President
 
Join Date: Jun 2008
Posts: 239
Quote:
Originally Posted by Leak View Post
I think we're talking about using "ConvertToRGB32()" inside of ffdshow directly when playing back the video in a media player here...
indeed, and I simply made printscreens of Haali's Renderer in RGB32.

OK, so you're saying that ffdshow does interlaced chroma upsampling even if deinterlacing is being processed with one of its filters ?

so 2 options : make its deinterlace filter kill the interlaced flag, or put an option to force progressive upsampling ?

I'm sure clsid should be able to manage one of these two ?
pitch.fr is offline   Reply With Quote
Old 17th September 2008, 18:55   #40  |  Link
MatMaul
Registered User
 
Join Date: Apr 2004
Posts: 402
ok now YV12 with your shader looks exactly the same as NV12.
that's great, thanks for that and I vote for incorporate it in mpc-hc.
MatMaul is offline   Reply With Quote
Reply

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 03:00.


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