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 v12 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding
Date: Mon, 25 Dec 2023 00:06:52 +0100
Message-ID: <20231224230652.GM6420@pb2> (raw)
In-Reply-To: <20231205065034.1621-2-tong1.wu@intel.com>


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

On Tue, Dec 05, 2023 at 02:46:44PM +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>
> ---
[...]
> +unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx,
> +                                      D3D12VADecodeContext *ctx, const AVFrame *frame,
> +                                      int curr)
> +{
> +    AVD3D12VAFrame *f;
> +    ID3D12Resource *res;
> +    unsigned i;
> +
> +    f = (AVD3D12VAFrame *)frame->data[0];
> +    if (!f)
> +        goto fail;
> +
> +    res = f->texture;
> +    if (!res)
> +        goto fail;
> +
> +    if (!curr) {
> +        for (i = 0; i < ctx->max_num_ref; i++) {
> +            if (ctx->ref_resources[i] && res == ctx->ref_resources[i]) {
> +                ctx->used_mask |= 1 << i;
> +                return i;
> +            }
> +        }
> +    } else {
> +        for (i = 0; i < ctx->max_num_ref; i++) {
> +            if (!((ctx->used_mask >> i) & 0x1)) {
> +                ctx->ref_resources[i] = res;
> +                return i;
> +            }
> +        }
> +    }
> +
> +fail:
> +    assert(0);

this should probably be some av_assert*

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If the United States is serious about tackling the national security threats 
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier

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

  reply	other threads:[~2023-12-24 23:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05  6:46 [FFmpeg-devel] [PATCH v12 1/9] libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding Tong Wu
2023-12-24 23:06   ` Michael Niedermayer [this message]
2023-12-25  2:07     ` Wu, Tong1
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 3/9] avcodec: add D3D12VA hardware accelerated HEVC decoding Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 4/9] avcodec: add D3D12VA hardware accelerated VP9 decoding Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 5/9] avcodec: add D3D12VA hardware accelerated AV1 decoding Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 6/9] avcodec: add D3D12VA hardware accelerated MPEG-2 decoding Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 7/9] avcodec: add D3D12VA hardware accelerated VC1 decoding Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 8/9] Changelog: D3D12VA hardware accelerated H264, HEVC, VP9, AV1, MPEG-2 and " Tong Wu
2023-12-05  6:46 ` [FFmpeg-devel] [PATCH v12 9/9] avcodec/d3d12va_hevc: enable allow_profile_mismatch flag for d3d12va msp profile Tong Wu
2023-12-18  6:28 ` [FFmpeg-devel] [PATCH v12 1/9] libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 Xiang, Haihao
2023-12-21  8:30   ` Xiang, Haihao
2023-12-21  9:00     ` Lynne
2023-12-21 11:38       ` Wu, Tong1

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=20231224230652.GM6420@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