[libav-devel] [PATCH 16/25] hwcontext_qsv: Support derivation from child devices

2017-03-04 Thread Mark Thompson
--- libavutil/hwcontext_qsv.c | 122 +++--- 1 file changed, 93 insertions(+), 29 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 3409e9b97..2d202017d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.

[libav-devel] [PATCH 24/25] lavfi: Add filter to run an arbitrary OpenCL kernel on frames

2017-03-04 Thread Mark Thompson
--- configure | 1 + libavfilter/Makefile| 1 + libavfilter/allfilters.c| 1 + libavfilter/vf_opencl_program.c | 259 4 files changed, 262 insertions(+) create mode 100644 libavfilter/vf_opencl_program.c dif

[libav-devel] [PATCH 07/25] avconv: Enable generic hwaccel support for VDPAU

2017-03-04 Thread Mark Thompson
--- avtools/Makefile | 1 - avtools/avconv.h | 1 - avtools/avconv_opt.c | 4 +- avtools/avconv_vdpau.c | 159 - 4 files changed, 2 insertions(+), 163 deletions(-) delete mode 100644 avtools/avconv_vdpau.c diff --git a/avtools/M

[libav-devel] [PATCH 18/25] hwcontext_qsv: Implement mapping frames to the child device type

2017-03-04 Thread Mark Thompson
--- libavutil/hwcontext_qsv.c | 39 +-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index a2506103a..40837a33d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -583

[libav-devel] [PATCH 23/25] lavfi: Add some common code for OpenCL filtering

2017-03-04 Thread Mark Thompson
--- libavfilter/opencl.c | 244 +++ libavfilter/opencl.h | 73 +++ 2 files changed, 317 insertions(+) create mode 100644 libavfilter/opencl.c create mode 100644 libavfilter/opencl.h diff --git a/libavfilter/opencl.c b/libavfilter/open

[libav-devel] [PATCH 17/25] hwcontext_qsv: Implement mapping frames from the child device type

2017-03-04 Thread Mark Thompson
Factorises out existing surface initialisation code to reuse. --- libavutil/hwcontext_qsv.c | 174 +- 1 file changed, 142 insertions(+), 32 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 2d202017d..a2506103a 100644

[libav-devel] [PATCH 20/25] lavu: OpenCL hwcontext implementation

2017-03-04 Thread Mark Thompson
--- configure |5 +- doc/APIchanges |4 + libavutil/Makefile |2 + libavutil/hwcontext.c |4 + libavutil/hwcontext.h |1 + libavutil/hwcontext_internal.h |1 + libavutil/hwcontext_opencl.c | 1182 +

[libav-devel] [PATCH 05/25] lavc: Add hwaccel_flags field to AVCodecContext

2017-03-04 Thread Mark Thompson
From: wm4 This "reuses" the flags introduced for the av_vdpau_bind_context() API function, and makes them available to all hwaccels. This does not affect the current vdpau API, as av_vdpau_bind_context() should obviously override the AVCodecContext.hwaccel_flags flags for the sake of compatibilit

[libav-devel] [PATCH 13/25] hwcontext: Improve allocation in derived contexts

2017-03-04 Thread Mark Thompson
Use the flags argument of av_hwframe_ctx_create_derived() to pass the mapping flags which will be used on allocation. Also, set the format and hardware context on the allocated frame automatically - the user should not be required to do this themselves. --- libavutil/hwcontext.c | 14 +++

[libav-devel] [PATCH 09/25] qsvdec: Allow use of hw_device_ctx to make the internal session

2017-03-04 Thread Mark Thompson
--- libavcodec/qsvdec.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 96526a100..2c90436a1 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -42,7 +42,7 @@ #include "qsvdec.h" static int qsv_ini

[libav-devel] [PATCH 10/25] qsvenc: Allow use of hw_device_ctx to make the internal session

2017-03-04 Thread Mark Thompson
--- libavcodec/qsvenc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index b2f2b4db7..bd8c24321 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -693,6 +693,13 @@ static int qsvenc_init_session(AVCodecContext *avctx, QSVEncConte

[libav-devel] [PATCH 25/25] lavfi: Add OpenCL overlay filter

2017-03-04 Thread Mark Thompson
Currently works only with RGBA on top of NV12 in BT.601. --- configure | 1 + libavfilter/Makefile| 1 + libavfilter/allfilters.c| 1 + libavfilter/opencl/overlay.cl | 125 libavfilter/vf_overlay_opencl.c | 314

[libav-devel] [PATCH 02/25] hwcontext: Make it easier to work with device types

2017-03-04 Thread Mark Thompson
Adds functions to convert to/from strings and a function to iterate over all supported device types. Also adds a new invalid type AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value. --- libavutil/hwcontext.c | 46 ++ libavutil/hwcontext.h | 28 ++

[libav-devel] [PATCH 19/25] lavu: Add OpenCL hardware pixfmt

2017-03-04 Thread Mark Thompson
--- doc/APIchanges | 3 +++ libavutil/pixdesc.c | 4 libavutil/pixfmt.h | 7 +++ libavutil/version.h | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 1e84c3803..253454358 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@

[libav-devel] [PATCH 15/25] vf_hwmap: Add reverse mapping for hardware frames

2017-03-04 Thread Mark Thompson
This is something of a hack. It allocates a new hwframe context for the target format, then maps it back to the source link and overwrites the input link hw_frames_ctx so that the previous filter will receive the frames we want from ff_get_video_buffer(). It may fail if the previous filter impose

[libav-devel] [PATCH 22/25] hwcontext_opencl: QSV to OpenCL mapping for Intel Media SDK

2017-03-04 Thread Mark Thompson
Uses the cl_intel_va_api_media_sharing extension, which supports only NV12 surfaces and only mapping from QSV to OpenCL. --- configure| 5 + libavutil/hwcontext_opencl.c | 262 +++ 2 files changed, 267 insertions(+) diff --git a/config

[libav-devel] [PATCH 06/25] lavc: vdpau: add support for new hw_frames_ctx and hw_device_ctx API

2017-03-04 Thread Mark Thompson
From: wm4 This supports retrieving the device from a provided hw_frames_ctx, and automatically creating a hw_frames_ctx if hw_device_ctx is set. The old API is not deprecated yet. The user can still use av_vdpau_bind_context() (with or without setting hw_frames_ctx), or use the API before that b

[libav-devel] [PATCH 21/25] hwcontext_opencl: VAAPI to/from OpenCL mapping for Intel i965+beignet

2017-03-04 Thread Mark Thompson
Supports all surface formats that the OpenCL hwcontext does, with mapping in both direction. --- configure | 6 + libavutil/hwcontext_internal.h | 3 + libavutil/hwcontext_opencl.c | 421 + libavutil/hwcontext_vaapi.c| 9 + 4

[libav-devel] [PATCH 00/25] More hardware frame mapping, generic hardware support in avconv, OpenCL support

2017-03-04 Thread Mark Thompson
Notable changes since last time: * Added more convenience functions for enum AVHWDeviceType [2]. * Removed the device table from avconv, made that setup a bit cleaner [3]. * Added hw_device_ctx support to QSV (for non-hwaccel cases, hwaccel qsvdec still todo if wanted) [8-10]. * QSV mapping also

[libav-devel] [PATCH 04/25] avconv: Enable generic hwaccel support for VAAPI

2017-03-04 Thread Mark Thompson
--- avtools/Makefile | 1 - avtools/avconv.h | 2 - avtools/avconv_opt.c | 20 - avtools/avconv_vaapi.c | 231 - 4 files changed, 16 insertions(+), 238 deletions(-) delete mode 100644 avtools/avconv_vaapi.c diff --git a/avtoo

[libav-devel] [PATCH 01/25] hwcontext: Add device derivation

2017-03-04 Thread Mark Thompson
Creates a new device context from another of a different type which refers to the same underlying hardware. --- libavutil/hwcontext.c | 65 ++ libavutil/hwcontext.h | 26 + libavutil/hwcontext_internal.h | 8 ++ 3 files

[libav-devel] [PATCH 08/25] qsv: Add ability to create a session from a device

2017-03-04 Thread Mark Thompson
--- libavcodec/qsv.c | 49 --- libavcodec/qsv_internal.h | 9 ++--- libavcodec/qsvdec.c | 6 +++--- libavcodec/qsvenc.c | 6 +++--- 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec

[libav-devel] [PATCH 12/25] hwcontext: Add frame context mapping for nontrivial contexts

2017-03-04 Thread Mark Thompson
Some frames contexts are not usable without additional format-specific state in hwctx. This adds new functions map_frames_from and map_frames_to to set this up appropriately when deriving a frames context which will require it to be set. --- libavutil/hwcontext.c | 9 - libavutil

[libav-devel] [PATCH 11/25] avconv: Support setting the hardware device to use when filtering

2017-03-04 Thread Mark Thompson
This only supports one device globally, but more can be used by passing them with input streams in hw_frames_ctx or by deriving new devices inside a filter graph with hwmap. --- avtools/avconv.h| 1 + avtools/avconv_filter.c | 10 -- avtools/avconv_opt.c| 21 ++

[libav-devel] [PATCH 03/25] avconv: Generic device setup

2017-03-04 Thread Mark Thompson
Not yet enabled for any hwaccels. --- avtools/Makefile | 3 +- avtools/avconv.c | 22 +++ avtools/avconv.h | 17 +++ avtools/avconv_hw.c | 386 +++ avtools/avconv_opt.c | 33 - 5 files changed, 455 insertions(+), 6 deletions(-)

[libav-devel] [PATCH 14/25] vf_hwmap: Add device derivation

2017-03-04 Thread Mark Thompson
Also refactor a little and improve error messages to make failure cases easier to understand. --- libavfilter/vf_hwmap.c | 67 +++--- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c index 11