| View previous topic :: View next topic |
| Author |
Message |
Fibonacci Code Guest
|
Posted: Tue Jul 22, 2008 1:02 pm Post subject: Bijective 2 State Arithmatic coding question |
|
|
Hi Biject,
I have a question on your 2-state bijective code.
//--------------------------------------------------------------------------------------
David A. Scott July 2004
demo code for 2 state 1 bit high low bijective adaptive
code the mother of all bijective acompressors.
TYPICAL USE "arb2x filein fileout"
COMPLIE first compile all minor routines then
gcc arb2x.cpp *.o -o arb2x.exe
//--------------------------------------------------------------------------------------
/* OUTPUT BITS PLUS FOLLOWING OPPOSITE BITS. */
void
bit_plus_follow(int bit)
{
for (dasw(bit); bits_to_follow > 0; bits_to_follow--)
dasw(1 ^ bit);
}
I see that this program will output the input from text
'10010010100011' string to
binary characters. But I wish to output the data directly to
'10100101000'
string again, without convert them to character. But I am not quite
understand
what does bit_plus_follow function do.
suppose it is a loop, if (int bit) = 1 and bit_to_follow = 3, so the
character will be
11100000 ? as DASW suppose to collect them in byte then only write
it ?
Please advise.
Thanks |
|
| |
|
Back to top |
biject Guest
|
Posted: Tue Jul 22, 2008 3:09 pm Post subject: Re: Bijective 2 State Arithmatic coding question |
|
|
On Jul 22, 7:02 am, Fibonacci Code <angli...@gmail.com> wrote:
[quote]Hi Biject,
I have a question on your 2-state bijective code.
//--------------------------------------------------------------------------------------
David A. Scott July 2004
demo code for 2 state 1 bit high low bijective adaptive
code the mother of all bijective acompressors.
TYPICAL USE "arb2x filein fileout"
COMPLIE first compile all minor routines then
gcc arb2x.cpp *.o -o arb2x.exe
//--------------------------------------------------------------------------------------
/* OUTPUT BITS PLUS FOLLOWING OPPOSITE BITS. */
void
bit_plus_follow(int bit)
{
for (dasw(bit); bits_to_follow > 0; bits_to_follow--)
dasw(1 ^ bit);
}
[/quote]
There more than meets the eye here. dasw(bit) actuall calls
routines in bit_byts and what it does depends on what has happened
before. bits_to_follow is from marks code I think its the same
spelling
he used I hate long symbols. The problem is when expanding the
intervail you oftern output a ONE or output a ZERO. or if stuck in
middle
of an you out a C meaning you have decidced between 01111111..
or 100000000.. But at some point you decided then you output a lot
of bits base on number of C>s. It might be easier to look at mark
code
to get the flaver of the idea. But its more complicated when you do it
bijectively. The code is easier to follow than words since so many
exceptions.
[quote]
I see that this program will output the input from text
'10010010100011' string to
binary characters. But I wish to output the data directly to
'10100101000'
string again, without convert them to character. But I am not quite
understand
what does bit_plus_follow function do.
suppose it is a loop, if (int bit) = 1 and bit_to_follow = 3, so the
character will be
11100000 ? as DASW suppose to collect them in byte then only write
it ?
Please advise.
Thanks
[/quote]
I take it your looking at arb2x. This program reads and writes to
byte files.
It actaully compresses the string that is in the byte file. Not the 8
bit per
byte string but the actually string based on bijective trandform of
stirngs
to bytes that I choose to use.
To compress an actullly pure bit sring that you have represent purely
as file of ascii 1>s and 0>s you have to transfoms the file usiing
a012b01
or others but latest the lastest one I used. its in a012b01.zip the
reverse
is b012a01. Once you coneverted and used arb2x you get a messy
looking
byte file. Then run b012a01 on output play with it. It works.
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" |
|
| |
|
Back to top |
biject Guest
|
Posted: Tue Jul 22, 2008 3:52 pm Post subject: Re: Bijective 2 State Arithmatic coding question |
|
|
On Jul 22, 7:02 am, Fibonacci Code <angli...@gmail.com> wrote:
....
[quote]I see that this program will output the input from text
'10010010100011' string to
binary characters. But I wish to output the data directly to
'10100101000'
string again, without convert them to character. But I am not quite
understand
what does bit_plus_follow function do.
suppose it is a loop, if (int bit) = 1 and bit_to_follow = 3, so the
character will be
11100000 ? as DASW suppose to collect them in byte then only write
it ?
Please advise.
Thanks
[/quote]
Just for grins I used my current string rountines and my current
arb2x here is
what I got
took you original string
0000 31 30 30 31 30 30 31 30 31 30 30 30 31 31 . .
*10010010100011*
number of bytes is 14
converted ir to file for arb2x used a012b01
0000 92 8E . . . . . . . . . . . . . . *..*
number of bytes is 2
then ran arb2x
0000 61 8E 80 . . . . . . . . . . . . . *a..*
number of bytes is 3
then ran b012a01
0000 30 31 31 30 30 30 30 31 31 30 30 30 31 31 31 30
*0110000110001110*
number of bytes is 16
So it went from 14 bit string to 16 bit string. I most likeely used
the KT
method of update since it grows here. Anyway its all a trade off.
Every time you do a bijection you could lose or gain a bit. several
done here.
Not sure if version you have has same gain I used KT or LAPLCE for
thhe cell
in versus undates.
Another thing is that dasw is defined by the #define one is what I
call the
stability output and that prevents long strings of zeros and ones from
blowing
up on decompression. You might wnat to use altermate define for dasw
for
learning purposes.
coding version 20060602 for arb2x and a012b01
I don>t keep good track of versions it may or may not be latest
where did you get '10100101000'
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" |
|
| |
|
Back to top |
Fibonacci Code Guest
|
Posted: Wed Jul 23, 2008 1:17 pm Post subject: Re: Bijective 2 State Arithmatic coding question |
|
|
On Jul 22, 11:52 pm, biject <biject.b...@gmail.com> wrote:
[quote]On Jul 22, 7:02 am, Fibonacci Code <angli...@gmail.com> wrote:
...
I see that this program will output the input from text
'10010010100011' string to
binary characters. But I wish to output the data directly to
'10100101000'
string again, without convert them to character. But I am not quite
understand
what does bit_plus_follow function do.
suppose it is a loop, if (int bit) = 1 and bit_to_follow = 3, so the
character will be
11100000 ? as DASW suppose to collect them in byte then only write
it ?
Please advise.
Thanks
Just for grins I used my current string rountines and my current
arb2x here is
what I got
took you original string
0000 31 30 30 31 30 30 31 30 31 30 30 30 31 31 . .
*10010010100011*
number of bytes is 14
converted ir to file for arb2x used a012b01
0000 92 8E . . . . . . . . . . . . . . *..*
number of bytes is 2
then ran arb2x
0000 61 8E 80 . . . . . . . . . . . . . *a..*
number of bytes is 3
then ran b012a01
0000 30 31 31 30 30 30 30 31 31 30 30 30 31 31 31 30
*0110000110001110*
number of bytes is 16
So it went from 14 bit string to 16 bit string. I most likeely used
the KT
method of update since it grows here. Anyway its all a trade off.
Every time you do a bijection you could lose or gain a bit. several
done here.
Not sure if version you have has same gain I used KT or LAPLCE for
thhe cell
in versus undates.
Another thing is that dasw is defined by the #define one is what I
call the
stability output and that prevents long strings of zeros and ones from
blowing
up on decompression. You might wnat to use altermate define for dasw
for
learning purposes.
coding version 20060602 for arb2x and a012b01
I don>t keep good track of versions it may or may not be latest
where did you get '10100101000'
David A. Scott
--
My Crypto codehttp://bijective.dogma.net/crypto/scott19u.ziphttp://www.jim.com/jamesd/Kong/scott19u.zipold version
My Compression codehttp://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"
[/quote]
Hi Biject,
Thanks for your info, I am aware now, the program
actually work in bytes.
my problem is that I need to use it in a variable length bit string
consist of eg '010001011 11110000 101'
which is not a direct byte block and the output is not a byte block
either.
Is there possible of such kind of 2 state arithmatic compresser ? Any
sample code existed ?
I understand now what is the run problem if the probability falls in
middle eg. 0.3333333, 0.788888 etc
those will represent with a bit string with lots of repeating bit.
Thanks
Fibonacci |
|
| |
|
Back to top |
biject Guest
|
Posted: Thu Jul 24, 2008 12:38 am Post subject: Re: Bijective 2 State Arithmatic coding question |
|
|
On Jul 23, 7:17 am, Fibonacci Code <angli...@gmail.com> wrote:
[quote]On Jul 22, 11:52 pm, biject <biject.b...@gmail.com> wrote:
On Jul 22, 7:02 am, Fibonacci Code <angli...@gmail.com> wrote:
...
I see that this program will output the input from text
'10010010100011' string to
binary characters. But I wish to output the data directly to
'10100101000'
string again, without convert them to character. But I am not quite
understand
what does bit_plus_follow function do.
suppose it is a loop, if (int bit) = 1 and bit_to_follow = 3, so the
character will be
11100000 ? as DASW suppose to collect them in byte then only write
it ?
Please advise.
Thanks
Just for grins I used my current string rountines and my current
arb2x here is
what I got
took you original string
0000 31 30 30 31 30 30 31 30 31 30 30 30 31 31 . .
*10010010100011*
number of bytes is 14
converted ir to file for arb2x used a012b01
0000 92 8E . . . . . . . . . . . . . . *..*
number of bytes is 2
then ran arb2x
0000 61 8E 80 . . . . . . . . . . . . . *a..*
number of bytes is 3
then ran b012a01
0000 30 31 31 30 30 30 30 31 31 30 30 30 31 31 31 30
*0110000110001110*
number of bytes is 16
So it went from 14 bit string to 16 bit string. I most likeely used
the KT
method of update since it grows here. Anyway its all a trade off.
Every time you do a bijection you could lose or gain a bit. several
done here.
Not sure if version you have has same gain I used KT or LAPLCE for
thhe cell
in versus undates.
Another thing is that dasw is defined by the #define one is what I
call the
stability output and that prevents long strings of zeros and ones from
blowing
up on decompression. You might wnat to use altermate define for dasw
for
learning purposes.
coding version 20060602 for arb2x and a012b01
I don>t keep good track of versions it may or may not be latest
where did you get '10100101000'
David A. Scott
--
My Crypto codehttp://bijective.dogma.net/crypto/scott19u.ziphttp://www.jim.com/jame...version
My Compression codehttp://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"
Hi Biject,
Thanks for your info, I am aware now, the program
actually work in bytes.
my problem is that I need to use it in a variable length bit string
consist of eg '010001011 11110000 101'
[/quote]
Actually if you look at the includes you will find a routine
w() this is core routine that changes bits to bytes bijectively on
output.
w(0) is where you are writting a '0' bit and w(1) is where your
writting
a one '1' bit. w(-1) it when your done you could call it end of
string.
But there is an excpct if the string is all ones. then the -1 at end
is
counted as a one in the string.
The reverse is the r() rountine you read a 1 for one and and a 0 fore
zero
a -1 for EOS and -2 for past EOS. Again if string all ones I count the
-1
as a one bit.
If change those two functions you can do what I think you want to do.
However arb2x the length is only a function of model cost and the
total
number of ones and zeros. So again no gain if close to .5 You may
want to to a BWTS on the string of ascii ones and zeros to do the but
BWT then a MTF and then call to your arb2x.
[quote]which is not a direct byte block and the output is not a byte block
either.
Is there possible of such kind of 2 state arithmatic compresser ? Any
sample code existed ?
I understand now what is the run problem if the probability falls in
middle eg. 0.3333333, 0.788888 etc
those will represent with a bit string with lots of repeating bit.
Thanks
Fibonacci
[/quote]
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" |
|
| |
|
Back to top |
|