|
回复 #13 1321612478 的帖子
顏色一直是N的缺點
因為多多少少還是有關BT.601的關係(YUV轉RGB)
以下是恢復的SHADER...(Media Player Classic的shader)
sampler s0 : register(s0);
float4 main(float2 tex : TEXCOORD0) : COLOR
{
float c0 = dot(tex2D(s0, tex), float4( 0.299, 0.587, 0.114,0));
float c1 = dot(tex2D(s0, tex), float4(-0.169,-0.331, 0.500,0));
float c2 = dot(tex2D(s0, tex), float4( 0.500,-0.419,-0.081,0));
// Y range is 16 ~ 235, CrCb range is -112 ~ 112
if(c0<0.062) c0=0;
else c0=(c0-0.062)*1.164;
c1=c1*1.134;
c2=c2*1.134;
float cr = c0+1.402*c2;
float cg = c0-0.344*c1-0.714*c2;
float cb = c0+1.772*c1;
float4 cx = float4(cr,cg,cb,0);
return cx;
} |
|