[FFmpeg-devel] [PATCH] cbs_h264: Need [] in the name when subscript is required

2018-05-03 Thread Haihao Xiang
Otherwise it will hit an assert in the function ff_cbs_trace_syntax_element() in cbs.c, line 400. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/cbs_h264_syntax_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liba

[FFmpeg-devel] [PATCH v3 1/4] cbs_h265: read/write HEVC PREFIX SEI

2018-05-09 Thread Haihao Xiang
below: ffmpeg -i input-with-sei.mkv -c:v copy -bsf:v trace_headers -f null - Fix the ranges for max_display_mastering_luminance and min_display_mastering_luminance Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/cbs_h2645.c| 45 ++ libavcodec/cbs_

[FFmpeg-devel] [PATCH v3 4/4] vaapi_encode_h265: Insert content light level information

2018-05-09 Thread Haihao Xiang
v2: clip the value to 16bits and look for the metadata on I/IDR frame Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/libavcodec/vaapi_encode_h2

[FFmpeg-devel] [PATCH v3 2/4] vaapi_encode_h265: Insert mastering display colour volume if needed

2018-05-09 Thread Haihao Xiang
as a ORed value so that we needn't check the correspoding SEI message again when writting the header. v3: fix typo in commit log, change the option to '-sei hdr' and add some comments about the medtadata update Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.c

[FFmpeg-devel] [PATCH 2/2] hwcontext_vaapi: Add an assert in vaapi_map_from_drm()

2018-05-09 Thread Haihao Xiang
Every fourcc in vaapi_drm_format_map should be in vaapi_format_map, so add an assert to ensure we have the right maps. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavutil/hwcontext_vaapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/hwcontext_vaa

[FFmpeg-devel] [PATCH 1/2] vaapi_encode: Add an assert in vaapi_encode_truncate_gop()

2018-05-09 Thread Haihao Xiang
The flag of input_available must be set when pic_start is not NULL, so add an assert to ensure it is true. In addition, the assert on last_pic is unnecessary now, so remove this assert. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode.c | 4 ++-- 1 file chan

[FFmpeg-devel] [PATCH] qsv: Use the installed mfx include headers if possibile

2018-05-11 Thread Haihao Xiang
-by: Haihao Xiang <haihao.xi...@intel.com> --- configure| 3 ++- fftools/ffmpeg_qsv.c | 5 + libavcodec/qsv.c | 10 ++ libavcodec/qsv.h | 4 libavcodec/qsv_internal.h| 4 libavcodec/qs

[FFmpeg-devel] [PATCH 1/3] vaapi_encode: Initialize the pointer

2018-05-04 Thread Haihao Xiang
Otherwise it might use unitialized last_pic in av_assert0(last_pic) Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 36c8

[FFmpeg-devel] [PATCH 2/3] hwcontext_vaapi: Return error if can not find a VA RT format

2018-05-04 Thread Haihao Xiang
Otherwise va_rt_format might be unitialized Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavutil/hwcontext_vaapi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 7daaa951cc..e59042487d 100644 --- a/lib

[FFmpeg-devel] [PATCH 3/3] vaapi_encode_vp8: memset the the structure to 0

2018-05-04 Thread Haihao Xiang
The structure has reserved bytes, it is required to set the reserved bytes to 0 for future use. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_vp8.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_enco

[FFmpeg-devel] [PATCH 1/2] hevcdec: Miss the location of chroma samples when exporting stream parameters

2018-05-16 Thread Haihao Xiang
Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/hevcdec.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index c8877626d2..13d868bb4f 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -344,6 +344,11 @@

[FFmpeg-devel] [PATCH 2/2] ffmpeg: Use the colour properties from the input stream when doing transcode

2018-05-16 Thread Haihao Xiang
-by: Haihao Xiang <haihao.xi...@intel.com> --- fftools/ffmpeg.c | 4 1 file changed, 4 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 5a19a09d9a..80b5441f8f 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3298,6 +3298,10 @@ static int init_output_stream_

[FFmpeg-devel] [PATCH] vaapi_encode_h264: Take VAAPIEncodeH264Context::sei_needed as an ORed value

2018-05-02 Thread Haihao Xiang
We may check priv->sei_needed only when writing SEI messages. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h264.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_en

[FFmpeg-devel] [PATCH 4/4] vaapi_encode_h265: Insert content light level information

2018-05-02 Thread Haihao Xiang
Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 326fe4fe66..5fe487dfc5

[FFmpeg-devel] [PATCH 1/4] cbs_h265: read/write HEVC PREFIX SEI

2018-05-02 Thread Haihao Xiang
Similar to H264, cbs_h265_{read, write}_nal_unit() can handle HEVC prefix SEI NAL units. Currently mastering display colour volume SEI message is added only, we may add more SEI message if needed later v2: Fix coding style and rebase the code Signed-off-by: Haihao Xiang <haihao.xi...@intel.

[FFmpeg-devel] [PATCH 2/4] vaapi_encode_h265: Insert mastering display colour colume if needed

2018-05-02 Thread Haihao Xiang
as a ORed value so that we needn't check the correspoding SEI message again when writting the header. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.c | 128 - 1 file changed, 127 insertions(+), 1 deletion(-) diff

[FFmpeg-devel] [PATCH 3/4] cbs_h265: read/write content light level information SEI message

2018-05-02 Thread Haihao Xiang
Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/cbs_h2645.c| 1 + libavcodec/cbs_h265.h | 6 ++ libavcodec/cbs_h265_syntax_template.c | 17 + 3 files changed, 24 insertions(+) diff --git a/libavcodec/cbs_h26

[FFmpeg-devel] [PATCH] lavc/vaapi_encode_h264: Return AVERROR(ENOSYS)

2018-02-13 Thread Haihao Xiang
The corresponding feature is not implemented for old versions of VA-API, the returned value should be AVERROR(ENOSYS) Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liba

[FFmpeg-devel] [PATCH] lavc/vaapi_encode: Don't pass VAConfigAttribEncPackedHeaders with value set to 0

2018-02-13 Thread Haihao Xiang
messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the future. See https://github.com/intel/libva/issues/178 for more information. This fixes broken vp9 encoder on Kably Lake with Intel I965 driver. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode.c | 4 +

[FFmpeg-devel] [PATCH] lavc/vaapi_encode_vp9: add support for low-power encoding

2018-02-06 Thread Haihao Xiang
Although VAEntrypointEncSliceLP was added in old version of VAAPI, we never implemented it for VAAPI VP9 encoder before. so it is reasonable to require VAAPI 1.0 Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_vp9.c | 19 ++- 1 file chang

[FFmpeg-devel] [PATCH] lavc/vaapi_encode_h265: add support for low-power encoding

2018-02-06 Thread Haihao Xiang
Although VAEntrypointEncSliceLP was added in old version of VAAPI, we never implemented it for VAAPI H265 encoder before. so it is reasonable to require VAAPI 1.0 Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.c | 18 +- 1 file chang

[FFmpeg-devel] [PATCH] lavc/vaapi_encode: Don't return error if the underlying driver doesn't support B frame

2018-02-06 Thread Haihao Xiang
It is possible B frame is not supported for VAEntrypointEncSliceLP and the underlying driver has advertised it, so it is better to disable B frame instead of returning error for this case Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode.c | 7 +++

[FFmpeg-devel] [PATCH 2/2] vaapi_encode_h265: Insert mastering display colour colume if needed

2018-04-20 Thread Haihao Xiang
'-sei xxx' is added to control SEI insertion, so far only mastering display colour colume is available for testing. Another patch is required to change mastering display settings later. Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/vaapi_encode_h265.

[FFmpeg-devel] [PATCH 1/2] cbs_h265: read/write HEVC PREFIX SEI

2018-04-20 Thread Haihao Xiang
Similar to cbs_h264, cbs_h265_{read, write}_nal_unit() can handle HEVC prefix SEI NAL units now. Currently mastering display colour volume SEI message is added only, we may add more SEI message if needed later Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/cbs_h

[FFmpeg-devel] [PATCH] lavc/hevc: Don't parse NAL unit for a dummy buffer

2018-03-27 Thread Haihao Xiang
hevc parser mistakenly reports the following message if a dummy buffer is padded for EOF [hevc @ 0x559b63848610] missing picture in access unit Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/hevc_parser.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)

[FFmpeg-devel] [PATCH v2] lavc/hevc: Don't parse NAL unit for a dummy buffer

2018-03-29 Thread Haihao Xiang
hevc parser mistakenly reports the following message if a dummy buffer is padded for EOF [hevc @ 0x559b63848610] missing picture in access unit v2: use the preferred code style and rebase the patch Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> --- libavcodec/hevc_parser

[FFmpeg-devel] [PATCH] Fix link errors when HAVE_X86ASM is not defined

2018-11-20 Thread Haihao Xiang
: *** [ffmpeg_g] Error 1 Signed-off-by: Haihao Xiang --- libavfilter/x86/scene_sad_init.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavfilter/x86/scene_sad_init.c b/libavfilter/x86/scene_sad_init.c index 461fa406d9..7e93ef44d3 100644 --- a/libavfilter/x86/scene_sad_init.c +++ b

[FFmpeg-devel] [PATCH] ffmpeg_qsv: use -hwaccel_device to specify a device for VAAPI backend

2020-09-01 Thread Haihao Xiang
According to the FFmpeg documentation, -hwaccel_device can be used to select a device for hardware acceleration Example: ffmpeg -hwaccel qsv -hwaccel_device /dev/dri/renderD129 -c:v h264_qsv \ -i in.h264 -c:v hevc_qsv out.h265 --- fftools/ffmpeg_qsv.c | 8 1 file changed, 8

[FFmpeg-devel] [PATCH v2] qsv: add ${includedir}/mfx to the search path for old versions of libmfx

2020-09-07 Thread Haihao Xiang
${includedir}/mfx has been added to Cflags in libmfx.pc in new versions of libmfx. We may add ${includedir}/mfx to the search path for old versions of libmfx so that we may inlcude mfxfoo.h instead of mfx/mfxfoo.h If your libmfx comes without pkg-config support, this patch requires a small change

[FFmpeg-devel] [PATCH v2 4/7] lavc/hevc_ps: Add slice parse support for HEVC SCC extension

2020-09-10 Thread Haihao Xiang
From: Linjie Fu Signed-off-by: Linjie Fu --- libavcodec/hevcdec.c | 6 ++ libavcodec/hevcdec.h | 4 2 files changed, 10 insertions(+) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index b77df8d89f..cbfcf492a0 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@

[FFmpeg-devel] [PATCH v2 5/7] lavc/hevcdec: Fix the parsing for use_integer_mv_flag

2020-09-10 Thread Haihao Xiang
From: Linjie Fu According to 7.3.6.1, use_integer_mv_flag should be parsed if motion_vector_resolution_control_idc equals to 2. Otherwise wrong parameters in the subsequent parsing procedures would be got. Signed-off-by: Linjie Fu --- libavcodec/hevcdec.c | 8 libavcodec/hevcdec.h |

[FFmpeg-devel] [PATCH v2 3/7] lavc/hevc_ps: Add pps parse support for HEVC SCC extension

2020-09-10 Thread Haihao Xiang
From: Linjie Fu Signed-off-by: Linjie Fu Signed-off-by: Haihao Xiang --- v2 update: - Ignore pps_multilayer_extension_flag, pps_3d_extension_flag and pps_scc_extension_flag for non-SCC streams - Return AVERROR_PATCHWELCOME for pps_multilayer_extension_flag(1) and pps_3d_extension_flag(1

[FFmpeg-devel] [PATCH v2 1/7] lavc/avcodec: Add FF_PROFILE_HEVC_SCC for screen content coding

2020-09-10 Thread Haihao Xiang
From: Linjie Fu Signed-off-by: Linjie Fu --- libavcodec/avcodec.h | 1 + libavcodec/hevc_ps.c | 2 ++ libavcodec/profiles.c | 1 + 3 files changed, 4 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c91b2fd169..32e4770de2 100644 --- a/libavcodec/avcodec.h +++

[FFmpeg-devel] [PATCH v2 0/7] HEVC native support for Screen content coding

2020-09-10 Thread Haihao Xiang
Resend Linjie's patchset with the updates. As a part of the support for VA-API HEVC SCC decoding (gen12, Tiger Lake+). The full support could be accessed in: https://github.com/intel-media-ci/ffmpeg/pull/231 The VAAPI part would be provided later once the implementations of native parsing and

[FFmpeg-devel] [PATCH v2 2/7] lavc/hevc_ps: Add sps parse support for HEVC SCC extension syntax

2020-09-10 Thread Haihao Xiang
From: Linjie Fu According to 7.3.2.2.3 in T-REC-H.265-201911. Signed-off-by: Linjie Fu Signed-off-by: Haihao Xiang --- v2 update: - Ignore sps_multilayer_extension_flag, sps_3d_extension_flag and sps_scc_extension_flag for non-SCC streams - Return AVERROR_PATCHWELCOME

[FFmpeg-devel] [PATCH v2 6/7] lavc/hevcdec: Set max_num_merge_cand to uint8_t

2020-09-10 Thread Haihao Xiang
From: Linjie Fu uint8_t is big enough and keep consistent with the definition in cbs_h265.h. Signed-off-by: Linjie Fu --- libavcodec/hevcdec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 1164af2862..464eb7cd3c 100644

[FFmpeg-devel] [PATCH v2 7/7] lavc/hevc: Update reference list for SCC

2020-09-10 Thread Haihao Xiang
From: Linjie Fu Screen Content Coding allows non-intra slice in an IDR frame, and would mark the current decoded picture as "used for long-term reference", no matter TwoVersionsOfCurrDecPicFlag(8.1.3), hence some previous restricts are not suitable any more. Constructe RefPicListTemp and

[FFmpeg-devel] [PATCH 2/6] qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL)

2020-09-16 Thread Haihao Xiang
See https://spec.oneapi.com/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals https://github.com/oneapi-src/oneVPL --- libavcodec/qsv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index

[FFmpeg-devel] [PATCH 6/6] qsv: libmfx no longer supports OPAQUE memory since version 2.0 (oneVPL)

2020-09-16 Thread Haihao Xiang
--- libavcodec/qsv.c | 4 ++ libavcodec/qsv.h | 2 + libavcodec/qsv_internal.h| 2 + libavcodec/qsvdec.c | 9 libavcodec/qsvenc.c | 21 + libavcodec/qsvenc.h | 2 + libavfilter/qsvvpp.c |

[FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when using libmfx 2.0 (oneVPL)

2020-09-16 Thread Haihao Xiang
-devel/2020-September/269334.html Haihao Xiang (6): qsv: add ${includedir}/mfx to the search path for old versions of libmfx qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL) qsv: libmfx no longer supports audio since version 2.0 (oneVPL) qsvenc: libmfx no longer

[FFmpeg-devel] [PATCH 1/6] qsv: add ${includedir}/mfx to the search path for old versions of libmfx

2020-09-16 Thread Haihao Xiang
${includedir}/mfx has been added to Cflags in libmfx.pc for the current libmfx. We may add ${includedir}/mfx to the search path for olda versions of libmfx so that we may include foo.h instead of mfx/foo.h After applying this change, we won't need to change #include to include the right header

[FFmpeg-devel] [PATCH 3/6] qsv: libmfx no longer supports audio since version 2.0 (oneVPL)

2020-09-16 Thread Haihao Xiang
--- libavcodec/qsv.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 472e0952b3..2b77fdb2bf 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -143,8 +143,10 @@ static const struct { { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL),

[FFmpeg-devel] [PATCH 5/6] qsvenc: libmfx no longer supports MFX_RATECONTROL_LA_EXT since version 2.0 (oneVPL)

2020-09-16 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 3c66eed554..88a8a99517 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -100,7 +100,7 @@ static const struct { #if QSV_HAVE_VCM {

[FFmpeg-devel] [PATCH 4/6] qsvenc: libmfx no longer supports multi-frame encode since version 2.0 (oneVPL)

2020-09-16 Thread Haihao Xiang
--- libavcodec/qsvenc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index 77f886981c..9f3dc0b2ad 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -64,7 +64,7 @@ #define QSV_HAVE_ICQQSV_VERSION_ATLEAST(1, 28)

[FFmpeg-devel] [PATCH] lavc/qsvdec: Add QSV AV1 decoder

2020-09-16 Thread Haihao Xiang
AV1 decoder is supported on Tiger Lake+ platforms since libmfx 1.34 Signed-off-by: Haihao Xiang --- Changelog | 1 + configure | 1 + libavcodec/allcodecs.c| 1 + libavcodec/qsv.c | 4 libavcodec/qsvdec_other.c | 31

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

2020-10-10 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 explicitly, which will result in some SDK errors if a feature is unavailable under non-LowPower mode.

[FFmpeg-devel] [PATCH 2/2] qsv: remove audio error code

2020-08-19 Thread Haihao Xiang
--- libavcodec/qsv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index faa424bb68..6776b745b9 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -143,8 +143,6 @@ static const struct { { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL),

[FFmpeg-devel] [PATCH 1/2] qsv: needn't load user plugin since libmfx 1.28

2020-08-19 Thread Haihao Xiang
MFXVideoUSER_Load call is redundant since libmfx 1.28 --- libavcodec/qsv.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 55184e075a..faa424bb68 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -19,7 +19,6 @@ */

[FFmpeg-devel] [PATCH] qsv: add ${includedir}/mfx to the search path for old version of libmfx

2020-08-18 Thread Haihao Xiang
${inludedir}/mfx has been added to Cflags in libmfx.pc in new versions of libmfx. We may add ${includedir}/mfx to the search path for old version of libmfx so that we may inlcude mxfxxx.h instead of mfx/mf.h in FFmpeg If your libmfx comes without pkg-config support, this patch requires a

[FFmpeg-devel] [PATCH v2 1/2] qsv: needn't load user plugin since libmfx 1.28

2020-08-20 Thread Haihao Xiang
MFXVideoUSER_Load call is redundant since libmfx 1.28 --- Fixed merge conflict when applying this patch by 'git am' libavcodec/qsv.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 17720070f1..56a30ad642 100644 ---

[FFmpeg-devel] [PATCH] lavc/qsvenc: let the SDK to choose the encoding mode by default

2020-09-28 Thread Haihao Xiang
The SDK may support LowPower and non-LowPower modes, some features are available only under one of the two modes. It is hard for user to know whether a feature is supported under the given mode, so let the SDK to choose a mode for encoding by default. --- libavcodec/qsvenc.c | 6 --

[FFmpeg-devel] [PATCH] lavc/qsvenc: add support for Screen Content Coding (SCC) extension

2020-09-28 Thread Haihao Xiang
This patch adds support for SCC encoding on ICL+ platform Sample pipeline: ffmpeg -init_hw_device qsv=qsv:hw -f lavfi -i testsrc -vf \ "format=nv12,hwupload=extra_hw_frames=64,format=qsv" -c:v hevc_qsv \ -profile:v scc -low_power 1 out.h265 --- libavcodec/qsvenc.c | 3 +++

[FFmpeg-devel] [PATCH] ffmpeg_qsv: respect hwaccel_output_format setting

2020-10-21 Thread Haihao Xiang
Without this change, the output pixel format from qsv decoder is always 'qsv' regardless of the hwaccel_output_format setting, user will get errors when FFmpeg inserts an auto filter to convert 'qsv' format to the specified format Fox example: ffmpeg -loglevel verbose -hwaccel qsv -c:v h264_qsv

[FFmpeg-devel] [PATCH 1/2] hwcontext_vaapi: the first parameter is the AVHWFramesContext for dst

2020-06-19 Thread Haihao Xiang
vaapi_map_from_drm() is the implementation of map_to when src format is AV_PIX_FMT_DRM_PRIME, and the first parameter of map_to is the AVHWFramesContext for dst Signed-off-by: Haihao Xiang --- libavutil/hwcontext_vaapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[FFmpeg-devel] [PATCH 2/2] hwcontext_vaapi: try VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 firstly when importing a DMABuf

2020-06-19 Thread Haihao Xiang
User should provide the modifier when importing a DMABuf if this DMABuf has modifier. Signed-off-by: Haihao Xiang --- libavutil/hwcontext_vaapi.c | 137 +--- 1 file changed, 126 insertions(+), 11 deletions(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil

[FFmpeg-devel] [PATCH] hwcontext_vaapi: remove duplicate formats from sw_format list

2020-07-23 Thread Haihao Xiang
o_scaler_0 @ 0x560df58f4550] w:iw h:ih flags:'bicubic' interl:0 [Parsed_hwupload_0 @ 0x560df58f0ec0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_hwupload_0' Signed-off-by: Haihao Xiang --- libavutil/hwcontext_va

[FFmpeg-devel] [PATCH] hwcontext_vaapi: avoid fd leak in vaapi_device_derive

2020-07-24 Thread Haihao Xiang
--- libavutil/hwcontext_vaapi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index fb9be19647..a4dfaba92c 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -1698,8 +1698,12 @@ static

[FFmpeg-devel] [PATCH 1/2] qsvdec: factor common options out

2020-11-25 Thread Haihao Xiang
--- libavcodec/qsvdec.h | 13 + libavcodec/qsvdec_h2645.c | 12 ++-- libavcodec/qsvdec_other.c | 6 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/libavcodec/qsvdec.h b/libavcodec/qsvdec.h index f3b7344cba..10e8cf7f91 100644 ---

[FFmpeg-devel] [PATCH 2/2] qsvdec_av1: add an option to disable film grain

2020-11-25 Thread Haihao Xiang
User may use '-disable_film_grain 1' to disable film grain. --- libavcodec/qsvdec.c | 5 + libavcodec/qsvdec.h | 2 ++ libavcodec/qsvdec_other.c | 13 - 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index

[FFmpeg-devel] [PATCH v2 1/2] lavc/qsv: make some functions inline

2020-12-06 Thread Haihao Xiang
libraries as well. Signed-off-by: Haihao Xiang --- Per the comments from Anton and James, I used inline functions instead of avpriv functions in this patch libavcodec/Makefile| 2 +- libavcodec/qsv.c | 132 --- libavcodec/qsv_core_internal.h

[FFmpeg-devel] [PATCH v2 2/2] qsv: dump more info in error, debug and verbose mode

2020-12-06 Thread Haihao Xiang
Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 1 + libavfilter/qsvvpp.c | 21 +-- libavfilter/qsvvpp.h | 10

[FFmpeg-devel] [PATCH v3 1/2] lavf/qsv: Add functions to print mfx iopattern, warning and error

2020-12-09 Thread Haihao Xiang
It is a copy of the relevant part in lavc/qsv. Signed-off-by: Haihao Xiang --- To avoid duplicated tables in the same library after applying patch ' lavc/qsv: make some functions inline', use a local copy of the relevant code in this patch libavfilter/qsvvpp.c | 104

[FFmpeg-devel] [PATCH v3 2/2] qsv: dump more info in error, debug and verbose mode

2020-12-09 Thread Haihao Xiang
Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 1 + libavfilter/qsvvpp.c | 21 +-- libavfilter/vf_deinterlace_qsv.c | 36

[FFmpeg-devel] [PATCH 1/2] lavc/qsv: use avpriv_ instead of ff_ as prefix for some functions

2020-11-23 Thread Haihao Xiang
ff_qsv_print_iopattern, ff_qsv_print_error and ff_qsv_print_warning can be used outside of lavc. In addition, ff_qsv_map_error is used in libavcodec/qsv.c only, so remove ff_ from ff_qsv_map_error and make it static. Signed-off-by: Haihao Xiang --- libavcodec/Makefile| 2

[FFmpeg-devel] [PATCH 2/2] qsv: dump more info in error, debug and verbose mode

2020-11-23 Thread Haihao Xiang
Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 1 + libavfilter/qsvvpp.c | 21 +-- libavfilter/qsvvpp.h | 10

[FFmpeg-devel] [PATCH] qsvenc: Value '0' is not a valid value for parameter GopOptFlag

2020-11-04 Thread Haihao Xiang
The accepted values for GopOptFlag are MFX_GOP_CLOSED (1) and MFX_GOP_STRICT (2). Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 1ed8f5d973..62921e82a6 100644

[FFmpeg-devel] [PATCH 1/2] qsvenc_hevc: allow user set more coding options

2020-11-04 Thread Haihao Xiang
The SDK supports NalHrdConformance, RecoveryPointSEI and AUDelimiter for hevc encoder, so we may allow user to set these coding options like as what we did for h264_qsv encoder. Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 13 + libavcodec/qsvenc_hevc.c | 2 ++ 2

[FFmpeg-devel] [PATCH 2/2] qsvenc: allow AVC/HEVC encoder violate HRD conformance by default

2020-11-04 Thread Haihao Xiang
User may get better PSNR for the given bitrate for most cases by default and use option '-strict 1' to produce HRD conformant bitstream if required Signed-off-by: Haihao Xiang --- libavcodec/qsvenc_h264.c | 1 + libavcodec/qsvenc_hevc.c | 1 + 2 files changed, 2 insertions(+) diff --git

[FFmpeg-devel] [PATCH v4 2/2] qsv: dump more info in error, debug and verbose mode

2021-01-04 Thread Haihao Xiang
Dump iopattern mode and the SDK error/warning desciptions for qsv based filters and iopattern mode for qsvenc Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 1 + libavfilter/qsvvpp.c | 21 +-- libavfilter/vf_deinterlace_qsv.c | 36

[FFmpeg-devel] [PATCH v4 1/2] lavf/qsv: Add functions to print mfx iopattern, warning and error

2021-01-04 Thread Haihao Xiang
It is a copy of the relevant part in lavc/qsv but use different function names to avoid multiple definition when linking lavc and lavf statically. Signed-off-by: Haihao Xiang --- v4: rename the new functions to avoid multiple definition libavfilter/qsvvpp.c | 104

[FFmpeg-devel] [PATCH] lavc/qsvdec: needn't free the string for AV_OPT_TYPE_STRING AVOption

2021-01-28 Thread Haihao Xiang
The string for AV_OPT_TYPE_STRING AVOption gets freed by av_opt_free() when closing the AVCodecContext Signed-off-by: Haihao Xiang --- libavcodec/qsvdec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index d10f90a0db..2d4f72b3f6 100644

[FFmpeg-devel] [PATCH v3 07/22] lavfi/vpp_qsv: factorize extra MFX configuration

2021-06-15 Thread Haihao Xiang
This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 78 +--- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 7afbb3c983..c9a7b0ceb9 100644

[FFmpeg-devel] [PATCH v3 16/22] lavfi/qsvvpp: set PTS for output frame

2021-06-15 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

[FFmpeg-devel] [PATCH v3 08/22] lavfi/vpp_qsv: pass scaling mode to the SDK

2021-06-15 Thread Haihao Xiang
After this patch, the scaling mode will be passed to the SDK when the scaling mode is not equal to the default mode. This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff

[FFmpeg-devel] [PATCH v3 06/22] lavfi/vpp_qsv: allow special values for the output dimensions

2021-06-15 Thread Haihao Xiang
Special values are: 0 = original width/height -1 = keep original aspect This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 47 ++-- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git

[FFmpeg-devel] [PATCH v3 04/22] lavfi/vpp_qsv: add "a", "dar" and "sar" variables

2021-06-15 Thread Haihao Xiang
Also fix the coding style for VAR index. This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index

[FFmpeg-devel] [PATCH v3 05/22] lavfi/vpp_qsv: handle NULL pointer when evaluating an expression

2021-06-15 Thread Haihao Xiang
This is in preparation for re-using VPPContext but with a different option array for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index

[FFmpeg-devel] [PATCH v3 15/22] lavfi/qsvvpp: avoid overriding the returned value

2021-06-15 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

[FFmpeg-devel] [PATCH v3 18/22] lavfi/deinterlace_qsv: simplify deinterlace_qsv filter

2021-06-15 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

[FFmpeg-devel] [PATCH v3 11/22] lavfi/vpp_qsv: factor common QSV filter definition

2021-06-15 Thread Haihao Xiang
--- libavfilter/vf_vpp_qsv.c | 195 +-- 1 file changed, 86 insertions(+), 109 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index dd3afb5e10..03785e9398 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@

[FFmpeg-devel] [PATCH v3 10/22] lavfi/scale_qsv: re-use VPPContext for scale_qsv filter

2021-06-15 Thread Haihao Xiang
All features are implemented in vpp_qsv filter, scale_qsv can be taken as a special case of vpp_qsv filter now, we re-use VPPContext with a different option arrary and pixel formats --- libavfilter/Makefile | 2 +- libavfilter/vf_scale_qsv.c | 334 -

[FFmpeg-devel] [PATCH v3 12/22] lavfi/scale_qsv: add new options for scale_qsv filter

2021-06-15 Thread Haihao Xiang
Allow user to set crop area and async depth --- libavfilter/vf_vpp_qsv.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 03785e9398..bceee8c4df 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -675,6

[FFmpeg-devel] [PATCH v3 09/22] lavfi/vpp_qsv: add vpp_preinit callback

2021-06-15 Thread Haihao Xiang
Set the expected default value for options in this callback, hence we have the right values even if these options are not included in the option arrray. This is in preparation for re-using VPPContext but with a different option array for other QSV filters --- libavfilter/vf_vpp_qsv.c | 14

[FFmpeg-devel] [PATCH v3 17/22] lavfi/vpp_qsv: check output format string against NULL pointer

2021-06-15 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 cdf1f61b0f..45ac761d06 100644

[FFmpeg-devel] [PATCH v3 03/22] lavfi/scale_qsv: don't need variables for constants in FFmpeg

2021-06-15 Thread Haihao Xiang
PI, PHI and E are defined in FFmpeg --- libavfilter/vf_scale_qsv.c | 9 - 1 file changed, 9 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 77a782aa58..f8e937e40e 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -44,9

[FFmpeg-devel] [PATCH v3 02/22] lavfi/scale_qsv: simplify scale_qsv filter

2021-06-15 Thread Haihao Xiang
Use QSVVPPContext as a base context of QSVScaleContext, hence we may re-use functions defined for QSVVPPContext to manage MFX session for scale_qsv filter too. Because system memory is taken into account in QSVVVPPContext, we may add support for non-QSV pixel formats in the future ---

[FFmpeg-devel] [PATCH v3 01/22] lavfi/qsv: use QSVVPPContext as base context in vf_vpp_qsv/vf_overlay_qsv

2021-06-15 Thread Haihao Xiang
The same members between QSVVPPContext and VPPContext are removed from VPPContext, and async_depth is moved from QSVVPPParam to QSVVPPContext so that all QSV filters using QSVVPPContext may support async depth. In addition we may use QSVVPPContext as base context in other QSV filters in the

[FFmpeg-devel] [PATCH v3 00/22] clean-up QSV filters

2021-06-15 Thread Haihao Xiang
Haihao Xiang (22): lavfi/qsv: use QSVVPPContext as base context in vf_vpp_qsv/vf_overlay_qsv lavfi/scale_qsv: simplify scale_qsv filter lavfi/scale_qsv: don't need variables for constants in FFmpeg lavfi/vpp_qsv: add "a", "dar" and "sar" variables lavf

[FFmpeg-devel] [PATCH v3 14/22] lavfi/vpp_qsv: double the framerate for deinterlacing

2021-06-15 Thread Haihao Xiang
--- libavfilter/vf_vpp_qsv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 29ba220665..cde1acdbb0 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -255,10 +255,16 @@ static int

[FFmpeg-devel] [PATCH v3 19/22] lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter

2021-06-15 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 --- libavfilter/Makefile | 2 +- libavfilter/vf_deinterlace_qsv.c |

[FFmpeg-devel] [PATCH v3 21/22] lavfi/deinterlace_qsv: add more input / output pixel formats

2021-06-15 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

[FFmpeg-devel] [PATCH v3 22/22] lavfi/vpp_qsv: allow user to set scaling mode for vpp_qsv filter

2021-06-15 Thread Haihao Xiang
option 'scaling' accepts one of low_power and hq $ ffmpeg -init_hw_device qsv -hwaccel qsv -c:v h264_qsv -i input.h264 -vf "vpp_qsv=scaling=hq" -f null - --- libavfilter/vf_vpp_qsv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavfilter/vf_vpp_qsv.c

[FFmpeg-devel] [PATCH v3 20/22] lavfi/deinterlace_qsv: add async_depth option

2021-06-15 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 ba7d3488f1..99659a5523 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -713,6 +713,7

[FFmpeg-devel] [PATCH v3 13/22] lavfi/scale_qsv: add more input / output pixel formats

2021-06-15 Thread Haihao Xiang
NV12 and P010 are added $ ffmpeg -init_hw_device qsv -c:v h264_qsv -i input.h264 -vf "scale_qsv=format=p010" -f null - --- libavfilter/vf_vpp_qsv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index

[FFmpeg-devel] [PATCH 1/2] lavc/qsvdec: fix pts

2021-06-08 Thread Haihao Xiang
The time base used for compressed bitstream and video frame in the SDK is { 1, 9 }. [1][2] This can avoid the error message below from the muxer. $> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -f null - ... [null @ 0x561c24f6f2f0] Application provided invalid, non monotonically

[FFmpeg-devel] [PATCH 2/2] lavfi/vf_vpp_qsv: fix the time_base for outlink

2021-06-08 Thread Haihao Xiang
Since commit 89ffcd1, the pts on output pad is in the time base of the input link, not the time base of the output link when EOF is reached, so a filter after vpp_qsv might output some unexpected frames. In order to avoid this issue, use the same time base for input and ouput links The issue can

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

2021-06-09 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 - --- configure | 6 + libavfilter/Makefile | 3 +

[FFmpeg-devel] [PATCH v2 2/2] lavfi/vf_vpp_qsv: fix the time_base for outlink

2021-06-10 Thread Haihao Xiang
Since commit 89ffcd1, the status pts of the output link is set to a value in the input link time base, not in the output link time base when EOF is reached. Usually this pst value is larger than the required one because the output link time base is more greater than the input link time base. When

[FFmpeg-devel] [PATCH v2 1/2] lavc/qsvdec: fix pts

2021-06-10 Thread Haihao Xiang
The time base used for compressed bitstream and video frame in the SDK is { 1, 9 }. [1][2] This can avoid the error message below from the muxer. $> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -f null - ... [null @ 0x561c24f6f2f0] Application provided invalid, non monotonically

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

2021-06-22 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

  1   2   3   >