Log in

View Full Version : About ColorYUY2 filter's option


VoidShell
8th August 2007, 14:56
Hi, everyone.
I have some question about ColorYUY2.
I also thread about this a few days ago but then I don't get a answer about this question.

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

First, I am curious about level="TV->PC" and level="TV->PC.Y" differences. (Even definition)

And I am also curious about interpolation="411->422" and interpolation="411->422R".

In first case their differences like color or bright was confirmed to my eyes.
But about interpolation I can't find differences confirmed to my eyes those two options.

Read to thanks. :)

IanB
9th August 2007, 00:50
I can't read Japanese but from reading the source it seems the "TV->PC.Y" only transforms the Y channel, the other does Y, U and V.

The 422 code seems to interpolate from the right hand edge using the formula
w=Width;while (w>=3) {uv(w-2)=(uv[w-1]+uv[w-3])/2;w-=4;}

The 422R code seems to interpolate with rounding from the left hand edge using the formula
p=0;while (p<Width) {uv(p+1)=(uv[p+0]+uv[p+2]+1)/2;p+=4;}

Strange code :confused: For mod 4 widths rounding is the only difference. For odd mod 2 widths the other pixels is interpolated for the 422 case. But 411 will only be mod 4 width. :confused:

VoidShell
10th August 2007, 09:57
Thanks IanB.
It's strage code~ I think too.
Which one do you prefer, if you use converting interpolation?
422 or 422R?

foxyshadis
10th August 2007, 13:17
I doubt it makes the slightest difference. One has a bias down, one has a bias up, but neither is obviously more correct than the other. A no-bias conversion would require dither (a small random input).

VoidShell
11th August 2007, 17:05
Yes, I see.... Thanks.

IanB
11th August 2007, 22:58
@VoidShell,

Appart from the right edge/left edge guff,foxyshadis is correct about the no visible difference. Integer rounding is a contentious issue. Think about the following table.A B (A+B)/2 (A+B+1)/2
0 0 0 0
1 0 0 1
1 1 1 1
2 0 1 1
2 1 1 2
2 2 2 2
3 0 1 2
3 1 2 2
3 2 2 3
3 3 3 3

VoidShell
13th August 2007, 16:27
Sorry, I can't understand that table given by you.

Wilbert
13th August 2007, 19:39
422 422R
bias down bias up
A B (A+B)/2 (A+B+1)/2
0 0 0 0
1 0 0 1
1 1 1 1
2 0 1 1
2 1 1 2
2 2 2 2
3 0 1 2
3 1 2 2
3 2 2 3
3 3 3 3

I adjusted the table a bit. The first issue is, how do you round 0.5? Do you round it down (as in 422) or up (as in 422R). The second issue is, does it matter how you round it?

VoidShell
15th August 2007, 15:30
Ah~ Ok. It is easy for me now. Thanks to much.
In formula, it seems to some diffrent, but there isn't diffrence in output to my eyes.
So I don't know what is more effctive.
Would you recommend one to me?