IMO the huffman coding part is relatively easily and performance
is acceptable, it looks like linear in time.

the LZ77 is still very slow compared with zlib.so thus there
should be room for improvement. Test caes are in public repos
but not jal addons, I include here for your reference. Thanks.

You may need ot modify some file path, you can replace the 4 or
5 text files with any other text files you like, so they are not
attached.

please let me know if the attachment test script is missing.

After we are happy with zlib, we might try jpeg which is also a
minefield of patents, unfortunately.

Чт, 18 сен 2014, Raul Miller написал(а):
> It would be interesting to review the code and your test cases, once
> you are happy with it.
> 
> The whole "try again" thing is a good first cut, but there might be
> other approaches. (Or there might not be.)
> 
> Thanks,
> 
> -- 
> Raul
> 
> 
> On Thu, Sep 18, 2014 at 5:58 AM, bill lam <[email protected]> wrote:
> > After more tests, I found there is another rule not explicitly
> > mentioned in rfc -- the maximum bit length is 15 (or 7 in another
> > tree).  When the distribtution of frequency is highly spreaded,
> > the maximnum from hcode can be 16. In this case, it needs to
> > increase the level of (non-zero) minimum frequency and try
> > again, and iterate until the maximum bit length is 15 or smaller.
> >
> > --
> > regards,
> > ====================================================
> > GPG key 1024D/4434BAB3 2008-08-24
> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> > gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
dbr 1
cocurrent 'base'
coinsert'jzlib'

f1=: 4 : 0
a=. ".y
'en de'=. x
assert. a -: zlib_decode_so`[email protected] b=. 
zlib_encode_so`[email protected] a
smoutput 'data: ', (20{.y),'size: ',(10":#b),'  ratio: ', ":(#b)%(#a)
)

f2=: 4 : 0
'en de'=. x
assert. a -: zlib_decode_so`[email protected] b=. 
zlib_encode_so`[email protected] a=. fread jpath '~Public/arc/zlib/test/',y
smoutput 'data: ', (20{.y),'size: ',(10":#b),'  ratio: ', ":(#b)%(#a)
)

f3=: 4 : 0
'en de'=. x
assert. a -: zlib_decode_so`[email protected] b=. 1 
zlib_encode_so`[email protected] a=. fread jpath '~Addons/data/ddsqlite/lib/', 
y=. 'sqlite3.dll'
smoutput 'data: ', (20{.y),'size: ',(10":#b),'  ratio: ', ":(#b)%(#a)
assert. a -: zlib_decode_so`[email protected] b=. 1 
zlib_encode_so`[email protected] a=. fread jpath '~Addons/math/lapack/', y=. 
'jlapack.dll'
smoutput 'data: ', (20{.y),'size: ',(10":#b),'  ratio: ', ":(#b)%(#a)
)

test=: 3 : 0

smoutput 'so encode  so decode'
0 0 f1 '''abcdefg'''
0 0 f1 'a.'
0 0 f1 'a.,|.a.'
0 0 f1 '10000$''abcdeadc'''
0 0 f1 '500#''a'''
0 0 f1 '1600#''a'''
0 0 f1 '1600$a.'
0 0 f1 '1600#a.'
0 0 f1 'a.{~?.100000#256'
0 0 f2 'algorithm.txt'
0 0 f2 'rfc1950.txt'
0 0 f2 'rfc1951.txt'
0 0 f2 'rfc1952.txt'
0 0 f2 'txtvsbin.txt'
0 0 f3 ''

smoutput ' j encode   j decode'
1 1 f1 '''abcdefg'''
1 1 f1 'a.'
1 1 f1 'a.,|.a.'
1 1 f1 '10000$''abcdeadc'''
1 1 f1 '500#''a'''
1 1 f1 '1600#''a'''
1 1 f1 '1600$a.'
1 1 f1 '1600#a.'
1 1 f1 'a.{~?.100000#256'
1 1 f2 'algorithm.txt'
1 1 f2 'rfc1950.txt'
1 1 f2 'rfc1951.txt'
1 1 f2 'rfc1952.txt'
1 1 f2 'txtvsbin.txt'
1 1 f3 ''

smoutput 'so encode   j decode'
0 1 f1 '''abcdefg'''
0 1 f1 'a.'
0 1 f1 'a.,|.a.'
0 1 f1 '10000$''abcdeadc'''
0 1 f1 '500#''a'''
0 1 f1 '1600#''a'''
0 1 f1 '1600$a.'
0 1 f1 '1600#a.'
0 1 f1 'a.{~?.100000#256'
0 1 f2 'algorithm.txt'
0 1 f2 'rfc1950.txt'
0 1 f2 'rfc1951.txt'
0 1 f2 'rfc1952.txt'
0 1 f2 'txtvsbin.txt'
0 1 f3 ''

smoutput ' j encode  so decode'
1 0 f1 '''abcdefg'''
1 0 f1 'a.'
1 0 f1 'a.,|.a.'
1 0 f1 '10000$''abcdeadc'''
1 0 f1 '500#''a'''
1 0 f1 '1600#''a'''
1 0 f1 '1600$a.'
1 0 f1 '1600#a.'
1 0 f1 'a.{~?.100000#256'
1 0 f2 'algorithm.txt'
1 0 f2 'rfc1950.txt'
1 0 f2 'rfc1951.txt'
1 0 f2 'rfc1952.txt'
1 0 f2 'txtvsbin.txt'
1 0 f3 ''

smoutput 'done!'
)

test''
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to