648
extern const uint8_t x264_significant_coeff_flag_offset_8x8[2][64];
649
extern const uint8_t x264_last_coeff_flag_offset_8x8[63];
650
extern const uint8_t x264_coeff_flag_offset_chroma_422_dc[7];
651
extern const uint16_t x264_significant_coeff_flag_offset[2][16];
652
extern const uint16_t x264_last_coeff_flag_offset[2][16];
653
extern const uint16_t x264_coeff_abs_level_m1_offset[16];
654
extern const uint8_t x264_count_cat_m1[14];
656
/* Padded to [64] for easier addressing */
657
const uint8_t x264_significant_coeff_flag_offset_8x8[2][64] =
659
0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5,
660
4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7,
661
7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11,
662
12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12
664
0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 8, 4, 5,
665
6, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,11,12,11,
666
9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9,
667
9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14
669
const uint8_t x264_last_coeff_flag_offset_8x8[63] =
671
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
672
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
673
3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
674
5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
676
const uint8_t x264_coeff_flag_offset_chroma_422_dc[7] = { 0, 0, 1, 1, 2, 2, 2 }; /* MIN( i/2, 2 ) */
677
const uint16_t x264_significant_coeff_flag_offset[2][16] =
679
{ 105+0, 105+15, 105+29, 105+44, 105+47, 402, 484+0, 484+15, 484+29, 660, 528+0, 528+15, 528+29, 718, 0, 0 },
680
{ 277+0, 277+15, 277+29, 277+44, 277+47, 436, 776+0, 776+15, 776+29, 675, 820+0, 820+15, 820+29, 733, 0, 0 }
682
const uint16_t x264_last_coeff_flag_offset[2][16] =
684
{ 166+0, 166+15, 166+29, 166+44, 166+47, 417, 572+0, 572+15, 572+29, 690, 616+0, 616+15, 616+29, 748, 0, 0 },
685
{ 338+0, 338+15, 338+29, 338+44, 338+47, 451, 864+0, 864+15, 864+29, 699, 908+0, 908+15, 908+29, 757, 0, 0 }
687
const uint16_t x264_coeff_abs_level_m1_offset[16] =
689
227+0, 227+10, 227+20, 227+30, 227+39, 426, 952+0, 952+10, 952+20, 708, 982+0, 982+10, 982+20, 766
691
const uint8_t x264_count_cat_m1[14] = {15, 14, 15, 3, 14, 63, 15, 14, 15, 63, 15, 14, 15, 63};
694
647
// node ctx: 0..3: abslevel1 (with abslevelgt1 == 0).
695
648
// 4..7: abslevelgt1 + 3 (and abslevel1 doesn't matter).
696
649
/* map node ctx => cabac ctx for level=1 */