Code Comments
Programming Forum and web based access to our favorite programming groups.hi, I am want to compress data frames 45Bytes/Per frame to 37Bytes. the sample printed out data is " 4B63401F804FDF86CEE761DA46F55C91ACE445D9 88B4DBF8C9F7E27D355DE4851E0BBF3E3D9 8EF3D705B75208501"(46Bytes). I have tried some source code provide by internet with LZ77 coding LZ78 coding LZW coding RLE coding but all of them gernerate a data frame bigger than 46Bytes. I am very frustrated. can anybody give me some advice. I am considering flow compress. i.e compress in this side and decompress the other side just like online movie. will it possible? as I know we can not distinct the two frames after compressing. thanks.
Post Follow-up to this messagearniewang@yahoo.com.cn wrote: > hi, > I am want to compress data frames 45Bytes/Per frame to 37Bytes. the > sample printed out data is > " 4B63401F804FDF86CEE761DA46F55C91ACE445D9 88B4DBF8C9F7E27D355DE4851E0BBF3E3 D98EF3D705B75208501"(46Bytes). > I have tried some source code provide by internet with LZ77 > coding > LZ78 coding > LZW coding > RLE coding > but all of them gernerate a data frame bigger than 46Bytes. I am very > frustrated. What created this frame of data? If it is already compressed, then it is not likely you will be able to compress it any further. > can anybody give me some advice. I am considering flow compress. i.e > compress in this side and decompress the other side just like online > movie. will it possible? as I know we can not distinct the two frames > after compressing. > > > thanks. -- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com
Post Follow-up to this messagearniewang@yahoo.com.cn wrote in news:1113578223.760970.163240@f14g2000cwb.googlegroups.com: > hi, > I am want to compress data frames 45Bytes/Per frame to 37Bytes. the > sample printed out data is > " 4B63401F804FDF86CEE761DA46F55C91ACE445D9 88B4DBF8C9F7E27D355DE4851E0BBF > 3E3D98EF3D705B75208501"(46Bytes). > I have tried some source code provide by internet with > LZ77 > coding > LZ78 coding > LZW coding > RLE coding > but all of them gernerate a data frame bigger than 46Bytes. I am very > frustrated. > > can anybody give me some advice. I am considering flow compress. i.e > compress in this side and decompress the other side just like online > movie. will it possible? as I know we can not distinct the two frames > after compressing. > > > thanks. > > I am not sure exactly what your porblem is. Do you need exatly 37 bytes. what if some are 40 and some 34. Secondly to compress just 46 bytes to 37 you need to know more about the data it may or may not be possible. Also you claimed you used LZW did you try my version. If you used source off the net many compressors made for long files and you may need to mod them to shorten or remove wasted parts of the headers. David A. Scott -- My Crypto code http://bijective.dogma.net/crypto/scott19u.zip http://www.jim.com/jamesd/Kong/scott19u.zip old version My Compression code http://bijective.dogma.net/ **TO EMAIL ME drop the roman "five" ** Disclaimer:I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged. As a famous person once said "any cryptograhic system is only as strong as its weakest link"
Post Follow-up to this messageIn fact I use bit to arrange data in it, there are about 37Bytes contain the actuall data (maybe compressed). the other 9Bytes is arranged by us bit by bit. so I think it is not easy to compress. can I treat many frame sequencyly and send out one frame one time, maybe this better than treat only one frame.
Post Follow-up to this messageScott:
I have try some sample from you websites
ah3
arb3w
arb255
arbsha1
arbsha2
bibwt1
bwtdsc
bwtrle
fin2in
lzw1
lzw3s
vh
ah2
ah1
ah2a
ah2af
except some exes must use conditional files that I have not try , but
none can compress my binary data.
the sample way to compress is:
CHAR*
pchInput=" 4B63401F804FDF86CEE761DA46F55C91ACE445D9
88B4DBF8C9F7E27D355DE4851E
0BBF3E3D98EF3D705B75208501";
/* 92 chars mean 46 byte data */
BYTE lpBufSrc[PCUDATALEN];
BYTE lpBufDest[2*PCUDATALEN];
DWORD dwOrgLen=PCUDATALEN;
DWORD pdwEncLen=2*PCUDATALEN;
DWORD dwMaxLen=2*PCUDATALEN;
int i;
for (i=0;i<PCUDATALEN;i++)
{
sscanf(pchInput, "%2x", &lpBufSrc[i]);
pchInput+=2;
}
RunLengthEncode ( lpBufSrc,dwOrgLen,
lpBufDest,&pdwEncLen,dwMaxLen );
Post Follow-up to this messagesourc code to test my bin data:
CHAR*
pchInput=" 4B63401F804FDF86CEE761DA46F55C91ACE445D9
88B4DBF8C9F7E27D355DE4851E
0BBF3E3D98EF3D705B75208501";
BYTE lpBufSrc[PCUDATALEN];
BYTE lpBufDest[2*PCUDATALEN];
DWORD dwOrgLen=PCUDATALEN;
DWORD pdwEncLen=2*PCUDATALEN;
DWORD dwMaxLen=2*PCUDATALEN;
int i;
for (i=0;i<PCUDATALEN;i++)
{
sscanf(pchInput, "%2x", &lpBufSrc[i]);
pchInput+=2;
}
RunLengthEncode ( lpBufSrc,dwOrgLen,
lpBufDest,&pdwEncLen,dwMaxLen );
Post Follow-up to this message<arniewang@yahoo.com.cn> schrieb > I am want to compress data frames 45Bytes/Per frame to 37Bytes. the > sample printed out data is > " 4B63401F804FDF86CEE761DA46F55C91ACE445D9 88B4DBF8C9F7E27D355DE4851E0BBF3E3D98EF3D 7 05B75208501"(46Bytes). Must the compressed data a ASCII representation as well? Your data can be easily compressed to a 8bit binary chunk because your data range of the input data is fixed (A-Z 0-9). You have 36 symbols and if you would use 6bits for them (trivial case) for your input symbols, you end up with 34 Bytes by simply stuffing the bits. Using a compression scheme can get you further down, but it really depends on your needs.
Post Follow-up to this messagearniewang@yahoo.com.cn wrote: > hi, > I am want to compress data frames 45Bytes/Per frame to 37Bytes. the > sample printed out data is > " 4B63401F804FDF86CEE761DA46F55C91ACE445D9 88B4DBF8C9F7E27D355DE4851E0BBF3E3D98EF3D 705B752085 01"(46Bytes). > I have tried some source code provide by internet with LZ77 > coding > LZ78 coding > LZW coding > RLE coding > but all of them gernerate a data frame bigger than 46Bytes. I am very > frustrated. > > can anybody give me some advice. I am considering flow compress. i.e > compress in this side and decompress the other side just like online > movie. will it possible? as I know we can not distinct the two frames > after compressing. > > > thanks. Wether it works or not is dependant on wether your frames contain 45 or 37 Bytes of actual information. Put another way, can your frames be one of ANY possible combinations of 45 Bytes, or can you rule some combinations out? In the former case compression is impossible. In the second one, the rate of compression is a function of the amount of combinations that can be ruled out. Regards
Post Follow-up to this messageI convert the byte to string for print out. so every two char equal mens a Hex value of byte . I think there exisit possible in the this string.
Post Follow-up to this messageevery two chars stand for one hex byte value. at current stage any compress method I found in internet can not work at all. by the scott I do not know how to use fin2in to compress things.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.