aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-realmedia/src/codecs/rv60codes.rs
blob: 8effbb57daf8af616324a2c277fca799c38238fc (plain) (blame)
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
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
use nihav_core::codecs::*;
use nihav_core::io::bitreader::BitReader;
use nihav_core::io::codebook::*;
use std::mem;
use std::ptr;

const NUM_INTRA_SETS: usize = 5;
const NUM_INTER_SETS: usize = 7;

const NUM_COEFF_ENTRIES: usize = 3 * 3 * 3 * 4;
const NUM_ESC_ENTRIES: usize = 32;
const NUM_CBP_ENTRIES: usize = 64;
struct CoeffCodebooks {
    l0_cb:      [Codebook<u16>; 2],
    l12_cb:     [Codebook<u16>; 2],
    l3_cb:      [Codebook<u16>; 2],
    esc_cb:     Codebook<u16>,
}

const MAX_ELEMS: usize = NUM_COEFF_ENTRIES * 8;
struct RV60CodebookDescReader {
    len:        usize,
    codes:      [u32; MAX_ELEMS],
    bits:       [u8; MAX_ELEMS],
}

impl RV60CodebookDescReader {
    fn new(table: &'static [u32], len: usize, ignfirst: bool) -> Self {
        let mut prefixes: [u32; 18] = [0; 18];
        let mut counts: [usize; 17] = [0; 17];

        let mut codes: [u32; MAX_ELEMS] = [0; MAX_ELEMS];
        let mut bits:  [u8; MAX_ELEMS] = [0; MAX_ELEMS];
        for i in 0..(len + 7) >> 3 {
            let code = table[i];
            for j in 0..8 {
                if (i * 8 + j) == len { break; }
                let b = if !ignfirst || (i != 0) || (j != 0) {
                        (((code >> ((7 - j) * 4)) & 0xF) as u8) + 1
                    } else {
                        0
                    };
                bits[i * 8 + j] = b;
                counts[b as usize] += 1;
            }
        }
        for i in 1..17 {
            prefixes[i + 1] = (prefixes[i] + (counts[i] as u32)) << 1;
        }
        for i in 0..len {
            codes[i] = prefixes[bits[i] as usize];
            prefixes[bits[i] as usize] += 1;
        }

        Self { len, codes, bits }
    }
}

impl CodebookDescReader<u16> for RV60CodebookDescReader {
    fn bits(&mut self, idx: usize) -> u8  { self.bits[idx] }
    fn code(&mut self, idx: usize) -> u32 { self.codes[idx] }
    fn sym (&mut self, idx: usize) -> u16 { idx as u16 }
    fn len(&mut self) -> usize { self.len }
}

impl CoeffCodebooks {
    fn init(set_no: usize, intra: bool) -> Self {
        let coeff_tabs = if intra { &RV60_INTRA_COEFFS_CB_DESC[set_no] } else { &RV60_INTER_COEFFS_CB_DESC[set_no] };
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l0_tab[0], NUM_COEFF_ENTRIES * 8, true);
        let l0c0 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l0_tab[1], NUM_COEFF_ENTRIES * 8, true);
        let l0c1 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l12_tab[0], NUM_COEFF_ENTRIES, true);
        let l12c0 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l12_tab[1], NUM_COEFF_ENTRIES, true);
        let l12c1 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l3_tab[0], NUM_COEFF_ENTRIES, true);
        let l3c0 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.l3_tab[1], NUM_COEFF_ENTRIES, true);
        let l3c1 = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        let mut cbr = RV60CodebookDescReader::new(&coeff_tabs.esc_tab, NUM_ESC_ENTRIES, false);
        let esc_cb = Codebook::new(&mut cbr, CodebookMode::MSB).unwrap();
        Self {
            l0_cb:  [ l0c0,  l0c1 ],
            l12_cb: [ l12c0, l12c1 ],
            l3_cb:  [ l3c0,  l3c1 ],
            esc_cb,
        }
    }
}

pub struct RV60Codebooks {
    cbp8_cb:        [[Codebook<u16>; 4];  NUM_INTER_SETS],
    cbp16_cb:       [[Codebook<u16>; 12]; NUM_INTER_SETS],
    intra_coeff_cb: [CoeffCodebooks; NUM_INTRA_SETS],
    inter_coeff_cb: [CoeffCodebooks; NUM_INTER_SETS],
}

impl RV60Codebooks {
    pub fn init() -> Self {
        let cbp8_cb;
        let cbp16_cb;
        unsafe {
            let mut ucbp8_cb:  mem::MaybeUninit::<[[Codebook<u16>; 4];  NUM_INTER_SETS]> = mem::MaybeUninit::uninit();
            let mut ucbp16_cb: mem::MaybeUninit::<[[Codebook<u16>; 12]; NUM_INTER_SETS]> = mem::MaybeUninit::uninit();
            for set_no in 0..NUM_INTER_SETS {
                for i in 0..4 {
                    let mut cbr = RV60CodebookDescReader::new(&RV60_CBP8_TABS[set_no][i], NUM_CBP_ENTRIES, false);
                    ptr::write(&mut (*ucbp8_cb.as_mut_ptr())[set_no][i], Codebook::new(&mut cbr, CodebookMode::MSB).unwrap());
                }
                for i in 0..12 {
                    let mut cbr = RV60CodebookDescReader::new(&RV60_CBP16_TABS[set_no][i], NUM_CBP_ENTRIES, false);
                    ptr::write(&mut (*ucbp16_cb.as_mut_ptr())[set_no][i], Codebook::new(&mut cbr, CodebookMode::MSB).unwrap());
                }
            }
            cbp8_cb  = ucbp8_cb.assume_init();
            cbp16_cb = ucbp16_cb.assume_init();
        }
        let intra_coeff_cb;
        let inter_coeff_cb;
        unsafe {
            let mut uintra_coeff_cb: mem::MaybeUninit::<[CoeffCodebooks; NUM_INTRA_SETS]> = mem::MaybeUninit::uninit();
            for set_no in 0..NUM_INTRA_SETS {
                ptr::write(&mut (*uintra_coeff_cb.as_mut_ptr())[set_no], CoeffCodebooks::init(set_no, true));
            }
            let mut uinter_coeff_cb: mem::MaybeUninit::<[CoeffCodebooks; NUM_INTER_SETS]> = mem::MaybeUninit::uninit();
            for set_no in 0..NUM_INTER_SETS {
                ptr::write(&mut (*uinter_coeff_cb.as_mut_ptr())[set_no], CoeffCodebooks::init(set_no, false));
            }
            intra_coeff_cb = uintra_coeff_cb.assume_init();
            inter_coeff_cb = uinter_coeff_cb.assume_init();
        }
        Self { cbp8_cb, cbp16_cb, intra_coeff_cb, inter_coeff_cb }
    }
    fn get_c4x4_set(qp: u8, is_intra: bool) -> usize {
        if is_intra {
            RV60_QP_TO_IDX[(qp as usize) + 32]
        } else {
            RV60_QP_TO_IDX[qp as usize]
        }
    }
}

fn decode_coeff(br: &mut BitReader, cb: &Codebook<u16>, inval: i16, esc_val: i16) -> DecoderResult<i16> {
    if inval != esc_val {
        if inval != 0 && br.read_bool()? {
            Ok(-inval)
        } else {
            Ok(inval)
        }
    } else {
        let esc_sym                                     = br.read_cb(cb)?;
        let val = (if esc_sym > 23 {
                let esc_bits = (esc_sym - 23) as u8;
                let extrabits                           = br.read(esc_bits)? as i16;
                (1 << esc_bits) + extrabits + 22
            } else {
                esc_sym as i16
            }) + esc_val;
        if br.read_bool()? {
            Ok(-val)
        } else {
            Ok(val)
        }
    }
}

fn quant(val: i16, q: i16) -> i16 { (val * q + 8) >> 4 }

fn decode_2x2_dc(br: &mut BitReader, cb: &Codebook<u16>, coeffs: &mut [i16], stride: usize, block2: bool, dsc: usize, q_dc: i16, q_ac: i16) -> DecoderResult<()> {
    if dsc == 0 { return Ok(()); }
    let lx = RV60_DSC_TO_LX[dsc as usize];
    let l0 = ((lx >>  0) & 0xFF) as i16;
    let l1 = ((lx >>  8) & 0xFF) as i16;
    let l2 = ((lx >> 16) & 0xFF) as i16;
    let l3 = ((lx >> 24) & 0xFF) as i16;
    coeffs[0] = quant(decode_coeff(br, cb, l0, 3)?, q_dc);
    if !block2 {
        coeffs[1]      = quant(decode_coeff(br, cb, l1, 2)?, q_ac);
        coeffs[stride] = quant(decode_coeff(br, cb, l2, 2)?, q_ac);
    } else {
        coeffs[stride] = quant(decode_coeff(br, cb, l1, 2)?, q_ac);
        coeffs[1]      = quant(decode_coeff(br, cb, l2, 2)?, q_ac);
    }
    coeffs[stride + 1] = quant(decode_coeff(br, cb, l3, 2)?, q_ac);
    Ok(())
}
fn decode_2x2(br: &mut BitReader, cb: &Codebook<u16>, coeffs: &mut [i16], stride: usize, block2: bool, dsc: usize, q_ac: i16) -> DecoderResult<()> {
    if dsc == 0 { return Ok(()); }
    let lx = RV60_DSC_TO_LX[dsc as usize];
    let l0 = ((lx >>  0) & 0xFF) as i16;
    let l1 = ((lx >>  8) & 0xFF) as i16;
    let l2 = ((lx >> 16) & 0xFF) as i16;
    let l3 = ((lx >> 24) & 0xFF) as i16;
    coeffs[0] = quant(decode_coeff(br, cb, l0, 3)?, q_ac);
    if !block2 {
        coeffs[1]      = quant(decode_coeff(br, cb, l1, 2)?, q_ac);
        coeffs[stride] = quant(decode_coeff(br, cb, l2, 2)?, q_ac);
    } else {
        coeffs[stride] = quant(decode_coeff(br, cb, l1, 2)?, q_ac);
        coeffs[1]      = quant(decode_coeff(br, cb, l2, 2)?, q_ac);
    }
    coeffs[stride + 1] = quant(decode_coeff(br, cb, l3, 2)?, q_ac);
    Ok(())
}

fn decode_4x4_block_dc(br: &mut BitReader, cbs: &CoeffCodebooks, is_luma: bool, coeffs: &mut [i16], stride: usize, q_dc: i16, q_ac: i16) -> DecoderResult<()> {
    let tab_idx = if is_luma { 0 } else { 1 };
    let sym0                                            = br.read_cb(&cbs.l0_cb[tab_idx])?;
    let grp0 = (sym0 >> 3) as usize;
    let esc_cb = &cbs.esc_cb;
    if grp0 != 0 {
        decode_2x2_dc(br, esc_cb, &mut coeffs[0..], stride, false, grp0, q_dc, q_ac)?;
    }
    if (sym0 & 4) != 0 {
        let grp                                         = br.read_cb(&cbs.l12_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2..], stride, false, grp, q_ac)?;
    }
    if (sym0 & 2) != 0 {
        let grp                                         = br.read_cb(&cbs.l12_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2*stride..], stride, true, grp, q_ac)?;
    }
    if (sym0 & 1) != 0 {
        let grp                                         = br.read_cb(&cbs.l3_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2*stride+2..], stride, false, grp, q_ac)?;
    }
    Ok(())
}

fn decode_4x4_block(br: &mut BitReader, cbs: &CoeffCodebooks, is_luma: bool, coeffs: &mut [i16], stride: usize, q_ac: i16) -> DecoderResult<()> {
    let tab_idx = if is_luma { 0 } else { 1 };
    let sym0                                            = br.read_cb(&cbs.l0_cb[tab_idx])?;
    let grp0 = (sym0 >> 3) as usize;
    let esc_cb = &cbs.esc_cb;
    if grp0 != 0 {
        decode_2x2(br, esc_cb, &mut coeffs[0..], stride, false, grp0, q_ac)?;
    }
    if (sym0 & 4) != 0 {
        let grp                                         = br.read_cb(&cbs.l12_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2..], stride, false, grp, q_ac)?;
    }
    if (sym0 & 2) != 0 {
        let grp                                         = br.read_cb(&cbs.l12_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2*stride..], stride, true, grp, q_ac)?;
    }
    if (sym0 & 1) != 0 {
        let grp                                         = br.read_cb(&cbs.l3_cb[tab_idx])? as usize;
        decode_2x2(br, esc_cb, &mut coeffs[2*stride+2..], stride, false, grp, q_ac)?;
    }
    Ok(())
}

fn decode_cbp8(br: &mut BitReader, cbs: &[[Codebook<u16>; 4]; NUM_INTER_SETS], qp: u8, subset: usize) -> DecoderResult<u16> {
    let cb_set = RV60_QP_TO_IDX[qp as usize];
    let cbp                                             = br.read_cb(&cbs[cb_set][subset])?;
    Ok(cbp)
}

fn decode_super_cbp(br: &mut BitReader, cbs: &[Codebook<u16>]) -> DecoderResult<u32> {
    let sym0 = br.read_cb(&cbs[0])? as u32;
    let sym1 = br.read_cb(&cbs[1])? as u32;
    let sym2 = br.read_cb(&cbs[2])? as u32;
    let sym3 = br.read_cb(&cbs[3])? as u32;

    // luma/chroma interleaved CBPs
    Ok(0
       + ((sym0 & 0x03) <<  0)
       + ((sym0 & 0x0C) <<  2)
       + ((sym0 & 0x10) << 12)
       + ((sym0 & 0x20) << 15)
       + ((sym1 & 0x03) <<  2)
       + ((sym1 & 0x0C) <<  4)
       + ((sym1 & 0x10) << 13)
       + ((sym1 & 0x20) << 16)
       + ((sym2 & 0x03) <<  8)
       + ((sym2 & 0x0C) << 10)
       + ((sym2 & 0x10) << 14)
       + ((sym2 & 0x20) << 17)
       + ((sym3 & 0x03) << 10)
       + ((sym3 & 0x0C) << 12)
       + ((sym3 & 0x10) << 15)
       + ((sym3 & 0x20) << 18)
    )
}

pub fn rv6_decode_cbp8(br: &mut BitReader, cbs: &RV60Codebooks, subset: usize, qp: u8) -> DecoderResult<u32> {
    let cbp8 = decode_cbp8(br, &cbs.cbp8_cb, qp, subset)?;
    Ok(cbp8 as u32)
}

pub fn rv6_decode_cbp16(br: &mut BitReader, cbs: &RV60Codebooks, subset: usize, qp: u8) -> DecoderResult<u32> {
    let cb_set = RV60_QP_TO_IDX[qp as usize];
    let cbp16;
    if subset == 0 {
        cbp16 = decode_super_cbp(br, &cbs.cbp8_cb[cb_set])?;
    } else {
        cbp16 = decode_super_cbp(br, &cbs.cbp16_cb[cb_set][(subset - 1) * 4..][..4])?;
    }
    Ok(cbp16)
}

pub fn rv6_decode_cu_8x8(br: &mut BitReader, cbs: &RV60Codebooks, is_intra: bool, qp: u8, sel_qp: u8, y_coeffs: &mut [i16; 16 * 16], u_coeffs: &mut [i16; 8 * 8], v_coeffs: &mut [i16; 8 * 8], ccbp: u32, mode4x4: bool) -> DecoderResult<()> {
    let cb_set = RV60Codebooks::get_c4x4_set(sel_qp, is_intra);
    let cb = if is_intra { &cbs.intra_coeff_cb[cb_set] } else { &cbs.inter_coeff_cb[cb_set] };
    let q_y = RV60_QUANTS_B[qp as usize];
    let q_c_dc = RV60_QUANTS_B[RV60_CHROMA_QUANT_DC[qp as usize] as usize];
    let q_c_ac = RV60_QUANTS_B[RV60_CHROMA_QUANT[qp as usize] as usize];
    for i in 0..4 {
        if ((ccbp >> i) & 1) != 0 {
            let (off, stride) = if mode4x4 {
                    (i * 16, 4)
                } else {
                    ((i & 1) * 4 + (i & 2) * 2 * 8, 8)
                };
            decode_4x4_block(br, cb, true, &mut y_coeffs[off..], stride, q_y)?;
        }
    }
    if ((ccbp >> 4) & 1) != 0 {
        decode_4x4_block_dc(br, cb, false, u_coeffs, 4, q_c_dc, q_c_ac)?;
    }
    if ((ccbp >> 5) & 1) != 0 {
        decode_4x4_block_dc(br, cb, false, v_coeffs, 4, q_c_dc, q_c_ac)?;
    }
    Ok(())
}

pub fn rv6_decode_cu_16x16(br: &mut BitReader, cbs: &RV60Codebooks, is_intra: bool, qp: u8, sel_qp: u8, y_coeffs: &mut [i16; 16 * 16], u_coeffs: &mut [i16; 8 * 8], v_coeffs: &mut [i16; 8 * 8], ccbp: u32) -> DecoderResult<()> {
    let cb_set = RV60Codebooks::get_c4x4_set(sel_qp, is_intra);
    let cb = if is_intra { &cbs.intra_coeff_cb[cb_set] } else { &cbs.inter_coeff_cb[cb_set] };
    let q_y = RV60_QUANTS_B[qp as usize];
    let q_c_dc = RV60_QUANTS_B[RV60_CHROMA_QUANT_DC[qp as usize] as usize];
    let q_c_ac = RV60_QUANTS_B[RV60_CHROMA_QUANT[qp as usize] as usize];
    for i in 0..16 {
        if ((ccbp >> i) & 1) != 0 {
            let off = (i & 3) * 4 + (i >> 2) * 4 * 16;
            decode_4x4_block(br, cb, true, &mut y_coeffs[off..], 16, q_y)?;
        }
    }
    for i in 16..20 {
        if ((ccbp >> i) & 1) != 0 {
            let off = (i & 1) * 4 + (i & 2) * 2 * 8;
            if i == 16 {
                decode_4x4_block_dc(br, cb, false, &mut u_coeffs[off..], 8, q_c_dc, q_c_ac)?;
            } else {
                decode_4x4_block(br, cb, false, &mut u_coeffs[off..], 8, q_c_ac)?;
            }
        }
    }
    for i in 20..24 {
        if ((ccbp >> i) & 1) != 0 {
            let off = (i & 1) * 4 + (i & 2) * 2 * 8;
            if i == 20 {
                decode_4x4_block_dc(br, cb, false, &mut v_coeffs[off..], 8, q_c_dc, q_c_ac)?;
            } else {
                decode_4x4_block(br, cb, false, &mut v_coeffs[off..], 8, q_c_ac)?;
            }
        }
    }
    Ok(())
}

pub fn rv6_decode_cu_4x4in16x16(br: &mut BitReader, cbs: &RV60Codebooks, is_intra: bool, qp: u8, sel_qp: u8, y_coeffs: &mut [i16; 16 * 16], u_coeffs: &mut [i16; 8 * 8], v_coeffs: &mut [i16; 8 * 8], ccbp: u32) -> DecoderResult<()> {
    let cb_set = RV60Codebooks::get_c4x4_set(sel_qp, is_intra);
    let cb = if is_intra { &cbs.intra_coeff_cb[cb_set] } else { &cbs.inter_coeff_cb[cb_set] };
    let q_y = RV60_QUANTS_B[qp as usize];
    let q_c_dc = RV60_QUANTS_B[RV60_CHROMA_QUANT_DC[qp as usize] as usize];
    let q_c_ac = RV60_QUANTS_B[RV60_CHROMA_QUANT[qp as usize] as usize];
    for i in 0..16 {
        if ((ccbp >> i) & 1) != 0 {
            let off = i * 16;
            decode_4x4_block(br, cb, true, &mut y_coeffs[off..], 4, q_y)?;
        }
    }
    for i in 16..20 {
        if ((ccbp >> i) & 1) != 0 {
            let off = (i - 16) * 16;
            decode_4x4_block_dc(br, cb, false, &mut u_coeffs[off..], 4, q_c_dc, q_c_ac)?;
        }
    }
    for i in 20..24 {
        if ((ccbp >> i) & 1) != 0 {
            let off = (i - 20) * 16;
            decode_4x4_block_dc(br, cb, false, &mut v_coeffs[off..], 4, q_c_dc, q_c_ac)?;
        }
    }
    Ok(())
}

const RV60_QP_TO_IDX: [usize; 64] = [
    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0
];
const RV60_QUANTS_B: [i16; 32] = [
      60,   67,   76,   85,   96,  108,  121,  136,
     152,  171,  192,  216,  242,  272,  305,  341,
     383,  432,  481,  544,  606,  683,  767,  854,
     963, 1074, 1212, 1392, 1566, 1708, 1978, 2211
];
const RV60_CHROMA_QUANT_DC: [u8; 32] = [
     0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,
    14, 15, 15, 16, 17, 18, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23
];
const RV60_CHROMA_QUANT: [u8; 32] = [
     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
    16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25
];

const RV60_DSC_TO_LX: [u32; NUM_COEFF_ENTRIES] = [
    0x00000000, 0x01000000, 0x02000000, 0x00010000, 0x01010000, 0x02010000, 0x00020000, 0x01020000, 0x02020000,
    0x00000100, 0x01000100, 0x02000100, 0x00010100, 0x01010100, 0x02010100, 0x00020100, 0x01020100, 0x02020100,
    0x00000200, 0x01000200, 0x02000200, 0x00010200, 0x01010200, 0x02010200, 0x00020200, 0x01020200, 0x02020200,

    0x00000001, 0x01000001, 0x02000001, 0x00010001, 0x01010001, 0x02010001, 0x00020001, 0x01020001, 0x02020001,
    0x00000101, 0x01000101, 0x02000101, 0x00010101, 0x01010101, 0x02010101, 0x00020101, 0x01020101, 0x02020101,
    0x00000201, 0x01000201, 0x02000201, 0x00010201, 0x01010201, 0x02010201, 0x00020201, 0x01020201, 0x02020201,

    0x00000002, 0x01000002, 0x02000002, 0x00010002, 0x01010002, 0x02010002, 0x00020002, 0x01020002, 0x02020002,
    0x00000102, 0x01000102, 0x02000102, 0x00010102, 0x01010102, 0x02010102, 0x00020102, 0x01020102, 0x02020102,
    0x00000202, 0x01000202, 0x02000202, 0x00010202, 0x01010202, 0x02010202, 0x00020202, 0x01020202, 0x02020202,

    0x00000003, 0x01000003, 0x02000003, 0x00010003, 0x01010003, 0x02010003, 0x00020003, 0x01020003, 0x02020003,
    0x00000103, 0x01000103, 0x02000103, 0x00010103, 0x01010103, 0x02010103, 0x00020103, 0x01020103, 0x02020103,
    0x00000203, 0x01000203, 0x02000203, 0x00010203, 0x01010203, 0x02010203, 0x00020203, 0x01020203, 0x02020203
];

const RV60_CBP8_TABS: [[[u32; 8]; 4]; NUM_INTER_SETS] = [
  [
    [ 0x66666675, 0x66656553, 0x77767675, 0x77656552, 0x88878786, 0x88767663, 0x88868674, 0x87646441 ],
    [ 0x6383B594, 0xD8B7B6A2, 0x84A5B5A3, 0xD8C7B6A2, 0x94B5D5C5, 0xEAE9E8C4, 0xA4D4C4B3, 0xE9D7D6B2 ],
    [ 0x45555565, 0x56555552, 0x66666675, 0x67656552, 0x88888897, 0x88878774, 0x88978786, 0x88867661 ],
    [ 0x73639483, 0xB796A683, 0x849495A4, 0xD8C7B692, 0xA5B5C6C5, 0xEAD8D9C4, 0xA5B5B5C4, 0xE9D8D7B1 ],
  ], [
    [ 0x66666675, 0x66656553, 0x77767675, 0x77656552, 0x88878786, 0x88767663, 0x88868674, 0x87646441 ],
    [ 0x6383B594, 0xD8B7B6A2, 0x84A5B5A3, 0xD8C7B6A2, 0x94B5D5C5, 0xEAE9E8C4, 0xA4D4C4B3, 0xE9D7D6B2 ],
    [ 0x45555565, 0x56555552, 0x66666675, 0x67656552, 0x88888897, 0x88878774, 0x88978786, 0x88867661 ],
    [ 0x73639483, 0xB796A683, 0x849495A4, 0xD8C7B692, 0xA5B5C6C5, 0xEAD8D9C4, 0xA5B5B5C4, 0xE9D8D7B1 ],
  ], [
    [ 0x45555565, 0x56545543, 0x66666675, 0x67656553, 0x77777786, 0x78767664, 0x77867675, 0x87656551 ],
    [ 0x41848493, 0x86959582, 0x73A584A4, 0xA7B7A7A4, 0x84C6C6D6, 0xD9D8D8C5, 0x94D5B4D4, 0xD9D8D7D4 ],
    [ 0x34544554, 0x45444442, 0x66766675, 0x67656552, 0x88988897, 0x89877774, 0x99989896, 0x99868663 ],
    [ 0x52637373, 0x86857562, 0x84958494, 0xB8A79582, 0x94B6B6B6, 0xDAC8C8A4, 0x95B6A6C5, 0xDAC8C7A3 ],
  ], [
    [ 0x34445565, 0x45445443, 0x66667675, 0x77656553, 0x77777786, 0x78667664, 0x77867685, 0x88656552 ],
    [ 0x218383A4, 0x8696A694, 0x63B594C5, 0xC8D8C8D5, 0x63C5B5D6, 0xD9D9D9E7, 0x83C5B5E5, 0xD9E8E8D5 ],
    [ 0x24444454, 0x45443442, 0x66766675, 0x67666653, 0x78878787, 0x88777775, 0x99988797, 0x99877774 ],
    [ 0x41636373, 0x85757462, 0x73958595, 0xB8A79684, 0x84A6A6B6, 0xD9B8C8A5, 0x95B6A6B6, 0xDAC8C8B5 ],
  ], [
    [ 0x34444455, 0x45444443, 0x66666675, 0x67656653, 0x67777786, 0x78667664, 0x77767685, 0x87656553 ],
    [ 0x208494C5, 0xA8B7E9D7, 0x63C5B5E6, 0xEAEAEAE7, 0x63C6C6E7, 0xEBEAEBE8, 0x84D5C6E6, 0xEBEAEAE6 ],
    [ 0x23333454, 0x35443443, 0x67766676, 0x67666665, 0x77777787, 0x78777775, 0x99988898, 0x99888886 ],
    [ 0x40636374, 0x96757563, 0x749596A6, 0xB9A8A896, 0x84A6A6A7, 0xCAB8B9A7, 0x86A7B7C7, 0xDBC9DAB7 ],
  ], [
    [ 0x24444455, 0x35444443, 0x56666676, 0x67666664, 0x67777787, 0x78667665, 0x77767685, 0x78667663 ],
    [ 0x109495E7, 0xDAD9EAE8, 0x63C6C6E7, 0xECEBEBE9, 0x64C7C7E9, 0xEDEBECE9, 0x84D6D7E7, 0xECEBEBE8 ],
    [ 0x13343454, 0x35443444, 0x67776787, 0x68777776, 0x67777787, 0x79787886, 0x899988A8, 0x9A998997 ],
    [ 0x30535374, 0x87767665, 0x738586A7, 0xB9A9A9A7, 0x749697A8, 0xCAA9B9A8, 0x85A7B8C8, 0xDCCADAC8 ],
  ], [
    [ 0x13343455, 0x35454544, 0x56666777, 0x67676776, 0x67777787, 0x78777776, 0x77777787, 0x78777776 ],
    [ 0x018485D7, 0xDADADAD9, 0x53B6C7D9, 0xDDDCDCDB, 0x54C7C8DA, 0xDDDCDDDB, 0x64D7D8DA, 0xDDDDDDDB ],
    [ 0x03353456, 0x35464666, 0x67887899, 0x798A8999, 0x68898899, 0x8A9A9999, 0x8AAA9ABB, 0xABABABBA ],
    [ 0x10536487, 0x98879887, 0x74A7A8CA, 0xDCCBDBDA, 0x74A7B8CA, 0xDCDBCCCB, 0x85B8C9DB, 0xDDDCDDDB ]
  ]
];

const RV60_CBP16_TABS: [[[u32; 8]; 12]; NUM_INTER_SETS] = [
  [
    [ 0x8563A594, 0xA795B7A4, 0x9584B5A4, 0xB8A6C7A3, 0x9674B6A4, 0xB8A6D8B2, 0xA594C4C3, 0xD8C6C6B1 ],
    [ 0x02525474, 0x87978695, 0x56858797, 0xAAA9A796, 0x56A6A9DA, 0xEEEDECFB, 0x98B7B9D8, 0xFDDAEAC8 ],
    [ 0x02545475, 0x67867674, 0x55978696, 0xA9B8A784, 0x459897B9, 0xBBDBCAD9, 0x87B8A6C7, 0xCBDAD8C5 ],
    [ 0x03553364, 0x66876474, 0x67988585, 0xA8978474, 0x6BCCCACB, 0xCCCCCCCA, 0xBBCBCAB9, 0xCBB9B997 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x46555553, 0x56666675, 0x67656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x85639684, 0x9685A672, 0x96859594, 0xB795A582, 0xA786C7B6, 0xC9B7C8A3, 0xA796B5A3, 0xC7B6B591 ],
    [ 0x12534363, 0x66867473, 0x45766575, 0x98A89694, 0x65A786A7, 0xCBDBC9C6, 0x87A897B6, 0xCBD9B8C4 ],
    [ 0x12435464, 0x66757673, 0x44657585, 0x87979783, 0x558697A7, 0xA9A8B9A6, 0x879796A6, 0xB9B8B8A4 ],
    [ 0x02454464, 0x66867484, 0x579986A5, 0xA9B8A5A4, 0x79BAA9C9, 0xDCDBDAD7, 0xABDCCAD8, 0xDDDBD9C5 ],
  ], [
    [ 0x8563A594, 0xA795B7A4, 0x9584B5A4, 0xB8A6C7A3, 0x9674B6A4, 0xB8A6D8B2, 0xA594C4C3, 0xD8C6C6B1 ],
    [ 0x02525474, 0x87978695, 0x56858797, 0xAAA9A796, 0x56A6A9DA, 0xEEEDECFB, 0x98B7B9D8, 0xFDDAEAC8 ],
    [ 0x02545475, 0x67867674, 0x55978696, 0xA9B8A784, 0x459897B9, 0xBBDBCAD9, 0x87B8A6C7, 0xCBDAD8C5 ],
    [ 0x03553364, 0x66876474, 0x67988585, 0xA8978474, 0x6BCCCACB, 0xCCCCCCCA, 0xBBCBCAB9, 0xCBB9B997 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x46555553, 0x56666675, 0x67656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x35555565, 0x55555553, 0x56666665, 0x66656552, 0x78888887, 0x88878774, 0x78878786, 0x88767661 ],
    [ 0x85639684, 0x9685A672, 0x96859594, 0xB795A582, 0xA786C7B6, 0xC9B7C8A3, 0xA796B5A3, 0xC7B6B591 ],
    [ 0x12534363, 0x66867473, 0x45766575, 0x98A89694, 0x65A786A7, 0xCBDBC9C6, 0x87A897B6, 0xCBD9B8C4 ],
    [ 0x12435464, 0x66757673, 0x44657585, 0x87979783, 0x558697A7, 0xA9A8B9A6, 0x879796A6, 0xB9B8B8A4 ],
    [ 0x02454464, 0x66867484, 0x579986A5, 0xA9B8A5A4, 0x79BAA9C9, 0xDCDBDAD7, 0xABDCCAD8, 0xDDDBD9C5 ],
  ], [
    [ 0x63638493, 0x8696A6B4, 0x63847493, 0x87A696A4, 0x749595B4, 0xB8D7B7C4, 0x84A494A2, 0xA7B6A6D3 ],
    [ 0x02333455, 0x57677776, 0x56767797, 0x899A99A9, 0x78B8BADA, 0xDDDDDCDC, 0x98C8D9D9, 0xDDDCDCD9 ],
    [ 0x02444466, 0x56666666, 0x55776575, 0x77877575, 0x67AAA9DB, 0xCDDBDCDA, 0x98CAA7C8, 0xDCDBC9D8 ],
    [ 0x02452366, 0x56896698, 0x46786689, 0x789A88B9, 0xACCCCCCC, 0xCCCCCCCC, 0xCCCCCCCC, 0xCCCCCDDC ],
    [ 0x23443454, 0x45444443, 0x56666675, 0x67666663, 0x78878897, 0x89878775, 0x89979796, 0x99878773 ],
    [ 0x24344454, 0x35444443, 0x56666676, 0x67656663, 0x78888897, 0x89878775, 0x89979896, 0x99868773 ],
    [ 0x23443454, 0x45444443, 0x56666676, 0x67666663, 0x68888897, 0x89877775, 0x88988896, 0x99877673 ],
    [ 0x24344455, 0x35444443, 0x56666676, 0x67666653, 0x68888897, 0x89878774, 0x89989897, 0x99877763 ],
    [ 0x63537473, 0x85748562, 0x73848484, 0x96959683, 0x8596A5A4, 0xC8A7B794, 0x85A595A4, 0xC7B6B6A3 ],
    [ 0x02443374, 0x77867684, 0x568776A7, 0xA9BAA8B6, 0x78C9A8C9, 0xDDECDAD7, 0x99B8B9C8, 0xEDEAEAD6 ],
    [ 0x02445565, 0x56656664, 0x55878686, 0x98978674, 0x67A9A8C9, 0xABAACAB7, 0x87B9A7B8, 0xDBDAC9B6 ],
    [ 0x02553264, 0x66877585, 0x67997697, 0x98B997A6, 0x9ACBA9DA, 0xDDDCDBC8, 0xCCDCDADA, 0xDCDCDAD8 ],
  ], [
    [ 0x626383A3, 0x97A6C6C4, 0x538484B4, 0xA8C7C7E5, 0x74A4B5D5, 0xD9E8E8E5, 0x73B3B3E3, 0xC8E7E7E4 ],
    [ 0x02324464, 0x78778786, 0x569697C8, 0xBCCCCCCA, 0x88B8BACB, 0xCCCCCCCB, 0xA8B8CAC9, 0xCCCCCCCA ],
    [ 0x02444466, 0x46666767, 0x35775588, 0x78A988A8, 0x68CBB8CB, 0xCDCBDDDB, 0x98CAB8CA, 0xCCCCCBCA ],
    [ 0x02452366, 0x56987697, 0x38AA79AB, 0x9ABBBBBA, 0xBBBBBBBB, 0xBBBBBBBB, 0xBBBBBBBB, 0xBBBBBBBB ],
    [ 0x13343454, 0x45444553, 0x56666676, 0x67766675, 0x68878897, 0x89888885, 0x89989897, 0x99888885 ],
    [ 0x13344454, 0x35444543, 0x56667786, 0x78766765, 0x68888898, 0x89878875, 0x89989898, 0x99878885 ],
    [ 0x13343454, 0x35454453, 0x56766786, 0x78776675, 0x68888898, 0x89888786, 0x899898A8, 0x9A988785 ],
    [ 0x14343455, 0x35444543, 0x56676777, 0x67776764, 0x68888898, 0x89878875, 0x89989898, 0x99888875 ],
    [ 0x51536373, 0x85758573, 0x63848495, 0xA796A694, 0x749595A5, 0xB8B7B8A5, 0x85A695A5, 0xB9B7B8A5 ],
    [ 0x02433454, 0x67867674, 0x569787A7, 0xBBC9C9B7, 0x78B8A9C8, 0xDDDADBC8, 0x99A8BAC8, 0xDDDADBC7 ],
    [ 0x02444465, 0x56556664, 0x55876686, 0x88988786, 0x68AAA8BA, 0xABBACAB8, 0x87BA98C9, 0xCCCBCAB8 ],
    [ 0x02452364, 0x66877585, 0x57AA88B9, 0xA9CABAB8, 0x8ABAA9CA, 0xCCBBBBB9, 0xBBBBBBBB, 0xBBBBBBB9 ],
  ], [
    [ 0x716383B3, 0xB8D7D7E4, 0x6394A4D4, 0xC9E8E8E5, 0x73B5B5E5, 0xEAE9E9E6, 0x83C4C4E4, 0xE9E8E7E4 ],
    [ 0x01334575, 0x99A8A9B7, 0x66A7B8C8, 0xCCCCCCC8, 0x77B8CAC9, 0xCCCCCCCB, 0x98C8C9C9, 0xCCCCCBCA ],
    [ 0x01444486, 0x57777897, 0x55A876B8, 0xCACAB9C8, 0x67CAC8CA, 0xCCCACBCA, 0x98CAC8C9, 0xCCCCCBCA ],
    [ 0x01562486, 0x799998A8, 0x6AAA9999, 0x99999999, 0x99999999, 0x99999999, 0x9999999A, 0xAAAAAAA9 ],
    [ 0x13343454, 0x35444443, 0x56767787, 0x78777776, 0x67877797, 0x79888886, 0x899898A8, 0x9A999997 ],
    [ 0x13333454, 0x35444543, 0x57777787, 0x78777776, 0x67778898, 0x89888886, 0x899999A9, 0x9A989997 ],
    [ 0x13343454, 0x35453443, 0x57777787, 0x78777776, 0x67887798, 0x89888886, 0x899998A9, 0x9A999997 ],
    [ 0x13343454, 0x35443543, 0x57777787, 0x78777776, 0x68887898, 0x79888876, 0x899999A9, 0x9A999987 ],
    [ 0x60636384, 0x86859684, 0x63858596, 0xA8A7A8A6, 0x749696A6, 0xB9A8B9A6, 0x85A6A7B7, 0xC9B8C9B7 ],
    [ 0x02333454, 0x77768775, 0x678798A7, 0xCBB9CAB7, 0x6897A9B8, 0xDDC9DBB8, 0x89A8BAD8, 0xDDDADBC8 ],
    [ 0x02344465, 0x56556664, 0x558777A8, 0x99A9A9A8, 0x679A98CA, 0xABBBBAB9, 0x78BA98CB, 0xCCCCCBCA ],
    [ 0x01453366, 0x67777676, 0x79BBBABB, 0xBBBBBBB9, 0x8ABBABBB, 0xBBBBBBBA, 0xBBBBBBBB, 0xBBBBBBBB ],
  ], [
    [ 0x816383C4, 0xB9D8D8E5, 0x62A4B4E5, 0xEAE9E9E6, 0x63B5B5E6, 0xEAEAEAE7, 0x82C4C4E5, 0xEAE9E9E5 ],
    [ 0x01335485, 0x9AB9A8B7, 0x7697B8B8, 0xBBBBBBB9, 0x67B8BABB, 0xBBBBBBBB, 0x98B7BABA, 0xBBBBBBBB ],
    [ 0x01445396, 0x78879AA6, 0x559897A9, 0xAAA9AAA9, 0x67A9A9AA, 0xAA9AAAAA, 0x97A9A8AA, 0xAAAAAAAA ],
    [ 0x02643476, 0x76777776, 0x67777777, 0x77777777, 0x77777777, 0x77777777, 0x77777777, 0x77777777 ],
    [ 0x03343455, 0x46564665, 0x57777898, 0x79898888, 0x688888A8, 0x89999998, 0x899999B9, 0xABAAAAA9 ],
    [ 0x03344555, 0x36454655, 0x67788898, 0x79888998, 0x68888999, 0x8A899998, 0x899AAABA, 0xABAAAAA9 ],
    [ 0x03443465, 0x36564555, 0x57887898, 0x79898898, 0x688988A9, 0x8A998998, 0x89AA99BA, 0xABAAAAA9 ],
    [ 0x03344556, 0x36454655, 0x57787899, 0x79898988, 0x68898999, 0x8A898998, 0x8AAAAABA, 0x9BABABA9 ],
    [ 0x50536374, 0x86859685, 0x53858596, 0xA8A8B8A6, 0x648696A7, 0xB9A8B9B7, 0x759797B7, 0xB9B9CAC8 ],
    [ 0x02324465, 0x78768886, 0x668698A8, 0xBBB9CBB9, 0x6797A9B9, 0xCCB9CCB9, 0x7897BBC9, 0xCCCACCCA ],
    [ 0x02354366, 0x46666665, 0x458987BA, 0x9AAABAA9, 0x58AB99CA, 0xACBBBABA, 0x78BCA9CB, 0xCCCCCBCB ],
    [ 0x01453466, 0x66766675, 0x79AAA9AA, 0xAAAAAAAA, 0x7AAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA ],
  ], [
    [ 0x807473D6, 0xC9C9E9E7, 0x52B6A5E7, 0xDBEAEAE8, 0x53B6B6E8, 0xEBEAEBE9, 0x63C5B5E7, 0xEBEAEAE7 ],
    [ 0x01435495, 0x99999999, 0x66989999, 0x99999999, 0x57989999, 0x99999999, 0x97979999, 0x999999AA ],
    [ 0x01445487, 0x77778787, 0x55888888, 0x88999999, 0x57999999, 0x99999999, 0x77999999, 0x99999999 ],
    [ 0x03675677, 0x76666666, 0x66666666, 0x66666666, 0x66666666, 0x66666666, 0x66777777, 0x77666677 ],
    [ 0x02343566, 0x36575777, 0x588988AA, 0x8A9A9AAA, 0x588989BA, 0x8A9BAABA, 0x7AA9AABB, 0xACBCBCCB ],
    [ 0x03343556, 0x36464666, 0x577888A9, 0x8A8A9AAA, 0x588989AA, 0x8A9A9BBA, 0x7A9AAACB, 0xABABBCBA ],
    [ 0x03343466, 0x36564666, 0x578978A9, 0x7A9A8AA9, 0x578979AA, 0x8A9B99AA, 0x79AA9ABB, 0x9BABAABA ],
    [ 0x03343556, 0x36464666, 0x588979AA, 0x7B8A8A9A, 0x588989AA, 0x8A9A9AAA, 0x7AAB9ABB, 0x9BABABBA ],
    [ 0x50535385, 0x879797A7, 0x438686A8, 0xA9B9BAD9, 0x438686B8, 0xB9CACBDA, 0x649797C9, 0xBACADBDA ],
    [ 0x01334677, 0x78778887, 0x5797AAAB, 0xBBBBBBBB, 0x6898BBBB, 0xBBBAAAAA, 0x8AA9AAAA, 0xAAAAAAAA ],
    [ 0x01464488, 0x46566677, 0x57AAAAAA, 0xAAAAAAAA, 0x5AAAAAAA, 0xAAAAAAAA, 0x8AAAAAAA, 0xAAAAAAAA ],
    [ 0x02453466, 0x67777777, 0x77777777, 0x77777777, 0x77777777, 0x77777777, 0x77777777, 0x77777788 ],
  ]
];

struct CoeffsCBDesc {
    l0_tab:     [[u32; 108]; 2],
    l12_tab:    [[u32; 14]; 2],
    l3_tab:     [[u32; 14]; 2],
    esc_tab:    [u32; 4],
}
const RV60_INTRA_COEFFS_CB_DESC: [CoeffsCBDesc; NUM_INTRA_SETS] = [
  CoeffsCBDesc {
    l0_tab: [
      [
        0xF6464655, 0x68677866, 0x9C9BAB99, 0x58576766, 0x8A788977, 0xBDBCCCA9, 0x8B8A9A88, 0xBD9ABB98,
        0xBEBCCDA9, 0x58676766, 0x7A888877, 0xBDBCBCA9, 0x79788876, 0x9B999987, 0xDECCCCA9, 0xACAABB98,
        0xCEABCCA9, 0xEECCDEB9, 0x8B9A8A88, 0xBDBBAB98, 0xBEBDBCA9, 0xADABAB98, 0xCEBCBBA9, 0xEEDDCDB9,
        0xBEBCBCA9, 0xDECCCDA9, 0xDECDDDA8, 0x47566766, 0x79788877, 0xBDABBCA9, 0x59677876, 0x8A899987,
        0xCEBCCCA9, 0x9C9AAB98, 0xBDAABC98, 0xDEBCDDB9, 0x69787876, 0x8A898987, 0xCECCCCA9, 0x7A898977,
        0x9B9A9A87, 0xDECCCDBA, 0xADAABB98, 0xBEABBC98, 0xEECCDEB9, 0x9CAB9A98, 0xBDBCAB99, 0xDECDCCB9,
        0xADBBAB98, 0xBEBCBBA9, 0xEEDDCCA9, 0xCEBCCCA9, 0xDECCCCA9, 0xEECCCD98, 0x69798987, 0x9B9AAA98,
        0xBEBDCDBA, 0x8B899A88, 0xACAAAB98, 0xEEDDDDCA, 0xAD9BAB98, 0xCEBBCCA9, 0xDECDDEB9, 0x8B899A88,
        0xACAAAB98, 0xEEDDDDCA, 0x9B9A9A98, 0xADABABA9, 0xEEDDDEBA, 0xBEABBCA9, 0xCEBCCCA9, 0xEECDEEB9,
        0xADABAB99, 0xCECCBCA9, 0xDEDECDBA, 0xBEBCACA9, 0xCECCBCA9, 0xEEDECDB9, 0xCEBCCCA9, 0xDECCCDA9,
        0xEECCCD98, 0x9C9AAA98, 0xBDBBBB98, 0xEEDDDDB9, 0x9C9A9A98, 0xBDBBBB98, 0xEEDDDDB9, 0xADAAAB97,
        0xCEABBB98, 0xEECCCD97, 0x9C9AAB98, 0xBDABBB98, 0xEEDDDDB9, 0x9C9AAB98, 0xBEABBB98, 0xEEDDDDB9,
        0xADAAAB97, 0xBEABBB97, 0xEEBBCC97, 0xADABAB98, 0xCEBBBB98, 0xEECDCC98, 0xADABAB98, 0xBEBBAB98,
        0xEECCBC97, 0xBDAAAB87, 0xAD9AAB86, 0xCE9A9A75
      ], [
        0xF6374878, 0x59798B9A, 0xDEDDEEDC, 0x49597A89, 0x8B8AACAA, 0xEEDEEEDD, 0x9D9BBDAB, 0xBEACDEBC,
        0xEEDEEEDD, 0x49796A89, 0x8B9A9CAA, 0xEEDEEEDD, 0x7B8A9B9A, 0x9DABADAB, 0xEEDEEEDD, 0xBEACCEBC,
        0xCEBDDECC, 0xEEEEEEDD, 0x9DBC9CAB, 0xBECDBDBC, 0xEEEEEEDD, 0xBEBDBDBC, 0xCECDBECC, 0xEEEEEEDD,
        0xDEDEDECC, 0xEEDEDECD, 0xEEEEEEDC, 0x17485979, 0x6A798B9A, 0xEEDDDECC, 0x49697A89, 0x8B8AACAA,
        0xEEDDEEDD, 0x9D8BBDAB, 0xBEACCEBC, 0xEEDEEEDD, 0x49797A89, 0x8C9B9CAA, 0xEEDEEEDD, 0x6B8A9B9A,
        0x9D9BACAB, 0xEEDEEEDD, 0xAEACCEBB, 0xCEBDDEBC, 0xEEDEEEDD, 0x9DBC9CAB, 0xBECDBDBC, 0xEEEEDEDD,
        0xAEBCBDBB, 0xCECDBDBC, 0xEEEEDEDD, 0xDEDEDECC, 0xDEDEDECC, 0xEEEEEECC, 0x39697A89, 0x8B9B9CAA,
        0xEEDEEEDD, 0x6B7A9B9A, 0x9C9BBDAB, 0xEEEEEEDD, 0x9E9CBEBB, 0xBEBCDECC, 0xEEEEEEDD, 0x6B8A8B9A,
        0x9DABACAB, 0xEEEEEEDD, 0x7C9B9CAB, 0x9DACBDBB, 0xEEEEEEDD, 0xAEACCEBC, 0xBEBDDECC, 0xEEDEEEDD,
        0x9EBC9DBB, 0xBECDBDBC, 0xEEEEEEDD, 0xAEBDBDBC, 0xBECEBECC, 0xEEEEDEDD, 0xDEDEDECC, 0xDEDEDECC,
        0xEEDEDECC, 0x6A7A8B99, 0x9C9BACAA, 0xEEDDDECC, 0x7B8A9B9A, 0x9DABACAB, 0xEEDDDECC, 0x9D9BAC9A,
        0xBEACBDAB, 0xEEDDDEBB, 0x7B8A8B9A, 0x9DABACAB, 0xEEDDDECC, 0x7C9B9C9A, 0x9DABADAB, 0xEEDEDECC,
        0x9D9BADAA, 0xAEACBDAA, 0xEECDDEBB, 0x8D9B9C9A, 0xBEBCACAA, 0xEEDECDBB, 0x9DAC9C9A, 0xAEBCACAA,
        0xDEDECDBB, 0xAEACAC99, 0xAEACAC99, 0xCEABAB98
      ]],
    l12_tab: [
      [
        0xF3624857, 0x82484587, 0x89578689, 0x89924735, 0x86794585, 0x69789679, 0x78989957, 0x867A7896,
        0x7A78A89A, 0x79989A99, 0x97897897, 0x8878A789, 0x78888988, 0x87760000
      ], [
        0xF3915968, 0xB25957A8, 0x9B78B89C, 0xBBC15936, 0xA79B46A5, 0x7A89C79B, 0x9ACBBC57, 0xB68B8AC6,
        0x8B79C9AC, 0x9ACAACBB, 0xC79B89C9, 0xAB8AC8AC, 0x9AB9ACAA, 0xCAAB0000
      ]],
    l3_tab: [
      [
        0xF3524747, 0x83574687, 0x8A588789, 0x89914735, 0x86894685, 0x6988A789, 0x89A9AA47, 0x868A79A6,
        0x8A78A9AB, 0x7AA9AB9A, 0xA79A89A9, 0x9A89A99A, 0x99A9AA9A, 0xA9980000
      ], [
        0xF4B16C7A, 0xE37C68CA, 0xBE9BEABE, 0xCCE06B37, 0xC8BE58C7, 0x9CABEABE, 0xACECDD68, 0xC79DACE8,
        0xAD9ADBCE, 0xBCEBCEDD, 0xEAACABDC, 0xDEBBDBCD, 0xCDECDECD, 0xEDDD0000
      ]],
    esc_tab: [ 0x01334555, 0x66777788, 0x88999AAA, 0x999BCEED ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
        0xF5364655, 0x58687877, 0xBECDCDBA, 0x48576766, 0x7A798988, 0xDECDDDBB, 0x9C8AAB99, 0xBE9BBCA9,
        0xEECCDEBA, 0x48676766, 0x7A898978, 0xDECDCDBA, 0x6A797977, 0x8B9A9A88, 0xEECDCDBA, 0xADABBCA9,
        0xBEACCDAA, 0xEECDDEBA, 0x9CAB8A99, 0xBDBC9BA9, 0xDEDECCBA, 0xBDBCAB99, 0xBEBDACAA, 0xEEDECDB9,
        0xCECDCDA9, 0xDECDCDA9, 0xEECDCDA8, 0x37575766, 0x79798977, 0xDECDCDBA, 0x59687877, 0x8B8A9A88,
        0xEECDDDBA, 0x9C9AAC99, 0xBEABBCA9, 0xEECDDEBA, 0x59786877, 0x8B8A8A88, 0xEEDDCDBA, 0x7A898988,
        0x9B9A9A99, 0xEECDCDBA, 0xADABBC99, 0xBEABBDA9, 0xEEBDDEA9, 0x9DAB9A99, 0xBEBCABA9, 0xEEDECCBA,
        0xADBCABA9, 0xBEBCACA9, 0xEEDEBCA9, 0xCECDCDA9, 0xDEBDBDA9, 0xEECDCD98, 0x6A798A88, 0x9C9BAB99,
        0xEEDEDECB, 0x7B8A8A99, 0xACABABA9, 0xEEDEEECB, 0xAD9BBCA9, 0xBEACCDAA, 0xEECDEEBA, 0x8B9A8A99,
        0xADABABA9, 0xEEEEDECB, 0x8C9B9B99, 0xADACACAA, 0xEEDEDECB, 0xBEACBCAA, 0xBEACCDAA, 0xEECDDEBA,
        0xAEBCABA9, 0xBECDACAA, 0xEEEECDBA, 0xBEBDACAA, 0xBECDACAA, 0xEEDECDBA, 0xCECDCDA9, 0xCEBDBDA9,
        0xEEBCCD98, 0x9C9A9B99, 0xBEBCBCA9, 0xEEDDDEBA, 0x9C9B9B99, 0xBEABACA9, 0xEEDDDDBA, 0xAD9BAB98,
        0xBEABAC98, 0xEECCCD98, 0x9D9B9B99, 0xBEACBCA9, 0xEEDDDDBA, 0x9D9B9B99, 0xAEACACA9, 0xEEDDDDB9,
        0xAD9BAB98, 0xAE9BAC98, 0xDEACCD98, 0xADAB9B98, 0xBEACAB98, 0xEECDCC98, 0xAEAB9B98, 0xBEACAB98,
        0xDECCBC98, 0xAE9B9B87, 0xAE9B9B87, 0xBE8A9A75
      ], [
        0xF7484979, 0x6A7A8BAB, 0xDEDEEEEE, 0x39598B9A, 0x8C8BADBC, 0xEEEEEEEE, 0x9E9CBEBD, 0xBEBEDECD,
        0xEEEEEEEE, 0x3A7A6A9A, 0x8C9C9CAC, 0xEEEEEEEE, 0x6B8B9CAC, 0x9DADADBC, 0xEEEEEEDE, 0xAEBECECD,
        0xCEBEDECD, 0xEEEEEEDE, 0x9EBD9DBD, 0xBECEADCD, 0xEEEEDEEE, 0xAECEBECD, 0xBEDEBECD, 0xEEEEDEDE,
        0xDEDEDECD, 0xEEDEDECD, 0xEEEEEEDD, 0x18585A8A, 0x6A8A9BAB, 0xEEEEEEDE, 0x4A6A8B9B, 0x8C9BADBC,
        0xEEEEEEEE, 0x8E8DBEBC, 0xBEADDECD, 0xEEDEEEEE, 0x4A7A6B9B, 0x8C9C9CAC, 0xEEEEEEEE, 0x6C8B9CAC,
        0x8D9DADBC, 0xEEDEEEDE, 0xAEADCECD, 0xBEBEDECD, 0xEEDEEEDE, 0x8EBD8DBC, 0xBECEADCD, 0xEEEEDEDE,
        0xAECEAEBD, 0xBECEAECD, 0xEEEEDEDD, 0xDEDEDECD, 0xDEDEDECD, 0xEEDEDECC, 0x3A6A7B9B, 0x8C9B9CBC,
        0xEEEEEEEE, 0x5B7B8CAB, 0x9DACADBC, 0xEEEEEEEE, 0x8E9DBEBC, 0xBEBEDECD, 0xEEEEEEEE, 0x5B8B7CAB,
        0x9DADADBD, 0xEEEEEEEE, 0x7C9C9DAC, 0x9DADADBD, 0xEEEEEEEE, 0xAEAECECD, 0xBEBEDECD, 0xEEDEEEDD,
        0x9EBE9DBC, 0xBECEAECD, 0xEEEEDEEE, 0xAECEAECD, 0xBECEAECD, 0xEEEEDEDD, 0xCECEDECD, 0xCEDECECD,
        0xEEDEDECC, 0x5B7B8B9B, 0x9D9CACAC, 0xEEDEDECC, 0x6C8C8C9B, 0x9DACADAC, 0xEEDEDECC, 0x8E8C9CAB,
        0xAEADBDAB, 0xEEDEDECB, 0x6C8B8C9B, 0x9DADADAC, 0xEEDEDECC, 0x7C9C9CAB, 0x9DADADAC, 0xEEDEDECC,
        0x8E9CADAB, 0x9E9CADAB, 0xDECDDEBB, 0x8D9C8C9B, 0xAEBDADAB, 0xEEDECECB, 0x8EAD9CAB, 0x9EAD9CAB,
        0xDEDEBDBB, 0x9EACAC9A, 0x9DAC9C9A, 0xBDABAB99
      ]],
    l12_tab: [
      [
        0xF3824968, 0x92494597, 0x89679789, 0x99924935, 0x96793595, 0x69789689, 0x78989857, 0xA67A78A6,
        0x7A78A889, 0x89A89999, 0x87897897, 0x78789789, 0x77878878, 0x87760000
      ], [
        0xF4B26C7A, 0xD26C58DA, 0xBD8AEABE, 0xCDE05C37, 0xC8AD47C6, 0x8CAAD9BD, 0xABECCE58, 0xC79D9BD7,
        0xAD8ADABE, 0xACEBCECC, 0xE8AC9ACA, 0xBD9AD9BD, 0xABDACEBC, 0xDBCD0000
      ]],
    l3_tab: [
      [
        0xF3824968, 0xA24946A8, 0x9B78A89A, 0x9AA14936, 0xA78A36A5, 0x7A89A89A, 0x89A99957, 0xA68B89B6,
        0x8B78B99B, 0x89B9ABAA, 0xA79A89A8, 0x9989A89A, 0x89999999, 0x98880000
      ], [
        0xF4B16C9B, 0xE36D58DA, 0xBE9BEABE, 0xCCE05B47, 0xD9BE47C7, 0x8CABEABE, 0xABECCE68, 0xB8ADBCE8,
        0x9D9ACCCE, 0xBCEBDEDE, 0xEAABBBCD, 0xEEBCDBCD, 0xDDECDEDD, 0xEDDE0000
      ]],
    esc_tab: [ 0x02233455, 0x56667788, 0x88999AAA, 0x999BDDDD ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF8484878, 0x6A7A7A89, 0xDECDCDBA, 0x4A597A89,
    0x7B8A8B99, 0xDECDCDBA, 0x8E8BAD99, 0xAE8BBD9A,
    0xDEBCCDAA, 0x4A7A5989, 0x7B8B8A99, 0xDECDCDBA,
    0x6C7B8B89, 0x8C8B8B99, 0xDECDBDBA, 0xAE9CBD9A,
    0xAE9CBD9A, 0xDEBCCDA9, 0x8EAC7B99, 0x9EBD8B9A,
    0xDECEBCAA, 0xAEAD9C99, 0xAEBD9C9A, 0xDECDBCA9,
    0xCEBDBDA9, 0xCEBDBD99, 0xEEBCBC98, 0x29595989,
    0x7B8A8A99, 0xDECDCDBA, 0x4B6A7A89, 0x7C8B8B99,
    0xDECDCDBA, 0x8E8BAC99, 0xAE8BBD9A, 0xDEBCCEA9,
    0x5B7A6A89, 0x7C9B8A99, 0xDECDCCBA, 0x6C8B8B99,
    0x8C8B8B99, 0xDECDCDBA, 0x9E9CAD99, 0xAE9BBD99,
    0xDEACCDA9, 0x8EAC7B99, 0xAEBD8B99, 0xDECEBCA9,
    0x9EAD9C99, 0xAEAD9C9A, 0xDECDACA9, 0xCEBDBD99,
    0xCEACBC99, 0xDEACBC98, 0x5C7B7B99, 0x9D9B9BAA,
    0xEEDDDDBB, 0x6C7B8B9A, 0x9D9BACAA, 0xEEDDDDBB,
    0x9E8CAC99, 0xAE9CBDAA, 0xEEBDDEAA, 0x6C8B8B9A,
    0x9D9C9CAA, 0xEEDDDDBB, 0x7D8B8C9A, 0x9D9C9CAA,
    0xEECDCDBA, 0x9E9CAD9A, 0x9E8CBDAA, 0xDEACCEA9,
    0x9EAC8B99, 0xAEBD9CAA, 0xDEDEBCAA, 0x9EAD9C9A,
    0x9EBD9CAA, 0xDECEACA9, 0xBEBDBD99, 0xAEACAC99,
    0xCEABAC88, 0x8D9C9C99, 0xAEACAC9A, 0xEEDDCDB9,
    0x8D9C8C99, 0xAEACAC99, 0xEEDDCDB9, 0x9D8B9B88,
    0xAE9CAC88, 0xDEBCCC98, 0x8E8C9C99, 0xAEACACAA,
    0xEEDDCDB9, 0x7E8C8C99, 0x9EAC9C9A, 0xEECDCDA9,
    0x8E8B9B88, 0x9E8B9C88, 0xCEABBC98, 0x9E9B8B88,
    0xAE9C9C88, 0xDECCBC98, 0x9E9B8B88, 0x9E9B8B88,
    0xDEBCAB98, 0x9E8B9B77, 0x8D8A8A77, 0x9D798965,
     ], [
    0xFA5C5BAD, 0x7CAD9DCE, 0xEEEEEEEE, 0x4D7D9EBD,
    0x8EAEBEDE, 0xEEEEEEEE, 0x9EAEDEDE, 0xCECEEEEE,
    0xEEEEEEEE, 0x3D9E7DBE, 0x8EBEAEDE, 0xEEEEEEEE,
    0x7EAEAECE, 0x9EBEBEDE, 0xEEEEEEEE, 0xBECEDEDE,
    0xCECEEEEE, 0xEEEEEEEE, 0x9EDEAEDE, 0xBEEEBEEE,
    0xEEEEEEEE, 0xBEDEBEDE, 0xCEEECEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x0B6C6CBC,
    0x7CAD9DCE, 0xEEEEEEEE, 0x4D7D9EBD, 0x8EAEBEDE,
    0xEEEEEEEE, 0x9E9ECECE, 0xCEBEEEEE, 0xEEEEEEEE,
    0x4D9E7DBD, 0x8EBEAEDE, 0xEEEEEEEE, 0x6EAE9ECE,
    0x8EBEAECE, 0xEEEEEEEE, 0xBEBEDEDE, 0xCECEDEDE,
    0xEEEEEEEE, 0x9ECE9EDE, 0xBEEEBEEE, 0xEEEEEEEE,
    0xAEDEBEDE, 0xBEEEBEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x3D8D7DBD, 0x8DAEAEDE,
    0xEEEEEEEE, 0x5E8E9ECD, 0x9EBEBEDE, 0xEEEEEEEE,
    0x9E9ECECE, 0xCECEEEEE, 0xEEEEEEEE, 0x5E9E8ECE,
    0x9ECEBEDE, 0xEEEEEEEE, 0x7EAEAECE, 0x9EBEBEDE,
    0xEEEEEEEE, 0xAEBEDEDE, 0xBEBEDEDE, 0xEEEEEEEE,
    0x8ECE9ECE, 0xBEEEBEDE, 0xEEEEEEEE, 0xAEDEBEDE,
    0xBEDEBEDE, 0xEEEEEEEE, 0xDEEEEEEE, 0xDEEEEEEE,
    0xEEEEEEEE, 0x5D9E8EBD, 0x9EBEAECD, 0xEEEEEEEE,
    0x6E9E9EBD, 0xAEBEBECE, 0xEEEEEEEE, 0x8E9EAEBD,
    0xBEBECECD, 0xEEEEEEDE, 0x6E9E9EBD, 0xAEBEAECE,
    0xEEEEEEEE, 0x7EAE9EBD, 0x9EBEAECD, 0xEEEEEEEE,
    0x8E9EBEBD, 0xAEAEBEBD, 0xEEDEEEDE, 0x8EAE9EBD,
    0xBECEBECD, 0xEEEEEEDE, 0x8EBE9EBD, 0xAEBEAEBD,
    0xEEEEDEDE, 0xAEBEBEAC, 0xAEBDBDBC, 0xCECDBDBC,
      ]],
    l12_tab: [
      [
        0xF4925967, 0x93595697, 0x79789889, 0x88915935, 0x96794695, 0x69779789, 0x88988846, 0x95796795,
        0x7A67A779, 0x78988988, 0x86796796, 0x78689679, 0x77878878, 0x87760000
      ], [
        0xF5D26E7A, 0xE27D68E9, 0xBE8BEACE, 0xCDD05C37, 0xD7AE48E6, 0x8D9BE9BE, 0xABEEEE48, 0xD69D9BE6,
        0x9E7AEACE, 0xACEBCEED, 0xE7AD8AEA, 0xCE8BE9BE, 0xBCEBCEBC, 0xEDCE0000
      ]],
    l3_tab: [
      [
        0xF4926968, 0xA26946A7, 0x8A78A78A, 0x89915936, 0x968A3695, 0x7978A78A, 0x78A89946, 0x957A78A5,
        0x7A68A89A, 0x89A89A99, 0x96797898, 0x99789789, 0x89989989, 0x98880000
      ], [
        0xF3B27C9D, 0xD26D57C9, 0xBC8BD9CD, 0xBCD04B48, 0xCACD47B6, 0x8DBBD9DD, 0xABCDBD57, 0x989CDCC7,
        0xAC9BCCDD, 0xBBDBDDDD, 0xD99BDDDD, 0xDDBBCBAD, 0xDDDDDDCD, 0xDDDD0000
      ]],
    esc_tab: [ 0x01244556, 0x6778999A, 0xAABBCCCC, 0xCCCEEEFF ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF8494978, 0x6A7A7A89, 0xDECDCDBB, 0x4B597A89,
    0x7C7A8B99, 0xDECDCDBB, 0x8E8BAD9A, 0xAE8BBDAA,
    0xDEBCCEAA, 0x3A7A5989, 0x7B8B7A99, 0xDECDCDBB,
    0x6C8A8B89, 0x7C8B8B99, 0xDECDBDBA, 0xAE9CBD9A,
    0xAE9CBDAA, 0xEEBCCEAA, 0x8EAD8B99, 0x9EBD8B9A,
    0xDECEBCAA, 0xAEBD9C9A, 0xAEBD9CAA, 0xDECDBCAA,
    0xCEBDBDAA, 0xCEBDBDA9, 0xEEBDBDA9, 0x2A595989,
    0x7B8A8A99, 0xEECDCCBB, 0x4B6A7A89, 0x7C8B8B99,
    0xEECDCDBB, 0x8E8BAD99, 0xAE8BBD9A, 0xDEBCCEAA,
    0x4B7A6A89, 0x7C9B8B99, 0xEECDCCBB, 0x6C8B7B89,
    0x7C8B8B99, 0xDEBDCDBA, 0x9E9CAD9A, 0xAE8BBD9A,
    0xDEACCDAA, 0x8EAC7B99, 0xAEBD8B9A, 0xDECEBCAA,
    0xAEAD9C9A, 0xAEAD8C9A, 0xDECDACAA, 0xCEBDBDA9,
    0xBEBDBD99, 0xDEACBC98, 0x5C7B7B99, 0x9D9B9BAA,
    0xEEDDDDBB, 0x6C7B8B9A, 0x9D9B9CAA, 0xEEDDDEBB,
    0x9E8CAC9A, 0xAE9CBDAA, 0xEECDDEBA, 0x6D8B8B9A,
    0x9D9C9CAA, 0xEEDDDDCB, 0x7D8B8C9A, 0x8D9C9CAA,
    0xEECECEBB, 0x9E9CAD9A, 0x9E8CBDAA, 0xDEACCEAA,
    0x9EAD8C9A, 0xAEBD9CAA, 0xEEDECDBA, 0x9EBD9CAA,
    0x9EBD9C9A, 0xDECEBCAA, 0xBEBDBDA9, 0xAEACAD99,
    0xCEACAC98, 0x7E9C9C9A, 0xAEACACAA, 0xEEDDCDBA,
    0x8E9C8C9A, 0xAEACACAA, 0xEEDDDDBA, 0x9E8B9C89,
    0xBE9CAC99, 0xEECCCD99, 0x8E9C9C9A, 0xAEACACAA,
    0xEEDDDDBA, 0x7E9C8C9A, 0x9EAC9C9A, 0xEECDDDBA,
    0x8E8B9C89, 0x9E8B9C89, 0xDEABBC98, 0x9E9C8C89,
    0xAEAC9C99, 0xDECDBC98, 0x9E9C8C89, 0x9EAC8C99,
    0xDECCAC98, 0x9E9B9B77, 0x8D8A8B77, 0x9D898A76,
      ], [
    0xFA6C6CBD, 0x7CAEAEDE, 0xEEEEEEEE, 0x3D7E9ECE,
    0x8EAEBEDE, 0xEEEEEEEE, 0x9EAEDEEE, 0xCECEEEEE,
    0xEEEEEEEE, 0x3D9E7DCE, 0x8DCEAEDE, 0xEEEEEEEE,
    0x7EAEAECE, 0x9EBEBEEE, 0xEEEEEEEE, 0xBECEEEEE,
    0xDEDEEEEE, 0xEEEEEEEE, 0x9EDEAEDE, 0xCEEECEEE,
    0xEEEEEEEE, 0xBEEECEEE, 0xDEEECEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x0B6C6CBD,
    0x7CAEADDE, 0xEEEEEEEE, 0x4E7E9ECE, 0x8EAEBEDE,
    0xEEEEEEEE, 0x9EAEDEEE, 0xCECEEEEE, 0xEEEEEEEE,
    0x4E9E7DCE, 0x8ECEAEDE, 0xEEEEEEEE, 0x6EAEAECE,
    0x8EBEBEDE, 0xEEEEEEEE, 0xBECEDEDE, 0xCECEEEEE,
    0xEEEEEEEE, 0x9EDE9EDE, 0xCEEECEEE, 0xEEEEEEEE,
    0xBEDEBEEE, 0xCEEECEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x3D8E8ECE, 0x8DBEAEDE,
    0xEEEEEEEE, 0x5E8E9ECE, 0x9EBECEDE, 0xEEEEEEEE,
    0x9EAECEDE, 0xCECEEEEE, 0xEEEEEEEE, 0x5E9E8ECE,
    0x9ECEBEDE, 0xEEEEEEEE, 0x7EAEAECE, 0x9ECEBEDE,
    0xEEEEEEEE, 0xAEBEDEDE, 0xBEBEEEEE, 0xEEEEEEEE,
    0x8ECE9EDE, 0xCEEECEEE, 0xEEEEEEEE, 0xAEDEBEEE,
    0xBEEEBEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xDEEEEEEE,
    0xEEEEEEEE, 0x5E9E8EBE, 0x9EBEAECE, 0xEEEEEEEE,
    0x6E9E9EBE, 0xAEBEBECE, 0xEEEEEEEE, 0x8E9EBEBE,
    0xBEBECECE, 0xEEEEEEEE, 0x6E9E9EBE, 0xAEBEBECE,
    0xEEEEEEEE, 0x7EAE9EBE, 0x9EBEBECE, 0xEEEEEEEE,
    0x9EAEBEBE, 0xAEAECECE, 0xEEEEEEEE, 0x8EBE9EBE,
    0xBEDEBECE, 0xEEEEEEEE, 0x9EBEAECE, 0xAECEAECE,
    0xEEEEDEEE, 0xAEBEBEBD, 0xAEBEBEBD, 0xDECECECD,
      ]],
    l12_tab: [
      [
        0xF4925967, 0xA3595697, 0x89789889, 0x99915935, 0x96793695, 0x69779789, 0x78998946, 0x957A68A5,
        0x7A67A78A, 0x78A88A98, 0x96796897, 0x89689779, 0x77878978, 0x97770000
      ], [
        0xF5D26D7A, 0xD27D68D9, 0xBD8BDACD, 0xDDD05C37, 0xD8AD47D6, 0x8DABD8BD, 0xBCDDDD47, 0xD69D9CD6,
        0x9D8ADBBD, 0xACDBDDDD, 0xD7AD8BDA, 0xDD8BD9BD, 0xCCDBDDCD, 0xDDCD0000
      ]],
    l3_tab: [
      [
        0xF4925A68, 0xB25A46A7, 0x8A78A78A, 0x99A14936, 0x978B36A5, 0x6A78A78A, 0x88A99A46, 0x957A89B5,
        0x7A68A89B, 0x89B89B9A, 0xA78978A9, 0x9A78A89A, 0x99A99A99, 0xA9990000
      ], [
        0xF3D26DAE, 0xE26E58BA, 0xBEADDBDD, 0xDDD04848, 0xDADD47D6, 0x8DBDDDBD, 0xDDDBDD56, 0x979DBBD8,
        0xADABDDDD, 0xBDDADDDD, 0xDB9BBBDD, 0xDDDBDDDD, 0xDDDDDDDD, 0xDDDD0000
      ]],
    esc_tab: [ 0x01234577, 0x8899ABBB, 0xCCDDDEEE, 0xEEEEEFFE ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF8494989, 0x6A7A7A9A, 0xEEDEDDCC, 0x3B5A7A89,
    0x7C8B8B9A, 0xEECDDECC, 0x9E8CBDAB, 0xAE9CBEAB,
    0xEECDDECC, 0x3A7A5A89, 0x7B8B8A9A, 0xEEDEDDCC,
    0x6C8B8B9A, 0x7C8B8B9A, 0xDECECDBC, 0xAEADBEAB,
    0xBE9DBEAB, 0xEECDDECC, 0x8EBD8CAA, 0xAECE9CAB,
    0xEEEECDCC, 0xAEBD9DAB, 0xBECEADAB, 0xEEEECDBB,
    0xDECECEBB, 0xDECECEBB, 0xEEDEDEBB, 0x1A5A5989,
    0x7B8B8A9A, 0xEEDDDDCC, 0x4B6A7A89, 0x7C8B9B9A,
    0xEECDDECC, 0x8E8CAD9A, 0xAE9CBDAB, 0xEECDEECB,
    0x4B7B6A89, 0x7C9B8B9A, 0xEEDECDCC, 0x6C8B8B9A,
    0x7C8B8B9A, 0xEECDCEBC, 0xAE9DBDAB, 0xAE9CBDAB,
    0xEEBDDEBB, 0x8EBD7C9A, 0xAEBE9CAB, 0xEEEECDCB,
    0xAEBD9DAB, 0xAEBE9CAB, 0xEEDEBDBB, 0xCECECEBB,
    0xCEBDCEBB, 0xEECDCDBA, 0x5C7B7B9A, 0x9D9C9CAB,
    0xEEEEDECC, 0x6D7C8C9A, 0x9E9CACAB, 0xEEDEEEDC,
    0x9E8CADAB, 0xBEADCEBB, 0xEEDEEECC, 0x6D8C8C9A,
    0x9DAD9CAB, 0xEEEEDECC, 0x7D9C8CAB, 0x8E9C9CAB,
    0xEEDEDECC, 0x9E9DBDAB, 0x9E8DBDAB, 0xEEBDEECB,
    0x9EAD8CAA, 0xBECEADAB, 0xEEEEDECC, 0xAEBE9DAB,
    0xAEBE9CAB, 0xEEEECDCB, 0xCECECEBB, 0xBEBDBDBB,
    0xCEBCBDAA, 0x7E9D9DAB, 0xAEBDADAB, 0xEEEEDECB,
    0x8E9D9CAB, 0xAEADADAB, 0xEEEEEECB, 0x9E9CAC9A,
    0xBEADADAA, 0xEEDDDEBA, 0x8E9D9DAB, 0xBEADADAB,
    0xEEEEEECB, 0x8E9D9DAB, 0xAEADADAB, 0xEEDEDECB,
    0x8E8CAC9A, 0xAE8CAD9A, 0xEEBDCDBA, 0x9EAC9D9A,
    0xBEBDADAA, 0xEEDEDDBA, 0x9EAD9D9A, 0xAEAD9D9A,
    0xEEDDCDBA, 0x9E9CAC89, 0x9E9B9C99, 0xBEAAAB98,
      ], [
    0xFB6D6DCD, 0x7CADAEDE, 0xEEDDDDDD, 0x4D7DADDD,
    0x9DBDDDDD, 0xDDDDDDDD, 0xADADDDDD, 0xCDDDDDDD,
    0xDDDDDEEE, 0x3EAE7EDE, 0x9ECEBEEE, 0xEEEEEEEE,
    0x7EBEBECE, 0x9ECECEEE, 0xEEEEEEEE, 0xCEDEEEEE,
    0xDEDEEEEE, 0xEEEEEEEE, 0x9EEEAEEE, 0xDEEECEEE,
    0xEEEEEEEE, 0xCEEECEEE, 0xDEEEDEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x0C7D6ECE,
    0x7CBEAEEE, 0xEEEEEEEE, 0x4E8E9ECE, 0x9EBECEEE,
    0xEEEEEEEE, 0x9EAEEEEE, 0xDEDEEEEE, 0xEEEEEEEE,
    0x4EAE7EDE, 0x9ECEBEEE, 0xEEEEEEEE, 0x7EBEAEDE,
    0x8ECEBEEE, 0xEEEEEEEE, 0xBECEEEEE, 0xCECEEEEE,
    0xEEEEEEEE, 0x9EEEAEEE, 0xCEEECEEE, 0xEEEEEEEE,
    0xBEEECEEE, 0xCEEECEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x2E8E8ECE, 0x8DBEBEDE,
    0xEEEEEEEE, 0x5E9E9EDE, 0xAECEDEEE, 0xEEEEEEEE,
    0x9EAEDEEE, 0xCEDEEEEE, 0xEEEEEEEE, 0x5EAE8ECE,
    0xAEDEBEEE, 0xEEEEEEEE, 0x7EBEAEDE, 0x9ECECEEE,
    0xEEEEEEEE, 0xBECEEEEE, 0xCECEEEEE, 0xEEEEEEEE,
    0x9EEE9EEE, 0xCEEECEEE, 0xEEEEEEEE, 0xBEEEBEEE,
    0xBEEECEEE, 0xEEEEEEEE, 0xDEEEEEEE, 0xDEEEEEEE,
    0xEEEEEEEE, 0x5E9E9ECE, 0x9EBEBEDE, 0xEEEEEEEE,
    0x6E9E9ECE, 0xAECEBEDE, 0xEEEEEEEE, 0x9EAEBECE,
    0xDECECEDE, 0xEEEEEEEE, 0x6EAE9ECE, 0xAECEBEDD,
    0xDDDDDDDD, 0x7DAD9DCD, 0xADCDBDDD, 0xDDDDDDDD,
    0x9DADCDCD, 0xBDBDCDDD, 0xDDDDDDDD, 0x8DBD9DCD,
    0xCDDDBDDD, 0xDDDDDDDD, 0x9DCDADCD, 0xBDCDADDD,
    0xDDDDDDDD, 0xADCDCDCD, 0xBDDDBDCD, 0xDDDDDDDD,
      ]],
    l12_tab: [
      [
        0xF5B26B79, 0xC36B57B8, 0x9B89B99B, 0xABC05A36, 0xB78C47B5, 0x7B89B79B, 0x99BAAB57, 0xB68B89C6,
        0x8B68B99C, 0x8AB99CAA, 0xB79B89B8, 0x9B89B89B, 0x99B9AB99, 0xB9AA0000
      ], [
        0xF5D27E8B, 0xE27E68EA, 0xBE9CDBDE, 0xEEE06B37, 0xC9BC38E7, 0x8EBCE9CE, 0xBDEDED48, 0xC69EABC6,
        0xAE8BEBEE, 0x9CDCCDCE, 0xE8AD9CEA, 0xCD8CEABE, 0xCEECCEBC, 0xDDDD0000
      ]],
    l3_tab: [
      [
        0xF4B26B8A, 0xC26B57B8, 0xAC89C99D, 0xABC05A46, 0xB8AC47A5, 0x7B9AC8AC, 0x9ACBBC57, 0xB78B9BC7,
        0x8B79BABD, 0x9BCABCBC, 0xD89B9ABC, 0xCC9ABABC, 0xBCCBBCBB, 0xDBCC0000
      ], [
        0xF4D29DDD, 0xD27D57D8, 0xDD8DDDDD, 0xDDD04D48, 0xD7DD38D6, 0xDDDDDDDD, 0xDDDDDD46, 0xD88DDDDD,
        0xDD9DDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDD9DDDDD, 0xEEEEEEEE, 0xDDDD0000
      ]],
    esc_tab: [ 0x01234577, 0x8899ABBD, 0xDDDDDDDD, 0xDDDDDEED ],
   },
];
const RV60_INTER_COEFFS_CB_DESC: [CoeffsCBDesc; NUM_INTER_SETS] = [
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF5354544, 0x57676765, 0xACAABA97, 0x57566765,
    0x79788876, 0xCDBBCBA8, 0x9B89AA87, 0xBDAABB98,
    0xDECCDDB9, 0x57676765, 0x79888876, 0xCDBBCBA8,
    0x79788876, 0x9B999987, 0xDECBCCA8, 0xBDAABB98,
    0xDEBBCCA8, 0xEEDDDDB9, 0x9B9A9A87, 0xBDBBBB98,
    0xDECCDCA8, 0xBDABBB98, 0xDECBCBA8, 0xEEDDDDB9,
    0xCEBCCCA8, 0xEEDDDDB9, 0xEEDDEDB8, 0x47565765,
    0x79788876, 0xBDBBBBA8, 0x69787876, 0x9B999987,
    0xDEBBCCA8, 0xAC9ABB98, 0xCEBBCCA8, 0xEECCDDB9,
    0x69787876, 0x9B999987, 0xDECCCCA8, 0x8A899987,
    0xACAAAA97, 0xEECCDCB9, 0xCDABCCA8, 0xDEBCCCA8,
    0xEEDDEDB9, 0xACAAAA97, 0xCEBBBBA8, 0xEEDDDCB9,
    0xCEBBBBA8, 0xDECCCCA8, 0xEEDDDDB9, 0xDECCDDB9,
    0xEEDDDDB9, 0xEEDDEDB8, 0x7A898987, 0xACAAAB98,
    0xDECCDDB9, 0x9B9AAA98, 0xCDBBBBA8, 0xEEDDEDB9,
    0xBEABCCA9, 0xDECCDDB9, 0xEEDDEECA, 0x9CAA9A98,
    0xCDBBBBA8, 0xEEDDEDB9, 0xBDABBBA8, 0xCECCCCA9,
    0xEEEDEDCA, 0xDEBCDDB9, 0xEECCDDB9, 0xEEEEEEC9,
    0xBEBCBBA9, 0xDEDDCCB9, 0xEEEEEDC9, 0xDECCCCB9,
    0xEEDDDDB9, 0xEEEEEEC9, 0xEEDDDDB9, 0xEEDDEEB9,
    0xEEEDEEB9, 0xACABABA9, 0xCECCCCB9, 0xEEDDEECA,
    0xBDBBBCA9, 0xDECCDDB9, 0xEEEEEECA, 0xCEBCCDA9,
    0xEECCDDB9, 0xEEDDEEB9, 0xBDBCBCA9, 0xDECDCCB9,
    0xEEEEEECA, 0xCECCCCB9, 0xEEDDDDBA, 0xEEEEEECA,
    0xDECCDDB9, 0xEECDEDB9, 0xEEDDEEB9, 0xCECDBCA9,
    0xEEDDCCB9, 0xEEEEEDB9, 0xDEDDCCB9, 0xEEDDDDB9,
    0xEEEEEDB9, 0xEECDDDA8, 0xEEDDDDA8, 0xEECCDCA7,
      ], [
    0xF5263656, 0x48687978, 0xCECCDDBB, 0x38576978,
    0x7A899A99, 0xEEDDDECB, 0xADABCDAA, 0xCEBCDEBB,
    0xEEEEEEED, 0x48686878, 0x7A899A99, 0xEEDDDECB,
    0x7A899A99, 0xACAAABAA, 0xEEDDEECC, 0xCEBCDEBB,
    0xEEDDEECC, 0xEEEEEEED, 0xBDBCACBA, 0xDECDCDCB,
    0xEEEEEEED, 0xCECDCDBB, 0xEEDDDECC, 0xEEEEEEED,
    0xEEEEEEDD, 0xEEEEEEED, 0xEEEEEEEE, 0x17475867,
    0x69798988, 0xDECCDDCB, 0x59687988, 0x8B9AAB99,
    0xEEDDEECB, 0xBDABCDBA, 0xDECCDECB, 0xEEEEEEED,
    0x59797988, 0x8B9A9B99, 0xEEDDEECC, 0x8B8A9B99,
    0xACABBCAA, 0xEEDDEEDC, 0xDECCDECB, 0xEECDEECC,
    0xEEEEEEED, 0xBEBCACBB, 0xDEDDCDCB, 0xEEEEEEED,
    0xDECDCDCB, 0xEEDEDECC, 0xEEEEEEED, 0xEEEEEEDD,
    0xEEEEEEED, 0xEEEEEEED, 0x6A898A99, 0xACABBCAA,
    0xEEEEEEDC, 0x8C9AACAA, 0xBDBCCDBB, 0xEEEEEEDD,
    0xCEBDDECB, 0xEEDDEEDC, 0xEEEEEEEE, 0x9C9B9BAA,
    0xBDBCBCBB, 0xEEEEEEDD, 0xADBBBCBA, 0xCECCCDBB,
    0xEEEEEEED, 0xEEDDEEDC, 0xEEDEEEDC, 0xEEEEEEED,
    0xCEDDBDCB, 0xEEEEDEDC, 0xEEEEEEEE, 0xEEEEDECC,
    0xEEEEDEDC, 0xEEEEEEED, 0xEEEEEEED, 0xEEEEEEED,
    0xEEEEEEED, 0x9DACBDBB, 0xCECDDECB, 0xEEEEEEED,
    0xBEBCCDBB, 0xDEDDDECC, 0xEEEEEEED, 0xDECDEECC,
    0xEEDEEEDC, 0xEEEEEEED, 0xBECCBDBB, 0xDEDDDECC,
    0xEEEEEEED, 0xCECDCECC, 0xEEDEEECC, 0xEEEEEEED,
    0xDEDEEEDC, 0xEEDEEEDC, 0xEEEEEEED, 0xCEDEBECC,
    0xEEEEDEDC, 0xEEEEEEED, 0xDEEEDECC, 0xEEEEDEDC,
    0xEEEEEEED, 0xEEEEEEDC, 0xEEEEEEDC, 0xEEEEEECB,
      ]],
    l12_tab: [
      [
        0xF3624757, 0x82474577, 0x78568678, 0x78824735, 0x86784575, 0x68788678, 0x78888857, 0x86797896,
        0x79789899, 0x78989999, 0x979989A8, 0x9989989A, 0x99989989, 0x98880000
      ], [
        0xF3815978, 0xB2594698, 0x9B78A89B, 0xABC14936, 0x979B4695, 0x7A99B79B, 0x89BBBC68, 0xA78B9AC7,
        0x8B89BABC, 0x9ACABCCC, 0xC9ACABDB, 0xCD9BCABD, 0xBCDABDBC, 0xDCCC0000
      ]],
    l3_tab: [
      [
        0xF3624757, 0x82474586, 0x78578778, 0x78824735, 0x76784575, 0x68789678, 0x78989847, 0x86797896,
        0x79789899, 0x79989999, 0x979A89A8, 0x9989A99A, 0x9999AA9A, 0xA9980000
      ], [
        0xF2915A69, 0xC25A47B8, 0xAD89C9AD, 0xCCE15A36, 0xB79D47B6, 0x8B9AD9AD, 0xABDCDE68, 0xB79CACE8,
        0x9C9ADBCE, 0xBCEBCEDD, 0xEABDBCED, 0xDEBCECDE, 0xDEEDDEDD, 0xEEEE0000
      ]],
    esc_tab: [ 0x01235566, 0x788899AA, 0xABBBBBCC, 0xBBBCEEEE ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF5354544, 0x57676765, 0xACAABA97, 0x57566765,
    0x79788876, 0xCDBBCBA8, 0x9B89AA87, 0xBDAABB98,
    0xDECCDDB9, 0x57676765, 0x79888876, 0xCDBBCBA8,
    0x79788876, 0x9B999987, 0xDECBCCA8, 0xBDAABB98,
    0xDEBBCCA8, 0xEEDDDDB9, 0x9B9A9A87, 0xBDBBBB98,
    0xDECCDCA8, 0xBDABBB98, 0xDECBCBA8, 0xEEDDDDB9,
    0xCEBCCCA8, 0xEEDDDDB9, 0xEEDDEDB8, 0x47565765,
    0x79788876, 0xBDBBBBA8, 0x69787876, 0x9B999987,
    0xDEBBCCA8, 0xAC9ABB98, 0xCEBBCCA8, 0xEECCDDB9,
    0x69787876, 0x9B999987, 0xDECCCCA8, 0x8A899987,
    0xACAAAA97, 0xEECCDCB9, 0xCDABCCA8, 0xDEBCCCA8,
    0xEEDDEDB9, 0xACAAAA97, 0xCEBBBBA8, 0xEEDDDCB9,
    0xCEBBBBA8, 0xDECCCCA8, 0xEEDDDDB9, 0xDECCDDB9,
    0xEEDDDDB9, 0xEEDDEDB8, 0x7A898987, 0xACAAAB98,
    0xDECCDDB9, 0x9B9AAA98, 0xCDBBBBA8, 0xEEDDEDB9,
    0xBEABCCA9, 0xDECCDDB9, 0xEEDDEECA, 0x9CAA9A98,
    0xCDBBBBA8, 0xEEDDEDB9, 0xBDABBBA8, 0xCECCCCA9,
    0xEEEDEDCA, 0xDEBCDDB9, 0xEECCDDB9, 0xEEEEEEC9,
    0xBEBCBBA9, 0xDEDDCCB9, 0xEEEEEDC9, 0xDECCCCB9,
    0xEEDDDDB9, 0xEEEEEEC9, 0xEEDDDDB9, 0xEEDDEEB9,
    0xEEEDEEB9, 0xACABABA9, 0xCECCCCB9, 0xEEDDEECA,
    0xBDBBBCA9, 0xDECCDDB9, 0xEEEEEECA, 0xCEBCCDA9,
    0xEECCDDB9, 0xEEDDEEB9, 0xBDBCBCA9, 0xDECDCCB9,
    0xEEEEEECA, 0xCECCCCB9, 0xEEDDDDBA, 0xEEEEEECA,
    0xDECCDDB9, 0xEECDEDB9, 0xEEDDEEB9, 0xCECDBCA9,
    0xEEDDCCB9, 0xEEEEEDB9, 0xDEDDCCB9, 0xEEDDDDB9,
    0xEEEEEDB9, 0xEECDDDA8, 0xEEDDDDA8, 0xEECCDCA7,
      ], [
    0xF5263656, 0x48687978, 0xCECCDDBB, 0x38576978,
    0x7A899A99, 0xEEDDDECB, 0xADABCDAA, 0xCEBCDEBB,
    0xEEEEEEED, 0x48686878, 0x7A899A99, 0xEEDDDECB,
    0x7A899A99, 0xACAAABAA, 0xEEDDEECC, 0xCEBCDEBB,
    0xEEDDEECC, 0xEEEEEEED, 0xBDBCACBA, 0xDECDCDCB,
    0xEEEEEEED, 0xCECDCDBB, 0xEEDDDECC, 0xEEEEEEED,
    0xEEEEEEDD, 0xEEEEEEED, 0xEEEEEEEE, 0x17475867,
    0x69798988, 0xDECCDDCB, 0x59687988, 0x8B9AAB99,
    0xEEDDEECB, 0xBDABCDBA, 0xDECCDECB, 0xEEEEEEED,
    0x59797988, 0x8B9A9B99, 0xEEDDEECC, 0x8B8A9B99,
    0xACABBCAA, 0xEEDDEEDC, 0xDECCDECB, 0xEECDEECC,
    0xEEEEEEED, 0xBEBCACBB, 0xDEDDCDCB, 0xEEEEEEED,
    0xDECDCDCB, 0xEEDEDECC, 0xEEEEEEED, 0xEEEEEEDD,
    0xEEEEEEED, 0xEEEEEEED, 0x6A898A99, 0xACABBCAA,
    0xEEEEEEDC, 0x8C9AACAA, 0xBDBCCDBB, 0xEEEEEEDD,
    0xCEBDDECB, 0xEEDDEEDC, 0xEEEEEEEE, 0x9C9B9BAA,
    0xBDBCBCBB, 0xEEEEEEDD, 0xADBBBCBA, 0xCECCCDBB,
    0xEEEEEEED, 0xEEDDEEDC, 0xEEDEEEDC, 0xEEEEEEED,
    0xCEDDBDCB, 0xEEEEDEDC, 0xEEEEEEEE, 0xEEEEDECC,
    0xEEEEDEDC, 0xEEEEEEED, 0xEEEEEEED, 0xEEEEEEED,
    0xEEEEEEED, 0x9DACBDBB, 0xCECDDECB, 0xEEEEEEED,
    0xBEBCCDBB, 0xDEDDDECC, 0xEEEEEEED, 0xDECDEECC,
    0xEEDEEEDC, 0xEEEEEEED, 0xBECCBDBB, 0xDEDDDECC,
    0xEEEEEEED, 0xCECDCECC, 0xEEDEEECC, 0xEEEEEEED,
    0xDEDEEEDC, 0xEEDEEEDC, 0xEEEEEEED, 0xCEDEBECC,
    0xEEEEDEDC, 0xEEEEEEED, 0xDEEEDECC, 0xEEEEDEDC,
    0xEEEEEEED, 0xEEEEEEDC, 0xEEEEEEDC, 0xEEEEEECB,
      ]],
    l12_tab: [
      [
        0xF3624757, 0x82474577, 0x78568678, 0x78824735, 0x86784575, 0x68788678, 0x78888857, 0x86797896,
        0x79789899, 0x78989999, 0x979989A8, 0x9989989A, 0x99989989, 0x98880000
      ], [
        0xF3815978, 0xB2594698, 0x9B78A89B, 0xABC14936, 0x979B4695, 0x7A99B79B, 0x89BBBC68, 0xA78B9AC7,
        0x8B89BABC, 0x9ACABCCC, 0xC9ACABDB, 0xCD9BCABD, 0xBCDABDBC, 0xDCCC0000
      ]],
    l3_tab: [
      [
        0xF3624757, 0x82474586, 0x78578778, 0x78824735, 0x76784575, 0x68789678, 0x78989847, 0x86797896,
        0x79789899, 0x79989999, 0x979A89A8, 0x9989A99A, 0x9999AA9A, 0xA9980000
      ], [
        0xF2915A69, 0xC25A47B8, 0xAD89C9AD, 0xCCE15A36, 0xB79D47B6, 0x8B9AD9AD, 0xABDCDE68, 0xB79CACE8,
        0x9C9ADBCE, 0xBCEBCEDD, 0xEABDBCED, 0xDEBCECDE, 0xDEEDDEDD, 0xEEEE0000
      ]],
    esc_tab: [ 0x01235566, 0x788899AA, 0xABBBBBCC, 0xBBBCEEEE ],
   },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF4343444, 0x57676765, 0xBDBBBBA9, 0x47566765,
    0x79788877, 0xCECCCCB9, 0xAC9AAB98, 0xCEBBCCA9,
    0xEEDDEECA, 0x47575665, 0x79888877, 0xCECCCCB9,
    0x79788877, 0x9B9A9A98, 0xEEDDDDBA, 0xBEBBCCA9,
    0xDECCDDBA, 0xEEEEEECA, 0xACAB9A98, 0xCDBCBBA9,
    0xEEDDDDCA, 0xBEBCBBA9, 0xDECCCCBA, 0xEEEEEECA,
    0xEEDDDECA, 0xEEEEEECA, 0xEEEEEECA, 0x37565665,
    0x79788877, 0xCECCCCB9, 0x69787877, 0x9B999A88,
    0xDEDDDDBA, 0xAD9BBCA9, 0xCEBCCDB9, 0xEEEEEECA,
    0x69787877, 0x9B9A9988, 0xDEDDDDBA, 0x8B999988,
    0xACABAB98, 0xEEDDDDCA, 0xCEBCCCB9, 0xDECCDDBA,
    0xEEEEEECA, 0xBDBBABA9, 0xCECCBCB9, 0xEEEEEDCA,
    0xCECCBCA9, 0xDEDDCCBA, 0xEEEEEECA, 0xEEDEEECA,
    0xEEEEEECA, 0xEEEEEECA, 0x7A8A9A98, 0xADABBBA9,
    0xEEEEEEDB, 0x9C9BABA9, 0xCEBCCCBA, 0xEEEEEEDB,
    0xCEBCDDBA, 0xEECDEECB, 0xEEEEEEDB, 0x9CABABA9,
    0xCECCBCBA, 0xEEEEEEDB, 0xBDBCBCAA, 0xCECDCDBA,
    0xEEEEEEDB, 0xDECDDECB, 0xEEDDEECB, 0xEEEEEEDB,
    0xCECDBCBA, 0xEEDECDCA, 0xEEEEEEDB, 0xDEDECDCA,
    0xEEEEDDCB, 0xEEEEEEDB, 0xEEEEEECB, 0xEEEEEECB,
    0xEEEEEECA, 0xACACBCAA, 0xCECDCDBB, 0xEEEEEEDB,
    0xBEBCCDBA, 0xDEDDDDCB, 0xEEEEEEDB, 0xCEBCDDBA,
    0xEECDEECA, 0xEEEEEECA, 0xBECDBCBA, 0xDEDEDDCB,
    0xEEEEEEDB, 0xCECDCDBB, 0xEEDEDECB, 0xEEEEEEDB,
    0xDECDDEBA, 0xEEDDEECA, 0xEEEEEECA, 0xCEDDBCBA,
    0xEEEECDBA, 0xEEEEEECA, 0xDEDECDBA, 0xEEEECDCA,
    0xEEEEEECA, 0xEEDDDDB9, 0xEEDDDDB9, 0xEECDDDA8,
      ], [
    0xF4263657, 0x48687989, 0xCECDDEDD, 0x38586978,
    0x7A8A9B9A, 0xEEDEEEEE, 0xADACCECC, 0xDECEEEDD,
    0xEEEEEEEE, 0x38686878, 0x7A8A8A9A, 0xEEDEEEDE,
    0x7A8A9B9A, 0x9CACACBB, 0xEEEEEEEE, 0xDECEDEDD,
    0xEEDEEEEE, 0xEEEEEEEE, 0xBEBDADBC, 0xDEDECEDD,
    0xEEEEEEEE, 0xDEDECEDD, 0xEEEEDEDE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x17475868,
    0x69798A9A, 0xDEDEEEDD, 0x59698A89, 0x8B9BACAB,
    0xEEEEEEEE, 0xBEADDECC, 0xDECEEEDD, 0xEEEEEEEE,
    0x59797A89, 0x8B9B9BAB, 0xEEEEEEEE, 0x8B9B9BAB,
    0xADACBDBC, 0xEEEEEEEE, 0xDECEEEDE, 0xEEDEEEEE,
    0xEEEEEEEE, 0xBECEADCC, 0xDEEECEDD, 0xEEEEEEEE,
    0xDEDECEDD, 0xEEEEDEDE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x6A8A8B9A, 0x9CACBCBC,
    0xEEEEEEEE, 0x8C9BACAB, 0xBEBDCECD, 0xEEEEEEEE,
    0xCEBEDEDD, 0xEEDEEEEE, 0xEEEEEEEE, 0x8C9C9CAB,
    0xBECDBDCD, 0xEEEEEEEE, 0xAEBDBDCC, 0xBECECECD,
    0xEEEEEEEE, 0xEEDEEEEE, 0xEEDEEEEE, 0xEEEEEEEE,
    0xCEDEBECD, 0xEEEEDEDE, 0xEEEEEEEE, 0xDEEEDEDE,
    0xEEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x9DBDBDCC, 0xCECEDEDD, 0xEEEEEEEE,
    0xAEBECECD, 0xDEDEDEDD, 0xEEEEEEEE, 0xCECEDEDD,
    0xEEDEEEEE, 0xEEEEEEEE, 0xAECEBECD, 0xDEDEDEDD,
    0xEEEEEEEE, 0xBECECEDD, 0xDEDEDEDE, 0xEEEEEEEE,
    0xDEDEEEDD, 0xEEDEEEDE, 0xEEEEEEEE, 0xBEDEBECD,
    0xEEEEDEDD, 0xEEEEEEEE, 0xCEEECEDD, 0xDEEECEDD,
    0xEEEEEEEE, 0xEEEEEEED, 0xDEEEDEDD, 0xEEEEDEDC,
      ]],
    l12_tab: [
      [
        0xF2724868, 0x92484688, 0x8A679789, 0x9AA14846, 0x978A4585, 0x6989A789, 0x88A9AA67, 0xA78A89B7,
        0x8A89A9AB, 0x89A9AAAA, 0xA8AB9AB9, 0xAA9AB9AB, 0xAAA9AA9A, 0xAA990000
      ], [
        0xF2915A89, 0xD25A57B9, 0xBD79C9AD, 0xCDE14A46, 0xB8AD36B6, 0x7BABD8AC, 0xAADCDE68, 0xC8ADACE7,
        0x9D9ADBCE, 0x9BDBCDDD, 0xDABDBCDC, 0xDDACDBCD, 0xCDEBDECD, 0xDDDD0000
      ]],
    l3_tab: [
      [
        0xF2724868, 0x92484698, 0x9A68989A, 0x9AA14836, 0x978A4695, 0x7989A78A, 0x89AAAA58, 0xA78A9AB7,
        0x9A89BAAB, 0x9ABAABBB, 0xB9ABAABA, 0xBBABCABC, 0xBBBBBBBB, 0xBBBA0000
      ], [
        0xF4B16C9B, 0xF27C69DB, 0xCFABFBDF, 0xEFF06C48, 0xDACF58D7, 0xAECDFBCF, 0xCDFEEF8A, 0xDABFDEFA,
        0xCFBCFEFF, 0xDEFEEFFF, 0xFDEFEEFF, 0xFFEFFEFF, 0xFFFFFFFF, 0xFFFE0000
      ]],
    esc_tab: [ 0x01235566, 0x788899AA, 0xABBBBCCC, 0xBBBCDDDD ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF4243444, 0x47576766, 0xCDBCCCBA, 0x47566766,
    0x79798988, 0xDECDDDBA, 0xAD9BBCA9, 0xCEBCCDBA,
    0xEEDEEECB, 0x47575666, 0x79898888, 0xDECCCCBA,
    0x79798988, 0x9B9A9A99, 0xEEDDDDCB, 0xBEBCCDBA,
    0xDECDDEBB, 0xEEEEEECB, 0xACAB9A99, 0xBECCBBAA,
    0xEEDEDDCB, 0xBECCBCBA, 0xDECDCDBA, 0xEEEEEECB,
    0xEEDEDECB, 0xEEEEEECB, 0xEEEEEECB, 0x36565766,
    0x79798988, 0xDECDDDCA, 0x69687977, 0x9B9A9A99,
    0xEEDDDDCB, 0xAD9BBCAA, 0xCEBCDDBA, 0xEEEEEECB,
    0x69797877, 0x9B9A9A99, 0xEEDDDDCB, 0x8B9A9A99,
    0xACABABA9, 0xEEDEDECB, 0xCEBCCDBA, 0xDECDDECB,
    0xEEEEEECB, 0xADBC9BAA, 0xCECDBCBA, 0xEEEEEECB,
    0xCECDBCBA, 0xDEDECDBB, 0xEEEEEECB, 0xEEDEDECB,
    0xEEEEEECB, 0xEEEEEECA, 0x7B8A9A99, 0xADBCBCBA,
    0xEEEEEEDC, 0x9C9BABAA, 0xBEBCCDBB, 0xEEEEEEDC,
    0xBEACCEBB, 0xDECDEECB, 0xEEEEEEDC, 0x9CAB9BAA,
    0xBECDBCBB, 0xEEEEEEDC, 0xADBCBCBA, 0xCECDCDCB,
    0xEEEEEEDC, 0xDECDDECB, 0xDECEEECB, 0xEEEEEEDC,
    0xBECDACBA, 0xDEDECDCB, 0xEEEEEEDC, 0xDEDECDCB,
    0xDEEECDCB, 0xEEEEEEDB, 0xEEEEEEDB, 0xEEEEEECB,
    0xEEDEEECA, 0x9CACACBB, 0xCECDCDCB, 0xEEEEEEDC,
    0xAEBDBDBB, 0xDECEDECB, 0xEEEEEEDC, 0xBEBDCEBA,
    0xEECDDECB, 0xEEEEEECB, 0xAEBDBCBB, 0xDEDECDCB,
    0xEEEEEEDC, 0xBECDCDCB, 0xDEDEDECC, 0xEEEEEEDC,
    0xCECDDEBB, 0xDECDDECB, 0xEEDEEECA, 0xBECEACBA,
    0xDEDECDBB, 0xEEEEEECA, 0xCEDEBDBA, 0xDEDECDBB,
    0xEEEEDECA, 0xDECDCDBA, 0xDECDCDBA, 0xEECDCCA8,
      ], [
    0xF5262668, 0x4869799A, 0xEEEEEEEE, 0x38597A8A,
    0x7B9B9CAC, 0xEEEEEEEE, 0xBEBEDEDE, 0xDEDEEEEE,
    0xEEEEEEEE, 0x3869598A, 0x7B9C9BAC, 0xEEEEEEEE,
    0x7B9C9CAC, 0x9DBDBDCD, 0xEEEEEEEE, 0xDEDEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xBEDEAECE, 0xDEEECEEE,
    0xEEEEEEEE, 0xDEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x17485879,
    0x6A8B8BAB, 0xEEEEEEEE, 0x5A6A8B9B, 0x8CACADBD,
    0xEEEEEEEE, 0xBEBEDEDE, 0xDEDEEEEE, 0xEEEEEEEE,
    0x5A7B7A9B, 0x8CAD9CBC, 0xEEEEEEEE, 0x8CAC9CBC,
    0x9EBEBDCD, 0xEEEEEEEE, 0xDEDEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xBEDEAECE, 0xDEEECEEE, 0xEEEEEEEE,
    0xDEEEDEEE, 0xEEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x5B8C8CAC, 0xADBDBDCD,
    0xEEEEEEEE, 0x8D9DADBD, 0xBECECEDE, 0xEEEEEEEE,
    0xCEBEEEDE, 0xEEDEEEEE, 0xEEEEEEEE, 0x8DAD9DBC,
    0xBECEBEDE, 0xEEEEEEEE, 0x9EBEBECD, 0xBECECEDE,
    0xEEEEEEEE, 0xDEEEEEEE, 0xDEDEEEEE, 0xEEEEEEEE,
    0xBEDEAEDE, 0xEEEEDEEE, 0xEEEEEEEE, 0xDEEEDEEE,
    0xDEEECEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x8EBEBECD, 0xCEDECEEE, 0xEEEEEEEE,
    0xAEBECECD, 0xDEDEDEEE, 0xEEEEEEEE, 0xBEBEDEDE,
    0xEEDEEEEE, 0xEEEEEEEE, 0x9ECEBECD, 0xCEEEDEEE,
    0xEEEEEEEE, 0xAECECEDE, 0xDEDEDEEE, 0xEEEEEEEE,
    0xCEDEEEEE, 0xDEDEEEEE, 0xEEEEEEEE, 0xAEDEAECD,
    0xEEEEDEEE, 0xEEEEEEEE, 0xBEEECEDE, 0xDEEECEDE,
    0xEEEEEEEE, 0xDEEEEEEE, 0xDEEEDEEE, 0xEEDEDEDD,
      ]],
    l12_tab: [
      [
        0xF2724878, 0xA2484698, 0x9A67989A, 0xAAA14846, 0x978A3695, 0x7A89A78A, 0x89AAAA68, 0xA78B9AB7,
        0x8B89B9AB, 0x89B9ABAA, 0xA8AB9AB9, 0xAB9AB9AB, 0xAAA9AB9A, 0xBAA90000
      ], [
        0xF3B26C9B, 0xE25C58DB, 0xCE8ADABE, 0xEEE05B47, 0xD9BE37D7, 0x9DBCE8BE, 0xBCEEEE79, 0xD8BEBCE8,
        0xAEABECCE, 0xACECDEEE, 0xEACECDED, 0xEEBDECDE, 0xDEECEEDE, 0xEEEE0000
      ]],
    l3_tab: [
      [
        0xF2815979, 0xB24946A8, 0x9B79B99B, 0xABC15946, 0xA89B46A6, 0x8A9AB89B, 0x9ABBBC68, 0xB89BABC8,
        0x9B9ACABC, 0xABCBBCCC, 0xCABCABCB, 0xCCABCBCC, 0xBCCBCCBC, 0xCCCC0000
      ], [
        0xF3D17EBD, 0xF27E6AFC, 0xEFBDFCEF, 0xFFF06D5A, 0xECEF59E9, 0xBEDFFCEF, 0xDFFFFF9B, 0xEBDFEFFB,
        0xDFCEFFFF, 0xEFFFFFFF, 0xFEEFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000
      ]],
    esc_tab: [ 0x01235566, 0x788899AA, 0xAABBBCCC, 0xCBBCEEEE ],
  },
  CoeffsCBDesc {
    l0_tab:[
      [
    0xF4252545, 0x47676777, 0xCECCCCBB, 0x47576877,
    0x7A898A99, 0xDEDDCDCB, 0xAD9BBDAA, 0xBEBCCDBB,
    0xEEDEDECB, 0x47675777, 0x7A898989, 0xDECDCDCB,
    0x7A898A89, 0x9C9BABAA, 0xEEDEDECB, 0xBEBDCDBB,
    0xDECDDECB, 0xEEEEEECC, 0x9DBC9BAA, 0xBECDACBB,
    0xEEDEDECB, 0xBECDBCBB, 0xCECECDBB, 0xEEEEDECB,
    0xDEDEDECB, 0xEEDEDECC, 0xEEEEEECB, 0x27575767,
    0x7A898999, 0xDEDDDDCB, 0x59697988, 0x9C9BABAA,
    0xEEDEDECC, 0xAE9CBDAA, 0xCEBDCEBB, 0xEEEEEEDC,
    0x59797988, 0x9B9B9AAA, 0xEEDEDECB, 0x8B9B9B9A,
    0x9DACACAA, 0xEEDEDECC, 0xCEBDCEBB, 0xCEBDDECB,
    0xEEDEEECC, 0xADBD9BAA, 0xCECDBCBB, 0xEEEEDECB,
    0xCECDBDBB, 0xCEDEBDBB, 0xEEEEDECB, 0xEEDEDECB,
    0xEEDEDECB, 0xEEEEDECB, 0x6B8B8B9A, 0xADBCACBB,
    0xEEEEEEDC, 0x8C9CACAA, 0xBEBDCDBB, 0xEEEEEEDC,
    0xBEADCEBB, 0xDECEDECC, 0xEEEEEEDC, 0x8CAC9BAA,
    0xBEBDBDBB, 0xEEEEEEDC, 0xAEBDBDBB, 0xBECDCDCB,
    0xEEEEEEDC, 0xCECEDECC, 0xDECEDECC, 0xEEDEEEDC,
    0xBECEACBB, 0xDEDECDCB, 0xEEEEEEDC, 0xCEDECDCB,
    0xDEDECDCC, 0xEEEEDEDC, 0xEEEEEECC, 0xDEDEDECC,
    0xEEDEDECB, 0x8DADACBB, 0xCECECDCB, 0xEEEEEEDC,
    0xAEBDBDBB, 0xCECECECC, 0xEEEEEEDC, 0xBEADCEBB,
    0xDECDDEBB, 0xEEEEEECB, 0xAEBDADBB, 0xCEDECDCC,
    0xEEEEEEDC, 0xAECEBDCB, 0xCEDECECC, 0xEEEEEEDC,
    0xBEBDCEBB, 0xCEBEDEBB, 0xEEDEEECB, 0xBECEACBA,
    0xDEDEBDBB, 0xEEEEDECB, 0xBECEBDBB, 0xCEDEBDBB,
    0xEEEEDECB, 0xCECDCDBA, 0xCEBDBDBA, 0xDEBCBCA9,
      ], [
    0xF5383879, 0x498B7BAC, 0xEEEEEEEE, 0x3A6A7BAC,
    0x8CADAECE, 0xEEEEEEEE, 0xCECEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x3A7B6A9C, 0x8CAD9DCE, 0xEEEEEEEE,
    0x7DAEADCD, 0xAECECEDE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xBEEEBEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x085A5A9B,
    0x6A9C9CBD, 0xEEEEEEEE, 0x5B7C9CBC, 0x9EBEBECE,
    0xEEEEEEEE, 0xCECEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0x5B9C7CAC, 0x9EBEAEDE, 0xEEEEEEEE, 0x8EBEAECE,
    0xAECEBEDE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xBEEEBEEE, 0xEEEEDEEE, 0xEEEEEEEE,
    0xEEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x6D9D9DCD, 0xAECECEEE,
    0xEEEEEEEE, 0x8EAEBECE, 0xBEDEDEEE, 0xEEEEEEEE,
    0xCECEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x8EBEAECE,
    0xBEDECEEE, 0xEEEEEEEE, 0xAECECEDE, 0xBEDECEEE,
    0xEEEEEEEE, 0xDEEEEEEE, 0xDEDEEEEE, 0xEEEEEEEE,
    0xBEEEBEDE, 0xEEEEDEEE, 0xEEEEEEEE, 0xDEEEDEEE,
    0xDEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x8ECEBEDE, 0xCEDEDEEE, 0xEEEEEEEE,
    0xAECECEDE, 0xDEEEEEEE, 0xEEEEEEEE, 0xBECEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x9ECEBEDE, 0xDEEEDEEE,
    0xEEEEEEEE, 0xAEDEDEEE, 0xDEEEEEEE, 0xEEEEEEEE,
    0xCEDEEEEE, 0xDEDEEEEE, 0xEEEEEEEE, 0xAEDEBEDE,
    0xEEEEDEEE, 0xEEEEEEEE, 0xBEEECEEE, 0xDEEEDEEE,
    0xEEEEEEEE, 0xDEEEEEEE, 0xDEEEEEEE, 0xEEEEEEEE,
      ]],
    l12_tab: [
      [
        0xF2825978, 0xB15956A9, 0x9B68A89B, 0xABB15946, 0xA79B46A6, 0x7A99B79B, 0x99BABB68, 0xB79B9AC7,
        0x9B89CAAC, 0x8ACAACBB, 0xB8AB9AC9, 0xAB9ACAAC, 0xAAB9ABAA, 0xBAAA0000
      ], [
        0xF4D27EAC, 0xE16E69EC, 0xDE9BECDE, 0xEEE06D59, 0xEBDE49E8, 0xAECDE9CE, 0xCDEEEE7A, 0xE9CECEE9,
        0xCEACEDEE, 0xBDEDEEEE, 0xEBEECEEE, 0xEECEEDEE, 0xEEEDEEEE, 0xEEEE0000
      ]],
    l3_tab: [
      [
        0xF2815979, 0xB25946A8, 0x9B79B9AB, 0xBBC14946, 0xA89B46A6, 0x8A9AC89B, 0x9ACBBC68, 0xB79BABD8,
        0x9B9ACBBD, 0xABCBBCCC, 0xDABCABCB, 0xCDABCBCD, 0xCCDBCDCC, 0xDCCC0000
      ], [
        0xF3D17FCF, 0xF27F6AFD, 0xFFBDFCEF, 0xFFF06D59, 0xFCFF59E9, 0xBFEFFDFF, 0xDFFFFF9B, 0xEBDFFFFB,
        0xDFCEFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000
      ]],
    esc_tab: [ 0x01235566, 0x788899AA, 0xABBBBCCC, 0xBBBCDDDD ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF4352556, 0x47686878, 0xCECDCDBB, 0x38586878,
    0x7A8A8A99, 0xDEDDCDCB, 0x9E9CBDAB, 0xBEBCCDBB,
    0xEEDEDECC, 0x37685777, 0x7A8A7999, 0xDECDCDCB,
    0x6A8A8A99, 0x8C9B9BAA, 0xDEDEDDCC, 0xBEBDCDBB,
    0xCEBDCECB, 0xEEDEDECC, 0x9DAC8BAA, 0xBEBDACBB,
    0xEEDECECB, 0xBECDACBB, 0xCECEBDBB, 0xEEDEDECC,
    0xDEDEDECC, 0xEEDEDECC, 0xEEEEEECB, 0x27575777,
    0x6A8A8999, 0xDEDDCDCB, 0x5A697989, 0x8B9B9B9A,
    0xEEDEDECC, 0x9E9CBDAB, 0xCEBDCEBB, 0xEEDEEECC,
    0x59796989, 0x8B9B9A9A, 0xEEDEDDCC, 0x7B9B8B9A,
    0x9C9C9BAA, 0xEEDEDECC, 0xBEBDCDBB, 0xCEBDCEBB,
    0xEEDEEECC, 0x9EBD8BAA, 0xBECDACBB, 0xEEEEDECB,
    0xBECEACBB, 0xBECEBDBB, 0xEEEEDECB, 0xDEDEDECC,
    0xDEDEDECB, 0xEEDEDECB, 0x6B8B8B9A, 0x9DACACBB,
    0xEEEEEEDC, 0x7C9C9CAA, 0xAEBDBDBB, 0xEEEEEEDC,
    0xAEADBEBB, 0xCEBEDECC, 0xEEEEEEDC, 0x7C9C9BAA,
    0xAEBDACBB, 0xEEEEEEDC, 0x9DACACBB, 0xAEBDBDBB,
    0xEEEEEEDC, 0xBEBDCEBC, 0xCEBEDECC, 0xEEDEEEDC,
    0xAEBD9CAB, 0xCEDEBDBB, 0xEEEEEEDC, 0xBECEBDBB,
    0xCEDEBDCB, 0xEEEEDECC, 0xDEDEDECC, 0xDEDEDECC,
    0xEECECEBB, 0x8DAC9CAB, 0xBEBDBDBB, 0xEEEEEEDC,
    0x9DADADBB, 0xCECECDCB, 0xEEEEEEDC, 0xAEADBDAB,
    0xCEBDCEBB, 0xEEDEEECB, 0x9DBDACBB, 0xCECEBDCB,
    0xEEEEEEDC, 0xAEBDBDBB, 0xCECECECC, 0xEEEEEEDC,
    0xAEBDBEBB, 0xCEBDCEBB, 0xEEDEEECB, 0xAEBD9CAA,
    0xCECEBDBB, 0xEEEEDECB, 0xAECDADBB, 0xCECEBDBB,
    0xEEEEDDCB, 0xBEBEBDAA, 0xBEBDBDAA, 0xCEBCBCA9,
      ], [
    0xF638388A, 0x498B8BBD, 0xEEEEEEEE, 0x3A6B8CAC,
    0x8DADBEDE, 0xEEEEEEEE, 0xCECEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x3A8C6BAC, 0x8DBEADDE, 0xEEEEEEEE,
    0x8DAEAECE, 0xAECECEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xBEEECEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x095A5A9B,
    0x7B9D9DCE, 0xEEEEEEEE, 0x5C7D9DBD, 0x9EBECEDE,
    0xEEEEEEEE, 0xCECEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0x4C9D7CBD, 0x9ECEBEDE, 0xEEEEEEEE, 0x8EBEBEDE,
    0x9ECEBEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xBEEEBEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x5D9E9DCD, 0xAECECEEE,
    0xEEEEEEEE, 0x8EAEBEDE, 0xBEDEDEEE, 0xEEEEEEEE,
    0xCECEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0x7EBEAEDE,
    0xBEEECEEE, 0xEEEEEEEE, 0x9ECECEEE, 0xBEDEDEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xBEEEBEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xDEEEEEEE,
    0xDEEEDEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
    0xEEEEEEEE, 0x7EBEBEDE, 0xCEEEDEEE, 0xEEEEEEEE,
    0x9ECECEEE, 0xDEEEEEEE, 0xEEEEEEEE, 0xBECEEEEE,
    0xEEEEEEEE, 0xEEEEEEEE, 0x9ECEBEEE, 0xDEEEDEEE,
    0xEEEEEEEE, 0xAEDECEEE, 0xDEEEEEEE, 0xEEEEEEEE,
    0xCEDEEEEE, 0xEEDEEEEE, 0xEEEEEEEE, 0xAEDEBEEE,
    0xEEEEDEEE, 0xEEEEEEEE, 0xCEEEDEEE, 0xDEEEDEEE,
    0xEEEEEEEE, 0xDEEEEEEE, 0xDEEEEEEE, 0xEEEEEEEE,
      ]],
    l12_tab: [
      [
        0xF2825978, 0xB24956A8, 0x9B68A89B, 0xABB14936, 0xA79B36A5, 0x7A99B78B, 0x99BAAB58, 0xB68B8AC6,
        0x8B89B9AC, 0x8AC9ACBB, 0xB8AB9AC9, 0xAB8AB9AC, 0xAAB9ABAA, 0xBAAA0000
      ], [
        0xF4D27EAD, 0xE16E69EC, 0xEE9CECEE, 0xEEE06E59, 0xEBEE49E8, 0xAEDDE9DE, 0xDEEEEE7A, 0xE9CECEE8,
        0xCEBCEEEE, 0xBEEEEEEE, 0xEBEEDEEE, 0xEECEEEEE, 0xEEEEEEEE, 0xEEEE0000
      ]],
    l3_tab: [
      [
        0xF2815979, 0xB25A46A9, 0xAC79B9AC, 0xBBC14946, 0xA8AC46A6, 0x8B9AC89C, 0x9ACBCC68, 0xB79CABD7,
        0x9C8ACBBD, 0xABDBBDCC, 0xD9ACABCB, 0xCDABCBCD, 0xCCDBCDCC, 0xDCCC0000
      ], [
        0xF3D17FCF, 0xF27F6AFE, 0xEFBEFCEF, 0xEFF05F69, 0xFEFF59F9, 0xCFFFFDFF, 0xDFFFFF9A, 0xEBEFFFFB,
        0xCFCEFFFF, 0xFFFEFFFF, 0xFFEFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFE0000
      ]],
    esc_tab: [ 0x01235566, 0x7888999A, 0xABBBCCCC, 0xCBCDDEED ],
  },
  CoeffsCBDesc {
    l0_tab: [
      [
    0xF5373667, 0x58796989, 0xDEDECECD, 0x39596989,
    0x6B8B8B9A, 0xDEDEDEDD, 0x9E9DBDBC, 0xBEBDCECD,
    0xEEEEEEDD, 0x38695889, 0x6A8B8A9A, 0xDEDEDEDD,
    0x6B8B8B9A, 0x8C9C9CAB, 0xEEDEDEDD, 0xBEBECEBC,
    0xCECEDECD, 0xEEEEEEDE, 0x9EBD9CAB, 0xAECEADCC,
    0xEEEEDEDD, 0xAECEBDBC, 0xCEDEBDCC, 0xEEEEEEDD,
    0xDEDEDEDD, 0xEEEEEEDD, 0xEEEEEEDD, 0x18585878,
    0x6A8A8A9A, 0xDEDEDEDD, 0x4A6A7A8A, 0x8C9B9CAB,
    0xEEEEDEDD, 0x9E9DBEBC, 0xBEBECECD, 0xEEEEEEED,
    0x4A7A6A8A, 0x7C9C8BAB, 0xEEEEDEDD, 0x6B8C8BAB,
    0x8C9C9CAB, 0xDEDEDEDD, 0xBEBECECD, 0xBEAECECD,
    0xEEDEEEDD, 0x9EBD8CAB, 0xBECEADBC, 0xEEEEDEDD,
    0xAECEADBC, 0xBECEADCC, 0xEEEEDEDD, 0xDEDEDEDD,
    0xDEDEDECD, 0xEEEEDEDD, 0x5B8B7B9A, 0x9DACACBC,
    0xEEEEEEEE, 0x7D8C9CAB, 0xAEBDBDBC, 0xEEEEEEEE,
    0x9E9DBEBC, 0xCEBEDECD, 0xEEEEEEEE, 0x7C9C8CAB,
    0xAEBDADBC, 0xEEEEEEEE, 0x8DADADBC, 0xAEBDBDBC,
    0xEEEEEEEE, 0xBEBECECD, 0xBEAECECD, 0xEECEEEDE,
    0x9EBE9DBC, 0xCECEBDCD, 0xEEEEEEEE, 0xAECEBECC,
    0xBECEADCD, 0xEEEEDEDD, 0xDEEEDEDD, 0xCEDEDECD,
    0xDECEDECD, 0x7DAD9DBC, 0xBEBEBDCC, 0xEEEEEEED,
    0x8EADADBC, 0xCECECECC, 0xEEEEEEDD, 0x9E9DBEBC,
    0xCEBEDECC, 0xEEEEEEDD, 0x8EBDADBC, 0xBECEBECC,
    0xEEEEEEDD, 0x9EBEAEBC, 0xBECECECC, 0xEEEEEEED,
    0xAEAEBEBC, 0xBEAECECC, 0xEEDEEEDC, 0x9EBE9DAB,
    0xCEDEBDBC, 0xEEEEEEDD, 0xAEBEADBC, 0xBECEBEBC,
    0xEEEEDEDC, 0xBEBECEBC, 0xBEBEBEBB, 0xCEBCCDBB,
      ], [
    0xF649398B, 0x5A9C9CDD, 0xDDDDDDDD, 0x3B6C9DBD,
    0x8DBDCDDD, 0xDDDDDDDD, 0xCDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0x3B9D6CBD, 0x8DCDBDDD, 0xDDDDDDDD,
    0x8DBDBDDD, 0xADDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xBDDDCDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0x0A6B5BAC,
    0x6BADADDD, 0xDDDDDDDD, 0x4C8D9DCD, 0x9DBDCDDD,
    0xDDDDDDDD, 0xCDCDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0x4DAD7DCD, 0x9DDDCDDD, 0xDDDDDDDD, 0x8DBDCDDD,
    0x9DDDCDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xBDDDBDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0x4D9D8DCD, 0x9DCDBDDD,
    0xDDDDDDDD, 0x7DADBDDD, 0xBDDDDDDD, 0xDDDDDDDD,
    0xBDBDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0x6DBD9DDD,
    0xBDDDDDDD, 0xDDDDDDDD, 0x9DDDCDDD, 0xADDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xADDDADDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0x6DBDADDD, 0xBDDDCDDD, 0xDDDDDDDD,
    0x9DBDCDDD, 0xCDDDDDDD, 0xDDDDDDDD, 0xBDBDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0x8DDDBDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xADDDCDDD, 0xDDDDDDDD, 0xDDDDDDDD,
    0xCDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xADDDBDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xBDDDDDDD, 0xDDDDDDDD,
    0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDEED,
      ]],
    l12_tab: [
      [
        0xF3A26B8A, 0xD26B57CA, 0xBD89CABD, 0xCDE05B47, 0xC8AD47C6, 0x8DABD8AD, 0xABDCDE58, 0xC79D9BE7,
        0x9D8AEABE, 0x9BEBBEDC, 0xE9ADABDA, 0xCE9BDABE, 0xBCEACEBC, 0xDCCD0000
      ], [
        0xF4D26EAC, 0xE17E69EE, 0xEEACEDEE, 0xEEE06C58, 0xEBDE49E8, 0xAEDDEADE, 0xEEEEEE79, 0xEACEEEE8,
        0xAECCEDDE, 0xBEEEEEEE, 0xEDDEDEEE, 0xEEDEEEEE, 0xEEEEEEEE, 0xEEEE0000
      ]],
    l3_tab: [
      [
        0xF3B25B9B, 0xE25B57CA, 0xCE8AD9BE, 0xDDE04A47, 0xCACE47C7, 0x8DBCE9BD, 0xABEDDE68, 0xB8ADCDE8,
        0xADABECDE, 0xBDECDEEE, 0xEBCDCDEE, 0xEEBCECDE, 0xEEEDDEEE, 0xEEEE0000
      ], [
        0xF3D27DEE, 0xE18E69EE, 0xEEAEEEBE, 0xEEE05E6A, 0xEEEE59E8, 0xBEEEEBEE, 0xEEEEEEAA, 0xEEEEEEEB,
        0xEEEEEEEE, 0xEBEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEED0000
      ]],
    esc_tab: [ 0x01234577, 0x8899AABD, 0xDEEEEEEE, 0xEDDDDEED ],
  },
];