mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
消除SSimDownscaler的噪声
This commit is contained in:
parent
e21127262b
commit
27dc26ad7d
2 changed files with 5 additions and 7 deletions
|
|
@ -71,9 +71,5 @@ D2D_PS_ENTRY(main) {
|
|||
float3 origin = SampleInputCur(0).rgb;
|
||||
float3 r = GammaInv(avg[1] + avg[2] * Gamma(origin) - avg[0]);
|
||||
|
||||
// 消除噪点
|
||||
if (abs(GetLuma(r) - GetLuma(origin)) > 0.1) {
|
||||
r = origin;
|
||||
}
|
||||
return float4(r, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,13 @@ D2D_PS_ENTRY(main) {
|
|||
W += w;
|
||||
}
|
||||
avg /= W;
|
||||
|
||||
|
||||
float3 cur2 = SampleInputCur(2).rgb;
|
||||
cur2 *= cur2;
|
||||
float3 Sl = abs(avg[0] - cur2);
|
||||
float3 Sh = abs(avg[1] - cur2);
|
||||
float3 r = lerp(0.5f, 1.0 / (1.0 + sqrt(Sh / Sl)), 1 - step(Sl, 5e-6));
|
||||
return float4(r, 0.0);
|
||||
|
||||
// 受限于精度,这里增大噪声阈值
|
||||
float3 r = lerp(0.5f, 1.0 / (1.0 + sqrt(Sh / Sl)), 1 - step(Sl, 8e-4));
|
||||
return float4(r, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue