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 3AFF140841 for ; Sun, 24 Dec 2023 23:07:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5717568D149; Mon, 25 Dec 2023 01:07:00 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 50BFF68CD82 for ; Mon, 25 Dec 2023 01:06:54 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 361F9E0002 for ; Sun, 24 Dec 2023 23:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703459213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QdY6dXGvekdtocTC6P5lr2A0P7pJNLyC6VbYB+U6VYM=; b=GmFsPOhzY+IwhAbhwt3ZDFEIsihJHRS8iYlYHZ20of3gfMZ92m0CNjUKnd8Y1FMoqk555X vdCtq4TWCCoGho6+NulJIZ+eU5QFvA2eJHrwXe9P3Tc8QK5EQ3ZL/PyiGFAusFJagdh4Ly Vr1wAD3mTqty2p+UcWCWampQxePM1kyt4Xld3oubEWI0AfF+ohetYnKrHfqwfuJKqXPnPW JGAH4Bzvs8YXhONyiadbVOndMe04UjI6zAU2mvEzodsrFoZckUUtERbV3XaxQpgT2VIDbt 82pgObcE+kdzefhYcUd5hoa6unFtmjacIXtQ2a/fsBh42QVKaEsu7IdMDsxJbw== Date: Mon, 25 Dec 2023 00:06:52 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231224230652.GM6420@pb2> References: <20231205065034.1621-1-tong1.wu@intel.com> <20231205065034.1621-2-tong1.wu@intel.com> MIME-Version: 1.0 In-Reply-To: <20231205065034.1621-2-tong1.wu@intel.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v12 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="===============8616992138041782928==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8616992138041782928== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ByWDhVrfOLxO82cA" Content-Disposition: inline --ByWDhVrfOLxO82cA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 05, 2023 at 02:46:44PM +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 > --- [...] > +unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, > + D3D12VADecodeContext *ctx, const A= VFrame *frame, > + int curr) > +{ > + AVD3D12VAFrame *f; > + ID3D12Resource *res; > + unsigned i; > + > + f =3D (AVD3D12VAFrame *)frame->data[0]; > + if (!f) > + goto fail; > + > + res =3D f->texture; > + if (!res) > + goto fail; > + > + if (!curr) { > + for (i =3D 0; i < ctx->max_num_ref; i++) { > + if (ctx->ref_resources[i] && res =3D=3D ctx->ref_resources[i= ]) { > + ctx->used_mask |=3D 1 << i; > + return i; > + } > + } > + } else { > + for (i =3D 0; i < ctx->max_num_ref; i++) { > + if (!((ctx->used_mask >> i) & 0x1)) { > + ctx->ref_resources[i] =3D res; > + return i; > + } > + } > + } > + > +fail: > + assert(0); this should probably be some av_assert* thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threat= s=20 related to an insecure 5G network, it needs to rethink the extent to which = it values corporate profits and government espionage over security.-Bruce Schn= eier --ByWDhVrfOLxO82cA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZYi5iQAKCRBhHseHBAsP q3HEAJ4lbOQdi22pt76yMAuqjmXvh4CxfwCdGDaczgWAfpy/6wMc4oZSdiVETPU= =9OLx -----END PGP SIGNATURE----- --ByWDhVrfOLxO82cA-- --===============8616992138041782928== 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". --===============8616992138041782928==--