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 EE6CD4105E for ; Fri, 11 Nov 2022 16:41:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E42CB68B5DA; Fri, 11 Nov 2022 18:41:38 +0200 (EET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2102.outbound.protection.outlook.com [40.92.99.102]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89CA668AE3C for ; Fri, 11 Nov 2022 18:41:31 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hk60OIm12+irGo3R2mx/VwLtbjFRqa5JmwBmXTxXVhirRy7nlQxWKBXsTyMtjszwBehNqwOypySVQb5Sc7RPXqdw5RU3O/Ey0ENziln4LbwrODzzWiJ5ehUtK/qc2nSaZlRlqLUomEDFxMHoXojQMI1ov3xyBukQARw3cNwpb2Neba/O3+4FOOUS+vO4cgsT6kzH7RykhIlj9yttYVjnwbTuypS9eMlhn6FKTFxen0xwMSTAsVc2+Rqwg/ZxiGotIZXBhtOAso7hDLLmlEa610lW2IQNCSv4qpL+XvebZ1K9YrfI3YiMJ2iAZhJ5s2i24WSffOdJ3y1TifcFavdm7g== 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=4WUGu21KhKZzhCuxTqvYJEJPYn05OyKHHoOVSmeZTs8=; b=JZahyKPDbjrUyFVCgBMzVY2TZa53oGICRLFx5r0/FOr/kpXyV+R9HQhTi5kEGaiVKzoW9uuFHBSW/R8n3p8UYw3cIo5gu8tiuDnrKCFhu2J9+OvhfDNnDnU7TURle2LIL/pCJUr5AEjZDye8ElzpIyILvpPUbHdWA3DeDTANcaVxLx/M5TRXQMGtsN2oJmgV8jEPazWeDA5bLHOjPGLNqG89EXdRZg6bT8lQiW+RcBgsMzGsdkvnAs5K5ggGJnEZitDKe9DpYYFBT5I+R9WhNmsCmUPbZ/LZLih+AhNPsDWlFQlL6CbDejyl1KGcB3jxdEmVtl/i3OhW0ziNLHxeTQ== 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=4WUGu21KhKZzhCuxTqvYJEJPYn05OyKHHoOVSmeZTs8=; b=CD8CsLEHTbwDO0eMwiBmkULqOGE13z3a9/hO9/yTB4hf026VDNBVzHWxWm7wu+iWZpqAtOaMl/rUhjw8xpRkIG1q+RdsQ0lfph0FlSJDhHg8IgyMKuCrf14jGOPmqLhDjX7NCBBiFFvpM+Ss2tiS7hknWVTw31YjCe+kK2Vssa4AfKZDEjXdorn1lwM3SpnUX8KLO+yjHskvT+w4K0yiC5hwU/czoJKswFOGmK8VoagF+nTE2BhvqrCE6TVQ+qGVdywCGYvENu0GgxdBkragR8+KWX+AqPJPUZ6i4DMXLO/Vzg15A3xIFvvuY9ZpNossty8Uzyho0mjHlvm4Pa+Sxw== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by OSZP286MB2270.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18b::7) 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:41:27 +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:41:27 +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/9XuU1s84q4KmZUqgAGrKYCAACuYSoAAeaYAgADlI5qAAR8RAIArLlyD Date: Fri, 11 Nov 2022 16:41:26 +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: [Mq1RujxYQbqY5+nIhL53o9Zcn5/JHOoW] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: OSZP286MB2173:EE_|OSZP286MB2270:EE_ x-ms-office365-filtering-correlation-id: d1aa7156-7719-4142-2742-08dac40393d0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: At+SfzcJRgBgscs2XXSMYXTaghTIq2JY6OU5ro6gFQCaBBEarKxH3FVNcv0sXOZ0C33P9RACuYH7JxM1LoPpbv/azmIZqDRlj706pCHP5p8tJbgxVn+VGsWh0qQgjhpHE89Y+VO6lpTCJke1qdvMgI8EaCC0ZBbqBKc1+7NGlP5krvuZtgZIu3eRvavo6YfZ6toA9L7+zlyMgAUGSyGszXm9Zs+LzDoCjvHDc54ZRG8/5/1fWDgGjyBodQKm6VuFTTkIj+kjY/CkagdDQHkk2Jmu7F6gW3NCkWPTeU8inYkHZ3u3EWUJszG05s6cXhGvJQWVQtiJ3O9MLjZaWV8mwRwIULDQYIRZlNYdBy2HkW60NWsoH8N05AZsvk72eWsMJ5FVEJzuvwfY6cb4k64mc+VKXC6EZ/HlRH4JGcnLIZu3D8o2ZlcZDikzUujo1dtfkxKVakvFopM/7STm5J3gkBVFAm/MmtXG5gA0fozfvs4/8JASGM95fVGEalqQh50StX8ppLjxjOSoLC75CMgytSAclEfbOu/g6rIiH8j+B/vqpL5r3yy/3+4tX7Qoc1M+Rxvk2kVmKII0ti7pSLdmahcGO4Tzh8wdlFCjBfL8jChvquADk1DKrzBhNSoO5LjSoMjSf/Rm1GDn3aHZ9c2NC2c1QErDrgTa3XumI8DpskSSplMlnZVF9rRg8hpj8JB6 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?c2orUEFwSk5pei9WVEREdnhRaGQzWDBGVmZ5ODFCbVJ6REo2ZGdzUDlQ?= =?iso-2022-jp?B?SkcvVW4rdHRmQWs0TXVaSlN4R3FsU2x3ZEREMGhQS01PTmg0Wkl0VDNl?= =?iso-2022-jp?B?eDBBWlY2MUZ3NE1ORHVmNldaZkY0MjdHQ3JZeFVRakwrSzhBaUdwRHk2?= =?iso-2022-jp?B?NW1IeUk3dkxOUUZDZ2kwV3VGOTZ1czVXUGFTYTM4a1RwSFI2OENGMjlp?= =?iso-2022-jp?B?ME9UOHVYTFF0NkI3RHpCZFEyTm5YVlBwMHVNZS9JV0xwRDM3YjdEZHNl?= =?iso-2022-jp?B?MGV2bmN4dGo0Mkk0YjZXVnB2aG9QZ3lYMFZMVVMxRWQwR0MrTGhCT05X?= =?iso-2022-jp?B?NnE1VFhXdjZ4bVZBT3pXUWN6bm9DcndEbmVSVzVVdFJzYmg0Nm1vWTJM?= =?iso-2022-jp?B?VnVUckJGazhCOXJjU3hRbVBkd1ovQzFtVUZSTGFqcXYrUE9VSm1nYVVY?= =?iso-2022-jp?B?MmEyYmcvVGZzMFg4d2N0ai8zREJkbUxGaGNDTTVrNEFITkVxandPRS9y?= =?iso-2022-jp?B?YUJibHVxdVdCbCtQc1daczJvZzJaUDNJcHJ2OGhSbCtuMlFtM2p3cGpj?= =?iso-2022-jp?B?TXZKbUxYQU5ESFZaWFVYdXFXMFpraXNlNm1uR21BYU1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nQStWUVRtaUlQUmVGNHhVMVVXanNnN2R4UkFn?= =?iso-2022-jp?B?M2hYR0ZTRU9CWUMwdzQ1cVY3dGJGQXhtWWNxc1dBSGROZ1doa2R6SGdy?= =?iso-2022-jp?B?bGk4eXU2eGxSSW5qNWtZSzBqTlV3eFZNMVhKQ2N1YnR6aDhJR3hseE02?= =?iso-2022-jp?B?L2JGSVRXaGhZbHpWdTlsNmxEZFREOUgyWnBoZkxXUDNyMG15cGsvUmRB?= =?iso-2022-jp?B?TjNVQ1pVQXBKNUw5dzNpN3B1Rk80VHlqdmg1U1NyNE9VeStlK00yRE1o?= =?iso-2022-jp?B?OERiclZxaTJtOWMwRGo3S2x3Skovall4WkwxZm5YWE5PUGVKVVRFdEVn?= =?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: d1aa7156-7719-4142-2742-08dac40393d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 16:41:26.9716 (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: OSZP286MB2270 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: ffmpeg-devel on behalf of Lynne Sent: Saturday, October 15, 2022 1:16:18 PM 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. >>>> 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? _______________________________________________ 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". _______________________________________________ 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".