Recent

Author Topic: Please help  (Read 10627 times)

q250

  • New Member
  • *
  • Posts: 20
Re: Please help
« Reply #45 on: November 17, 2023, 05:50:44 am »
lets say we manage to cutoff 37 bits

Again, open any file in a hex editor and check if you can cut 37 bits, you cant. And minimum for this to work is 16 bits. 16 bits cut = 0% compression, after 24 bits cut you saved 1 byte. Chances for first round are ultra low (you will never be able to compress regular text). Chances for another round are 0, so you have ultra low chances to compress something by 1 byte.
i dont understand what is writen here.

Fibonacci

  • Hero Member
  • *****
  • Posts: 1000
  • Behold, I bring salvation - FPC Unleashed
Re: Please help
« Reply #46 on: November 17, 2023, 07:04:01 am »
if you manage cutoff 9-16 bit on paper, then on practice - 8 bit, for 17-24 is 16 bit reduction and so on.

You wont manage to cut off even 4 bits. You understand?

https://www.researchgate.net/figure/LETTERS-ASCII-VALUES-AND-BINARY-6_tbl1_341450296

Here is a table showing the binary values for the letters in the ASCII table. Find one character you could possibly compress.
FPC Unleashed - inline vars, tuples, statement expressions, array equality, compound assignments, indexed/lazy labels, no-RTTI & more. ⭐ Star it on GitHub!

gerardus

  • Jr. Member
  • **
  • Posts: 94
Re: Please help
« Reply #47 on: November 17, 2023, 08:49:30 am »
There is no way you can encode every random N-bit value in N-1 or less bits just by shuffling bits.
for every random N-bit value, it is indeed impossible. but for every, exept two, random N-bit value turns out it is possible. main equation that govern that transormation :
2^N - 2 = summ of 2^N, N:=1 to N-1

1. You don't have any guarantee about the content of what you'll have to encode in the future.
2. There is no bit shuffling transformation that will give 1 to 1 correspondence between N bit values and N-x bit values. That's impossible.
You can do a scan of the data stream, see what values are most represented and encode them with less bits (Huffman, arithmetic coding...)
You can build a dictionary and substitute entries in the dictionary with references (LZ and other many variations)
You can do run-length encoding.
There are many combinations and optimizations of these techniques and others, have look at wikipedia for starters. 
https://en.wikipedia.org/wiki/Lossless_compression
But there is no way to only shuffle bits and get a bijection with smaller values.

q250

  • New Member
  • *
  • Posts: 20
Re: Please help
« Reply #48 on: November 17, 2023, 01:13:26 pm »
if you manage cutoff 9-16 bit on paper, then on practice - 8 bit, for 17-24 is 16 bit reduction and so on.

You wont manage to cut off even 4 bits. You understand?

https://www.researchgate.net/figure/LETTERS-ASCII-VALUES-AND-BINARY-6_tbl1_341450296

Here is a table showing the binary values for the letters in the ASCII table. Find one character you could possibly compress.
still dont get it.
There is no way you can encode every random N-bit value in N-1 or less bits just by shuffling bits.
for every random N-bit value, it is indeed impossible. but for every, exept two, random N-bit value turns out it is possible. main equation that govern that transormation :
2^N - 2 = summ of 2^N, N:=1 to N-1
But there is no way to only shuffle bits and get a bijection with smaller values.
just take look at pictures with tables above.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Please help
« Reply #49 on: November 17, 2023, 02:18:43 pm »
still dont get it.
Draw on your paper a big box that contain 8 small boxes and fill them with your 0's and 1's, do that for next 8 bits again and again and again...
Do your shuffle stuff, how much big boxes are needed? = same amount.


... I forget to tell, a big box can't live without its 8 small boxes, so even when you just need 1 small, its inside a big one that contain always 8.
« Last Edit: November 17, 2023, 02:28:15 pm by KodeZwerg »
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

tetrastes

  • Hero Member
  • *****
  • Posts: 766
Re: Please help
« Reply #50 on: November 17, 2023, 03:49:53 pm »
lets say we manage to cutoff 37 bits

Again, open any file in a hex editor and check if you can cut 37 bits, you cant. And minimum for this to work is 16 bits. 16 bits cut = 0% compression, after 24 bits cut you saved 1 byte. Chances for first round are ultra low (you will never be able to compress regular text). Chances for another round are 0, so you have ultra low chances to compress something by 1 byte.
i dont understand what is writen here.

If I understand this stuff correctly, to cut off a file by 37 bits, it must start with 37 (if other bits are ones) or 36 zero bits. Try to find such file on your computer. 

gerardus

  • Jr. Member
  • **
  • Posts: 94
Re: Please help
« Reply #51 on: November 17, 2023, 04:43:28 pm »
just take look at pictures with tables above.

The table with 8 bit values you posted is useless for encoding anything. To encode anything with variable length codes you need prefix codes like Huffman produces. If you put your table results one after the other in a file the decoder will be unable to know where to cut and decode.
Imagine the compressed stream starts with 1000000.
What is the uncompressed conversion according to your table?
10111111  00000001?
00000101  00000011  00000011 00000011 ?
(I stop here, there many more conflicts)




q250

  • New Member
  • *
  • Posts: 20
Re: Please help
« Reply #52 on: November 18, 2023, 02:55:38 pm »
variable length codes
its not variable length code. you find that table, but dont bother to read what it means.

 

TinyPortal © 2005-2018