The shortest code is: (nothing)
"If no code, than do ... "
A code only one bit longer is: 0
An other code, as short as the previous one is: 1
All other codes are longer.
It can't be any shorter in the digital world.
One normal RGB pixel has a code of 24 bits long, always.
Fixed length codes are easy, but not very efficient.
Using codes of variable length can reduce the amount of bits needed, and one doesn't have to stop counting, ever.
It goes something like this:
|
Decimal
|
Variable Bit Length
|
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
... |
0
1
00
01
10
11
000
001
010
011
100
101
110
111
0000
0001
0010
... |
One problem though; how do you know how long a code is? Well; you don't unless you make notes or use a system like 8 to 14 modulation (which isn't efficient).
An example of a code plus how long each code is:
010010110100101111010010000100. 2,4,3,5,2,8,4,2.
becomes:
01 - 0010 - 110 - 10010 - 11 - 11010010 - 0001 - 00.
Next problem is when if the length notation is getting too long, and it has to be not decimal but of course digital also. There are easy solutions for that, so I won't go farther into that now.
Point is that these are the shortest possible codes and thus create the smallest files.
Connect them to..
A code is what it's connected to.
One code can be connected to a fixed value, but also to a dynamic one.
If there are 1000.000.000 options but only 100 codes, "fixed" codes can be connected to 100 out of these 1000.000.000. But dynamic codes can point to the first 100 most likely options out of 1000.000.000. The dynamic connections are far more interesting, where prediction plays an important role.
One code can point to one RGB pixel value, or to 10 pixels, or 100, or 1000, or whatever you want. The size and kind of what a code is connected to is without limits. |
|