aboutsummaryrefslogtreecommitdiff
path: root/lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch')
-rw-r--r--lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch75
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch b/lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch
deleted file mode 100644
index 4336c3180f..0000000000
--- a/lib/ffmpeg/patches/0019-dxva-mpeg2-speed-up-slice-allocation.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 681f74b224e16a4df7f8c4e31a9be56975d57e10 Mon Sep 17 00:00:00 2001
-From: CrystalP <CrystalP@xbmc.org>
-Date: Mon, 10 Oct 2011 19:42:50 -0400
-Subject: [PATCH 19/24] dxva-mpeg2 speed up slice allocation
-
-The number of slices is not very likely to change from frame to frame, so
-at the beginning of a new frame, allocate memory for the amount of slices of
-the previous frame. Saves a lot of reallocation, for some TV capture samples
-there are over 200 slices.
-
-There wasn't anywhere really appropriate to store last_slice_count (needs to
-live from first frame to last frame), so this is likely to cause discussion to
-merge upstream.
-Adding members to dxva_context breaks ABI, which we don't care too much about
-since on Windows we don't support external ffmpeg.
-dxva mpeg2 code also has access to MpegEncContext, but adding there would
-likely break ABI as well.
----
- libavcodec/dxva2.h | 1 +
- libavcodec/dxva2_mpeg2.c | 12 ++++++++++++
- 2 files changed, 13 insertions(+)
-
-diff --git a/libavcodec/dxva2.h b/libavcodec/dxva2.h
-index fc99560..16a6994 100644
---- a/libavcodec/dxva2.h
-+++ b/libavcodec/dxva2.h
-@@ -66,6 +66,7 @@ struct dxva_context {
- * Private to the FFmpeg AVHWAccel implementation
- */
- unsigned report_id;
-+ unsigned last_slice_count;
- };
-
- #endif /* AVCODEC_DXVA_H */
-diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
-index 8ba83b6..90507f9 100644
---- a/libavcodec/dxva2_mpeg2.c
-+++ b/libavcodec/dxva2_mpeg2.c
-@@ -222,6 +222,16 @@
- ctx_pic->slice_count = 0;
- ctx_pic->bitstream_size = 0;
- ctx_pic->bitstream = NULL;
-+
-+ if (ctx->last_slice_count > 0)
-+ {
-+ ctx_pic->slice = av_fast_realloc(NULL,
-+ &ctx_pic->slice_alloc,
-+ ctx->last_slice_count * sizeof(DXVA_SliceInfo));
-+ if (!ctx_pic->slice)
-+ return -1;
-+ }
-+
- return 0;
- }
-
-@@ -251,6 +261,7 @@
- struct MpegEncContext *s = avctx->priv_data;
- struct dxva2_picture_context *ctx_pic =
- s->current_picture_ptr->f.hwaccel_picture_private;
-+ struct dxva_context *ctx = avctx->hwaccel_context;
- int ret;
-
- if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
-@@ -261,6 +272,8 @@
- commit_bitstream_and_slice_buffer);
- if (!ret)
- ff_mpeg_draw_horiz_band(s, 0, avctx->height);
-+
-+ ctx->last_slice_count = ctx_pic->slice_count;
- return ret;
- }
-
---
-1.7.9.4
-