i going from encoded to decoding..
the code says at counter 0 put into byteout.0 = invert of index pointer left 1.
this inverts a 1 to give you 0 when it should be 1.
it seems that you need to invert the first bit of the encoded data before you start moving through the rest of the code with <<1
regards
andrew




Bookmarks