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