View Single Post
Old 7th November 2010, 04:54   #17  |  Link
JanWillem32
Registered User
 
JanWillem32's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,083
@nurbs I wanted a shader that can deband. The approach was easy: analyze if the surrounding areas are nearly the same and then blur the pixel with the surrounding areas. Because that analysis also tells you if the pixel is on a contour or in a detailed area, it is very easy to implement sharpen too. I re-used a lot of code from sharpen complex v2 for the sharpen part. They were easy to combine, and the sharpen part can be disabled by setting the amount of sharpen coefficients to 0. That doesn't lower the processing requirements a lot however.
The complex part is that it first analyses the surrounding pixels, and then uses a mechanism that increases (or decreases) the contrast of the pixel that the shader is working on. My shader uses 6 different methods to either blur or sharpen, depending on the contrast with the surrounding zones.
I know that this shader is a bit "future orientated", but with the very fast increase in GPU power over the years, I don't mind making a heavy shader.
The shader is still beta, it could use some more blur and sharpen methods and it really needs some fine-tuning of the sharpening adaptation to the relative contrast. At the moment it is okay for 1080p, but only so-so for 720p, unless I upscale it to the display resolution first.

@CiNcH "UseBT601CSC" tells the GPU driver to convert limited range YUV <16,235> for Y (luma), <16,240> for U and V (chroma), to full-range YUV when enabled (<0,255> in 8-bit or normalized <0,256> for higher bitdepths), or to do no conversion when disabled. When luma is not expanded, a converted full-range RGB picture will have a dark gray tint instead of black, and a light gray tint instead of white. When Chroma is not expanded, colors can not become saturated, and the whole picture will be dull.
JanWillem32 is offline   Reply With Quote