Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: BGB Newsgroups: comp.arch Subject: Re: Misc: Applications of small floating point formats. Date: Thu, 1 Aug 2024 04:49:50 -0500 Organization: A noiseless patient Spider Lines: 66 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 01 Aug 2024 11:49:55 +0200 (CEST) Injection-Info: dont-email.me; posting-host="333d6ae404bf8b1a0d3118c53a323626"; logging-data="2225429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RTF1p4EiHYoRfU04DMvwwdDtl3dfoNHQ=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:dLDSaQc2JAksNy31ozREKK0Kzhc= Content-Language: en-US In-Reply-To: Bytes: 3138 On 7/31/2024 7:44 PM, Lawrence D'Oliveiro wrote: > On Wed, 31 Jul 2024 18:31:35 -0500, BGB wrote: > >> Binary16 is useful for graphics and audio processing. > > The common format for CG work is OpenEXR, and that allows for 32-bit and > even 64-bit floats, per pixel component. So for example R-G-B-Alpha is 4 > components. > IME, typically OpenGL HDR framebuffers used 4x Binary16. I had considered 4x FP8U (E4.F4) here. Which is twice as much memory as LDR RGB555A (*1). But, traditionally OpenGL used RGBA8888 for LDR. For textures, one has, say: RGBA16F and R11f_G11F_B10F ... Granted, this can all be hidden behind the OpenGL API (the API calls can convert between internal and external formats as needed). Good quality would favor the higher quality formats, but more often I had favored "basically passable" in the name of memory use and speed (like, if things were consistently and solidly in double-digit framerate territories, would care more about quality; but quality doesn't matter as much when it can't sustain over 10fps...). *1: 0rrrrrgggggbbbbb 1rrrraggggabbbba Or, 3-bit alpha if MSB is set. Typically gives full RGB555 quality if the pixel is fully opaque. Better average case than RGBA4444. Though, GL also has an RGB555T format: rrrrrgggggbbbbba Which is moderately annoying (kinda similar, but different). rrrrrgggggbbbbb0 -> 1rrrr0gggg0bbbb0 rrrrrgggggbbbbb1 -> 0rrrrrgggggbbbbb To what extent I had messed with EXR images, they were Binary16... >> The 8-bit formats get a bit more niche; main use-cases mostly to save >> memory. > > Heavily used in AI work. Yeah, one use-case, along with image pixel data and audio... May seem like an eclectic mix of use-cases, but often a lot of these cases seem to need the same things, and I am messing with both (and trying to run GLQuake and wanting to use an FPGA board to try to drive a small robot around, ...). Generally made more progress on the GLQuake front than the autonomous self-driving robot front though. ....