diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-18 09:32:06 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-18 09:32:06 -0700 |
commit | 314743a4a752716b8e977482ad6c757c70d019db (patch) | |
tree | 3bb2332e5232c1b37e9da0ccb02aec2e87de1a00 /xfa/fxbarcode/pdf417/BC_PDF417Common.cpp | |
parent | 3420909bbb47d6e47d6c561cbcce06d056fdf0a3 (diff) | |
download | pdfium-314743a4a752716b8e977482ad6c757c70d019db.tar.xz |
Reduce size of several PDFium constant tables.
Either by using the smallest possible data type, or
By accurately calcuating the bounds, or
Moving to array of pointers for varying length rows.
Notes:
The 929 is reassuring since PDF417 barcode uses GF(929).
FX_WCHAR is 4 bytes on unix (2 on windows).
Binary looks to be about 240k smaller on linux/64
R=ochang@chromium.org
Review URL: https://codereview.chromium.org/1807373002 .
Diffstat (limited to 'xfa/fxbarcode/pdf417/BC_PDF417Common.cpp')
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417Common.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Common.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Common.cpp index fa4647db84..92c641d1bd 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Common.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417Common.cpp @@ -22,16 +22,9 @@ #include "xfa/fxbarcode/pdf417/BC_PDF417Common.h" -int32_t CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929; -int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1; -int32_t CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3; -int32_t CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90; -int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32; -int32_t CBC_PDF417Common::MODULES_IN_CODEWORD = 17; -int32_t CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18; -int32_t CBC_PDF417Common::BARS_IN_MODULE = 8; -CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = NULL; -int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { +CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = nullptr; + +const int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { 0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, 0x1035c, 0x10396, 0x103a6, 0x103ac, 0x10422, 0x10428, 0x10436, 0x10442, 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482, @@ -381,7 +374,8 @@ int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { 0x1faec, 0x1fb16, 0x1fb26, 0x1fb2c, 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4, 0x1fba8, 0x1fbb6, 0x1fbda}; -int32_t CBC_PDF417Common::CODEWORD_TABLE[] = { + +const uint16_t CBC_PDF417Common::CODEWORD_TABLE[] = { 2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, 902, 896, 908, 868, 865, 861, 859, 2511, 873, 871, 1780, 835, 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, |