[FFmpeg-devel] [PATCH v2] lavc/vaapi_decode: Reject decoding of frames with no slices

2024-05-13 Thread David Rosca
Matches other hwaccels. --- v2: AVERROR libavcodec/vaapi_decode.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 8e9f647c20..7c91d50f7b 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -157,6 +157,11

[FFmpeg-devel] [PATCH] lavc/vaapi_decode: Reject decoding of frames with no slices

2024-05-10 Thread David Rosca
Matches other hwaccels. --- libavcodec/vaapi_decode.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 8e9f647c20..3c4030c073 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -157,6 +157,11 @@ int

Re: [FFmpeg-devel] [PATCH] lavc/vaapi_h264: Fix merging fields in DPB with missing references

2024-05-08 Thread David Rosca
On Tue, May 7, 2024 at 10:22 PM Mark Thompson wrote: > > On 07/05/2024 07:00, David Rosca wrote: > > If there are missing references, h264 decode does error concealment > > by copying previous refs which means there will be duplicated surfaces > > and this code would t

[FFmpeg-devel] [PATCH v2] lavc/vaapi_h264: Fix merging fields in DPB with missing references

2024-05-08 Thread David Rosca
If there are missing references, h264 decode does error concealment by copying previous refs which means there will be duplicated surfaces. Check long_ref and frame_idx in addition to surface when looking for the other field to avoid trying to merge with wrong picture. Also allow to merge with

Re: [FFmpeg-devel] [PATCH 2/2] lavc/vaapi_av1: Avoid sending the same slice buffer multiple times

2024-05-08 Thread David Rosca
On Tue, May 7, 2024 at 10:01 PM Mark Thompson wrote: > > On 28/04/2024 08:26, David Rosca wrote: > > When there are multiple tiles in one slice buffer, use multiple slice > > params to avoid sending the same slice buffer multiple times and thus > > increasing the b

[FFmpeg-devel] [PATCH v2 2/2] lavc/vaapi_av1: Avoid sending the same slice buffer multiple times

2024-05-08 Thread David Rosca
When there are multiple tiles in one slice buffer, use multiple slice params to avoid sending the same slice buffer multiple times and thus increasing the bitstream size the driver will need to upload to hw. --- v2: Avoid allocations every slice. libavcodec/vaapi_av1.c | 47

[FFmpeg-devel] [PATCH v2 1/2] lavc/vaapi_decode: Make it possible to send multiple slice params buffers

2024-05-08 Thread David Rosca
--- v2: No changes libavcodec/vaapi_av1.c| 2 +- libavcodec/vaapi_decode.c | 3 ++- libavcodec/vaapi_decode.h | 1 + libavcodec/vaapi_h264.c | 2 +- libavcodec/vaapi_hevc.c | 4 ++-- libavcodec/vaapi_mjpeg.c | 2 +- libavcodec/vaapi_mpeg2.c | 2 +- libavcodec/vaapi_mpeg4.c | 2 +-

Re: [FFmpeg-devel] [PATCH] lavc/vaapi_h264: Don't try to merge fields in DPB for non-field pics

2024-05-07 Thread David Rosca
On Mon, May 6, 2024 at 9:55 PM Mark Thompson wrote: > > On 05/05/2024 17:36, David Rosca wrote: > > This path can be hit when there are missing references while decoding > > progressive stream and would completely break the DPB contents. > > --- > >

[FFmpeg-devel] [PATCH] lavc/vaapi_h264: Fix merging fields in DPB with missing references

2024-05-07 Thread David Rosca
If there are missing references, h264 decode does error concealment by copying previous refs which means there will be duplicated surfaces and this code would try to merge them instead of correctly appending to DPB. Make sure the fields were actually merged before early return. ---

[FFmpeg-devel] [PATCH] lavc/vaapi_h264: Don't try to merge fields in DPB for non-field pics

2024-05-05 Thread David Rosca
This path can be hit when there are missing references while decoding progressive stream and would completely break the DPB contents. --- libavcodec/vaapi_h264.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/libavcodec/vaapi_h264.c

[FFmpeg-devel] [PATCH 2/2] lavc/vaapi_av1: Avoid sending the same slice buffer multiple times

2024-04-28 Thread David Rosca
When there are multiple tiles in one slice buffer, use multiple slice params to avoid sending the same slice buffer multiple times and thus increasing the bitstream size the driver will need to upload to hw. --- libavcodec/vaapi_av1.c | 37 +++-- 1 file changed, 23

[FFmpeg-devel] [PATCH 1/2] lavc/vaapi_decode: Make it possible to send multiple slice params buffers

2024-04-28 Thread David Rosca
--- libavcodec/vaapi_av1.c| 2 +- libavcodec/vaapi_decode.c | 3 ++- libavcodec/vaapi_decode.h | 1 + libavcodec/vaapi_h264.c | 2 +- libavcodec/vaapi_hevc.c | 4 ++-- libavcodec/vaapi_mjpeg.c | 2 +- libavcodec/vaapi_mpeg2.c | 2 +- libavcodec/vaapi_mpeg4.c | 2 +-

Re: [FFmpeg-devel] [PATCH v4] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2024-04-25 Thread David Rosca
On Fri, Nov 24, 2023 at 8:27 AM Xiang, Haihao wrote: > > On Vr, 2023-10-27 at 22:25 +0200, David Rosca wrote: > > This allows some optimizations in driver, such as not having to read > > back the data if write-only mapping is requested. > > --- > > v4: overwrite

[FFmpeg-devel] [PATCH] lavc/vaapi_encode_av1: Set roi_quant_range

2024-04-01 Thread David Rosca
--- libavcodec/vaapi_encode_av1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vaapi_encode_av1.c b/libavcodec/vaapi_encode_av1.c index a46b882ab9..02a31b894d 100644 --- a/libavcodec/vaapi_encode_av1.c +++ b/libavcodec/vaapi_encode_av1.c @@ -155,6 +155,8 @@ static av_cold int

[FFmpeg-devel] [PATCH v4] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2023-10-27 Thread David Rosca
This allows some optimizations in driver, such as not having to read back the data if write-only mapping is requested. --- v4: overwrite + note about vaMapBuffer libva fallback libavutil/hwcontext_vaapi.c | 12 1 file changed, 12 insertions(+) diff --git

Re: [FFmpeg-devel] [PATCH v3] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2023-10-27 Thread David Rosca
On Fri, Oct 27, 2023 at 7:14 PM Mark Thompson wrote: > > On 27/10/2023 11:00, David Rosca wrote: > > This allows some optimizations in driver, such as not having to read > > back the data if write-only mapping is requested. > > --- > > v3: Fix another warning > &g

[FFmpeg-devel] [PATCH v3] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2023-10-27 Thread David Rosca
This allows some optimizations in driver, such as not having to read back the data if write-only mapping is requested. --- v3: Fix another warning libavutil/hwcontext_vaapi.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c

[FFmpeg-devel] [PATCH v2] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2023-10-27 Thread David Rosca
This allows some optimizations in driver, such as not having to read back the data if write-only mapping is requested. --- v2: Fix warning libavutil/hwcontext_vaapi.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index

[FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: Use vaMapBuffer2 for mapping image buffers

2023-10-27 Thread David Rosca
This allows some optimizations in driver, such as not having to read back the data if write-only mapping is requested. --- libavutil/hwcontext_vaapi.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index

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

2023-08-15 Thread David Rosca
On Tue, Aug 15, 2023 at 9:25 PM Mark Thompson wrote: > > 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 > >>&

[FFmpeg-devel] [PATCH v3] lavu/hwcontext_vaapi: Add vaapi_drm_format_map support for x2rgb10

2023-08-10 Thread David Rosca
Support for allocating frames with x2rgb10 format was added in c00264f5013, this adds support for importing DMA-BUFs. --- v2: fix #ifdef -> #if v3: annotate libavutil/hwcontext_vaapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c

Re: [FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: Add vaapi_drm_format_map support for x2rgb10

2023-08-09 Thread David Rosca
On Wed, Aug 9, 2023 at 2:35 PM Rémi Denis-Courmont wrote: > > > > Le 9 août 2023 15:02:45 GMT+03:00, David Rosca a écrit : > >Support for allocating frames with x2rgb10 format was added > >in c00264f5013, this adds support for importing DMA-BUFs. > >--- >

[FFmpeg-devel] [PATCH v2] lavu/hwcontext_vaapi: Add vaapi_drm_format_map support for x2rgb10

2023-08-09 Thread David Rosca
Support for allocating frames with x2rgb10 format was added in c00264f5013, this adds support for importing DMA-BUFs. v2: Fix #ifdef -> #if --- libavutil/hwcontext_vaapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index

[FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: Add vaapi_drm_format_map support for x2rgb10

2023-08-09 Thread David Rosca
Support for allocating frames with x2rgb10 format was added in c00264f5013, this adds support for importing DMA-BUFs. --- libavutil/hwcontext_vaapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 6c3a227ddd..63544ce476

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

2023-08-07 Thread David Rosca
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 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 25d6b7f09e..f146942aa5 100644 ---

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

2023-08-05 Thread David Rosca
--- libavcodec/vaapi_encode.c | 1 + libavcodec/vaapi_encode.h | 9 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index bfca315a7a..f161c76304 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@

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

2023-07-17 Thread David Rosca
On Mon, Jul 10, 2023 at 9:40 AM Fei Wang wrote: > > Signed-off-by: Fei Wang > --- > Changelog |1 + > configure |3 + > doc/encoders.texi | 13 + > libavcodec/Makefile |1 + > libavcodec/allcodecs.c|1 + >

[FFmpeg-devel] [PATCH] lavc/vaapi_encode: add "quality" option to all encoders

2023-05-21 Thread David Rosca
Move "quality" option from h264_vaapi to common options. --- libavcodec/vaapi_encode.c | 3 +++ libavcodec/vaapi_encode.h | 8 +++- libavcodec/vaapi_encode_h264.c | 5 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavcodec/vaapi_encode.c

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

2023-01-17 Thread David Rosca
v3: pic_order_cnt steps by 2 --- libavcodec/vaapi_encode_h264.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index f15bcc6..de0951f 100644 --- a/libavcodec/vaapi_encode_h264.c +++

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

2023-01-10 Thread David Rosca
On Mon, Jan 9, 2023 at 10:11 PM Mark Thompson wrote: > > 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: > >>> --- > >>> libavc

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

2023-01-10 Thread David Rosca
v2: frame_num steps by 2 --- libavcodec/vaapi_encode_h264.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 7a6b54ab6f..8093c47179 100644 --- a/libavcodec/vaapi_encode_h264.c +++

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

2023-01-08 Thread David Rosca
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_h26

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

2022-12-29 Thread David Rosca
--- libavcodec/vaapi_encode_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index dd17be2..d6926c4 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -350,7 +350,7 @@ static