Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

New and revolutionary data comression scheme!

Name: Anonymous 2009-06-13 17:17

Infinite compression?

I've always was interested in how compressed files worked and why the compression factor is so low.
The entropy explanation isn't something i would accept without tinkering with the data. The idea of my compression algorithm(currently under development) is to
use algebraic properties of files to express the data in more concise way.
The thing might sound trivial, but its implementation is not.
Normal compression works by splitting FILE and finding redundant pieces to express them in minimum volume.
Imagine a FILE read and converted to arbitrary precision integer. Now consider all the myriad ways to generate said integer. Sounds difficult? Not so much.
1.lets take a Prime Number,e.g. 2 and raise it to power closest to our integer, e.g. 20000. Note the difference from the (FILE-result).
2.Get the smallest difference with the powers available,
and proceed to next step:
3.If the difference is negative: find 2 raised to the power
of X which would close the gap,by substracting it from #1
If the difference is positive just add 2 with closest power to the difference .
The end result could be something like
2^6+2^5-2^3+2^1-2^0=Integer=FILE
Its can be improved further by using other prime numbers powers with the idea of expression taking the least space.
The same thing can be accomplished with arbitrary length floating point numbers like 2^123712.1282 which would converge faster,but will require some fixing to convert to a stable binary result.
Posted by FrozenVoid at 15:37

Name: Anonymous 2009-06-21 8:08

Update:MPI and GMP refusing to link with my compiles and i downloaded MAPM, which apparently works.
(I have GCC(install corrupted and refuses to work),DMC(works ok),TCC(fails to work sometimes with function errors,but very fast and produces small .exes))

The problem its converting all files to decimals(which goes 100bytes/second). here is the current code(inpbuf is where file is stored):

M_APM decstr=m_apm_init();printf("Converting number in inpbuf to decimal:\n");
//store multiplier,store current byte,current byte multiply,current decstr copy,
M_APM pow2store=m_apm_init();M_APM pow2base=m_apm_init();M_APM bytexpow=m_apm_init();M_APM decstrcopy=m_apm_init();
//byte multiplier (2^8)^(pos from end:0=1) first bit=1,
M_APM pow2exp=m_apm_init();m_apm_set_long(pow2exp,2L);
unsigned long int curbyte;unsigned long int curpow;unsigned long int pos;

for(pos=(filesize-1);pos;pos--){
curbyte=(unsigned long int)inpbuf[pos];
if(pos%1000==0){printf("Processed %u of %u bytes\n",filesize-pos,filesize);}
//curent byte as int
 m_apm_set_long(pow2base,curbyte);
 //this is multiplier for current byte (2^8)^pos=2^(pos*8)
 m_apm_integer_pow_nr(pow2store,pow2exp,8*((filesize-pos)-1));
 m_apm_multiply(bytexpow, pow2base, pow2store);
 m_apm_copy(decstrcopy,decstr);
m_apm_add(decstr,decstrcopy,bytexpow);
}
printf("Inpbuf succesfuly converted to decimal.\n");
m_apm_free(pow2store);m_apm_free(pow2base);m_apm_free(bytexpow);m_apm_free(decstrcopy);m_apm_free(pow2exp);
char *testbuf=malloc(filesize*26);m_apm_to_integer_string(testbuf,decstr);
fwrite(testbuf,1,strlen(testbuf),output);

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List