Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding
Date: Wed, 31 May 2023 22:56:28 +0200
Message-ID: <20230531205628.GV1391451@pb2> (raw)
In-Reply-To: <20230531030722.1307-2-tong1.wu@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 4118 bytes --]

On Wed, May 31, 2023 at 11:07:15AM +0800, Tong Wu wrote:
> From: Wu Jianhua <toqsxw@outlook.com>
> 
> The implementation is based on:
> https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview
> 
> 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.
> 
> The command below is how to enable d3d12va:
> ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4
> 
> Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
> Signed-off-by: Tong Wu <tong1.wu@intel.com>
> ---
>  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 ‘ff_dxva2_get_surface_index’:
src/libavcodec/dxva2_internal.h:48:43: error: pasting "." and "surface_count" 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 ‘D3D11VA_VAR’
 #define DXVA2_CONTEXT_VAR(avctx, ctx, var) (avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) :  DXVA2_VAR(ctx, var)))
                                                                                                                  ^~~~~~~~~~~
src/libavcodec/dxva2_internal.h:127:49: note: in expansion of macro ‘DXVA2_CONTEXT_VAR’
 #define DXVA_CONTEXT_COUNT(avctx, ctx)          DXVA2_CONTEXT_VAR(avctx, ctx, surface_count)
                                                 ^~~~~~~~~~~~~~~~~
src/libavcodec/dxva2.c:791:21: note: in expansion of macro ‘DXVA_CONTEXT_COUNT’
     for (i = 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_count" 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 ‘DXVA2_VAR’
 #define DXVA2_CONTEXT_VAR(avctx, ctx, var) (avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) :  DXVA2_VAR(ctx, var)))
                                                                                                                                           ^~~~~~~~~
src/libavcodec/dxva2_internal.h:127:49: note: in expansion of macro ‘DXVA2_CONTEXT_VAR’
 #define DXVA_CONTEXT_COUNT(avctx, ctx)          DXVA2_CONTEXT_VAR(avctx, ctx, surface_count)
                                                 ^~~~~~~~~~~~~~~~~
src/libavcodec/dxva2.c:791:21: note: in expansion of macro ‘DXVA_CONTEXT_COUNT’
     for (i = 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 answer.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

  parent reply	other threads:[~2023-05-31 20:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  3:07 [FFmpeg-devel] [PATCH v2 1/9] libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding Tong Wu
2023-05-31  7:50   ` Zhanbang He
2023-05-31  8:54     ` Wu, Tong1
2023-05-31 20:56   ` Michael Niedermayer [this message]
2023-06-01 11:23     ` Wu, Tong1
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 3/9] avcodec: add D3D12VA hardware accelerated HEVC decoding Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 4/9] avcodec: add D3D12VA hardware accelerated VP9 decoding Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 5/9] avcodec: add D3D12VA hardware accelerated AV1 decoding Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 6/9] avcodec: add D3D12VA hardware accelerated MPEG-2 decoding Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 7/9] avcodec: add D3D12VA hardware accelerated VC1 decoding Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 8/9] Changelog: D3D12VA hardware accelerated H264, HEVC, VP9, AV1, MPEG-2 and " Tong Wu
2023-05-31  3:07 ` [FFmpeg-devel] [PATCH v2 9/9] avcodec/d3d12va_hevc: enable allow_profile_mismatch flag for d3d12va msp profile Tong Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230531205628.GV1391451@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git