summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-01-26 22:14:41 +0100
committer ImJezze <jezze@gmx.net>2016-01-26 22:14:41 +0100
commita5fb4397056456d618c428c5cbda9614f977e36a (patch)
treefb807b4be399776357587c038083c7f7e828c619 /hlsl
parentd516871e6fcbde11863b927de75a042e8b8ce3e9 (diff)
Cleanup (nw)
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/ntsc.fx27
1 files changed, 14 insertions, 13 deletions
diff --git a/hlsl/ntsc.fx b/hlsl/ntsc.fx
index ed07e37a4cc..107be16af16 100644
--- a/hlsl/ntsc.fx
+++ b/hlsl/ntsc.fx
@@ -108,7 +108,7 @@ static const int HalfSampleCount = SampleCount / 2;
float4 GetCompositeYIQ(float2 TexCoord)
{
- float2 SourceTexelDims = 1.0f / SourceDims;
+ float2 SourceTexelDims = 1.0f / SourceDims;
float2 SourceRes = SourceDims * SourceRect;
float2 PValueSourceTexel = float2(PValue, 0.0f) * SourceTexelDims;
@@ -131,12 +131,13 @@ float4 GetCompositeYIQ(float2 TexCoord)
float4 I = float4(dot(Texel0, IDot), dot(Texel1, IDot), dot(Texel2, IDot), dot(Texel3, IDot));
float4 Q = float4(dot(Texel0, QDot), dot(Texel1, QDot), dot(Texel2, QDot), dot(Texel3, QDot));
- float4 W = PI2 * CCValue * ScanTime;
+ float W = PI2 * CCValue * ScanTime;
+ float WoPI = W / PI;
+
+ float HOffset = (BValue + SignalOffset) / WoPI;
+ float VScale = (AValue * SourceRes.y) / WoPI;
- float4 T = HPosition
- + (AValue / 360.0f * SourceRes.y) * VPosition
- + (BValue / 360.0f)
- + (SignalOffset / 360.0f);
+ float4 T = HPosition + HOffset + VPosition * VScale;
float4 TW = T * W;
float4 CompositeYIQ = Y + I * cos(TW) + Q * sin(TW);
@@ -171,7 +172,11 @@ float4 ps_main(PS_INPUT Input) : COLOR
float PI2Length = PI2 / SampleCount;
float W = PI2 * CCValue * ScanTime;
-
+ float WoPI = W / PI;
+
+ float HOffset = (BValue + SignalOffset) / WoPI;
+ float VScale = (AValue * SourceRes.y) / WoPI;
+
float4 YAccum = 0.0f;
float4 IAccum = 0.0f;
float4 QAccum = 0.0f;
@@ -190,12 +195,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
float4 C = GetCompositeYIQ(float2(Cx.r, Cy.r));
- float4 T = HPosition
- + (AValue / 360.0f * SourceRes.y) * VPosition
- + (BValue / 360.0f)
- + (SignalOffset / 360.0f);
- float4 WT = W * T
- + OValue;
+ float4 T = HPosition + HOffset + VPosition * VScale;
+ float4 WT = W * T + OValue;
float4 SincKernel = 0.54f + 0.46f * cos(PI2Length * n4);