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