xref: /aosp_15_r20/external/zlib/inffast.h (revision 86ee64e75fa5f8bce2c8c356138035642429cd05)
1*86ee64e7SAndroid Build Coastguard Worker /* inffast.h -- header to use inffast.c
2*86ee64e7SAndroid Build Coastguard Worker  * Copyright (C) 1995-2003, 2010 Mark Adler
3*86ee64e7SAndroid Build Coastguard Worker  * For conditions of distribution and use, see copyright notice in zlib.h
4*86ee64e7SAndroid Build Coastguard Worker  */
5*86ee64e7SAndroid Build Coastguard Worker 
6*86ee64e7SAndroid Build Coastguard Worker /* WARNING: this file should *not* be used by applications. It is
7*86ee64e7SAndroid Build Coastguard Worker    part of the implementation of the compression library and is
8*86ee64e7SAndroid Build Coastguard Worker    subject to change. Applications should only use zlib.h.
9*86ee64e7SAndroid Build Coastguard Worker  */
10*86ee64e7SAndroid Build Coastguard Worker 
11*86ee64e7SAndroid Build Coastguard Worker /* INFLATE_FAST_MIN_INPUT: the minimum number of input bytes needed so that
12*86ee64e7SAndroid Build Coastguard Worker    we can safely call inflate_fast() with only one up-front bounds check. One
13*86ee64e7SAndroid Build Coastguard Worker    length/distance code pair (15 bits for the length code, 5 bits for length
14*86ee64e7SAndroid Build Coastguard Worker    extra, 15 bits for the distance code, 13 bits for distance extra) requires
15*86ee64e7SAndroid Build Coastguard Worker    reading up to 48 input bits (6 bytes).
16*86ee64e7SAndroid Build Coastguard Worker */
17*86ee64e7SAndroid Build Coastguard Worker #define INFLATE_FAST_MIN_INPUT 6
18*86ee64e7SAndroid Build Coastguard Worker 
19*86ee64e7SAndroid Build Coastguard Worker /* INFLATE_FAST_MIN_OUTPUT: the minimum number of output bytes needed so that
20*86ee64e7SAndroid Build Coastguard Worker    we can safely call inflate_fast() with only one up-front bounds check. One
21*86ee64e7SAndroid Build Coastguard Worker    length/distance code pair can output up to 258 bytes, which is the maximum
22*86ee64e7SAndroid Build Coastguard Worker    length that can be coded.
23*86ee64e7SAndroid Build Coastguard Worker  */
24*86ee64e7SAndroid Build Coastguard Worker #define INFLATE_FAST_MIN_OUTPUT 258
25*86ee64e7SAndroid Build Coastguard Worker 
26*86ee64e7SAndroid Build Coastguard Worker void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start);
27