Re: Sliding window
- From: "Bartc" <bc@xxxxxxxxxx>
- Date: Sat, 12 Apr 2008 23:50:28 GMT
"filia&sofia" <in_tyrannos@xxxxxxxxxxx> wrote in message
news:6fe1ca80-5232-4d44-9503-7a62a20b03cc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I want only the bits that exist in the file originally. The length of
the chunks should be ceil(n/8) bytes. Also, the bits that do not hold
any information are located at the "Most Significant Bit" end. In
short, the read information (in bits) is represented in bytes.
For example, if the file has: "0110 0100 1111 1101 0011 0101 0101 1100
0000" and n=9.
Then, 1st chunk is (without padding) "0110 0100 1". 2nd is "111 1101
00". 3rd is "11 0101 010" and 4th is "1 1100 0000".
Now, we need two bytes to represent nine bits. We pad all the chunks
with zeroes, e.g. 1st becomes "0000000 011001001" etc.
Will the alignment on output be the same as in the input?
The output file is same as the input file: the algorithm has to remove
padded zeroes and join chunks in the way that preserves information in
overlapping bytes. At this point, the algorithm should produce
identical files in a extremely fast manner.
Hopefully, this additional information helps.
Actually, it's made things more confusing! I've looked at your earlier post
and from that it seemed you need some sort of combined move+bitshift.
I assume your N in that post (buffer byte size) can be bigger than a machine
word? And the M bits at a time you're taking from that buffer can also be
bigger than a machine word?
Best to post some C code here, so that assuming it works as you want, you
might be able to get help with optimising.
--
Bart
.
- References:
- Sliding window
- From: filia&sofia
- Re: Sliding window
- From: Bartc
- Re: Sliding window
- From: filia&sofia
- Sliding window
- Prev by Date: Re: Problem with hdparam
- Next by Date: Re: Sliding window
- Previous by thread: Re: Sliding window
- Next by thread: Re: Sliding window
- Index(es):
Relevant Pages
|