1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /**
4  *****************************************************************************
5  * @file dc_header_footer.h
6  *
7  * @ingroup Dc_DataCompression
8  *
9  * @description
10  *      Definition of the Data Compression header and footer parameters.
11  *
12  *****************************************************************************/
13 #ifndef DC_HEADER_FOOTER_H_
14 #define DC_HEADER_FOOTER_H_
15 
16 /* Header and footer sizes for Zlib and Gzip */
17 #define DC_ZLIB_HEADER_SIZE (2)
18 #define DC_GZIP_HEADER_SIZE (10)
19 #define DC_ZLIB_FOOTER_SIZE (4)
20 #define DC_GZIP_FOOTER_SIZE (8)
21 
22 /* Values used to build the headers for Zlib and Gzip */
23 #define DC_GZIP_ID1 (0x1f)
24 #define DC_GZIP_ID2 (0x8b)
25 #define DC_GZIP_FILESYSTYPE (0x03)
26 #define DC_ZLIB_WINDOWSIZE_OFFSET (4)
27 #define DC_ZLIB_FLEVEL_OFFSET (6)
28 #define DC_ZLIB_HEADER_OFFSET (31)
29 
30 /* Compression level for Zlib */
31 #define DC_ZLIB_LEVEL_0 (0)
32 #define DC_ZLIB_LEVEL_1 (1)
33 #define DC_ZLIB_LEVEL_2 (2)
34 #define DC_ZLIB_LEVEL_3 (3)
35 
36 /* CM parameter for Zlib */
37 #define DC_ZLIB_CM_DEFLATE (8)
38 
39 /* Type of Gzip compression */
40 #define DC_GZIP_FAST_COMP (4)
41 #define DC_GZIP_MAX_COMP (2)
42 
43 #endif /* DC_HEADER_FOOTER_H_ */
44