/* uocr_golden.h -- GENERATED by mkuocrgolden.py from the checkpoint's remote code; do not edit. */ #pragma once #include static const int32_t kUocrPatch = 16, kUocrDownsample = 4; static const int32_t kUocrBaseSize = 1024, kUocrTile = 640; static const int32_t kUocrMinTiles = 2, kUocrMaxTiles = 32; static const bool kUocrCropMode = true; static const int32_t kUocrImageToken = 128815; struct GoldUocrGrid { int64_t h, w; int32_t cols, rows; }; static const GoldUocrGrid kUocrGrid[] = { { 1, 1, 1, 1 }, { 40, 30, 1, 1 }, { 100, 100, 1, 1 }, { 300, 500, 1, 1 }, { 500, 300, 1, 1 }, { 640, 640, 1, 1 }, { 641, 641, 2, 2 }, { 500, 700, 4, 3 }, { 700, 500, 3, 4 }, { 800, 1000, 5, 4 }, { 1000, 800, 4, 5 }, { 1024, 1024, 2, 2 }, { 1280, 1024, 4, 5 }, { 1024, 1280, 5, 4 }, { 900, 1400, 3, 2 }, { 1400, 900, 2, 3 }, { 2000, 600, 3, 10 }, { 600, 2000, 10, 3 }, { 2400, 400, 1, 6 }, { 400, 2400, 6, 1 }, { 1080, 1920, 7, 4 }, { 1920, 1080, 4, 7 }, { 515, 1031, 2, 1 }, { 1031, 515, 1, 2 }, { 100, 5000, 32, 1 }, { 5000, 100, 1, 32 }, { 3000, 3000, 5, 5 }, { 720, 1280, 7, 4 }, { 800, 640, 4, 5 }, { 640, 800, 5, 4 }, { 960, 720, 3, 4 }, { 720, 960, 4, 3 }, { 1600, 1200, 3, 4 }, { 1200, 1600, 4, 3 }, { 33, 4096, 32, 1 }, { 4096, 33, 1, 32 }, }; struct GoldUocrPic { int32_t f, h, w, mode; int32_t cols, rows, n_ids; int32_t n_seg, seg0; uint64_t global_fnv, local_fnv; }; static const GoldUocrPic kUocrPictures[] = { { 0, 300, 500, 1, 1, 1, 273, 2, 0, 0xabc7f1eabc334430ull, 0x0000000000000000ull }, { 1, 900, 1400, 1, 3, 2, 893, 4, 2, 0xb068ca82d7ec14c3ull, 0x93a9d30576e60c3eull }, { 2, 2400, 400, 1, 1, 6, 933, 8, 6, 0x92636385d3bfb221ull, 0x2df135a4207447b6ull }, { 3, 500, 700, 1, 4, 3, 1503, 5, 14, 0x2feb196ccb92c0feull, 0x2627954c4ca5bc98ull }, { 4, 64, 48, 1, 1, 1, 273, 2, 19, 0x406b72ef3c95b8b6ull, 0x0000000000000000ull }, { 5, 800, 1000, 1, 5, 4, 2313, 6, 21, 0xa449cce59a03d7dcull, 0x36b9d429ad266a50ull }, { 0, 300, 500, 2, 1, 1, 273, 2, 27, 0xabc7f1eabc334430ull, 0x0000000000000000ull }, { 1, 900, 1400, 2, 1, 1, 273, 2, 29, 0xb068ca82d7ec14c3ull, 0x0000000000000000ull }, { 2, 2400, 400, 2, 1, 1, 273, 2, 31, 0x92636385d3bfb221ull, 0x0000000000000000ull }, { 3, 500, 700, 2, 1, 1, 273, 2, 33, 0x2feb196ccb92c0feull, 0x0000000000000000ull }, { 4, 64, 48, 2, 1, 1, 273, 2, 35, 0x406b72ef3c95b8b6ull, 0x0000000000000000ull }, { 5, 800, 1000, 2, 1, 1, 273, 2, 37, 0xa449cce59a03d7dcull, 0x0000000000000000ull }, { 1, 900, 1400, 3, 1, 1, 111, 2, 39, 0x45321be8ce76d69dull, 0x0000000000000000ull }, { 3, 500, 700, 3, 1, 1, 111, 2, 41, 0xde290af82e82620full, 0x0000000000000000ull }, }; struct GoldUocrSeg { int32_t h, w, real; }; static const GoldUocrSeg kUocrSegs[] = { { 64, 68, 64 }, { 4, 4, 0 }, { 40, 124, 120 }, { 40, 124, 120 }, { 64, 68, 64 }, { 4, 4, 0 }, { 40, 44, 40 }, { 40, 44, 40 }, { 40, 44, 40 }, { 40, 44, 40 }, { 40, 44, 40 }, { 40, 44, 40 }, { 64, 68, 64 }, { 4, 4, 0 }, { 40, 164, 160 }, { 40, 164, 160 }, { 40, 164, 160 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 40, 204, 200 }, { 40, 204, 200 }, { 40, 204, 200 }, { 40, 204, 200 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 64, 68, 64 }, { 4, 4, 0 }, { 40, 44, 40 }, { 4, 4, 0 }, { 40, 44, 40 }, { 4, 4, 0 }, }; /* Pillow's Image.resize(BICUBIC) of a splitmix picture: its two-pass order is part of the * function (the intermediate rounds to eight bits). */ struct GoldUocrResize { int32_t sh, sw, dh, dw; uint64_t fnv; }; static const GoldUocrResize kUocrResize[] = { { 2400, 400, 1024, 171, 0xbccdeb5e050ce815ull }, { 300, 300, 90, 100, 0xac4b3e6526dfbbb5ull }, { 400, 300, 171, 1024, 0x799a058e681618b5ull }, { 300, 400, 1024, 171, 0x82e65a0a71c6ee00ull }, { 400, 1000, 200, 500, 0x7ef049c0990c00f6ull }, { 1000, 400, 200, 300, 0x5a8d982164d9ff27ull }, { 700, 500, 650, 470, 0x4697cb390555b911ull }, { 500, 700, 640, 650, 0x90a6214f04fe8c0bull }, { 320, 480, 320, 480, 0x8ce46502c9f58463ull }, { 240, 320, 160, 320, 0x8ba4f63a78cc06bdull }, { 240, 320, 240, 200, 0x9210b76889ecfbceull }, { 64, 48, 1024, 1024, 0x3ccf3b8e768cfcd2ull }, }; /* The transposed pairs whose tall side the reference's set visits last. */ struct GoldUocrTie { int32_t c, r; }; static const GoldUocrTie kUocrTallLast[] = { {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 9}, {1, 13}, {1, 14}, {1, 16}, {1, 18}, {1, 20}, {1, 22}, {1, 27}, {1, 29}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {2, 7}, {2, 8}, {2, 9}, {2, 14}, {2, 15}, {2, 16}, {3, 5}, {3, 7}, {3, 9}, {4, 5}, {4, 6}, {4, 7}, {4, 8}, }; static const int32_t kUocrNTallLast = 31;