Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #546841
| Subject | Re: data compression algorithm |
|---|---|
| Newsgroups | sci.electronics.design |
| References | (1 earlier) <jplqfe5rq7af3b0bctjts5tta1pqucptp3@4ax.com> <qdl3ah$1ar5$1@gioia.aioe.org> <squLE.1215$Fk3.584@fx21.iad> <qdobec$1utp$1@gioia.aioe.org> <qo20gehdaj6cbkna74vsc3c9b3pvssbjdl@4ax.com> |
| From | bitrex <user@example.net> |
| Message-ID | <z3VLE.10869$t_3.2468@fx18.iad> (permalink) |
| Organization | frugalusenet - www.frugalusenet.com |
| Date | 2019-06-11 17:30 -0400 |
On 6/11/19 4:16 PM, John Larkin wrote:
> On Tue, 11 Jun 2019 14:47:57 +0100, Martin Brown
> <'''newspam'''@nezumi.demon.co.uk> wrote:
>
>> On 10/06/2019 16:11, bitrex wrote:
>>> On 6/10/19 4:10 AM, Martin Brown wrote:
>>>> On 09/06/2019 20:03, John Larkin wrote:
>>>>> On Sun, 9 Jun 2019 13:54:11 -0400, bitrex <user@example.net> wrote:
>>>>>
>>>>>> In the vein of suggestions made by Martin Brown, David Eather, et al a
>>>>>> while back, this is idea for a lossy compressor/decompressor
>>>>>> designed to
>>>>>> compress 10 bits of greyscale image data down to 8 in a
>>>>>> semi-logarithmic
>>>>>> way.
>>>>>>
>>>>>> To avoid taking a square root on the output side the lossy
>>>>>> "decompressor", such as it is, is two iterations of a modified Newton's
>>>>>> method to compute the inverse.
>>>>>>
>>>>>> Since the compression function is nearly linear when its input is
>>>>>> small-valued using the 8 bit compressed value as the starting guess for
>>>>>> the inverse helps prevent Newton from hunting over across the
>>>>>> discontinuity in the input function, on the wrong side of the Y axis
>>>>>>
>>>>>>
>>>>>> #include <cstdint>
>>>>>>
>>>>>> //family of curves of the form x = int( 0.5+k*y*(A + By)/(A + Cy))
>>>>>>
>>>>>> constexpr auto compress(uint16_t y) -> uint8_t {
>>>>>> //tweak "k" to taste to avoid overflow
>>>>>> return 0.5 + 0.997 * y * (4096 + y) / (4096 + 32 * y);
>>>>>> }
>>>>
>>>> You really ought to do it in scaled integer arithmetic! Or lookup table.
>>>>
>>>> 0.5 converted to a fraction over A+Cy gives
>>>>
>>>> x = int( (A/2 + y*(A+C/2 + By))/(A' + Cy)
>>>>
>>>> k can be absorbed into A' ~ 4108
>>>
>>> The encoding side is running on a desktop-class PC don't need any lookup
>>> table there.
>>
>> If you have plenty of time on the encode side you might want to consider
>> another more costly form of data adaptive 12 bit to 8 bit encoding which
>> is based on greedy histogram equalisation. It requires an array to count
>> the frequency of every pixel value in the image and then multiple sweeps
>> of that to determine a histogram equalisation with ever increasing bin
>> widths to allocate the bins.
>>
>> Initially you start with binsize=1 and Nbins= 256
>>
>> target = Npixels/Nbins
>>
>> It works very well on images with a lot of baseline values and a few
>> features. You have to transmit a lookup table with the byte values.
>
> FPGA bit streams tend to have long runs of 0s and 1s. Assuming that
> anything else isn't worth compressing, one can write very simple
> compression/decompression routines that cut the size of a binary
> bitstream image by about 3:1. Serial bit-banging gets fast, too, when
> you're blasting out long runs of 1 or 0.
>
>
Transmitting moving pictures over meh-bandwith digital links "properly"
is mostly a solved engineering problem; you use some kind of FFT-based
lossy compression algorithm like mp2 and error correcting codes over the
link.
It would take a while to create a custom implementation from scratch.
buuut this client wasn't paying nearly enough to implement all that
jazz, and not convinced the desired receive hardware could pull it off.
It's an engineering rat hole. Maybe someday for fun I try it.
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
data compression algorithm bitrex <user@example.net> - 2019-06-09 13:54 -0400
Re: data compression algorithm John Larkin <jjlarkin@highlandtechnology.com> - 2019-06-09 12:03 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-09 17:27 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-09 17:31 -0400
Re: data compression algorithm John Doe <always.look@message.header> - 2019-06-09 22:05 +0000
Re: data compression algorithm bitrex <user@example.net> - 2019-06-09 18:10 -0400
Re: data compression algorithm John Larkin <jjlarkin@highlandtechnology.com> - 2019-06-09 16:36 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-09 19:43 -0400
Re: data compression algorithm John Larkin <jjlarkin@highlandtechnology.com> - 2019-06-10 07:12 -0700
Re: data compression algorithm Rick C <gnuarm.deletethisbit@gmail.com> - 2019-06-10 07:32 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 10:42 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 10:49 -0400
Re: data compression algorithm Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-06-10 09:10 +0100
Re: data compression algorithm John Larkin <jjlarkin@highlandtechnology.com> - 2019-06-10 07:17 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 11:03 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 11:11 -0400
Re: data compression algorithm John Doe <always.look@message.header> - 2019-06-10 17:23 +0000
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 15:07 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-10 15:31 -0400
Re: data compression algorithm John Doe <always.look@message.header> - 2019-06-11 15:07 +0000
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 11:40 -0400
Re: data compression algorithm John Larkin <jjlarkin@highland_snip_technology.com> - 2019-06-11 10:13 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 14:41 -0400
Re: data compression algorithm Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-06-11 14:47 +0100
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 11:41 -0400
Re: data compression algorithm Winfield Hill <winfieldhill@yahoo.com> - 2019-06-11 10:28 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 14:31 -0400
Re: data compression algorithm Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-06-11 19:56 +0100
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 15:32 -0400
Re: data compression algorithm Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-06-12 09:11 +0100
Re: data compression algorithm bitrex <user@example.net> - 2019-06-12 11:33 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 11:42 -0400
Re: data compression algorithm John Larkin <jjlarkin@highland_snip_technology.com> - 2019-06-11 13:16 -0700
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 17:20 -0400
Re: data compression algorithm bitrex <user@example.net> - 2019-06-11 17:30 -0400
Re: data compression algorithm david eather <eatDELETEher@tpg.com.au> - 2019-06-12 11:05 +1000
csiph-web