Talk:Content.bin file structure: Difference between revisions
LZ77 buffer problem |
Jedicommando (talk | contribs) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
:01 02 01 02 01 XX XX XX when you reach the third byte, it's no longer past the end of the buffer, because you just copied 2 more bytes into it. | :01 02 01 02 01 XX XX XX when you reach the third byte, it's no longer past the end of the buffer, because you just copied 2 more bytes into it. | ||
== Combine Pages == | |||
I agree with whoever put the combine template on, that the two should be combined. They have to deal with the same file and could easily be fit on a single page. --[[User:Hiker13526|Hiker13526]] 16:21, 4 May 2008 (PDT) | |||
Yes! Lets make it happen! |
Latest revision as of 02:22, 17 October 2008
"This code is NOT fully functional, because sometimes the algorithm request data not present in the buffer, and fills it with 'X' instead. Maybe someone can fix it, I think it's not difficult ;)"
I noticed this myself when writing a decompressor for a format similar to LZ77. Sometimes it will do things like request 8 bytes from only 2 bytes before the end of the buffer. This can be very difficult to emulate if you're decompressing file-to-file, but easy if you actually decompress to a buffer in RAM and then dump the buffer to disk. The trick is it ends up repeating those 2 bytes. To help visualize the process, imagine the contents of the buffer as you do this:
- 01 02 XX XX XX XX XX XX
- 01 02 01 XX XX XX XX XX copy first byte to end of buffer
- 01 02 01 02 XX XX XX XX copy second byte
- 01 02 01 02 01 XX XX XX when you reach the third byte, it's no longer past the end of the buffer, because you just copied 2 more bytes into it.
Combine Pages
I agree with whoever put the combine template on, that the two should be combined. They have to deal with the same file and could easily be fit on a single page. --Hiker13526 16:21, 4 May 2008 (PDT)
Yes! Lets make it happen!