summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2016-03-07 20:26:36 +0100
committerwm4 <wm4@nowhere>2016-03-07 22:31:15 +0100
commitc68721b832738d5ed2bcddfc33ba030fcb17e15e (patch)
tree78ed6021d10c77ab1218463fbec6f50d00e9a671
parent9f91bc4b75eda0395ed6bc8b3ae3b58e663489a6 (diff)
downloadmpv-c68721b832738d5ed2bcddfc33ba030fcb17e15e.tar.bz2
mpv-c68721b832738d5ed2bcddfc33ba030fcb17e15e.tar.xz
vo_opengl: improve superxbr algorithm
The values were changed to reflect an upstream change in the source for the super-xBR implementation. The anti-ringing code was basically not working at all, the new algorithm _significantly_ improves the result (reduces ringing).
-rw-r--r--video/out/opengl/superxbr.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/video/out/opengl/superxbr.c b/video/out/opengl/superxbr.c
index c2d308bfdb..e80b1b0a7c 100644
--- a/video/out/opengl/superxbr.c
+++ b/video/out/opengl/superxbr.c
@@ -82,24 +82,24 @@ struct step_params {
const struct step_params params[3] = {
{ .dstr = 0.129633,
.ostr = 0.175068,
- .d1 = {{1, 2, 1},
- {2, 4, 2},
- {1, 2, 1}},
- .d2 = {{-1, -1},
- {-1, -1}},
+ .d1 = {{0, 1, 0},
+ {1, 2, 1},
+ {0, 1, 0}},
+ .d2 = {{-1, 0},
+ { 0, -1}},
.o1 = {1, 2, 1},
- .o2 = {-1, -1},
+ .o2 = { 0, 0},
}, {
.dstr = 0.175068,
.ostr = 0.129633,
- .d1 = {{0, 2, 0},
- {2, 0, 2},
- {0, 2, 0}},
+ .d1 = {{0, 1, 0},
+ {1, 4, 1},
+ {0, 1, 0}},
.d2 = {{ 0, 0},
{ 0, 0}},
- .o1 = {2, 0, 2},
+ .o1 = {1, 4, 1},
.o2 = { 0, 0},
}
};
@@ -182,8 +182,7 @@ static void superxbr_step_h(struct gl_shader_cache *sc,
// Anti-ringing using center square
GLSLH(float lo = min(min( i(1,1), i(2,1) ), min( i(1,2), i(2,2) ));)
GLSLH(float hi = max(max( i(1,1), i(2,1) ), max( i(1,2), i(2,2) ));)
- GLSLHF("res = mix(res, clamp(res, lo, hi), 1.0-2.0*abs(%f-0.5));\n",
- conf->edge_strength);
+ GLSLH(res = clamp(res, lo, hi);)
GLSLHF("} // step\n");
}