Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/modules/brotli/enc/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 7 kB image not shown  

Quelle  dictionary_hash.c

  Sprache: C
 

/* Copyright 2015 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/


/* Hash table on the 4-byte prefixes of static dictionary words. */

#include "dictionary_hash.h"

#include "../common/platform.h"  /* IWYU pragma: keep */
#include "../common/static_init.h"

#if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE)
#include "../common/dictionary.h"
#include "hash_base.h"
#endif

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

#if (BROTLI_STATIC_INIT != BROTLI_STATIC_INIT_NONE)
BROTLI_BOOL BROTLI_COLD BrotliEncoderInitDictionaryHash(
    const BrotliDictionary* dict, uint16_t* words, uint8_t* lengths) {
  size_t global_idx = 0;
  size_t len;
  size_t i;
  static const uint8_t frozen_idx[1688] = {008164325631191364,
12881681321451290002808116431000004,
641212801324900000000170001036152,
000012880012800800640000000008,
000106413303200128100004443216130,
0128800000640640160014853000001280,
13000080000048000000321321290120,
10000000160001632000000001008,
0020000032000266128001600006416,
1288019224320084128128216001600640020,
00000000321006400000032066020,
408020033800080128162412802330160,
080640160012940032003202000000128,
0000064100000326400000160161600,
8020000800160800086412800082080,
00000032000000320801280001000,
168113600360649013280646413116224324,
045160013104960018419201772059600002,
03200000000640012800800001401,
000400000040064690082663264000,
00101281700000000001201600412864,
0000000022408001301664128264000128,
21926406500016000324227600047252,
13144760000641161484016106402010128,
6468000006414408020000003640000,
112800326600040018000003300320032,
01284641451400001280200200803800320,
3264440400012940014417321301613224134,
0064255081943316811718321615401303400,
0641280020000321000314000001640,
000000096124180112824064040161280,
640006408000006612800000000000,
000016064200006088206400001282,
212640640801283200100032012832338136,
0966400000644164800016020011280,
6416000000008002016040800000,
20000010000000000081360000080,
00002000640010200000000012800,
004000065000000000040000000,
0000212800082001280162004032001,
46464040101603268446510020371811480,
321283806400000040161128000128160,
0001128001286412864013001648001641280,
180215008006408100161282836321294144,
1300381020064050134132216128128128,
000204188123432192664224330013772640,
2481281280160321281281328001606400400,
1604128640010464321441302128019206482,
6413212812820840320442472803216004416,
9664172131000160016501292494864641264,
17664848128206421313610414115831700041164,
64019364648012800648648116080021128,
28841419700680012980168320640002400,
019208128000006401000040112864042,
3200000000000012832803200016170,
2400331282000012902000360322000,
0003200004000000043264000000,
3200321280000000000128160000000,
1013600241921283017182066042409208167,
01442064013064021613687432016806532812,
13164180306408003265041641668326436,
32243311280080326481011019800451440,
08128004000000100080000080100,
33032664201432004321606403320264,
641160655264017641929681082401764040,
0412800900130201920481286409606401,
1632013261282320120048328001280180,
0282441165320000000160000000000,
000010001600006400008000016128,
0001600000080000000000000330,
000000000000016000000000000,
000000000000000000000000000,
0000000};

  memset(lengths, 0, BROTLI_ENC_NUM_HASH_BUCKETS);

  for (len = BROTLI_MAX_DICTIONARY_WORD_LENGTH;
       len >= BROTLI_MIN_DICTIONARY_WORD_LENGTH; --len) {
    size_t length_lt_8 = len < 8 ? 1 : 0;
    size_t n = 1u << dict->size_bits_by_length[len];
    const uint8_t* dict_words = dict->data + dict->offsets_by_length[len];
    for (i = 0; i < n; ++i) {
      size_t j = n - 1 - i;
      const uint8_t* word = dict_words + len * j;
      const uint32_t key = Hash14(word);
      size_t idx = (key << 1) + length_lt_8;
      if ((lengths[idx] & 0x80) == 0) {
        BROTLI_BOOL is_final = TO_BROTLI_BOOL(frozen_idx[global_idx / 8] &
                                              (1u << (global_idx % 8)));
        words[idx] = (uint16_t)j;
        lengths[idx] = (uint8_t)(len + (is_final ? 0x80 : 0));
      }
      global_idx++;
    }
  }
  for (i = 0; i < BROTLI_ENC_NUM_HASH_BUCKETS; ++i) {
    lengths[i] &= 0x7F;
  }

  return BROTLI_TRUE;
}

BROTLI_MODEL("small")
uint16_t kStaticDictionaryHashWords[BROTLI_ENC_NUM_HASH_BUCKETS];
BROTLI_MODEL("small")
uint8_t kStaticDictionaryHashLengths[BROTLI_ENC_NUM_HASH_BUCKETS];

#else  /* BROTLI_STATIC_INIT */

/* Embed kStaticDictionaryHashWords and kStaticDictionaryHashLengths. */
#include "dictionary_hash_inc.h"

#endif  /* BROTLI_STATIC_INIT */

#if defined(__cplusplus) || defined(c_plusplus)
}  /* extern "C" */
#endif

Messung V0.5 in Prozent
C=83 H=89 G=85

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.