🔒 Locked
(im)possible compression method
Advertisement
Original Post
I had this kind of compression method pop into my head... Now I am not a very good programmer myself, I can only do a few advanced things in C, but then I only really code for fun and usually just for game modification, so I don''t know, though I highly doubt it, if it is possible to do this.
I am assuming a few things here for current file compressions. I am assuming that to compress the file they ''squish'' the coding so that ''air pockets'' are let out like a ziplock baggie and that, at most you can get rid of a few kilobytes for a ratio of the entire file size. I also assume they use some sort of encapsulation for further compression. Now what I would try to do, and again I don''t know if it''s possible and I know that if I said I did people would know I am just blowing hot air out of my ass, is to trick the computer into thinking that the file didn''t exsist but have maybe a single byte for reference purposes, obviously if the file didn''t exist you couldn''t unpack it. basically index the file into the smallest form of maybe a few digits of a code that would generate the file when decompressed. This would revolutionize internet gaming, streaming files, and even simple downloads because you would be able to take a terraquad of data, ''ghost'' it, as I have begun calling this inventive method, and then download, upload, and what not everywhere. instead of trying to stream packets of info up to 3.00MB in size that would only allow a broadband user to view, you could send thousands of 1KB files a second that carry loads of data, making even a dial-up user play games at lightning fasts speeds.
If it is possible I am sure someone would have thought of doing it but it would really be a cool idea. I think I am going to start looking into compression methods and see if I can actually do this, or something similar to this, because it sounds, at least in my mind, like something everyone would want to use in their internet enabled programming to reduce the ever growing problem of bandwidth and lag.
quote:
Original post by superpig
Too late.
Holy shit, that's awesome. too bad it's fake.
[edited by - fade2black on March 25, 2004 9:47:54 PM]
Damn, that wasn''t even the right thread, either. Does anyone have a link to the thread where some guy claimed he''d come up with a compression technique where you moved all the 1s to the beginning of the file, all the 0s to the end, and then zipped it?
Or was it that thread? I dunno. I don''t have time to read 27 pages.
Or was it that thread? I dunno. I don''t have time to read 27 pages.
quote:
Original post by Fade2Black
trick the computer into thinking that the file didn''t exsist but have maybe a single byte for reference purposes, obviously if the file didn''t exist you couldn''t unpack it. basically index the file into the smallest form of maybe a few digits of a code that would generate the file when decompressed.
Are you saying you want to find an algorithm that can generate the original file based on a number between 0 and 255?
Or are you saying you want to make it look like the file isn''t there so the computers/routers/whatever don''t intentionally slow it down?
__________________________________________
Live like you''re from the future.
quote:
Original post by superpig
Damn, that wasn''t even the right thread, either. Does anyone have a link to the thread where some guy claimed he''d come up with a compression technique where you moved all the 1s to the beginning of the file, all the 0s to the end, and then zipped it?
Or was it that thread? I dunno. I don''t have time to read 27 pages.![]()
Smells like the omega algorithm...
quote:
Original post by superpig
Too late.
Ah, I remember that one. Good for a chuckle. If only it were true....
EDIT: I used to be IO Fission back then. I notice most of those people don't post anymore. I wonder how many have changed their names, also, or just left.
[edited by - Doc on March 25, 2004 11:58:06 PM]
quote:
Original post by Rixterquote:
Original post by Fade2Black
trick the computer into thinking that the file didn''t exsist but have maybe a single byte for reference purposes, obviously if the file didn''t exist you couldn''t unpack it. basically index the file into the smallest form of maybe a few digits of a code that would generate the file when decompressed.
Are you saying you want to find an algorithm that can generate the original file based on a number between 0 and 255?
Or are you saying you want to make it look like the file isn''t there so the computers/routers/whatever don''t intentionally slow it down?
I am saying make the rest of the program disappear to the computer, except for a randomly generated (hexadecimal) number that is basically a ''key'' to the rest of the data that when it reads that key based on the algorithm, the decompressor knows what to put where, thus unpacking the file. So it''s a little of both.
quote:
Original post by Fade2Black
I am saying make the rest of the program disappear to the computer, except for a randomly generated (hexadecimal) number that is basically a ''key'' to the rest of the data that when it reads that key based on the algorithm, the decompressor knows what to put where, thus unpacking the file. So it''s a little of both.
If the number is randomly generated, how can the other program know what it represents? And a randomly generated (hexadecimal) number is the same as a randomly generated (binary) number or a randomly generated (decimal) number.
To me, it sounds as though you''re just sumarizing the data in a nice tidy format. As a general algorithm, this would fail miserably. But it can, and does, get applied to stuff all the time. A MMORPG doesn''t send vertex data to describe where your character is. It just generates a code that describes where your character is and the other program generates the vertex data on its own. The vertex data hides until it is needed, and never actually sent over the network.
CM
The problem of compression is stated quite simply in the fact that X bits can only produce Y combinations of files. Therefore the only compression methods I see improving are lossy compression techniques, and even then only to a point, but lossless compression.....
If I understand your proposed concept you intend to generate an algorithm which will accept a seed to generate a file.
This is a viable concept; search for applications of cellular automata to data compression. One of the problems is that to create an algorithm as effective as you suggest you would need to analyze the data and determine a (or set of patterns) that can be regenerated through recursive applications of the algorithm.
Decomposing the data in that way is possible (alhtough very difficult, I am still studying this for different reasons and don't have enough information available), but the end result will be a tool that will be incredibly computationally intensive, and therefore useable for large sets of data that will be distributed repeatedly, but not something that can be used for real time communication.
[edit]
By the way.. anyone who disagrees with this I suggest you inspect your physiology alot closer, as well as all cell-based life. All genetic material used by cellular organisms is derived from the genetic code, and it is applied to the same algorithm within the cells to generate very unique organisms.
Although that is a gross oversimplification, any basic investigation of genetics shows this to be reasonably accurate.
[edited by - ChaoticCanuck on March 25, 2004 12:58:26 AM]
This is a viable concept; search for applications of cellular automata to data compression. One of the problems is that to create an algorithm as effective as you suggest you would need to analyze the data and determine a (or set of patterns) that can be regenerated through recursive applications of the algorithm.
Decomposing the data in that way is possible (alhtough very difficult, I am still studying this for different reasons and don't have enough information available), but the end result will be a tool that will be incredibly computationally intensive, and therefore useable for large sets of data that will be distributed repeatedly, but not something that can be used for real time communication.
[edit]
By the way.. anyone who disagrees with this I suggest you inspect your physiology alot closer, as well as all cell-based life. All genetic material used by cellular organisms is derived from the genetic code, and it is applied to the same algorithm within the cells to generate very unique organisms.
Although that is a gross oversimplification, any basic investigation of genetics shows this to be reasonably accurate.
[edited by - ChaoticCanuck on March 25, 2004 12:58:26 AM]
quote:
Original post by Fade2Black
Stuff about compression....
I think you might need to do a bit of research on compression algorithms before trying to take this idea any further.
In theory, you *could* come up with some sort of algorithm which figures out a seed that will generate the entire data set, as ChaoticCanuck says. However, the larger the chunk of data, the harder it will be to find a seed that will generate the whole lot accurately. This is essentially how JPGs work - they use fourier transforms to calculate the coefficients of a series of sin and cosine waves that will generate the data. Of course, in order to keep the number of coefficients down to a manageable level, you have to apply this to subsets of the data (blocks) and even then, you have to be prepared to accept a certain level of error. (hence the lossiness of the format)
Alternatively, you could use the pseudo code below to compress your files, but in the time it takes to actually compress a file you could probably have saved and uploaded about a billion uncompressed versions of the file over a 56k modem.
void OMGAmazingCompression(string filename)
{
FILE* f = open(filename);
int fileSize = GetFileSize(f);
byte* databuffer = new byte[filesize];
byte* testbuffer = new byte[fileSize];
fread(databuffer,filesize,1,f);
fclose(f);
int seed = 0;
do
{
srand(seed);
for(int i = 0; i < filesize; i++)
{
testbuffer[i] = (byte)rand();
}
++seed;
}while(!CompareData(dataBuffer,fileSize));
f = fopen(strcat(filename),".oac"); // oac == OMG AMAZING COMPRESSION!!!1!!!
fwrite(&seed,sizeof(seed),1,f);
fwrite(&filesize,sizeof(filesize),1,f);
fclose(f);
delete[] databuffer;
delete[] testbuffer;
}
void OMGAmazingDecompression(string filename)
{
FILE* f = open(filename);
int seed;
int filesize;
fread(seed,sizeof(int),1,f);
fread(filesize,sizeof(int),1,f);
fclose(f);
byte* databuffer = new byte[fileSize];
srand(seed -1); // -1 because seed got ++'ed at the end of the compression loop!
for(int i = 0; i < filesize; i++)
{
databuffer[i] = (byte)rand();
}
filename[strlen(filename) - strlen(".oac")] = '\0';
f = fopen(filename);
fwrite(&databuffer,filesize,1,f);
fclose(f);
delete[] databuffer;
}
EDIT: added decompression.
[edited by - Sandman on March 26, 2004 4:21:44 AM]
Compressing any nonempty file:
const char hexchars[] = "0123456789ABCDEF";
void magic_compression(string filename)
{
ifstream f(filename.c_str(), ios::binary);
char c = f.get();
string output_filename = filename + ''.'' + hexchars[c / 16] + hexchars[c % 16];
ofstream g(output_filename.c_str(), ios::binary);
g << f.rdbuf();
}
void magic_decompression(string filename)
{
ifstream f(filename.c_str(), ios::binary);
char c; sscanf(filename.c_str() + filename.size() - 2, "%2X", &c);
string output_filename = filename.substr(0, filename.size() - 3);
ofstream g(output_filename.c_str(), ios::binary);
g << c << f.rdbuf();
}
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement