Deflate Format: differences between type blocks
up vote
1
down vote
favorite
I am currently trying to write a compressor and decompressor with the same purpose as the RFC Deflate specification.
I'm not able to understand the difference between how blocks are composed in the compression with fixed tables and dynamic tables. The file is processed by LZ77 generating (distance, length) + literal
.
- How do I know the type of block?
- Do I have to compress this data?
- Given that I use a fixed compression and don't have to send the tables, how would the encoder know how to encode data?
- Moreover, do I have to send data before the actual compression executes?
I am confused on the difference between fixed tables and the table we send in the dynamic mode, and how the two blocks use them to encode data.
I'm currently reading Data Compression: The Complete Reference. Any advice will be helpful.
c deflate
add a comment |
up vote
1
down vote
favorite
I am currently trying to write a compressor and decompressor with the same purpose as the RFC Deflate specification.
I'm not able to understand the difference between how blocks are composed in the compression with fixed tables and dynamic tables. The file is processed by LZ77 generating (distance, length) + literal
.
- How do I know the type of block?
- Do I have to compress this data?
- Given that I use a fixed compression and don't have to send the tables, how would the encoder know how to encode data?
- Moreover, do I have to send data before the actual compression executes?
I am confused on the difference between fixed tables and the table we send in the dynamic mode, and how the two blocks use them to encode data.
I'm currently reading Data Compression: The Complete Reference. Any advice will be helpful.
c deflate
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am currently trying to write a compressor and decompressor with the same purpose as the RFC Deflate specification.
I'm not able to understand the difference between how blocks are composed in the compression with fixed tables and dynamic tables. The file is processed by LZ77 generating (distance, length) + literal
.
- How do I know the type of block?
- Do I have to compress this data?
- Given that I use a fixed compression and don't have to send the tables, how would the encoder know how to encode data?
- Moreover, do I have to send data before the actual compression executes?
I am confused on the difference between fixed tables and the table we send in the dynamic mode, and how the two blocks use them to encode data.
I'm currently reading Data Compression: The Complete Reference. Any advice will be helpful.
c deflate
I am currently trying to write a compressor and decompressor with the same purpose as the RFC Deflate specification.
I'm not able to understand the difference between how blocks are composed in the compression with fixed tables and dynamic tables. The file is processed by LZ77 generating (distance, length) + literal
.
- How do I know the type of block?
- Do I have to compress this data?
- Given that I use a fixed compression and don't have to send the tables, how would the encoder know how to encode data?
- Moreover, do I have to send data before the actual compression executes?
I am confused on the difference between fixed tables and the table we send in the dynamic mode, and how the two blocks use them to encode data.
I'm currently reading Data Compression: The Complete Reference. Any advice will be helpful.
c deflate
c deflate
edited Nov 10 at 23:45
usr2564301
17.1k73269
17.1k73269
asked Nov 10 at 21:08
Franco Bosi
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Since you are trying to compress, you would pick the smaller of the two. zlib's deflate computes what the size of a fixed block and dynamic block would be, and emits the smaller of the two.
If you are encoding a fixed block, you encode using the fixed code for literal/lengths and distances. This code is provided in the RFC.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Since you are trying to compress, you would pick the smaller of the two. zlib's deflate computes what the size of a fixed block and dynamic block would be, and emits the smaller of the two.
If you are encoding a fixed block, you encode using the fixed code for literal/lengths and distances. This code is provided in the RFC.
add a comment |
up vote
1
down vote
Since you are trying to compress, you would pick the smaller of the two. zlib's deflate computes what the size of a fixed block and dynamic block would be, and emits the smaller of the two.
If you are encoding a fixed block, you encode using the fixed code for literal/lengths and distances. This code is provided in the RFC.
add a comment |
up vote
1
down vote
up vote
1
down vote
Since you are trying to compress, you would pick the smaller of the two. zlib's deflate computes what the size of a fixed block and dynamic block would be, and emits the smaller of the two.
If you are encoding a fixed block, you encode using the fixed code for literal/lengths and distances. This code is provided in the RFC.
Since you are trying to compress, you would pick the smaller of the two. zlib's deflate computes what the size of a fixed block and dynamic block would be, and emits the smaller of the two.
If you are encoding a fixed block, you encode using the fixed code for literal/lengths and distances. This code is provided in the RFC.
answered Nov 11 at 1:52
Mark Adler
56.1k759106
56.1k759106
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243422%2fdeflate-format-differences-between-type-blocks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown