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 8FF134346F for ; Fri, 11 Nov 2022 16:50:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 99C1868B034; Fri, 11 Nov 2022 18:50:40 +0200 (EET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2013.outbound.protection.outlook.com [40.92.99.13]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A43868B034 for ; Fri, 11 Nov 2022 18:50:33 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fEwQLHnrhRTJIeKJz9JIawIiN9pfPyPuShb4+4f3rP1Z74fMHEgfmwcBY/+r04Lf2CLLpre76k6ot5YstMbTdjKtlcuqXshKbll5Z4ZNB+9mPld+f6A6/f9VvRgdTE3PFKm3d8iv2VcIdtVZ6gTWz2p4p4bZUFEXhaP1FNoNBRD7E55Et61vUkajpkHg6r/EXIlSlJ6s94iDOKNfXd3GUEBuTPhOaXxawm5Ba5xMx7NBlmgUY/m/IhsFn/c4Ip/SD1wGzcGf192xrAKNTnxSC9glk+OLrXULU7HOI0S12Ydhz26joT0TyV554GGK904JvKBKXza73OewrbSZVbgKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=76Q6jA0MR29UAasWCrgaEOVI2R5uL4TnLIDCrkuGHS8=; b=M8ne3rQpC82YC+0hMSOCgxN0jNkJdjaGCq0hBWc9P1Orvme2Ea3nxmolqYDLnj0evkihnz11lxU9G3nFmQCOQpZ6THq3Hf5XmXvuSkdHwsIGhUZzVQ2Sqd1ofW2TtFK6gEb0IGVW9zOzge52ScZm0uaxrdg/ulaulkL9+EfmifuXg1RkvH0WCdL+AF34OmpIlWiQrmru9Zo5nI6/si32NQqwfvlqDgaMf3GG4KI/EZhA/Zj4GfBmvYTjG4BoJpeKazzcmOEx6LzR49rbWdNnQZfjlNkjPj4D2beUPtNisax+A5HcMIEa6TqN+SNcB+NH+ZQI1o33D2hhenMNgJLxOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=76Q6jA0MR29UAasWCrgaEOVI2R5uL4TnLIDCrkuGHS8=; b=obfSFUxIJ+dQ4khSr1c91sOcM4Ptwq9C2TfWwxudVjEJ7hr2D76pBxmsdnSxR6MWEDVH60P2YonDL73xAZKuq0RVO1/he97a/kJtp8dJ7m/m4PBbPdJaZRPNcz1wcr0AqlUpE5G5fpdaf+RjRjLjGb9YilaDdxcUb4l8lT6XVY9Ze+Nakl7cn4dpz2CD7/CGDGkI/LQBQ5kpZ3Lw8vSxyosiVHLnVRd4hh3b0bGKEtUZosIcNTTyjCv8JT4s7tTR9RlLLbwcXRXhLoX2vsaKtKkLyI1lfVtCHElvRZf9natvqVyVFfprDZM/O4m6jVt5esvzpXT3pXGGV0qjl1aGrw== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by TYCP286MB1465.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:17a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 16:50:29 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::5fa3:fb9a:f219:8c6f]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::5fa3:fb9a:f219:8c6f%5]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 16:50:29 +0000 From: Wu Jianhua To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH] avcodec: add D3D12VA hardware accelerated H264, HEVC, VP9, and AV1 decoding Thread-Index: AQHY3ikJgFdXkq4tME+m/9XuU1s84q4KmZUqgAGrKYCAACuYSoAAeaYAgADlI5qAAR8RAIArLmYG Date: Fri, 11 Nov 2022 16:50:29 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [JgLt+N6bnxYLEbVLPpQNjBC01aJZuoPa] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: OSZP286MB2173:EE_|TYCP286MB1465:EE_ x-ms-office365-filtering-correlation-id: 67256033-61cc-45b6-a766-08dac404d72f x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pYNuCZQVK6f9asy/0REmIwb7HnBOmHRDowM3I0mpzB5kCIQmtYij3JDzrpiPnYFiJ4jKkConxRveZT+lBETCodiQ05aaIAgEdjuYrY7GsNeFZB2x+5Ce07jQw2HUrlPOMcAjezl4S31/mMEot60ju/J4dCMUbIxF5wqXGA1eifoFhQUg+rEddG11sEvdqVdaWN6h+DCBgcQfYREw6iyVVlCivgch+39J3kBGa26eZZX+YIs9CZ6DqokVs29dM/lpHJ6nSK5FalSS6SOC89AncTy7kY+v8BWanUu14lDL9Q0LtbFpyCSLdPzEcIbIS4W5pA6juPRCRVxDXXAxiucbQUg9oWcrrPbI3WYdG2JGYBjHEg1ffMMtk8mNtVScRIAOj06aeE65ERgasoMZTyRYqb17JQ7wYvJtGsEyn+X6O2tdOs4Lf43sX0MwIlJxrfReDND8CYCH8Bjiu6qM1ZfhZu/kqF0cJDkMwRPoHZMj9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WTGwwcEFjRDlEelR6TDhzekZONC8rOWJqSkdZ?= =?iso-2022-jp?B?SkdZZk5GeDNUSFFpTTBIQUVtSVgvc3V2M05qVEJhc29pZTRtVGFDUkd6?= =?iso-2022-jp?B?dU00ZVFKT3FLdmZiQVN0d1VrQ25UbEE5M2FuOGdDVU4vcVo0U2xuK3ZC?= =?iso-2022-jp?B?NzFjM2NGakFKRkR1czBxRVo1Z09leFMzRkVpNTU2OUZjc0Z1WVpmZFcy?= =?iso-2022-jp?B?SFN3alhIOFljR3Z2ZGZVYkpWY0J4YUNoVWdUSTVudkI2SmtueWFoUElK?= =?iso-2022-jp?B?N0N2ZVV6UmRjQmNvcm51NDhVYVQrbUpjTTdha1czaUFIaWdyWnFpVERn?= =?iso-2022-jp?B?PT0=?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 67256033-61cc-45b6-a766-08dac404d72f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 16:50:29.5327 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB1465 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avcodec: add D3D12VA hardware accelerated H264, HEVC, VP9, and AV1 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: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > From: Lynne > Sent: 2022年10月15日 13:16 > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH] avcodec: add D3D12VA hardware accelerated H264, HEVC, VP9, and AV1 decoding > >Oct 14, 2022, 14:32 by toqsxw@outlook.com: > >> Lynne wrote: >> >>> Sent: 2022年10月14日 6:28 >>> To: FFmpeg development discussions and patches >>> Subject: Re: [FFmpeg-devel] [PATCH] avcodec: add D3D12VA hardware accelerated H264, HEVC, VP9, and AV1 decoding >>> >>> Oct 13, 2022, 17:48 by toqsxw@outlook.com: >>> >>>>> Lynne wrote: >>>>> >>>>> Oct 12, 2022, 13:09 by toqsxw@outlook.com: >>>>> >>>>> [PATCH] avcodec: add D3D12VA hardware accelerated H264, HEVC, VP9, and AV1 decoding >>>>> >>>>> Patch attached. >>>>> >>>>> The Sync locking functions and the queue locking functions should >>>>> be a function pointer in the device/frame context. Vulkan has >>>>> the same issue, and that's how I did it there. This allows for >>>>> API users to plug their own locking primitives in, which they need >>>>> to in case they initialize their own contexts. >>>>> >>>> >>>> I don’t need to follow your design. >>>> >>> >>> Yes, you do, because it's not my design, it's the design of the entire >>> hwcontext system. If API users cannot initialize a hwcontext with >>> their own, it's breakage. It's not optional. >>> Locking primitives are a part of this. >>> Either fix this or this is simply not getting merged. >>> >> >> As I learn from the docs of Direct3D12, it is a multithreading-friendly API, >> which means that the only mandatory field, device, set by the user can be >> accessed and used without any lock. Why do the API users need locking >> primitives to init the hwcontext_d3d12va? Have you got the initialization >> failed? If so, could you share the runtime error details here? >> >> And I checked the other hwcontexts, they didn't have a locking primitive also. >> The hwcontext_d3d11va has a locking used to protect accesses to device_context >> and video_context calls, which d3d12 doesn't need. So why the API users cannot >> initialize the hwcontext with their own? Is there any real failure case? Please pardon >> I don't quite understand what situation you are talking about, could you elaborate >> further if I get it wrong? >> >>>>> You should also document which fields API users have to set >>>>> themselves if they plan to use their own context. >>>>> >>>> >>>> Where should I document them? Doesn’t the comments enough? >>>> >>> In the comments. Look at how it's done elsewhere. >>> >> There is already a comment like what d3d11va wrote: >> /** >> * Device used for objects creation and access. This can also be >> * used to set the libavcodec decoding device. >> * >> * Can be set by the user. This is the only mandatory field - the other >> * device context fields are set from this and are available for convenience. >> * >> * Deallocating the AVHWDeviceContext will always release this interface, >> * and it does not matter whether it was user-allocated. >> */ >> ID3D12Device *device; >> >> Is there anything else missing? >> > > What about the frames context? Frame contexts are also user-settable. Yeah. The comment is missing. I will add them. Thanks. >>>>> Also, struct names in the public context lack an AV prefix. >>>>> >>>> Will fix. And which struct? Could you add the reference? >>>> >>> >>> In the main public context. >>> >> I check the codes and found that AVD3D12VASyncContext, AVD3D12VADeviceContext, >> AVD3D12FrameDescriptor and AVD3D12VAFramesContext are the structs in >> the hwcontext_d3d12va. Is there any other struct without AV prefix? Could you >> paste the name here? >> >>>>> D3D12VA_MAX_SURFACES is a terrible hack. Vendors should >>>>> fix their own drivers rather than users running out of memory. >>>>> >>>> >>>> Not my responsibility as a personal developer. I know nothing >>>> about the drivers. You can ask those vendors to fix them. I don’t >>>> think it’s a `terrible hack`. On my test, The MAX_SURFACES is >>>> enough for the decoder. If there are any docs or the drivers fixed >>>> it, just simply remove it. Why user will run out of memory? >>>> >>> >>> The whole way the hwcontext is designed is sketchy. Why are >>> you keeping all texture information in an array (texture_infos)?Frames are already pooled (it's called AVFramePool), so you're >>> not doing anything by adding a second layer on top of this other >>> than complexity. >>> The initial_pool_size parameter was a hack added to support >>> hwcontexts which cannot allocate surfaces dynamically, you don't >>> need to support this at all, you can just let users allocate >>> frames as they need to rather than preinitializing. >>> >> >> It’s the same implementation as d3d11va. The static initial_pool_size is >> needed by the decoder heap to initialize and the input stream needs it >> as well The feature that allows the user to allocate frames is not the basic >> functionalities of decoding. I recommend the user who needs the feature >> implement it and contribute the codes. >> > > It'll limit the hwcontext to just decoding, but whatever. > > Are there any devices that don't support Vulkan but support d3d12? Maybe those device only care about one thing, like a games console or something. Just a guess. _______________________________________________ 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".