av/codec/h264/h264dec/cavlctab.go

68 lines
3.9 KiB
Go
Raw Permalink Normal View History

2022-05-31 08:17:06 +03:00
package h264dec
// coefTokenTable is a CSV representation of table 9-5 from the specifications.
// This is used to populate a series of maps at initialisation for the
// retrieval of TotalCoeff and TrailingOnes values for a given coeff_token.
const coeffTokenTable = `0,0,1,11,1111,0000 11,01,1
0,1,0001 01,0010 11,0011 11,0000 00,0001 11,0001 111
1,1,01,10,1110,0000 01,1,01
0,2,0000 0111,0001 11,0010 11,0001 00,0001 00,0001 110
1,2,0001 00,0011 1,0111 1,0001 01,0001 10,0001 101
2,2,001,011,1101,0001 10,001,001
0,3,0000 0011 1,0000 111,0010 00,0010 00,0000 11,0000 0011 1
1,3,0000 0110,0010 10,0110 0,0010 01,0000 011,0001 100
2,3,0000 101,0010 01,0111 0,0010 10,0000 010,0001 011
3,3,0001 1,0101,1100,0010 11,0001 01,0000 1
0,4,0000 0001 11,0000 0111,0001 111,0011 00,0000 10,0000 0011 0
1,4,0000 0011 0,0001 10,0101 0,0011 01,0000 0011,0000 0010 1
2,4,0000 0101,0001 01,0101 1,0011 10,0000 0010,0001 010
3,4,0000 11,0100,1011,0011 11,0000 000,0000 01
0,5,0000 0000 111,0000 0100,0001 011,0100 00,-,0000 0001 11
1,5,0000 0001 10,0000 110,0100 0,0100 01,-,0000 0001 10
2,5,0000 0010 1,0000 101,0100 1,0100 10,-,0000 0010 0
3,5,0000 100,0011 0,1010,0100 11,-,0001 001
0,6,0000 0000 0111 1,0000 0011 1,0001 001,0101 00,-,0000 0000 111
1,6,0000 0000 110,0000 0110,0011 10,0101 01,-,0000 0000 110
2,6,0000 0001 01,0000 0101,0011 01,0101 10,-,0000 0001 01
3,6,0000 0100,0010 00,1001,0101 11,-,0001 000
0,7,0000 0000 0101 1,0000 0001 111,0001 000,0110 00,-,0000 0000 0111
1,7,0000 0000 0111 0,0000 0011 0,0010 10,0110 01,-,0000 0000 0110
2,7,0000 0000 101,0000 0010 1,0010 01,0110 10,-,0000 0000 101
3,7,0000 0010 0,0001 00,1000,0110 11,-,0000 0001 00
0,8,0000 0000 0100 0,0000 0001 011,0000 1111,0111 00,-,0000 0000 0011 1
1,8,0000 0000 0101 0,0000 0001 110,0001 110,0111 01,-,0000 0000 0101
2,8,0000 0000 0110 1,0000 0001 101,0001 101,0111 10,-,0000 0000 0100
3,8,0000 0001 00,0000 100,0110 1,0111 11,-,0000 0000 100
0,9,0000 0000 0011 11,0000 0000 1111,0000 1011,1000 00,-,-
1,9,0000 0000 0011 10,0000 0001 010,0000 1110,1000 01,-,-
2,9,0000 0000 0100 1,0000 0001 001,0001 010,1000 10,-,-
3,9,0000 0000 100,0000 0010 0,0011 00,1000 11,-,-
0,10,0000 0000 0010 11,0000 0000 1011,0000 0111 1,1001 00,-,-
1,10,0000 0000 0010 10,0000 0000 1110,0000 1010,1001 01,-,-
2,10,0000 0000 0011 01,0000 0000 1101,0000 1101,1001 10,-,-
3,10,0000 0000 0110 0,0000 0001 100,0001 100,1001 11,-,-
0,11,0000 0000 0001 111,0000 0000 1000,0000 0101 1,1010 00,-,-
1,11,0000 0000 0001 110,0000 0000 1010,0000 0111 0,1010 01,-,-
2,11,0000 0000 0010 01,0000 0000 1001,0000 1001,1010 10,-,-
3,11,0000 0000 0011 00,0000 0001 000,0000 1100,1010 11,-,-
0,12,0000 0000 0001 011,0000 0000 0111 1,0000 0100 0,1011 00,-,-
1,12,0000 0000 0001 010,0000 0000 0111 0,0000 0101 0,1011 01,-,-
2,12,0000 0000 0001 101,0000 0000 0110 1,0000 0110 1,1011 10,-,-
3,12,0000 0000 0010 00,0000 0000 1100,0000 1000,1011 11,-,-
0,13,0000 0000 0000 1111,0000 0000 0101 1,0000 0011 01,1100 00,-,-
1,13,0000 0000 0000 001,0000 0000 0101 0,0000 0011 1,1100 01,-,-
2,13,0000 0000 0001 001,0000 0000 0100 1,0000 0100 1,1100 10,-,-
3,13,0000 0000 0001 100,0000 0000 0110 0,0000 0110 0,1100 11,-,-
0,14,0000 0000 0000 1011,0000 0000 0011 1,0000 0010 01,1101 00,-,-
1,14,0000 0000 0000 1110,0000 0000 0010 11,0000 0011 00,1101 01,-,-
2,14,0000 0000 0000 1101,0000 0000 0011 0,0000 0010 11,1101 10,-,-
3,14,0000 0000 0001 000,0000 0000 0100 0,0000 0010 10,1101 11,-,-
0,15,0000 0000 0000 0111,0000 0000 0010 01,0000 0001 01,1110 00,-,-
1,15,0000 0000 0000 1010,0000 0000 0010 00,0000 0010 00,1110 01,-,-
2,15,0000 0000 0000 1001,0000 0000 0010 10,0000 0001 11,1110 10,-,-
3,15,0000 0000 0000 1100,0000 0000 0000 1,0000 0001 10,1110 11,-,-
0,16,0000 0000 0000 0100,0000 0000 0001 11,0000 0000 01,1111 00,-,-
1,16,0000 0000 0000 0110,0000 0000 0001 10,0000 0001 00,1111 01,-,-
2,16,0000 0000 0000 0101,0000 0000 0001 01,0000 0000 11,1111 10,-,-
3,16,0000 0000 0000 1000,0000 0000 0001 00,0000 0000 10,1111 11,-,-`