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

Infinite Compression Explained

Name: FrozenVoid 2009-06-24 10:03

Because most of you don't read my blog,(i don't read random blogs as well) and have so much questions about what i'm doing with my programs, i'll write it here:
All of the programs(about 6 developed so far) despite wildly varying routines are targeted to generate large integers.
These integers are not files. Following transformations occurs:
encode
1.file is converted to large integer X(arbitrary length).
2.X multiplied by some scale factor e.g. 10e1000 to get a lower bound
2.(X+1)by some scale factor e.g. 10e1000 to get an uppper bound
3.a search is performed for finding numbers inside that range which are easy to represent via formula.
4.if number(s) found its saved to a file.
decode:
1.a formula is supplied with number(s) and filesize
2.the formula generates an integer/float, which is then divided by scale factor(e.g. 10e1000).
3.the first filesize bytes are then written to output.

the proces isn't perfected yet, because the formulas currently used in my programs either too slow to search or cuttoff at float precision(for non-integer parameters)
________________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est

Name: FrozenVoid 2009-06-24 14:19

MAPM library expects its input in decimal ASCII strings only(its output is decimal only too).
old method was to pass bytes and buffer positions to mapm functions to multiply them one by one(which is slow ).
I'm trying to find a method to convert to decimal faster. this is the old code:

char *inpbuf=malloc(filesize); fread(inpbuf,1,filesize,input); fclose(input);
M_APM decstr=m_apm_init();m_apm_set_string(decstr,filler);
if(DEBUG){printf(CONVERTMSG);}
//store multiplier,store current byte,current byte multiply,current decstr copy,
M_APM pow2store=m_apm_init();m_apm_set_string(pow2store,filler);
M_APM pow2base=m_apm_init();M_APM bytexpow=m_apm_init();m_apm_set_string(bytexpow,filler);
M_APM decstrcopy=m_apm_init();m_apm_set_string(decstrcopy,filler);
//byte multiplier (2^8)^(pos from end:0=1) first bit=1,
M_APM pow2exp=m_apm_init();m_apm_set_long(pow2exp,TWOLONG);
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(DEBUG){if(pos%CONVERTCHUNKSIZE==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("Processed %u of %u bytes\n",filesize-pos,filesize);
if(DEBUG){printf(CONVERTOK);}
m_apm_copy(decstrcopy,decstr);




_______________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est

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