14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /****************************************************************************** 26 27 gif_hash.h - magfic constants and declarations for GIF LZW 28 29 ******************************************************************************/ 30 31 #ifndef _GIF_HASH_H_ 32 #define _GIF_HASH_H_ 33 34 #include <stdint.h> 35 36 #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ 37 #define HT_KEY_MASK 0x1FFF /* 13bits keys */ 38 #define HT_KEY_NUM_BITS 13 /* 13bits keys */ 39 #define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */ 40 #define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ 41 42 /* The 32 bits of the long are divided into two parts for the key & code: */ 43 /* 1. The code is 12 bits as our compression algorithm is limited to 12bits */ 44 /* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */ 45 /* The key is the upper 20 bits. The code is the lower 12. */ 46 #define HT_GET_KEY(l) (l >> 12) 47 #define HT_GET_CODE(l) (l & 0x0FFF) 48 #define HT_PUT_KEY(l) (l << 12) 49 #define HT_PUT_CODE(l) (l & 0x0FFF) 50 51 typedef struct GifHashTableType { 52 uint32_t HTable[HT_SIZE]; 53 } GifHashTableType; | 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /****************************************************************************** 26 27 gif_hash.h - magfic constants and declarations for GIF LZW 28 29 ******************************************************************************/ 30 31 #ifndef _GIF_HASH_H_ 32 #define _GIF_HASH_H_ 33 34 /** Begin JDK modifications to support building on Windows **/ 35 #ifndef _WIN32 36 #include <unistd.h> 37 #endif 38 /** End JDK modifications to support building on Windows **/ 39 #include <stdint.h> 40 41 #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */ 42 #define HT_KEY_MASK 0x1FFF /* 13bits keys */ 43 #define HT_KEY_NUM_BITS 13 /* 13bits keys */ 44 #define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */ 45 #define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */ 46 47 /* The 32 bits of the long are divided into two parts for the key & code: */ 48 /* 1. The code is 12 bits as our compression algorithm is limited to 12bits */ 49 /* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */ 50 /* The key is the upper 20 bits. The code is the lower 12. */ 51 #define HT_GET_KEY(l) (l >> 12) 52 #define HT_GET_CODE(l) (l & 0x0FFF) 53 #define HT_PUT_KEY(l) (l << 12) 54 #define HT_PUT_CODE(l) (l & 0x0FFF) 55 56 typedef struct GifHashTableType { 57 uint32_t HTable[HT_SIZE]; 58 } GifHashTableType; |