From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id AFF134BD4B for ; Tue, 2 Dec 2025 02:28:42 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'3Nf/HFJi+aA66x+ZHZdFPWQxyzLfyhr0WkN/mLtUf2w=', expected b'Oz50Wp9/61AZ2qNYx9wYAscpIotNiyw4m2qJ59E9wu4=')) header.d=niedermayer.cc header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1764642513; h=date : to : message-id : references : mime-version : in-reply-to : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : from; bh=udsYyBVCyEkDFIznXWmAiH2Ro/dbymPUBeg0IJ7hQ/w=; b=KTXRCeBnkMFw2MqpLOdvhDjQbqWrZs9qfy2TXhX8M1t2HtSuOFAEHFHLktpgxxOWaggko X8n73NORPNx2id07Rgwl3qnlp5pOoUa5W6gVSl3Y9mQXXEEWELjV9qf7IYW7eaVqVn1nCrK N6nhdw6/ra36/7cwqm+W9pOQkr6ZOJnhbytvSDXtbYhmQUYEcc8MzPB3G4RMJPe3uDAxMPc 5YfsZreeHcss466kbslr/lWDNF8SpU1YMAuf9jVoSovO7mncoAtHx5z1OPBSoKWDH6Lz1Mj yKvotgSWKcbipMHNbFDPZqeiY6Zuqf02e/KrcMEiIm5kegtnnCVGDJutS1UA== Received: from [172.19.0.3] (unknown [172.19.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 9BE86690404; Tue, 2 Dec 2025 04:28:33 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1764642497; b=UKo7xgvMJbRGbdYxnRablrrKCn7EKKiqAMHedAPcPrn7a9TneHgVfPzbegtiJmoefDWV+ E3+Uhy0xWOw5MnH3w/q6suREdn/HbUMnasKo2ftq1ojQDOC0fQqRPhJ3uF969ZV2OMlEWlu ULXIIlV8e5O2kgIYN/1gid4/GpH0RXcI1/w4VflLgLYphjOVmP9mMNKVNHFpGd8T+/vnNbG HNihY7JO3Ox4ajPBOSMXFg5ARbRXn/wf3fHFJ9LMNKsuZ/gfkVV6n94LtRHRWErskhzStHr ZVwtn5zAqm3a4vdv5Z2rAAfqJYcpuE4BmokNW5CyoqWhlSQv+4W9mOY9iUkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1764642497; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=3Nf/HFJi+aA66x+ZHZdFPWQxyzLfyhr0WkN/mLtUf2w=; b=WE/EpYa2iJc7MVrOa1NpEzPTizCeh2wIsC0eyyklWlLzZ07THCdr3KSL/J3UliZXcr1Z2 LiB32b/Rkj5exr402M9W1awO28RAfPmaTsUgiri4DffNLnfS2Q4Fib4sT4/8g6t1yABRiwj M7f9fAgrdaZRYobVusEjU1UDw0BULi8yRbCWVdbjzvWb1uc/q3+hYjZQvN/KlkCRsyjYJZF dZTQkfeFFmuj6qMIuCLYgDWbw7a1qVONgCr0/5k4c/mIWRaH76VGsIhKxgniXtLDdFfaAsS 90AOnouLDmspS+vWteEX2jfYLpg1eF0/wsg7NVwCjXCSVJE4ucjJ1tv7Xvaw== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=niedermayer.cc; arc=none; dmarc=none Authentication-Results: ffmpeg.org; dkim=pass header.d=niedermayer.cc; arc=none (Message is not ARC signed); dmarc=none Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 525EC68FCB7 for ; Tue, 2 Dec 2025 04:28:03 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 63D3041B4B; Tue, 2 Dec 2025 02:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1764642482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Oz50Wp9/61AZ2qNYx9wYAscpIotNiyw4m2qJ59E9wu4=; b=jdMoAMHNtLT9f7k7RjeMsmDGbTgIKThwo+kJnwH8s+2K1PlSw5zyycnDbPjdXlv97K2I4p ZB9p1QuALu1wzTKToCFhPHAAlpvGFr1wXfFHDz11eaD3CIC3gv5pfJpgq74G3+Vs8XUFep fXMpjBoJNCtXvmSCqow0/gWZT4tgTp1gESz4UtOIzbO9GSOincT63lIK7j0TnKPOpZCbQW XvQJyUbJBMFe3q+HKiVF+0LCxM3acZ7yV+NSXrf6p4/aRV9P09M1vtBgYdVQOuGniByuBT GSMiQIyAZTVm9nec8WWoZ/36VfvtPf406C1QY7/O+go8p6MQ8kICDcX3eBE+oQ== Date: Tue, 2 Dec 2025 03:28:01 +0100 To: ffmpeg-devel@ffmpeg.org Message-ID: References: <20251126095910.2B49E68EB72@ffbox0-bg.ffmpeg.org> MIME-Version: 1.0 In-Reply-To: <20251126095910.2B49E68EB72@ffbox0-bg.ffmpeg.org> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheelfeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepledtieehtdfhuedthfegjedtleevgfduffduvddufffgtdehtddugeduiefhjedtnecukfhppeeguddrieeirdeiiedrhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieeirdehtddphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopeefpdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrghdprhgtphhtthhopefrrhhimhgvrgguvhhitggvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepfihuthhonhhguddvtdeksehouhhtlhhoohhkrdgtohhm X-GND-Sasl: michael@niedermayer.cc Message-ID-Hash: 2DNH6HBYCQIVSI2F6AS64JTEGAOHI5JM X-Message-ID-Hash: 2DNH6HBYCQIVSI2F6AS64JTEGAOHI5JM X-MailFrom: SRS0=n641=6I=niedermayer.cc=michael@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] Re: [FFmpeg-cvslog] [ffmpeg] branch master updated. 92f2f9ea5c avcodec/d3d12va_encode: D3D12 AV1 encoding support List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michael Niedermayer via ffmpeg-devel Cc: Araz Iusubov , Tong Wu , Michael Niedermayer Content-Type: multipart/mixed; boundary="===============5229957656686920760==" Archived-At: List-Archive: List-Post: --===============5229957656686920760== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y8jSDekwkXtO9B/O" Content-Disposition: inline --Y8jSDekwkXtO9B/O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Wed, Nov 26, 2025 at 11:59:09AM +0200, ffmpeg-git--- via ffmpeg-cvslog w= rote: > The branch, master has been updated > via 92f2f9ea5c49e94814693861a7e9e47c993fca2e (commit) > from 81362b319ea7244d8d17110adfa59f10c7e78268 (commit) >=20 >=20 > - Log ----------------------------------------------------------------- > commit 92f2f9ea5c49e94814693861a7e9e47c993fca2e > Author: Araz Iusubov > AuthorDate: Mon Nov 10 17:23:25 2025 +0100 > Commit: Tong Wu > CommitDate: Wed Nov 26 09:58:44 2025 +0000 >=20 > avcodec/d3d12va_encode: D3D12 AV1 encoding support > =20 > Implement AV1 hardware encoding > using Direct3D 12 Video API (D3D12VA). >=20 [...] > int ff_d3d12va_encode_receive_packet(AVCodecContext *avctx, AVPacket *pk= t); > diff --git a/libavcodec/d3d12va_encode_av1.c b/libavcodec/d3d12va_encode_= av1.c > new file mode 100644 > index 0000000000..e7a115a2ee > --- /dev/null > +++ b/libavcodec/d3d12va_encode_av1.c [...] > +static int d3d12va_encode_av1_get_coded_data(AVCodecContext *avctx, > + D3D12VAEncodePicture *pic, = AVPacket *pkt) > +{ > + int err =3D 0; > + uint8_t *ptr =3D NULL; > + uint8_t *mapped_data =3D NULL; > + size_t total_size =3D 0; > + HRESULT hr =3D S_OK; > + size_t av1_pic_hd_size =3D 0; > + int tile_group_extra_size =3D 0; > + size_t bit_len =3D 0; > + D3D12VAEncodeContext *ctx =3D avctx->priv_data; > + > + char pic_hd_data[MAX_PARAM_BUFFER_SIZE] =3D { 0 }; > + > + err =3D d3d12va_encode_av1_get_buffer_size(avctx, pic, &total_size); > + if (err < 0) > + goto end; > + > + // Update the picture header and calculate the picture header size > + memset(pic_hd_data, 0, sizeof(pic_hd_data)); > + err =3D d3d12va_encode_av1_write_picture_header(avctx, pic, pic_hd_d= ata, &av1_pic_hd_size); > + if (err < 0) { > + av_log(avctx, AV_LOG_ERROR, "Failed to write picture header: %d.= \n", err); > + return err; > + } > + av1_pic_hd_size /=3D 8; > + av_log(avctx, AV_LOG_DEBUG, "AV1 picture header size: %zu bytes.\n",= av1_pic_hd_size); > + > + > + tile_group_extra_size =3D (av_log2(total_size) + 7) / 7 + 1; // 1 by= te for obu header, rest for tile group LEB128 size > + av_log(avctx, AV_LOG_DEBUG, "Tile group extra size: %d bytes.\n", ti= le_group_extra_size); > + > + total_size +=3D (pic->header_size + tile_group_extra_size + av1_pic_= hd_size); > + av_log(avctx, AV_LOG_DEBUG, "Output buffer size %"SIZE_SPECIFIER"\n"= , total_size); > + > + hr =3D ID3D12Resource_Map(pic->output_buffer, 0, NULL, (void **)&map= ped_data); > + if (FAILED(hr)) { > + err =3D AVERROR_UNKNOWN; > + goto end; > + } > + > + err =3D ff_get_encode_buffer(avctx, pkt, total_size, 0); > + if (err < 0) > + goto end; > + ptr =3D pkt->data; > + > + memcpy(ptr, mapped_data, pic->header_size); > + > + ptr +=3D pic->header_size; > + mapped_data +=3D pic->aligned_header_size; > + total_size -=3D pic->header_size; > + > + memcpy(ptr, pic_hd_data, av1_pic_hd_size); > + ptr +=3D av1_pic_hd_size; > + total_size -=3D av1_pic_hd_size; > + av_log(avctx, AV_LOG_DEBUG, "AV1 total_size after write picture head= er: %d.\n", total_size); > + > + total_size -=3D tile_group_extra_size; > + err =3D d3d12va_encode_av1_write_tile_group(avctx, mapped_data, tota= l_size, ptr, &bit_len); > + if (err < 0) { > + av_log(avctx, AV_LOG_ERROR, "Failed to write tile group: %d.\n",= err); > + goto end; > + } > + assert((total_size + tile_group_extra_size) * 8 =3D=3D bit_len); this possibly should be av_assert* thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes --Y8jSDekwkXtO9B/O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaS5OrQAKCRBhHseHBAsP qwpZAJ9IaU+GRsqQ4wjXm0y077/+Jh7rWACgm49Z6tZrc4roR4LVlpjzwoHYiW0= =j/eW -----END PGP SIGNATURE----- --Y8jSDekwkXtO9B/O-- --===============5229957656686920760== 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 To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org --===============5229957656686920760==--