• google group varint 无损压缩解压算法的高效实现


    group varint 是一种极为高效的压缩和解压算法, 只针对 uint32整数,是一种针对特定数据类型的压缩算法, 压缩比不高, 但是速度极快。

    int32整数可以通过zigZag转换为 uint32数据。

    下面给了2张图 辅助大家理解  varint 和 group varint

    我的这个实现版本, 压缩 400M整数数据 耗时 0.56 秒,
    解压 400M整数数据 耗时 0.35 秒

    下面直接上代码, 看不懂的直接联系我 !!!!!!

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    1168
    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    /******************************************************************
     *  Created on: 2011-4-26
     *      Author: yewang@taobao.com clm971910@gmail.com
     *
     *      Desc  : 提供uint32的  varint 压缩和解压功能
     *              提供group varint的高效实现
     *
     ******************************************************************/
     
    #ifndef VARINT_H_
    #define VARINT_H_
     
    #include <stdint.h>
    #include <stddef.h>
     
    #define   MAX_VARINT32_BYTES   5
    #define   MAX_UINT8            256
    #define   MAX_UINT16           65536
    #define   MAX_UINT24           16777216
    #define   MAX_UINT32           4294967296
     
    #define   GROUP_VARINT_DECODE(idx)              \
        valueArr[0] = ((GROUP_VARINT_TYPE_##idx *) star)[0].u0; \
        valueArr[1] = ((GROUP_VARINT_TYPE_##idx *) star)[0].u1; \
        valueArr[2] = ((GROUP_VARINT_TYPE_##idx *) star)[0].u2; \
        valueArr[3] = ((GROUP_VARINT_TYPE_##idx *) star)[0].u3;
     
    namespace index_lib
    {
     
    /**
     * group varint 的索引表,
     * 前4列分别表示 4个int压缩单元 和 第一个索引单元的距离 (byte)
     * 第5列 表示的是 下一个索引单元 和 第一个索引单元的距离(byte)
     */
    static const int GROUP_VARINT_IDX_ARR[256][5] =
    {
        /* 00 00 00 00 */ {1, 2, 3, 4, 5},
        /* 00 00 00 01 */ {1, 2, 3, 4, 6},
        /* 00 00 00 10 */ {1, 2, 3, 4, 7},
        /* 00 00 00 11 */ {1, 2, 3, 4, 8},
     
        /* 00 00 01 00 */ {1, 2, 3, 5, 6},
        /* 00 00 01 01 */ {1, 2, 3, 5, 7},
        /* 00 00 01 10 */ {1, 2, 3, 5, 8},
        /* 00 00 01 11 */ {1, 2, 3, 5, 9},
     
        /* 00 00 10 00 */ {1, 2, 3, 6, 7},
        /* 00 00 10 01 */ {1, 2, 3, 6, 8},
        /* 00 00 10 10 */ {1, 2, 3, 6, 9},
        /* 00 00 10 11 */ {1, 2, 3, 6, 10},
     
        /* 00 00 11 00 */ {1, 2, 3, 7, 8},
        /* 00 00 11 01 */ {1, 2, 3, 7, 9},
        /* 00 00 11 10 */ {1, 2, 3, 7, 10},
        /* 00 00 11 11 */ {1, 2, 3, 7, 11},
     
        /* 00 01 00 00 */ {1, 2, 4, 5, 6},
        /* 00 01 00 01 */ {1, 2, 4, 5, 7},
        /* 00 01 00 10 */ {1, 2, 4, 5, 8},
        /* 00 01 00 11 */ {1, 2, 4, 5, 9},
     
        /* 00 01 01 00 */ {1, 2, 4, 6, 7},
        /* 00 01 01 01 */ {1, 2, 4, 6, 8},
        /* 00 01 01 10 */ {1, 2, 4, 6, 9},
        /* 00 01 01 11 */ {1, 2, 4, 6, 10},
     
        /* 00 01 10 00 */ {1, 2, 4, 7, 8},
        /* 00 01 10 01 */ {1, 2, 4, 7, 9},
        /* 00 01 10 10 */ {1, 2, 4, 7, 10},
        /* 00 01 10 11 */ {1, 2, 4, 7, 11},
     
        /* 00 01 11 00 */ {1, 2, 4, 8, 9},
        /* 00 01 11 01 */ {1, 2, 4, 8, 10},
        /* 00 01 11 10 */ {1, 2, 4, 8, 11},
        /* 00 01 11 11 */ {1, 2, 4, 8, 12},
     
        /* 00 10 00 00 */ {1, 2, 5, 6, 7},
        /* 00 10 00 01 */ {1, 2, 5, 6, 8},
        /* 00 10 00 10 */ {1, 2, 5, 6, 9},
        /* 00 10 00 11 */ {1, 2, 5, 6, 10},
     
        /* 00 10 01 00 */ {1, 2, 5, 7, 8},
        /* 00 10 01 01 */ {1, 2, 5, 7, 9},
        /* 00 10 01 10 */ {1, 2, 5, 7, 10},
        /* 00 10 01 11 */ {1, 2, 5, 7, 11},
     
        /* 00 10 10 00 */ {1, 2, 5, 8, 9},
        /* 00 10 10 01 */ {1, 2, 5, 8, 10},
        /* 00 10 10 10 */ {1, 2, 5, 8, 11},
        /* 00 10 10 11 */ {1, 2, 5, 8, 12},
     
        /* 00 10 11 00 */ {1, 2, 5, 9, 10},
        /* 00 10 11 01 */ {1, 2, 5, 9, 11},
        /* 00 10 11 10 */ {1, 2, 5, 9, 12},
        /* 00 10 11 11 */ {1, 2, 5, 9, 13},
     
        /* 00 11 00 00 */ {1, 2, 6, 7, 8},
        /* 00 11 00 01 */ {1, 2, 6, 7, 9},
        /* 00 11 00 10 */ {1, 2, 6, 7, 10},
        /* 00 11 00 11 */ {1, 2, 6, 7, 11},
     
        /* 00 11 01 00 */ {1, 2, 6, 8, 9},
        /* 00 11 01 01 */ {1, 2, 6, 8, 10},
        /* 00 11 01 10 */ {1, 2, 6, 8, 11},
        /* 00 11 01 11 */ {1, 2, 6, 8, 12},
     
        /* 00 11 10 00 */ {1, 2, 6, 9, 10},
        /* 00 11 10 01 */ {1, 2, 6, 9, 11},
        /* 00 11 10 10 */ {1, 2, 6, 9, 12},
        /* 00 11 10 11 */ {1, 2, 6, 9, 13},
     
        /* 00 11 11 00 */ {1, 2, 6, 10, 11},
        /* 00 11 11 01 */ {1, 2, 6, 10, 12},
        /* 00 11 11 10 */ {1, 2, 6, 10, 13},
        /* 00 11 11 11 */ {1, 2, 6, 10, 14},
     
        /* 01 00 00 00 */ {1, 3, 4, 5, 6},
        /* 01 00 00 01 */ {1, 3, 4, 5, 7},
        /* 01 00 00 10 */ {1, 3, 4, 5, 8},
        /* 01 00 00 11 */ {1, 3, 4, 5, 9},
     
        /* 01 00 01 00 */ {1, 3, 4, 6, 7},
        /* 01 00 01 01 */ {1, 3, 4, 6, 8},
        /* 01 00 01 10 */ {1, 3, 4, 6, 9},
        /* 01 00 01 11 */ {1, 3, 4, 6, 10},
     
        /* 01 00 10 00 */ {1, 3, 4, 7, 8},
        /* 01 00 10 01 */ {1, 3, 4, 7, 9},
        /* 01 00 10 10 */ {1, 3, 4, 7, 10},
        /* 01 00 10 11 */ {1, 3, 4, 7, 11},
     
        /* 01 00 11 00 */ {1, 3, 4, 8, 9},
        /* 01 00 11 01 */ {1, 3, 4, 8, 10},
        /* 01 00 11 10 */ {1, 3, 4, 8, 11},
        /* 01 00 11 11 */ {1, 3, 4, 8, 12},
     
        /* 01 01 00 00 */ {1, 3, 5, 6, 7},
        /* 01 01 00 01 */ {1, 3, 5, 6, 8},
        /* 01 01 00 10 */ {1, 3, 5, 6, 9},
        /* 01 01 00 11 */ {1, 3, 5, 6, 10},
     
        /* 01 01 01 00 */ {1, 3, 5, 7, 8},
        /* 01 01 01 01 */ {1, 3, 5, 7, 9},
        /* 01 01 01 10 */ {1, 3, 5, 7, 10},
        /* 01 01 01 11 */ {1, 3, 5, 7, 11},
     
        /* 01 01 10 00 */ {1, 3, 5, 8, 9},
        /* 01 01 10 01 */ {1, 3, 5, 8, 10},
        /* 01 01 10 10 */ {1, 3, 5, 8, 11},
        /* 01 01 10 11 */ {1, 3, 5, 8, 12},
     
        /* 01 01 11 00 */ {1, 3, 5, 9, 10},
        /* 01 01 11 01 */ {1, 3, 5, 9, 11},
        /* 01 01 11 10 */ {1, 3, 5, 9, 12},
        /* 01 01 11 11 */ {1, 3, 5, 9, 13},
     
        /* 01 10 00 00 */ {1, 3, 6, 7, 8},
        /* 01 10 00 01 */ {1, 3, 6, 7, 9},
        /* 01 10 00 10 */ {1, 3, 6, 7, 10},
        /* 01 10 00 11 */ {1, 3, 6, 7, 11},
     
        /* 01 10 01 00 */ {1, 3, 6, 8, 9},
        /* 01 10 01 01 */ {1, 3, 6, 8, 10},
        /* 01 10 01 10 */ {1, 3, 6, 8, 11},
        /* 01 10 01 11 */ {1, 3, 6, 8, 12},
     
        /* 01 10 10 00 */ {1, 3, 6, 9, 10},
        /* 01 10 10 01 */ {1, 3, 6, 9, 11},
        /* 01 10 10 10 */ {1, 3, 6, 9, 12},
        /* 01 10 10 11 */ {1, 3, 6, 9, 13},
     
        /* 01 10 11 00 */ {1, 3, 6, 10, 11},
        /* 01 10 11 01 */ {1, 3, 6, 10, 12},
        /* 01 10 11 10 */ {1, 3, 6, 10, 13},
        /* 01 10 11 11 */ {1, 3, 6, 10, 14},
     
        /* 01 11 00 00 */ {1, 3, 7, 8, 9},
        /* 01 11 00 01 */ {1, 3, 7, 8, 10},
        /* 01 11 00 10 */ {1, 3, 7, 8, 11},
        /* 01 11 00 11 */ {1, 3, 7, 8, 12},
     
        /* 01 11 01 00 */ {1, 3, 7, 9, 10},
        /* 01 11 01 01 */ {1, 3, 7, 9, 11},
        /* 01 11 01 10 */ {1, 3, 7, 9, 12},
        /* 01 11 01 11 */ {1, 3, 7, 9, 13},
     
        /* 01 11 10 00 */ {1, 3, 7, 10, 11},
        /* 01 11 10 01 */ {1, 3, 7, 10, 12},
        /* 01 11 10 10 */ {1, 3, 7, 10, 13},
        /* 01 11 10 11 */ {1, 3, 7, 10, 14},
     
        /* 01 11 11 00 */ {1, 3, 7, 11, 12},
        /* 01 11 11 01 */ {1, 3, 7, 11, 13},
        /* 01 11 11 10 */ {1, 3, 7, 11, 14},
        /* 01 11 11 11 */ {1, 3, 7, 11, 15},
     
        /* 10 00 00 00 */ {1, 4, 5, 6, 7},
        /* 10 00 00 01 */ {1, 4, 5, 6, 8},
        /* 10 00 00 10 */ {1, 4, 5, 6, 9},
        /* 10 00 00 11 */ {1, 4, 5, 6, 10},
     
        /* 10 00 01 00 */ {1, 4, 5, 7, 8},
        /* 10 00 01 01 */ {1, 4, 5, 7, 9},
        /* 10 00 01 10 */ {1, 4, 5, 7, 10},
        /* 10 00 01 11 */ {1, 4, 5, 7, 11},
     
        /* 10 00 10 00 */ {1, 4, 5, 8, 9},
        /* 10 00 10 01 */ {1, 4, 5, 8, 10},
        /* 10 00 10 10 */ {1, 4, 5, 8, 11},
        /* 10 00 10 11 */ {1, 4, 5, 8, 12},
     
        /* 10 00 11 00 */ {1, 4, 5, 9, 10},
        /* 10 00 11 01 */ {1, 4, 5, 9, 11},
        /* 10 00 11 10 */ {1, 4, 5, 9, 12},
        /* 10 00 11 11 */ {1, 4, 5, 9, 13},
     
        /* 10 01 00 00 */ {1, 4, 6, 7, 8},
        /* 10 01 00 01 */ {1, 4, 6, 7, 9},
        /* 10 01 00 10 */ {1, 4, 6, 7, 10},
        /* 10 01 00 11 */ {1, 4, 6, 7, 11},
     
        /* 10 01 01 00 */ {1, 4, 6, 8, 9},
        /* 10 01 01 01 */ {1, 4, 6, 8, 10},
        /* 10 01 01 10 */ {1, 4, 6, 8, 11},
        /* 10 01 01 11 */ {1, 4, 6, 8, 12},
     
        /* 10 01 10 00 */ {1, 4, 6, 9, 10},
        /* 10 01 10 01 */ {1, 4, 6, 9, 11},
        /* 10 01 10 10 */ {1, 4, 6, 9, 12},
        /* 10 01 10 11 */ {1, 4, 6, 9, 13},
     
        /* 10 01 11 00 */ {1, 4, 6, 10, 11},
        /* 10 01 11 01 */ {1, 4, 6, 10, 12},
        /* 10 01 11 10 */ {1, 4, 6, 10, 13},
        /* 10 01 11 11 */ {1, 4, 6, 10, 14},
     
        /* 10 10 00 00 */ {1, 4, 7, 8, 9},
        /* 10 10 00 01 */ {1, 4, 7, 8, 10},
        /* 10 10 00 10 */ {1, 4, 7, 8, 11},
        /* 10 10 00 11 */ {1, 4, 7, 8, 12},
     
        /* 10 10 01 00 */ {1, 4, 7, 9, 10},
        /* 10 10 01 01 */ {1, 4, 7, 9, 11},
        /* 10 10 01 10 */ {1, 4, 7, 9, 12},
        /* 10 10 01 11 */ {1, 4, 7, 9, 13},
     
        /* 10 10 10 00 */ {1, 4, 7, 10, 11},
        /* 10 10 10 01 */ {1, 4, 7, 10, 12},
        /* 10 10 10 10 */ {1, 4, 7, 10, 13},
        /* 10 10 10 11 */ {1, 4, 7, 10, 14},
     
        /* 10 10 11 00 */ {1, 4, 7, 11, 12},
        /* 10 10 11 01 */ {1, 4, 7, 11, 13},
        /* 10 10 11 10 */ {1, 4, 7, 11, 14},
        /* 10 10 11 11 */ {1, 4, 7, 11, 15},
     
        /* 10 11 00 00 */ {1, 4, 8, 9, 10},
        /* 10 11 00 01 */ {1, 4, 8, 9, 11},
        /* 10 11 00 10 */ {1, 4, 8, 9, 12},
        /* 10 11 00 11 */ {1, 4, 8, 9, 13},
     
        /* 10 11 01 00 */ {1, 4, 8, 10, 11},
        /* 10 11 01 01 */ {1, 4, 8, 10, 12},
        /* 10 11 01 10 */ {1, 4, 8, 10, 13},
        /* 10 11 01 11 */ {1, 4, 8, 10, 14},
     
        /* 10 11 10 00 */ {1, 4, 8, 11, 12},
        /* 10 11 10 01 */ {1, 4, 8, 11, 13},
        /* 10 11 10 10 */ {1, 4, 8, 11, 14},
        /* 10 11 10 11 */ {1, 4, 8, 11, 15},
     
        /* 10 11 11 00 */ {1, 4, 8, 12, 13},
        /* 10 11 11 01 */ {1, 4, 8, 12, 14},
        /* 10 11 11 10 */ {1, 4, 8, 12, 15},
        /* 10 11 11 11 */ {1, 4, 8, 12, 16},
     
        /* 11 00 00 00 */ {1, 5, 6, 7, 8},
        /* 11 00 00 01 */ {1, 5, 6, 7, 9},
        /* 11 00 00 10 */ {1, 5, 6, 7, 10},
        /* 11 00 00 11 */ {1, 5, 6, 7, 11},
     
        /* 11 00 01 00 */ {1, 5, 6, 8, 9},
        /* 11 00 01 01 */ {1, 5, 6, 8, 10},
        /* 11 00 01 10 */ {1, 5, 6, 8, 11},
        /* 11 00 01 11 */ {1, 5, 6, 8, 12},
     
        /* 11 00 10 00 */ {1, 5, 6, 9, 10},
        /* 11 00 10 01 */ {1, 5, 6, 9, 11},
        /* 11 00 10 10 */ {1, 5, 6, 9, 12},
        /* 11 00 10 11 */ {1, 5, 6, 9, 13},
     
        /* 11 00 11 00 */ {1, 5, 6, 10, 11},
        /* 11 00 11 01 */ {1, 5, 6, 10, 12},
        /* 11 00 11 10 */ {1, 5, 6, 10, 13},
        /* 11 00 11 11 */ {1, 5, 6, 10, 14},
     
        /* 11 01 00 00 */ {1, 5, 7, 8, 9},
        /* 11 01 00 01 */ {1, 5, 7, 8, 10},
        /* 11 01 00 10 */ {1, 5, 7, 8, 11},
        /* 11 01 00 11 */ {1, 5, 7, 8, 12},
     
        /* 11 01 01 00 */ {1, 5, 7, 9, 10},
        /* 11 01 01 01 */ {1, 5, 7, 9, 11},
        /* 11 01 01 10 */ {1, 5, 7, 9, 12},
        /* 11 01 01 11 */ {1, 5, 7, 9, 13},
     
        /* 11 01 10 00 */ {1, 5, 7, 10, 11},
        /* 11 01 10 01 */ {1, 5, 7, 10, 12},
        /* 11 01 10 10 */ {1, 5, 7, 10, 13},
        /* 11 01 10 11 */ {1, 5, 7, 10, 14},
     
        /* 11 01 11 00 */ {1, 5, 7, 11, 12},
        /* 11 01 11 01 */ {1, 5, 7, 11, 13},
        /* 11 01 11 10 */ {1, 5, 7, 11, 14},
        /* 11 01 11 11 */ {1, 5, 7, 11, 15},
     
        /* 11 10 00 00 */ {1, 5, 8, 9, 10},
        /* 11 10 00 01 */ {1, 5, 8, 9, 11},
        /* 11 10 00 10 */ {1, 5, 8, 9, 12},
        /* 11 10 00 11 */ {1, 5, 8, 9, 13},
     
        /* 11 10 01 00 */ {1, 5, 8, 10, 11},
        /* 11 10 01 01 */ {1, 5, 8, 10, 12},
        /* 11 10 01 10 */ {1, 5, 8, 10, 13},
        /* 11 10 01 11 */ {1, 5, 8, 10, 14},
     
        /* 11 10 10 00 */ {1, 5, 8, 11, 12},
        /* 11 10 10 01 */ {1, 5, 8, 11, 13},
        /* 11 10 10 10 */ {1, 5, 8, 11, 14},
        /* 11 10 10 11 */ {1, 5, 8, 11, 15},
     
        /* 11 10 11 00 */ {1, 5, 8, 12, 13},
        /* 11 10 11 01 */ {1, 5, 8, 12, 14},
        /* 11 10 11 10 */ {1, 5, 8, 12, 15},
        /* 11 10 11 11 */ {1, 5, 8, 12, 16},
     
        /* 11 11 00 00 */ {1, 5, 9, 10, 11},
        /* 11 11 00 01 */ {1, 5, 9, 10, 12},
        /* 11 11 00 10 */ {1, 5, 9, 10, 13},
        /* 11 11 00 11 */ {1, 5, 9, 10, 14},
     
        /* 11 11 01 00 */ {1, 5, 9, 11, 12},
        /* 11 11 01 01 */ {1, 5, 9, 11, 13},
        /* 11 11 01 10 */ {1, 5, 9, 11, 14},
        /* 11 11 01 11 */ {1, 5, 9, 11, 15},
     
        /* 11 11 10 00 */ {1, 5, 9, 12, 13},
        /* 11 11 10 01 */ {1, 5, 9, 12, 14},
        /* 11 11 10 10 */ {1, 5, 9, 12, 15},
        /* 11 11 10 11 */ {1, 5, 9, 12, 16},
     
        /* 11 11 11 00 */ {1, 5, 9, 13, 14},
        /* 11 11 11 01 */ {1, 5, 9, 13, 15},
        /* 11 11 11 10 */ {1, 5, 9, 13, 16},
        /* 11 11 11 11 */ {1, 5, 9, 13, 17}
    };
     
    #pragma pack(1)
    struct GROUP_VARINT_TYPE_0   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_1   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_2   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_3   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_4   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_5   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_6   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_7   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_8   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_9   { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_10  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_11  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_12  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_13  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_14  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_15  { uint32_t u0:8;   uint32_t u1:8;   uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_16  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_17  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_18  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_19  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_20  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_21  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_22  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_23  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_24  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_25  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_26  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_27  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_28  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_29  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_30  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_31  { uint32_t u0:8;   uint32_t u1:16;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_32  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_33  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_34  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_35  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_36  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_37  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_38  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_39  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_40  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_41  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_42  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_43  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_44  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_45  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_46  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_47  { uint32_t u0:8;   uint32_t u1:24;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_48  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_49  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_50  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_51  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_52  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_53  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_54  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_55  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_56  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_57  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_58  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_59  { uint32_t u0:8;   uint32_t u1;     uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_60  { uint32_t u0:8;   uint32_t u1;     uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_61  { uint32_t u0:8;   uint32_t u1;     uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_62  { uint32_t u0:8;   uint32_t u1;     uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_63  { uint32_t u0:8;   uint32_t u1;     uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_64  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_65  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_66  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_67  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_68  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_69  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_70  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_71  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_72  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_73  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_74  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_75  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_76  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_77  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_78  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_79  { uint32_t u0:16;   uint32_t u1:8;   uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_80  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_81  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_82  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_83  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_84  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_85  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_86  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_87  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_88  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_89  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_90  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_91  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_92  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_93  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_94  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_95  { uint32_t u0:16;   uint32_t u1:16;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_96  { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_97  { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_98  { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_99  { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_100 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_101 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_102 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_103 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_104 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_105 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_106 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_107 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_108 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_109 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_110 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_111 { uint32_t u0:16;   uint32_t u1:24;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_112 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_113 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_114 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_115 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_116 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_117 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_118 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_119 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_120 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_121 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_122 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_123 { uint32_t u0:16;   uint32_t u1;     uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_124 { uint32_t u0:16;   uint32_t u1;     uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_125 { uint32_t u0:16;   uint32_t u1;     uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_126 { uint32_t u0:16;   uint32_t u1;     uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_127 { uint32_t u0:16;   uint32_t u1;     uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_128 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_129 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_130 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_131 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_132 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_133 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_134 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_135 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_136 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_137 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_138 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_139 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_140 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_141 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_142 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_143 { uint32_t u0:24;   uint32_t u1:8;   uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_144 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_145 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_146 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_147 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_148 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_149 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_150 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_151 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_152 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_153 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_154 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_155 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_156 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_157 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_158 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_159 { uint32_t u0:24;   uint32_t u1:16;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_160 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_161 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_162 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_163 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_164 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_165 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_166 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_167 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_168 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_169 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_170 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_171 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_172 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_173 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_174 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_175 { uint32_t u0:24;   uint32_t u1:24;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_176 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_177 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_178 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_179 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_180 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_181 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_182 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_183 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_184 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_185 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_186 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_187 { uint32_t u0:24;   uint32_t u1;     uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_188 { uint32_t u0:24;   uint32_t u1;     uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_189 { uint32_t u0:24;   uint32_t u1;     uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_190 { uint32_t u0:24;   uint32_t u1;     uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_191 { uint32_t u0:24;   uint32_t u1;     uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_192 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_193 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_194 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_195 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_196 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_197 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_198 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_199 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_200 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_201 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_202 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_203 { uint32_t u0;      uint32_t u1:8;   uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_204 { uint32_t u0;      uint32_t u1:8;   uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_205 { uint32_t u0;      uint32_t u1:8;   uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_206 { uint32_t u0;      uint32_t u1:8;   uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_207 { uint32_t u0;      uint32_t u1:8;   uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_208 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_209 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_210 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_211 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_212 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_213 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_214 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_215 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_216 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_217 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_218 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_219 { uint32_t u0;      uint32_t u1:16;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_220 { uint32_t u0;      uint32_t u1:16;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_221 { uint32_t u0;      uint32_t u1:16;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_222 { uint32_t u0;      uint32_t u1:16;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_223 { uint32_t u0;      uint32_t u1:16;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_224 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_225 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_226 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_227 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_228 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_229 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_230 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_231 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_232 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_233 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_234 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_235 { uint32_t u0;      uint32_t u1:24;  uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_236 { uint32_t u0;      uint32_t u1:24;  uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_237 { uint32_t u0;      uint32_t u1:24;  uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_238 { uint32_t u0;      uint32_t u1:24;  uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_239 { uint32_t u0;      uint32_t u1:24;  uint32_t u2;    uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_240 { uint32_t u0;      uint32_t u1;     uint32_t u2:8;  uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_241 { uint32_t u0;      uint32_t u1;     uint32_t u2:8;  uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_242 { uint32_t u0;      uint32_t u1;     uint32_t u2:8;  uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_243 { uint32_t u0;      uint32_t u1;     uint32_t u2:8;  uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_244 { uint32_t u0;      uint32_t u1;     uint32_t u2:16; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_245 { uint32_t u0;      uint32_t u1;     uint32_t u2:16; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_246 { uint32_t u0;      uint32_t u1;     uint32_t u2:16; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_247 { uint32_t u0;      uint32_t u1;     uint32_t u2:16; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_248 { uint32_t u0;      uint32_t u1;     uint32_t u2:24; uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_249 { uint32_t u0;      uint32_t u1;     uint32_t u2:24; uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_250 { uint32_t u0;      uint32_t u1;     uint32_t u2:24; uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_251 { uint32_t u0;      uint32_t u1;     uint32_t u2:24; uint32_t u3; };
     
    struct GROUP_VARINT_TYPE_252 { uint32_t u0;      uint32_t u1;     uint32_t u2;    uint32_t u3:8; };
    struct GROUP_VARINT_TYPE_253 { uint32_t u0;      uint32_t u1;     uint32_t u2;    uint32_t u3:16; };
    struct GROUP_VARINT_TYPE_254 { uint32_t u0;      uint32_t u1;     uint32_t u2;    uint32_t u3:24; };
    struct GROUP_VARINT_TYPE_255 { uint32_t u0;      uint32_t u1;     uint32_t u2;    uint32_t u3; };
    #pragma pack()
     
    /**
     * 将一个uint32整数 做 varint 编码 输出到 buf中
     *
     * @param value       输出的值
     * @param target      输出的缓冲 , 需确保buf 空间是够用的
     *
     * @return  target中下一个可用的字节位置
     */
    inline uint8_t *
    varint_encode_uint32 ( uint32_t value, uint8_t * target)
    {
        target[0] = (uint8_t)(value | 0x80);
     
        if ( value >= (1 << 7) )
        {
            target[1] = (uint8_t)( (value >>  7) | 0x80 );
     
            if ( value >= (1 << 14) )
            {
                target[2] = (uint8_t)( (value >> 14) | 0x80 );
     
                if ( value >= (1 << 21) )
                {
                    target[3] = (uint8_t)((value >> 21) | 0x80);
     
                    if ( value >= (1 << 28) )
                    {
                        target[4] = (uint8_t)(value >> 28);
                        return target + 5;
                    }
                    else
                    {
                        target[3] &= 0x7F;
                        return target + 4;
                    }
                }
                else
                {
                    target[2] &= 0x7F;
                    return target + 3;
                }
            }
            else
            {
                target[1] &= 0x7F;
                return target + 2;
            }
        }
        else
        {
            target[0] &= 0x7F;
            return target + 1;
        }
    }
     
    /**
     * 从buf中 将 varint压缩编码的值 还原读取出来
     * 需要确保输入的buf 从 输出的指针到结尾 超过  5个byte, 避免出现core
     * 函数内部不做边界检查
     *
     * @param buffer    输入的buf
     * @param value     输出的值
     *
     * @return  target中下一个可读的字节位置
     */
    inline const uint8_t *
    varint_decode_uint32(const uint8_t * buffer, uint32_t * value)
    {
        const uint8_t * ptr = buffer;
     
        uint32_t  i = 0;
        uint32_t  b;
        uint32_t  result;
     
        b = *(ptr++); result  = (b & 0x7F)      ; if (!(b & 0x80)) goto done;
        b = *(ptr++); result |= (b & 0x7F) <<  7; if (!(b & 0x80)) goto done;
        b = *(ptr++); result |= (b & 0x7F) << 14; if (!(b & 0x80)) goto done;
        b = *(ptr++); result |= (b & 0x7F) << 21; if (!(b & 0x80)) goto done;
        b = *(ptr++); result |=  b         << 28; if (!(b & 0x80)) goto done;
     
        for (; i < MAX_VARINT32_BYTES; i++)
        {
            b = *(ptr++); if (!(b & 0x80)) goto done;
        }
     
        return NULL;
    done:
        *value = result;
        return ptr;
    }
     
    /**
     * 对整数数组进行 group varint编码, 一次处理4个整数
     *
     * @param valueArr   无符号整数的数组  元素个数, 必须是4的倍数。 多余不处理
     * @param target     用于输出的buf . 需要确够大 ,  4个整数最多用 17个byte
     *
     * @return  target下一个可写byte
     */
    inline uint8_t *
    group_varint_encode_uint32 ( uint32_t * valueArr, uint8_t * target)
    {
        uint8_t len1 = 0;                  // 第  1 个数字用的 字节数
        uint8_t len2 = 0;                  // 第  2 个数字用的 字节数
        uint8_t len3 = 0;                  // 第  3 个数字用的 字节数
        uint8_t len4 = 0;                  // 第 4 个数字用的 字节数
        uint8_t len  = 0;                  // 4个数字总共用的 字节数
     
        uint8_t * buf = target + 1;
     
        if ( valueArr[0] < MAX_UINT8 )
        {
            len1   = 1;
            buf[0] = (uint8_t) valueArr[0];
        }
        else if ( valueArr[0] < MAX_UINT16 )
        {
            len1 = 2;
            ((uint16_t *)(buf))[0] = (uint16_t) valueArr[0];
        }
        else if ( valueArr[0] < MAX_UINT24 )
        {
            len1 = 3;
            ((uint32_t *)(buf))[0] = ( valueArr[0] );
        } else  {
            len1 = 4;
            ((uint32_t *)(buf))[0] = valueArr[0];
        }
        len = len1;
     
        /*  处理第二个数字   */
        if ( valueArr[1] < MAX_UINT8 )
        {
            len2 = 1;
            buf[len] = (uint8_t) valueArr[1];
        }
        else if ( valueArr[1] < MAX_UINT16 )
        {
            len2 = 2;
            ((uint16_t *)(buf + len))[0] = (uint16_t) valueArr[1];
        }
        else if ( valueArr[1] < MAX_UINT24 )
        {
            len2 = 3;
            ((uint32_t *)(buf + len))[0] = ( valueArr[1] );
        } else  {
            len2 = 4;
            ((uint32_t *)(buf + len))[0] = valueArr[1];
        }
        len = len + len2;
     
        /*  处理第3个数字   */
        if ( valueArr[2] < MAX_UINT8 )
        {
            len3 = 1;
            buf[len] = (uint8_t) valueArr[2];
        }
        else if ( valueArr[2] < MAX_UINT16 )
        {
            len3 = 2;
            ((uint16_t *)(buf + len))[0] = (uint16_t) valueArr[2];
        }
        else if ( valueArr[2] < MAX_UINT24 )
        {
            len3 = 3;
            ((uint32_t *)(buf + len))[0] = ( valueArr[2] );
        } else  {
            len3 = 4;
            ((uint32_t *)(buf + len))[0] = valueArr[2];
        }
        len = len + len3;
     
        /*  处理第4个数字   */
        if ( valueArr[3] < MAX_UINT8 )
        {
            len4 = 1;
            buf[len] = (uint8_t) valueArr[3];
        }
        else if ( valueArr[3] < MAX_UINT16 )
        {
            len4 = 2;
            ((uint16_t *)(buf + len))[0] = (uint16_t) valueArr[3];
        }
        else if ( valueArr[3] < MAX_UINT24 )
        {
            len4 = 3;
            ((uint32_t *)(buf + len))[0] = ( valueArr[3] );
        } else  {
            len4 = 4;
            ((uint32_t *)(buf + len))[0] = valueArr[3];
        }
        len = len + len4;
     
        /* 处理第一个索引字节 */
        target[0] = ((len1 - 1) << 6) | ((len2 - 1) << 4) | ((len3 - 1) << 2) | (len4 - 1);
     
        return buf + len;
    }
     
    /**
     * 对输入的buf进行解压, 每次一定解压出4个整数
     *
     * @param buf      输入的buf
     * @param valueArr    输出的数组,  需要预先开辟为4个整数的数组
     *
     * @return target下一个可读byte
     */
    inline const uint8_t *
    group_varint_decode_uint32 ( const uint8_t * buf, uint32_t * valueArr)
    {
        const uint8_t * star = buf + 1;
     
        switch ( buf[0] )
        {
            case 0  :  GROUP_VARINT_DECODE(0);    break;
            case 1  :  GROUP_VARINT_DECODE(1);    break;
            case 2  :  GROUP_VARINT_DECODE(2);    break;
            case 3  :  GROUP_VARINT_DECODE(3);    break;
            case 4  :  GROUP_VARINT_DECODE(4);    break;
            case 5  :  GROUP_VARINT_DECODE(5);    break;
            case 6  :  GROUP_VARINT_DECODE(6);    break;
            case 7  :  GROUP_VARINT_DECODE(7);    break;
            case 8  :  GROUP_VARINT_DECODE(8);    break;
            case 9  :  GROUP_VARINT_DECODE(9);    break;
            case 10 :  GROUP_VARINT_DECODE(10);   break;
            case 11 :  GROUP_VARINT_DECODE(11);   break;
            case 12 :  GROUP_VARINT_DECODE(12);   break;
            case 13 :  GROUP_VARINT_DECODE(13);   break;
            case 14 :  GROUP_VARINT_DECODE(14);   break;
            case 15 :  GROUP_VARINT_DECODE(15);   break;
            case 16 :  GROUP_VARINT_DECODE(16);   break;
            case 17 :  GROUP_VARINT_DECODE(17);   break;
            case 18 :  GROUP_VARINT_DECODE(18);   break;
            case 19 :  GROUP_VARINT_DECODE(19);   break;
            case 20 :  GROUP_VARINT_DECODE(20);   break;
            case 21 :  GROUP_VARINT_DECODE(21);   break;
            case 22 :  GROUP_VARINT_DECODE(22);   break;
            case 23 :  GROUP_VARINT_DECODE(23);   break;
            case 24 :  GROUP_VARINT_DECODE(24);   break;
            case 25 :  GROUP_VARINT_DECODE(25);   break;
            case 26 :  GROUP_VARINT_DECODE(26);   break;
            case 27 :  GROUP_VARINT_DECODE(27);   break;
            case 28 :  GROUP_VARINT_DECODE(28);   break;
            case 29 :  GROUP_VARINT_DECODE(29);   break;
            case 30 :  GROUP_VARINT_DECODE(30);   break;
            case 31 :  GROUP_VARINT_DECODE(31);   break;
            case 32 :  GROUP_VARINT_DECODE(32);   break;
            case 33 :  GROUP_VARINT_DECODE(33);   break;
            case 34 :  GROUP_VARINT_DECODE(34);   break;
            case 35 :  GROUP_VARINT_DECODE(35);   break;
            case 36 :  GROUP_VARINT_DECODE(36);   break;
            case 37 :  GROUP_VARINT_DECODE(37);   break;
            case 38 :  GROUP_VARINT_DECODE(38);   break;
            case 39 :  GROUP_VARINT_DECODE(39);   break;
            case 40 :  GROUP_VARINT_DECODE(40);   break;
            case 41 :  GROUP_VARINT_DECODE(41);   break;
            case 42 :  GROUP_VARINT_DECODE(42);   break;
            case 43 :  GROUP_VARINT_DECODE(43);   break;
            case 44 :  GROUP_VARINT_DECODE(44);   break;
            case 45 :  GROUP_VARINT_DECODE(45);   break;
            case 46 :  GROUP_VARINT_DECODE(46);   break;
            case 47 :  GROUP_VARINT_DECODE(47);   break;
            case 48 :  GROUP_VARINT_DECODE(48);   break;
            case 49 :  GROUP_VARINT_DECODE(49);   break;
            case 50 :  GROUP_VARINT_DECODE(50);   break;
            case 51 :  GROUP_VARINT_DECODE(51);   break;
            case 52 :  GROUP_VARINT_DECODE(52);   break;
            case 53 :  GROUP_VARINT_DECODE(53);   break;
            case 54 :  GROUP_VARINT_DECODE(54);   break;
            case 55 :  GROUP_VARINT_DECODE(55);   break;
            case 56 :  GROUP_VARINT_DECODE(56);   break;
            case 57 :  GROUP_VARINT_DECODE(57);   break;
            case 58 :  GROUP_VARINT_DECODE(58);   break;
            case 59 :  GROUP_VARINT_DECODE(59);   break;
            case 60 :  GROUP_VARINT_DECODE(60);   break;
            case 61 :  GROUP_VARINT_DECODE(61);   break;
            case 62 :  GROUP_VARINT_DECODE(62);   break;
            case 63 :  GROUP_VARINT_DECODE(63);   break;
            case 64 :  GROUP_VARINT_DECODE(64);   break;
            case 65 :  GROUP_VARINT_DECODE(65);   break;
            case 66 :  GROUP_VARINT_DECODE(66);   break;
            case 67 :  GROUP_VARINT_DECODE(67);   break;
            case 68 :  GROUP_VARINT_DECODE(68);   break;
            case 69 :  GROUP_VARINT_DECODE(69);   break;
            case 70 :  GROUP_VARINT_DECODE(70);   break;
            case 71 :  GROUP_VARINT_DECODE(71);   break;
            case 72 :  GROUP_VARINT_DECODE(72);   break;
            case 73 :  GROUP_VARINT_DECODE(73);   break;
            case 74 :  GROUP_VARINT_DECODE(74);   break;
            case 75 :  GROUP_VARINT_DECODE(75);   break;
            case 76 :  GROUP_VARINT_DECODE(76);   break;
            case 77 :  GROUP_VARINT_DECODE(77);   break;
            case 78 :  GROUP_VARINT_DECODE(78);   break;
            case 79 :  GROUP_VARINT_DECODE(79);   break;
            case 80 :  GROUP_VARINT_DECODE(80);   break;
            case 81 :  GROUP_VARINT_DECODE(81);   break;
            case 82 :  GROUP_VARINT_DECODE(82);   break;
            case 83 :  GROUP_VARINT_DECODE(83);   break;
            case 84 :  GROUP_VARINT_DECODE(84);   break;
            case 85 :  GROUP_VARINT_DECODE(85);   break;
            case 86 :  GROUP_VARINT_DECODE(86);   break;
            case 87 :  GROUP_VARINT_DECODE(87);   break;
            case 88 :  GROUP_VARINT_DECODE(88);   break;
            case 89 :  GROUP_VARINT_DECODE(89);   break;
            case 90 :  GROUP_VARINT_DECODE(90);   break;
            case 91 :  GROUP_VARINT_DECODE(91);   break;
            case 92 :  GROUP_VARINT_DECODE(92);   break;
            case 93 :  GROUP_VARINT_DECODE(93);   break;
            case 94 :  GROUP_VARINT_DECODE(94);   break;
            case 95 :  GROUP_VARINT_DECODE(95);   break;
            case 96 :  GROUP_VARINT_DECODE(96);   break;
            case 97 :  GROUP_VARINT_DECODE(97);   break;
            case 98 :  GROUP_VARINT_DECODE(98);   break;
            case 99 :  GROUP_VARINT_DECODE(99);   break;
            case 100 :  GROUP_VARINT_DECODE(100);   break;
            case 101 :  GROUP_VARINT_DECODE(101);   break;
            case 102 :  GROUP_VARINT_DECODE(102);   break;
            case 103 :  GROUP_VARINT_DECODE(103);   break;
            case 104 :  GROUP_VARINT_DECODE(104);   break;
            case 105 :  GROUP_VARINT_DECODE(105);   break;
            case 106 :  GROUP_VARINT_DECODE(106);   break;
            case 107 :  GROUP_VARINT_DECODE(107);   break;
            case 108 :  GROUP_VARINT_DECODE(108);   break;
            case 109 :  GROUP_VARINT_DECODE(109);   break;
            case 110 :  GROUP_VARINT_DECODE(110);   break;
            case 111 :  GROUP_VARINT_DECODE(111);   break;
            case 112 :  GROUP_VARINT_DECODE(112);   break;
            case 113 :  GROUP_VARINT_DECODE(113);   break;
            case 114 :  GROUP_VARINT_DECODE(114);   break;
            case 115 :  GROUP_VARINT_DECODE(115);   break;
            case 116 :  GROUP_VARINT_DECODE(116);   break;
            case 117 :  GROUP_VARINT_DECODE(117);   break;
            case 118 :  GROUP_VARINT_DECODE(118);   break;
            case 119 :  GROUP_VARINT_DECODE(119);   break;
            case 120 :  GROUP_VARINT_DECODE(120);   break;
            case 121 :  GROUP_VARINT_DECODE(121);   break;
            case 122 :  GROUP_VARINT_DECODE(122);   break;
            case 123 :  GROUP_VARINT_DECODE(123);   break;
            case 124 :  GROUP_VARINT_DECODE(124);   break;
            case 125 :  GROUP_VARINT_DECODE(125);   break;
            case 126 :  GROUP_VARINT_DECODE(126);   break;
            case 127 :  GROUP_VARINT_DECODE(127);   break;
            case 128 :  GROUP_VARINT_DECODE(128);   break;
            case 129 :  GROUP_VARINT_DECODE(129);   break;
            case 130 :  GROUP_VARINT_DECODE(130);   break;
            case 131 :  GROUP_VARINT_DECODE(131);   break;
            case 132 :  GROUP_VARINT_DECODE(132);   break;
            case 133 :  GROUP_VARINT_DECODE(133);   break;
            case 134 :  GROUP_VARINT_DECODE(134);   break;
            case 135 :  GROUP_VARINT_DECODE(135);   break;
            case 136 :  GROUP_VARINT_DECODE(136);   break;
            case 137 :  GROUP_VARINT_DECODE(137);   break;
            case 138 :  GROUP_VARINT_DECODE(138);   break;
            case 139 :  GROUP_VARINT_DECODE(139);   break;
            case 140 :  GROUP_VARINT_DECODE(140);   break;
            case 141 :  GROUP_VARINT_DECODE(141);   break;
            case 142 :  GROUP_VARINT_DECODE(142);   break;
            case 143 :  GROUP_VARINT_DECODE(143);   break;
            case 144 :  GROUP_VARINT_DECODE(144);   break;
            case 145 :  GROUP_VARINT_DECODE(145);   break;
            case 146 :  GROUP_VARINT_DECODE(146);   break;
            case 147 :  GROUP_VARINT_DECODE(147);   break;
            case 148 :  GROUP_VARINT_DECODE(148);   break;
            case 149 :  GROUP_VARINT_DECODE(149);   break;
            case 150 :  GROUP_VARINT_DECODE(150);   break;
            case 151 :  GROUP_VARINT_DECODE(151);   break;
            case 152 :  GROUP_VARINT_DECODE(152);   break;
            case 153 :  GROUP_VARINT_DECODE(153);   break;
            case 154 :  GROUP_VARINT_DECODE(154);   break;
            case 155 :  GROUP_VARINT_DECODE(155);   break;
            case 156 :  GROUP_VARINT_DECODE(156);   break;
            case 157 :  GROUP_VARINT_DECODE(157);   break;
            case 158 :  GROUP_VARINT_DECODE(158);   break;
            case 159 :  GROUP_VARINT_DECODE(159);   break;
            case 160 :  GROUP_VARINT_DECODE(160);   break;
            case 161 :  GROUP_VARINT_DECODE(161);   break;
            case 162 :  GROUP_VARINT_DECODE(162);   break;
            case 163 :  GROUP_VARINT_DECODE(163);   break;
            case 164 :  GROUP_VARINT_DECODE(164);   break;
            case 165 :  GROUP_VARINT_DECODE(165);   break;
            case 166 :  GROUP_VARINT_DECODE(166);   break;
            case 167 :  GROUP_VARINT_DECODE(167);   break;
            case 168 :  GROUP_VARINT_DECODE(168);   break;
            case 169 :  GROUP_VARINT_DECODE(169);   break;
            case 170 :  GROUP_VARINT_DECODE(170);   break;
            case 171 :  GROUP_VARINT_DECODE(171);   break;
            case 172 :  GROUP_VARINT_DECODE(172);   break;
            case 173 :  GROUP_VARINT_DECODE(173);   break;
            case 174 :  GROUP_VARINT_DECODE(174);   break;
            case 175 :  GROUP_VARINT_DECODE(175);   break;
            case 176 :  GROUP_VARINT_DECODE(176);   break;
            case 177 :  GROUP_VARINT_DECODE(177);   break;
            case 178 :  GROUP_VARINT_DECODE(178);   break;
            case 179 :  GROUP_VARINT_DECODE(179);   break;
            case 180 :  GROUP_VARINT_DECODE(180);   break;
            case 181 :  GROUP_VARINT_DECODE(181);   break;
            case 182 :  GROUP_VARINT_DECODE(182);   break;
            case 183 :  GROUP_VARINT_DECODE(183);   break;
            case 184 :  GROUP_VARINT_DECODE(184);   break;
            case 185 :  GROUP_VARINT_DECODE(185);   break;
            case 186 :  GROUP_VARINT_DECODE(186);   break;
            case 187 :  GROUP_VARINT_DECODE(187);   break;
            case 188 :  GROUP_VARINT_DECODE(188);   break;
            case 189 :  GROUP_VARINT_DECODE(189);   break;
            case 190 :  GROUP_VARINT_DECODE(190);   break;
            case 191 :  GROUP_VARINT_DECODE(191);   break;
            case 192 :  GROUP_VARINT_DECODE(192);   break;
            case 193 :  GROUP_VARINT_DECODE(193);   break;
            case 194 :  GROUP_VARINT_DECODE(194);   break;
            case 195 :  GROUP_VARINT_DECODE(195);   break;
            case 196 :  GROUP_VARINT_DECODE(196);   break;
            case 197 :  GROUP_VARINT_DECODE(197);   break;
            case 198 :  GROUP_VARINT_DECODE(198);   break;
            case 199 :  GROUP_VARINT_DECODE(199);   break;
            case 200 :  GROUP_VARINT_DECODE(200);   break;
            case 201 :  GROUP_VARINT_DECODE(201);   break;
            case 202 :  GROUP_VARINT_DECODE(202);   break;
            case 203 :  GROUP_VARINT_DECODE(203);   break;
            case 204 :  GROUP_VARINT_DECODE(204);   break;
            case 205 :  GROUP_VARINT_DECODE(205);   break;
            case 206 :  GROUP_VARINT_DECODE(206);   break;
            case 207 :  GROUP_VARINT_DECODE(207);   break;
            case 208 :  GROUP_VARINT_DECODE(208);   break;
            case 209 :  GROUP_VARINT_DECODE(209);   break;
            case 210 :  GROUP_VARINT_DECODE(210);   break;
            case 211 :  GROUP_VARINT_DECODE(211);   break;
            case 212 :  GROUP_VARINT_DECODE(212);   break;
            case 213 :  GROUP_VARINT_DECODE(213);   break;
            case 214 :  GROUP_VARINT_DECODE(214);   break;
            case 215 :  GROUP_VARINT_DECODE(215);   break;
            case 216 :  GROUP_VARINT_DECODE(216);   break;
            case 217 :  GROUP_VARINT_DECODE(217);   break;
            case 218 :  GROUP_VARINT_DECODE(218);   break;
            case 219 :  GROUP_VARINT_DECODE(219);   break;
            case 220 :  GROUP_VARINT_DECODE(220);   break;
            case 221 :  GROUP_VARINT_DECODE(221);   break;
            case 222 :  GROUP_VARINT_DECODE(222);   break;
            case 223 :  GROUP_VARINT_DECODE(223);   break;
            case 224 :  GROUP_VARINT_DECODE(224);   break;
            case 225 :  GROUP_VARINT_DECODE(225);   break;
            case 226 :  GROUP_VARINT_DECODE(226);   break;
            case 227 :  GROUP_VARINT_DECODE(227);   break;
            case 228 :  GROUP_VARINT_DECODE(228);   break;
            case 229 :  GROUP_VARINT_DECODE(229);   break;
            case 230 :  GROUP_VARINT_DECODE(230);   break;
            case 231 :  GROUP_VARINT_DECODE(231);   break;
            case 232 :  GROUP_VARINT_DECODE(232);   break;
            case 233 :  GROUP_VARINT_DECODE(233);   break;
            case 234 :  GROUP_VARINT_DECODE(234);   break;
            case 235 :  GROUP_VARINT_DECODE(235);   break;
            case 236 :  GROUP_VARINT_DECODE(236);   break;
            case 237 :  GROUP_VARINT_DECODE(237);   break;
            case 238 :  GROUP_VARINT_DECODE(238);   break;
            case 239 :  GROUP_VARINT_DECODE(239);   break;
            case 240 :  GROUP_VARINT_DECODE(240);   break;
            case 241 :  GROUP_VARINT_DECODE(241);   break;
            case 242 :  GROUP_VARINT_DECODE(242);   break;
            case 243 :  GROUP_VARINT_DECODE(243);   break;
            case 244 :  GROUP_VARINT_DECODE(244);   break;
            case 245 :  GROUP_VARINT_DECODE(245);   break;
            case 246 :  GROUP_VARINT_DECODE(246);   break;
            case 247 :  GROUP_VARINT_DECODE(247);   break;
            case 248 :  GROUP_VARINT_DECODE(248);   break;
            case 249 :  GROUP_VARINT_DECODE(249);   break;
            case 250 :  GROUP_VARINT_DECODE(250);   break;
            case 251 :  GROUP_VARINT_DECODE(251);   break;
            case 252 :  GROUP_VARINT_DECODE(252);   break;
            case 253 :  GROUP_VARINT_DECODE(253);   break;
            case 254 :  GROUP_VARINT_DECODE(254);   break;
            case 255 :  GROUP_VARINT_DECODE(255);   break;
        }
     
        return buf + GROUP_VARINT_IDX_ARR[ buf[0] ][4];
    }
     
    /**
     * 对整数进行 zigZag编码,  有符号数 转换为 无符号数
     *
     * @param n  有符号数
     *
     * @return   无符号数
     */
    inline uint32_t zigZag_encode32(int32_t  n) { return (n << 1) ^ (n >> 31);         }
    inline uint64_t zigZag_encode64(int64_t  n) { return (n << 1) ^ (n >> 63);         }
     
    /**
     * 对整数进行 zigZag 解码,  无符号数 转换为 有符号数
     *
     * @param n  无符号数
     *
     * @return   有符号数
     */
    inline int32_t  zigZag_decode32(uint32_t n) { return (n >> 1) ^ -(int32_t)(n & 1); }
    inline int64_t  zigZag_decode64(uint64_t n) { return (n >> 1) ^ -(int64_t)(n & 1); }
     
    }
     
    #endif /* VARINT_H_ */
  • 相关阅读:
    java中的多线程
    PSCollectionView瀑布流实现
    直接拿来用!最火的iOS开源项目(一~三)
    iOS6新特征:UICollectionView介绍
    mac os颜色拾取工具/软件/器推荐
    ios/object-c中的UIColor一些比较偏的颜色展示/示例
    UIColor和 同 CIColor 与 CGColor 之间的联系、转换
    IOS开发自定义CheckBox控件
    IOS常用的第三方开发库
    JVM -XX: 参数介绍
  • 原文地址:https://www.cnblogs.com/shihao/p/2453197.html
Copyright © 2020-2023  润新知