commit 774c3dd1b1ac2162a7348d4734551de8f3033e20
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sun Jul 21 01:30:22 2024 +0100
fix
...decode-Make-it-possible-to-send-multiple-.patch | 74 ++++++++++++++++++----
...av1-Avoid-sending-the-same-slice-buffer-m.patch | 9 ++-
2 files changed, 65 insertions(+), 18 deletions(-)
---
diff --git a/0001-lavc-vaapi_decode-Make-it-possible-to-send-multiple-.patch
b/0001-lavc-vaapi_decode-Make-it-possible-to-send-multiple-.patch
index 34bca43..0ae7a76 100644
--- a/0001-lavc-vaapi_decode-Make-it-possible-to-send-multiple-.patch
+++ b/0001-lavc-vaapi_decode-Make-it-possible-to-send-multiple-.patch
@@ -1,28 +1,28 @@
-From 5176821735c397de2a108cd266a6c6759a5e0ffe Mon Sep 17 00:00:00 2001
+From fe9d889dcd79ea18d4dfaa39df4ddbd4c8c3b15c Mon Sep 17 00:00:00 2001
From: David Rosca <nowrep(a)gmail.com>
Date: Wed, 8 May 2024 09:11:11 +0200
-Subject: [PATCH 1/2] lavc/vaapi_decode: Make it possible to send multiple
- slice params buffers
+Subject: [PATCH] lavc/vaapi_decode: Make it possible to send multiple slice
+ params buffers
Reviewed-by: Neal Gompa <ngompa13(a)gmail.com>
Signed-off-by: David Rosca <nowrep(a)gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang(a)intel.com>
-(cherry picked from commit fe9d889dcd79ea18d4dfaa39df4ddbd4c8c3b15c)
-
-[modified to drop h264/hevc/vc1 parts stripped in Fedora Linux]
---
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 +-
+ libavcodec/vaapi_vc1.c | 2 +-
libavcodec/vaapi_vp8.c | 2 +-
libavcodec/vaapi_vp9.c | 2 +-
- 8 files changed, 9 insertions(+), 7 deletions(-)
+ 11 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/libavcodec/vaapi_av1.c b/libavcodec/vaapi_av1.c
-index 1f9a6071ba..03771dd3e0 100644
+index f61bf63098..e184d01a43 100644
--- a/libavcodec/vaapi_av1.c
+++ b/libavcodec/vaapi_av1.c
@@ -409,7 +409,7 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx,
@@ -35,10 +35,10 @@ index 1f9a6071ba..03771dd3e0 100644
buffer,
size);
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
-index ceac769c52..9344c21fd2 100644
+index 7f2fe032db..7c91d50f7b 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
-@@ -62,6 +62,7 @@ int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx,
+@@ -63,6 +63,7 @@ int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx,
int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
VAAPIDecodePicture *pic,
const void *params_data,
@@ -46,7 +46,7 @@ index ceac769c52..9344c21fd2 100644
size_t params_size,
const void *slice_data,
size_t slice_size)
-@@ -90,7 +91,7 @@ int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
+@@ -88,7 +89,7 @@ int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
VASliceParameterBufferType,
@@ -67,6 +67,41 @@ index 6beda14e52..702171e108 100644
size_t params_size,
const void *slice_data,
size_t slice_size);
+diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
+index 55cf5a05ee..b47531ce1c 100644
+--- a/libavcodec/vaapi_h264.c
++++ b/libavcodec/vaapi_h264.c
+@@ -375,7 +375,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
+ slice_param.chroma_offset_l1);
+
+ err = ff_vaapi_decode_make_slice_buffer(avctx, pic,
+- &slice_param, sizeof(slice_param),
++ &slice_param, 1, sizeof(slice_param),
+ buffer, size);
+ if (err) {
+ ff_vaapi_decode_cancel(avctx, pic);
+diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
+index 3bdd2dd1b8..3937b7574a 100644
+--- a/libavcodec/vaapi_hevc.c
++++ b/libavcodec/vaapi_hevc.c
+@@ -353,7 +353,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx)
+ if (pic->last_size) {
+ last_slice_param->LongSliceFlags.fields.LastSliceOfPic = 1;
+ ret = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic,
+- &pic->last_slice_param,
slice_param_size,
++ &pic->last_slice_param, 1,
slice_param_size,
+ pic->last_buffer,
pic->last_size);
+ if (ret < 0)
+ goto fail;
+@@ -471,7 +471,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
+
+ if (!sh->first_slice_in_pic_flag) {
+ err = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic,
+- &pic->last_slice_param,
slice_param_size,
++ &pic->last_slice_param, 1,
slice_param_size,
+ pic->last_buffer,
pic->last_size);
+ pic->last_buffer = NULL;
+ pic->last_size = 0;
diff --git a/libavcodec/vaapi_mjpeg.c b/libavcodec/vaapi_mjpeg.c
index 5b8d47bb2a..9557cf5f9b 100644
--- a/libavcodec/vaapi_mjpeg.c
@@ -106,6 +141,19 @@ index 363b686e42..612de10cd7 100644
buffer, size);
if (err < 0) {
ff_vaapi_decode_cancel(avctx, pic);
+diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
+index 5594118a69..abbe877dd8 100644
+--- a/libavcodec/vaapi_vc1.c
++++ b/libavcodec/vaapi_vc1.c
+@@ -490,7 +490,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const
uint8_t *buffer,
+ };
+
+ err = ff_vaapi_decode_make_slice_buffer(avctx, pic,
+- &slice_param, sizeof(slice_param),
++ &slice_param, 1, sizeof(slice_param),
+ buffer, size);
+ if (err < 0) {
+ ff_vaapi_decode_cancel(avctx, pic);
diff --git a/libavcodec/vaapi_vp8.c b/libavcodec/vaapi_vp8.c
index 31137a45bd..66fdde1f39 100644
--- a/libavcodec/vaapi_vp8.c
@@ -120,7 +168,7 @@ index 31137a45bd..66fdde1f39 100644
goto fail;
diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c
-index 9dc7d5e72b..ff11022db7 100644
+index b8e760c807..a28fc75a59 100644
--- a/libavcodec/vaapi_vp9.c
+++ b/libavcodec/vaapi_vp9.c
@@ -158,7 +158,7 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx,
@@ -133,5 +181,5 @@ index 9dc7d5e72b..ff11022db7 100644
if (err) {
ff_vaapi_decode_cancel(avctx, pic);
--
-2.45.1
+2.25.1
diff --git a/0002-lavc-vaapi_av1-Avoid-sending-the-same-slice-buffer-m.patch
b/0002-lavc-vaapi_av1-Avoid-sending-the-same-slice-buffer-m.patch
index 91d018a..4d9af55 100644
--- a/0002-lavc-vaapi_av1-Avoid-sending-the-same-slice-buffer-m.patch
+++ b/0002-lavc-vaapi_av1-Avoid-sending-the-same-slice-buffer-m.patch
@@ -1,7 +1,7 @@
-From 1740980b070897fd147b2d1a5259c9d7957d58a8 Mon Sep 17 00:00:00 2001
+From d2d911eb9a2fc6eb8d86b3ae025a56c1a2692fba Mon Sep 17 00:00:00 2001
From: David Rosca <nowrep(a)gmail.com>
Date: Wed, 8 May 2024 09:11:13 +0200
-Subject: [PATCH 2/2] lavc/vaapi_av1: Avoid sending the same slice buffer
+Subject: [PATCH 1/1] lavc/vaapi_av1: Avoid sending the same slice buffer
multiple times
When there are multiple tiles in one slice buffer, use multiple slice
@@ -11,13 +11,12 @@ increasing the bitstream size the driver will need to upload to hw.
Reviewed-by: Neal Gompa <ngompa13(a)gmail.com>
Signed-off-by: David Rosca <nowrep(a)gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang(a)intel.com>
-(cherry picked from commit d2d911eb9a2fc6eb8d86b3ae025a56c1a2692fba)
---
libavcodec/vaapi_av1.c | 47 +++++++++++++++++++++++++++++-------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/libavcodec/vaapi_av1.c b/libavcodec/vaapi_av1.c
-index 03771dd3e0..ea8dd4d93d 100644
+index e184d01a43..fe0852318d 100644
--- a/libavcodec/vaapi_av1.c
+++ b/libavcodec/vaapi_av1.c
@@ -19,6 +19,7 @@
@@ -108,5 +107,5 @@ index 03771dd3e0..ea8dd4d93d 100644
const FFHWAccel ff_av1_vaapi_hwaccel = {
--
-2.45.1
+2.25.1