- Added maximization features, with corresponding plugins. Added painting feature...
[mldemos:mldemos.git] / _3rdParty / dlib / compress_stream.h
1 // Copyright (C) 2003  Davis E. King (davis@dlib.net)\r
2 // License: Boost Software License   See LICENSE.txt for the full license.\r
3 #ifndef DLIB_COMPRESS_STREAm_\r
4 #define DLIB_COMPRESS_STREAm_\r
5 \r
6 #include "compress_stream/compress_stream_kernel_1.h"\r
7 #include "compress_stream/compress_stream_kernel_2.h"\r
8 #include "compress_stream/compress_stream_kernel_3.h"\r
9 \r
10 #include "conditioning_class.h"\r
11 #include "entropy_encoder.h"\r
12 #include "entropy_decoder.h"\r
13 \r
14 #include "entropy_encoder_model.h"\r
15 #include "entropy_decoder_model.h"\r
16 #include "lz77_buffer.h"\r
17 #include "sliding_buffer.h"\r
18 #include "lzp_buffer.h"\r
19 #include "crc32.h"\r
20 \r
21 \r
22 namespace dlib\r
23 {\r
24 \r
25     class compress_stream\r
26     {\r
27         compress_stream() {}\r
28 \r
29         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_1b fce1;\r
30         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_1b fcd1;\r
31 \r
32         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_2b fce2;\r
33         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_2b fcd2;\r
34 \r
35         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_3b fce3;\r
36         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_3b fcd3;\r
37 \r
38         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_4a fce4a;\r
39         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_4a fcd4a;\r
40         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_4b fce4b;\r
41         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_4b fcd4b;\r
42 \r
43         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_5a fce5a;\r
44         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_5a fcd5a;\r
45         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_5b fce5b;\r
46         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_5b fcd5b;\r
47         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_5c fce5c;\r
48         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_5c fcd5c;\r
49 \r
50         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_6a fce6;\r
51         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_6a fcd6;\r
52 \r
53 \r
54         typedef entropy_encoder_model<257,entropy_encoder::kernel_2a>::kernel_2d fce2d;\r
55         typedef entropy_decoder_model<257,entropy_decoder::kernel_2a>::kernel_2d fcd2d;\r
56 \r
57         typedef sliding_buffer<unsigned char>::kernel_1a sliding_buffer1;\r
58         typedef lz77_buffer::kernel_2a lz77_buffer2a;\r
59 \r
60 \r
61         typedef lzp_buffer::kernel_1a lzp_buf_1;\r
62         typedef lzp_buffer::kernel_2a lzp_buf_2;\r
63 \r
64 \r
65         typedef entropy_encoder_model<513,entropy_encoder::kernel_2a>::kernel_1b fce_length;\r
66         typedef entropy_decoder_model<513,entropy_decoder::kernel_2a>::kernel_1b fcd_length;\r
67 \r
68         typedef entropy_encoder_model<65534,entropy_encoder::kernel_2a>::kernel_1b fce_length_2;\r
69         typedef entropy_decoder_model<65534,entropy_decoder::kernel_2a>::kernel_1b fcd_length_2;\r
70 \r
71 \r
72         typedef entropy_encoder_model<32257,entropy_encoder::kernel_2a>::kernel_1b fce_index;\r
73         typedef entropy_decoder_model<32257,entropy_decoder::kernel_2a>::kernel_1b fcd_index;\r
74 \r
75     public:\r
76         \r
77         //----------- kernels ---------------\r
78 \r
79         // kernel_1a        \r
80         typedef      compress_stream_kernel_1 <fce1,fcd1,crc32::kernel_1a>\r
81                      kernel_1a;\r
82    \r
83         // kernel_1b        \r
84         typedef      compress_stream_kernel_1 <fce2,fcd2,crc32::kernel_1a>\r
85                      kernel_1b;\r
86 \r
87         // kernel_1c        \r
88         typedef      compress_stream_kernel_1 <fce3,fcd3,crc32::kernel_1a>\r
89                      kernel_1c;\r
90 \r
91         // kernel_1da        \r
92         typedef      compress_stream_kernel_1 <fce4a,fcd4a,crc32::kernel_1a>\r
93                      kernel_1da;\r
94 \r
95         // kernel_1ea        \r
96         typedef      compress_stream_kernel_1 <fce5a,fcd5a,crc32::kernel_1a>\r
97                      kernel_1ea;\r
98 \r
99         // kernel_1db        \r
100         typedef      compress_stream_kernel_1 <fce4b,fcd4b,crc32::kernel_1a>\r
101                      kernel_1db;\r
102 \r
103         // kernel_1eb        \r
104         typedef      compress_stream_kernel_1 <fce5b,fcd5b,crc32::kernel_1a>\r
105                      kernel_1eb;\r
106 \r
107         // kernel_1ec        \r
108         typedef      compress_stream_kernel_1 <fce5c,fcd5c,crc32::kernel_1a>\r
109                      kernel_1ec;\r
110 \r
111 \r
112 \r
113 \r
114         // kernel_2a        \r
115         typedef      compress_stream_kernel_2 <fce2,fcd2,lz77_buffer2a,sliding_buffer1,fce_length,fcd_length,fce_index,fcd_index,crc32::kernel_1a>\r
116                      kernel_2a;\r
117 \r
118 \r
119 \r
120 \r
121         // kernel_3a        \r
122         typedef      compress_stream_kernel_3 <lzp_buf_1,crc32::kernel_1a,16>\r
123                      kernel_3a;\r
124         // kernel_3b        \r
125         typedef      compress_stream_kernel_3 <lzp_buf_2,crc32::kernel_1a,16>\r
126                      kernel_3b;\r
127    \r
128 \r
129     };\r
130 }\r
131 \r
132 #endif // DLIB_COMPRESS_STREAm_\r
133 \r