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/out/vo_x11.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/out/vo_x11.c')
-rw-r--r-- | video/out/vo_x11.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index d65326616c..98ebc7f6d1 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -300,7 +300,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, } /* set image size (which is indeed neither the input nor output size), - if zoom is on it will be changed during draw_slice anyway so we don't + if zoom is on it will be changed during draw_image anyway so we don't duplicate the aspect code here */ p->image_width = (width + 7) & (~7); @@ -474,8 +474,7 @@ static void flip_page(struct vo *vo) XSync(vo->x11->display, False); } -static int draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, - int x, int y) +static void draw_image(struct vo *vo, mp_image_t *mpi) { struct priv *p = vo->priv; uint8_t *dst[MP_MAX_PLANES] = {NULL}; @@ -517,15 +516,9 @@ static int draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, dst[0] += dstStride[0] * (p->image_height - 1); dstStride[0] = -dstStride[0]; } - sws_scale(p->swsContext, (const uint8_t **)src, stride, y, h, dst, - dstStride); + sws_scale(p->swsContext, (const uint8_t **)mpi->planes, mpi->stride, + 0, mpi->h, dst, dstStride); mp_draw_sub_backup_reset(p->osd_backup); - return 0; -} - -static void draw_image(struct vo *vo, mp_image_t *mpi) -{ - draw_slice(vo, mpi->planes, mpi->stride, mpi->w, mpi->h, 0, 0); } static int query_format(struct vo *vo, uint32_t format) @@ -651,7 +644,6 @@ const struct vo_driver video_out_x11 = { .config = config, .control = control, .draw_image = draw_image, - .draw_slice = draw_slice, .draw_osd = draw_osd, .flip_page = flip_page, .check_events = check_events, |