Path: blob/master/src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h
41153 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/******************************************************************************2526gif_hash.h - magfic constants and declarations for GIF LZW2728SPDX-License-Identifier: MIT2930******************************************************************************/3132#ifndef _GIF_HASH_H_33#define _GIF_HASH_H_3435/** Begin JDK modifications to support building on Windows **/36#ifndef _WIN3237#include <unistd.h>38#endif39/** End JDK modifications to support building on Windows **/40#include <stdint.h>4142#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */43#define HT_KEY_MASK 0x1FFF /* 13bits keys */44#define HT_KEY_NUM_BITS 13 /* 13bits keys */45#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */46#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */4748/* The 32 bits of the long are divided into two parts for the key & code: */49/* 1. The code is 12 bits as our compression algorithm is limited to 12bits */50/* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */51/* The key is the upper 20 bits. The code is the lower 12. */52#define HT_GET_KEY(l) (l >> 12)53#define HT_GET_CODE(l) (l & 0x0FFF)54#define HT_PUT_KEY(l) (l << 12)55#define HT_PUT_CODE(l) (l & 0x0FFF)5657typedef struct GifHashTableType {58uint32_t HTable[HT_SIZE];59} GifHashTableType;6061GifHashTableType *_InitHashTable(void);62void _ClearHashTable(GifHashTableType *HashTable);63void _InsertHashTable(GifHashTableType *HashTable, uint32_t Key, int Code);64int _ExistsHashTable(GifHashTableType *HashTable, uint32_t Key);6566#endif /* _GIF_HASH_H_ */6768/* end */697071