消除SSimDownscaler的噪声

This commit is contained in:
Xu Liu 2021-07-11 23:04:52 +08:00
commit 27dc26ad7d
2 changed files with 5 additions and 7 deletions

View file

@ -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);
}

View file

@ -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);
}