From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9A522466C1 for ; Wed, 31 May 2023 20:56:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9C4A668C220; Wed, 31 May 2023 23:56:37 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14D5268BE95 for ; Wed, 31 May 2023 23:56:30 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id C944920003 for ; Wed, 31 May 2023 20:56:29 +0000 (UTC) Date: Wed, 31 May 2023 22:56:28 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230531205628.GV1391451@pb2> References: <20230531030722.1307-1-tong1.wu@intel.com> <20230531030722.1307-2-tong1.wu@intel.com> MIME-Version: 1.0 In-Reply-To: <20230531030722.1307-2-tong1.wu@intel.com> Subject: Re: [FFmpeg-devel] [PATCH v2 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============4978075155441965294==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4978075155441965294== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sA0T44BA86podSFD" Content-Disposition: inline --sA0T44BA86podSFD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 31, 2023 at 11:07:15AM +0800, Tong Wu wrote: > From: Wu Jianhua >=20 > The implementation is based on: > https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-vide= o-overview >=20 > With the Direct3D 12 video decoding support, we can render or process > the decoded images by the pixel shaders or compute shaders directly > without the extra copy overhead, which is beneficial especially if you > are trying to render or post-process a 4K or 8K video. >=20 > The command below is how to enable d3d12va: > ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4 >=20 > Signed-off-by: Wu Jianhua > Signed-off-by: Tong Wu > --- > configure | 2 + > libavcodec/Makefile | 3 + > libavcodec/d3d11va.h | 3 - > libavcodec/d3d12va.c | 552 ++++++++++++++++++++++++++++++++++++ > libavcodec/d3d12va.h | 184 ++++++++++++ > libavcodec/d3d12va_h264.c | 210 ++++++++++++++ > libavcodec/dxva2.c | 24 ++ > libavcodec/dxva2.h | 3 - > libavcodec/dxva2_h264.c | 12 +- > libavcodec/dxva2_internal.h | 69 +++-- > libavcodec/h264_slice.c | 4 + > libavcodec/h264dec.c | 3 + > libavcodec/hwaccels.h | 1 + > libavcodec/hwconfig.h | 2 + > 14 files changed, 1030 insertions(+), 42 deletions(-) > create mode 100644 libavcodec/d3d12va.c > create mode 100644 libavcodec/d3d12va.h > create mode 100644 libavcodec/d3d12va_h264.c seems to break build on mingw64 here make CC libavcodec/dxva2.o In file included from src/libavcodec/dxva2.c:33:0: src/libavcodec/dxva2.c: In function =E2=80=98ff_dxva2_get_surface_index=E2= =80=99: src/libavcodec/dxva2_internal.h:48:43: error: pasting "." and "surface_coun= t" does not give a valid preprocessing token #define D3D11VA_VAR(ctx, var) ctx->d3d11va.##var ^ src/libavcodec/dxva2_internal.h:123:114: note: in expansion of macro =E2=80= =98D3D11VA_VAR=E2=80=99 #define DXVA2_CONTEXT_VAR(avctx, ctx, var) (avctx->pix_fmt =3D=3D AV_PIX_F= MT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) : DXVA2_V= AR(ctx, var))) = ^~~~~~~~~~~ src/libavcodec/dxva2_internal.h:127:49: note: in expansion of macro =E2=80= =98DXVA2_CONTEXT_VAR=E2=80=99 #define DXVA_CONTEXT_COUNT(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, c= tx, surface_count) ^~~~~~~~~~~~~~~~~ src/libavcodec/dxva2.c:791:21: note: in expansion of macro =E2=80=98DXVA_CO= NTEXT_COUNT=E2=80=99 for (i =3D 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { ^ In file included from src/libavcodec/dxva2.c:33:0: src/libavcodec/dxva2_internal.h:40:39: error: pasting "." and "surface_coun= t" does not give a valid preprocessing token #define DXVA2_VAR(ctx, var) ctx->dxva2.##var ^ src/libavcodec/dxva2_internal.h:123:139: note: in expansion of macro =E2=80= =98DXVA2_VAR=E2=80=99 #define DXVA2_CONTEXT_VAR(avctx, ctx, var) (avctx->pix_fmt =3D=3D AV_PIX_F= MT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) : DXVA2_V= AR(ctx, var))) = ^~~~~~~~~ src/libavcodec/dxva2_internal.h:127:49: note: in expansion of macro =E2=80= =98DXVA2_CONTEXT_VAR=E2=80=99 #define DXVA_CONTEXT_COUNT(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, c= tx, surface_count) ^~~~~~~~~~~~~~~~~ src/libavcodec/dxva2.c:791:21: note: in expansion of macro =E2=80=98DXVA_CO= NTEXT_COUNT=E2=80=99 for (i =3D 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { ^ src/ffbuild/common.mak:81: recipe for target 'libavcodec/dxva2.o' failed make: *** [libavcodec/dxva2.o] Error 1 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answe= r. --sA0T44BA86podSFD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZHe0eAAKCRBhHseHBAsP q8gOAJ0Qq82Q3+NGtu9VZXlaG5tRiBDR4wCeNwDwPX4Pzxz0QRDRD02y6ckEPyE= =bRdL -----END PGP SIGNATURE----- --sA0T44BA86podSFD-- --===============4978075155441965294== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============4978075155441965294==--