summaryrefslogtreecommitdiffstats
path: root/video/out/gl_utils.h
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-03-12 22:18:16 +0100
committerwm4 <wm4@nowhere>2015-03-12 23:20:21 +0100
commit3974a5ca5e55ce00e8177a672e0627bfabee4118 (patch)
tree382713c02863c460e5c9b4007bf4bf8b4d89e49e /video/out/gl_utils.h
parente74a4d5bc0b101fbfb371942c00d3a77267dc4a6 (diff)
downloadmpv-3974a5ca5e55ce00e8177a672e0627bfabee4118.tar.bz2
mpv-3974a5ca5e55ce00e8177a672e0627bfabee4118.tar.xz
vo_opengl: refactor shader generation (part 2)
This adds stuff related to gamma, linear light, sigmoid, BT.2020-CL, etc, as well as color management. Also adds a new gamma function (gamma22). This adds new parameters to configure the CMS settings, in particular letting us target simple colorspaces without requiring usage of a 3DLUT. This adds smoothmotion. Mostly working, but it's still sensitive to timing issues. It's based on an actual queue now, but the queue size is kept small to avoid larger amounts of latency. Also makes “upscale before blending” the default strategy. This is justified because the "render after blending" thing doesn't seme to work consistently any way (introduces stutter due to the way vsync timing works, or something), so this behavior is a bit closer to master and makes pausing/unpausing less weird/jumpy. This adds the remaining scalers, including bicubic_fast, sharpen3, sharpen5, polar filters and antiringing. Apparently, sharpen3/5 also consult scale-param1, which was undocumented in master. This also implements cropping and chroma transformation, plus rotation/flipping. These are inherently part of the same logic, although it's a bit rough around the edges in some case, mainly due to the fallback code paths (for bilinear scaling without indirection).
Diffstat (limited to 'video/out/gl_utils.h')
-rw-r--r--video/out/gl_utils.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/video/out/gl_utils.h b/video/out/gl_utils.h
index a1bb2ecafb..b4f5650ea6 100644
--- a/video/out/gl_utils.h
+++ b/video/out/gl_utils.h
@@ -86,15 +86,27 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h,
#define FBOTEX_FUZZY_H 2
void fbotex_set_filter(struct fbotex *fbo, GLenum gl_filter);
-void gl_matrix_ortho2d(float m[3][3], float x0, float x1, float y0, float y1);
+void gl_matrix_ortho2d(float m[3][2], float x0, float x1, float y0, float y1);
-static inline void gl_matrix_mul_vec(float m[3][3], float *x, float *y)
+// This treats m as an affine transformation, in other words m[2][n] gets
+// added to the output.
+static inline void gl_matrix_mul_vec(float m[3][2], float *x, float *y)
{
float vx = *x, vy = *y;
*x = vx * m[0][0] + vy * m[1][0] + m[2][0];
*y = vx * m[0][1] + vy * m[1][1] + m[2][1];
}
+struct mp_rect_f {
+ float x0, y0, x1, y1;
+};
+
+static inline void gl_matrix_mul_rect(float m[3][2], struct mp_rect_f *r)
+{
+ gl_matrix_mul_vec(m, &r->x0, &r->y0);
+ gl_matrix_mul_vec(m, &r->x1, &r->y1);
+}
+
void gl_set_debug_logger(GL *gl, struct mp_log *log);
struct gl_shader_cache;