github.com/fraugster/parquet-go@v0.12.0/bitpacking32_test.go (about)

     1  package goparquet
     2  
     3  // This file is based on the code from https://github.com/kostya-sh/parquet-go
     4  // Copyright (c) 2015 Konstantin Shaposhnikov
     5  
     6  import (
     7  	"bytes"
     8  	"testing"
     9  )
    10  
    11  func TestUnpack8int32(t *testing.T) {
    12  	for _, test := range unpack8int32Tests {
    13  		unpacker := unpack8Int32FuncByWidth[test.width]
    14  		if got := unpacker(test.data); got != test.values {
    15  			t.Errorf("unpack for width %d: got %v, want %v", test.width, got, test.values)
    16  		}
    17  
    18  		packer := pack8Int32FuncByWidth[test.width]
    19  		if got := packer(test.values); !bytes.Equal(got, test.data) {
    20  			t.Errorf("pack for width %d: got %v, want %v", test.width, got, test.data)
    21  		}
    22  	}
    23  }
    24  
    25  var unpack8int32Tests = []struct {
    26  	width  int
    27  	data   []byte
    28  	values [8]int32
    29  }{
    30  	// bit width = 0
    31  	{0, []byte{}, [8]int32{0, 0, 0, 0, 0, 0, 0, 0}},
    32  
    33  	// bit width = 1
    34  	{1, []byte{0x00}, [8]int32{0, 0, 0, 0, 0, 0, 0, 0}},
    35  	{1, []byte{0xFF}, [8]int32{1, 1, 1, 1, 1, 1, 1, 1}},
    36  	{1, []byte{0x4D}, [8]int32{1, 0, 1, 1, 0, 0, 1, 0}},
    37  
    38  	// bit width = 2
    39  	{2, []byte{0x55, 0x55}, [8]int32{1, 1, 1, 1, 1, 1, 1, 1}},
    40  	{2, []byte{0xAA, 0xAA}, [8]int32{2, 2, 2, 2, 2, 2, 2, 2}},
    41  	{2, []byte{0xA4, 0x41}, [8]int32{0, 1, 2, 2, 1, 0, 0, 1}},
    42  
    43  	// bit width = 3
    44  	{3, []byte{0x00, 0x00, 0x00}, [8]int32{0, 0, 0, 0, 0, 0, 0, 0}},
    45  	{3, []byte{0x88, 0xC6, 0xFA}, [8]int32{0, 1, 2, 3, 4, 5, 6, 7}},
    46  	{3, []byte{0x77, 0x39, 0x05}, [8]int32{7, 6, 5, 4, 3, 2, 1, 0}},
    47  	{3, []byte{0x23, 0xA2, 0x11}, [8]int32{3, 4, 0, 1, 2, 3, 4, 0}},
    48  
    49  	// bit width = 4
    50  	{4, []byte{0x00, 0x00, 0x00, 0x00}, [8]int32{0, 0, 0, 0, 0, 0, 0, 0}},
    51  	{4, []byte{0x10, 0x32, 0x54, 0x76}, [8]int32{0, 1, 2, 3, 4, 5, 6, 7}},
    52  	{4, []byte{0x67, 0x45, 0x23, 0x01}, [8]int32{7, 6, 5, 4, 3, 2, 1, 0}},
    53  	{4, []byte{0xEF, 0xCD, 0xAB, 0x89}, [8]int32{15, 14, 13, 12, 11, 10, 9, 8}},
    54  
    55  	// bit width = 5
    56  	{5, []byte{0x00, 0x00, 0x00, 0x00, 0x00}, [8]int32{0, 0, 0, 0, 0, 0, 0, 0}},
    57  	{5, []byte{0x20, 0x88, 0x41, 0x8A, 0x39}, [8]int32{0, 1, 2, 3, 4, 5, 6, 7}},
    58  	{5, []byte{0xC7, 0x14, 0x32, 0x44, 0x00}, [8]int32{7, 6, 5, 4, 3, 2, 1, 0}},
    59  	{5, []byte{0xDF, 0x77, 0xBE, 0x75, 0xC6}, [8]int32{31, 30, 29, 28, 27, 26, 25, 24}},
    60  
    61  	// bit width = 6
    62  	{
    63  		6,
    64  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    65  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
    66  	},
    67  	{
    68  		6,
    69  		[]byte{0x40, 0x20, 0x0C, 0x44, 0x61, 0x1C},
    70  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
    71  	},
    72  	{
    73  		6,
    74  		[]byte{0x87, 0x51, 0x10, 0x83, 0x10, 0x00},
    75  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
    76  	},
    77  	{
    78  		6,
    79  		[]byte{0xBF, 0xDF, 0xF3, 0xBB, 0x9E, 0xE3},
    80  		[8]int32{63, 62, 61, 60, 59, 58, 57, 56},
    81  	},
    82  
    83  	// bit width = 7
    84  	{
    85  		7,
    86  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    87  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
    88  	},
    89  	{
    90  		7,
    91  		[]byte{0x80, 0x80, 0x60, 0x40, 0x28, 0x18, 0x0E},
    92  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
    93  	},
    94  	{
    95  		7,
    96  		[]byte{0x07, 0x43, 0x81, 0x30, 0x10, 0x04, 0x00},
    97  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
    98  	},
    99  	{
   100  		7,
   101  		[]byte{0x7F, 0x7F, 0x9F, 0xBF, 0xD7, 0xE7, 0xF1},
   102  		[8]int32{127, 126, 125, 124, 123, 122, 121, 120},
   103  	},
   104  
   105  	// bit width = 8
   106  	{
   107  		8,
   108  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   109  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   110  	},
   111  	{
   112  		8,
   113  		[]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
   114  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   115  	},
   116  	{
   117  		8,
   118  		[]byte{0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00},
   119  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   120  	},
   121  	{
   122  		8,
   123  		[]byte{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8},
   124  		[8]int32{255, 254, 253, 252, 251, 250, 249, 248},
   125  	},
   126  
   127  	// bit width = 9
   128  	{
   129  		9,
   130  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   131  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   132  	},
   133  	{
   134  		9,
   135  		[]byte{0x00, 0x02, 0x08, 0x18, 0x40, 0xA0, 0x80, 0x81, 0x03},
   136  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   137  	},
   138  	{
   139  		9,
   140  		[]byte{0x07, 0x0C, 0x14, 0x20, 0x30, 0x40, 0x40, 0x00, 0x00},
   141  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   142  	},
   143  	{
   144  		9,
   145  		[]byte{0xFF, 0xFD, 0xF7, 0xE7, 0xBF, 0x5F, 0x7F, 0x7E, 0xFC},
   146  		[8]int32{511, 510, 509, 508, 507, 506, 505, 504},
   147  	},
   148  
   149  	// bit width = 10
   150  	{
   151  		10,
   152  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   153  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   154  	},
   155  	{
   156  		10,
   157  		[]byte{0x00, 0x04, 0x20, 0xC0, 0x00, 0x04, 0x14, 0x60, 0xC0, 0x01},
   158  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   159  	},
   160  	{
   161  		10,
   162  		[]byte{0x07, 0x18, 0x50, 0x00, 0x01, 0x03, 0x08, 0x10, 0x00, 0x00},
   163  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   164  	},
   165  	{
   166  		10,
   167  		[]byte{0xFF, 0xFB, 0xDF, 0x3F, 0xFF, 0xFB, 0xEB, 0x9F, 0x3F, 0xFE},
   168  		[8]int32{1023, 1022, 1021, 1020, 1019, 1018, 1017, 1016},
   169  	},
   170  
   171  	// bit width = 11
   172  	{
   173  		11,
   174  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   175  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   176  	},
   177  	{
   178  		11,
   179  		[]byte{0x00, 0x08, 0x80, 0x00, 0x06, 0x40, 0x80, 0x02, 0x18, 0xE0, 0x00},
   180  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   181  	},
   182  	{
   183  		11,
   184  		[]byte{0x07, 0x30, 0x40, 0x01, 0x08, 0x30, 0x00, 0x01, 0x04, 0x00, 0x00},
   185  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   186  	},
   187  	{
   188  		11,
   189  		[]byte{0xFF, 0xF7, 0x7F, 0xFF, 0xF9, 0xBF, 0x7F, 0xFD, 0xE7, 0x1F, 0xFF},
   190  		[8]int32{2047, 2046, 2045, 2044, 2043, 2042, 2041, 2040},
   191  	},
   192  
   193  	// bit width = 12
   194  	{
   195  		12,
   196  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   197  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   198  	},
   199  	{
   200  		12,
   201  		[]byte{0x00, 0x10, 0x00, 0x02, 0x30, 0x00, 0x04, 0x50, 0x00, 0x06, 0x70, 0x00},
   202  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   203  	},
   204  	{
   205  		12,
   206  		[]byte{0x07, 0x60, 0x00, 0x05, 0x40, 0x00, 0x03, 0x20, 0x00, 0x01, 0x00, 0x00},
   207  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   208  	},
   209  	{
   210  		12,
   211  		[]byte{0xFF, 0xEF, 0xFF, 0xFD, 0xCF, 0xFF, 0xFB, 0xAF, 0xFF, 0xF9, 0x8F, 0xFF},
   212  		[8]int32{4095, 4094, 4093, 4092, 4091, 4090, 4089, 4088},
   213  	},
   214  
   215  	// bit width = 13
   216  	{
   217  		13,
   218  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   219  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   220  	},
   221  	{
   222  		13,
   223  		[]byte{0x00, 0x20, 0x00, 0x08, 0x80, 0x01, 0x40, 0x00, 0x0A, 0x80, 0x01, 0x38, 0x00},
   224  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   225  	},
   226  	{
   227  		13,
   228  		[]byte{0x07, 0xC0, 0x00, 0x14, 0x00, 0x02, 0x30, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00},
   229  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   230  	},
   231  	{
   232  		13,
   233  		[]byte{0xFF, 0xDF, 0xFF, 0xF7, 0x7F, 0xFE, 0xBF, 0xFF, 0xF5, 0x7F, 0xFE, 0xC7, 0xFF},
   234  		[8]int32{8191, 8190, 8189, 8188, 8187, 8186, 8185, 8184},
   235  	},
   236  
   237  	// bit width = 14
   238  	{
   239  		14,
   240  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   241  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   242  	},
   243  	{
   244  		14,
   245  		[]byte{0x00, 0x40, 0x00, 0x20, 0x00, 0x0C, 0x00, 0x04, 0x40, 0x01, 0x60, 0x00, 0x1C, 0x00},
   246  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   247  	},
   248  	{
   249  		14,
   250  		[]byte{0x07, 0x80, 0x01, 0x50, 0x00, 0x10, 0x00, 0x03, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00},
   251  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   252  	},
   253  	{
   254  		14,
   255  		[]byte{0xFF, 0xBF, 0xFF, 0xDF, 0xFF, 0xF3, 0xFF, 0xFB, 0xBF, 0xFE, 0x9F, 0xFF, 0xE3, 0xFF},
   256  		[8]int32{16383, 16382, 16381, 16380, 16379, 16378, 16377, 16376},
   257  	},
   258  
   259  	// bit width = 15
   260  	{
   261  		15,
   262  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   263  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   264  	},
   265  	{
   266  		15,
   267  		[]byte{0x00, 0x80, 0x00, 0x80, 0x00, 0x60, 0x00, 0x40, 0x00, 0x28, 0x00, 0x18, 0x00, 0x0E, 0x00},
   268  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   269  	},
   270  	{
   271  		15,
   272  		[]byte{0x07, 0x00, 0x03, 0x40, 0x01, 0x80, 0x00, 0x30, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00},
   273  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   274  	},
   275  	{
   276  		15,
   277  		[]byte{0xFF, 0x7F, 0xFF, 0x7F, 0xFF, 0x9F, 0xFF, 0xBF, 0xFF, 0xD7, 0xFF, 0xE7, 0xFF, 0xF1, 0xFF},
   278  		[8]int32{32767, 32766, 32765, 32764, 32763, 32762, 32761, 32760},
   279  	},
   280  
   281  	// bit width = 16
   282  	{
   283  		16,
   284  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   285  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   286  	},
   287  	{
   288  		16,
   289  		[]byte{0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00},
   290  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   291  	},
   292  	{
   293  		16,
   294  		[]byte{0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x04, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00},
   295  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   296  	},
   297  	{
   298  		16,
   299  		[]byte{0xFF, 0xFF, 0xFE, 0xFF, 0xFD, 0xFF, 0xFC, 0xFF, 0xFB, 0xFF, 0xFA, 0xFF, 0xF9, 0xFF, 0xF8, 0xFF},
   300  		[8]int32{65535, 65534, 65533, 65532, 65531, 65530, 65529, 65528},
   301  	},
   302  
   303  	// bit width = 17
   304  	{
   305  		17,
   306  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   307  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   308  	},
   309  	{
   310  		17,
   311  		[]byte{0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x18, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x80, 0x01, 0x80, 0x03, 0x00},
   312  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   313  	},
   314  	{
   315  		17,
   316  		[]byte{0x07, 0x00, 0x0C, 0x00, 0x14, 0x00, 0x20, 0x00, 0x30, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00},
   317  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   318  	},
   319  	{
   320  		17,
   321  		[]byte{0xFF, 0xFF, 0xFD, 0xFF, 0xF7, 0xFF, 0xE7, 0xFF, 0xBF, 0xFF, 0x5F, 0xFF, 0x7F, 0xFE, 0x7F, 0xFC, 0xFF},
   322  		[8]int32{131071, 131070, 131069, 131068, 131067, 131066, 131065, 131064},
   323  	},
   324  
   325  	// bit width = 18
   326  	{
   327  		18,
   328  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   329  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   330  	},
   331  	{
   332  		18,
   333  		[]byte{0x00, 0x00, 0x04, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x00, 0x04, 0x00, 0x14, 0x00, 0x60, 0x00, 0xC0, 0x01, 0x00},
   334  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   335  	},
   336  	{
   337  		18,
   338  		[]byte{0x07, 0x00, 0x18, 0x00, 0x50, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00},
   339  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   340  	},
   341  	{
   342  		18,
   343  		[]byte{0xFF, 0xFF, 0xFB, 0xFF, 0xDF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFB, 0xFF, 0xEB, 0xFF, 0x9F, 0xFF, 0x3F, 0xFE, 0xFF},
   344  		[8]int32{262143, 262142, 262141, 262140, 262139, 262138, 262137, 262136},
   345  	},
   346  
   347  	// bit width = 19
   348  	{
   349  		19,
   350  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   351  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   352  	},
   353  	{
   354  		19,
   355  		[]byte{0x00, 0x00, 0x08, 0x00, 0x80, 0x00, 0x00, 0x06, 0x00, 0x40, 0x00, 0x80, 0x02, 0x00, 0x18, 0x00, 0xE0, 0x00, 0x00},
   356  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   357  	},
   358  	{
   359  		19,
   360  		[]byte{0x07, 0x00, 0x30, 0x00, 0x40, 0x01, 0x00, 0x08, 0x00, 0x30, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00},
   361  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   362  	},
   363  	{
   364  		19,
   365  		[]byte{0xFF, 0xFF, 0xF7, 0xFF, 0x7F, 0xFF, 0xFF, 0xF9, 0xFF, 0xBF, 0xFF, 0x7F, 0xFD, 0xFF, 0xE7, 0xFF, 0x1F, 0xFF, 0xFF},
   366  		[8]int32{524287, 524286, 524285, 524284, 524283, 524282, 524281, 524280},
   367  	},
   368  
   369  	// bit width = 20
   370  	{
   371  		20,
   372  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   373  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   374  	},
   375  	{
   376  		20,
   377  		[]byte{0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x30, 0x00, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x06, 0x00, 0x70, 0x00, 0x00},
   378  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   379  	},
   380  	{
   381  		20,
   382  		[]byte{0x07, 0x00, 0x60, 0x00, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00},
   383  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   384  	},
   385  	{
   386  		20,
   387  		[]byte{0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xCF, 0xFF, 0xFF, 0xFB, 0xFF, 0xAF, 0xFF, 0xFF, 0xF9, 0xFF, 0x8F, 0xFF, 0xFF},
   388  		[8]int32{1048575, 1048574, 1048573, 1048572, 1048571, 1048570, 1048569, 1048568},
   389  	},
   390  
   391  	// bit width = 21
   392  	{
   393  		21,
   394  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   395  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   396  	},
   397  	{
   398  		21,
   399  		[]byte{0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x80, 0x01, 0x00, 0x40, 0x00, 0x00, 0x0A, 0x00, 0x80, 0x01, 0x00, 0x38, 0x00, 0x00},
   400  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   401  	},
   402  	{
   403  		21,
   404  		[]byte{0x07, 0x00, 0xC0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x00, 0x30, 0x00, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00},
   405  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   406  	},
   407  	{
   408  		21,
   409  		[]byte{0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xF7, 0xFF, 0x7F, 0xFE, 0xFF, 0xBF, 0xFF, 0xFF, 0xF5, 0xFF, 0x7F, 0xFE, 0xFF, 0xC7, 0xFF, 0xFF},
   410  		[8]int32{2097151, 2097150, 2097149, 2097148, 2097147, 2097146, 2097145, 2097144},
   411  	},
   412  
   413  	// bit width = 22
   414  	{
   415  		22,
   416  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   417  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   418  	},
   419  	{
   420  		22,
   421  		[]byte{0x00, 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x04, 0x00, 0x40, 0x01, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x00},
   422  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   423  	},
   424  	{
   425  		22,
   426  		[]byte{0x07, 0x00, 0x80, 0x01, 0x00, 0x50, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00},
   427  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   428  	},
   429  	{
   430  		22,
   431  		[]byte{0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xF3, 0xFF, 0xFF, 0xFB, 0xFF, 0xBF, 0xFE, 0xFF, 0x9F, 0xFF, 0xFF, 0xE3, 0xFF, 0xFF},
   432  		[8]int32{4194303, 4194302, 4194301, 4194300, 4194299, 4194298, 4194297, 4194296},
   433  	},
   434  
   435  	// bit width = 23
   436  	{
   437  		23,
   438  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   439  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   440  	},
   441  	{
   442  		23,
   443  		[]byte{0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x60, 0x00, 0x00, 0x40, 0x00, 0x00, 0x28, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0E, 0x00, 0x00},
   444  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   445  	},
   446  	{
   447  		23,
   448  		[]byte{0x07, 0x00, 0x00, 0x03, 0x00, 0x40, 0x01, 0x00, 0x80, 0x00, 0x00, 0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00},
   449  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   450  	},
   451  	{
   452  		23,
   453  		[]byte{0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xD7, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF},
   454  		[8]int32{8388607, 8388606, 8388605, 8388604, 8388603, 8388602, 8388601, 8388600},
   455  	},
   456  
   457  	// bit width = 24
   458  	{
   459  		24,
   460  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   461  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   462  	},
   463  	{
   464  		24,
   465  		[]byte{0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x06, 0x00, 0x00, 0x07, 0x00, 0x00},
   466  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   467  	},
   468  	{
   469  		24,
   470  		[]byte{0x07, 0x00, 0x00, 0x06, 0x00, 0x00, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00},
   471  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   472  	},
   473  	{
   474  		24,
   475  		[]byte{0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF},
   476  		[8]int32{16777215, 16777214, 16777213, 16777212, 16777211, 16777210, 16777209, 16777208},
   477  	},
   478  
   479  	// bit width = 25
   480  	{
   481  		25,
   482  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   483  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   484  	},
   485  	{
   486  		25,
   487  		[]byte{0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x00, 0x00, 0x18, 0x00, 0x00, 0x40, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x80, 0x01, 0x00, 0x80, 0x03, 0x00, 0x00},
   488  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   489  	},
   490  	{
   491  		25,
   492  		[]byte{0x07, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   493  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   494  	},
   495  	{
   496  		25,
   497  		[]byte{0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF},
   498  		[8]int32{33554431, 33554430, 33554429, 33554428, 33554427, 33554426, 33554425, 33554424},
   499  	},
   500  
   501  	// bit width = 26
   502  	{
   503  		26,
   504  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   505  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   506  	},
   507  	{
   508  		26,
   509  		[]byte{0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x14, 0x00, 0x00, 0x60, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00},
   510  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   511  	},
   512  	{
   513  		26,
   514  		[]byte{0x07, 0x00, 0x00, 0x18, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   515  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   516  	},
   517  	{
   518  		26,
   519  		[]byte{0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xEB, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0x3F, 0xFE, 0xFF, 0xFF},
   520  		[8]int32{67108863, 67108862, 67108861, 67108860, 67108859, 67108858, 67108857, 67108856},
   521  	},
   522  
   523  	// bit width = 27
   524  	{
   525  		27,
   526  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   527  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   528  	},
   529  	{
   530  		27,
   531  		[]byte{0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x18, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00},
   532  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   533  	},
   534  	{
   535  		27,
   536  		[]byte{0x07, 0x00, 0x00, 0x30, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   537  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   538  	},
   539  	{
   540  		27,
   541  		[]byte{0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0x7F, 0xFD, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF},
   542  		[8]int32{134217727, 134217726, 134217725, 134217724, 134217723, 134217722, 134217721, 134217720},
   543  	},
   544  
   545  	// bit width = 28
   546  	{
   547  		28,
   548  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   549  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   550  	},
   551  	{
   552  		28,
   553  		[]byte{0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00},
   554  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   555  	},
   556  	{
   557  		28,
   558  		[]byte{0x07, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   559  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   560  	},
   561  	{
   562  		28,
   563  		[]byte{0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF},
   564  		[8]int32{268435455, 268435454, 268435453, 268435452, 268435451, 268435450, 268435449, 268435448},
   565  	},
   566  
   567  	// bit width = 29
   568  	{
   569  		29,
   570  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   571  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   572  	},
   573  	{
   574  		29,
   575  		[]byte{0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00},
   576  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   577  	},
   578  	{
   579  		29,
   580  		[]byte{0x07, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   581  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   582  	},
   583  	{
   584  		29,
   585  		[]byte{0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xC7, 0xFF, 0xFF, 0xFF},
   586  		[8]int32{536870911, 536870910, 536870909, 536870908, 536870907, 536870906, 536870905, 536870904},
   587  	},
   588  
   589  	// bit width = 30
   590  	{
   591  		30,
   592  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   593  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   594  	},
   595  	{
   596  		30,
   597  		[]byte{0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00},
   598  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   599  	},
   600  	{
   601  		30,
   602  		[]byte{0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   603  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   604  	},
   605  	{
   606  		30,
   607  		[]byte{0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xF3, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xBF, 0xFE, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF},
   608  		[8]int32{1073741823, 1073741822, 1073741821, 1073741820, 1073741819, 1073741818, 1073741817, 1073741816},
   609  	},
   610  
   611  	// bit width = 31
   612  	{
   613  		31,
   614  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   615  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   616  	},
   617  	{
   618  		31,
   619  		[]byte{0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00},
   620  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   621  	},
   622  	{
   623  		31,
   624  		[]byte{0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   625  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   626  	},
   627  	{
   628  		31,
   629  		[]byte{0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xD7, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF, 0xFF},
   630  		[8]int32{2147483647, 2147483646, 2147483645, 2147483644, 2147483643, 2147483642, 2147483641, 2147483640},
   631  	},
   632  
   633  	// bit width = 32
   634  	{
   635  		32,
   636  		[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   637  		[8]int32{0, 0, 0, 0, 0, 0, 0, 0},
   638  	},
   639  	{
   640  		32,
   641  		[]byte{0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00},
   642  		[8]int32{0, 1, 2, 3, 4, 5, 6, 7},
   643  	},
   644  	{
   645  		32,
   646  		[]byte{0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
   647  		[8]int32{7, 6, 5, 4, 3, 2, 1, 0},
   648  	},
   649  	{
   650  		32,
   651  		[]byte{0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF},
   652  		[8]int32{0, -1, -2, -3, -4, -5, -6, -7},
   653  	},
   654  }