summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-04 18:16:36 +0100
committerwm4 <wm4@nowhere>2013-01-13 17:39:31 +0100
commit23ab098969f5182585578ee01c3a47d42dea031f (patch)
tree3f9003095a8f8bb92ab61e8df9c51e109f4d4ffb /video/filter/vf_sub.c
parentcfa1f9e082f3da83adb5161be140e477b38bc5c7 (diff)
downloadmpv-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_sub.c')
-rw-r--r--video/filter/vf_sub.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index 5b2a79a030..3307af0c90 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -104,12 +104,6 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi)
FFMAX(mpi->width, vf->priv->outw),
FFMAX(mpi->height, vf->priv->outh));
- if ((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) &&
- !(vf->dmpi->flags & MP_IMGFLAG_DIRECT)) {
- mp_tmsg(MSGT_ASS, MSGL_INFO, "Full DR not possible, trying SLICES instead!\n");
- return;
- }
-
int tmargin = vf->priv->opt_top_margin;
// set up mpi as a cropped-down image of dmpi:
if (mpi->flags & MP_IMGFLAG_PLANAR) {
@@ -124,8 +118,6 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi)
mpi->stride[0] = vf->dmpi->stride[0];
mpi->width = vf->dmpi->width;
mpi->flags |= MP_IMGFLAG_DIRECT;
- mpi->flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
-// vf->dmpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK;
}
static void blank(mp_image_t *mpi, int y1, int y2)
@@ -155,8 +147,7 @@ static void blank(mp_image_t *mpi, int y1, int y2)
static int prepare_image(struct vf_instance *vf, mp_image_t *mpi)
{
int tmargin = vf->priv->opt_top_margin;
- if (mpi->flags & MP_IMGFLAG_DIRECT
- || mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) {
+ if (mpi->flags & MP_IMGFLAG_DIRECT) {
vf->dmpi = mpi->priv;
if (!vf->dmpi) {
mp_tmsg(MSGT_ASS, MSGL_WARN, "Why do we get NULL??\n");