Skip to content

Commit

Permalink
d3d12va: manually add mem.h to fix the regression
Browse files Browse the repository at this point in the history
Signed-off-by: Tong Wu <tong1.wu@intel.com>
  • Loading branch information
tong1wu committed Apr 3, 2024
1 parent f522ba2 commit 8d224bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a26c4b900d402f2fabf82c53ebd2e9f739d9044f Mon Sep 17 00:00:00 2001
From 399a030b258529a46dd0c45ba437a150f1274d37 Mon Sep 17 00:00:00 2001
From: Tong Wu <tong1.wu@intel.com>
Date: Thu, 14 Mar 2024 13:16:57 +0800
Subject: [PATCH 03/11] avcodec/vaapi_encode: move the dpb logic from VAAPI to
Subject: [PATCH 02/10] avcodec/vaapi_encode: move the dpb logic from VAAPI to
base layer

Move receive_packet function to base. Add *alloc, *issue, *output, *free
Expand All @@ -11,7 +11,7 @@ base layer as-is.
Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
libavcodec/Makefile | 2 +-
libavcodec/hw_base_encode.c | 599 ++++++++++++++++++++++++++++++++
libavcodec/hw_base_encode.c | 600 ++++++++++++++++++++++++++++++++
libavcodec/hw_base_encode.h | 2 +
libavcodec/vaapi_encode.c | 586 +------------------------------
libavcodec/vaapi_encode.h | 3 -
Expand All @@ -22,7 +22,7 @@ Signed-off-by: Tong Wu <tong1.wu@intel.com>
libavcodec/vaapi_encode_mpeg2.c | 2 +-
libavcodec/vaapi_encode_vp8.c | 2 +-
libavcodec/vaapi_encode_vp9.c | 2 +-
12 files changed, 625 insertions(+), 581 deletions(-)
12 files changed, 626 insertions(+), 581 deletions(-)
create mode 100644 libavcodec/hw_base_encode.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
Expand All @@ -40,10 +40,10 @@ index 7ef2e03ca6..79063a6ef4 100644
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c
new file mode 100644
index 0000000000..dcba902f44
index 0000000000..1d9a255f69
--- /dev/null
+++ b/libavcodec/hw_base_encode.c
@@ -0,0 +1,599 @@
@@ -0,0 +1,600 @@
+/*
+ * This file is part of FFmpeg.
+ *
Expand All @@ -66,6 +66,7 @@ index 0000000000..dcba902f44
+#include "libavutil/common.h"
+#include "libavutil/internal.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
+#include "libavutil/pixdesc.h"
+
+#include "encode.h"
Expand Down
17 changes: 9 additions & 8 deletions patches/0129-avcodec-add-D3D12VA-hardware-HEVC-encoder.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d749489d90062e94ecf5fa6ae0cbdb27dddea56d Mon Sep 17 00:00:00 2001
From c4bbe2d90c4039e0818b644a193afabfd3ed5b1c Mon Sep 17 00:00:00 2001
From: Tong Wu <tong1.wu@intel.com>
Date: Tue, 22 Aug 2023 13:26:36 +0800
Subject: [PATCH 11/11] avcodec: add D3D12VA hardware HEVC encoder
Subject: [PATCH 10/10] avcodec: add D3D12VA hardware HEVC encoder

This implementation is based on D3D12 Video Encoding Spec:
https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html
Expand All @@ -17,8 +17,8 @@ Signed-off-by: Tong Wu <tong1.wu@intel.com>
libavcodec/allcodecs.c | 1 +
libavcodec/d3d12va_encode.c | 1550 ++++++++++++++++++++++++++++++
libavcodec/d3d12va_encode.h | 321 +++++++
libavcodec/d3d12va_encode_hevc.c | 957 ++++++++++++++++++
6 files changed, 2838 insertions(+), 1 deletion(-)
libavcodec/d3d12va_encode_hevc.c | 958 ++++++++++++++++++
6 files changed, 2839 insertions(+), 1 deletion(-)
create mode 100644 libavcodec/d3d12va_encode.c
create mode 100644 libavcodec/d3d12va_encode.h
create mode 100644 libavcodec/d3d12va_encode_hevc.c
Expand Down Expand Up @@ -104,7 +104,7 @@ index 2386b450a6..7b5093233c 100644
extern const FFCodec ff_hevc_mf_encoder;
diff --git a/libavcodec/d3d12va_encode.c b/libavcodec/d3d12va_encode.c
new file mode 100644
index 0000000000..88a08efa76
index 0000000000..1bd05d0117
--- /dev/null
+++ b/libavcodec/d3d12va_encode.c
@@ -0,0 +1,1550 @@
Expand Down Expand Up @@ -134,6 +134,7 @@ index 0000000000..88a08efa76
+#include "libavutil/common.h"
+#include "libavutil/internal.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/hwcontext_d3d12va_internal.h"
+#include "libavutil/hwcontext_d3d12va.h"
Expand Down Expand Up @@ -785,7 +786,6 @@ index 0000000000..88a08efa76
+static int d3d12va_encode_output(AVCodecContext *avctx,
+ const HWBaseEncodePicture *base_pic, AVPacket *pkt)
+{
+ D3D12VAEncodeContext *ctx = avctx->priv_data;
+ D3D12VAEncodePicture *pic = (D3D12VAEncodePicture *)base_pic;
+ AVPacket *pkt_ptr = pkt;
+ int err;
Expand Down Expand Up @@ -1987,10 +1987,10 @@ index 0000000000..10e2d87035
+#endif /* AVCODEC_D3D12VA_ENCODE_H */
diff --git a/libavcodec/d3d12va_encode_hevc.c b/libavcodec/d3d12va_encode_hevc.c
new file mode 100644
index 0000000000..aec0d9dcec
index 0000000000..5d709cf0cc
--- /dev/null
+++ b/libavcodec/d3d12va_encode_hevc.c
@@ -0,0 +1,957 @@
@@ -0,0 +1,958 @@
+/*
+ * Direct3D 12 HW acceleration video encoder
+ *
Expand All @@ -2014,6 +2014,7 @@ index 0000000000..aec0d9dcec
+ */
+#include "libavutil/opt.h"
+#include "libavutil/common.h"
+#include "libavutil/mem.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/hwcontext_d3d12va_internal.h"
+
Expand Down

0 comments on commit 8d224bf

Please sign in to comment.