diff options
author | wm4 <wm4@nowhere> | 2012-11-04 18:16:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 17:39:31 +0100 |
commit | 23ab098969f5182585578ee01c3a47d42dea031f (patch) | |
tree | 3f9003095a8f8bb92ab61e8df9c51e109f4d4ffb /video/filter/vf_vo.c | |
parent | cfa1f9e082f3da83adb5161be140e477b38bc5c7 (diff) | |
download | mpv-23ab098969f5182585578ee01c3a47d42dea031f.tar.bz2 mpv-23ab098969f5182585578ee01c3a47d42dea031f.tar.xz |
video: remove slice based filtering and video output
Slices allowed filtering or drawing video in horizontal bands or
blocks. This allowed working on the video in smaller units. In theory,
this could bring a performance win by lowering cache pressure, as you
didn't have to keep the whole video frame in cache while filtering,
only the slice.
In practice, the slice code path was barely used for the following
reasons:
- Multithreaded decoding with ffmpeg didn't use slices. The ffmpeg
slice callback was disabled, because it can be called from another
thread, and the mplayer video chain is not thread-safe.
- There was nothing that would turn "full" images into appropriate
slices, so slices were rarely used.
- Most filters didn't actually support slices.
On the other hand, supporting slices lead to code duplication and more
complex code in general. I made some experiments and didn't find any
actual measurable performance improvements when using slices. Even
ffmpeg removed slices based filtering from libavfilter in favor of
simpler code.
The most broken thing about the slices code path is that slices can't
be queued, like it is done for images in vo.c.
Diffstat (limited to 'video/filter/vf_vo.c')
-rw-r--r-- | video/filter/vf_vo.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/video/filter/vf_vo.c b/video/filter/vf_vo.c index 8fe30bf415..b8eb7bb13d 100644 --- a/video/filter/vf_vo.c +++ b/video/filter/vf_vo.c @@ -37,9 +37,6 @@ struct vf_priv_s { }; #define video_out (vf->priv->vo) -static void draw_slice(struct vf_instance *vf, unsigned char **src, - int *stride, int w, int h, int x, int y); - static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) @@ -69,7 +66,6 @@ static int config(struct vf_instance *vf, // save vo's stride capability for the wanted colorspace: vf->default_caps = video_out->default_caps; - vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice; return 1; } @@ -140,21 +136,6 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) return vo_draw_image(video_out, mpi, pts); } -static void start_slice(struct vf_instance *vf, mp_image_t *mpi) -{ - if (!video_out->config_ok) - return; - vo_control(video_out, VOCTRL_START_SLICE, mpi); -} - -static void draw_slice(struct vf_instance *vf, unsigned char **src, - int *stride, int w, int h, int x, int y) -{ - if (!video_out->config_ok) - return; - vo_draw_slice(video_out, src, stride, w, h, x, y); -} - static void uninit(struct vf_instance *vf) { if (vf->priv) { @@ -172,8 +153,6 @@ static int vf_open(vf_instance_t *vf, char *args) vf->query_format = query_format; vf->get_image = get_image; vf->put_image = put_image; - vf->draw_slice = draw_slice; - vf->start_slice = start_slice; vf->uninit = uninit; vf->priv = calloc(1, sizeof(struct vf_priv_s)); vf->priv->vo = (struct vo *)args; |