summaryrefslogtreecommitdiffstats
path: root/video/out/vo.h
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-11-23 20:06:05 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2015-01-23 09:14:41 +0100
commitc29ab5a46b2676d013e4294ee719d83f6bc469b6 (patch)
treea20afc45d995e23e8a4c82575ba93994aade311a /video/out/vo.h
parent86f4fcf1e2b7dc6a4aba343465a5bf153d37c7f9 (diff)
downloadmpv-c29ab5a46b2676d013e4294ee719d83f6bc469b6.tar.bz2
mpv-c29ab5a46b2676d013e4294ee719d83f6bc469b6.tar.xz
vo_opengl: add smoothmotion frame blending
SmoothMotion is a way to time and blend frames made popular by MadVR. It's intended behaviour is to remove stuttering caused by mismatches between the display refresh rate and the video fps, while preserving the video's original artistic qualities (no soap opera effect). It's supposed to make 24fps video playback on 60hz monitors as close as possible to a 24hz monitor. Instead of drawing a frame once once it's pts has passed the vsync time, we redraw at the display refresh rate, and if we detect the vsync is between two frames we interpolated them (depending on their position relative to the vsync). We actually interpolate as few frames as possible to avoid a blur effect as much as possible. For example, if we were to play back a 1fps video on a 60hz monitor, we would blend at most on 1 vsync for each frame (while the other 59 vsyncs would be rendered as is). Frame interpolation is always done before scaling and in linear light when possible (an ICC profile is used, or :srgb is used).
Diffstat (limited to 'video/out/vo.h')
-rw-r--r--video/out/vo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index d943d4ad78..33a2513c1f 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -106,6 +106,8 @@ enum mp_voctrl {
VOCTRL_GET_RECENT_FLIP_TIME, // int64_t* (using mp_time_us())
VOCTRL_GET_PREF_DEINT, // int*
+
+ VOCTRL_GET_VSYNC_TIMED, // bool*
};
// VOCTRL_SET_EQUALIZER
@@ -171,6 +173,11 @@ struct vo_extra {
struct mpv_opengl_cb_context *opengl_cb_context;
};
+struct frame_timing {
+ int64_t pts;
+ int64_t next_vsync;
+};
+
struct vo_driver {
// Encoding functionality, which can be invoked via --o only.
bool encode;
@@ -218,6 +225,12 @@ struct vo_driver {
*/
void (*draw_image)(struct vo *vo, struct mp_image *mpi);
+ /* Like draw image, but is called before every vsync with timing
+ * information
+ */
+ void (*draw_image_timed)(struct vo *vo, struct mp_image *mpi,
+ struct frame_timing *t);
+
/*
* Blit/Flip buffer to the screen. Must be called after each frame!
*/