diff options
author | beliyaal <beliyaal@users.sourceforge.net> | 2009-05-31 22:52:49 +0400 |
---|---|---|
committer | beliyaal <beliyaal@users.sourceforge.net> | 2009-05-31 22:52:49 +0400 |
commit | 8326dd472e84e85757a68f7c8eeacb22dcdc7b5f (patch) | |
tree | 7d4e8df4148c5e4f8bf5e99cbb44d330c7263ced /src/apps/mplayerc/res | |
parent | 20c15a7d616bcdbda8f74a28856b2435ee48819a (diff) |
Fixed: Mono HDMV LPCM
Fixed: Imperceptibly faster Bicubic resizer
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1137 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/res')
-rw-r--r-- | src/apps/mplayerc/res/shaders/resizer.psh | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/src/apps/mplayerc/res/shaders/resizer.psh b/src/apps/mplayerc/res/shaders/resizer.psh index e90aacec2..66cd0bb27 100644 --- a/src/apps/mplayerc/res/shaders/resizer.psh +++ b/src/apps/mplayerc/res/shaders/resizer.psh @@ -9,7 +9,6 @@ float4 dxdy05 : register(c0); float2 dxdy : register(c1);
float2 dx : register(c2);
float2 dy : register(c3);
-float2 TexSize : register(c4);
#define A _The_Value_Of_A_Is_Set_Here_
@@ -28,10 +27,9 @@ struct PS_INPUT float4 main_bilinear(PS_INPUT input) : COLOR
{
- float2 inputt0 = input.t0;
- float2 PixelPos = inputt0 * TexSize;
- float2 ExactPixel = floor(PixelPos);
- float2 dd = PixelPos - ExactPixel;
+ float2 PixelPos = input.t0;
+ float2 dd = frac(PixelPos);
+ float2 ExactPixel = PixelPos - dd;
float2 samplePos = ExactPixel*dxdy + dxdy05;
float4 c = lerp(
@@ -83,31 +81,43 @@ float4 SampleY(float4 tx, float4 ty, float2 t0) float4 main_bicubic1pass(PS_INPUT input) : COLOR
{
- float2 inputt0 = input.t0;
- float2 PixelPos = inputt0 * TexSize;
- float2 ExactPixel = floor(PixelPos);
- float2 dd = PixelPos - ExactPixel;
+ float2 PixelPos = input.t0;
+ float2 dd = frac(PixelPos);
+ float2 ExactPixel = PixelPos - dd;
float2 samplePos = ExactPixel*dxdy + dxdy05;
return SampleY(taps(dd.x), taps(dd.y), samplePos);
}
-float4 Sample(float4 t, PS_INPUT input)
+float4 Sample(float4 t, float2 samplePos, float2 sampleD)
{
return
mul(t,
float4x4(
- tex2D(s0, input.t0),
- tex2D(s1, input.t1),
- tex2D(s2, input.t2),
- tex2D(s3, input.t3)
+ tex2D(s0, samplePos - sampleD),
+ tex2D(s0, samplePos),
+ tex2D(s0, samplePos + sampleD),
+ tex2D(s0, samplePos + sampleD + sampleD)
)
);
}
-float4 main_bicubic2pass(PS_INPUT input) : COLOR
+float4 main_bicubic2pass_pass1(PS_INPUT input) : COLOR
{
- float2 dd = frac(input.t4);
- return Sample(taps(dd.x), input);
- // return Sample(tex1D(s4, dd.x), input);
+ float2 PixelPos = input.t0;
+ float2 dd = frac(PixelPos);
+ float2 ExactPixel = PixelPos - dd;
+ float2 samplePos = ExactPixel*dxdy + dxdy05;
+
+ return Sample(taps(dd.x), samplePos, dx);
+}
+
+float4 main_bicubic2pass_pass2(PS_INPUT input) : COLOR
+{
+ float2 PixelPos = input.t0;
+ float2 dd = frac(PixelPos);
+ float2 ExactPixel = PixelPos - dd;
+ float2 samplePos = ExactPixel*dxdy + dxdy05;
+
+ return Sample(taps(dd.y), samplePos, dy);
}
|