[FFmpeg-devel] [PATCH 3/3] lavc/qsvenc_hevc: accept HDR metadata if have

2022-10-17 Thread haihao . xiang-at-intel . com
From: Haihao Xiang The SDK may accept HDR metadata via mfxEncodeCtrl::ExtParam Signed-off-by: Haihao Xiang --- libavcodec/qsvenc_hevc.c | 80 1 file changed, 80 insertions(+) diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index

[FFmpeg-devel] [PATCH 2/3] lavc/qsvenc: enlarge the maximum number of ExtParam buffers on mfxEncodeCtrl

2022-10-17 Thread haihao . xiang-at-intel . com
From: Haihao Xiang The next commit and other commits in future will use more ExtParam buffers. And combine 2 free functions into single one Signed-off-by: Haihao Xiang --- libavcodec/qsv_internal.h | 2 +- libavcodec/qsvenc.c | 27 --- 2 files changed, 9

[FFmpeg-devel] [PATCH 1/3] lavc/qsvenc: fix check to avoid segfault

2022-10-17 Thread haihao . xiang-at-intel . com
From: Haihao Xiang Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 15e6936a65..19fe6e59a2 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -2093,8 +2093,8

[FFmpeg-devel] [PATCH] qsv: check for libmfx.pc instead of mfx.pc

2022-05-25 Thread Haihao Xiang
This fixed the regression caused by commit 478e1a98a Reported-by: Timo Rothenpieler Signed-off-by: Haihao Xiang --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 6cf7d89674..5a167613a4 100755 --- a/configure +++ b/configure @@ -6565,7

[FFmpeg-devel] [PATCH] qsv: add requirement for the mininal version of libmfx

2022-05-22 Thread Haihao Xiang
libmfx 1.28 was released 3 years ago, it is easy to get a greater version than 1.28. We may remove lots of compile-time checks if adding the requirement for the minimal version in the configure script. --- configure | 7 +- libavcodec/qsv.c | 24 -- libavcodec/qsvenc.

[FFmpeg-devel] [PATCH v08 10/10] configure: add --enable-libvpl option

2022-04-28 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.6 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. It is recommended to use oneVPL for new work, even for currently available hardwares [1]

[FFmpeg-devel] [PATCH v08 09/10] qsv: use a new method to create mfx session when using oneVPL

2022-04-28 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add config filters for D3D9/D3D11 session (galinart) The default device is changed to d3d11va for oneVPL when both d3d11va and dxva2 are enabled on Microsoft Windows This is in preparation for oneVPL sup

[FFmpeg-devel] [PATCH v08 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2022-04-28 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsve

[FFmpeg-devel] [PATCH v08 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2022-04-28 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v08 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2022-04-28 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsvenc.h

[FFmpeg-devel] [PATCH v08 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2022-04-28 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c | 5 +

[FFmpeg-devel] [PATCH v08 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2022-04-28 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v08 03/10] qsv: remove mfx/ prefix from mfx headers

2022-04-28 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v08 02/10] configure: fix the check for MFX_CODEC_VP9

2022-04-28 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v08 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2022-04-28 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v08 00/10] make QSV works with the Intel's oneVPL

2022-04-28 Thread Haihao Xiang
.html [3] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-matrix [4] https://www.intel.com/content/www/us/en/develop/documentation/upgrading-from-msdk-to-onevpl/top.html Haihao Xiang (10): configure: ensure --enable-libmfx uses libmfx 1.x configure: fix the check for MFX_CODE

[FFmpeg-devel] [PATCH] qsvenc: fix typo

2022-04-07 Thread Haihao Xiang
--- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 2514d5b256..fbb22ca436 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1003,7 +1003,7 @@ static int init_video_param(AVCodecContext *avctx, QS

[FFmpeg-devel] [PATCH v2] lavc/qsvenc: add tile encoding support for VP9

2022-01-12 Thread Haihao Xiang
Add -tile_rows and -tile_cols options to specify the number of tile rows and columns Signed-off-by: Haihao Xiang --- v2: add option descriptions in the doc doc/encoders.texi | 6 ++ libavcodec/qsvenc.c | 4 libavcodec/qsvenc.h | 1 + libavcodec/qsvenc_vp9.c | 10

[FFmpeg-devel] [PATCH v2] lavc/qsvenc: add encode support for screen content coding extension

2022-01-12 Thread Haihao Xiang
Enables HEVC Screen Content Coding extension support on ICL+ platform Signed-off-by: Haihao Xiang --- v2: rebased it against the latest master and added scc to the doc doc/encoders.texi| 3 +++ libavcodec/qsvenc.c | 3 +++ libavcodec/qsvenc_hevc.c | 3 +++ 3 files changed, 9

[FFmpeg-devel] [PATCH v2] lavc/qsvenc_hevc: add -pic_timing_sei option

2022-01-11 Thread Haihao Xiang
The SDK may insert picture timing SEI for hevc and the code to set mfx parameter has been added in qsvenc, however the corresponding option is missing in the hevc option array Reviewed-by: Limin Wang Signed-off-by: Haihao Xiang --- v2: added option description in the doc doc/encoders.texi

[FFmpeg-devel] [PATCH] MAINTAINERS: add my gpg fingerprint

2021-12-22 Thread Haihao Xiang
Signed-off-by: Haihao Xiang --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 50ee5efecc..c065e94498 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -611,6 +611,7 @@ Daniel Verkamp78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7

[FFmpeg-devel] [PATCH] lavc/qsvenc: add tile encoding support for VP9

2021-12-13 Thread Haihao Xiang
Add -tile_rows and -tile_cols options to specify the number of tile rows and columns --- libavcodec/qsvenc.c | 4 libavcodec/qsvenc_vp9.c | 10 ++ 2 files changed, 14 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 26a94cd419..270bdad544 100644 --- a/l

[FFmpeg-devel] [PATCH 5/5] lavc/qsvenc: dump parameters for mjpeg encoding in verbose mode

2021-12-12 Thread Haihao Xiang
--- libavcodec/qsvenc.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 106438f227..92a8b49fe3 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -421,6 +421,18 @@ static void dump_video_vp9_param(AVCodecContext *avctx,

[FFmpeg-devel] [PATCH 4/5] lavc/qsvenc: dump parameters for VP9 encoding in verbose mode

2021-12-12 Thread Haihao Xiang
--- libavcodec/qsvenc.c | 80 + 1 file changed, 80 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index a2a8a79189..106438f227 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -343,6 +343,84 @@ static void dump_video_p

[FFmpeg-devel] [PATCH 3/5] lavc/qsvenc: add VP9 profiles

2021-12-12 Thread Haihao Xiang
--- libavcodec/qsvenc.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 7dab8bab0f..a2a8a79189 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -76,6 +76,15 @@ static const struct profile_names hevc_profiles[] = { #e

[FFmpeg-devel] [PATCH 2/5] lavc/qsvenc: define profile array per codec

2021-12-12 Thread Haihao Xiang
The SDK defines HEVC, VP9 and AV1 profiles in the same values e.g. MFX_PROFILE_HEVC_MAIN =1, MFX_PROFILE_VP9_0 =1, MFX_PROFILE_AV1_MAIN =1, To avoid potential errors when adding VP9, AV1 profiles later, this patch defines profile array per codec. --- libav

[FFmpeg-devel] [PATCH 1/5] lavc/qsvenc: remove VC1 profiles

2021-12-12 Thread Haihao Xiang
The SDK doesn't support VC1 encoding. In addition, both MFX_PROFILE_VC1_SIMPLE and MFX_PROFILE_HEVC_MAIN are 1 in the SDK, HEVC main profile is recognized as simple profile in the verbose output if don't remove VC1 profiles. $ ffmpeg -v verbose -qsv_device /dev/dri/renderD129 -f lavfi -i yuvtestsr

[FFmpeg-devel] [PATCH] lavc/qsvenc: set base address for V plane

2021-12-12 Thread Haihao Xiang
The SDK checks Data.V when using system memory for VP9 encoding. This fixed the error below: $ ffmpeg -qsv_device /dev/dri/renderD129 -f lavfi -i yuvtestsrc -c:v vp9_qsv -f null - [vp9_qsv @ 0x55b8387cbe90] Error during encoding: NULL pointer (-2) Video encoding failed --- libavcodec/qsvenc.c |

[FFmpeg-devel] [PATCH v6 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavc

[FFmpeg-devel] [PATCH v6 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec

[FFmpeg-devel] [PATCH v6 10/10] configure: add --enable-libvpl option

2021-10-15 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. It is recommended to use oneVPL for new work, even for currently available hardwares [1]

[FFmpeg-devel] [PATCH v6 09/10] qsv: use a new method to create mfx session when using oneVPL

2021-10-15 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add AccelerationMode config filter for D3D9/D3D11 session (galinart) The default device is changed to d3d11va for oneVPL when both d3d11va and dxva2 are enabled on Microsoft Windows This is in preparatio

[FFmpeg-devel] [PATCH v6 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.

[FFmpeg-devel] [PATCH v6 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c |

[FFmpeg-devel] [PATCH v6 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v6 03/10] qsv: remove mfx/ prefix from mfx headers

2021-10-15 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v6 02/10] configure: fix the check for MFX_CODEC_VP9

2021-10-15 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v6 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-10-15 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v6 00/10] make QSV works with the Intel's oneVPL

2021-10-15 Thread Haihao Xiang
.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html Haihao Xiang (10): configure: ensure --enable-libmfx uses libmfx 1.x configure: fix the check for MFX_CODEC_VP9 qsv: remove mfx/ prefix from mfx headers qsv: load user plugin for MFX_VERSION < 2.0 qsv: build

[FFmpeg-devel] [PATCH] qsvenc_hevc: Enable look ahead with ExtBRC

2021-10-08 Thread Haihao Xiang
From: Daniel Socek Signed-off-by: Daniel Socek Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 3 +++ libavcodec/qsvenc_hevc.c | 1 + 2 files changed, 4 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 06f55604b5..e21a9b1207 100644 --- a/libavcodec

[FFmpeg-devel] [PATCH v5 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-10-08 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavc

[FFmpeg-devel] [PATCH v5 10/10] configure: add --enable-libvpl option

2021-10-08 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. It is recommended to use oneVPL for new work, even for currently available hardwares [1]

[FFmpeg-devel] [PATCH v5 09/10] qsv: use a new method to create mfx session when using oneVPL

2021-10-08 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add AccelerationMode config filter for D3D9/D3D11 session (galinart) The default device is changed to d3d11va for oneVPL when both d3d11va and dxva2 are enabled on Microsoft Windows This is in preparatio

[FFmpeg-devel] [PATCH v5 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-10-08 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec

[FFmpeg-devel] [PATCH v5 02/10] configure: fix the check for MFX_CODEC_VP9

2021-10-08 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v5 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-10-08 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.

[FFmpeg-devel] [PATCH v5 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-10-08 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c |

[FFmpeg-devel] [PATCH v5 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-10-08 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v5 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-10-08 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v5 03/10] qsv: remove mfx/ prefix from mfx headers

2021-10-08 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v5 00/10] make QSV works with the Intel's oneVPL

2021-10-08 Thread Haihao Xiang
dk-to-onevpl.html Haihao Xiang (10): configure: ensure --enable-libmfx uses libmfx 1.x configure: fix the check for MFX_CODEC_VP9 qsv: remove mfx/ prefix from mfx headers qsv: load user plugin for MFX_VERSION < 2.0 qsv: build audio related code when MFX_VERSION < 2.0 qsvenc: support

[FFmpeg-devel] [PATCH v4 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-09-22 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavc

[FFmpeg-devel] [PATCH v4 10/10] configure: add --enable-libvpl option

2021-09-22 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. It is recommended to use oneVPL for new work, even for currently available hardwares [1]

[FFmpeg-devel] [PATCH v4 09/10] qsv: use a new method to create mfx session when using oneVPL

2021-09-22 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add AccelerationMode config filter for D3D9/D3D11 session (galinart) The default device is changed to d3d11va for oneVPL when both d3d11va and dxva2 are enabled on Microsoft Windows This is in preparatio

[FFmpeg-devel] [PATCH v4 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-09-22 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec

[FFmpeg-devel] [PATCH v4 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-09-22 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.

[FFmpeg-devel] [PATCH v4 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-09-22 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c |

[FFmpeg-devel] [PATCH v4 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-09-22 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v4 03/10] qsv: remove mfx/ prefix from mfx headers

2021-09-22 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v4 02/10] configure: fix the check for MFX_CODEC_VP9

2021-09-22 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v4 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-09-22 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v4 00/10] make QSV works with the Intel's oneVPL

2021-09-22 Thread Haihao Xiang
r and fixed bugs [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/index.html [2] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-matrix [3] https://software.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html Haihao Xiang (10): conf

[FFmpeg-devel] [PATCH 2/2] ffmpeg_opt: consider HW acceleration method when selecting decoder

2021-09-22 Thread Haihao Xiang
Usually a HW decoder is expected when user specifies a HW acceleration method via -hwaccel option, however the current implementation doesn't take HW acceleration method into account, it is possible to select a SW decoder. For example: $> ffmpeg -hwaccel vaapi -i av1.ivf -f null - ... Stream #0:0

[FFmpeg-devel] [PATCH 1/2] ffmpeg_opt: select a decoder after getting values for per-stream hwdec options

2021-09-22 Thread Haihao Xiang
After applying this patch, the desired HW acceleration method is known before selecting decoder, so we may take HW acceleration method into account when selecting decoder for input stream in the next commit There should be no functional changes in this patch --- fftools/ffmpeg_opt.c | 116 +++

[FFmpeg-devel] [PATCH v3 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-09-17 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.

[FFmpeg-devel] [PATCH v3 10/10] configure: add --enable-libvpl option

2021-09-17 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2 is the required minimum version when building Intel oneVPL code. It will fail to run configure script if both libmfx and libvpl are enabled. --- configure | 26 -- 1 file changed, 20 insertions(+), 6 deletio

[FFmpeg-devel] [PATCH v3 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-09-17 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavc

[FFmpeg-devel] [PATCH v3 09/10] qsv: use a new method to create mfx session when using oneVPL

2021-09-17 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add AccelerationMode config filter for D3D9/D3D11 session (galinart) The default device is changed to d3d11va for oneVPL when both d3d11va and dxva2 are enabled on Microsoft Windows This is in preparatio

[FFmpeg-devel] [PATCH v3 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-09-17 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec

[FFmpeg-devel] [PATCH v3 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-09-17 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c |

[FFmpeg-devel] [PATCH v3 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-09-17 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v3 03/10] qsv: remove mfx/ prefix from mfx headers

2021-09-17 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v3 02/10] configure: fix the check for MFX_CODEC_VP9

2021-09-17 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v3 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-09-17 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v3 00/10] make QSV works with the Intel's oneVPL

2021-09-17 Thread Haihao Xiang
ource/index.html [2] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-matrix Haihao Xiang (10): configure: ensure --enable-libmfx uses libmfx 1.x configure: fix the check for MFX_CODEC_VP9 qsv: remove mfx/ prefix from mfx headers qsv: load user plugin for MFX_VERSION < 2

[FFmpeg-devel] [PATCH] libavcodec/hevc_mp4toannexb_bsf: ignore extra data if possible

2021-09-09 Thread Haihao Xiang
It is possible that an IRAP frame in input AVPacket has SPS and PPS, and these headers should take effect. Hence we should not prepend extra data to IRAP frame in this case, otherwise an IRAP frame in output AVPacket will have 2 SPS/PPS when extra data also has SPS and PPS, the second SPS/PPS will

[FFmpeg-devel] [PATCH v2 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-08-16 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c

[FFmpeg-devel] [PATCH v2 10/10] configure: add --enable-libvpl option

2021-08-16 Thread Haihao Xiang
This allows user to build FFmpeg against Intel's oneVPL SDK. oneVPL 2.2 is the required minimum version when building Intel oneVPL SDK code. It will fail to run configure script if both libmfx and libvpl are enabled. --- configure | 26 -- 1 file changed, 20 insertions(+),

[FFmpeg-devel] [PATCH v2 09/10] qsv: use a new method to create mfx session when using the oneVPL SDK

2021-08-16 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a workable mfx session[1] Add AccelerationMode config filter for D3D9 session (galinart) This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/programming_guide/VPL_prg_sessi

[FFmpeg-devel] [PATCH v2 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-08-16 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.

[FFmpeg-devel] [PATCH v2 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-08-16 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavc

[FFmpeg-devel] [PATCH v2 03/10] qsv: remove mfx/ prefix from mfx headers

2021-08-16 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to

[FFmpeg-devel] [PATCH v2 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-08-16 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec

[FFmpeg-devel] [PATCH v2 02/10] configure: fix the check for MFX_CODEC_VP9

2021-08-16 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by MFX_VERSION_NEXT, which means those data structures have never been used in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is added in mfxstructures.h. In addition, mfxdefs.h is included in mfxvp9.h, so we may use the check in thi

[FFmpeg-devel] [PATCH v2 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-08-16 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1]: https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2]: https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c |

[FFmpeg-devel] [PATCH v2 00/10] make QSV works with Intel's oneVPL

2021-08-16 Thread Haihao Xiang
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/index.html [2] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-matrix Haihao Xiang (10): configure: ensure --enable-libmfx uses libmfx 1.x configure: fix the check for MFX_CODEC_VP9 qsv: remove mfx/ prefix from mfx he

[FFmpeg-devel] [PATCH v2 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-08-16 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx as library name[2], however some of obsolete features, including OPAQUE memory, multi-frame encode, user plugins and LA_EXT rate control mode etc, have been

[FFmpeg-devel] [PATCH v2] lavc/qsvenc: allows the SDK runtime to choose LowPower/non-LowPower modes

2021-08-11 Thread Haihao Xiang
The SDK supports LowPower and non-LowPower modes, but some features are available only under one of the two modes. Currently non-LowPower mode is always chosen in FFmpeg if the mode is not set to LowPower explicitly. User will experience some SDK errors if a LowPower related feature is specified bu

[FFmpeg-devel] [PATCH] ffmpeg_hw: Don't ignore key parameters when initializing a hw device

2021-08-10 Thread Haihao Xiang
Currently user may use '-init_hw_device type=name' to initialize a hw device, however the key parameter is ignored when use '-init_hw_device type=name,key=value'. After applying this patch, user may set key parameter if needed. --- fftools/ffmpeg_hw.c | 16 +++- 1 file changed, 15 inse

[FFmpeg-devel] [PATCH v3 2/2] doc/examples/qsvdec: simplify this example via hw_device_ctx interface

2021-08-10 Thread Haihao Xiang
--- doc/examples/qsvdec.c | 45 +-- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c index 7415eefca5..571d868f93 100644 --- a/doc/examples/qsvdec.c +++ b/doc/examples/qsvdec.c @@ -44,38 +44,10 @@

[FFmpeg-devel] [PATCH v3 1/2] qsvdec: add support for HW_DEVICE_CTX method

2021-08-10 Thread Haihao Xiang
This allows user set hw_device_ctx instead of hw_frames_ctx for QSV decoders, hence we may remove the ad-hoc libmfx setup code from FFmpeg. "-hwaccel_output_format format" is applied to QSV decoders after removing the ad-hoc libmfx code. In order to keep compatibility with old commandlines, the de

[FFmpeg-devel] [PATCH v2] avfilter: add QSV variants of the stack filters

2021-08-05 Thread Haihao Xiang
Include hstack_qsv, vstack_qsv and xstack_qsv, some code is copy and pasted from other filters Example: $> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -filter_complex "[0:v][0:v]hstack_qsv" -f null - --- v2: fix wrong reference in filters.texi configure | 6 + doc/filters.

[FFmpeg-devel] [PATCH] lavc/qsvenc_hevc: add -pic_timing_sei option

2021-08-05 Thread Haihao Xiang
The SDK may insert picture timing SEI for hevc and the code to set mfx parameter has been added in qsvenc, however the corresponding option is missing in the hevc option array --- libavcodec/qsvenc_hevc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsv

[FFmpeg-devel] [PATCH v5 20/20] lavfi/deinterlace_qsv: add more input / output pixel formats

2021-08-05 Thread Haihao Xiang
NV12 is added in system memory and the command below may work now. $ ffmpeg -init_hw_device qsv -c:v h264_qsv -i input.h264 -vf deinterlace_qsv -f null - --- libavfilter/vf_vpp_qsv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_v

[FFmpeg-devel] [PATCH v5 16/20] lavfi/vpp_qsv: check output format string against NULL pointer

2021-08-05 Thread Haihao Xiang
This is in preparation for re-using VPPContext but with a different option array for deinterlacing_qsv filter --- libavfilter/vf_vpp_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 3eddefea31..f7854f81bf 100644 ---

[FFmpeg-devel] [PATCH v5 18/20] lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter

2021-08-05 Thread Haihao Xiang
All features are implemented in vpp_qsv filter now, so deinterlace_qsv can be taken as a specical case of vpp_qsv filter, we re-use VPPContext with a different option array and pix formats for deinterlace_qsv filter A new option -rate is used to control the output frame rate, by default it will ou

[FFmpeg-devel] [PATCH v5 19/20] lavfi/deinterlace_qsv: add async_depth option

2021-08-05 Thread Haihao Xiang
Allow user to set async depth for deinterlace_qsv --- libavfilter/vf_vpp_qsv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 518595d91e..edd10f5af6 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -730,6 +730,7

[FFmpeg-devel] [PATCH v5 17/20] lavfi/deinterlace_qsv: simplify deinterlace_qsv filter

2021-08-05 Thread Haihao Xiang
Like what we did for scale_qsv filter, we use QSVVPPContext as a base context to manage MFX session for deinterlace_qsv filter --- libavfilter/vf_deinterlace_qsv.c | 492 ++- 1 file changed, 30 insertions(+), 462 deletions(-) diff --git a/libavfilter/vf_deinterlace_qsv

[FFmpeg-devel] [PATCH v5 15/20] lavfi/qsvvpp: set PTS for output frame

2021-08-05 Thread Haihao Xiang
When the SDK returns MFX_ERR_MORE_SURFACE, the PTS is not set for the output frame. We assign a PTS calculated from the input frame to the output frame. After applying this patch, we may avoid the error below: [null @ 0x56395cab4ae0] Application provided invalid, non monotonically increasing dts t

[FFmpeg-devel] [PATCH v5 14/20] lavfi/qsvvpp: avoid overriding the returned value

2021-08-05 Thread Haihao Xiang
Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() is overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always false when MFX_ERR_MORE_SURFACE is returned from MFXVideoVPP_RunFrameVPPAsync() --- libavfilter/qsvvpp.c | 11 --- 1 file changed, 8 insertions(+), 3 dele

  1   2   3   >