Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.cpp

Issue 1814233005: Make a few more const tables smaller. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: format Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h ('k') | core/fxcodec/jbig2/JBig2_SddProc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_STANDARD_H_ 7 #include "core/include/fxcrt/fx_basic.h"
8 #define CORE_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_STANDARD_H_ 8 #include "core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h"
9
10 #include "core/include/fxcrt/fx_system.h"
11
12 struct JBig2TableLine {
13 int PREFLEN;
14 int RANDELEN;
15 int RANGELOW;
16 };
17 9
18 const bool HuffmanTable_HTOOB_B1 = false; 10 const bool HuffmanTable_HTOOB_B1 = false;
19 const JBig2TableLine HuffmanTable_B1[] = {{1, 4, 0}, 11 const JBig2TableLine HuffmanTable_B1[] = {{1, 4, 0},
20 {2, 8, 16}, 12 {2, 8, 16},
21 {3, 16, 272}, 13 {3, 16, 272},
22 {0, 32, -1}, 14 {0, 32, -1},
23 {3, 32, 65808}}; 15 {3, 32, 65808}};
16 const size_t HuffmanTable_B1_Size = FX_ArraySize(HuffmanTable_B1);
17
24 const bool HuffmanTable_HTOOB_B2 = true; 18 const bool HuffmanTable_HTOOB_B2 = true;
25 const JBig2TableLine HuffmanTable_B2[] = {{1, 0, 0}, {2, 0, 1}, {3, 0, 2}, 19 const JBig2TableLine HuffmanTable_B2[] = {{1, 0, 0}, {2, 0, 1}, {3, 0, 2},
26 {4, 3, 3}, {5, 6, 11}, {0, 32, -1}, 20 {4, 3, 3}, {5, 6, 11}, {0, 32, -1},
27 {6, 32, 75}, {6, 0, 0}}; 21 {6, 32, 75}, {6, 0, 0}};
22 const size_t HuffmanTable_B2_Size = FX_ArraySize(HuffmanTable_B2);
23
28 const bool HuffmanTable_HTOOB_B3 = true; 24 const bool HuffmanTable_HTOOB_B3 = true;
29 const JBig2TableLine HuffmanTable_B3[] = { 25 const JBig2TableLine HuffmanTable_B3[] = {
30 {8, 8, -256}, {1, 0, 0}, {2, 0, 1}, {3, 0, 2}, {4, 3, 3}, 26 {8, 8, -256}, {1, 0, 0}, {2, 0, 1}, {3, 0, 2}, {4, 3, 3},
31 {5, 6, 11}, {8, 32, -257}, {7, 32, 75}, {6, 0, 0}}; 27 {5, 6, 11}, {8, 32, -257}, {7, 32, 75}, {6, 0, 0}};
28 const size_t HuffmanTable_B3_Size = FX_ArraySize(HuffmanTable_B3);
29
32 const bool HuffmanTable_HTOOB_B4 = false; 30 const bool HuffmanTable_HTOOB_B4 = false;
33 const JBig2TableLine HuffmanTable_B4[] = { 31 const JBig2TableLine HuffmanTable_B4[] = {
34 {1, 0, 1}, {2, 0, 2}, {3, 0, 3}, {4, 3, 4}, 32 {1, 0, 1}, {2, 0, 2}, {3, 0, 3}, {4, 3, 4},
35 {5, 6, 12}, {0, 32, -1}, {5, 32, 76}, 33 {5, 6, 12}, {0, 32, -1}, {5, 32, 76},
36 }; 34 };
35 const size_t HuffmanTable_B4_Size = FX_ArraySize(HuffmanTable_B4);
36
37 const bool HuffmanTable_HTOOB_B5 = false; 37 const bool HuffmanTable_HTOOB_B5 = false;
38 const JBig2TableLine HuffmanTable_B5[] = {{7, 8, -255}, {1, 0, 1}, {2, 0, 2}, 38 const JBig2TableLine HuffmanTable_B5[] = {{7, 8, -255}, {1, 0, 1}, {2, 0, 2},
39 {3, 0, 3}, {4, 3, 4}, {5, 6, 12}, 39 {3, 0, 3}, {4, 3, 4}, {5, 6, 12},
40 {7, 32, -256}, {6, 32, 76}}; 40 {7, 32, -256}, {6, 32, 76}};
41 const size_t HuffmanTable_B5_Size = FX_ArraySize(HuffmanTable_B5);
42
41 const bool HuffmanTable_HTOOB_B6 = false; 43 const bool HuffmanTable_HTOOB_B6 = false;
42 const JBig2TableLine HuffmanTable_B6[] = { 44 const JBig2TableLine HuffmanTable_B6[] = {
43 {5, 10, -2048}, {4, 9, -1024}, {4, 8, -512}, {4, 7, -256}, {5, 6, -128}, 45 {5, 10, -2048}, {4, 9, -1024}, {4, 8, -512}, {4, 7, -256}, {5, 6, -128},
44 {5, 5, -64}, {4, 5, -32}, {2, 7, 0}, {3, 7, 128}, {3, 8, 256}, 46 {5, 5, -64}, {4, 5, -32}, {2, 7, 0}, {3, 7, 128}, {3, 8, 256},
45 {4, 9, 512}, {4, 10, 1024}, {6, 32, -2049}, {6, 32, 2048}}; 47 {4, 9, 512}, {4, 10, 1024}, {6, 32, -2049}, {6, 32, 2048}};
48 const size_t HuffmanTable_B6_Size = FX_ArraySize(HuffmanTable_B6);
49
46 const bool HuffmanTable_HTOOB_B7 = false; 50 const bool HuffmanTable_HTOOB_B7 = false;
47 const JBig2TableLine HuffmanTable_B7[] = { 51 const JBig2TableLine HuffmanTable_B7[] = {
48 {4, 9, -1024}, {3, 8, -512}, {4, 7, -256}, {5, 6, -128}, {5, 5, -64}, 52 {4, 9, -1024}, {3, 8, -512}, {4, 7, -256}, {5, 6, -128}, {5, 5, -64},
49 {4, 5, -32}, {4, 5, 0}, {5, 5, 32}, {5, 6, 64}, {4, 7, 128}, 53 {4, 5, -32}, {4, 5, 0}, {5, 5, 32}, {5, 6, 64}, {4, 7, 128},
50 {3, 8, 256}, {3, 9, 512}, {3, 10, 1024}, {5, 32, -1025}, {5, 32, 2048}, 54 {3, 8, 256}, {3, 9, 512}, {3, 10, 1024}, {5, 32, -1025}, {5, 32, 2048},
51 }; 55 };
56 const size_t HuffmanTable_B7_Size = FX_ArraySize(HuffmanTable_B7);
57
52 const bool HuffmanTable_HTOOB_B8 = true; 58 const bool HuffmanTable_HTOOB_B8 = true;
53 const JBig2TableLine HuffmanTable_B8[] = { 59 const JBig2TableLine HuffmanTable_B8[] = {
54 {8, 3, -15}, {9, 1, -7}, {8, 1, -5}, {9, 0, -3}, {7, 0, -2}, 60 {8, 3, -15}, {9, 1, -7}, {8, 1, -5}, {9, 0, -3}, {7, 0, -2},
55 {4, 0, -1}, {2, 1, 0}, {5, 0, 2}, {6, 0, 3}, {3, 4, 4}, 61 {4, 0, -1}, {2, 1, 0}, {5, 0, 2}, {6, 0, 3}, {3, 4, 4},
56 {6, 1, 20}, {4, 4, 22}, {4, 5, 38}, {5, 6, 70}, {5, 7, 134}, 62 {6, 1, 20}, {4, 4, 22}, {4, 5, 38}, {5, 6, 70}, {5, 7, 134},
57 {6, 7, 262}, {7, 8, 390}, {6, 10, 646}, {9, 32, -16}, {9, 32, 1670}, 63 {6, 7, 262}, {7, 8, 390}, {6, 10, 646}, {9, 32, -16}, {9, 32, 1670},
58 {2, 0, 0}}; 64 {2, 0, 0}};
65 const size_t HuffmanTable_B8_Size = FX_ArraySize(HuffmanTable_B8);
66
59 const bool HuffmanTable_HTOOB_B9 = true; 67 const bool HuffmanTable_HTOOB_B9 = true;
60 const JBig2TableLine HuffmanTable_B9[] = { 68 const JBig2TableLine HuffmanTable_B9[] = {
61 {8, 4, -31}, {9, 2, -15}, {8, 2, -11}, {9, 1, -7}, {7, 1, -5}, 69 {8, 4, -31}, {9, 2, -15}, {8, 2, -11}, {9, 1, -7}, {7, 1, -5},
62 {4, 1, -3}, {3, 1, -1}, {3, 1, 1}, {5, 1, 3}, {6, 1, 5}, 70 {4, 1, -3}, {3, 1, -1}, {3, 1, 1}, {5, 1, 3}, {6, 1, 5},
63 {3, 5, 7}, {6, 2, 39}, {4, 5, 43}, {4, 6, 75}, {5, 7, 139}, 71 {3, 5, 7}, {6, 2, 39}, {4, 5, 43}, {4, 6, 75}, {5, 7, 139},
64 {5, 8, 267}, {6, 8, 523}, {7, 9, 779}, {6, 11, 1291}, {9, 32, -32}, 72 {5, 8, 267}, {6, 8, 523}, {7, 9, 779}, {6, 11, 1291}, {9, 32, -32},
65 {9, 32, 3339}, {2, 0, 0}}; 73 {9, 32, 3339}, {2, 0, 0}};
74 const size_t HuffmanTable_B9_Size = FX_ArraySize(HuffmanTable_B9);
75
66 const bool HuffmanTable_HTOOB_B10 = true; 76 const bool HuffmanTable_HTOOB_B10 = true;
67 const JBig2TableLine HuffmanTable_B10[] = { 77 const JBig2TableLine HuffmanTable_B10[] = {
68 {7, 4, -21}, {8, 0, -5}, {7, 0, -4}, {5, 0, -3}, {2, 2, -2}, 78 {7, 4, -21}, {8, 0, -5}, {7, 0, -4}, {5, 0, -3}, {2, 2, -2},
69 {5, 0, 2}, {6, 0, 3}, {7, 0, 4}, {8, 0, 5}, {2, 6, 6}, 79 {5, 0, 2}, {6, 0, 3}, {7, 0, 4}, {8, 0, 5}, {2, 6, 6},
70 {5, 5, 70}, {6, 5, 102}, {6, 6, 134}, {6, 7, 198}, {6, 8, 326}, 80 {5, 5, 70}, {6, 5, 102}, {6, 6, 134}, {6, 7, 198}, {6, 8, 326},
71 {6, 9, 582}, {6, 10, 1094}, {7, 11, 2118}, {8, 32, -22}, {8, 32, 4166}, 81 {6, 9, 582}, {6, 10, 1094}, {7, 11, 2118}, {8, 32, -22}, {8, 32, 4166},
72 {2, 0, 0}}; 82 {2, 0, 0}};
83 const size_t HuffmanTable_B10_Size = FX_ArraySize(HuffmanTable_B10);
84
73 const bool HuffmanTable_HTOOB_B11 = false; 85 const bool HuffmanTable_HTOOB_B11 = false;
74 const JBig2TableLine HuffmanTable_B11[] = { 86 const JBig2TableLine HuffmanTable_B11[] = {
75 {1, 0, 1}, {2, 1, 2}, {4, 0, 4}, {4, 1, 5}, {5, 1, 7}, 87 {1, 0, 1}, {2, 1, 2}, {4, 0, 4}, {4, 1, 5}, {5, 1, 7},
76 {5, 2, 9}, {6, 2, 13}, {7, 2, 17}, {7, 3, 21}, {7, 4, 29}, 88 {5, 2, 9}, {6, 2, 13}, {7, 2, 17}, {7, 3, 21}, {7, 4, 29},
77 {7, 5, 45}, {7, 6, 77}, {0, 32, 0}, {7, 32, 141}}; 89 {7, 5, 45}, {7, 6, 77}, {0, 32, 0}, {7, 32, 141}};
90 const size_t HuffmanTable_B11_Size = FX_ArraySize(HuffmanTable_B11);
91
78 const bool HuffmanTable_HTOOB_B12 = false; 92 const bool HuffmanTable_HTOOB_B12 = false;
79 const JBig2TableLine HuffmanTable_B12[] = { 93 const JBig2TableLine HuffmanTable_B12[] = {
80 {1, 0, 1}, {2, 0, 2}, {3, 1, 3}, {5, 0, 5}, {5, 1, 6}, 94 {1, 0, 1}, {2, 0, 2}, {3, 1, 3}, {5, 0, 5}, {5, 1, 6},
81 {6, 1, 8}, {7, 0, 10}, {7, 1, 11}, {7, 2, 13}, {7, 3, 17}, 95 {6, 1, 8}, {7, 0, 10}, {7, 1, 11}, {7, 2, 13}, {7, 3, 17},
82 {7, 4, 25}, {8, 5, 41}, {0, 32, 0}, {8, 32, 73}}; 96 {7, 4, 25}, {8, 5, 41}, {0, 32, 0}, {8, 32, 73}};
97 const size_t HuffmanTable_B12_Size = FX_ArraySize(HuffmanTable_B12);
98
83 const bool HuffmanTable_HTOOB_B13 = false; 99 const bool HuffmanTable_HTOOB_B13 = false;
84 const JBig2TableLine HuffmanTable_B13[] = { 100 const JBig2TableLine HuffmanTable_B13[] = {
85 {1, 0, 1}, {3, 0, 2}, {4, 0, 3}, {5, 0, 4}, {4, 1, 5}, 101 {1, 0, 1}, {3, 0, 2}, {4, 0, 3}, {5, 0, 4}, {4, 1, 5},
86 {3, 3, 7}, {6, 1, 15}, {6, 2, 17}, {6, 3, 21}, {6, 4, 29}, 102 {3, 3, 7}, {6, 1, 15}, {6, 2, 17}, {6, 3, 21}, {6, 4, 29},
87 {6, 5, 45}, {7, 6, 77}, {0, 32, 0}, {7, 32, 141}}; 103 {6, 5, 45}, {7, 6, 77}, {0, 32, 0}, {7, 32, 141}};
104 const size_t HuffmanTable_B13_Size = FX_ArraySize(HuffmanTable_B13);
105
88 const bool HuffmanTable_HTOOB_B14 = false; 106 const bool HuffmanTable_HTOOB_B14 = false;
89 const JBig2TableLine HuffmanTable_B14[] = {{3, 0, -2}, {3, 0, -1}, {1, 0, 0}, 107 const JBig2TableLine HuffmanTable_B14[] = {{3, 0, -2}, {3, 0, -1}, {1, 0, 0},
90 {3, 0, 1}, {3, 0, 2}, {0, 32, -3}, 108 {3, 0, 1}, {3, 0, 2}, {0, 32, -3},
91 {0, 32, 3}}; 109 {0, 32, 3}};
110 const size_t HuffmanTable_B14_Size = FX_ArraySize(HuffmanTable_B14);
111
92 const bool HuffmanTable_HTOOB_B15 = false; 112 const bool HuffmanTable_HTOOB_B15 = false;
93 const JBig2TableLine HuffmanTable_B15[] = { 113 const JBig2TableLine HuffmanTable_B15[] = {
94 {7, 4, -24}, {6, 2, -8}, {5, 1, -4}, {4, 0, -2}, {3, 0, -1}, 114 {7, 4, -24}, {6, 2, -8}, {5, 1, -4}, {4, 0, -2}, {3, 0, -1},
95 {1, 0, 0}, {3, 0, 1}, {4, 0, 2}, {5, 1, 3}, {6, 2, 5}, 115 {1, 0, 0}, {3, 0, 1}, {4, 0, 2}, {5, 1, 3}, {6, 2, 5},
96 {7, 4, 9}, {7, 32, -25}, {7, 32, 25}}; 116 {7, 4, 9}, {7, 32, -25}, {7, 32, 25}};
97 117 const size_t HuffmanTable_B15_Size = FX_ArraySize(HuffmanTable_B15);
98 #endif // CORE_FXCODEC_JBIG2_JBIG2_HUFFMANTABLE_STANDARD_H_
OLDNEW
« no previous file with comments | « core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h ('k') | core/fxcodec/jbig2/JBig2_SddProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698