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 ESMTPS id 933574DF8C for ; Thu, 6 Mar 2025 00:16:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC60768F3DF; Thu, 6 Mar 2025 02:16:00 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6EA668F3C4 for ; Thu, 6 Mar 2025 02:15:53 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 11E7720480 for ; Thu, 6 Mar 2025 00:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1741220153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=TbtQSw45ojJeAEThzr2PqZUHGqKOWl3b5Eh54DSgL+g=; b=Hht7dVt+vb2iu0FJAgSOl54/rjnR7wJFruS7JN+v6IgvCcIuztiarJvb8XctxcvaY03M9F GwxmM+mK0SfjGEIOYR9ddvC5faQwfebaNlJq4sY+eVe8XMMh2VcBVbOu0AhkPEGBXT2jWc PII5Af76lByEUNs+QTBc/PQttSdbRxIYMv+PAqoPn73qzHFvcuBwALIuaCgWCNXDDelGFi hbyRAWeA8ksmiQqe+dSq8MvQSFshFpp0Sjc6Z9RxvSReB1o3Q7W8tA64i0/Tiila+Z05zJ 7pkgedpuKJxWYv3L7lkXIv1SV7QFE5TOsDzEEK32rtCCri6XiA1WFlh3BHdvKQ== Date: Thu, 6 Mar 2025 01:15:52 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250306001552.GV4991@pb2> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdeivdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfggtggusehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeifeegvefgvdegledugeehlefhgeffvdeggfdtgeevgeduleevieeuleeiteevffenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [RFC] FFV1 float support 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="===============7662148627839535152==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7662148627839535152== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yW6XgwTqolSEzfdp" Content-Disposition: inline --yW6XgwTqolSEzfdp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi everyone Current FFv1 code with my patchset supports 16bit floats. The implementation is quite simple. Which is good I have tried improving compression, the gains are incremental, but its not large overall. For example 44% space gain on the remapping table is just 0.1% overall. I have few float samples. Its mainly one high quality slideshow of unrelated 16bit float images. These excercise a wide range fo things including negati= ve color values. I think I have only one single (non slideshow) video of float 16 samples, It turns out the most efficient way to store floats that i found, is to rem= ap them to integers. Not to store tham as sign, exponent, mantisse, i tried th= at for many hours. Storing them using a remapping, has a very nice side effect though, and tha= t is it will be easy to add 32bit and 64bit float support (once there is some sample data) Because a image of 64bit floats, after its split into slices of up to 256x2= 56 can always be mapped into 16bit integers within each slice. What about the mapping itself, it uses a rather simple rle coder. ive spend most of the day today tuning that and failing to really beat that. Using context from the previous image didnt work with the slideshow material i have nor that one video i have. I tried using sign and exponent as contex= t, tried previous run, relations of runs, low bits and many more, but no or insignificant improvments of yesterdays implementation was achieved. There was some paper, lynne pointed my too about float remapping but that s= eemed about remapping scientific 1-dimensional data. And what that paper did was bascially reverse mapping floats into decimal numbers like 1.23456*10^-2 No image or video i found has samples like that. Also the paper was messy Considering the whole remap table is now bascially down to slightly more th= an 0.1% of teh whole file, its not worth to look at that more. Beyond the remapping, the storage of float follows what we do with integers split into slices, perform decorrelation between planes, encode pixel for pixel and sample for sample with a preidctor, and context from the surrounding qualitized pixel differences and range coder. If people have more ideas that fit into FFv1 float support. (that is, good compresssion vs complexity vs speed and an architecture that fits into FFv1) ... If not, i intend to apply my current patchset, update the FFv1 specification and move on to some other work thx --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Homeopathy is like voting while filling the ballot out with transparent ink. Sometimes the outcome one wanted occurs. Rarely its worse than filling out a ballot properly. --yW6XgwTqolSEzfdp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ8jpNQAKCRBhHseHBAsP qzUrAJ46eCQ3HFv9NfP+ikEYHJAL7PnYOwCeLmnzIl7shmpBoVF240KVtZrg6vU= =9cfV -----END PGP SIGNATURE----- --yW6XgwTqolSEzfdp-- --===============7662148627839535152== 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". --===============7662148627839535152==--