[FFmpeg-devel] [PATCH 2/2] lavfi/ddagrab: Fix 8-bit BGR output to not advertise an alpha component

2023-10-22 Thread Mark Thompson
There is never an alpha component here, so the actual format is BGR0 rather than BGRA. This fixes cases which maintain the alpha component and therefore generate unexpected results. --- E.g. fixes download and encode with PNG to make an RGB PNG as expected, rather than an RGBA PNG with nothing

[FFmpeg-devel] [PATCH 1/2] hwcontext_d3d11: Add BGR0 support

2023-10-22 Thread Mark Thompson
The 8-bit four-component DXGI container is also used for three-component RGB without alpha. --- This list is only used for AV->DXGI mapping, so it doesn't matter that there are duplicate DXGI formats in the list. libavutil/hwcontext_d3d11va.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [FFmpeg-devel] [PATCH 2/6] avcodec/cbs: Do not assert on traces beyond 255 bits

2023-10-22 Thread Mark Thompson
On 22/10/2023 01:35, Michael Niedermayer wrote: Fixes: Assertion length < 256 failed at libavcodec/cbs.c:517 Fixes: 62673/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-6490971837431808 Found-by: continuous fuzzing process

Re: [FFmpeg-devel] [PATCH] amfenc: Use a blocking call instead of sleeping and polling

2023-10-22 Thread Mark Thompson
On 19/10/2023 17:13, Evgeny Pavlov wrote: On Wed, Oct 18, 2023 at 10:36 PM Mark Thompson wrote: --- On 17/10/2023 18:11, Evgeny Pavlov wrote: The reason for using av_usleep() here is that AMF API doesn’t provide an API for explicit wait. There are two modes to get output from encoder: 1

Re: [FFmpeg-devel] [PATCH avcodec/amfenc: 10 bit support, v4, 1/3] avcodec/amfenc: Fixes the color information in the output.

2023-10-18 Thread Mark Thompson
On 17/10/2023 19:00, Evgeny Pavlov wrote: On Mon, Oct 16, 2023 at 11:41 PM Mark Thompson wrote: ... @@ -785,6 +787,41 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) return ret; } +int ff_amf_get_color_profile(AVCodecContext *avctx) +{ +amf_int64

[FFmpeg-devel] [PATCH] amfenc: Use a blocking call instead of sleeping and polling

2023-10-18 Thread Mark Thompson
--- On 17/10/2023 18:11, Evgeny Pavlov wrote: The reason for using av_usleep() here is that AMF API doesn’t provide an API for explicit wait. There are two modes to get output from encoder: 1. Polling with some sleep to avoid CPU thrashing – currently used in FFmpeg 2. Set timeout parameter on

Re: [FFmpeg-devel] [PATCH avcodec/amfenc: 10 bit support, v4, 1/3] avcodec/amfenc: Fixes the color information in the output.

2023-10-16 Thread Mark Thompson
On 09/10/2023 10:52, Evgeny Pavlov wrote: From: Michael Fabian 'Xaymar' Dirks added 10 bit support for amf hevc. before: command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file.mkv -an -c:v h264_amf res.dx11_hw_h264.mkv output - Format of input

Re: [FFmpeg-devel] [PATCH] avcodec/amfenc: Fix for windows imprecise sleep

2023-10-16 Thread Mark Thompson
On 16/10/2023 10:13, Evgeny Pavlov wrote: This commit reduces the sleep time on Windows to improve AMF encoding performance on low resolution input videos. This fix is for Windows only, because sleep() function isn't very accurate on Windows OS. Fix for issue #10622 Signed-off-by: Evgeny

Re: [FFmpeg-devel] [PATCH v1] avcodec/cbs: Keep ff_cbs_trace_syntax_element

2023-10-16 Thread Mark Thompson
const char *name, const int *subscripts, + const char *bitstring, int64_t value); + // Helper functions for read/write of common bitstream elements, including // generation of trace output. The simple functions are equivalent to @Mark Thompson Could you please take a look if

Re: [FFmpeg-devel] [PATCH v2] cbs_av1: Make fake OBU size length field a write option

2023-10-02 Thread Mark Thompson
On 27/09/2023 03:16, Wang, Fei W wrote: On Tue, 2023-09-26 at 21:30 +0100, Mark Thompson wrote: This is an option to modify the behaviour of the writer, not a syntax field. --- On 26/09/2023 03:34, Wang, Fei W wrote: On Mon, 2023-09-25 at 14:53 +0100, Mark Thompson wrote: ... diff --git

[FFmpeg-devel] [PATCH v2] cbs_av1: Make fake OBU size length field a write option

2023-09-26 Thread Mark Thompson
This is an option to modify the behaviour of the writer, not a syntax field. --- On 26/09/2023 03:34, Wang, Fei W wrote: On Mon, 2023-09-25 at 14:53 +0100, Mark Thompson wrote: ... diff --git a/libavcodec/vaapi_encode_av1.c b/libavcodec/vaapi_encode_av1.c index 3ff1c47b53..861bf4a13b 100644

Re: [FFmpeg-devel] [PATCH] cbs_av1: Make fake OBU size length field a write option

2023-09-26 Thread Mark Thompson
On 26/09/2023 10:19, Andreas Rheinhardt wrote: Mark Thompson: This is an option to modify the behaviour of the writer, not a syntax field. --- Tested by hacking av1_metadata.  For example, adding: av_opt_set_int(ctx->common.output->priv_data, "fixed_obu_size_length", 7, 0

[FFmpeg-devel] [PATCH] cbs_av1: Make fake OBU size length field a write option

2023-09-25 Thread Mark Thompson
This is an option to modify the behaviour of the writer, not a syntax field. --- Tested by hacking av1_metadata. For example, adding: av_opt_set_int(ctx->common.output->priv_data, "fixed_obu_size_length", 7, 0); gets you OBU headers that look like: [trace_headers @ 0x55706fcb2880] OBU header

Re: [FFmpeg-devel] [PATCH v3 6/6] lavc/vaapi_encode: Add VAAPI AV1 encoder

2023-08-16 Thread Mark Thompson
On 16/08/2023 08:54, Wang, Fei W wrote: On Sun, 2023-08-13 at 22:43 +0100, Mark Thompson wrote: On 10/08/2023 03:54, Wang, Fei W wrote: On Mon, 2023-08-07 at 22:21 +0100, Mark Thompson wrote: On 03/08/2023 07:01, fei.w.wang-at-intel@ffmpeg.org wrote: From: Fei Wang Signed-off-by: Fei

[FFmpeg-devel] [PATCH v2] cbs: Make tracing more general

2023-08-16 Thread Mark Thompson
Turn tracing into callbacks for each syntax element, with default callbacks to match current trace_headers behaviour for debug. Move the construction of bit strings into the trace callback, which simplifies all of the read and write functions. --- Add user context pointer to trace callback.

Re: [FFmpeg-devel] [PATCH v2] lavc/vaapi_encode: Add filler_data option

2023-08-15 Thread Mark Thompson
On 15/08/2023 20:09, Mark Thompson wrote: On 15/08/2023 09:02, Xiang, Haihao wrote: On Ma, 2023-08-07 at 09:27 +0200, David Rosca wrote: v2: Add description in encoders.texi ---   doc/encoders.texi | 3 +++   libavcodec/vaapi_encode.c | 1 +   libavcodec/vaapi_encode.h | 9 -   3

Re: [FFmpeg-devel] [PATCH v2] lavc/vaapi_encode: Add filler_data option

2023-08-15 Thread Mark Thompson
On 15/08/2023 09:02, Xiang, Haihao wrote: On Ma, 2023-08-07 at 09:27 +0200, David Rosca wrote: v2: Add description in encoders.texi ---  doc/encoders.texi | 3 +++  libavcodec/vaapi_encode.c | 1 +  libavcodec/vaapi_encode.h | 9 -  3 files changed, 12 insertions(+), 1

Re: [FFmpeg-devel] [PATCH v3 6/6] lavc/vaapi_encode: Add VAAPI AV1 encoder

2023-08-13 Thread Mark Thompson
On 10/08/2023 03:54, Wang, Fei W wrote: On Mon, 2023-08-07 at 22:21 +0100, Mark Thompson wrote: On 03/08/2023 07:01, fei.w.wang-at-intel@ffmpeg.org wrote: From: Fei Wang Signed-off-by: Fei Wang --- Changelog |1 + configure |3

[FFmpeg-devel] [PATCH] cbs: Make tracing more general

2023-08-13 Thread Mark Thompson
Turn tracing into callbacks for each syntax element, with a default callback to match trace_headers for debug. Move the construction of bit strings outside CBS, which simplifies all of the read and write functions. --- Prompted by the AV1 VAAPI encode patch which reimplements a load of AV1

Re: [FFmpeg-devel] [PATCH v3 6/6] lavc/vaapi_encode: Add VAAPI AV1 encoder

2023-08-07 Thread Mark Thompson
On 03/08/2023 07:01, fei.w.wang-at-intel@ffmpeg.org wrote: From: Fei Wang Signed-off-by: Fei Wang --- Changelog |1 + configure |3 + doc/encoders.texi | 13 + libavcodec/Makefile |1 +

Re: [FFmpeg-devel] [PATCH v3 5/6] lavc/vaapi_encode: Separate reference frame into previous/future list

2023-08-07 Thread Mark Thompson
On 03/08/2023 07:01, fei.w.wang-at-intel@ffmpeg.org wrote: From: Fei Wang To support more reference frames from different directions. Signed-off-by: Fei Wang --- libavcodec/vaapi_encode.c | 112 +--- libavcodec/vaapi_encode.h | 15 +++--

Re: [FFmpeg-devel] [PATCH v3 4/6] lavc/vaapi_encode: Extract set output pkt timestamp function

2023-08-07 Thread Mark Thompson
On 03/08/2023 07:01, fei.w.wang-at-intel@ffmpeg.org wrote: From: Fei Wang Signed-off-by: Fei Wang --- libavcodec/vaapi_encode.c | 37 - 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/libavcodec/vaapi_encode.c

Re: [FFmpeg-devel] [PATCH v2 1/4] cbs_av1: Add tracing headers for metadata types

2023-05-17 Thread Mark Thompson
On 23/02/2023 13:14, James Almer wrote: On 1/24/2023 7:46 PM, Mark Thompson wrote: Make it a little easier to interpret metadata in trace output. ---   libavcodec/cbs_av1_syntax_template.c | 10 ++   1 file changed, 10 insertions(+) ... Set LGTM. Set applied. (Apologies

[FFmpeg-devel] [PATCH 1/5] cbs: Add some common code for read/write of miscellaneous user data

2023-02-03 Thread Mark Thompson
From: Mark Thompson Supports closed captions, active format and bar data as defined by SCTE 128 part 1 or A/53 part 4, suitable for use with both MPEG-2 and H.264. Signed-off-by: Aman Karmani --- libavcodec/cbs_misc.c | 217 ++ libavcodec/cbs_misc.h

[FFmpeg-devel] [PATCH v2 4/4] av1_parse: Don't reject zero-size padding OBUs

2023-01-24 Thread Mark Thompson
Padding OBUs are not required to be nonempty. --- libavcodec/av1_parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/av1_parse.c b/libavcodec/av1_parse.c index b1620eb043..e2f105a8e2 100644 --- a/libavcodec/av1_parse.c +++ b/libavcodec/av1_parse.c @@ -88,7

[FFmpeg-devel] [PATCH v2 3/4] av1_parse: Remove unused getbits instance

2023-01-24 Thread Mark Thompson
--- libavcodec/av1_parse.c | 6 +- libavcodec/av1_parse.h | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/libavcodec/av1_parse.c b/libavcodec/av1_parse.c index 59ea0bc6e7..b1620eb043 100644 --- a/libavcodec/av1_parse.c +++ b/libavcodec/av1_parse.c @@ -56,7 +56,7 @@ int

[FFmpeg-devel] [PATCH v2 2/4] cbs_av1: Don't reject unknown metadata

2023-01-24 Thread Mark Thompson
Accept it and pass it through unchanged. The standard requires that decoders ignore unknown metadata, and indeed this is tested by some of the Argon coverage streams. --- libavcodec/cbs_av1.c | 7 +++ libavcodec/cbs_av1.h | 7 +++

[FFmpeg-devel] [PATCH v2 1/4] cbs_av1: Add tracing headers for metadata types

2023-01-24 Thread Mark Thompson
Make it a little easier to interpret metadata in trace output. --- libavcodec/cbs_av1_syntax_template.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index e95925a493..817a0f8ae6 100644 ---

Re: [FFmpeg-devel] [PATCH 3/2] cbs_av1: Remove constraint on MDCV luminance values

2023-01-24 Thread Mark Thompson
On 18/01/2023 20:38, James Almer wrote: On 1/18/2023 5:35 PM, Mark Thompson wrote: While desiring min to be less than max feels entirely sensible, unfortunately the standard does not actually have this requirement. Huh, it really doesn't. --- Some of the Argon coverage streams test

[FFmpeg-devel] [PATCH 3/2] cbs_av1: Remove constraint on MDCV luminance values

2023-01-18 Thread Mark Thompson
While desiring min to be less than max feels entirely sensible, unfortunately the standard does not actually have this requirement. --- Some of the Argon coverage streams test this. libavcodec/cbs_av1_syntax_template.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[FFmpeg-devel] [PATCH 2/2] cbs_av1: Don't reject unknown metadata

2023-01-17 Thread Mark Thompson
Accept it and pass it through unchanged. The standard requires that decoders ignore unknown metadata, and indeed this is tested by some of the Argon coverage streams. --- Artificial test example: [trace_headers @ 0x5596dda6ed80] OBU header [trace_headers @ 0x5596dda6ed80] 0

[FFmpeg-devel] [PATCH 1/2] cbs_av1: Add tracing headers for metadata types

2023-01-17 Thread Mark Thompson
Make it a little easier to interpret metadata in trace output. --- libavcodec/cbs_av1_syntax_template.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index d98d3d42de..46f4c5a6b8 100644 ---

Re: [FFmpeg-devel] [PATCH] vaapi_encode_h264: Only set pic_order_cnt_type to 0 with B-frames

2023-01-09 Thread Mark Thompson
On 09/01/2023 07:37, David Rosca wrote: On Mon, Jan 9, 2023 at 3:22 AM Xiang, Haihao wrote: On Do, 2022-12-29 at 22:20 +0100, David Rosca wrote: --- libavcodec/vaapi_encode_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode_h264.c

Re: [FFmpeg-devel] [PATCH] vaapi: support VAProfileH264High10

2023-01-05 Thread Mark Thompson
On 26/12/2022 06:59, Jean Jogh wrote: see https://github.com/intel/libva/pull/664 Signed-off-by: jianfeng.zheng --- configure | 13 + libavcodec/h264_slice.c| 6 ++ libavcodec/vaapi_decode.c | 10 ++ libavcodec/vaapi_encode_h264.c

Re: [FFmpeg-devel] [RFC PATCH 4/4] avcodec/h265_metadata_bsf: add nuh_layer_id option

2023-01-05 Thread Mark Thompson
On 05/01/2023 16:14, Zhao Zhili wrote: From: Zhao Zhili Extract NALUs with the specified nuh_layer_id and rewrite as base layer. For example, to extract alpha layer with nuh_layer_id equal to 1: ./ffmpeg -i alpha.mp4 \ -an -c:v copy \ -bsf:v

Re: [FFmpeg-devel] [PATCH v5 2/2] lavc/vaapi_decode: add support for HWACCEL_CAP_RESET_WITHOUT_UNINIT

2022-11-28 Thread Mark Thompson
On 14/11/2022 01:16, Fei Wang wrote: This can fix vp9 decode image corruption when the frame size is change, but the pervious frames still be referenced. Surfaces don't need to be bound to vaContext only after VAAPI 1.0.0:

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode

2022-11-24 Thread Mark Thompson
to the reference surface, and doesn't bother to write the display surface at all. This is then very visible when any user tries to display the display surface, because it hasn't been written. This patch is NOT a hack, like @Mark Thompson mentioned. Your proposed patch is trying to crystalise

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode

2022-11-22 Thread Mark Thompson
On 22/11/2022 20:59, Mark Thompson wrote: On 22/11/2022 20:26, Mark Thompson wrote: On 22/11/2022 19:18, Dong, Ruijing wrote: [AMD Official Use Only - General] Hi Mark, Sorry for being late to reply to you. Your understanding is correct, and I have sent a new patch [v4] for addressing

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode

2022-11-22 Thread Mark Thompson
On 22/11/2022 20:26, Mark Thompson wrote: On 22/11/2022 19:18, Dong, Ruijing wrote: [AMD Official Use Only - General] Hi Mark, Sorry for being late to reply to you. Your understanding is correct, and I have sent a new patch [v4] for addressing the current issue and to use driver quirk

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode

2022-11-22 Thread Mark Thompson
it to the correct one instead? - Mark -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Sunday, November 20, 2022 11:44 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode On 20/11/2022 02:59, Ruijing Dong

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1_vaapi: add direct film grain mode

2022-11-20 Thread Mark Thompson
On 20/11/2022 02:59, Ruijing Dong wrote: Adding direct film grain mode for av1 decoder, which outputs alongside film grain. AV_HWACCEL_FLAG_DIRECT_FILM_GRAIN is the new flag introduced to enable this path. issue: By using AMD av1 decoder via VAAPI, when used with film grain content, the output

Re: [FFmpeg-devel] [PATCH v3 1/3] lavc/decode: Warp get_hw_config function

2022-09-07 Thread Mark Thompson
On 07/09/2022 09:47, Xiang, Haihao wrote: On Wed, 2022-08-31 at 01:20 +, Wang, Fei W wrote: On Tue, 2022-08-23 at 16:19 +0800, Fei Wang wrote: From: Linjie Fu Wrap the procedure of getting the hardware config from a pixel format into a function. Signed-off-by: Linjie Fu Signed-off-by:

Re: [FFmpeg-devel] [PATCH v3 2/3] lavc/decode: Add internal surface re-allocate method for hwaccel

2022-09-07 Thread Mark Thompson
On 23/08/2022 09:19, Fei Wang wrote: From: Linjie Fu Add HWACCEL_CAP_INTERNAL_ALLOC flag to indicate hwaccels are able to re-allocate surface internally through ff_decode_get_hw_frames_ctx. So that hwaccels don't need to reinitialize all hw related configs when decode resolution change, just

Re: [FFmpeg-devel] [PATCH v11 10/13] lavu/hwcontext_qsv: make qsv hwdevice works with oneVPL

2022-07-21 Thread Mark Thompson
On 20/07/2022 09:40, Xiang, Haihao wrote: From: 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

Re: [FFmpeg-devel] [PATCH v2 3/3] hwcontext_vaapi: #if guard VAAPI_DRM specifics

2022-07-21 Thread Mark Thompson
On 20/07/2022 11:56, Emil Velikov wrote: From: Emil Velikov Similar to the VAAPI_X11 bits, guard all the VAAPI_DRM parts behind a compiler guard. Signed-off-by: Emil Velikov --- libavutil/hwcontext_vaapi.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

Re: [FFmpeg-devel] [PATCH v2 0/3] hwcontext_vaapi: dlopen libva-x11 and libva-drm

2022-07-21 Thread Mark Thompson
On 20/07/2022 17:41, Emil Velikov wrote: On Tue, 19 Jul 2022 at 19:16, Nicolas George wrote: Emil Velikov (12022-07-19): As you may know the libva* set of libraries share an internal ABI between them. In a resent libva commit, the va_fool API was removed. Thus if one is to mix different

Re: [FFmpeg-devel] [PATCH] hwcontext: Skip derivation checking for an existing device if options are set

2022-05-03 Thread Mark Thompson
On 03/05/2022 01:14, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Tuesday, May 3, 2022 2:09 AM To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] hwcontext: Skip derivation checking for an existing device

Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive-device function which searches for existing devices in both directions

2022-05-03 Thread Mark Thompson
On 03/05/2022 01:11, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Tuesday, May 3, 2022 1:57 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive- device function which searches for existing

[FFmpeg-devel] [PATCH] hwcontext: Skip derivation checking for an existing device if options are set

2022-05-02 Thread Mark Thompson
If options are set then the user definitely intends to create a new device, so we shouldn't attempt to return an existing one. --- libavutil/hwcontext.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c

Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive-device function which searches for existing devices in both directions

2022-05-02 Thread Mark Thompson
On 02/05/2022 23:59, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Tuesday, May 3, 2022 12:12 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive- device function which searches for existing

Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive-device function which searches for existing devices in both directions

2022-05-02 Thread Mark Thompson
On 02/05/2022 09:14, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Monday, May 2, 2022 12:01 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive- device function which searches for existing

Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive-device function which searches for existing devices in both directions

2022-05-01 Thread Mark Thompson
On 30/04/2022 23:42, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Saturday, April 30, 2022 11:39 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive- device function which searches

Re: [FFmpeg-devel] [PATCH v2 5/7] avcodec/cbs_sei: refactor to use avutil/uuid

2022-05-01 Thread Mark Thompson
On 30/04/2022 21:53, Pierre-Anthony Lemieux wrote: On Sat, Apr 30, 2022 at 12:26 PM Mark Thompson wrote: On 30/04/2022 18:53, Pierre-Anthony Lemieux wrote: On Sat, Apr 30, 2022 at 10:31 AM Mark Thompson wrote: On 24/04/2022 11:14, Zane van Iperen wrote: From: Pierre-Anthony Lemieux

Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive-device function which searches for existing devices in both directions

2022-04-30 Thread Mark Thompson
On 30/04/2022 21:07, softworkz wrote: From: softworkz The test /libavutil/tests/hwdevice checks that when deriving a device from a source device and then deriving back to the type of the source device, the result is matching the original source device, i.e. the derivation mechanism doesn't

Re: [FFmpeg-devel] [PATCH v2 5/7] avcodec/cbs_sei: refactor to use avutil/uuid

2022-04-30 Thread Mark Thompson
On 30/04/2022 18:53, Pierre-Anthony Lemieux wrote: On Sat, Apr 30, 2022 at 10:31 AM Mark Thompson wrote: On 24/04/2022 11:14, Zane van Iperen wrote: From: Pierre-Anthony Lemieux --- libavcodec/cbs_sei.h | 3 ++- libavcodec/vaapi_encode_h264.c | 8 2 files changed

Re: [FFmpeg-devel] [PATCH] avcodec/cbs_jpeg: Fix size of huffman symbol table array

2022-04-30 Thread Mark Thompson
On 30/04/2022 19:38, Andreas Rheinhardt wrote: Mark Thompson: On 08/02/2022 09:41, Andreas Rheinhardt wrote: L[i] can be in the range of 0-255, see table B.5 of ITU T.81. Signed-off-by: Andreas Rheinhardt ---   libavcodec/cbs_jpeg.h | 2 +-   libavcodec

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_av1: also copy the last frame header's decomposed content when parsing redundant frame headers

2022-04-30 Thread Mark Thompson
On 28/03/2022 02:08, James Almer wrote: This prevents CBS from propagating zeroed AV1RawFrameHeader units in reading scenarios. Writing scenarios remain unaffected as the content of these units is not used to assemble the bitstream. Signed-off-by: James Almer --- libavcodec/cbs_av1.c

Re: [FFmpeg-devel] [PATCH v2] libavcodec/cbs_av1: Add size check before parse obu

2022-04-30 Thread Mark Thompson
On 29/03/2022 09:29, Wenbin Chen wrote: cbs_av1_write_unit() check pbc size after parsing obu frame, and return AVERROR(ENOSPC) if pbc is small. pbc will be reallocated and this obu frame will be parsed again, but this may cause error because CodedBitstreamAV1Context has already been updated,

Re: [FFmpeg-devel] [PATCH v2 5/7] avcodec/cbs_sei: refactor to use avutil/uuid

2022-04-30 Thread Mark Thompson
On 24/04/2022 11:14, Zane van Iperen wrote: From: Pierre-Anthony Lemieux --- libavcodec/cbs_sei.h | 3 ++- libavcodec/vaapi_encode_h264.c | 8 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/cbs_sei.h b/libavcodec/cbs_sei.h index

Re: [FFmpeg-devel] [PATCH] avcodec/cbs_jpeg: Fix size of huffman symbol table array

2022-04-30 Thread Mark Thompson
On 08/02/2022 09:41, Andreas Rheinhardt wrote: L[i] can be in the range of 0-255, see table B.5 of ITU T.81. Signed-off-by: Andreas Rheinhardt --- libavcodec/cbs_jpeg.h | 2 +- libavcodec/cbs_jpeg_syntax_template.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)

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

2022-04-30 Thread Mark Thompson
On 28/04/2022 10:23, Haihao Xiang wrote: 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

Re: [FFmpeg-devel] [PATCH v6 1/2] lavc/vaapi_encode: add support for maxframesize

2022-04-30 Thread Mark Thompson
On 29/04/2022 08:31, Fei Wang wrote: From: Linjie Fu Add support for max frame size: - max_frame_size (bytes) to indicate the max allowed size for frame. If the frame size exceeds the limitation, encoder will to control the frame size by adjusting QP value. ffmpeg -hwaccel vaapi

Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi

2022-03-14 Thread Mark Thompson
, 2022-03-13 at 20:45 +, Mark Thompson wrote: On 11/03/2022 09:00, Fei Wang wrote: From: Linjie Fu Use GPB frames to replace regular P/B frames if backend driver does not support it. - GPB: Generalized P and B picture. Regular P/B frames replaced by B frames with previous-predict

Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi

2022-03-14 Thread Mark Thompson
On 14/03/2022 02:15, Xiang, Haihao wrote: On Sun, 2022-03-13 at 20:45 +, Mark Thompson wrote: On 11/03/2022 09:00, Fei Wang wrote: From: Linjie Fu Use GPB frames to replace regular P/B frames if backend driver does not support it. - GPB: Generalized P and B picture. Regular P/B

Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/vaapi_encode_h265: Add GPB frame support for hevc_vaapi

2022-03-13 Thread Mark Thompson
On 11/03/2022 09:00, Fei Wang wrote: From: Linjie Fu Use GPB frames to replace regular P/B frames if backend driver does not support it. - GPB: Generalized P and B picture. Regular P/B frames replaced by B frames with previous-predict only, L0 == L1. Normal B frames still have

Re: [FFmpeg-devel] [PATCH v2 1/4] lavc/vaapi_encode_h265: Add P frame to GPB frame support for hevc_vaapi

2022-02-21 Thread Mark Thompson
On 21/02/2022 02:13, Fei Wang wrote: From: Linjie Fu Use GPB frames to replace regular P frames if backend driver does not support it. - GPB: Generalized P and B picture. P frames replaced by B frames with forward-predict only, L0 == L1. Normal B frames still have 2 different

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2022-01-10 Thread Mark Thompson
On 10/01/2022 06:47, Xiang, Haihao wrote: Hi Mark, We want to provide a more user friendly command-line to share gfx memory between QSV, VAAPI and other HW methods. E.g. VAAPI provides sharpness_vaapi but QSV doesn't provide a corresponding filter, we want to use sharpness_vaapi filter on the

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2022-01-10 Thread Mark Thompson
On 10/01/2022 01:40, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Monday, January 10, 2022 1:57 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2022-01-09 Thread Mark Thompson
On 09/01/2022 23:36, Soft Works wrote:>> -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Monday, January 10, 2022 12:13 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for ex

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2022-01-09 Thread Mark Thompson
On 09/01/2022 21:15, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Sunday, January 9, 2022 7:39 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2022-01-09 Thread Mark Thompson
On 05/01/2022 03:38, Xiang, Haihao wrote: ... this patch really fixed some issues for me and others. Can you explain this in more detail? I'd like to understand whether the issues you refer to are something which would be fixed by the ffmpeg utility allowing selection of devices for

Re: [FFmpeg-devel] [PATCH, v2] lavf/vf_deinterlace_vaapi: flush queued frame for field in DeinterlacingBob

2022-01-09 Thread Mark Thompson
On 29/12/2021 03:45, Xiang, Haihao wrote: -Original Message- From: ffmpeg-devel On Behalf Of Linjie Fu Sent: Wednesday, September 18, 2019 16:20 To: ffmpeg-devel@ffmpeg.org Cc: Fu, Linjie Subject: [FFmpeg-devel] [PATCH, v2] lavf/vf_deinterlace_vaapi: flush queued frame for field in

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2021-12-30 Thread Mark Thompson
On 30/12/2021 00:29, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Thursday, December 30, 2021 12:04 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing

Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-12-29 Thread Mark Thompson
On 28/12/2021 19:04, Soft Works wrote:>> -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Tuesday, December 28, 2021 1:54 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to

Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

2021-12-29 Thread Mark Thompson
On 25/11/2021 02:41, Soft Works wrote: The test /libavutil/tests/hwdevice checks that when deriving a device from a source device and then deriving back to the type of the source device, the result is matching the original source device, i.e. the derivation mechanism doesn't create a new device

Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-12-28 Thread Mark Thompson
On 28/12/2021 01:17, Soft Works wrote: -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Tuesday, December 28, 2021 12:46 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-12-27 Thread Mark Thompson
On 27/12/2021 20:31, Soft Works wrote:>> -Original Message- From: ffmpeg-devel On Behalf Of Mark Thompson Sent: Monday, December 27, 2021 7:51 PM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to

Re: [FFmpeg-devel] [FFmpeg-cvslog] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-12-27 Thread Mark Thompson
On 10/12/2021 16:05, Wenbin Chen wrote: ffmpeg | branch: master | Wenbin Chen | Tue Dec 7 17:05:50 2021 +0800| [f3c9847c2754b7a43eb721c95e356a53085c2491] | committer: Lynne libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame Vulkan will map nv12 to R8 and GR88, so

Re: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-12-27 Thread Mark Thompson
On 16/11/2021 08:16, Wenbin Chen wrote: From: nyanmisaka mfxHDLPair was added to qsv, so modify qsv->opencl map function as well. Now the following commandline works: ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \ -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va

Re: [FFmpeg-devel] [PATCH 1/3] libavcodec/vaapi_encode: Change the way to call async to increase performance

2021-12-27 Thread Mark Thompson
On 27/10/2021 09:57, Wenbin Chen wrote: Fix: #7706. After commit 5fdcf85bbffe7451c2, vaapi encoder's performance decrease. The reason is that vaRenderPicture() and vaSyncSurface() are called at the same time (vaRenderPicture() always followed by a vaSyncSurface()). When we encode stream with B

Re: [FFmpeg-devel] [PATCH] avfilter/vf_nlmeans_opencl: making filter independent of bit depth

2021-04-03 Thread Mark Thompson
On 21/03/2021 23:22, Lucas Clemente Vella wrote: This filter originally quantized OpenCL float images fetchs in 256 levels, and computed the integral image of squared differences in 32 bit integers. This had two consequences: 1) it could overflow if the image resolution was big enough (I got

Re: [FFmpeg-devel] [PATCH] avutils/hwcontext_qsv: set the source device in qsv_device_create

2021-03-13 Thread Mark Thompson
On 11/03/2021 08:53, Xu, Guangxin wrote: -Original Message- From: ffmpeg-devel On Behalf Of Guangxin Xu Sent: Friday, March 5, 2021 9:46 AM To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] avutils/hwcontext_qsv: set the source device in

Re: [FFmpeg-devel] [PATCH v2 02/18] cbs_h264: Add support for frame packing arrangement SEI messages

2021-03-12 Thread Mark Thompson
On 23/02/2021 16:39, James Almer wrote: On 2/21/2021 4:51 PM, Mark Thompson wrote: ---   libavcodec/cbs_h264.h | 23   libavcodec/cbs_h2645.c    |  6 +   libavcodec/cbs_h264_syntax_template.c | 39 +++   3 files changed, 68

Re: [FFmpeg-devel] [PATCH] cbs_sei: Detect payload overflows when reading SEI messages

2021-03-12 Thread Mark Thompson
On 21/02/2021 20:58, Michael Niedermayer wrote: On Tue, Feb 02, 2021 at 08:58:11PM +, Mark Thompson wrote: The top-level GetBitContext is sized for the whole NAL unit, so it fails to detect overflows where a payload continues into the following message. To fix that, we make a new context

Re: [FFmpeg-devel] [PATCH] cbs_h265: Detect more reference combinations which would overflow the DPB

2021-03-12 Thread Mark Thompson
On 21/02/2021 20:54, Michael Niedermayer wrote: On Wed, Feb 03, 2021 at 09:34:07PM +, Mark Thompson wrote: In total, the number of short term references (from the selected short term ref pic set), the number of long term references (combining both the used candidates from the SPS and those

Re: [FFmpeg-devel] [PATCH 9/9] avcodec/cbs_h26[45]: Remove redundant enum constants

2021-03-12 Thread Mark Thompson
On 10/03/2021 10:29, Andreas Rheinhardt wrote: Unused since 8843607f495c95c1e67a3ce3d6f15dca6e252439. Signed-off-by: Andreas Rheinhardt --- libavcodec/cbs_h264.h | 10 -- libavcodec/cbs_h265.h | 9 - 2 files changed, 19 deletions(-) diff --git a/libavcodec/cbs_h264.h

Re: [FFmpeg-devel] [PATCH 7/8] avcodec/cbs_sei: Fix leak of AVBufferRef on error

2021-03-12 Thread Mark Thompson
On 10/03/2021 01:06, Andreas Rheinhardt wrote: An AVBufferRef (and the corresponding AVBuffer and the underlying actual buffer) would leak in ff_cbs_sei_add_message() on error in case an error happened after its creation and before it has been attached to more permanent storage. Fix this by only

Re: [FFmpeg-devel] [PATCH] lavu: add VKAPI hwcontext implementation

2021-03-12 Thread Mark Thompson
On 12/03/2021 18:29, Suji Velupillai wrote: On Fri, Mar 12, 2021 at 1:12 AM Jean-Baptiste Kempf wrote: On Thu, 11 Mar 2021, at 23:09, suji.velupil...@broadcom.com wrote: Initial commit to add VKAPI hardware accelerator implementation. The depedency component vkil source code can be obtained

Re: [FFmpeg-devel] [PATCH v2] avcodec: add a get_encoder_buffer() callback to AVCodecContext

2021-03-12 Thread Mark Thompson
On 22/02/2021 22:27, James Almer wrote: On 2/21/2021 6:04 PM, James Almer wrote: On 2/21/2021 5:29 PM, Mark Thompson wrote: On 21/02/2021 20:00, James Almer wrote: On 2/21/2021 4:13 PM, Mark Thompson wrote: On 21/02/2021 17:35, James Almer wrote: This callback is functionally the same

Re: [FFmpeg-devel] [PATCH] lavu: add VKAPI hwcontext implementation

2021-03-12 Thread Mark Thompson
On 11/03/2021 22:09, suji.velupil...@broadcom.com wrote: From: Suji Velupillai Initial commit to add VKAPI hardware accelerator implementation. The depedency component vkil source code can be obtained from github https://github.com/Broadcom/vkil Signed-off-by: Suji Velupillai --- configure

Re: [FFmpeg-devel] [PATCH v2] avcodec: add a get_encoder_buffer() callback to AVCodecContext

2021-02-21 Thread Mark Thompson
On 21/02/2021 20:00, James Almer wrote: On 2/21/2021 4:13 PM, Mark Thompson wrote: On 21/02/2021 17:35, James Almer wrote: This callback is functionally the same as get_buffer2() is for decoders, and implements for the new encode API the functionality of the old encode API had where the user

[FFmpeg-devel] [PATCH v2 17/18] vaapi_encode_h264: Support HDR metadata

2021-02-21 Thread Mark Thompson
This can now be done in exactly the same way as it is for H.265. --- libavcodec/vaapi_encode_h264.c | 66 +- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index b546ddec08..582a855586

[FFmpeg-devel] [PATCH v2 12/18] h264_metadata_bsf: Support HDR metadata

2021-02-21 Thread Mark Thompson
--- doc/bitstream_filters.texi | 17 + libavcodec/h264_metadata_bsf.c | 25 + 2 files changed, 42 insertions(+) diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 60e729484d..0ff76b86f0 100644 --- a/doc/bitstream_filters.texi

[FFmpeg-devel] [PATCH v2 11/18] h264_metadata_bsf: Simplify display orientation handling

2021-02-21 Thread Mark Thompson
The case where the user supplies new value directly as options still requires a bit of special handling. --- libavcodec/h264_metadata_bsf.c | 118 ++--- 1 file changed, 21 insertions(+), 97 deletions(-) diff --git a/libavcodec/h264_metadata_bsf.c

[FFmpeg-devel] [PATCH v2 18/18] cbs: Add metadata test

2021-02-21 Thread Mark Thompson
This tests insert/extract/remove for each supported codec/type combination. --- libavcodec/Makefile | 1 + libavcodec/tests/cbs_metadata.c | 390 tests/fate/libavcodec.mak | 5 + 3 files changed, 396 insertions(+) create mode 100644

[FFmpeg-devel] [PATCH v2 16/18] vaapi_encode_h265: Ensure that HDR metadata is included with seek points

2021-02-21 Thread Mark Thompson
Save the most recent HDR side data structures and use them when generating an IDR or CRA frame. --- libavcodec/vaapi_encode_h265.c | 93 -- 1 file changed, 32 insertions(+), 61 deletions(-) diff --git a/libavcodec/vaapi_encode_h265.c

[FFmpeg-devel] [PATCH v2 10/18] cbs: Add interface to allow BSFs easy access to metadata manipulation

2021-02-21 Thread Mark Thompson
--- libavcodec/cbs_bsf.c | 73 libavcodec/cbs_bsf.h | 6 2 files changed, 79 insertions(+) diff --git a/libavcodec/cbs_bsf.c b/libavcodec/cbs_bsf.c index 9b521cf111..4f8f7f499d 100644 --- a/libavcodec/cbs_bsf.c +++ b/libavcodec/cbs_bsf.c @@

[FFmpeg-devel] [PATCH v2 15/18] vaapi_encode: Unify SEI option mask enum

2021-02-21 Thread Mark Thompson
This was in two disjoint parts in the H.264 and H.265 files. Unify them in the header to avoid any confusion, because they are really the same enum. --- libavcodec/vaapi_encode.h | 8 libavcodec/vaapi_encode_h264.c | 6 -- libavcodec/vaapi_encode_h265.c | 5 - 3 files

[FFmpeg-devel] [PATCH v2 09/18] cbs_av1: Support manipulating HDR CLL and MDCV metadata

2021-02-21 Thread Mark Thompson
--- libavcodec/cbs_av1.c | 91 1 file changed, 91 insertions(+) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 0c958c81c2..281382c792 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -17,6 +17,7 @@ */ #include

[FFmpeg-devel] [PATCH v2 08/18] cbs_av1: Implement metadata manipulation

2021-02-21 Thread Mark Thompson
--- libavcodec/cbs_av1.c | 142 +++ 1 file changed, 142 insertions(+) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 302e1f38f5..0c958c81c2 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -22,6 +22,7 @@ #include "cbs.h"

<    1   2   3   4   5   6   7   8   9   10   >