forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust376.5 MiBa5441e8Tahinli3 months ago1014 commits

cdf.rs4826 lines, 178.3 KiBHistoryRawDownload
1//! The default CDF tables of spec section 9.4, in the orientation
2//! [`crate::msac`] reads: cumulative probabilities scaled to `1 << 15`, with
3//! the alphabet's total as the second-to-last entry and the adaptation counter
4//! last.
5//!
6//! Only the syntax elements the tile writer codes today are here; the rest
7//! arrive with the syntax that needs them.
8
9/// `Default_Partition_W64_Cdf` (spec 9.4): the ten partition types of a
10/// 64x64 block, indexed by the context the blocks above and left give.
11pub const PARTITION_W64: [[u16; 11]; 4] = [
12 [
13 20137, 21547, 23078, 29566, 29837, 30261, 30524, 30892, 31724, 32768, 0,
14 ],
15 [
16 6732, 7490, 9497, 27944, 28250, 28515, 28969, 29630, 30104, 32768, 0,
17 ],
18 [
19 5945, 7663, 8348, 28683, 29117, 29749, 30064, 30298, 32238, 32768, 0,
20 ],
21 [
22 870, 1212, 1487, 31198, 31394, 31574, 31743, 31881, 32332, 32768, 0,
23 ],
24];
25
26/// `Default_Skip_Cdf` (spec 9.4): indexed by how many of the blocks above
27/// and left were skipped.
28pub const SKIP: [[u16; 3]; 3] = [[31671, 32768, 0], [16515, 32768, 0], [4576, 32768, 0]];
29
30/// `Default_Intra_Frame_Y_Mode_Cdf` (spec 9.4): the thirteen luma intra
31/// modes of a key frame, indexed by the mode context of the block above and
32/// then of the block to the left.
33pub const KF_Y_MODE: [[[u16; 14]; 5]; 5] = [
34 [
35 [
36 15588, 17027, 19338, 20218, 20682, 21110, 21825, 23244, 24189, 28165, 29093, 30466,
37 32768, 0,
38 ],
39 [
40 12016, 18066, 19516, 20303, 20719, 21444, 21888, 23032, 24434, 28658, 30172, 31409,
41 32768, 0,
42 ],
43 [
44 10052, 10771, 22296, 22788, 23055, 23239, 24133, 25620, 26160, 29336, 29929, 31567,
45 32768, 0,
46 ],
47 [
48 14091, 15406, 16442, 18808, 19136, 19546, 19998, 22096, 24746, 29585, 30958, 32462,
49 32768, 0,
50 ],
51 [
52 12122, 13265, 15603, 16501, 18609, 20033, 22391, 25583, 26437, 30261, 31073, 32475,
53 32768, 0,
54 ],
55 ],
56 [
57 [
58 10023, 19585, 20848, 21440, 21832, 22760, 23089, 24023, 25381, 29014, 30482, 31436,
59 32768, 0,
60 ],
61 [
62 5983, 24099, 24560, 24886, 25066, 25795, 25913, 26423, 27610, 29905, 31276, 31794,
63 32768, 0,
64 ],
65 [
66 7444, 12781, 20177, 20728, 21077, 21607, 22170, 23405, 24469, 27915, 29090, 30492,
67 32768, 0,
68 ],
69 [
70 8537, 14689, 15432, 17087, 17408, 18172, 18408, 19825, 24649, 29153, 31096, 32210,
71 32768, 0,
72 ],
73 [
74 7543, 14231, 15496, 16195, 17905, 20717, 21984, 24516, 26001, 29675, 30981, 31994,
75 32768, 0,
76 ],
77 ],
78 [
79 [
80 12613, 13591, 21383, 22004, 22312, 22577, 23401, 25055, 25729, 29538, 30305, 32077,
81 32768, 0,
82 ],
83 [
84 9687, 13470, 18506, 19230, 19604, 20147, 20695, 22062, 23219, 27743, 29211, 30907,
85 32768, 0,
86 ],
87 [
88 6183, 6505, 26024, 26252, 26366, 26434, 27082, 28354, 28555, 30467, 30794, 32086,
89 32768, 0,
90 ],
91 [
92 10718, 11734, 14954, 17224, 17565, 17924, 18561, 21523, 23878, 28975, 30287, 32252,
93 32768, 0,
94 ],
95 [
96 9194, 9858, 16501, 17263, 18424, 19171, 21563, 25961, 26561, 30072, 30737, 32463,
97 32768, 0,
98 ],
99 ],
100 [
101 [
102 12602, 14399, 15488, 18381, 18778, 19315, 19724, 21419, 25060, 29696, 30917, 32409,
103 32768, 0,
104 ],
105 [
106 8203, 13821, 14524, 17105, 17439, 18131, 18404, 19468, 25225, 29485, 31158, 32342,
107 32768, 0,
108 ],
109 [
110 8451, 9731, 15004, 17643, 18012, 18425, 19070, 21538, 24605, 29118, 30078, 32018,
111 32768, 0,
112 ],
113 [
114 7714, 9048, 9516, 16667, 16817, 16994, 17153, 18767, 26743, 30389, 31536, 32528, 32768,
115 0,
116 ],
117 [
118 8843, 10280, 11496, 15317, 16652, 17943, 19108, 22718, 25769, 29953, 30983, 32485,
119 32768, 0,
120 ],
121 ],
122 [
123 [
124 12578, 13671, 15979, 16834, 19075, 20913, 22989, 25449, 26219, 30214, 31150, 32477,
125 32768, 0,
126 ],
127 [
128 9563, 13626, 15080, 15892, 17756, 20863, 22207, 24236, 25380, 29653, 31143, 32277,
129 32768, 0,
130 ],
131 [
132 8356, 8901, 17616, 18256, 19350, 20106, 22598, 25947, 26466, 29900, 30523, 32261,
133 32768, 0,
134 ],
135 [
136 10835, 11815, 13124, 16042, 17018, 18039, 18947, 22753, 24615, 29489, 30883, 32482,
137 32768, 0,
138 ],
139 [
140 7618, 8288, 9859, 10509, 15386, 18657, 22903, 28776, 29180, 31355, 31802, 32593, 32768,
141 0,
142 ],
143 ],
144];
145
146/// `Default_Uv_Mode_Cdf` (spec 9.4) for blocks where chroma from luma is not
147/// allowed: the thirteen chroma intra modes, indexed by the luma mode.
148pub const UV_MODE_NO_CFL: [[u16; 14]; 13] = [
149 [
150 22631, 24152, 25378, 25661, 25986, 26520, 27055, 27923, 28244, 30059, 30941, 31961, 32768,
151 0,
152 ],
153 [
154 9513, 26881, 26973, 27046, 27118, 27664, 27739, 27824, 28359, 29505, 29800, 31796, 32768, 0,
155 ],
156 [
157 9845, 9915, 28663, 28704, 28757, 28780, 29198, 29822, 29854, 30764, 31777, 32029, 32768, 0,
158 ],
159 [
160 13639, 13897, 14171, 25331, 25606, 25727, 25953, 27148, 28577, 30612, 31355, 32493, 32768,
161 0,
162 ],
163 [
164 9764, 9835, 9930, 9954, 25386, 27053, 27958, 28148, 28243, 31101, 31744, 32363, 32768, 0,
165 ],
166 [
167 11825, 13589, 13677, 13720, 15048, 29213, 29301, 29458, 29711, 31161, 31441, 32550, 32768,
168 0,
169 ],
170 [
171 14175, 14399, 16608, 16821, 17718, 17775, 28551, 30200, 30245, 31837, 32342, 32667, 32768,
172 0,
173 ],
174 [
175 12885, 13038, 14978, 15590, 15673, 15748, 16176, 29128, 29267, 30643, 31961, 32461, 32768,
176 0,
177 ],
178 [
179 12026, 13661, 13874, 15305, 15490, 15726, 15995, 16273, 28443, 30388, 30767, 32416, 32768,
180 0,
181 ],
182 [
183 19052, 19840, 20579, 20916, 21150, 21467, 21885, 22719, 23174, 28861, 30379, 32175, 32768,
184 0,
185 ],
186 [
187 18627, 19649, 20974, 21219, 21492, 21816, 22199, 23119, 23527, 27053, 31397, 32148, 32768,
188 0,
189 ],
190 [
191 17026, 19004, 19997, 20339, 20586, 21103, 21349, 21907, 22482, 25896, 26541, 31819, 32768,
192 0,
193 ],
194 [
195 12124, 13759, 14959, 14992, 15007, 15051, 15078, 15166, 15255, 15753, 16039, 16606, 32768,
196 0,
197 ],
198];
199
200// The coefficient CDFs below are the q-context-2 tables (`base_q_idx` 61..=120,
201// spec 8.3.2's `Default_..._Cdf[2]`), which is the context the frames this
202// crate writes today sit in. The other three sets arrive with the rate control
203// that can leave that band.
204
205/// `Default_Txb_Skip_Cdf[2][4][0]` (spec 9.4): the all-zero flag of a 64x64
206/// luma transform block whose block size is the transform size, so its
207/// context is 0.
208pub const TXB_SKIP_LUMA_64: [u16; 3] = [28573, 32768, 0];
209
210/// `Default_Txb_Skip_Cdf[2][3][7]` (spec 9.4): the all-zero flag of a 32x32
211/// chroma transform block that covers its whole plane block with no coded
212/// neighbour, which is context 7.
213pub const TXB_SKIP_CHROMA_32_NONE: [u16; 3] = [5124, 32768, 0];
214
215/// `Default_Eob_Pt_1024_Cdf[2][0][0]` (spec 9.4): the end-of-block position
216/// token of a luma transform block with 1024 coded coefficient positions —
217/// what a 64x64 transform has, since only its top-left 32x32 is coded.
218pub const EOB_PT_1024_LUMA: [u16; 12] = [
219 2784, 3831, 7041, 10521, 14847, 18844, 23155, 26682, 29229, 31045, 32768, 0,
220];
221
222/// `Default_Coeff_Base_Eob_Cdf[2][4][0][0]` (spec 9.4): the level of the last
223/// coefficient of a 64x64 luma transform block, less one, when that
224/// coefficient is the DC.
225pub const COEFF_BASE_EOB_LUMA_64_DC: [u16; 4] = [935, 3382, 32768, 0];
226
227/// `av1_default_eob_multi512_cdfs[2][0][0]` (`token_cdfs.h:829-906`,
228/// lane-rectwire): the end-of-block group of a luma transform with 512 coded
229/// positions -- what a true 32x16/16x32 rectangular transform has
230/// (`txsize_log2_minus4` = 5, `common_data.h:346`), distinct from
231/// [`EOB_PT_1024_LUMA`]'s 1024-position group a *square* 32x32 reads.
232pub const EOB_PT_512_LUMA: [u16; 11] = [
233 2624, 3936, 6480, 9686, 13979, 17726, 23267, 28410, 31078, 32768, 0,
234];
235/// [`EOB_PT_512_LUMA`], q-context 0 (`base_q_idx` 0..=20).
236pub const EOB_PT_512_LUMA_Q0: [u16; 11] = [
237 641, 983, 3707, 5430, 10234, 14958, 18788, 23412, 26061, 32768, 0,
238];
239/// [`EOB_PT_512_LUMA`], q-context 1 (`base_q_idx` 21..=60).
240pub const EOB_PT_512_LUMA_Q1: [u16; 11] = [
241 1230, 2278, 5035, 7776, 11871, 15346, 19590, 24584, 28749, 32768, 0,
242];
243/// [`EOB_PT_512_LUMA`], q-context 3 (`base_q_idx` 121..=255).
244pub const EOB_PT_512_LUMA_Q3: [u16; 11] = [
245 5927, 7809, 10923, 14597, 19439, 24135, 28456, 31142, 32060, 32768, 0,
246];
247
248/// `av1_default_eob_multi128_cdfs[2][1][0]` (`token_cdfs.h:829-906`,
249/// lane-rectwire): the end-of-block group of a chroma transform with 128
250/// coded positions -- what a true 16x8/8x16 rectangular transform has
251/// (`txsize_log2_minus4` = 3), distinct from [`EOB_PT_256_CHROMA`]'s
252/// 256-position group a *square* 16x16 reads.
253pub const EOB_PT_128_CHROMA: [u16; 9] = [
254 13627, 16246, 20173, 24429, 27948, 30415, 31863, 32768, 0,
255];
256/// [`EOB_PT_128_CHROMA`], q-context 0.
257pub const EOB_PT_128_CHROMA_Q0: [u16; 9] = [
258 5245, 7456, 12880, 15852, 20033, 23932, 27608, 32768, 0,
259];
260/// [`EOB_PT_128_CHROMA`], q-context 1.
261pub const EOB_PT_128_CHROMA_Q1: [u16; 9] = [
262 8045, 11200, 15497, 19595, 23948, 27408, 30938, 32768, 0,
263];
264/// [`EOB_PT_128_CHROMA`], q-context 3.
265pub const EOB_PT_128_CHROMA_Q3: [u16; 9] = [
266 24313, 26062, 28385, 30107, 31217, 31898, 32345, 32768, 0,
267];
268
269/// `Default_Dc_Sign_Cdf[2][0]` (spec 9.4): the sign of a luma DC coefficient,
270/// indexed by whether the neighbouring blocks' DC signs lean negative (1),
271/// positive (2) or neither (0).
272pub const DC_SIGN_LUMA: [[u16; 3]; 3] = [[16000, 32768, 0], [13056, 32768, 0], [18816, 32768, 0]];
273
274/// `Default_Partition_W32_Cdf` (spec 9.4): the ten partition types of a
275/// 32x32 block, indexed by the context the blocks above and left give.
276pub const PARTITION_W32: [[u16; 11]; 4] = [
277 [
278 18462, 20920, 23124, 27647, 28227, 29049, 29519, 30178, 31544, 32768, 0,
279 ],
280 [
281 7689, 9060, 12056, 24992, 25660, 26182, 26951, 28041, 29052, 32768, 0,
282 ],
283 [
284 6015, 9009, 10062, 24544, 25409, 26545, 27071, 27526, 32047, 32768, 0,
285 ],
286 [
287 1394, 2208, 2796, 28614, 29061, 29466, 29840, 30185, 31899, 32768, 0,
288 ],
289];
290
291/// `Default_Uv_Mode_Cfl_Allowed_Cdf` (spec 9.4): the fourteen chroma intra
292/// modes — the thirteen the CFL-free table has, plus chroma from luma —
293/// indexed by the luma mode of the same block. A block of 32x32 or smaller is
294/// offered CFL, so it reads this table where a 64x64 block reads
295/// [`UV_MODE_NO_CFL`].
296pub const UV_MODE_CFL: [[u16; 15]; 13] = [
297 [
298 10407, 11208, 12900, 13181, 13823, 14175, 14899, 15656, 15986, 20086, 20995, 22455, 24212,
299 32768, 0,
300 ],
301 [
302 4532, 19780, 20057, 20215, 20428, 21071, 21199, 21451, 22099, 24228, 24693, 27032, 29472,
303 32768, 0,
304 ],
305 [
306 5273, 5379, 20177, 20270, 20385, 20439, 20949, 21695, 21774, 23138, 24256, 24703, 26679,
307 32768, 0,
308 ],
309 [
310 6740, 7167, 7662, 14152, 14536, 14785, 15034, 16741, 18371, 21520, 22206, 23389, 24182,
311 32768, 0,
312 ],
313 [
314 4987, 5368, 5928, 6068, 19114, 20315, 21857, 22253, 22411, 24911, 25380, 26027, 26376,
315 32768, 0,
316 ],
317 [
318 5370, 6889, 7247, 7393, 9498, 21114, 21402, 21753, 21981, 24780, 25386, 26517, 27176,
319 32768, 0,
320 ],
321 [
322 4816, 4961, 7204, 7326, 8765, 8930, 20169, 20682, 20803, 23188, 23763, 24455, 24940, 32768,
323 0,
324 ],
325 [
326 6608, 6740, 8529, 9049, 9257, 9356, 9735, 18827, 19059, 22336, 23204, 23964, 24793, 32768,
327 0,
328 ],
329 [
330 5998, 7419, 7781, 8933, 9255, 9549, 9753, 10417, 18898, 22494, 23139, 24764, 25989, 32768,
331 0,
332 ],
333 [
334 10660, 11298, 12550, 12957, 13322, 13624, 14040, 15004, 15534, 20714, 21789, 23443, 24861,
335 32768, 0,
336 ],
337 [
338 10522, 11530, 12552, 12963, 13378, 13779, 14245, 15235, 15902, 20102, 22696, 23774, 25838,
339 32768, 0,
340 ],
341 [
342 10099, 10691, 12639, 13049, 13386, 13665, 14125, 15163, 15636, 19676, 20474, 23519, 25208,
343 32768, 0,
344 ],
345 [
346 3144, 5087, 7382, 7504, 7593, 7690, 7801, 8064, 8232, 9248, 9875, 10521, 29048, 32768, 0,
347 ],
348];
349
350/// `Default_Cfl_Sign_Cdf` (spec 9.4): the joint sign of a `UV_CFL_PRED`
351/// block's U/V alpha (spec 5.11.45's `cfl_alpha_signs`) — libaom's
352/// `default_cfl_sign_cdf` (entropymode.c), whose `AOM_CDF8(a0..a6)` arguments
353/// are this convention's cumulative points verbatim (only the *storage*, not
354/// the spec's own table, is `AOM_ICDF`-inverted).
355pub const CFL_SIGN: [u16; 9] = [1418, 2123, 13340, 18405, 26972, 28343, 32294, 32768, 0];
356
357/// `default_filter_intra_cdfs` (entropymode.c), the `use_filter_intra` flag's
358/// prior, indexed by block-size class: `[0]`=4x4, `[1]`=8x8, `[2]`=16x16,
359/// `[3]`=32x32 -- the only square sizes `av1_filter_intra_allowed_bsize`
360/// (width and height both <=32) ever offers this decoder's square blocks.
361/// `[4]`/`[5]` (lane-intradisp r1) add `BLOCK_32X16`/`BLOCK_16X32`'s own rows
362/// (12756/14301, `default_filter_intra_cdfs` index 8/7) -- the two rect
363/// strips `PARTITION_HORZ`/`PARTITION_VERT` decode, each with its own
364/// distinct default probability from every square class above.
365pub const FILTER_INTRA: [[u16; 3]; 6] = [
366 [4621, 32768, 0],
367 [7866, 32768, 0],
368 [12408, 32768, 0],
369 [22343, 32768, 0],
370 [12756, 32768, 0],
371 [14301, 32768, 0],
372];
373/// `default_filter_intra_mode_cdf` (entropymode.c): which of the five
374/// `FILTER_INTRA_MODES` a `use_filter_intra` block picks.
375pub const FILTER_INTRA_MODE: [u16; 6] = [8949, 12776, 17211, 29558, 32768, 0];
376
377/// `default_palette_y_size_cdf` (entropymode.c): `PALETTE_SIZES` (2..=8),
378/// indexed by `av1_get_palette_bsize_ctx` (0..=6, `PALATTE_BSIZE_CTXS`).
379pub const PALETTE_Y_SIZE: [[u16; 8]; 7] = [
380 [7952, 13000, 18149, 21478, 25527, 29241, 32768, 0],
381 [7139, 11421, 16195, 19544, 23666, 28073, 32768, 0],
382 [7788, 12741, 17325, 20500, 24315, 28530, 32768, 0],
383 [8271, 14064, 18246, 21564, 25071, 28533, 32768, 0],
384 [12725, 19180, 21863, 24839, 27535, 30120, 32768, 0],
385 [9711, 14888, 16923, 21052, 25661, 27875, 32768, 0],
386 [14940, 20797, 21678, 24186, 27033, 28999, 32768, 0],
387];
388/// `default_palette_uv_size_cdf` (entropymode.c): as [`PALETTE_Y_SIZE`], for
389/// the chroma plane's own palette size.
390pub const PALETTE_UV_SIZE: [[u16; 8]; 7] = [
391 [8713, 19979, 27128, 29609, 31331, 32272, 32768, 0],
392 [5839, 15573, 23581, 26947, 29848, 31700, 32768, 0],
393 [4426, 11260, 17999, 21483, 25863, 29430, 32768, 0],
394 [3228, 9464, 14993, 18089, 22523, 27420, 32768, 0],
395 [3768, 8886, 13091, 17852, 22495, 27207, 32768, 0],
396 [2464, 8451, 12861, 21632, 25525, 28555, 32768, 0],
397 [1269, 5435, 10433, 18963, 21700, 25865, 32768, 0],
398];
399/// `default_palette_y_mode_cdf` (entropymode.c): whether a `DC_PRED` block
400/// uses a palette, indexed `[bsize_ctx][palette_mode_ctx]`
401/// (`palette_mode_ctx` from `av1_get_palette_mode_ctx` -- this decoder never
402/// completes a decode with a nonzero neighbour `palette_size`, so only row
403/// `[.][0]` is ever read, but the whole table is here to match libaom's
404/// adaptation shape exactly).
405pub const PALETTE_Y_MODE: [[[u16; 3]; 3]; 7] = [
406 [[31676, 32768, 0], [3419, 32768, 0], [1261, 32768, 0]],
407 [[31912, 32768, 0], [2859, 32768, 0], [980, 32768, 0]],
408 [[31823, 32768, 0], [3400, 32768, 0], [781, 32768, 0]],
409 [[32030, 32768, 0], [3561, 32768, 0], [904, 32768, 0]],
410 [[32309, 32768, 0], [7337, 32768, 0], [1462, 32768, 0]],
411 [[32265, 32768, 0], [4015, 32768, 0], [1521, 32768, 0]],
412 [[32450, 32768, 0], [7946, 32768, 0], [129, 32768, 0]],
413];
414/// `default_palette_uv_mode_cdf` (entropymode.c): whether a `UV_DC_PRED`
415/// block uses a chroma palette, indexed by `palette_uv_mode_ctx` (whether
416/// this block's own luma palette was used -- always 0 here, see
417/// [`PALETTE_Y_MODE`]'s doc).
418pub const PALETTE_UV_MODE: [[u16; 3]; 2] = [[32461, 32768, 0], [21488, 32768, 0]];
419/// `default_intrabc_cdf` (entropymode.c): the `use_intrabc` flag on an
420/// intra frame with `allow_intrabc` set.
421pub const INTRABC: [u16; 3] = [30531, 32768, 0];
422
423/// `default_tx_size_cdf[0]` (entropymode.c): an 8x8 block's `tx_depth` flag
424/// (`TX8` vs `TX4`), indexed by `tx_size_context` (0..=2).
425pub const TX_SIZE_CAT0: [[u16; 3]; 3] = [[19968, 32768, 0], [19968, 32768, 0], [24320, 32768, 0]];
426/// `default_tx_size_cdf[1]` (entropymode.c): a 16x16 block's `tx_depth`
427/// (`TX16`/`TX8`/`TX4`), indexed by `tx_size_context`.
428pub const TX_SIZE_CAT1: [[u16; 4]; 3] = [
429 [12272, 30172, 32768, 0],
430 [12272, 30172, 32768, 0],
431 [18677, 30848, 32768, 0],
432];
433/// `default_tx_size_cdf[2]` (entropymode.c): a 32x32 block's `tx_depth`
434/// (`TX32`/`TX16`/`TX8`), indexed by `tx_size_context`.
435pub const TX_SIZE_CAT2: [[u16; 4]; 3] = [
436 [12986, 15180, 32768, 0],
437 [12986, 15180, 32768, 0],
438 [24302, 25602, 32768, 0],
439];
440/// `default_tx_size_cdf[3]` (entropymode.c): a 64x64 block's `tx_depth`
441/// (`TX64`/`TX32`/`TX16`), indexed by `tx_size_context`.
442pub const TX_SIZE_CAT3: [[u16; 4]; 3] = [
443 [5782, 11475, 32768, 0],
444 [5782, 11475, 32768, 0],
445 [16803, 22759, 32768, 0],
446];
447
448/// `default_switchable_interp_cdf` (spec 9.4): a `SWITCHABLE`-filter frame's
449/// per-block `interp_filter[dir]` (spec 5.11.20's `read_interpolation_filter`,
450/// three symbols -- `EIGHTTAP`/`EIGHTTAP_SMOOTH`/`EIGHTTAP_SHARP`, `BILINEAR`
451/// is never chosen this way), indexed by `av1_get_pred_context_switchable_interp`'s
452/// `ctx_offset + dir * INTER_FILTER_DIR_OFFSET + neighbour_term`
453/// (`INTER_FILTER_DIR_OFFSET` = 8; this decoder never codes a compound
454/// reference, so `ctx_offset` -- `INTER_FILTER_COMP_OFFSET` on a second
455/// reference frame -- is always 0, leaving rows 0..=3 for `dir` 0 and 8..=11
456/// for `dir` 1).
457pub const SWITCHABLE_INTERP: [[u16; 4]; 16] = [
458 [31935, 32720, 32768, 0],
459 [5568, 32719, 32768, 0],
460 [422, 2938, 32768, 0],
461 [28244, 32608, 32768, 0],
462 [31206, 31953, 32768, 0],
463 [4862, 32121, 32768, 0],
464 [770, 1152, 32768, 0],
465 [20889, 25637, 32768, 0],
466 [31910, 32724, 32768, 0],
467 [4120, 32712, 32768, 0],
468 [305, 2247, 32768, 0],
469 [27403, 32636, 32768, 0],
470 [31022, 32009, 32768, 0],
471 [2963, 32093, 32768, 0],
472 [601, 943, 32768, 0],
473 [14969, 21398, 32768, 0],
474];
475
476/// `Default_Cfl_Alpha_Cdf` (spec 9.4): a `UV_CFL_PRED` block's per-plane
477/// alpha magnitude (spec 5.11.45's `cfl_alpha_u`/`cfl_alpha_v`), indexed by
478/// the joint sign's context (`CFL_CONTEXT_U`/`CFL_CONTEXT_V`,
479/// libaom's cfl.h) — libaom's `default_cfl_alpha_cdf`.
480pub const CFL_ALPHA: [[u16; 17]; 6] = [
481 [
482 7637, 20719, 31401, 32481, 32657, 32688, 32692, 32696, 32700, 32704, 32708, 32712, 32716,
483 32720, 32724, 32768, 0,
484 ],
485 [
486 14365, 23603, 28135, 31168, 32167, 32395, 32487, 32573, 32620, 32647, 32668, 32672, 32676,
487 32680, 32684, 32768, 0,
488 ],
489 [
490 11532, 22380, 28445, 31360, 32349, 32523, 32584, 32649, 32673, 32677, 32681, 32685, 32689,
491 32693, 32697, 32768, 0,
492 ],
493 [
494 26990, 31402, 32282, 32571, 32692, 32696, 32700, 32704, 32708, 32712, 32716, 32720, 32724,
495 32728, 32732, 32768, 0,
496 ],
497 [
498 17248, 26058, 28904, 30608, 31305, 31877, 32126, 32321, 32394, 32464, 32516, 32560, 32576,
499 32593, 32622, 32768, 0,
500 ],
501 [
502 14738, 21678, 25779, 27901, 29024, 30302, 30980, 31843, 32144, 32413, 32520, 32594, 32622,
503 32656, 32660, 32768, 0,
504 ],
505];
506
507/// `Default_Txb_Skip_Cdf[2][3][0]` (spec 9.4): the all-zero flag of a 32x32
508/// luma transform block that covers its whole plane block, which is context 0.
509pub const TXB_SKIP_LUMA_32: [u16; 3] = [30669, 32768, 0];
510
511/// `Default_Coeff_Base_Cdf[2][3][0]` (spec 9.4): the level of a coefficient
512/// of a 32x32 luma transform block, capped at three, for each of the
513/// forty-two contexts its neighbours' magnitudes and its own position give.
514pub const COEFF_BASE_LUMA_32: [[u16; 5]; 42] = [
515 [4456, 11274, 15533, 32768, 0],
516 [21219, 29079, 31616, 32768, 0],
517 [11173, 23774, 28567, 32768, 0],
518 [7282, 18293, 24263, 32768, 0],
519 [4890, 13286, 19115, 32768, 0],
520 [1890, 5508, 8659, 32768, 0],
521 [26651, 32136, 32647, 32768, 0],
522 [14630, 28254, 31455, 32768, 0],
523 [8716, 21287, 27395, 32768, 0],
524 [5615, 15331, 22008, 32768, 0],
525 [2675, 7700, 12150, 32768, 0],
526 [29954, 32526, 32690, 32768, 0],
527 [16126, 28982, 31633, 32768, 0],
528 [9030, 21361, 27352, 32768, 0],
529 [5411, 14793, 21271, 32768, 0],
530 [2943, 8422, 13163, 32768, 0],
531 [29539, 32601, 32730, 32768, 0],
532 [18125, 30385, 32201, 32768, 0],
533 [10422, 24090, 29468, 32768, 0],
534 [6468, 17487, 24438, 32768, 0],
535 [2970, 8653, 13531, 32768, 0],
536 [30912, 32715, 32748, 32768, 0],
537 [20666, 31373, 32497, 32768, 0],
538 [12509, 26640, 30917, 32768, 0],
539 [8058, 20629, 27290, 32768, 0],
540 [4231, 12006, 18052, 32768, 0],
541 [8192, 16384, 24576, 32768, 0],
542 [8192, 16384, 24576, 32768, 0],
543 [8192, 16384, 24576, 32768, 0],
544 [8192, 16384, 24576, 32768, 0],
545 [8192, 16384, 24576, 32768, 0],
546 [8192, 16384, 24576, 32768, 0],
547 [8192, 16384, 24576, 32768, 0],
548 [8192, 16384, 24576, 32768, 0],
549 [8192, 16384, 24576, 32768, 0],
550 [8192, 16384, 24576, 32768, 0],
551 [8192, 16384, 24576, 32768, 0],
552 [8192, 16384, 24576, 32768, 0],
553 [8192, 16384, 24576, 32768, 0],
554 [8192, 16384, 24576, 32768, 0],
555 [8192, 16384, 24576, 32768, 0],
556 [8192, 16384, 24576, 32768, 0],
557];
558
559/// `Default_Coeff_Br_Cdf[2][3][0]` (spec 9.4): a base-range increment in a
560/// 32x32 luma transform block, for each of the twenty-one contexts.
561pub const COEFF_BR_LUMA_32: [[u16; 5]; 21] = [
562 [9040, 14786, 18360, 32768, 0],
563 [9979, 15718, 19415, 32768, 0],
564 [7913, 13918, 18311, 32768, 0],
565 [5859, 10889, 15184, 32768, 0],
566 [4593, 8677, 12510, 32768, 0],
567 [3820, 7396, 10791, 32768, 0],
568 [1730, 3471, 5192, 32768, 0],
569 [11803, 18365, 22709, 32768, 0],
570 [11419, 18058, 22225, 32768, 0],
571 [9418, 15774, 20243, 32768, 0],
572 [7539, 13325, 17657, 32768, 0],
573 [6233, 11317, 15384, 32768, 0],
574 [5137, 9656, 13545, 32768, 0],
575 [2977, 5774, 8349, 32768, 0],
576 [21207, 27246, 29640, 32768, 0],
577 [19547, 26578, 29497, 32768, 0],
578 [16169, 23871, 27690, 32768, 0],
579 [12820, 20458, 25018, 32768, 0],
580 [10224, 17332, 22214, 32768, 0],
581 [8526, 15048, 19884, 32768, 0],
582 [5037, 9410, 13118, 32768, 0],
583];
584
585/// `Default_Coeff_Base_Eob_Cdf[2][3][0]` (spec 9.4): the level of the last
586/// coefficient of a 32x32 luma transform block, less one, for each of the
587/// four contexts its position in the scan gives.
588pub const COEFF_BASE_EOB_LUMA_32: [[u16; 4]; 4] = [
589 [2809, 19301, 32768, 0],
590 [32205, 32622, 32768, 0],
591 [32338, 32730, 32768, 0],
592 [31786, 32616, 32768, 0],
593];
594
595/// `Default_Eob_Extra_Cdf[2][3][0]` (spec 9.4): the top bit of the offset
596/// into an end-of-block position group, for each group.
597pub const EOB_EXTRA_LUMA_32: [[u16; 3]; 9] = [
598 [23312, 32768, 0],
599 [21607, 32768, 0],
600 [16526, 32768, 0],
601 [18957, 32768, 0],
602 [18034, 32768, 0],
603 [18934, 32768, 0],
604 [24247, 32768, 0],
605 [16921, 32768, 0],
606 [17080, 32768, 0],
607];
608
609/// `Av1_Nz_Map_Ctx_Offset` for a 32x32 transform (the position term of the
610/// coefficient-level context, spec 8.3.2): row and column clamped to four.
611pub const NZ_MAP_CTX_OFFSET_32: [[u8; 5]; 5] = [
612 [0, 1, 6, 6, 21],
613 [1, 6, 6, 21, 21],
614 [6, 6, 21, 21, 21],
615 [6, 21, 21, 21, 21],
616 [21, 21, 21, 21, 21],
617];
618
619/// `Default_Txb_Skip_Cdf[2][2][7..10]` (spec 9.4): the all-zero flag of a
620/// 16x16 chroma transform block that covers its whole plane block, for the
621/// three contexts its coded neighbours give.
622pub const TXB_SKIP_CHROMA_16: [[u16; 3]; 3] =
623 [[3648, 32768, 0], [15690, 32768, 0], [26815, 32768, 0]];
624
625/// `Default_Coeff_Base_Cdf[2][2][1]` (spec 9.4): the level of a coefficient
626/// of a 16x16 chroma transform block, capped at three, for each of the
627/// forty-two contexts its neighbours and its position give.
628pub const COEFF_BASE_CHROMA_16: [[u16; 5]; 42] = [
629 [9185, 19694, 24688, 32768, 0],
630 [26081, 31985, 32621, 32768, 0],
631 [16015, 29000, 31787, 32768, 0],
632 [10542, 23690, 29206, 32768, 0],
633 [6732, 17945, 24677, 32768, 0],
634 [3916, 11039, 16722, 32768, 0],
635 [28224, 32566, 32744, 32768, 0],
636 [19100, 31138, 32485, 32768, 0],
637 [12528, 26620, 30879, 32768, 0],
638 [7741, 20277, 26885, 32768, 0],
639 [4566, 12845, 18990, 32768, 0],
640 [29933, 32593, 32718, 32768, 0],
641 [17670, 30333, 32155, 32768, 0],
642 [10385, 23600, 28909, 32768, 0],
643 [6243, 16236, 22407, 32768, 0],
644 [3976, 10389, 16017, 32768, 0],
645 [28377, 32561, 32738, 32768, 0],
646 [19366, 31175, 32482, 32768, 0],
647 [13327, 27175, 31094, 32768, 0],
648 [8258, 20769, 27143, 32768, 0],
649 [4703, 13198, 19527, 32768, 0],
650 [31086, 32706, 32748, 32768, 0],
651 [22853, 31902, 32583, 32768, 0],
652 [14759, 28186, 31419, 32768, 0],
653 [9284, 22382, 28348, 32768, 0],
654 [5585, 15192, 21868, 32768, 0],
655 [28291, 32652, 32746, 32768, 0],
656 [19849, 32107, 32571, 32768, 0],
657 [14834, 26818, 29214, 32768, 0],
658 [10306, 22594, 28672, 32768, 0],
659 [6615, 17384, 23384, 32768, 0],
660 [28947, 32604, 32745, 32768, 0],
661 [25625, 32289, 32646, 32768, 0],
662 [18758, 28672, 31403, 32768, 0],
663 [10017, 23430, 28523, 32768, 0],
664 [6862, 15269, 22131, 32768, 0],
665 [23933, 32509, 32739, 32768, 0],
666 [19927, 31495, 32631, 32768, 0],
667 [11903, 26023, 30621, 32768, 0],
668 [7026, 20094, 27252, 32768, 0],
669 [5998, 18106, 24437, 32768, 0],
670 [8192, 16384, 24576, 32768, 0],
671];
672
673/// `Default_Coeff_Br_Cdf[2][2][1]` (spec 9.4): a base-range increment in a
674/// 16x16 chroma transform block, for each of its twenty-one contexts.
675pub const COEFF_BR_CHROMA_16: [[u16; 5]; 21] = [
676 [13569, 19800, 23206, 32768, 0],
677 [13128, 19924, 23869, 32768, 0],
678 [8329, 14841, 19403, 32768, 0],
679 [6130, 10976, 15057, 32768, 0],
680 [4682, 8839, 12518, 32768, 0],
681 [3656, 7409, 10588, 32768, 0],
682 [2577, 5099, 7412, 32768, 0],
683 [22427, 28684, 30585, 32768, 0],
684 [20913, 27750, 30139, 32768, 0],
685 [15840, 24109, 27834, 32768, 0],
686 [12308, 20029, 24569, 32768, 0],
687 [10216, 16785, 21458, 32768, 0],
688 [8309, 14203, 19113, 32768, 0],
689 [6043, 11168, 15307, 32768, 0],
690 [23166, 28901, 30998, 32768, 0],
691 [21899, 28405, 30751, 32768, 0],
692 [18413, 26091, 29443, 32768, 0],
693 [15233, 23114, 27352, 32768, 0],
694 [12683, 20472, 25288, 32768, 0],
695 [10702, 18259, 23409, 32768, 0],
696 [8125, 14464, 19226, 32768, 0],
697];
698
699/// `Default_Coeff_Base_Eob_Cdf[2][2][1]` (spec 9.4): the level of the last
700/// coefficient of a 16x16 chroma transform block, less one, for each of the
701/// four contexts its position in the scan gives.
702pub const COEFF_BASE_EOB_CHROMA_16: [[u16; 4]; 4] = [
703 [25476, 30366, 32768, 0],
704 [32169, 32687, 32768, 0],
705 [32479, 32689, 32768, 0],
706 [31673, 32634, 32768, 0],
707];
708
709/// `Default_Eob_Extra_Cdf[2][2][1]` (spec 9.4): the top bit of the offset
710/// into an end-of-block position group of a 16x16 chroma transform block.
711pub const EOB_EXTRA_CHROMA_16: [[u16; 3]; 9] = [
712 [22041, 32768, 0],
713 [23434, 32768, 0],
714 [20001, 32768, 0],
715 [20554, 32768, 0],
716 [20951, 32768, 0],
717 [20145, 32768, 0],
718 [15562, 32768, 0],
719 [16384, 32768, 0],
720 [16384, 32768, 0],
721];
722
723/// `Default_Eob_Pt_256_Cdf[2][1][0]` (spec 9.4): the end-of-block group of a
724/// 256-coefficient chroma transform block with a two-dimensional transform.
725pub const EOB_PT_256_CHROMA: [u16; 10] = [
726 11514, 13794, 17480, 20754, 24361, 27378, 29492, 31277, 32768, 0,
727];
728
729/// `Default_Dc_Sign_Cdf[2][1]` (spec 9.4): the sign of a chroma DC
730/// coefficient, indexed the way [`DC_SIGN_LUMA`] is.
731pub const DC_SIGN_CHROMA: [[u16; 3]; 3] = [[15232, 32768, 0], [12928, 32768, 0], [17280, 32768, 0]];
732
733/// `Default_Angle_Delta_Cdf` (spec 9.4): the offset a directional intra mode
734/// is steered by, seven symbols from -3 to +3, one row per directional mode in
735/// the order they follow `V_PRED`.
736pub const ANGLE_DELTA: [[u16; 8]; 8] = [
737 [2180, 5032, 7567, 22776, 26989, 30217, 32768, 0],
738 [2301, 5608, 8801, 23487, 26974, 30330, 32768, 0],
739 [3780, 11018, 13699, 19354, 23083, 31286, 32768, 0],
740 [4581, 11226, 15147, 17138, 21834, 28397, 32768, 0],
741 [1737, 10927, 14509, 19588, 22745, 28823, 32768, 0],
742 [2664, 10176, 12485, 17650, 21600, 30495, 32768, 0],
743 [2240, 11096, 15453, 20341, 22561, 28917, 32768, 0],
744 [3605, 10428, 12459, 17676, 21244, 30655, 32768, 0],
745];
746/// `Default_Coeff_Base_Cdf[2][4][0]` (spec 9.4): the level of a coefficient of a 64x64 luma
747/// transform block, capped at three, for each of the forty-two contexts its neighbours and its
748/// position give.
749pub const COEFF_BASE_LUMA_64: [[u16; 5]; 42] = [
750 [2575, 7281, 11077, 32768, 0],
751 [14002, 20866, 25402, 32768, 0],
752 [6343, 15056, 19658, 32768, 0],
753 [4474, 11858, 17041, 32768, 0],
754 [2865, 8299, 12534, 32768, 0],
755 [1344, 3949, 6391, 32768, 0],
756 [24720, 31239, 32459, 32768, 0],
757 [12585, 25356, 29968, 32768, 0],
758 [7181, 18246, 24444, 32768, 0],
759 [5025, 13667, 19885, 32768, 0],
760 [2521, 7304, 11605, 32768, 0],
761 [29908, 32252, 32584, 32768, 0],
762 [17421, 29156, 31575, 32768, 0],
763 [9889, 22188, 27782, 32768, 0],
764 [5878, 15647, 22123, 32768, 0],
765 [2814, 8665, 13323, 32768, 0],
766 [30183, 32568, 32713, 32768, 0],
767 [18528, 30195, 32049, 32768, 0],
768 [10982, 24606, 29657, 32768, 0],
769 [6957, 18165, 25231, 32768, 0],
770 [3508, 10118, 15468, 32768, 0],
771 [31761, 32736, 32748, 32768, 0],
772 [21041, 31328, 32546, 32768, 0],
773 [12568, 26732, 31166, 32768, 0],
774 [8052, 20720, 27733, 32768, 0],
775 [4336, 12192, 18396, 32768, 0],
776 [8192, 16384, 24576, 32768, 0],
777 [8192, 16384, 24576, 32768, 0],
778 [8192, 16384, 24576, 32768, 0],
779 [8192, 16384, 24576, 32768, 0],
780 [8192, 16384, 24576, 32768, 0],
781 [8192, 16384, 24576, 32768, 0],
782 [8192, 16384, 24576, 32768, 0],
783 [8192, 16384, 24576, 32768, 0],
784 [8192, 16384, 24576, 32768, 0],
785 [8192, 16384, 24576, 32768, 0],
786 [8192, 16384, 24576, 32768, 0],
787 [8192, 16384, 24576, 32768, 0],
788 [8192, 16384, 24576, 32768, 0],
789 [8192, 16384, 24576, 32768, 0],
790 [8192, 16384, 24576, 32768, 0],
791 [8192, 16384, 24576, 32768, 0],
792];
793
794/// `Default_Coeff_Base_Eob_Cdf[2][4][0]` (spec 9.4): the level of the last coefficient of a
795/// 64x64 luma transform block, less one, for each of the four contexts its position gives.
796pub const COEFF_BASE_EOB_LUMA_64: [[u16; 4]; 4] = [
797 [935, 3382, 32768, 0],
798 [30789, 31909, 32768, 0],
799 [32466, 32756, 32768, 0],
800 [30860, 32513, 32768, 0],
801];
802
803/// `Default_Eob_Extra_Cdf[2][4][0]` (spec 9.4): the top bit of the end-of-block position of a
804/// 64x64 luma transform block, one context per end-of-block group.
805pub const EOB_EXTRA_LUMA_64: [[u16; 3]; 9] = [
806 [26998, 32768, 0],
807 [16737, 32768, 0],
808 [17838, 32768, 0],
809 [18922, 32768, 0],
810 [19515, 32768, 0],
811 [18636, 32768, 0],
812 [17333, 32768, 0],
813 [15776, 32768, 0],
814 [22658, 32768, 0],
815];
816
817/// `Default_Coeff_Base_Cdf[2][3][1]` (spec 9.4): the level of a coefficient of a 32x32 chroma
818/// transform block, capped at three, for each of the forty-two contexts its neighbours and its
819/// position give.
820pub const COEFF_BASE_CHROMA_32: [[u16; 5]; 42] = [
821 [10202, 20633, 25484, 32768, 0],
822 [27336, 31445, 32352, 32768, 0],
823 [12420, 24384, 28552, 32768, 0],
824 [7648, 18115, 23856, 32768, 0],
825 [5662, 14341, 19902, 32768, 0],
826 [3611, 10328, 15390, 32768, 0],
827 [30945, 32616, 32736, 32768, 0],
828 [18682, 30505, 32253, 32768, 0],
829 [11513, 25336, 30203, 32768, 0],
830 [7449, 19452, 26148, 32768, 0],
831 [4482, 13051, 18886, 32768, 0],
832 [32022, 32690, 32747, 32768, 0],
833 [18578, 30501, 32146, 32768, 0],
834 [11249, 23368, 28631, 32768, 0],
835 [5645, 16958, 22158, 32768, 0],
836 [5009, 11444, 16637, 32768, 0],
837 [31357, 32710, 32748, 32768, 0],
838 [21552, 31494, 32504, 32768, 0],
839 [13891, 27677, 31340, 32768, 0],
840 [9051, 22098, 28172, 32768, 0],
841 [5190, 13377, 19486, 32768, 0],
842 [32364, 32740, 32748, 32768, 0],
843 [24839, 31907, 32551, 32768, 0],
844 [17160, 28779, 31696, 32768, 0],
845 [12452, 24137, 29602, 32768, 0],
846 [6165, 15389, 22477, 32768, 0],
847 [8192, 16384, 24576, 32768, 0],
848 [8192, 16384, 24576, 32768, 0],
849 [8192, 16384, 24576, 32768, 0],
850 [8192, 16384, 24576, 32768, 0],
851 [8192, 16384, 24576, 32768, 0],
852 [8192, 16384, 24576, 32768, 0],
853 [8192, 16384, 24576, 32768, 0],
854 [8192, 16384, 24576, 32768, 0],
855 [8192, 16384, 24576, 32768, 0],
856 [8192, 16384, 24576, 32768, 0],
857 [8192, 16384, 24576, 32768, 0],
858 [8192, 16384, 24576, 32768, 0],
859 [8192, 16384, 24576, 32768, 0],
860 [8192, 16384, 24576, 32768, 0],
861 [8192, 16384, 24576, 32768, 0],
862 [8192, 16384, 24576, 32768, 0],
863];
864
865/// `Default_Coeff_Br_Cdf[2][3][1]` (spec 9.4): the base-range tail of a 32x32 chroma transform
866/// block, for each of the twenty-one contexts its neighbours and its position give.
867pub const COEFF_BR_CHROMA_32: [[u16; 5]; 21] = [
868 [12339, 17329, 20140, 32768, 0],
869 [13505, 19895, 23225, 32768, 0],
870 [9847, 16944, 21564, 32768, 0],
871 [7280, 13256, 18348, 32768, 0],
872 [4712, 10009, 14454, 32768, 0],
873 [4361, 7914, 12477, 32768, 0],
874 [2870, 5628, 7995, 32768, 0],
875 [20061, 25504, 28526, 32768, 0],
876 [15235, 22878, 26145, 32768, 0],
877 [12985, 19958, 24155, 32768, 0],
878 [9782, 16641, 21403, 32768, 0],
879 [9456, 16360, 20760, 32768, 0],
880 [6855, 12940, 18557, 32768, 0],
881 [5661, 10564, 15002, 32768, 0],
882 [25656, 30602, 31894, 32768, 0],
883 [22570, 29107, 31092, 32768, 0],
884 [18917, 26423, 29541, 32768, 0],
885 [15940, 23649, 27754, 32768, 0],
886 [12803, 20581, 25219, 32768, 0],
887 [11082, 18695, 23376, 32768, 0],
888 [7939, 14373, 19005, 32768, 0],
889];
890
891/// `Default_Coeff_Base_Eob_Cdf[2][3][1]` (spec 9.4): the level of the last coefficient of a
892/// 32x32 chroma transform block, less one, for each of the four contexts its position gives.
893pub const COEFF_BASE_EOB_CHROMA_32: [[u16; 4]; 4] = [
894 [22737, 29105, 32768, 0],
895 [30810, 32362, 32768, 0],
896 [30014, 32627, 32768, 0],
897 [30528, 32574, 32768, 0],
898];
899
900/// `Default_Eob_Extra_Cdf[2][3][1]` (spec 9.4): the top bit of the end-of-block position of a
901/// 32x32 chroma transform block, one context per end-of-block group.
902pub const EOB_EXTRA_CHROMA_32: [[u16; 3]; 9] = [
903 [26579, 32768, 0],
904 [24910, 32768, 0],
905 [18637, 32768, 0],
906 [19800, 32768, 0],
907 [20388, 32768, 0],
908 [9887, 32768, 0],
909 [15642, 32768, 0],
910 [30198, 32768, 0],
911 [24721, 32768, 0],
912];
913
914/// `Default_Txb_Skip_Cdf[2][3][7..10]` (spec 9.4): the all-zero flag of a 32x32 chroma transform
915/// block that covers its whole plane block, for the three contexts its coded neighbours give.
916pub const TXB_SKIP_CHROMA_32: [[u16; 3]; 3] =
917 [[5124, 32768, 0], [18719, 32768, 0], [28468, 32768, 0]];
918
919/// `Default_Eob_Pt_1024_Cdf[2][1][0]` (spec 9.4): the end-of-block group of a
920/// 1024-coefficient chroma transform block with a two-dimensional transform.
921pub const EOB_PT_1024_CHROMA: [u16; 12] = [
922 9577, 12466, 17739, 20750, 22061, 23215, 24601, 25483, 25843, 32056, 32768, 0,
923];
924/// `Default_Txb_Skip_Cdf[2][2][0]`: the all-zero flag of a 16x16 luma transform, whose only context is zero because the transform covers its whole block.
925pub const TXB_SKIP_LUMA_16: [u16; 3] = [32363, 32768, 0];
926
927/// `Default_Txb_Skip_Cdf[2][1][7..10]`: the all-zero flag of an 8x8 chroma transform.
928pub const TXB_SKIP_CHROMA_8: [[u16; 3]; 3] =
929 [[3050, 32768, 0], [14603, 32768, 0], [25155, 32768, 0]];
930
931/// `Default_Eob_Pt_256_Cdf[2][0][0]`: the end-of-block group of a 16x16 luma transform.
932pub const EOB_PT_256_LUMA: [u16; 10] =
933 [3089, 3920, 6038, 9460, 14266, 19881, 25766, 29176, 32768, 0];
934
935/// `Default_Eob_Pt_64_Cdf[2][1][0]`: the end-of-block group of an 8x8 chroma transform.
936pub const EOB_PT_64_CHROMA: [u16; 8] = [15050, 17126, 21410, 24886, 28156, 30726, 32768, 0];
937
938/// `Default_Eob_Extra_Cdf[2][2][0]`: the top offset bit inside a 16x16 luma transform's end-of-block group.
939pub const EOB_EXTRA_LUMA_16: [[u16; 3]; 9] = [
940 [19833, 32768, 0],
941 [21502, 32768, 0],
942 [17485, 32768, 0],
943 [20267, 32768, 0],
944 [18353, 32768, 0],
945 [23329, 32768, 0],
946 [21478, 32768, 0],
947 [16384, 32768, 0],
948 [16384, 32768, 0],
949];
950
951/// `Default_Eob_Extra_Cdf[2][1][1]`: the same, for an 8x8 chroma transform.
952pub const EOB_EXTRA_CHROMA_8: [[u16; 3]; 9] = [
953 [20536, 32768, 0],
954 [20664, 32768, 0],
955 [20625, 32768, 0],
956 [19123, 32768, 0],
957 [14862, 32768, 0],
958 [16384, 32768, 0],
959 [16384, 32768, 0],
960 [16384, 32768, 0],
961 [16384, 32768, 0],
962];
963
964/// `Default_Coeff_Base_Cdf[2][2][0]`: a 16x16 luma coefficient's base level.
965pub const COEFF_BASE_LUMA_16: [[u16; 5]; 42] = [
966 [9800, 17635, 21073, 32768, 0],
967 [26153, 31885, 32527, 32768, 0],
968 [15038, 27852, 31006, 32768, 0],
969 [8718, 20564, 26486, 32768, 0],
970 [5128, 14076, 20514, 32768, 0],
971 [2636, 7566, 11925, 32768, 0],
972 [27551, 32504, 32701, 32768, 0],
973 [18310, 30054, 32100, 32768, 0],
974 [10211, 23420, 29082, 32768, 0],
975 [6222, 16876, 23916, 32768, 0],
976 [3462, 9954, 15498, 32768, 0],
977 [29991, 32633, 32721, 32768, 0],
978 [19883, 30751, 32201, 32768, 0],
979 [11141, 24184, 29285, 32768, 0],
980 [6420, 16940, 23774, 32768, 0],
981 [3392, 9753, 15118, 32768, 0],
982 [28465, 32616, 32712, 32768, 0],
983 [19850, 30702, 32244, 32768, 0],
984 [10983, 24024, 29223, 32768, 0],
985 [6294, 16770, 23582, 32768, 0],
986 [3244, 9283, 14509, 32768, 0],
987 [30023, 32717, 32748, 32768, 0],
988 [22940, 32032, 32626, 32768, 0],
989 [14282, 27928, 31473, 32768, 0],
990 [8562, 21327, 27914, 32768, 0],
991 [4846, 13393, 19919, 32768, 0],
992 [29981, 32590, 32695, 32768, 0],
993 [20465, 30963, 32166, 32768, 0],
994 [11479, 23579, 28195, 32768, 0],
995 [5916, 15648, 22073, 32768, 0],
996 [3031, 8605, 13398, 32768, 0],
997 [31146, 32691, 32739, 32768, 0],
998 [23106, 31724, 32444, 32768, 0],
999 [13783, 26738, 30439, 32768, 0],
1000 [7852, 19468, 25807, 32768, 0],
1001 [3860, 11124, 16853, 32768, 0],
1002 [31014, 32724, 32748, 32768, 0],
1003 [23629, 32109, 32628, 32768, 0],
1004 [14747, 28115, 31403, 32768, 0],
1005 [8545, 21242, 27478, 32768, 0],
1006 [4574, 12781, 19067, 32768, 0],
1007 [8192, 16384, 24576, 32768, 0],
1008];
1009
1010/// `Default_Coeff_Base_Cdf[2][1][1]`: an 8x8 chroma coefficient's base level.
1011pub const COEFF_BASE_CHROMA_8: [[u16; 5]; 42] = [
1012 [11016, 22111, 26794, 32768, 0],
1013 [25946, 32357, 32677, 32768, 0],
1014 [17890, 30452, 32252, 32768, 0],
1015 [11678, 25142, 29816, 32768, 0],
1016 [6720, 17534, 24584, 32768, 0],
1017 [4230, 11665, 17820, 32768, 0],
1018 [28400, 32623, 32747, 32768, 0],
1019 [21164, 31668, 32575, 32768, 0],
1020 [13572, 27388, 31182, 32768, 0],
1021 [8234, 20750, 27358, 32768, 0],
1022 [5065, 14055, 20897, 32768, 0],
1023 [28981, 32547, 32705, 32768, 0],
1024 [18681, 30543, 32239, 32768, 0],
1025 [10919, 24075, 29286, 32768, 0],
1026 [6431, 17199, 24077, 32768, 0],
1027 [3819, 10464, 16618, 32768, 0],
1028 [26870, 32467, 32693, 32768, 0],
1029 [19041, 30831, 32347, 32768, 0],
1030 [11794, 25211, 30016, 32768, 0],
1031 [6888, 18019, 24970, 32768, 0],
1032 [4370, 12363, 18992, 32768, 0],
1033 [29578, 32670, 32744, 32768, 0],
1034 [23159, 32007, 32613, 32768, 0],
1035 [15315, 28669, 31676, 32768, 0],
1036 [9298, 22607, 28782, 32768, 0],
1037 [6144, 15913, 22968, 32768, 0],
1038 [28110, 32499, 32669, 32768, 0],
1039 [21574, 30937, 32015, 32768, 0],
1040 [12759, 24818, 28727, 32768, 0],
1041 [6545, 16761, 23042, 32768, 0],
1042 [3649, 10597, 16833, 32768, 0],
1043 [28163, 32552, 32728, 32768, 0],
1044 [22101, 31469, 32464, 32768, 0],
1045 [13160, 25472, 30143, 32768, 0],
1046 [7303, 18684, 25468, 32768, 0],
1047 [5241, 13975, 20955, 32768, 0],
1048 [28400, 32631, 32744, 32768, 0],
1049 [22104, 31793, 32603, 32768, 0],
1050 [13557, 26571, 30846, 32768, 0],
1051 [7749, 19861, 26675, 32768, 0],
1052 [4873, 14030, 21234, 32768, 0],
1053 [8192, 16384, 24576, 32768, 0],
1054];
1055
1056/// `Default_Coeff_Base_Eob_Cdf[2][2][0]`: the base level of the last coefficient of a 16x16 luma transform.
1057pub const COEFF_BASE_EOB_LUMA_16: [[u16; 4]; 4] = [
1058 [12854, 29093, 32768, 0],
1059 [32272, 32558, 32768, 0],
1060 [32667, 32729, 32768, 0],
1061 [32306, 32585, 32768, 0],
1062];
1063
1064/// `Default_Coeff_Base_Eob_Cdf[2][1][1]`: the same, for an 8x8 chroma transform.
1065pub const COEFF_BASE_EOB_CHROMA_8: [[u16; 4]; 4] = [
1066 [27116, 30842, 32768, 0],
1067 [31971, 32598, 32768, 0],
1068 [32088, 32576, 32768, 0],
1069 [32067, 32664, 32768, 0],
1070];
1071
1072/// `Default_Coeff_Br_Cdf[2][2][0]`: the base-range tail of a 16x16 luma coefficient.
1073pub const COEFF_BR_LUMA_16: [[u16; 5]; 21] = [
1074 [14438, 20798, 24089, 32768, 0],
1075 [12621, 19203, 23097, 32768, 0],
1076 [8177, 14125, 18402, 32768, 0],
1077 [5674, 10501, 14456, 32768, 0],
1078 [4236, 8239, 11733, 32768, 0],
1079 [3447, 6750, 9806, 32768, 0],
1080 [1986, 3950, 5864, 32768, 0],
1081 [16208, 22099, 24930, 32768, 0],
1082 [16537, 24025, 27585, 32768, 0],
1083 [12780, 20381, 24867, 32768, 0],
1084 [9767, 16612, 21416, 32768, 0],
1085 [7686, 13738, 18398, 32768, 0],
1086 [6333, 11614, 15964, 32768, 0],
1087 [3941, 7571, 10836, 32768, 0],
1088 [22819, 27422, 29202, 32768, 0],
1089 [22224, 28514, 30721, 32768, 0],
1090 [17660, 25433, 28913, 32768, 0],
1091 [13574, 21482, 26002, 32768, 0],
1092 [10629, 17977, 22938, 32768, 0],
1093 [8612, 15298, 20265, 32768, 0],
1094 [5607, 10491, 14596, 32768, 0],
1095];
1096
1097/// `Default_Coeff_Br_Cdf[2][1][1]`: the base-range tail of an 8x8 chroma coefficient.
1098pub const COEFF_BR_CHROMA_8: [[u16; 5]; 21] = [
1099 [14433, 21155, 24938, 32768, 0],
1100 [14658, 21716, 25545, 32768, 0],
1101 [9923, 16824, 21557, 32768, 0],
1102 [6982, 13052, 17721, 32768, 0],
1103 [5419, 10503, 15050, 32768, 0],
1104 [4852, 9162, 13014, 32768, 0],
1105 [3271, 6395, 9630, 32768, 0],
1106 [22210, 27833, 30109, 32768, 0],
1107 [20750, 27368, 29821, 32768, 0],
1108 [16894, 24828, 28573, 32768, 0],
1109 [13247, 21276, 25757, 32768, 0],
1110 [10038, 17265, 22563, 32768, 0],
1111 [8587, 14947, 20327, 32768, 0],
1112 [5645, 11371, 15252, 32768, 0],
1113 [22027, 27526, 29714, 32768, 0],
1114 [23098, 29146, 31221, 32768, 0],
1115 [19886, 27341, 30272, 32768, 0],
1116 [15609, 23747, 28046, 32768, 0],
1117 [11993, 20065, 24939, 32768, 0],
1118 [9637, 18267, 23671, 32768, 0],
1119 [7625, 13801, 19144, 32768, 0],
1120];
1121
1122/// `Default_Partition_Cdf[0..4]`, `PARTITION_W16` format (spec 5.11.4 codes an
1123/// 8x8 block's partition as a 4-symbol read that only ever terminates
1124/// `PARTITION_NONE` for this writer -- `PARTITION_SPLIT` is illegal at 8x8, so
1125/// row 4 of libaom's real (8-symbol) 8x8 table is dropped and only the shared
1126/// leading four symbols, common to every partition-symbol alphabet, are kept.
1127pub const PARTITION_W8: [[u16; 5]; 4] = [
1128 [19132, 25510, 30392, 32768, 0],
1129 [13928, 19855, 28540, 32768, 0],
1130 [12522, 23679, 28629, 32768, 0],
1131 [9896, 18783, 25853, 32768, 0],
1132];
1133
1134/// `Default_Partition_Cdf[0..4]`: the partition symbol of a 16x16 block.
1135pub const PARTITION_W16: [[u16; 11]; 4] = [
1136 [
1137 15597, 20929, 24571, 26706, 27664, 28821, 29601, 30571, 31902, 32768, 0,
1138 ],
1139 [
1140 7925, 11043, 16785, 22470, 23971, 25043, 26651, 28701, 29834, 32768, 0,
1141 ],
1142 [
1143 5414, 13269, 15111, 20488, 22360, 24500, 25537, 26336, 32117, 32768, 0,
1144 ],
1145 [
1146 2662, 6362, 8614, 20860, 23053, 24778, 26436, 27829, 31171, 32768, 0,
1147 ],
1148];
1149
1150/// The transform type of a 16x16 intra luma transform, as an index into the
1151/// spec's `Tx_Type_Intra_Inv_Set2`, indexed by the block's luma mode.
1152///
1153/// A 16x16 intra transform is the only size this writer's intra path codes
1154/// whose transform-type set holds more than one type: 32x32 and 64x64 are
1155/// DCT-only for an *intra* block by spec 5.11.48's `get_tx_set` (its
1156/// `txSzSqrUp == TX_32X32` case returns `TX_SET_DCTONLY` only in the
1157/// `!is_inter` branch). An `is_inter` 32x32 transform takes the other branch
1158/// and reads [`INTER_TX_TYPE_SET3_32`] instead.
1159pub const INTRA_TX_TYPE_SET2_16: [[u16; 6]; 13] = [
1160 [1127, 12814, 22772, 27483, 32768, 0],
1161 [145, 6761, 11980, 26667, 32768, 0],
1162 [362, 5887, 11678, 16725, 32768, 0],
1163 [385, 15213, 18587, 30693, 32768, 0],
1164 [25, 2914, 23134, 27903, 32768, 0],
1165 [60, 4470, 11749, 23991, 32768, 0],
1166 [37, 3332, 14511, 21448, 32768, 0],
1167 [157, 6320, 13036, 17439, 32768, 0],
1168 [119, 6719, 12906, 29396, 32768, 0],
1169 [47, 5537, 12576, 21499, 32768, 0],
1170 [269, 6076, 11258, 23115, 32768, 0],
1171 [83, 5615, 12001, 17228, 32768, 0],
1172 [1968, 5556, 12023, 18547, 32768, 0],
1173];
1174
1175/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_3` row for `TX_32X32` (spec
1176/// 9.4): the transform type of an `is_inter` 32x32 luma transform, whose
1177/// `get_tx_set` (5.11.48) returns `TX_SET_INTER_3` -- `{IDTX, DCT_DCT}` --
1178/// because `txSzSqrUp == TX_32X32` takes the `is_inter` branch there, unlike
1179/// an intra block's, which is DCT-only at that size. The writer only ever
1180/// uses DCT_DCT, index one of `Tx_Type_Inter_Inv_Set3`.
1181pub const INTER_TX_TYPE_SET3_32: [u16; 3] = [748, 32768, 0];
1182
1183/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_3` row for `TX_16X16` (spec
1184/// 9.4): the transform type of an `is_inter` 16x16 luma transform coded under
1185/// `reduced_tx_set` (spec 5.11.48's `use_reduced_set` branch forces
1186/// `TX_SET_INTER_3` for every inter size below 32x32, the same two-symbol set
1187/// [`INTER_TX_TYPE_SET3_32`] reads at 32x32) -- without `reduced_tx_set` a
1188/// 16x16 inter transform reads the twelve-symbol `TX_SET_INTER_2` instead,
1189/// which this crate does not carry a table for. The writer only ever uses
1190/// DCT_DCT, index one of `Tx_Type_Inter_Inv_Set3`, same as the 32x32 table.
1191pub const INTER_TX_TYPE_SET3_16: [u16; 3] = [1998, 32768, 0];
1192
1193/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_3` row for `TX_8X8` (spec 9.4):
1194/// the transform type of an `is_inter` 8x8 luma transform under
1195/// `reduced_tx_set` -- an 8x8 leaf under a straddling 16x16 block
1196/// (lane-av1inter8), the same two-symbol set [`INTER_TX_TYPE_SET3_16`] and
1197/// [`INTER_TX_TYPE_SET3_32`] read at their own sizes, just its own default
1198/// probability and adaptation state (libaom `entropymode.c`'s
1199/// `default_inter_ext_tx_cdf[EXT_TX_SET_DCT_IDTX][TX_8X8]`).
1200pub const INTER_TX_TYPE_SET3_8: [u16; 3] = [4167, 32768, 0];
1201
1202/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_2` (`EXT_TX_SET_DTT9_IDTX_1DDCT`)
1203/// row for `TX_16X16` (lane-cdffwd2, spec 9.4/5.11.48): the twelve-symbol
1204/// transform type of an `is_inter` 16x16 luma transform when `reduced_tx_set
1205/// == 0` -- `av1_get_ext_tx_set_type`'s `av1_ext_tx_set_lookup[1][1]`, not
1206/// [`INTER_TX_TYPE_SET3_16`]'s two-symbol reduced set (libaom
1207/// `entropymode.c` `default_inter_ext_tx_cdf[2][TX_16X16]`).
1208pub const INTER_TX_TYPE_SET2_16: [u16; 13] = [
1209 770, 2421, 5225, 12907, 15819, 18927, 21561, 24089, 26595, 28526, 30529, 32768, 0,
1210];
1211
1212/// `Default_Inter_Ext_Tx_Cdf`'s `TX_SET_INTER_1` (`EXT_TX_SET_ALL16`) row for
1213/// `TX_8X8` (lane-cdffwd2): the full sixteen-symbol transform type of an
1214/// `is_inter` 8x8 luma transform when `reduced_tx_set == 0`
1215/// (`av1_ext_tx_set_lookup[1][0]`, libaom `entropymode.c`
1216/// `default_inter_ext_tx_cdf[1][TX_8X8]`).
1217pub const INTER_TX_TYPE_SET1_8: [u16; 17] = [
1218 1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357, 17674, 20408, 22517, 25010, 27116, 28856,
1219 30749, 32768, 0,
1220];
1221
1222// The inter-frame tables below (spec 9.4) support the syntax an inter block
1223// needs: whether it is coded as intra at all, which reference frame and
1224// motion vector it takes when it is not. The compound-reference tables
1225// (`COMP_MODE`/`COMP_REF_TYPE`/`UNI_COMP_REF`/`COMP_REF`/`COMP_BWDREF` above)
1226// read once a frame's `reference_select` header bit is set (lane-av1comp);
1227// compound *prediction* itself -- `inter_compound_mode`, compound DRL, the
1228// mvstack's dual-ref scan, and distance-weighted MC blending -- is not yet
1229// ported, so a block that actually reads `COMPOUND_REFERENCE` still refuses.
1230
1231/// `default_inter_compound_mode_cdf` (entropymode.c): which of the eight
1232/// `INTER_COMPOUND_MODES` (`NEAREST_NEARESTMV`..`NEW_NEWMV`) a compound
1233/// block takes, indexed by `av1_mode_context_analyzer`'s `comp_ctx` (spec
1234/// 5.11.24's `compound_mode`, libaom's `read_inter_compound_mode`) --
1235/// lane-av1comp, symbol read only, not yet wired into MV assignment or MC.
1236pub const INTER_COMPOUND_MODE: [[u16; 9]; 8] = [
1237 [7760, 13823, 15808, 17641, 19156, 20666, 26891, 32768, 0],
1238 [10730, 19452, 21145, 22749, 24039, 25131, 28724, 32768, 0],
1239 [10664, 20221, 21588, 22906, 24295, 25387, 28436, 32768, 0],
1240 [13298, 16984, 20471, 24182, 25067, 25736, 26422, 32768, 0],
1241 [18904, 23325, 25242, 27432, 27898, 28258, 30758, 32768, 0],
1242 [10725, 17454, 20124, 22820, 24195, 25168, 26046, 32768, 0],
1243 [17125, 24273, 25814, 27492, 28214, 28704, 30592, 32768, 0],
1244 [13046, 23214, 24505, 25942, 27435, 28442, 29330, 32768, 0],
1245];
1246
1247/// `compound_mode_ctx_map` (`mvref_common.h`): folds a compound block's
1248/// `new_mv_ctx`/`ref_mv_ctx` pair (row = `ref_mv_ctx >> 1`, column =
1249/// `min(new_mv_ctx, COMP_NEWMV_CTXS - 1)`, `COMP_NEWMV_CTXS` = 5) down to
1250/// the single `comp_ctx` [`INTER_COMPOUND_MODE`] is indexed by --
1251/// `av1_mode_context_analyzer`'s compound branch.
1252pub const COMPOUND_MODE_CTX_MAP: [[usize; 5]; 3] =
1253 [[0, 1, 1, 1, 1], [1, 2, 3, 4, 4], [4, 4, 5, 6, 7]];
1254
1255/// `Default_Intra_Inter_Cdf` (spec 9.4): whether an inter frame's block is
1256/// coded as intra, indexed by whether the block above and left are inter.
1257pub const INTRA_INTER: [[u16; 3]; 4] = [
1258 [806, 32768, 0],
1259 [16662, 32768, 0],
1260 [20186, 32768, 0],
1261 [26538, 32768, 0],
1262];
1263
1264/// `Default_Single_Ref_Cdf` (spec 9.4): the six binary decisions that narrow
1265/// an inter block's single reference frame down from the seven it can name,
1266/// indexed by the reference context of the blocks around it.
1267pub const SINGLE_REF: [[[u16; 3]; 6]; 3] = [
1268 [
1269 [4897, 32768, 0],
1270 [1555, 32768, 0],
1271 [4236, 32768, 0],
1272 [8650, 32768, 0],
1273 [904, 32768, 0],
1274 [1444, 32768, 0],
1275 ],
1276 [
1277 [16973, 32768, 0],
1278 [16751, 32768, 0],
1279 [19647, 32768, 0],
1280 [24773, 32768, 0],
1281 [11014, 32768, 0],
1282 [15087, 32768, 0],
1283 ],
1284 [
1285 [29744, 32768, 0],
1286 [30279, 32768, 0],
1287 [31194, 32768, 0],
1288 [31895, 32768, 0],
1289 [26875, 32768, 0],
1290 [30304, 32768, 0],
1291 ],
1292];
1293
1294/// `default_skip_mode_cdfs` (entropymode.c, `SKIP_MODE_CONTEXTS` = 3): whether
1295/// a block reads `skip_mode` (forced `NEAREST_NEARESTMV` compound, `skip`
1296/// forced true, no residual) -- indexed by `av1_get_skip_mode_context`
1297/// (`above.skip_mode + left.skip_mode`, `pred_common.h`), only read when this
1298/// frame's own `skip_mode_present` header bit is set and the block is at
1299/// least 8x8 both dims (`is_comp_ref_allowed`) -- lane-av1comp.
1300pub const SKIP_MODE: [[u16; 3]; 3] = [[32621, 32768, 0], [20708, 32768, 0], [8127, 32768, 0]];
1301
1302/// `default_obmc_cdf` (spec 9.4): `use_obmc`, by square bsize (`BLOCK_8X8`,
1303/// `BLOCK_16X16`, `BLOCK_32X32`, `BLOCK_64X64` -- `BLOCK_SIZES_ALL` indices
1304/// 3/6/9/12, the only sizes this decoder ever codes). Read only once
1305/// `motion_mode_allowed` (spec 5.11.24's `read_motion_mode`) offers
1306/// `OBMC_CAUSAL` rather than `WARPED_CAUSAL` -- lane-motionmode round 1
1307/// never reaches the three-way `motion_mode_cdf`, see `decode.rs`.
1308pub const OBMC: [[u16; 3]; 6] = [
1309 [10437, 32768, 0],
1310 [17432, 32768, 0],
1311 [25817, 32768, 0],
1312 [30128, 32768, 0],
1313 // lane-rect r2: BLOCK_16X32 (index 7) and BLOCK_32X16 (index 8) rows --
1314 // rect strips read their own bsize row, not the square class
1315 // (rect-flake-1: the strip's motion_mode read diverged on this).
1316 [14423, 32768, 0],
1317 [15142, 32768, 0],
1318];
1319
1320/// `default_motion_mode_cdf` (spec 9.4, `entropymode.c`), the square-bsize
1321/// rows only (`BLOCK_8X8`/`16X16`/`32X32`/`64X64` -- indices 3/6/9/12 of
1322/// libaom's `BLOCK_SIZES_ALL`, same square subset [`OBMC`] keeps): the
1323/// 3-symbol `SIMPLE_TRANSLATION`/`OBMC_CAUSAL`/`WARPED_CAUSAL` alphabet
1324/// `read_motion_mode` reads instead of [`OBMC`] whenever `motion_mode_allowed`
1325/// (spec 5.11.24) resolves to `WARPED_CAUSAL`-eligible (`num_proj_ref >= 1`
1326/// under `allow_warped_motion`) -- lane-warp round 1.
1327pub const MOTION_MODE: [[u16; 4]; 6] = [
1328 [7651, 24760, 32768, 0],
1329 [19419, 26810, 32768, 0],
1330 [26260, 29116, 32768, 0],
1331 [29516, 30701, 32768, 0],
1332 // lane-rect r2: BLOCK_16X32 / BLOCK_32X16 rows (indices 7/8).
1333 [5123, 23606, 32768, 0],
1334 [11606, 24308, 32768, 0],
1335];
1336
1337/// `default_interintra_cdf` (spec 9.4): `interintra`, indexed by
1338/// `size_group_lookup[bsize]` (0..=3) -- read only when the sequence header's
1339/// `enable_interintra_compound` is set and `is_interintra_allowed(mbmi)`
1340/// holds (single-ref, `BLOCK_8X8..=BLOCK_32X32`, mode `NEARESTMV..NEWMV`);
1341/// lane-sb128 r3: consuming this symbol (even always-refused on `interintra
1342/// == 1`) is required to stay bit-aligned with every later block once the
1343/// sequence header turns the tool on -- see decode.rs's own read site.
1344pub const INTERINTRA: [[u16; 3]; 4] = [
1345 [16384, 32768, 0],
1346 [26887, 32768, 0],
1347 [27597, 32768, 0],
1348 [30237, 32768, 0],
1349];
1350
1351/// `default_interintra_mode_cdf` (spec 9.4): `interintra_mode` (II_DC/II_V/
1352/// II_H/II_SMOOTH), indexed by `size_group_lookup[bsize]`, read right after
1353/// `interintra == 1` (lane-interintra r1).
1354pub const INTERINTRA_MODE: [[u16; 5]; 4] = [
1355 [8192, 16384, 24576, 32768, 0],
1356 [1875, 11082, 27332, 32768, 0],
1357 [2473, 9996, 26388, 32768, 0],
1358 [4238, 11537, 25926, 32768, 0],
1359];
1360
1361/// `default_wedge_interintra_cdf` (spec 9.4): `wedge_interintra`, indexed by
1362/// bsize over `BLOCK_SIZES_ALL` -- read for every interintra block whose
1363/// size `av1_is_wedge_used` allows (the 8x8..32x32 family), REGARDLESS of
1364/// the sequence header's `enable_interintra_wedge` bit (libaom
1365/// decodemv.c:1548 gates on block size alone; the seq bit constrains only
1366/// the encoder).
1367pub const WEDGE_INTERINTRA: [[u16; 3]; 22] = [
1368 [16384, 32768, 0],
1369 [16384, 32768, 0],
1370 [16384, 32768, 0],
1371 [20036, 32768, 0],
1372 [24957, 32768, 0],
1373 [26704, 32768, 0],
1374 [27530, 32768, 0],
1375 [29564, 32768, 0],
1376 [29444, 32768, 0],
1377 [26872, 32768, 0],
1378 [16384, 32768, 0],
1379 [16384, 32768, 0],
1380 [16384, 32768, 0],
1381 [16384, 32768, 0],
1382 [16384, 32768, 0],
1383 [16384, 32768, 0],
1384 [16384, 32768, 0],
1385 [16384, 32768, 0],
1386 [16384, 32768, 0],
1387 [16384, 32768, 0],
1388 [16384, 32768, 0],
1389 [16384, 32768, 0],
1390];
1391
1392/// `default_compound_type_cdf` (spec 9.4, libaom `entropymode.c`):
1393/// `compound_type` (`MASKED_COMPOUND_TYPES` == 2: `COMPOUND_WEDGE` vs
1394/// `COMPOUND_DIFFWTD`), indexed by bsize over `BLOCK_SIZES_ALL`, read only
1395/// on the `comp_group_idx == 1` (masked-compound) path -- lane-maskcomp.
1396pub const COMPOUND_TYPE: [[u16; 3]; 22] = [
1397 [16384, 32768, 0],
1398 [16384, 32768, 0],
1399 [16384, 32768, 0],
1400 [23431, 32768, 0],
1401 [13171, 32768, 0],
1402 [11470, 32768, 0],
1403 [9770, 32768, 0],
1404 [9100, 32768, 0],
1405 [8233, 32768, 0],
1406 [6172, 32768, 0],
1407 [16384, 32768, 0],
1408 [16384, 32768, 0],
1409 [16384, 32768, 0],
1410 [16384, 32768, 0],
1411 [16384, 32768, 0],
1412 [16384, 32768, 0],
1413 [16384, 32768, 0],
1414 [16384, 32768, 0],
1415 [11820, 32768, 0],
1416 [7701, 32768, 0],
1417 [16384, 32768, 0],
1418 [16384, 32768, 0],
1419];
1420
1421/// `default_wedge_idx_cdf` (spec 9.4, libaom `entropymode.c`): `wedge_index`
1422/// (16-ary, `MAX_WEDGE_TYPES`), indexed by bsize over `BLOCK_SIZES_ALL` --
1423/// read only when `interinter_comp.type == COMPOUND_WEDGE` (lane-maskcomp).
1424pub const WEDGE_IDX: [[u16; 17]; 22] = [
1425 [
1426 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1427 28672, 30720, 32768, 0,
1428 ],
1429 [
1430 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1431 28672, 30720, 32768, 0,
1432 ],
1433 [
1434 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1435 28672, 30720, 32768, 0,
1436 ],
1437 [
1438 2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, 22362, 24127, 25702, 27752,
1439 29450, 31171, 32768, 0,
1440 ],
1441 [
1442 806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, 18452, 19422, 22839, 26127,
1443 29629, 32768, 0,
1444 ],
1445 [
1446 2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, 24520, 27470, 29456,
1447 30529, 31656, 32768, 0,
1448 ],
1449 [
1450 1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, 20961, 22884, 24471, 26719,
1451 28714, 30877, 32768, 0,
1452 ],
1453 [
1454 1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, 18114, 19313, 22521,
1455 26012, 29550, 32768, 0,
1456 ],
1457 [
1458 2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, 20533, 23434, 25972, 27944,
1459 29570, 31416, 32768, 0,
1460 ],
1461 [
1462 1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, 22038, 23963, 25311, 26988,
1463 28766, 31012, 32768, 0,
1464 ],
1465 [
1466 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1467 28672, 30720, 32768, 0,
1468 ],
1469 [
1470 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1471 28672, 30720, 32768, 0,
1472 ],
1473 [
1474 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1475 28672, 30720, 32768, 0,
1476 ],
1477 [
1478 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1479 28672, 30720, 32768, 0,
1480 ],
1481 [
1482 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1483 28672, 30720, 32768, 0,
1484 ],
1485 [
1486 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1487 28672, 30720, 32768, 0,
1488 ],
1489 [
1490 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1491 28672, 30720, 32768, 0,
1492 ],
1493 [
1494 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1495 28672, 30720, 32768, 0,
1496 ],
1497 [
1498 154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, 24985, 25684, 27259, 28883,
1499 30911, 32768, 0,
1500 ],
1501 [
1502 1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, 27251, 29173, 30089,
1503 30960, 31933, 32768, 0,
1504 ],
1505 [
1506 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1507 28672, 30720, 32768, 0,
1508 ],
1509 [
1510 2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576, 26624,
1511 28672, 30720, 32768, 0,
1512 ],
1513];
1514
1515/// `Default_Comp_Mode_Cdf` (spec 9.4, `default_comp_inter_cdf`): whether an
1516/// inter block reads `SINGLE_REFERENCE` or `COMPOUND_REFERENCE` -- only
1517/// reached once `read_ref_frames` knows the frame's `reference_select`
1518/// header bit made the choice per-block instead of fixing it, indexed by
1519/// `av1_get_reference_mode_context` (lane-av1comp).
1520pub const COMP_MODE: [[u16; 3]; 5] = [
1521 [26828, 32768, 0],
1522 [24035, 32768, 0],
1523 [12031, 32768, 0],
1524 [10640, 32768, 0],
1525 [2901, 32768, 0],
1526];
1527
1528/// `Default_Comp_Ref_Type_Cdf` (spec 9.4, `default_comp_ref_type_cdf`):
1529/// unidirectional vs. bidirectional compound reference pair, indexed by
1530/// `av1_get_comp_reference_type_context`.
1531pub const COMP_REF_TYPE: [[u16; 3]; 5] = [
1532 [1198, 32768, 0],
1533 [2070, 32768, 0],
1534 [9166, 32768, 0],
1535 [7499, 32768, 0],
1536 [22475, 32768, 0],
1537];
1538
1539/// `Default_Comp_Group_Idx_Cdf` (spec 9.4, libaom `default_comp_group_idx_cdfs`):
1540/// whether a compound block's `comp_group_idx` picks masked compound (`1`)
1541/// over the plain distance-weighted/simple-average blend (`0`), indexed by
1542/// `get_comp_group_idx_context` -- only read when `seq.enable_masked_compound`
1543/// and the block size is masked-compound-eligible (lane-av1comp).
1544pub const COMP_GROUP_IDX: [[u16; 3]; 6] = [
1545 [26607, 32768, 0],
1546 [22891, 32768, 0],
1547 [18840, 32768, 0],
1548 [24594, 32768, 0],
1549 [19934, 32768, 0],
1550 [22674, 32768, 0],
1551];
1552
1553/// `Default_Compound_Idx_Cdf` (spec 9.4, libaom `default_compound_idx_cdfs`):
1554/// whether a compound block's `compound_idx` picks the simple average
1555/// (`1`) or [`crate::compound::dist_wtd_comp_weight_assign`]'s distance
1556/// weights (`0`), indexed by `get_comp_index_context` -- only read when
1557/// `seq.enable_jnt_comp` (lane-av1comp).
1558pub const COMPOUND_IDX: [[u16; 3]; 6] = [
1559 [18244, 32768, 0],
1560 [12865, 32768, 0],
1561 [7053, 32768, 0],
1562 [13259, 32768, 0],
1563 [9334, 32768, 0],
1564 [4644, 32768, 0],
1565];
1566
1567/// `Default_Uni_Comp_Ref_Cdf` (spec 9.4, `default_uni_comp_ref_cdf`): the
1568/// three binary decisions narrowing a unidirectional compound pair down to
1569/// one of `{BWDREF,ALTREF}`/`{LAST,LAST2}`/`{LAST,LAST3}`/`{LAST,GOLDEN}`.
1570pub const UNI_COMP_REF: [[[u16; 3]; 3]; 3] = [
1571 [[5284, 32768, 0], [3865, 32768, 0], [3128, 32768, 0]],
1572 [[23152, 32768, 0], [14173, 32768, 0], [15270, 32768, 0]],
1573 [[31774, 32768, 0], [25120, 32768, 0], [26710, 32768, 0]],
1574];
1575
1576/// `Default_Comp_Ref_Cdf` (spec 9.4, `default_comp_ref_cdf`): the three
1577/// binary decisions narrowing a bidirectional pair's forward reference.
1578pub const COMP_REF: [[[u16; 3]; 3]; 3] = [
1579 [[4946, 32768, 0], [9468, 32768, 0], [1503, 32768, 0]],
1580 [[19891, 32768, 0], [22441, 32768, 0], [15160, 32768, 0]],
1581 [[30731, 32768, 0], [31059, 32768, 0], [27544, 32768, 0]],
1582];
1583
1584/// `Default_Comp_Bwdref_Cdf` (spec 9.4, `default_comp_bwdref_cdf`): the two
1585/// binary decisions narrowing a bidirectional pair's backward reference.
1586pub const COMP_BWDREF: [[[u16; 3]; 2]; 3] = [
1587 [[2235, 32768, 0], [1423, 32768, 0]],
1588 [[17182, 32768, 0], [15175, 32768, 0]],
1589 [[30606, 32768, 0], [30489, 32768, 0]],
1590];
1591
1592/// `Default_Y_Mode_Cdf` (spec 9.4): the thirteen luma intra modes of an inter
1593/// frame's intra block, indexed by the block's size group -- unlike a key
1594/// frame's [`KF_Y_MODE`], which is indexed by the neighbours' modes instead.
1595pub const Y_MODE: [[u16; 14]; 4] = [
1596 [
1597 22801, 23489, 24293, 24756, 25601, 26123, 26606, 27418, 27945, 29228, 29685, 30349, 32768,
1598 0,
1599 ],
1600 [
1601 18673, 19845, 22631, 23318, 23950, 24649, 25527, 27364, 28152, 29701, 29984, 30852, 32768,
1602 0,
1603 ],
1604 [
1605 19770, 20979, 23396, 23939, 24241, 24654, 25136, 27073, 27830, 29360, 29730, 30659, 32768,
1606 0,
1607 ],
1608 [
1609 20155, 21301, 22838, 23178, 23261, 23533, 23703, 24804, 25352, 26575, 27016, 28049, 32768,
1610 0,
1611 ],
1612];
1613
1614/// `Default_New_Mv_Cdf` (spec 9.4): whether an inter block's motion vector is
1615/// coded explicitly rather than taken from a neighbour, indexed by how many
1616/// neighbours already chose a new vector.
1617pub const NEW_MV: [[u16; 3]; 6] = [
1618 [24035, 32768, 0],
1619 [16630, 32768, 0],
1620 [15339, 32768, 0],
1621 [8386, 32768, 0],
1622 [12222, 32768, 0],
1623 [4676, 32768, 0],
1624];
1625
1626/// `Default_Zero_Mv_Cdf` (spec 9.4): whether an inter block's motion vector is
1627/// the zero vector, indexed by whether the block's global motion type is
1628/// identity.
1629pub const ZERO_MV: [[u16; 3]; 2] = [[2175, 32768, 0], [1054, 32768, 0]];
1630
1631/// `Default_Ref_Mv_Cdf` (spec 9.4): which of the block's reference motion
1632/// vector candidates it takes, indexed by how many candidates are available.
1633pub const REF_MV: [[u16; 3]; 6] = [
1634 [23974, 32768, 0],
1635 [24188, 32768, 0],
1636 [17848, 32768, 0],
1637 [28622, 32768, 0],
1638 [24312, 32768, 0],
1639 [19923, 32768, 0],
1640];
1641
1642/// `Default_Drl_Mode_Cdf` (spec 9.4): the dynamic reference list index a
1643/// block's motion vector prediction is drawn from, indexed by the list's
1644/// context.
1645pub const DRL_MODE: [[u16; 3]; 3] = [[13104, 32768, 0], [24560, 32768, 0], [18945, 32768, 0]];
1646
1647// The motion vector tables below (spec 9.4's `Default_Mv_*`) are the shared
1648// defaults for both components of a vector: [`crate::cdf_state::Cdfs`] holds
1649// one owned copy of each per component, seeded from the same constant here,
1650// since the spec's default state does not distinguish them -- only adaptation
1651// does, once a tile has coded a few vectors.
1652
1653/// `Default_Mv_Joint_Cdf` (spec 9.4): which of a motion vector's two
1654/// components change at all.
1655pub const MV_JOINT: [u16; 5] = [4096, 11264, 19328, 32768, 0];
1656
1657/// `Default_Mv_Class_Cdf` (spec 9.4): the magnitude class of one motion
1658/// vector component.
1659pub const MV_CLASS: [u16; 12] = [
1660 28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767, 32768, 0,
1661];
1662
1663/// `Default_Mv_Class0_Bit_Cdf` (spec 9.4): the integer bit of a small-class
1664/// motion vector's magnitude.
1665pub const MV_CLASS0_BIT: [u16; 3] = [27648, 32768, 0];
1666
1667/// `Default_Mv_Class0_Fr_Cdf` (spec 9.4): the fractional part of a
1668/// small-class motion vector's magnitude, indexed by its integer bit.
1669pub const MV_CLASS0_FR: [[u16; 5]; 2] = [
1670 [16384, 24576, 26624, 32768, 0],
1671 [12288, 21248, 24128, 32768, 0],
1672];
1673
1674/// `Default_Mv_Class0_Hp_Cdf` (spec 9.4): the half-pel bit of a small-class
1675/// motion vector's magnitude.
1676pub const MV_CLASS0_HP: [u16; 3] = [20480, 32768, 0];
1677
1678/// `Default_Mv_Bit_Cdf` (spec 9.4): one bit of a motion vector's integer
1679/// magnitude above the small-class range, indexed by the bit's position.
1680pub const MV_BIT: [[u16; 3]; 10] = [
1681 [17408, 32768, 0],
1682 [17920, 32768, 0],
1683 [18944, 32768, 0],
1684 [20480, 32768, 0],
1685 [22528, 32768, 0],
1686 [24576, 32768, 0],
1687 [28672, 32768, 0],
1688 [29952, 32768, 0],
1689 [29952, 32768, 0],
1690 [30720, 32768, 0],
1691];
1692
1693/// `Default_Mv_Fr_Cdf` (spec 9.4): the fractional part of a motion vector's
1694/// magnitude, outside the small-class range.
1695pub const MV_FR: [u16; 5] = [8192, 17408, 21248, 32768, 0];
1696
1697/// `Default_Mv_Hp_Cdf` (spec 9.4): the half-pel bit of a motion vector's
1698/// magnitude, outside the small-class range.
1699pub const MV_HP: [u16; 3] = [16384, 32768, 0];
1700
1701/// `Default_Mv_Sign_Cdf` (spec 9.4): the sign of a motion vector component.
1702pub const MV_SIGN: [u16; 3] = [16384, 32768, 0];
1703
1704// q-context 0/1/3 coefficient CDFs (spec 9.4's `Default_..._Cdf[0]`,
1705// `[1]` and `[3]`), auto-derived from the same libaom `token_cdfs.h` the
1706// q-context-2 tables above were transcribed from, and checked by reproducing
1707// every q-context-2 table above byte-for-byte with the same indexing before
1708// generating these (see the lane report for the check).
1709
1710// q-context 0: base_q_idx 0..=20.
1711
1712/// TXB_SKIP_LUMA_64, q-context 0: the same table as [`TXB_SKIP_LUMA_64`], for `base_q_idx` 0..=20.
1713pub const TXB_SKIP_LUMA_64_Q0: [u16; 3] = [6308, 32768, 0];
1714/// TXB_SKIP_LUMA_32, q-context 0: the same table as [`TXB_SKIP_LUMA_32`], for `base_q_idx` 0..=20.
1715pub const TXB_SKIP_LUMA_32_Q0: [u16; 3] = [17920, 32768, 0];
1716/// TXB_SKIP_LUMA_16, q-context 0: the same table as [`TXB_SKIP_LUMA_16`], for `base_q_idx` 0..=20.
1717pub const TXB_SKIP_LUMA_16_Q0: [u16; 3] = [29957, 32768, 0];
1718/// TXB_SKIP_CHROMA_8, q-context 0: the same table as [`TXB_SKIP_CHROMA_8`], for `base_q_idx` 0..=20.
1719pub const TXB_SKIP_CHROMA_8_Q0: [[u16; 3]; 3] =
1720 [[5403, 32768, 0], [18096, 32768, 0], [30003, 32768, 0]];
1721/// TXB_SKIP_CHROMA_16, q-context 0: the same table as [`TXB_SKIP_CHROMA_16`], for `base_q_idx` 0..=20.
1722pub const TXB_SKIP_CHROMA_16_Q0: [[u16; 3]; 3] =
1723 [[3778, 32768, 0], [15336, 32768, 0], [28981, 32768, 0]];
1724/// TXB_SKIP_CHROMA_32, q-context 0: the same table as [`TXB_SKIP_CHROMA_32`], for `base_q_idx` 0..=20.
1725pub const TXB_SKIP_CHROMA_32_Q0: [[u16; 3]; 3] =
1726 [[1366, 32768, 0], [15628, 32768, 0], [30462, 32768, 0]];
1727/// EOB_EXTRA_LUMA_16, q-context 0: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 0..=20.
1728pub const EOB_EXTRA_LUMA_16_Q0: [[u16; 3]; 9] = [
1729 [23905, 32768, 0],
1730 [17194, 32768, 0],
1731 [16170, 32768, 0],
1732 [17695, 32768, 0],
1733 [13826, 32768, 0],
1734 [15810, 32768, 0],
1735 [12036, 32768, 0],
1736 [16384, 32768, 0],
1737 [16384, 32768, 0],
1738];
1739/// EOB_EXTRA_LUMA_32, q-context 0: the same table as [`EOB_EXTRA_LUMA_32`], for `base_q_idx` 0..=20.
1740pub const EOB_EXTRA_LUMA_32_Q0: [[u16; 3]; 9] = [
1741 [27399, 32768, 0],
1742 [16327, 32768, 0],
1743 [18071, 32768, 0],
1744 [19584, 32768, 0],
1745 [20721, 32768, 0],
1746 [18432, 32768, 0],
1747 [19560, 32768, 0],
1748 [10150, 32768, 0],
1749 [8805, 32768, 0],
1750];
1751/// EOB_EXTRA_LUMA_64, q-context 0: the same table as [`EOB_EXTRA_LUMA_64`], for `base_q_idx` 0..=20.
1752pub const EOB_EXTRA_LUMA_64_Q0: [[u16; 3]; 9] = [
1753 [23406, 32768, 0],
1754 [21845, 32768, 0],
1755 [18432, 32768, 0],
1756 [16384, 32768, 0],
1757 [17096, 32768, 0],
1758 [12561, 32768, 0],
1759 [17320, 32768, 0],
1760 [22395, 32768, 0],
1761 [21370, 32768, 0],
1762];
1763/// EOB_EXTRA_CHROMA_8, q-context 0: the same table as [`EOB_EXTRA_CHROMA_8`], for `base_q_idx` 0..=20.
1764pub const EOB_EXTRA_CHROMA_8_Q0: [[u16; 3]; 9] = [
1765 [20681, 32768, 0],
1766 [20701, 32768, 0],
1767 [15250, 32768, 0],
1768 [15017, 32768, 0],
1769 [14928, 32768, 0],
1770 [16384, 32768, 0],
1771 [16384, 32768, 0],
1772 [16384, 32768, 0],
1773 [16384, 32768, 0],
1774];
1775/// EOB_EXTRA_CHROMA_16, q-context 0: the same table as [`EOB_EXTRA_CHROMA_16`], for `base_q_idx` 0..=20.
1776pub const EOB_EXTRA_CHROMA_16_Q0: [[u16; 3]; 9] = [
1777 [23959, 32768, 0],
1778 [20799, 32768, 0],
1779 [19021, 32768, 0],
1780 [16203, 32768, 0],
1781 [17886, 32768, 0],
1782 [14144, 32768, 0],
1783 [12010, 32768, 0],
1784 [16384, 32768, 0],
1785 [16384, 32768, 0],
1786];
1787/// EOB_EXTRA_CHROMA_32, q-context 0: the same table as [`EOB_EXTRA_CHROMA_32`], for `base_q_idx` 0..=20.
1788pub const EOB_EXTRA_CHROMA_32_Q0: [[u16; 3]; 9] = [
1789 [24932, 32768, 0],
1790 [20833, 32768, 0],
1791 [12027, 32768, 0],
1792 [16670, 32768, 0],
1793 [19914, 32768, 0],
1794 [15106, 32768, 0],
1795 [17662, 32768, 0],
1796 [13783, 32768, 0],
1797 [28756, 32768, 0],
1798];
1799/// EOB_PT_1024_LUMA, q-context 0: the same table as [`EOB_PT_1024_LUMA`], for `base_q_idx` 0..=20.
1800pub const EOB_PT_1024_LUMA_Q0: [u16; 12] = [
1801 393, 421, 751, 1623, 3160, 6352, 13345, 18047, 22571, 25830, 32768, 0,
1802];
1803/// EOB_PT_1024_CHROMA, q-context 0: the same table as [`EOB_PT_1024_CHROMA`], for `base_q_idx` 0..=20.
1804pub const EOB_PT_1024_CHROMA_Q0: [u16; 12] = [
1805 1865, 1988, 2930, 4242, 10533, 16538, 21354, 27255, 28546, 31784, 32768, 0,
1806];
1807/// EOB_PT_256_LUMA, q-context 0: the same table as [`EOB_PT_256_LUMA`], for `base_q_idx` 0..=20.
1808pub const EOB_PT_256_LUMA_Q0: [u16; 10] =
1809 [310, 584, 1887, 3589, 6168, 8611, 11352, 15652, 32768, 0];
1810/// EOB_PT_256_CHROMA, q-context 0: the same table as [`EOB_PT_256_CHROMA`], for `base_q_idx` 0..=20.
1811pub const EOB_PT_256_CHROMA_Q0: [u16; 10] =
1812 [2520, 3240, 5952, 8870, 12577, 17558, 19954, 24168, 32768, 0];
1813/// EOB_PT_64_CHROMA, q-context 0: the same table as [`EOB_PT_64_CHROMA`], for `base_q_idx` 0..=20.
1814pub const EOB_PT_64_CHROMA_Q0: [u16; 8] = [3505, 5304, 10086, 13814, 17684, 23370, 32768, 0];
1815/// COEFF_BASE_LUMA_16, q-context 0: the same table as [`COEFF_BASE_LUMA_16`], for `base_q_idx` 0..=20.
1816pub const COEFF_BASE_LUMA_16_Q0: [[u16; 5]; 42] = [
1817 [5487, 10460, 13708, 32768, 0],
1818 [21597, 28303, 30674, 32768, 0],
1819 [11037, 21953, 26476, 32768, 0],
1820 [8147, 17962, 22952, 32768, 0],
1821 [5242, 13061, 18532, 32768, 0],
1822 [1889, 5208, 8182, 32768, 0],
1823 [26774, 32133, 32590, 32768, 0],
1824 [17844, 29564, 31767, 32768, 0],
1825 [11690, 24438, 29171, 32768, 0],
1826 [7542, 18215, 24459, 32768, 0],
1827 [2993, 8050, 12319, 32768, 0],
1828 [28023, 32328, 32591, 32768, 0],
1829 [18651, 30126, 31954, 32768, 0],
1830 [12164, 25146, 29589, 32768, 0],
1831 [7762, 18530, 24771, 32768, 0],
1832 [3492, 9183, 13920, 32768, 0],
1833 [27591, 32008, 32491, 32768, 0],
1834 [17149, 28853, 31510, 32768, 0],
1835 [11485, 24003, 28860, 32768, 0],
1836 [7697, 18086, 24210, 32768, 0],
1837 [3075, 7999, 12218, 32768, 0],
1838 [28268, 32482, 32654, 32768, 0],
1839 [19631, 31051, 32404, 32768, 0],
1840 [13860, 27260, 31020, 32768, 0],
1841 [9605, 21613, 27594, 32768, 0],
1842 [4876, 12162, 17908, 32768, 0],
1843 [27248, 32316, 32576, 32768, 0],
1844 [18955, 30457, 32075, 32768, 0],
1845 [11824, 23997, 28795, 32768, 0],
1846 [7346, 18196, 24647, 32768, 0],
1847 [3403, 9247, 14111, 32768, 0],
1848 [29711, 32655, 32735, 32768, 0],
1849 [21169, 31394, 32417, 32768, 0],
1850 [13487, 27198, 30957, 32768, 0],
1851 [8828, 21683, 27614, 32768, 0],
1852 [4270, 11451, 17038, 32768, 0],
1853 [28708, 32578, 32731, 32768, 0],
1854 [20120, 31241, 32482, 32768, 0],
1855 [13692, 27550, 31321, 32768, 0],
1856 [9418, 22514, 28439, 32768, 0],
1857 [4999, 13283, 19462, 32768, 0],
1858 [8192, 16384, 24576, 32768, 0],
1859];
1860/// COEFF_BASE_LUMA_32, q-context 0: the same table as [`COEFF_BASE_LUMA_32`], for `base_q_idx` 0..=20.
1861pub const COEFF_BASE_LUMA_32_Q0: [[u16; 5]; 42] = [
1862 [5141, 7096, 8260, 32768, 0],
1863 [27186, 29022, 29789, 32768, 0],
1864 [6668, 12568, 15682, 32768, 0],
1865 [2172, 6181, 8638, 32768, 0],
1866 [1126, 3379, 4531, 32768, 0],
1867 [443, 1361, 2254, 32768, 0],
1868 [26083, 31153, 32436, 32768, 0],
1869 [13486, 24603, 28483, 32768, 0],
1870 [6508, 14840, 19910, 32768, 0],
1871 [3386, 8800, 13286, 32768, 0],
1872 [1530, 4322, 7054, 32768, 0],
1873 [29639, 32080, 32548, 32768, 0],
1874 [15897, 27552, 30290, 32768, 0],
1875 [8588, 20047, 25383, 32768, 0],
1876 [4889, 13339, 19269, 32768, 0],
1877 [2240, 6871, 10498, 32768, 0],
1878 [28165, 32197, 32517, 32768, 0],
1879 [20735, 30427, 31568, 32768, 0],
1880 [14325, 24671, 27692, 32768, 0],
1881 [5119, 12554, 17805, 32768, 0],
1882 [1810, 5441, 8261, 32768, 0],
1883 [31212, 32724, 32748, 32768, 0],
1884 [23352, 31766, 32545, 32768, 0],
1885 [14669, 27570, 31059, 32768, 0],
1886 [8492, 20894, 27272, 32768, 0],
1887 [3644, 10194, 15204, 32768, 0],
1888 [8192, 16384, 24576, 32768, 0],
1889 [8192, 16384, 24576, 32768, 0],
1890 [8192, 16384, 24576, 32768, 0],
1891 [8192, 16384, 24576, 32768, 0],
1892 [8192, 16384, 24576, 32768, 0],
1893 [8192, 16384, 24576, 32768, 0],
1894 [8192, 16384, 24576, 32768, 0],
1895 [8192, 16384, 24576, 32768, 0],
1896 [8192, 16384, 24576, 32768, 0],
1897 [8192, 16384, 24576, 32768, 0],
1898 [8192, 16384, 24576, 32768, 0],
1899 [8192, 16384, 24576, 32768, 0],
1900 [8192, 16384, 24576, 32768, 0],
1901 [8192, 16384, 24576, 32768, 0],
1902 [8192, 16384, 24576, 32768, 0],
1903 [8192, 16384, 24576, 32768, 0],
1904];
1905/// COEFF_BASE_LUMA_64, q-context 0: the same table as [`COEFF_BASE_LUMA_64`], for `base_q_idx` 0..=20.
1906pub const COEFF_BASE_LUMA_64_Q0: [[u16; 5]; 42] = [
1907 [601, 983, 1311, 32768, 0],
1908 [18725, 23406, 28087, 32768, 0],
1909 [5461, 8192, 10923, 32768, 0],
1910 [3781, 15124, 21425, 32768, 0],
1911 [2587, 7761, 12072, 32768, 0],
1912 [106, 458, 810, 32768, 0],
1913 [22282, 29710, 31894, 32768, 0],
1914 [8508, 20926, 25984, 32768, 0],
1915 [3726, 12713, 18083, 32768, 0],
1916 [1620, 7112, 10893, 32768, 0],
1917 [729, 2236, 3495, 32768, 0],
1918 [30163, 32474, 32684, 32768, 0],
1919 [18304, 30464, 32000, 32768, 0],
1920 [11443, 26526, 29647, 32768, 0],
1921 [6007, 15292, 21299, 32768, 0],
1922 [2234, 6703, 8937, 32768, 0],
1923 [30954, 32177, 32571, 32768, 0],
1924 [17363, 29562, 31076, 32768, 0],
1925 [9686, 22464, 27410, 32768, 0],
1926 [8192, 16384, 21390, 32768, 0],
1927 [1755, 8046, 11264, 32768, 0],
1928 [31168, 32734, 32748, 32768, 0],
1929 [22486, 31441, 32471, 32768, 0],
1930 [12833, 25627, 29738, 32768, 0],
1931 [6980, 17379, 23122, 32768, 0],
1932 [3111, 8887, 13479, 32768, 0],
1933 [8192, 16384, 24576, 32768, 0],
1934 [8192, 16384, 24576, 32768, 0],
1935 [8192, 16384, 24576, 32768, 0],
1936 [8192, 16384, 24576, 32768, 0],
1937 [8192, 16384, 24576, 32768, 0],
1938 [8192, 16384, 24576, 32768, 0],
1939 [8192, 16384, 24576, 32768, 0],
1940 [8192, 16384, 24576, 32768, 0],
1941 [8192, 16384, 24576, 32768, 0],
1942 [8192, 16384, 24576, 32768, 0],
1943 [8192, 16384, 24576, 32768, 0],
1944 [8192, 16384, 24576, 32768, 0],
1945 [8192, 16384, 24576, 32768, 0],
1946 [8192, 16384, 24576, 32768, 0],
1947 [8192, 16384, 24576, 32768, 0],
1948 [8192, 16384, 24576, 32768, 0],
1949];
1950/// COEFF_BASE_CHROMA_8, q-context 0: the same table as [`COEFF_BASE_CHROMA_8`], for `base_q_idx` 0..=20.
1951pub const COEFF_BASE_CHROMA_8_Q0: [[u16; 5]; 42] = [
1952 [6037, 16771, 21957, 32768, 0],
1953 [24774, 31704, 32426, 32768, 0],
1954 [16830, 28589, 31056, 32768, 0],
1955 [10602, 22828, 27760, 32768, 0],
1956 [6733, 16829, 23071, 32768, 0],
1957 [3250, 8914, 13556, 32768, 0],
1958 [25582, 32220, 32668, 32768, 0],
1959 [18659, 30342, 32223, 32768, 0],
1960 [12546, 26149, 30515, 32768, 0],
1961 [8420, 20451, 26801, 32768, 0],
1962 [4636, 12420, 18344, 32768, 0],
1963 [27581, 32362, 32639, 32768, 0],
1964 [18987, 30083, 31978, 32768, 0],
1965 [11327, 24248, 29084, 32768, 0],
1966 [7264, 17719, 24120, 32768, 0],
1967 [3995, 10768, 16169, 32768, 0],
1968 [25893, 31831, 32487, 32768, 0],
1969 [16577, 28587, 31379, 32768, 0],
1970 [10189, 22748, 28182, 32768, 0],
1971 [6832, 17094, 23556, 32768, 0],
1972 [3708, 10110, 15334, 32768, 0],
1973 [25904, 32282, 32656, 32768, 0],
1974 [19721, 30792, 32276, 32768, 0],
1975 [12819, 26243, 30411, 32768, 0],
1976 [8572, 20614, 26891, 32768, 0],
1977 [5364, 14059, 20467, 32768, 0],
1978 [26580, 32438, 32677, 32768, 0],
1979 [20852, 31225, 32340, 32768, 0],
1980 [12435, 25700, 29967, 32768, 0],
1981 [8691, 20825, 26976, 32768, 0],
1982 [4446, 12209, 17269, 32768, 0],
1983 [27350, 32429, 32696, 32768, 0],
1984 [21372, 30977, 32272, 32768, 0],
1985 [12673, 25270, 29853, 32768, 0],
1986 [9208, 20925, 26640, 32768, 0],
1987 [5018, 13351, 18732, 32768, 0],
1988 [27351, 32479, 32713, 32768, 0],
1989 [21398, 31209, 32387, 32768, 0],
1990 [12162, 25047, 29842, 32768, 0],
1991 [7896, 18691, 25319, 32768, 0],
1992 [4670, 12882, 18881, 32768, 0],
1993 [8192, 16384, 24576, 32768, 0],
1994];
1995/// COEFF_BASE_CHROMA_16, q-context 0: the same table as [`COEFF_BASE_CHROMA_16`], for `base_q_idx` 0..=20.
1996pub const COEFF_BASE_CHROMA_16_Q0: [[u16; 5]; 42] = [
1997 [5673, 14302, 19711, 32768, 0],
1998 [26251, 30701, 31834, 32768, 0],
1999 [12782, 23783, 27803, 32768, 0],
2000 [9127, 20657, 25808, 32768, 0],
2001 [6368, 16208, 21462, 32768, 0],
2002 [2465, 7177, 10822, 32768, 0],
2003 [29961, 32563, 32719, 32768, 0],
2004 [18318, 29891, 31949, 32768, 0],
2005 [11361, 24514, 29357, 32768, 0],
2006 [7900, 19603, 25607, 32768, 0],
2007 [4002, 10590, 15546, 32768, 0],
2008 [29637, 32310, 32595, 32768, 0],
2009 [18296, 29913, 31809, 32768, 0],
2010 [10144, 21515, 26871, 32768, 0],
2011 [5358, 14322, 20394, 32768, 0],
2012 [3067, 8362, 13346, 32768, 0],
2013 [28652, 32470, 32676, 32768, 0],
2014 [17538, 30771, 32209, 32768, 0],
2015 [13924, 26882, 30494, 32768, 0],
2016 [10496, 22837, 27869, 32768, 0],
2017 [7236, 16396, 21621, 32768, 0],
2018 [30743, 32687, 32746, 32768, 0],
2019 [23006, 31676, 32489, 32768, 0],
2020 [14494, 27828, 31120, 32768, 0],
2021 [10174, 22801, 28352, 32768, 0],
2022 [6242, 15281, 21043, 32768, 0],
2023 [25817, 32243, 32720, 32768, 0],
2024 [18618, 31367, 32325, 32768, 0],
2025 [13997, 28318, 31878, 32768, 0],
2026 [12255, 26534, 31383, 32768, 0],
2027 [9561, 21588, 28450, 32768, 0],
2028 [28188, 32635, 32724, 32768, 0],
2029 [22060, 32365, 32728, 32768, 0],
2030 [18102, 30690, 32528, 32768, 0],
2031 [14196, 28864, 31999, 32768, 0],
2032 [12262, 25792, 30865, 32768, 0],
2033 [24176, 32109, 32628, 32768, 0],
2034 [18280, 29681, 31963, 32768, 0],
2035 [10205, 23703, 29664, 32768, 0],
2036 [7889, 20025, 27676, 32768, 0],
2037 [6060, 16743, 23970, 32768, 0],
2038 [8192, 16384, 24576, 32768, 0],
2039];
2040/// COEFF_BASE_CHROMA_32, q-context 0: the same table as [`COEFF_BASE_CHROMA_32`], for `base_q_idx` 0..=20.
2041pub const COEFF_BASE_CHROMA_32_Q0: [[u16; 5]; 42] = [
2042 [2461, 7013, 9371, 32768, 0],
2043 [24749, 29600, 30986, 32768, 0],
2044 [9466, 19037, 22417, 32768, 0],
2045 [3584, 9280, 14400, 32768, 0],
2046 [1505, 3929, 5433, 32768, 0],
2047 [677, 1500, 2736, 32768, 0],
2048 [23987, 30702, 32117, 32768, 0],
2049 [13554, 24571, 29263, 32768, 0],
2050 [6211, 14556, 21155, 32768, 0],
2051 [3135, 10972, 15625, 32768, 0],
2052 [2435, 7127, 11427, 32768, 0],
2053 [31300, 32532, 32550, 32768, 0],
2054 [14757, 30365, 31954, 32768, 0],
2055 [4405, 11612, 18553, 32768, 0],
2056 [580, 4132, 7322, 32768, 0],
2057 [1695, 10169, 14124, 32768, 0],
2058 [30008, 32282, 32591, 32768, 0],
2059 [19244, 30108, 31748, 32768, 0],
2060 [11180, 24158, 29555, 32768, 0],
2061 [5650, 14972, 19209, 32768, 0],
2062 [2114, 5109, 8456, 32768, 0],
2063 [31856, 32716, 32748, 32768, 0],
2064 [23012, 31664, 32572, 32768, 0],
2065 [13694, 26656, 30636, 32768, 0],
2066 [8142, 19508, 26093, 32768, 0],
2067 [4253, 10955, 16724, 32768, 0],
2068 [8192, 16384, 24576, 32768, 0],
2069 [8192, 16384, 24576, 32768, 0],
2070 [8192, 16384, 24576, 32768, 0],
2071 [8192, 16384, 24576, 32768, 0],
2072 [8192, 16384, 24576, 32768, 0],
2073 [8192, 16384, 24576, 32768, 0],
2074 [8192, 16384, 24576, 32768, 0],
2075 [8192, 16384, 24576, 32768, 0],
2076 [8192, 16384, 24576, 32768, 0],
2077 [8192, 16384, 24576, 32768, 0],
2078 [8192, 16384, 24576, 32768, 0],
2079 [8192, 16384, 24576, 32768, 0],
2080 [8192, 16384, 24576, 32768, 0],
2081 [8192, 16384, 24576, 32768, 0],
2082 [8192, 16384, 24576, 32768, 0],
2083 [8192, 16384, 24576, 32768, 0],
2084];
2085/// COEFF_BR_LUMA_16, q-context 0: the same table as [`COEFF_BR_LUMA_16`], for `base_q_idx` 0..=20.
2086pub const COEFF_BR_LUMA_16_Q0: [[u16; 5]; 21] = [
2087 [10563, 16233, 19763, 32768, 0],
2088 [9794, 16022, 19804, 32768, 0],
2089 [6750, 11945, 15759, 32768, 0],
2090 [4963, 9186, 12752, 32768, 0],
2091 [3845, 7435, 10627, 32768, 0],
2092 [3051, 6085, 8834, 32768, 0],
2093 [1311, 2596, 3830, 32768, 0],
2094 [11246, 16404, 19689, 32768, 0],
2095 [12315, 18911, 22731, 32768, 0],
2096 [10557, 17095, 21289, 32768, 0],
2097 [8136, 14006, 18249, 32768, 0],
2098 [6348, 11474, 15565, 32768, 0],
2099 [5196, 9655, 13400, 32768, 0],
2100 [2349, 4526, 6587, 32768, 0],
2101 [13337, 18730, 21569, 32768, 0],
2102 [19306, 26071, 28882, 32768, 0],
2103 [15952, 23540, 27254, 32768, 0],
2104 [12409, 19934, 24430, 32768, 0],
2105 [9760, 16706, 21389, 32768, 0],
2106 [8004, 14220, 18818, 32768, 0],
2107 [4138, 7794, 10961, 32768, 0],
2108];
2109/// COEFF_BR_LUMA_32, q-context 0: the same table as [`COEFF_BR_LUMA_32`], for `base_q_idx` 0..=20.
2110pub const COEFF_BR_LUMA_32_Q0: [[u16; 5]; 21] = [
2111 [2331, 3662, 5244, 32768, 0],
2112 [2891, 4771, 6145, 32768, 0],
2113 [4598, 7623, 9729, 32768, 0],
2114 [3520, 6845, 9199, 32768, 0],
2115 [3417, 6119, 9324, 32768, 0],
2116 [2601, 5412, 7385, 32768, 0],
2117 [600, 1173, 1744, 32768, 0],
2118 [7672, 13286, 17469, 32768, 0],
2119 [4232, 7792, 10793, 32768, 0],
2120 [2915, 5317, 7397, 32768, 0],
2121 [2318, 4356, 6152, 32768, 0],
2122 [2127, 4000, 5554, 32768, 0],
2123 [1850, 3478, 5275, 32768, 0],
2124 [977, 1933, 2843, 32768, 0],
2125 [18280, 24387, 27989, 32768, 0],
2126 [15852, 22671, 26185, 32768, 0],
2127 [13845, 20951, 24789, 32768, 0],
2128 [11055, 17966, 22129, 32768, 0],
2129 [9138, 15422, 19801, 32768, 0],
2130 [7454, 13145, 17456, 32768, 0],
2131 [3370, 6393, 9013, 32768, 0],
2132];
2133/// COEFF_BR_CHROMA_8, q-context 0: the same table as [`COEFF_BR_CHROMA_8`], for `base_q_idx` 0..=20.
2134pub const COEFF_BR_CHROMA_8_Q0: [[u16; 5]; 21] = [
2135 [15460, 21696, 25469, 32768, 0],
2136 [12170, 19249, 23191, 32768, 0],
2137 [8723, 15027, 19332, 32768, 0],
2138 [6428, 11704, 15874, 32768, 0],
2139 [4922, 9292, 13052, 32768, 0],
2140 [4139, 7695, 11010, 32768, 0],
2141 [2291, 4508, 6598, 32768, 0],
2142 [19856, 26920, 29828, 32768, 0],
2143 [17923, 25289, 28792, 32768, 0],
2144 [14278, 21968, 26297, 32768, 0],
2145 [10910, 18136, 22950, 32768, 0],
2146 [8423, 14815, 19627, 32768, 0],
2147 [6771, 12283, 16774, 32768, 0],
2148 [4074, 7750, 11081, 32768, 0],
2149 [19852, 26074, 28672, 32768, 0],
2150 [19371, 26110, 28989, 32768, 0],
2151 [16265, 23873, 27663, 32768, 0],
2152 [12758, 20378, 24952, 32768, 0],
2153 [10095, 17098, 21961, 32768, 0],
2154 [8250, 14628, 19451, 32768, 0],
2155 [5205, 9745, 13622, 32768, 0],
2156];
2157/// COEFF_BR_CHROMA_16, q-context 0: the same table as [`COEFF_BR_CHROMA_16`], for `base_q_idx` 0..=20.
2158pub const COEFF_BR_CHROMA_16_Q0: [[u16; 5]; 21] = [
2159 [10870, 16684, 20949, 32768, 0],
2160 [9664, 15230, 18680, 32768, 0],
2161 [6886, 12109, 15408, 32768, 0],
2162 [4825, 8900, 12305, 32768, 0],
2163 [3630, 7162, 10314, 32768, 0],
2164 [3036, 6429, 9387, 32768, 0],
2165 [1671, 3296, 4940, 32768, 0],
2166 [13819, 19159, 23026, 32768, 0],
2167 [11984, 19108, 23120, 32768, 0],
2168 [10690, 17210, 21663, 32768, 0],
2169 [7984, 14154, 18333, 32768, 0],
2170 [6868, 12294, 16124, 32768, 0],
2171 [5274, 8994, 12868, 32768, 0],
2172 [2988, 5771, 8424, 32768, 0],
2173 [19736, 26647, 29141, 32768, 0],
2174 [18933, 26070, 28984, 32768, 0],
2175 [15779, 23048, 27200, 32768, 0],
2176 [12638, 20061, 24532, 32768, 0],
2177 [10692, 17545, 22220, 32768, 0],
2178 [9217, 15251, 20054, 32768, 0],
2179 [5078, 9284, 12594, 32768, 0],
2180];
2181/// COEFF_BR_CHROMA_32, q-context 0: the same table as [`COEFF_BR_CHROMA_32`], for `base_q_idx` 0..=20.
2182pub const COEFF_BR_CHROMA_32_Q0: [[u16; 5]; 21] = [
2183 [5842, 9229, 10838, 32768, 0],
2184 [2313, 3491, 4276, 32768, 0],
2185 [2998, 6104, 7496, 32768, 0],
2186 [2420, 7447, 9868, 32768, 0],
2187 [3034, 8495, 10923, 32768, 0],
2188 [4076, 8937, 10975, 32768, 0],
2189 [1086, 2370, 3299, 32768, 0],
2190 [9714, 17254, 20444, 32768, 0],
2191 [8543, 13698, 17123, 32768, 0],
2192 [4918, 9007, 11910, 32768, 0],
2193 [4129, 7532, 10553, 32768, 0],
2194 [2364, 5533, 8058, 32768, 0],
2195 [1834, 3546, 5563, 32768, 0],
2196 [1473, 2908, 4133, 32768, 0],
2197 [15405, 21193, 25619, 32768, 0],
2198 [15691, 21952, 26561, 32768, 0],
2199 [12962, 19194, 24165, 32768, 0],
2200 [10272, 17855, 22129, 32768, 0],
2201 [8588, 15270, 20718, 32768, 0],
2202 [8682, 14669, 19500, 32768, 0],
2203 [4870, 9636, 13205, 32768, 0],
2204];
2205/// COEFF_BASE_EOB_LUMA_16, q-context 0: the same table as [`COEFF_BASE_EOB_LUMA_16`], for `base_q_idx` 0..=20.
2206pub const COEFF_BASE_EOB_LUMA_16_Q0: [[u16; 4]; 4] = [
2207 [1786, 12612, 32768, 0],
2208 [30663, 31625, 32768, 0],
2209 [32339, 32468, 32768, 0],
2210 [31148, 31833, 32768, 0],
2211];
2212/// COEFF_BASE_EOB_LUMA_32, q-context 0: the same table as [`COEFF_BASE_EOB_LUMA_32`], for `base_q_idx` 0..=20.
2213pub const COEFF_BASE_EOB_LUMA_32_Q0: [[u16; 4]; 4] = [
2214 [1787, 2532, 32768, 0],
2215 [30832, 31662, 32768, 0],
2216 [31824, 32682, 32768, 0],
2217 [32133, 32569, 32768, 0],
2218];
2219/// COEFF_BASE_EOB_LUMA_64, q-context 0: the same table as [`COEFF_BASE_EOB_LUMA_64`], for `base_q_idx` 0..=20.
2220pub const COEFF_BASE_EOB_LUMA_64_Q0: [[u16; 4]; 4] = [
2221 [1725, 3449, 32768, 0],
2222 [31102, 31935, 32768, 0],
2223 [32457, 32613, 32768, 0],
2224 [32412, 32649, 32768, 0],
2225];
2226/// COEFF_BASE_EOB_CHROMA_8, q-context 0: the same table as [`COEFF_BASE_EOB_CHROMA_8`], for `base_q_idx` 0..=20.
2227pub const COEFF_BASE_EOB_CHROMA_8_Q0: [[u16; 4]; 4] = [
2228 [12608, 27820, 32768, 0],
2229 [30680, 32225, 32768, 0],
2230 [30809, 32335, 32768, 0],
2231 [31299, 32423, 32768, 0],
2232];
2233/// COEFF_BASE_EOB_CHROMA_16, q-context 0: the same table as [`COEFF_BASE_EOB_CHROMA_16`], for `base_q_idx` 0..=20.
2234pub const COEFF_BASE_EOB_CHROMA_16_Q0: [[u16; 4]; 4] = [
2235 [18857, 23865, 32768, 0],
2236 [31428, 32428, 32768, 0],
2237 [31744, 32373, 32768, 0],
2238 [31775, 32526, 32768, 0],
2239];
2240/// COEFF_BASE_EOB_CHROMA_32, q-context 0: the same table as [`COEFF_BASE_EOB_CHROMA_32`], for `base_q_idx` 0..=20.
2241pub const COEFF_BASE_EOB_CHROMA_32_Q0: [[u16; 4]; 4] = [
2242 [13751, 22235, 32768, 0],
2243 [32089, 32409, 32768, 0],
2244 [27084, 27920, 32768, 0],
2245 [29291, 32594, 32768, 0],
2246];
2247
2248// q-context 1: base_q_idx 21..=60.
2249
2250/// TXB_SKIP_LUMA_64, q-context 1: the same table as [`TXB_SKIP_LUMA_64`], for `base_q_idx` 21..=60.
2251pub const TXB_SKIP_LUMA_64_Q1: [u16; 3] = [26584, 32768, 0];
2252/// TXB_SKIP_LUMA_32, q-context 1: the same table as [`TXB_SKIP_LUMA_32`], for `base_q_idx` 21..=60.
2253pub const TXB_SKIP_LUMA_32_Q1: [u16; 3] = [26726, 32768, 0];
2254/// TXB_SKIP_LUMA_16, q-context 1: the same table as [`TXB_SKIP_LUMA_16`], for `base_q_idx` 21..=60.
2255pub const TXB_SKIP_LUMA_16_Q1: [u16; 3] = [31901, 32768, 0];
2256/// TXB_SKIP_CHROMA_8, q-context 1: the same table as [`TXB_SKIP_CHROMA_8`], for `base_q_idx` 21..=60.
2257pub const TXB_SKIP_CHROMA_8_Q1: [[u16; 3]; 3] =
2258 [[4419, 32768, 0], [16294, 32768, 0], [28345, 32768, 0]];
2259/// TXB_SKIP_CHROMA_16, q-context 1: the same table as [`TXB_SKIP_CHROMA_16`], for `base_q_idx` 21..=60.
2260pub const TXB_SKIP_CHROMA_16_Q1: [[u16; 3]; 3] =
2261 [[4215, 32768, 0], [15756, 32768, 0], [28341, 32768, 0]];
2262/// TXB_SKIP_CHROMA_32, q-context 1: the same table as [`TXB_SKIP_CHROMA_32`], for `base_q_idx` 21..=60.
2263pub const TXB_SKIP_CHROMA_32_Q1: [[u16; 3]; 3] =
2264 [[5583, 32768, 0], [21313, 32768, 0], [29390, 32768, 0]];
2265/// EOB_EXTRA_LUMA_16, q-context 1: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 21..=60.
2266pub const EOB_EXTRA_LUMA_16_Q1: [[u16; 3]; 9] = [
2267 [22409, 32768, 0],
2268 [21012, 32768, 0],
2269 [15650, 32768, 0],
2270 [17395, 32768, 0],
2271 [15469, 32768, 0],
2272 [20205, 32768, 0],
2273 [19511, 32768, 0],
2274 [16384, 32768, 0],
2275 [16384, 32768, 0],
2276];
2277/// EOB_EXTRA_LUMA_32, q-context 1: the same table as [`EOB_EXTRA_LUMA_32`], for `base_q_idx` 21..=60.
2278pub const EOB_EXTRA_LUMA_32_Q1: [[u16; 3]; 9] = [
2279 [25991, 32768, 0],
2280 [20314, 32768, 0],
2281 [17731, 32768, 0],
2282 [19678, 32768, 0],
2283 [18649, 32768, 0],
2284 [17307, 32768, 0],
2285 [21798, 32768, 0],
2286 [17549, 32768, 0],
2287 [15630, 32768, 0],
2288];
2289/// EOB_EXTRA_LUMA_64, q-context 1: the same table as [`EOB_EXTRA_LUMA_64`], for `base_q_idx` 21..=60.
2290pub const EOB_EXTRA_LUMA_64_Q1: [[u16; 3]; 9] = [
2291 [26605, 32768, 0],
2292 [11304, 32768, 0],
2293 [16726, 32768, 0],
2294 [16560, 32768, 0],
2295 [20866, 32768, 0],
2296 [23524, 32768, 0],
2297 [19878, 32768, 0],
2298 [13469, 32768, 0],
2299 [23084, 32768, 0],
2300];
2301/// EOB_EXTRA_CHROMA_8, q-context 1: the same table as [`EOB_EXTRA_CHROMA_8`], for `base_q_idx` 21..=60.
2302pub const EOB_EXTRA_CHROMA_8_Q1: [[u16; 3]; 9] = [
2303 [22117, 32768, 0],
2304 [22028, 32768, 0],
2305 [18650, 32768, 0],
2306 [16042, 32768, 0],
2307 [15885, 32768, 0],
2308 [16384, 32768, 0],
2309 [16384, 32768, 0],
2310 [16384, 32768, 0],
2311 [16384, 32768, 0],
2312];
2313/// EOB_EXTRA_CHROMA_16, q-context 1: the same table as [`EOB_EXTRA_CHROMA_16`], for `base_q_idx` 21..=60.
2314pub const EOB_EXTRA_CHROMA_16_Q1: [[u16; 3]; 9] = [
2315 [24220, 32768, 0],
2316 [22480, 32768, 0],
2317 [17737, 32768, 0],
2318 [18916, 32768, 0],
2319 [19268, 32768, 0],
2320 [18412, 32768, 0],
2321 [18844, 32768, 0],
2322 [16384, 32768, 0],
2323 [16384, 32768, 0],
2324];
2325/// EOB_EXTRA_CHROMA_32, q-context 1: the same table as [`EOB_EXTRA_CHROMA_32`], for `base_q_idx` 21..=60.
2326pub const EOB_EXTRA_CHROMA_32_Q1: [[u16; 3]; 9] = [
2327 [26585, 32768, 0],
2328 [21469, 32768, 0],
2329 [20432, 32768, 0],
2330 [17735, 32768, 0],
2331 [19280, 32768, 0],
2332 [15235, 32768, 0],
2333 [20297, 32768, 0],
2334 [22471, 32768, 0],
2335 [28997, 32768, 0],
2336];
2337/// EOB_PT_1024_LUMA, q-context 1: the same table as [`EOB_PT_1024_LUMA`], for `base_q_idx` 21..=60.
2338pub const EOB_PT_1024_LUMA_Q1: [u16; 12] = [
2339 696, 948, 3145, 5702, 9706, 13217, 17851, 21856, 25692, 28034, 32768, 0,
2340];
2341/// EOB_PT_1024_CHROMA, q-context 1: the same table as [`EOB_PT_1024_CHROMA`], for `base_q_idx` 21..=60.
2342pub const EOB_PT_1024_CHROMA_Q1: [u16; 12] = [
2343 2672, 3591, 9330, 17084, 22725, 24284, 26527, 28027, 28377, 30876, 32768, 0,
2344];
2345/// EOB_PT_256_LUMA, q-context 1: the same table as [`EOB_PT_256_LUMA`], for `base_q_idx` 21..=60.
2346pub const EOB_PT_256_LUMA_Q1: [u16; 10] =
2347 [1448, 2109, 4151, 6263, 9329, 13260, 17944, 23300, 32768, 0];
2348/// EOB_PT_256_CHROMA, q-context 1: the same table as [`EOB_PT_256_CHROMA`], for `base_q_idx` 21..=60.
2349pub const EOB_PT_256_CHROMA_Q1: [u16; 10] = [
2350 6402, 8148, 12623, 15072, 18728, 22847, 26447, 29377, 32768, 0,
2351];
2352/// EOB_PT_64_CHROMA, q-context 1: the same table as [`EOB_PT_64_CHROMA`], for `base_q_idx` 21..=60.
2353pub const EOB_PT_64_CHROMA_Q1: [u16; 8] = [8609, 10612, 14624, 18714, 22614, 29024, 32768, 0];
2354/// COEFF_BASE_LUMA_16, q-context 1: the same table as [`COEFF_BASE_LUMA_16`], for `base_q_idx` 21..=60.
2355pub const COEFF_BASE_LUMA_16_Q1: [[u16; 5]; 42] = [
2356 [7555, 14942, 18501, 32768, 0],
2357 [24410, 31178, 32287, 32768, 0],
2358 [14394, 26738, 30253, 32768, 0],
2359 [8413, 19554, 25195, 32768, 0],
2360 [4766, 12924, 18785, 32768, 0],
2361 [2029, 5806, 9207, 32768, 0],
2362 [26776, 32364, 32663, 32768, 0],
2363 [18732, 29967, 31931, 32768, 0],
2364 [11005, 23786, 28852, 32768, 0],
2365 [6466, 16909, 23510, 32768, 0],
2366 [3044, 8638, 13419, 32768, 0],
2367 [29208, 32582, 32704, 32768, 0],
2368 [20068, 30857, 32208, 32768, 0],
2369 [12003, 25085, 29595, 32768, 0],
2370 [6947, 17750, 24189, 32768, 0],
2371 [3245, 9103, 14007, 32768, 0],
2372 [27359, 32465, 32669, 32768, 0],
2373 [19421, 30614, 32174, 32768, 0],
2374 [11915, 25010, 29579, 32768, 0],
2375 [6950, 17676, 24074, 32768, 0],
2376 [3007, 8473, 13096, 32768, 0],
2377 [29002, 32676, 32735, 32768, 0],
2378 [22102, 31849, 32576, 32768, 0],
2379 [14408, 28009, 31405, 32768, 0],
2380 [9027, 21679, 27931, 32768, 0],
2381 [4694, 12678, 18748, 32768, 0],
2382 [28216, 32528, 32682, 32768, 0],
2383 [20849, 31264, 32318, 32768, 0],
2384 [12756, 25815, 29751, 32768, 0],
2385 [7565, 18801, 24923, 32768, 0],
2386 [3509, 9533, 14477, 32768, 0],
2387 [30133, 32687, 32739, 32768, 0],
2388 [23063, 31910, 32515, 32768, 0],
2389 [14588, 28051, 31132, 32768, 0],
2390 [9085, 21649, 27457, 32768, 0],
2391 [4261, 11654, 17264, 32768, 0],
2392 [29518, 32691, 32748, 32768, 0],
2393 [22451, 31959, 32613, 32768, 0],
2394 [14864, 28722, 31700, 32768, 0],
2395 [9695, 22964, 28716, 32768, 0],
2396 [4932, 13358, 19502, 32768, 0],
2397 [8192, 16384, 24576, 32768, 0],
2398];
2399/// COEFF_BASE_LUMA_32, q-context 1: the same table as [`COEFF_BASE_LUMA_32`], for `base_q_idx` 21..=60.
2400pub const COEFF_BASE_LUMA_32_Q1: [[u16; 5]; 42] = [
2401 [3078, 6839, 9890, 32768, 0],
2402 [13837, 20450, 24479, 32768, 0],
2403 [5914, 14222, 19328, 32768, 0],
2404 [3866, 10267, 14762, 32768, 0],
2405 [2612, 7208, 11042, 32768, 0],
2406 [1067, 2991, 4776, 32768, 0],
2407 [25817, 31646, 32529, 32768, 0],
2408 [13708, 26338, 30385, 32768, 0],
2409 [7328, 18585, 24870, 32768, 0],
2410 [4691, 13080, 19276, 32768, 0],
2411 [1825, 5253, 8352, 32768, 0],
2412 [29386, 32315, 32624, 32768, 0],
2413 [17160, 29001, 31360, 32768, 0],
2414 [9602, 21862, 27396, 32768, 0],
2415 [5915, 15772, 22148, 32768, 0],
2416 [2786, 7779, 12047, 32768, 0],
2417 [29246, 32450, 32663, 32768, 0],
2418 [18696, 29929, 31818, 32768, 0],
2419 [10510, 23369, 28560, 32768, 0],
2420 [6229, 16499, 23125, 32768, 0],
2421 [2608, 7448, 11705, 32768, 0],
2422 [30753, 32710, 32748, 32768, 0],
2423 [21638, 31487, 32503, 32768, 0],
2424 [12937, 26854, 30870, 32768, 0],
2425 [8182, 20596, 26970, 32768, 0],
2426 [3637, 10269, 15497, 32768, 0],
2427 [8192, 16384, 24576, 32768, 0],
2428 [8192, 16384, 24576, 32768, 0],
2429 [8192, 16384, 24576, 32768, 0],
2430 [8192, 16384, 24576, 32768, 0],
2431 [8192, 16384, 24576, 32768, 0],
2432 [8192, 16384, 24576, 32768, 0],
2433 [8192, 16384, 24576, 32768, 0],
2434 [8192, 16384, 24576, 32768, 0],
2435 [8192, 16384, 24576, 32768, 0],
2436 [8192, 16384, 24576, 32768, 0],
2437 [8192, 16384, 24576, 32768, 0],
2438 [8192, 16384, 24576, 32768, 0],
2439 [8192, 16384, 24576, 32768, 0],
2440 [8192, 16384, 24576, 32768, 0],
2441 [8192, 16384, 24576, 32768, 0],
2442 [8192, 16384, 24576, 32768, 0],
2443];
2444/// COEFF_BASE_LUMA_64, q-context 1: the same table as [`COEFF_BASE_LUMA_64`], for `base_q_idx` 21..=60.
2445pub const COEFF_BASE_LUMA_64_Q1: [[u16; 5]; 42] = [
2446 [1035, 2807, 4156, 32768, 0],
2447 [13162, 18138, 20939, 32768, 0],
2448 [2696, 6633, 8755, 32768, 0],
2449 [1373, 4161, 6853, 32768, 0],
2450 [1099, 2746, 4716, 32768, 0],
2451 [340, 1021, 1599, 32768, 0],
2452 [22826, 30419, 32135, 32768, 0],
2453 [10395, 21762, 26942, 32768, 0],
2454 [4726, 12407, 17361, 32768, 0],
2455 [2447, 7080, 10593, 32768, 0],
2456 [1227, 3717, 6011, 32768, 0],
2457 [28156, 31424, 31934, 32768, 0],
2458 [16915, 27754, 30373, 32768, 0],
2459 [9148, 20990, 26431, 32768, 0],
2460 [5950, 15515, 21148, 32768, 0],
2461 [2492, 7327, 11526, 32768, 0],
2462 [30602, 32477, 32670, 32768, 0],
2463 [20026, 29955, 31568, 32768, 0],
2464 [11220, 23628, 28105, 32768, 0],
2465 [6652, 17019, 22973, 32768, 0],
2466 [3064, 8536, 13043, 32768, 0],
2467 [31769, 32724, 32748, 32768, 0],
2468 [22230, 30887, 32373, 32768, 0],
2469 [12234, 25079, 29731, 32768, 0],
2470 [7326, 18816, 25353, 32768, 0],
2471 [3933, 10907, 16616, 32768, 0],
2472 [8192, 16384, 24576, 32768, 0],
2473 [8192, 16384, 24576, 32768, 0],
2474 [8192, 16384, 24576, 32768, 0],
2475 [8192, 16384, 24576, 32768, 0],
2476 [8192, 16384, 24576, 32768, 0],
2477 [8192, 16384, 24576, 32768, 0],
2478 [8192, 16384, 24576, 32768, 0],
2479 [8192, 16384, 24576, 32768, 0],
2480 [8192, 16384, 24576, 32768, 0],
2481 [8192, 16384, 24576, 32768, 0],
2482 [8192, 16384, 24576, 32768, 0],
2483 [8192, 16384, 24576, 32768, 0],
2484 [8192, 16384, 24576, 32768, 0],
2485 [8192, 16384, 24576, 32768, 0],
2486 [8192, 16384, 24576, 32768, 0],
2487 [8192, 16384, 24576, 32768, 0],
2488];
2489/// COEFF_BASE_CHROMA_8, q-context 1: the same table as [`COEFF_BASE_CHROMA_8`], for `base_q_idx` 21..=60.
2490pub const COEFF_BASE_CHROMA_8_Q1: [[u16; 5]; 42] = [
2491 [8639, 19339, 24429, 32768, 0],
2492 [24404, 31837, 32525, 32768, 0],
2493 [16997, 29425, 31784, 32768, 0],
2494 [11253, 24234, 29149, 32768, 0],
2495 [6751, 17394, 24028, 32768, 0],
2496 [3490, 9830, 15191, 32768, 0],
2497 [26283, 32471, 32714, 32768, 0],
2498 [19599, 31168, 32442, 32768, 0],
2499 [13146, 26954, 30893, 32768, 0],
2500 [8214, 20588, 26890, 32768, 0],
2501 [4699, 13081, 19300, 32768, 0],
2502 [28212, 32458, 32669, 32768, 0],
2503 [18594, 30316, 32100, 32768, 0],
2504 [11219, 24408, 29234, 32768, 0],
2505 [6865, 17656, 24149, 32768, 0],
2506 [3678, 10362, 16006, 32768, 0],
2507 [25825, 32136, 32616, 32768, 0],
2508 [17313, 29853, 32021, 32768, 0],
2509 [11197, 24471, 29472, 32768, 0],
2510 [6947, 17781, 24405, 32768, 0],
2511 [3768, 10660, 16261, 32768, 0],
2512 [27352, 32500, 32706, 32768, 0],
2513 [20850, 31468, 32469, 32768, 0],
2514 [14021, 27707, 31133, 32768, 0],
2515 [8964, 21748, 27838, 32768, 0],
2516 [5437, 14665, 21187, 32768, 0],
2517 [26304, 32492, 32698, 32768, 0],
2518 [20409, 31380, 32385, 32768, 0],
2519 [13682, 27222, 30632, 32768, 0],
2520 [8974, 21236, 26685, 32768, 0],
2521 [4234, 11665, 16934, 32768, 0],
2522 [26273, 32357, 32711, 32768, 0],
2523 [20672, 31242, 32441, 32768, 0],
2524 [14172, 27254, 30902, 32768, 0],
2525 [9870, 21898, 27275, 32768, 0],
2526 [5164, 13506, 19270, 32768, 0],
2527 [26725, 32459, 32728, 32768, 0],
2528 [20991, 31442, 32527, 32768, 0],
2529 [13071, 26434, 30811, 32768, 0],
2530 [8184, 20090, 26742, 32768, 0],
2531 [4803, 13255, 19895, 32768, 0],
2532 [8192, 16384, 24576, 32768, 0],
2533];
2534/// COEFF_BASE_CHROMA_16, q-context 1: the same table as [`COEFF_BASE_CHROMA_16`], for `base_q_idx` 21..=60.
2535pub const COEFF_BASE_CHROMA_16_Q1: [[u16; 5]; 42] = [
2536 [6465, 16958, 21688, 32768, 0],
2537 [25199, 31514, 32360, 32768, 0],
2538 [14774, 27149, 30607, 32768, 0],
2539 [9257, 21438, 26972, 32768, 0],
2540 [5723, 15183, 21882, 32768, 0],
2541 [3150, 8879, 13731, 32768, 0],
2542 [26989, 32262, 32682, 32768, 0],
2543 [17396, 29937, 32085, 32768, 0],
2544 [11387, 24901, 29784, 32768, 0],
2545 [7289, 18821, 25548, 32768, 0],
2546 [3734, 10577, 16086, 32768, 0],
2547 [29728, 32501, 32695, 32768, 0],
2548 [17431, 29701, 31903, 32768, 0],
2549 [9921, 22826, 28300, 32768, 0],
2550 [5896, 15434, 22068, 32768, 0],
2551 [3430, 9646, 14757, 32768, 0],
2552 [28614, 32511, 32705, 32768, 0],
2553 [19364, 30638, 32263, 32768, 0],
2554 [13129, 26254, 30402, 32768, 0],
2555 [8754, 20484, 26440, 32768, 0],
2556 [4378, 11607, 17110, 32768, 0],
2557 [30292, 32671, 32744, 32768, 0],
2558 [21780, 31603, 32501, 32768, 0],
2559 [14314, 27829, 31291, 32768, 0],
2560 [9611, 22327, 28263, 32768, 0],
2561 [4890, 13087, 19065, 32768, 0],
2562 [25862, 32567, 32733, 32768, 0],
2563 [20794, 32050, 32567, 32768, 0],
2564 [17243, 30625, 32254, 32768, 0],
2565 [13283, 27628, 31474, 32768, 0],
2566 [9669, 22532, 28918, 32768, 0],
2567 [27435, 32697, 32748, 32768, 0],
2568 [24922, 32390, 32714, 32768, 0],
2569 [21449, 31504, 32536, 32768, 0],
2570 [16392, 29729, 31832, 32768, 0],
2571 [11692, 24884, 29076, 32768, 0],
2572 [24193, 32290, 32735, 32768, 0],
2573 [18909, 31104, 32563, 32768, 0],
2574 [12236, 26841, 31403, 32768, 0],
2575 [8171, 21840, 29082, 32768, 0],
2576 [7224, 17280, 25275, 32768, 0],
2577 [8192, 16384, 24576, 32768, 0],
2578];
2579/// COEFF_BASE_CHROMA_32, q-context 1: the same table as [`COEFF_BASE_CHROMA_32`], for `base_q_idx` 21..=60.
2580pub const COEFF_BASE_CHROMA_32_Q1: [[u16; 5]; 42] = [
2581 [5244, 12150, 16906, 32768, 0],
2582 [20486, 26858, 29701, 32768, 0],
2583 [7756, 18317, 23735, 32768, 0],
2584 [3452, 9256, 13146, 32768, 0],
2585 [2020, 5206, 8229, 32768, 0],
2586 [1801, 4993, 7903, 32768, 0],
2587 [27051, 31858, 32531, 32768, 0],
2588 [15988, 27531, 30619, 32768, 0],
2589 [9188, 21484, 26719, 32768, 0],
2590 [6273, 17186, 23800, 32768, 0],
2591 [3108, 9355, 14764, 32768, 0],
2592 [31076, 32520, 32680, 32768, 0],
2593 [18119, 30037, 31850, 32768, 0],
2594 [10244, 22969, 27472, 32768, 0],
2595 [4692, 14077, 19273, 32768, 0],
2596 [3694, 11677, 17556, 32768, 0],
2597 [30060, 32581, 32720, 32768, 0],
2598 [21011, 30775, 32120, 32768, 0],
2599 [11931, 24820, 29289, 32768, 0],
2600 [7119, 17662, 24356, 32768, 0],
2601 [3833, 10706, 16304, 32768, 0],
2602 [31954, 32731, 32748, 32768, 0],
2603 [23913, 31724, 32489, 32768, 0],
2604 [15520, 28060, 31286, 32768, 0],
2605 [11517, 23008, 28571, 32768, 0],
2606 [6193, 14508, 20629, 32768, 0],
2607 [8192, 16384, 24576, 32768, 0],
2608 [8192, 16384, 24576, 32768, 0],
2609 [8192, 16384, 24576, 32768, 0],
2610 [8192, 16384, 24576, 32768, 0],
2611 [8192, 16384, 24576, 32768, 0],
2612 [8192, 16384, 24576, 32768, 0],
2613 [8192, 16384, 24576, 32768, 0],
2614 [8192, 16384, 24576, 32768, 0],
2615 [8192, 16384, 24576, 32768, 0],
2616 [8192, 16384, 24576, 32768, 0],
2617 [8192, 16384, 24576, 32768, 0],
2618 [8192, 16384, 24576, 32768, 0],
2619 [8192, 16384, 24576, 32768, 0],
2620 [8192, 16384, 24576, 32768, 0],
2621 [8192, 16384, 24576, 32768, 0],
2622 [8192, 16384, 24576, 32768, 0],
2623];
2624/// COEFF_BR_LUMA_16, q-context 1: the same table as [`COEFF_BR_LUMA_16`], for `base_q_idx` 21..=60.
2625pub const COEFF_BR_LUMA_16_Q1: [[u16; 5]; 21] = [
2626 [13549, 19724, 23158, 32768, 0],
2627 [11844, 18382, 22246, 32768, 0],
2628 [7919, 13619, 17773, 32768, 0],
2629 [5486, 10143, 13946, 32768, 0],
2630 [4166, 7983, 11324, 32768, 0],
2631 [3364, 6506, 9427, 32768, 0],
2632 [1598, 3160, 4674, 32768, 0],
2633 [15281, 20979, 23781, 32768, 0],
2634 [14939, 22119, 25952, 32768, 0],
2635 [11363, 18407, 22812, 32768, 0],
2636 [8609, 14857, 19370, 32768, 0],
2637 [6737, 12184, 16480, 32768, 0],
2638 [5506, 10263, 14262, 32768, 0],
2639 [2990, 5786, 8380, 32768, 0],
2640 [20249, 25253, 27417, 32768, 0],
2641 [21070, 27518, 30001, 32768, 0],
2642 [16854, 24469, 28074, 32768, 0],
2643 [12864, 20486, 25000, 32768, 0],
2644 [9962, 16978, 21778, 32768, 0],
2645 [8074, 14338, 19048, 32768, 0],
2646 [4494, 8479, 11906, 32768, 0],
2647];
2648/// COEFF_BR_LUMA_32, q-context 1: the same table as [`COEFF_BR_LUMA_32`], for `base_q_idx` 21..=60.
2649pub const COEFF_BR_LUMA_32_Q1: [[u16; 5]; 21] = [
2650 [5705, 10930, 15725, 32768, 0],
2651 [7946, 12765, 16115, 32768, 0],
2652 [6801, 12123, 16226, 32768, 0],
2653 [5462, 10135, 14200, 32768, 0],
2654 [4189, 8011, 11507, 32768, 0],
2655 [3191, 6229, 9408, 32768, 0],
2656 [1057, 2137, 3212, 32768, 0],
2657 [10018, 17067, 21491, 32768, 0],
2658 [7380, 12582, 16453, 32768, 0],
2659 [6068, 10845, 14339, 32768, 0],
2660 [5098, 9198, 12555, 32768, 0],
2661 [4312, 8010, 11119, 32768, 0],
2662 [3700, 6966, 9781, 32768, 0],
2663 [1693, 3326, 4887, 32768, 0],
2664 [18757, 24930, 27774, 32768, 0],
2665 [17648, 24596, 27817, 32768, 0],
2666 [14707, 22052, 26026, 32768, 0],
2667 [11720, 18852, 23292, 32768, 0],
2668 [9357, 15952, 20525, 32768, 0],
2669 [7810, 13753, 18210, 32768, 0],
2670 [3879, 7333, 10328, 32768, 0],
2671];
2672/// COEFF_BR_CHROMA_8, q-context 1: the same table as [`COEFF_BR_CHROMA_8`], for `base_q_idx` 21..=60.
2673pub const COEFF_BR_CHROMA_8_Q1: [[u16; 5]; 21] = [
2674 [14899, 21217, 24503, 32768, 0],
2675 [13519, 20283, 24047, 32768, 0],
2676 [9429, 15966, 20365, 32768, 0],
2677 [6700, 12355, 16652, 32768, 0],
2678 [5088, 9704, 13716, 32768, 0],
2679 [4243, 8154, 11731, 32768, 0],
2680 [2702, 5364, 7861, 32768, 0],
2681 [22745, 28388, 30454, 32768, 0],
2682 [20235, 27146, 29922, 32768, 0],
2683 [15896, 23715, 27637, 32768, 0],
2684 [11840, 19350, 24131, 32768, 0],
2685 [9122, 15932, 20880, 32768, 0],
2686 [7488, 13581, 18362, 32768, 0],
2687 [5114, 9568, 13370, 32768, 0],
2688 [20845, 26553, 28932, 32768, 0],
2689 [20981, 27372, 29884, 32768, 0],
2690 [17781, 25335, 28785, 32768, 0],
2691 [13760, 21708, 26297, 32768, 0],
2692 [10975, 18415, 23365, 32768, 0],
2693 [9045, 15789, 20686, 32768, 0],
2694 [6130, 11199, 15423, 32768, 0],
2695];
2696/// COEFF_BR_CHROMA_16, q-context 1: the same table as [`COEFF_BR_CHROMA_16`], for `base_q_idx` 21..=60.
2697pub const COEFF_BR_CHROMA_16_Q1: [[u16; 5]; 21] = [
2698 [13960, 19617, 22829, 32768, 0],
2699 [11150, 17341, 21228, 32768, 0],
2700 [7150, 12964, 17190, 32768, 0],
2701 [5331, 10002, 13867, 32768, 0],
2702 [4167, 7744, 11057, 32768, 0],
2703 [3480, 6629, 9646, 32768, 0],
2704 [1883, 3784, 5686, 32768, 0],
2705 [18752, 25660, 28912, 32768, 0],
2706 [16968, 24586, 28030, 32768, 0],
2707 [13520, 21055, 25313, 32768, 0],
2708 [10453, 17626, 22280, 32768, 0],
2709 [8386, 14505, 19116, 32768, 0],
2710 [6742, 12595, 17008, 32768, 0],
2711 [4273, 8140, 11499, 32768, 0],
2712 [22120, 27827, 30233, 32768, 0],
2713 [20563, 27358, 29895, 32768, 0],
2714 [17076, 24644, 28153, 32768, 0],
2715 [13362, 20942, 25309, 32768, 0],
2716 [10794, 17965, 22695, 32768, 0],
2717 [9014, 15652, 20319, 32768, 0],
2718 [5708, 10512, 14497, 32768, 0],
2719];
2720/// COEFF_BR_CHROMA_32, q-context 1: the same table as [`COEFF_BR_CHROMA_32`], for `base_q_idx` 21..=60.
2721pub const COEFF_BR_CHROMA_32_Q1: [[u16; 5]; 21] = [
2722 [8278, 13242, 15922, 32768, 0],
2723 [10547, 15867, 18919, 32768, 0],
2724 [9106, 15842, 20609, 32768, 0],
2725 [6833, 13007, 17218, 32768, 0],
2726 [4811, 9712, 13923, 32768, 0],
2727 [3985, 7352, 11128, 32768, 0],
2728 [1688, 3458, 5262, 32768, 0],
2729 [12951, 21861, 26510, 32768, 0],
2730 [9788, 16044, 20276, 32768, 0],
2731 [6309, 11244, 14870, 32768, 0],
2732 [5183, 9349, 12566, 32768, 0],
2733 [4389, 8229, 11492, 32768, 0],
2734 [3633, 6945, 10620, 32768, 0],
2735 [3600, 6847, 9907, 32768, 0],
2736 [21748, 28137, 30255, 32768, 0],
2737 [19436, 26581, 29560, 32768, 0],
2738 [16359, 24201, 27953, 32768, 0],
2739 [13961, 21693, 25871, 32768, 0],
2740 [11544, 18686, 23322, 32768, 0],
2741 [9372, 16462, 20952, 32768, 0],
2742 [6138, 11210, 15390, 32768, 0],
2743];
2744/// COEFF_BASE_EOB_LUMA_16, q-context 1: the same table as [`COEFF_BASE_EOB_LUMA_16`], for `base_q_idx` 21..=60.
2745pub const COEFF_BASE_EOB_LUMA_16_Q1: [[u16; 4]; 4] = [
2746 [2644, 25198, 32768, 0],
2747 [32038, 32451, 32768, 0],
2748 [32639, 32695, 32768, 0],
2749 [32166, 32518, 32768, 0],
2750];
2751/// COEFF_BASE_EOB_LUMA_32, q-context 1: the same table as [`COEFF_BASE_EOB_LUMA_32`], for `base_q_idx` 21..=60.
2752pub const COEFF_BASE_EOB_LUMA_32_Q1: [[u16; 4]; 4] = [
2753 [1044, 2257, 32768, 0],
2754 [30755, 31923, 32768, 0],
2755 [32208, 32693, 32768, 0],
2756 [32244, 32615, 32768, 0],
2757];
2758/// COEFF_BASE_EOB_LUMA_64, q-context 1: the same table as [`COEFF_BASE_EOB_LUMA_64`], for `base_q_idx` 21..=60.
2759pub const COEFF_BASE_EOB_LUMA_64_Q1: [[u16; 4]; 4] = [
2760 [478, 1834, 32768, 0],
2761 [31005, 31987, 32768, 0],
2762 [32317, 32724, 32768, 0],
2763 [30865, 32648, 32768, 0],
2764];
2765/// COEFF_BASE_EOB_CHROMA_8, q-context 1: the same table as [`COEFF_BASE_EOB_CHROMA_8`], for `base_q_idx` 21..=60.
2766pub const COEFF_BASE_EOB_CHROMA_8_Q1: [[u16; 4]; 4] = [
2767 [26279, 30968, 32768, 0],
2768 [31142, 32495, 32768, 0],
2769 [31713, 32540, 32768, 0],
2770 [31929, 32594, 32768, 0],
2771];
2772/// COEFF_BASE_EOB_CHROMA_16, q-context 1: the same table as [`COEFF_BASE_EOB_CHROMA_16`], for `base_q_idx` 21..=60.
2773pub const COEFF_BASE_EOB_CHROMA_16_Q1: [[u16; 4]; 4] = [
2774 [17187, 27668, 32768, 0],
2775 [31714, 32550, 32768, 0],
2776 [32283, 32678, 32768, 0],
2777 [31930, 32563, 32768, 0],
2778];
2779/// COEFF_BASE_EOB_CHROMA_32, q-context 1: the same table as [`COEFF_BASE_EOB_CHROMA_32`], for `base_q_idx` 21..=60.
2780pub const COEFF_BASE_EOB_CHROMA_32_Q1: [[u16; 4]; 4] = [
2781 [21317, 26207, 32768, 0],
2782 [29133, 30868, 32768, 0],
2783 [29311, 31231, 32768, 0],
2784 [29657, 31087, 32768, 0],
2785];
2786
2787// q-context 3: base_q_idx 121..=255.
2788
2789/// TXB_SKIP_LUMA_64, q-context 3: the same table as [`TXB_SKIP_LUMA_64`], for `base_q_idx` 121..=255.
2790pub const TXB_SKIP_LUMA_64_Q3: [u16; 3] = [31539, 32768, 0];
2791/// TXB_SKIP_LUMA_32, q-context 3: the same table as [`TXB_SKIP_LUMA_32`], for `base_q_idx` 121..=255.
2792pub const TXB_SKIP_LUMA_32_Q3: [u16; 3] = [31671, 32768, 0];
2793/// TXB_SKIP_LUMA_16, q-context 3: the same table as [`TXB_SKIP_LUMA_16`], for `base_q_idx` 121..=255.
2794pub const TXB_SKIP_LUMA_16_Q3: [u16; 3] = [32510, 32768, 0];
2795/// TXB_SKIP_CHROMA_8, q-context 3: the same table as [`TXB_SKIP_CHROMA_8`], for `base_q_idx` 121..=255.
2796pub const TXB_SKIP_CHROMA_8_Q3: [[u16; 3]; 3] =
2797 [[2786, 32768, 0], [11194, 32768, 0], [20155, 32768, 0]];
2798/// TXB_SKIP_CHROMA_16, q-context 3: the same table as [`TXB_SKIP_CHROMA_16`], for `base_q_idx` 121..=255.
2799pub const TXB_SKIP_CHROMA_16_Q3: [[u16; 3]; 3] =
2800 [[3440, 32768, 0], [13117, 32768, 0], [22702, 32768, 0]];
2801/// TXB_SKIP_CHROMA_32, q-context 3: the same table as [`TXB_SKIP_CHROMA_32`], for `base_q_idx` 121..=255.
2802pub const TXB_SKIP_CHROMA_32_Q3: [[u16; 3]; 3] =
2803 [[4656, 32768, 0], [16074, 32768, 0], [24704, 32768, 0]];
2804/// EOB_EXTRA_LUMA_16, q-context 3: the same table as [`EOB_EXTRA_LUMA_16`], for `base_q_idx` 121..=255.
2805pub const EOB_EXTRA_LUMA_16_Q3: [[u16; 3]; 9] = [
2806 [19941, 32768, 0],
2807 [20527, 32768, 0],
2808 [21470, 32768, 0],
2809 [22487, 32768, 0],
2810 [19558, 32768, 0],
2811 [22354, 32768, 0],
2812 [20331, 32768, 0],
2813 [16384, 32768, 0],
2814 [16384, 32768, 0],
2815];
2816/// EOB_EXTRA_LUMA_32, q-context 3: the same table as [`EOB_EXTRA_LUMA_32`], for `base_q_idx` 121..=255.
2817pub const EOB_EXTRA_LUMA_32_Q3: [[u16; 3]; 9] = [
2818 [21442, 32768, 0],
2819 [22358, 32768, 0],
2820 [18503, 32768, 0],
2821 [20291, 32768, 0],
2822 [19945, 32768, 0],
2823 [21294, 32768, 0],
2824 [21178, 32768, 0],
2825 [19400, 32768, 0],
2826 [10556, 32768, 0],
2827];
2828/// EOB_EXTRA_LUMA_64, q-context 3: the same table as [`EOB_EXTRA_LUMA_64`], for `base_q_idx` 121..=255.
2829pub const EOB_EXTRA_LUMA_64_Q3: [[u16; 3]; 9] = [
2830 [26064, 32768, 0],
2831 [22098, 32768, 0],
2832 [19613, 32768, 0],
2833 [20525, 32768, 0],
2834 [17595, 32768, 0],
2835 [16618, 32768, 0],
2836 [20497, 32768, 0],
2837 [18989, 32768, 0],
2838 [15513, 32768, 0],
2839];
2840/// EOB_EXTRA_CHROMA_8, q-context 3: the same table as [`EOB_EXTRA_CHROMA_8`], for `base_q_idx` 121..=255.
2841pub const EOB_EXTRA_CHROMA_8_Q3: [[u16; 3]; 9] = [
2842 [20125, 32768, 0],
2843 [20559, 32768, 0],
2844 [21707, 32768, 0],
2845 [22296, 32768, 0],
2846 [17333, 32768, 0],
2847 [16384, 32768, 0],
2848 [16384, 32768, 0],
2849 [16384, 32768, 0],
2850 [16384, 32768, 0],
2851];
2852/// EOB_EXTRA_CHROMA_16, q-context 3: the same table as [`EOB_EXTRA_CHROMA_16`], for `base_q_idx` 121..=255.
2853pub const EOB_EXTRA_CHROMA_16_Q3: [[u16; 3]; 9] = [
2854 [22752, 32768, 0],
2855 [25006, 32768, 0],
2856 [22075, 32768, 0],
2857 [21576, 32768, 0],
2858 [17740, 32768, 0],
2859 [21690, 32768, 0],
2860 [19211, 32768, 0],
2861 [16384, 32768, 0],
2862 [16384, 32768, 0],
2863];
2864/// EOB_EXTRA_CHROMA_32, q-context 3: the same table as [`EOB_EXTRA_CHROMA_32`], for `base_q_idx` 121..=255.
2865pub const EOB_EXTRA_CHROMA_32_Q3: [[u16; 3]; 9] = [
2866 [24648, 32768, 0],
2867 [24949, 32768, 0],
2868 [20708, 32768, 0],
2869 [23905, 32768, 0],
2870 [20501, 32768, 0],
2871 [9558, 32768, 0],
2872 [9423, 32768, 0],
2873 [30365, 32768, 0],
2874 [19253, 32768, 0],
2875];
2876/// EOB_PT_1024_LUMA, q-context 3: the same table as [`EOB_PT_1024_LUMA`], for `base_q_idx` 121..=255.
2877pub const EOB_PT_1024_LUMA_Q3: [u16; 12] = [
2878 6698, 8334, 11961, 15762, 20186, 23862, 27434, 29326, 31082, 32050, 32768, 0,
2879];
2880/// EOB_PT_1024_CHROMA, q-context 3: the same table as [`EOB_PT_1024_CHROMA`], for `base_q_idx` 121..=255.
2881pub const EOB_PT_1024_CHROMA_Q3: [u16; 12] = [
2882 20569, 22426, 25569, 26859, 28053, 28913, 29486, 29724, 29807, 32570, 32768, 0,
2883];
2884/// EOB_PT_256_LUMA, q-context 3: the same table as [`EOB_PT_256_LUMA`], for `base_q_idx` 121..=255.
2885pub const EOB_PT_256_LUMA_Q3: [u16; 10] = [
2886 5348, 7113, 11820, 15924, 22106, 26777, 30334, 31757, 32768, 0,
2887];
2888/// EOB_PT_256_CHROMA, q-context 3: the same table as [`EOB_PT_256_CHROMA`], for `base_q_idx` 121..=255.
2889pub const EOB_PT_256_CHROMA_Q3: [u16; 10] = [
2890 23110, 24597, 27140, 28894, 30167, 30927, 31392, 32094, 32768, 0,
2891];
2892/// EOB_PT_64_CHROMA, q-context 3: the same table as [`EOB_PT_64_CHROMA`], for `base_q_idx` 121..=255.
2893pub const EOB_PT_64_CHROMA_Q3: [u16; 8] = [24212, 25708, 28268, 30035, 31307, 32049, 32768, 0];
2894/// COEFF_BASE_LUMA_16, q-context 3: the same table as [`COEFF_BASE_LUMA_16`], for `base_q_idx` 121..=255.
2895pub const COEFF_BASE_LUMA_16_Q3: [[u16; 5]; 42] = [
2896 [7876, 16901, 21741, 32768, 0],
2897 [24001, 31898, 32625, 32768, 0],
2898 [14529, 27959, 31451, 32768, 0],
2899 [8273, 20818, 27258, 32768, 0],
2900 [5278, 14673, 21510, 32768, 0],
2901 [2983, 8843, 14039, 32768, 0],
2902 [28016, 32574, 32732, 32768, 0],
2903 [17471, 30306, 32301, 32768, 0],
2904 [10224, 24063, 29728, 32768, 0],
2905 [6602, 17954, 25052, 32768, 0],
2906 [4002, 11585, 17759, 32768, 0],
2907 [30190, 32634, 32739, 32768, 0],
2908 [17497, 30282, 32270, 32768, 0],
2909 [10229, 23729, 29538, 32768, 0],
2910 [6344, 17211, 24440, 32768, 0],
2911 [3849, 11189, 17108, 32768, 0],
2912 [28570, 32583, 32726, 32768, 0],
2913 [17521, 30161, 32238, 32768, 0],
2914 [10153, 23565, 29378, 32768, 0],
2915 [6455, 17341, 24443, 32768, 0],
2916 [3907, 11042, 17024, 32768, 0],
2917 [30689, 32715, 32748, 32768, 0],
2918 [21546, 31840, 32610, 32768, 0],
2919 [13547, 27581, 31459, 32768, 0],
2920 [8912, 21757, 28309, 32768, 0],
2921 [5548, 15080, 22046, 32768, 0],
2922 [30783, 32540, 32685, 32768, 0],
2923 [17540, 29528, 31668, 32768, 0],
2924 [10160, 21468, 26783, 32768, 0],
2925 [4724, 13393, 20054, 32768, 0],
2926 [2702, 8174, 13102, 32768, 0],
2927 [31648, 32686, 32742, 32768, 0],
2928 [20954, 31094, 32337, 32768, 0],
2929 [12420, 25698, 30179, 32768, 0],
2930 [7304, 19320, 26248, 32768, 0],
2931 [4366, 12261, 18864, 32768, 0],
2932 [31581, 32723, 32748, 32768, 0],
2933 [21373, 31586, 32525, 32768, 0],
2934 [12744, 26625, 30885, 32768, 0],
2935 [7431, 20322, 26950, 32768, 0],
2936 [4692, 13323, 20111, 32768, 0],
2937 [8192, 16384, 24576, 32768, 0],
2938];
2939/// COEFF_BASE_LUMA_32, q-context 3: the same table as [`COEFF_BASE_LUMA_32`], for `base_q_idx` 121..=255.
2940pub const COEFF_BASE_LUMA_32_Q3: [[u16; 5]; 42] = [
2941 [5992, 14304, 19765, 32768, 0],
2942 [22612, 31238, 32456, 32768, 0],
2943 [13456, 27162, 31087, 32768, 0],
2944 [8001, 20062, 26504, 32768, 0],
2945 [5168, 14105, 20764, 32768, 0],
2946 [2632, 7771, 12385, 32768, 0],
2947 [27034, 32344, 32709, 32768, 0],
2948 [15850, 29415, 31997, 32768, 0],
2949 [9494, 22776, 28841, 32768, 0],
2950 [6151, 16830, 23969, 32768, 0],
2951 [3461, 10039, 15722, 32768, 0],
2952 [30134, 32569, 32731, 32768, 0],
2953 [15638, 29422, 31945, 32768, 0],
2954 [9150, 21865, 28218, 32768, 0],
2955 [5647, 15719, 22676, 32768, 0],
2956 [3402, 9772, 15477, 32768, 0],
2957 [28530, 32586, 32735, 32768, 0],
2958 [17139, 30298, 32292, 32768, 0],
2959 [10200, 24039, 29685, 32768, 0],
2960 [6419, 17674, 24786, 32768, 0],
2961 [3544, 10225, 15824, 32768, 0],
2962 [31333, 32726, 32748, 32768, 0],
2963 [20618, 31487, 32544, 32768, 0],
2964 [12901, 27217, 31232, 32768, 0],
2965 [8624, 21734, 28171, 32768, 0],
2966 [5104, 14191, 20748, 32768, 0],
2967 [8192, 16384, 24576, 32768, 0],
2968 [8192, 16384, 24576, 32768, 0],
2969 [8192, 16384, 24576, 32768, 0],
2970 [8192, 16384, 24576, 32768, 0],
2971 [8192, 16384, 24576, 32768, 0],
2972 [8192, 16384, 24576, 32768, 0],
2973 [8192, 16384, 24576, 32768, 0],
2974 [8192, 16384, 24576, 32768, 0],
2975 [8192, 16384, 24576, 32768, 0],
2976 [8192, 16384, 24576, 32768, 0],
2977 [8192, 16384, 24576, 32768, 0],
2978 [8192, 16384, 24576, 32768, 0],
2979 [8192, 16384, 24576, 32768, 0],
2980 [8192, 16384, 24576, 32768, 0],
2981 [8192, 16384, 24576, 32768, 0],
2982 [8192, 16384, 24576, 32768, 0],
2983];
2984/// COEFF_BASE_LUMA_64, q-context 3: the same table as [`COEFF_BASE_LUMA_64`], for `base_q_idx` 121..=255.
2985pub const COEFF_BASE_LUMA_64_Q3: [[u16; 5]; 42] = [
2986 [4137, 10847, 15682, 32768, 0],
2987 [17824, 27001, 30058, 32768, 0],
2988 [10204, 22796, 28291, 32768, 0],
2989 [6076, 15935, 22125, 32768, 0],
2990 [3852, 10937, 16816, 32768, 0],
2991 [2252, 6324, 10131, 32768, 0],
2992 [25840, 32016, 32662, 32768, 0],
2993 [15109, 28268, 31531, 32768, 0],
2994 [9385, 22231, 28340, 32768, 0],
2995 [6082, 16672, 23479, 32768, 0],
2996 [3318, 9427, 14681, 32768, 0],
2997 [30594, 32574, 32718, 32768, 0],
2998 [16836, 29552, 31859, 32768, 0],
2999 [9556, 22542, 28356, 32768, 0],
3000 [6305, 16725, 23540, 32768, 0],
3001 [3376, 9895, 15184, 32768, 0],
3002 [29383, 32617, 32745, 32768, 0],
3003 [18891, 30809, 32401, 32768, 0],
3004 [11688, 25942, 30687, 32768, 0],
3005 [7468, 19469, 26651, 32768, 0],
3006 [3909, 11358, 17012, 32768, 0],
3007 [31564, 32736, 32748, 32768, 0],
3008 [20906, 31611, 32600, 32768, 0],
3009 [13191, 27621, 31537, 32768, 0],
3010 [8768, 22029, 28676, 32768, 0],
3011 [5079, 14109, 20906, 32768, 0],
3012 [8192, 16384, 24576, 32768, 0],
3013 [8192, 16384, 24576, 32768, 0],
3014 [8192, 16384, 24576, 32768, 0],
3015 [8192, 16384, 24576, 32768, 0],
3016 [8192, 16384, 24576, 32768, 0],
3017 [8192, 16384, 24576, 32768, 0],
3018 [8192, 16384, 24576, 32768, 0],
3019 [8192, 16384, 24576, 32768, 0],
3020 [8192, 16384, 24576, 32768, 0],
3021 [8192, 16384, 24576, 32768, 0],
3022 [8192, 16384, 24576, 32768, 0],
3023 [8192, 16384, 24576, 32768, 0],
3024 [8192, 16384, 24576, 32768, 0],
3025 [8192, 16384, 24576, 32768, 0],
3026 [8192, 16384, 24576, 32768, 0],
3027 [8192, 16384, 24576, 32768, 0],
3028];
3029/// COEFF_BASE_CHROMA_8, q-context 3: the same table as [`COEFF_BASE_CHROMA_8`], for `base_q_idx` 121..=255.
3030pub const COEFF_BASE_CHROMA_8_Q3: [[u16; 5]; 42] = [
3031 [8626, 20271, 26216, 32768, 0],
3032 [26707, 32406, 32711, 32768, 0],
3033 [16999, 30329, 32286, 32768, 0],
3034 [11445, 25123, 30286, 32768, 0],
3035 [6411, 18828, 25601, 32768, 0],
3036 [6801, 12458, 20248, 32768, 0],
3037 [29918, 32682, 32748, 32768, 0],
3038 [20649, 31739, 32618, 32768, 0],
3039 [12879, 27773, 31581, 32768, 0],
3040 [7896, 21751, 28244, 32768, 0],
3041 [5260, 14870, 23698, 32768, 0],
3042 [29252, 32593, 32731, 32768, 0],
3043 [17072, 30460, 32294, 32768, 0],
3044 [10653, 24143, 29365, 32768, 0],
3045 [6536, 17490, 23983, 32768, 0],
3046 [4929, 13170, 20085, 32768, 0],
3047 [28137, 32518, 32715, 32768, 0],
3048 [18171, 30784, 32407, 32768, 0],
3049 [11437, 25436, 30459, 32768, 0],
3050 [7252, 18534, 26176, 32768, 0],
3051 [4126, 13353, 20978, 32768, 0],
3052 [31162, 32726, 32748, 32768, 0],
3053 [23017, 32222, 32701, 32768, 0],
3054 [15629, 29233, 32046, 32768, 0],
3055 [9387, 22621, 29480, 32768, 0],
3056 [6922, 17616, 25010, 32768, 0],
3057 [28838, 32265, 32614, 32768, 0],
3058 [19701, 30206, 31920, 32768, 0],
3059 [11214, 22410, 27933, 32768, 0],
3060 [5320, 14177, 23034, 32768, 0],
3061 [5049, 12881, 17827, 32768, 0],
3062 [27484, 32471, 32734, 32768, 0],
3063 [21076, 31526, 32561, 32768, 0],
3064 [12707, 26303, 31211, 32768, 0],
3065 [8169, 21722, 28219, 32768, 0],
3066 [6045, 19406, 27042, 32768, 0],
3067 [27753, 32572, 32745, 32768, 0],
3068 [20832, 31878, 32653, 32768, 0],
3069 [13250, 27356, 31674, 32768, 0],
3070 [7718, 21508, 29858, 32768, 0],
3071 [7209, 18350, 25559, 32768, 0],
3072 [8192, 16384, 24576, 32768, 0],
3073];
3074/// COEFF_BASE_CHROMA_16, q-context 3: the same table as [`COEFF_BASE_CHROMA_16`], for `base_q_idx` 121..=255.
3075pub const COEFF_BASE_CHROMA_16_Q3: [[u16; 5]; 42] = [
3076 [7833, 18369, 24095, 32768, 0],
3077 [26650, 32273, 32702, 32768, 0],
3078 [16371, 29961, 32191, 32768, 0],
3079 [11055, 24082, 29629, 32768, 0],
3080 [6892, 18644, 25400, 32768, 0],
3081 [5006, 13057, 19240, 32768, 0],
3082 [29834, 32666, 32748, 32768, 0],
3083 [19577, 31335, 32570, 32768, 0],
3084 [12253, 26509, 31122, 32768, 0],
3085 [7991, 20772, 27711, 32768, 0],
3086 [5677, 15910, 23059, 32768, 0],
3087 [30109, 32532, 32720, 32768, 0],
3088 [16747, 30166, 32252, 32768, 0],
3089 [10134, 23542, 29184, 32768, 0],
3090 [5791, 16176, 23556, 32768, 0],
3091 [4362, 10414, 17284, 32768, 0],
3092 [29492, 32626, 32748, 32768, 0],
3093 [19894, 31402, 32525, 32768, 0],
3094 [12942, 27071, 30869, 32768, 0],
3095 [8346, 21216, 27405, 32768, 0],
3096 [6572, 17087, 23859, 32768, 0],
3097 [32035, 32735, 32748, 32768, 0],
3098 [22957, 31838, 32618, 32768, 0],
3099 [14724, 28572, 31772, 32768, 0],
3100 [10364, 23999, 29553, 32768, 0],
3101 [7004, 18433, 25655, 32768, 0],
3102 [27528, 32277, 32681, 32768, 0],
3103 [16959, 31171, 32096, 32768, 0],
3104 [10486, 23593, 27962, 32768, 0],
3105 [8192, 16384, 23211, 32768, 0],
3106 [8937, 17873, 20852, 32768, 0],
3107 [27715, 32002, 32615, 32768, 0],
3108 [15073, 29491, 31676, 32768, 0],
3109 [11264, 24576, 28672, 32768, 0],
3110 [2341, 18725, 23406, 32768, 0],
3111 [7282, 18204, 25486, 32768, 0],
3112 [28547, 32213, 32657, 32768, 0],
3113 [20788, 29773, 32239, 32768, 0],
3114 [6780, 21469, 30508, 32768, 0],
3115 [5958, 14895, 23831, 32768, 0],
3116 [16384, 21845, 27307, 32768, 0],
3117 [8192, 16384, 24576, 32768, 0],
3118];
3119/// COEFF_BASE_CHROMA_32, q-context 3: the same table as [`COEFF_BASE_CHROMA_32`], for `base_q_idx` 121..=255.
3120pub const COEFF_BASE_CHROMA_32_Q3: [[u16; 5]; 42] = [
3121 [11206, 21090, 26561, 32768, 0],
3122 [28759, 32279, 32671, 32768, 0],
3123 [14171, 27952, 31569, 32768, 0],
3124 [9743, 22907, 29141, 32768, 0],
3125 [6871, 17886, 24868, 32768, 0],
3126 [4960, 13152, 19315, 32768, 0],
3127 [31077, 32661, 32748, 32768, 0],
3128 [19400, 31195, 32515, 32768, 0],
3129 [12752, 26858, 31040, 32768, 0],
3130 [8370, 22098, 28591, 32768, 0],
3131 [5457, 15373, 22298, 32768, 0],
3132 [31697, 32706, 32748, 32768, 0],
3133 [17860, 30657, 32333, 32768, 0],
3134 [12510, 24812, 29261, 32768, 0],
3135 [6180, 19124, 24722, 32768, 0],
3136 [5041, 13548, 17959, 32768, 0],
3137 [31552, 32716, 32748, 32768, 0],
3138 [21908, 31769, 32623, 32768, 0],
3139 [14470, 28201, 31565, 32768, 0],
3140 [9493, 22982, 28608, 32768, 0],
3141 [6858, 17240, 24137, 32768, 0],
3142 [32543, 32752, 32756, 32768, 0],
3143 [24286, 32097, 32666, 32768, 0],
3144 [15958, 29217, 32024, 32768, 0],
3145 [10207, 24234, 29958, 32768, 0],
3146 [6929, 18305, 25652, 32768, 0],
3147 [8192, 16384, 24576, 32768, 0],
3148 [8192, 16384, 24576, 32768, 0],
3149 [8192, 16384, 24576, 32768, 0],
3150 [8192, 16384, 24576, 32768, 0],
3151 [8192, 16384, 24576, 32768, 0],
3152 [8192, 16384, 24576, 32768, 0],
3153 [8192, 16384, 24576, 32768, 0],
3154 [8192, 16384, 24576, 32768, 0],
3155 [8192, 16384, 24576, 32768, 0],
3156 [8192, 16384, 24576, 32768, 0],
3157 [8192, 16384, 24576, 32768, 0],
3158 [8192, 16384, 24576, 32768, 0],
3159 [8192, 16384, 24576, 32768, 0],
3160 [8192, 16384, 24576, 32768, 0],
3161 [8192, 16384, 24576, 32768, 0],
3162 [8192, 16384, 24576, 32768, 0],
3163];
3164/// COEFF_BR_LUMA_16, q-context 3: the same table as [`COEFF_BR_LUMA_16`], for `base_q_idx` 121..=255.
3165pub const COEFF_BR_LUMA_16_Q3: [[u16; 5]; 21] = [
3166 [17113, 23733, 27081, 32768, 0],
3167 [14139, 21406, 25452, 32768, 0],
3168 [8552, 15002, 19776, 32768, 0],
3169 [5871, 11120, 15378, 32768, 0],
3170 [4455, 8616, 12253, 32768, 0],
3171 [3469, 6910, 10386, 32768, 0],
3172 [2255, 4553, 6782, 32768, 0],
3173 [18224, 24376, 27053, 32768, 0],
3174 [19290, 26710, 29614, 32768, 0],
3175 [14936, 22991, 27184, 32768, 0],
3176 [11238, 18951, 23762, 32768, 0],
3177 [8786, 15617, 20588, 32768, 0],
3178 [7317, 13228, 18003, 32768, 0],
3179 [5101, 9512, 13493, 32768, 0],
3180 [22639, 28222, 30210, 32768, 0],
3181 [23216, 29331, 31307, 32768, 0],
3182 [19075, 26762, 29895, 32768, 0],
3183 [15014, 23113, 27457, 32768, 0],
3184 [11938, 19857, 24752, 32768, 0],
3185 [9942, 17280, 22282, 32768, 0],
3186 [7167, 13144, 17752, 32768, 0],
3187];
3188/// COEFF_BR_LUMA_32, q-context 3: the same table as [`COEFF_BR_LUMA_32`], for `base_q_idx` 121..=255.
3189pub const COEFF_BR_LUMA_32_Q3: [[u16; 5]; 21] = [
3190 [12162, 18785, 22648, 32768, 0],
3191 [12749, 19697, 23806, 32768, 0],
3192 [8580, 15297, 20346, 32768, 0],
3193 [6169, 11749, 16543, 32768, 0],
3194 [4836, 9391, 13448, 32768, 0],
3195 [3821, 7711, 11613, 32768, 0],
3196 [2228, 4601, 7070, 32768, 0],
3197 [16319, 24725, 28280, 32768, 0],
3198 [15698, 23277, 27168, 32768, 0],
3199 [12726, 20368, 25047, 32768, 0],
3200 [9912, 17015, 21976, 32768, 0],
3201 [7888, 14220, 19179, 32768, 0],
3202 [6777, 12284, 17018, 32768, 0],
3203 [4492, 8590, 12252, 32768, 0],
3204 [23249, 28904, 30947, 32768, 0],
3205 [21050, 27908, 30512, 32768, 0],
3206 [17440, 25340, 28949, 32768, 0],
3207 [14059, 22018, 26541, 32768, 0],
3208 [11288, 18903, 23898, 32768, 0],
3209 [9411, 16342, 21428, 32768, 0],
3210 [6278, 11588, 15944, 32768, 0],
3211];
3212/// COEFF_BR_CHROMA_8, q-context 3: the same table as [`COEFF_BR_CHROMA_8`], for `base_q_idx` 121..=255.
3213pub const COEFF_BR_CHROMA_8_Q3: [[u16; 5]; 21] = [
3214 [17616, 24586, 28112, 32768, 0],
3215 [15809, 23299, 27155, 32768, 0],
3216 [10767, 18890, 23793, 32768, 0],
3217 [7727, 14255, 18865, 32768, 0],
3218 [6129, 11926, 16882, 32768, 0],
3219 [4482, 9704, 14861, 32768, 0],
3220 [3277, 7452, 11522, 32768, 0],
3221 [22956, 28551, 30730, 32768, 0],
3222 [22724, 28937, 30961, 32768, 0],
3223 [18467, 26324, 29580, 32768, 0],
3224 [13234, 20713, 25649, 32768, 0],
3225 [11181, 17592, 22481, 32768, 0],
3226 [8291, 18358, 24576, 32768, 0],
3227 [7568, 11881, 14984, 32768, 0],
3228 [24948, 29001, 31147, 32768, 0],
3229 [25674, 30619, 32151, 32768, 0],
3230 [20841, 26793, 29603, 32768, 0],
3231 [14669, 24356, 28666, 32768, 0],
3232 [11334, 23593, 28219, 32768, 0],
3233 [8922, 14762, 22873, 32768, 0],
3234 [8301, 13544, 20535, 32768, 0],
3235];
3236/// COEFF_BR_CHROMA_16, q-context 3: the same table as [`COEFF_BR_CHROMA_16`], for `base_q_idx` 121..=255.
3237pub const COEFF_BR_CHROMA_16_Q3: [[u16; 5]; 21] = [
3238 [15820, 22738, 26488, 32768, 0],
3239 [13530, 20885, 25216, 32768, 0],
3240 [8395, 15530, 20452, 32768, 0],
3241 [6574, 12321, 16380, 32768, 0],
3242 [5353, 10419, 14568, 32768, 0],
3243 [4613, 8446, 12381, 32768, 0],
3244 [3440, 7158, 9903, 32768, 0],
3245 [24247, 29051, 31224, 32768, 0],
3246 [22118, 28058, 30369, 32768, 0],
3247 [16498, 24768, 28389, 32768, 0],
3248 [12920, 21175, 26137, 32768, 0],
3249 [10730, 18619, 25352, 32768, 0],
3250 [10187, 16279, 22791, 32768, 0],
3251 [9310, 14631, 22127, 32768, 0],
3252 [24970, 30558, 32057, 32768, 0],
3253 [24801, 29942, 31698, 32768, 0],
3254 [22432, 28453, 30855, 32768, 0],
3255 [19054, 25680, 29580, 32768, 0],
3256 [14392, 23036, 28109, 32768, 0],
3257 [12495, 20947, 26650, 32768, 0],
3258 [12442, 20326, 26214, 32768, 0],
3259];
3260/// COEFF_BR_CHROMA_32, q-context 3: the same table as [`COEFF_BR_CHROMA_32`], for `base_q_idx` 121..=255.
3261pub const COEFF_BR_CHROMA_32_Q3: [[u16; 5]; 21] = [
3262 [13981, 20067, 23226, 32768, 0],
3263 [16922, 23580, 26783, 32768, 0],
3264 [11005, 19039, 24487, 32768, 0],
3265 [7389, 14218, 19798, 32768, 0],
3266 [5598, 11505, 17206, 32768, 0],
3267 [6090, 11213, 15659, 32768, 0],
3268 [3820, 7371, 10119, 32768, 0],
3269 [21082, 26925, 29675, 32768, 0],
3270 [21262, 28627, 31128, 32768, 0],
3271 [18392, 26454, 30437, 32768, 0],
3272 [14870, 22910, 27096, 32768, 0],
3273 [12620, 19484, 24908, 32768, 0],
3274 [9290, 16553, 22802, 32768, 0],
3275 [6668, 14288, 20004, 32768, 0],
3276 [27704, 31055, 31949, 32768, 0],
3277 [24709, 29978, 31788, 32768, 0],
3278 [21668, 29264, 31657, 32768, 0],
3279 [18295, 26968, 30074, 32768, 0],
3280 [16399, 24422, 29313, 32768, 0],
3281 [14347, 23026, 28104, 32768, 0],
3282 [12370, 19806, 24477, 32768, 0],
3283];
3284/// COEFF_BASE_EOB_LUMA_16, q-context 3: the same table as [`COEFF_BASE_EOB_LUMA_16`], for `base_q_idx` 121..=255.
3285pub const COEFF_BASE_EOB_LUMA_16_Q3: [[u16; 4]; 4] = [
3286 [19980, 30591, 32768, 0],
3287 [32219, 32597, 32768, 0],
3288 [32581, 32706, 32768, 0],
3289 [31803, 32287, 32768, 0],
3290];
3291/// COEFF_BASE_EOB_LUMA_32, q-context 3: the same table as [`COEFF_BASE_EOB_LUMA_32`], for `base_q_idx` 121..=255.
3292pub const COEFF_BASE_EOB_LUMA_32_Q3: [[u16; 4]; 4] = [
3293 [24647, 30463, 32768, 0],
3294 [32412, 32695, 32768, 0],
3295 [32468, 32720, 32768, 0],
3296 [31269, 32523, 32768, 0],
3297];
3298/// COEFF_BASE_EOB_LUMA_64, q-context 3: the same table as [`COEFF_BASE_EOB_LUMA_64`], for `base_q_idx` 121..=255.
3299pub const COEFF_BASE_EOB_LUMA_64_Q3: [[u16; 4]; 4] = [
3300 [12358, 24977, 32768, 0],
3301 [31331, 32385, 32768, 0],
3302 [32634, 32756, 32768, 0],
3303 [30411, 32548, 32768, 0],
3304];
3305/// COEFF_BASE_EOB_CHROMA_8, q-context 3: the same table as [`COEFF_BASE_EOB_CHROMA_8`], for `base_q_idx` 121..=255.
3306pub const COEFF_BASE_EOB_CHROMA_8_Q3: [[u16; 4]; 4] = [
3307 [27558, 31151, 32768, 0],
3308 [32020, 32640, 32768, 0],
3309 [32097, 32575, 32768, 0],
3310 [32242, 32719, 32768, 0],
3311];
3312/// COEFF_BASE_EOB_CHROMA_16, q-context 3: the same table as [`COEFF_BASE_EOB_CHROMA_16`], for `base_q_idx` 121..=255.
3313pub const COEFF_BASE_EOB_CHROMA_16_Q3: [[u16; 4]; 4] = [
3314 [26473, 30507, 32768, 0],
3315 [32431, 32723, 32768, 0],
3316 [32196, 32611, 32768, 0],
3317 [31588, 32528, 32768, 0],
3318];
3319/// COEFF_BASE_EOB_CHROMA_32, q-context 3: the same table as [`COEFF_BASE_EOB_CHROMA_32`], for `base_q_idx` 121..=255.
3320pub const COEFF_BASE_EOB_CHROMA_32_Q3: [[u16; 4]; 4] = [
3321 [28482, 31505, 32768, 0],
3322 [32152, 32701, 32768, 0],
3323 [31732, 32598, 32768, 0],
3324 [31767, 32712, 32768, 0],
3325];
3326
3327#[cfg(test)]
3328mod tests {
3329 use super::*;
3330
3331 /// Every row of a CDF table is non-decreasing and ends with the
3332 /// alphabet's total (`32768`) followed by the adaptation counter (`0`),
3333 /// which is the shape [`crate::msac`] expects to read.
3334 fn assert_row_shape(row: &[u16]) {
3335 assert_eq!(row[row.len() - 2], 32768, "row does not total 32768");
3336 assert_eq!(row[row.len() - 1], 0, "row's adaptation counter is not 0");
3337 for w in row[..row.len() - 1].windows(2) {
3338 assert!(w[0] <= w[1], "row is not non-decreasing: {row:?}");
3339 }
3340 }
3341
3342 #[test]
3343 fn inter_frame_tables_are_well_formed_cdfs() {
3344 for row in INTRA_INTER {
3345 assert_row_shape(&row);
3346 }
3347 for ctx in SINGLE_REF {
3348 for row in ctx {
3349 assert_row_shape(&row);
3350 }
3351 }
3352 for row in Y_MODE {
3353 assert_row_shape(&row);
3354 }
3355 for row in NEW_MV {
3356 assert_row_shape(&row);
3357 }
3358 for row in ZERO_MV {
3359 assert_row_shape(&row);
3360 }
3361 for row in REF_MV {
3362 assert_row_shape(&row);
3363 }
3364 for row in DRL_MODE {
3365 assert_row_shape(&row);
3366 }
3367 assert_row_shape(&MV_JOINT);
3368 assert_row_shape(&MV_CLASS);
3369 assert_row_shape(&MV_CLASS0_BIT);
3370 for row in MV_CLASS0_FR {
3371 assert_row_shape(&row);
3372 }
3373 assert_row_shape(&MV_CLASS0_HP);
3374 for row in MV_BIT {
3375 assert_row_shape(&row);
3376 }
3377 assert_row_shape(&MV_FR);
3378 assert_row_shape(&MV_HP);
3379 assert_row_shape(&MV_SIGN);
3380 }
3381
3382 /// Each table's row length matches the spec's symbol count for that
3383 /// syntax element: two entries (total, counter) plus one fewer than the
3384 /// alphabet.
3385 #[test]
3386 fn inter_frame_tables_have_the_spec_alphabet_size() {
3387 assert_eq!(INTRA_INTER[0].len(), 2 + 1); // binary
3388 assert_eq!(SINGLE_REF[0][0].len(), 2 + 1); // binary
3389 assert_eq!(Y_MODE[0].len(), 2 + 13 - 1); // 13 luma intra modes
3390 assert_eq!(NEW_MV[0].len(), 2 + 1);
3391 assert_eq!(ZERO_MV[0].len(), 2 + 1);
3392 assert_eq!(REF_MV[0].len(), 2 + 1);
3393 assert_eq!(DRL_MODE[0].len(), 2 + 1);
3394 assert_eq!(MV_JOINT.len(), 2 + 3); // MV_JOINTS = 4
3395 assert_eq!(MV_CLASS.len(), 2 + 10); // MV_CLASSES = 11
3396 assert_eq!(MV_CLASS0_BIT.len(), 2 + 1);
3397 assert_eq!(MV_CLASS0_FR[0].len(), 2 + 3); // 4-way fraction
3398 assert_eq!(MV_CLASS0_HP.len(), 2 + 1);
3399 assert_eq!(MV_BIT[0].len(), 2 + 1);
3400 assert_eq!(MV_FR.len(), 2 + 3);
3401 assert_eq!(MV_HP.len(), 2 + 1);
3402 assert_eq!(MV_SIGN.len(), 2 + 1);
3403 }
3404}
3405
3406// TX_8X8/TX_4X4 tables (lane-av1-rect): the 8x8 luma and 4x4 chroma coefficient
3407// coding CDFs, extracted byte-exact from libaom's Default_*_Cdf tables, needed
3408// to let a key frame's straddling 16x16 quadrant split down to an 8x8 leaf.
3409
3410/// TXB_SKIP_LUMA_8_Q0, q-context 0: the same table as [`TXB_SKIP_LUMA_8`], for `base_q_idx` 0..=20.
3411pub const TXB_SKIP_LUMA_8_Q0: [u16; 3] = [31548, 32768, 0];
3412
3413/// TXB_SKIP_LUMA_8_Q1, q-context 1: the same table as [`TXB_SKIP_LUMA_8`], for `base_q_idx` 21..=60.
3414pub const TXB_SKIP_LUMA_8_Q1: [u16; 3] = [31782, 32768, 0];
3415
3416/// the all-zero flag of an 8x8 luma transform, whose only context is zero because the transform covers its whole block.
3417pub const TXB_SKIP_LUMA_8: [u16; 3] = [31957, 32768, 0];
3418
3419/// TXB_SKIP_LUMA_8_Q3, q-context 3: the same table as [`TXB_SKIP_LUMA_8`], for `base_q_idx` 121..=255.
3420pub const TXB_SKIP_LUMA_8_Q3: [u16; 3] = [31903, 32768, 0];
3421
3422/// TXB_SKIP_CHROMA_4_Q0, q-context 0: the same table as [`TXB_SKIP_CHROMA_4`], for `base_q_idx` 0..=20.
3423pub const TXB_SKIP_CHROMA_4_Q0: [[u16; 3]; 3] =
3424 [[7654, 32768, 0], [19473, 32768, 0], [29984, 32768, 0]];
3425
3426/// TXB_SKIP_CHROMA_4_Q1, q-context 1: the same table as [`TXB_SKIP_CHROMA_4`], for `base_q_idx` 21..=60.
3427pub const TXB_SKIP_CHROMA_4_Q1: [[u16; 3]; 3] =
3428 [[5495, 32768, 0], [17942, 32768, 0], [28280, 32768, 0]];
3429
3430/// the all-zero flag of a 4x4 chroma transform.
3431pub const TXB_SKIP_CHROMA_4: [[u16; 3]; 3] =
3432 [[4119, 32768, 0], [16026, 32768, 0], [25657, 32768, 0]];
3433
3434/// TXB_SKIP_CHROMA_4_Q3, q-context 3: the same table as [`TXB_SKIP_CHROMA_4`], for `base_q_idx` 121..=255.
3435pub const TXB_SKIP_CHROMA_4_Q3: [[u16; 3]; 3] =
3436 [[2713, 32768, 0], [11861, 32768, 0], [20773, 32768, 0]];
3437
3438/// EOB_PT_64_LUMA_Q0, q-context 0: the same table as [`EOB_PT_64_LUMA`], for `base_q_idx` 0..=20.
3439pub const EOB_PT_64_LUMA_Q0: [u16; 8] = [329, 498, 1101, 1784, 3265, 7758, 32768, 0];
3440
3441/// EOB_PT_64_LUMA_Q1, q-context 1: the same table as [`EOB_PT_64_LUMA`], for `base_q_idx` 21..=60.
3442pub const EOB_PT_64_LUMA_Q1: [u16; 8] = [1260, 1446, 2253, 3712, 6652, 13369, 32768, 0];
3443
3444/// the end-of-block group of an 8x8 luma transform.
3445pub const EOB_PT_64_LUMA: [u16; 8] = [2374, 2772, 4583, 7276, 12288, 19706, 32768, 0];
3446
3447/// EOB_PT_64_LUMA_Q3, q-context 3: the same table as [`EOB_PT_64_LUMA`], for `base_q_idx` 121..=255.
3448pub const EOB_PT_64_LUMA_Q3: [u16; 8] = [6307, 7541, 12060, 16358, 22553, 27865, 32768, 0];
3449
3450/// The `EOB_PT_64_LUMA` sibling of [`EOB_PT_16_LUMA_CLASS1`]
3451/// (`av1_default_eob_multi64_cdfs[q][0][1]`), for an 8x8 luma TU whose
3452/// `tx_type` resolves `V_DCT`/`H_DCT`.
3453pub const EOB_PT_64_LUMA_CLASS1_Q0: [u16; 8] = [335, 730, 1459, 5494, 8755, 12997, 32768, 0];
3454pub const EOB_PT_64_LUMA_CLASS1_Q1: [u16; 8] = [401, 605, 1029, 2563, 5845, 12626, 32768, 0];
3455pub const EOB_PT_64_LUMA_CLASS1: [u16; 8] = [497, 810, 1315, 3000, 7004, 15641, 32768, 0];
3456pub const EOB_PT_64_LUMA_CLASS1_Q3: [u16; 8] = [1289, 2320, 3971, 7926, 14153, 24291, 32768, 0];
3457
3458/// EOB_PT_16_CHROMA_Q0, q-context 0: the same table as [`EOB_PT_16_CHROMA`], for `base_q_idx` 0..=20.
3459pub const EOB_PT_16_CHROMA_Q0: [u16; 6] = [3247, 4950, 9688, 14563, 32768, 0];
3460
3461/// EOB_PT_16_CHROMA_Q1, q-context 1: the same table as [`EOB_PT_16_CHROMA`], for `base_q_idx` 21..=60.
3462pub const EOB_PT_16_CHROMA_Q1: [u16; 6] = [7637, 9498, 14259, 19108, 32768, 0];
3463
3464/// the end-of-block group of a 4x4 chroma transform.
3465pub const EOB_PT_16_CHROMA: [u16; 6] = [11139, 13270, 18241, 23566, 32768, 0];
3466
3467/// EOB_PT_16_CHROMA_Q3, q-context 3: the same table as [`EOB_PT_16_CHROMA`], for `base_q_idx` 121..=255.
3468pub const EOB_PT_16_CHROMA_Q3: [u16; 6] = [19575, 21766, 26044, 29709, 32768, 0];
3469
3470/// EOB_EXTRA_LUMA_8_Q0, q-context 0: the same table as [`EOB_EXTRA_LUMA_8`], for `base_q_idx` 0..=20.
3471pub const EOB_EXTRA_LUMA_8_Q0: [[u16; 3]; 9] = [
3472 [20401, 32768, 0],
3473 [17025, 32768, 0],
3474 [12845, 32768, 0],
3475 [12873, 32768, 0],
3476 [14094, 32768, 0],
3477 [16384, 32768, 0],
3478 [16384, 32768, 0],
3479 [16384, 32768, 0],
3480 [16384, 32768, 0],
3481];
3482
3483/// EOB_EXTRA_LUMA_8_Q1, q-context 1: the same table as [`EOB_EXTRA_LUMA_8`], for `base_q_idx` 21..=60.
3484pub const EOB_EXTRA_LUMA_8_Q1: [[u16; 3]; 9] = [
3485 [20430, 32768, 0],
3486 [20662, 32768, 0],
3487 [15367, 32768, 0],
3488 [16970, 32768, 0],
3489 [14657, 32768, 0],
3490 [16384, 32768, 0],
3491 [16384, 32768, 0],
3492 [16384, 32768, 0],
3493 [16384, 32768, 0],
3494];
3495
3496/// the top offset bit inside an 8x8 luma transform's end-of-block group.
3497pub const EOB_EXTRA_LUMA_8: [[u16; 3]; 9] = [
3498 [19139, 32768, 0],
3499 [21487, 32768, 0],
3500 [18959, 32768, 0],
3501 [20910, 32768, 0],
3502 [19089, 32768, 0],
3503 [16384, 32768, 0],
3504 [16384, 32768, 0],
3505 [16384, 32768, 0],
3506 [16384, 32768, 0],
3507];
3508
3509/// EOB_EXTRA_LUMA_8_Q3, q-context 3: the same table as [`EOB_EXTRA_LUMA_8`], for `base_q_idx` 121..=255.
3510pub const EOB_EXTRA_LUMA_8_Q3: [[u16; 3]; 9] = [
3511 [20238, 32768, 0],
3512 [21057, 32768, 0],
3513 [19159, 32768, 0],
3514 [22337, 32768, 0],
3515 [20159, 32768, 0],
3516 [16384, 32768, 0],
3517 [16384, 32768, 0],
3518 [16384, 32768, 0],
3519 [16384, 32768, 0],
3520];
3521
3522/// EOB_EXTRA_CHROMA_4_Q0, q-context 0: the same table as [`EOB_EXTRA_CHROMA_4`], for `base_q_idx` 0..=20.
3523pub const EOB_EXTRA_CHROMA_4_Q0: [[u16; 3]; 9] = [
3524 [19069, 32768, 0],
3525 [22525, 32768, 0],
3526 [13377, 32768, 0],
3527 [16384, 32768, 0],
3528 [16384, 32768, 0],
3529 [16384, 32768, 0],
3530 [16384, 32768, 0],
3531 [16384, 32768, 0],
3532 [16384, 32768, 0],
3533];
3534
3535/// EOB_EXTRA_CHROMA_4_Q1, q-context 1: the same table as [`EOB_EXTRA_CHROMA_4`], for `base_q_idx` 21..=60.
3536pub const EOB_EXTRA_CHROMA_4_Q1: [[u16; 3]; 9] = [
3537 [20335, 32768, 0],
3538 [21667, 32768, 0],
3539 [14818, 32768, 0],
3540 [16384, 32768, 0],
3541 [16384, 32768, 0],
3542 [16384, 32768, 0],
3543 [16384, 32768, 0],
3544 [16384, 32768, 0],
3545 [16384, 32768, 0],
3546];
3547
3548/// the same, for a 4x4 chroma transform.
3549pub const EOB_EXTRA_CHROMA_4: [[u16; 3]; 9] = [
3550 [20090, 32768, 0],
3551 [19444, 32768, 0],
3552 [17286, 32768, 0],
3553 [16384, 32768, 0],
3554 [16384, 32768, 0],
3555 [16384, 32768, 0],
3556 [16384, 32768, 0],
3557 [16384, 32768, 0],
3558 [16384, 32768, 0],
3559];
3560
3561/// EOB_EXTRA_CHROMA_4_Q3, q-context 3: the same table as [`EOB_EXTRA_CHROMA_4`], for `base_q_idx` 121..=255.
3562pub const EOB_EXTRA_CHROMA_4_Q3: [[u16; 3]; 9] = [
3563 [21416, 32768, 0],
3564 [20855, 32768, 0],
3565 [23410, 32768, 0],
3566 [16384, 32768, 0],
3567 [16384, 32768, 0],
3568 [16384, 32768, 0],
3569 [16384, 32768, 0],
3570 [16384, 32768, 0],
3571 [16384, 32768, 0],
3572];
3573
3574/// COEFF_BASE_LUMA_8_Q0, q-context 0: the same table as [`COEFF_BASE_LUMA_8`], for `base_q_idx` 0..=20.
3575pub const COEFF_BASE_LUMA_8_Q0: [[u16; 5]; 42] = [
3576 [4536, 10072, 14001, 32768, 0],
3577 [25459, 31416, 32206, 32768, 0],
3578 [16605, 28048, 30818, 32768, 0],
3579 [11008, 22857, 27719, 32768, 0],
3580 [6915, 16268, 22315, 32768, 0],
3581 [2625, 6812, 10537, 32768, 0],
3582 [24257, 31788, 32499, 32768, 0],
3583 [16880, 29454, 31879, 32768, 0],
3584 [11958, 25054, 29778, 32768, 0],
3585 [7916, 18718, 25084, 32768, 0],
3586 [3383, 8777, 13446, 32768, 0],
3587 [22720, 31603, 32393, 32768, 0],
3588 [14960, 28125, 31335, 32768, 0],
3589 [9731, 22210, 27928, 32768, 0],
3590 [6304, 15832, 22277, 32768, 0],
3591 [2910, 7818, 12166, 32768, 0],
3592 [20375, 30627, 32131, 32768, 0],
3593 [13904, 27284, 30887, 32768, 0],
3594 [9368, 21558, 27144, 32768, 0],
3595 [5937, 14966, 21119, 32768, 0],
3596 [2667, 7225, 11319, 32768, 0],
3597 [23970, 31470, 32378, 32768, 0],
3598 [17173, 29734, 32018, 32768, 0],
3599 [12795, 25441, 29965, 32768, 0],
3600 [8981, 19680, 25893, 32768, 0],
3601 [4728, 11372, 16902, 32768, 0],
3602 [24287, 31797, 32439, 32768, 0],
3603 [16703, 29145, 31696, 32768, 0],
3604 [10833, 23554, 28725, 32768, 0],
3605 [6468, 16566, 23057, 32768, 0],
3606 [2415, 6562, 10278, 32768, 0],
3607 [26610, 32395, 32659, 32768, 0],
3608 [18590, 30498, 32117, 32768, 0],
3609 [12420, 25756, 29950, 32768, 0],
3610 [7639, 18746, 24710, 32768, 0],
3611 [3001, 8086, 12347, 32768, 0],
3612 [25076, 32064, 32580, 32768, 0],
3613 [17946, 30128, 32028, 32768, 0],
3614 [12024, 24985, 29378, 32768, 0],
3615 [7517, 18390, 24304, 32768, 0],
3616 [3243, 8781, 13331, 32768, 0],
3617 [8192, 16384, 24576, 32768, 0],
3618];
3619
3620/// COEFF_BASE_LUMA_8_Q1, q-context 1: the same table as [`COEFF_BASE_LUMA_8`], for `base_q_idx` 21..=60.
3621pub const COEFF_BASE_LUMA_8_Q1: [[u16; 5]; 42] = [
3622 [6779, 13743, 17678, 32768, 0],
3623 [24806, 31797, 32457, 32768, 0],
3624 [17616, 29047, 31372, 32768, 0],
3625 [11063, 23175, 28003, 32768, 0],
3626 [6521, 16110, 22324, 32768, 0],
3627 [2764, 7504, 11654, 32768, 0],
3628 [25266, 32367, 32637, 32768, 0],
3629 [19054, 30553, 32175, 32768, 0],
3630 [12139, 25212, 29807, 32768, 0],
3631 [7311, 18162, 24704, 32768, 0],
3632 [3397, 9164, 14074, 32768, 0],
3633 [25988, 32208, 32522, 32768, 0],
3634 [16253, 28912, 31526, 32768, 0],
3635 [9151, 21387, 27372, 32768, 0],
3636 [5688, 14915, 21496, 32768, 0],
3637 [2717, 7627, 12004, 32768, 0],
3638 [23144, 31855, 32443, 32768, 0],
3639 [16070, 28491, 31325, 32768, 0],
3640 [8702, 20467, 26517, 32768, 0],
3641 [5243, 13956, 20367, 32768, 0],
3642 [2621, 7335, 11567, 32768, 0],
3643 [26636, 32340, 32630, 32768, 0],
3644 [19990, 31050, 32341, 32768, 0],
3645 [13243, 26105, 30315, 32768, 0],
3646 [8588, 19521, 25918, 32768, 0],
3647 [4717, 11585, 17304, 32768, 0],
3648 [25844, 32292, 32582, 32768, 0],
3649 [19090, 30635, 32097, 32768, 0],
3650 [11963, 24546, 28939, 32768, 0],
3651 [6218, 16087, 22354, 32768, 0],
3652 [2340, 6608, 10426, 32768, 0],
3653 [28046, 32576, 32694, 32768, 0],
3654 [21178, 31313, 32296, 32768, 0],
3655 [13486, 26184, 29870, 32768, 0],
3656 [7149, 17871, 23723, 32768, 0],
3657 [2833, 7958, 12259, 32768, 0],
3658 [27710, 32528, 32686, 32768, 0],
3659 [20674, 31076, 32268, 32768, 0],
3660 [12413, 24955, 29243, 32768, 0],
3661 [6676, 16927, 23097, 32768, 0],
3662 [2966, 8333, 12919, 32768, 0],
3663 [8192, 16384, 24576, 32768, 0],
3664];
3665
3666/// an 8x8 luma coefficient's base level.
3667pub const COEFF_BASE_LUMA_8: [[u16; 5]; 42] = [
3668 [9704, 17294, 21132, 32768, 0],
3669 [26762, 32278, 32633, 32768, 0],
3670 [18382, 29620, 31819, 32768, 0],
3671 [10891, 23475, 28723, 32768, 0],
3672 [6358, 16583, 23309, 32768, 0],
3673 [3248, 9118, 14141, 32768, 0],
3674 [27204, 32573, 32699, 32768, 0],
3675 [19818, 30824, 32329, 32768, 0],
3676 [11772, 25120, 30041, 32768, 0],
3677 [6995, 18033, 25039, 32768, 0],
3678 [3752, 10442, 16098, 32768, 0],
3679 [27222, 32256, 32559, 32768, 0],
3680 [15356, 28399, 31475, 32768, 0],
3681 [8821, 20635, 27057, 32768, 0],
3682 [5511, 14404, 21239, 32768, 0],
3683 [2935, 8222, 13051, 32768, 0],
3684 [24875, 32120, 32529, 32768, 0],
3685 [15233, 28265, 31445, 32768, 0],
3686 [8605, 20570, 26932, 32768, 0],
3687 [5431, 14413, 21196, 32768, 0],
3688 [2994, 8341, 13223, 32768, 0],
3689 [28201, 32604, 32700, 32768, 0],
3690 [21041, 31446, 32456, 32768, 0],
3691 [13221, 26213, 30475, 32768, 0],
3692 [8255, 19385, 26037, 32768, 0],
3693 [4930, 12585, 18830, 32768, 0],
3694 [28768, 32448, 32627, 32768, 0],
3695 [19705, 30561, 32021, 32768, 0],
3696 [11572, 23589, 28220, 32768, 0],
3697 [5532, 15034, 21446, 32768, 0],
3698 [2460, 7150, 11456, 32768, 0],
3699 [29874, 32619, 32699, 32768, 0],
3700 [21621, 31071, 32201, 32768, 0],
3701 [12511, 24747, 28992, 32768, 0],
3702 [6281, 16395, 22748, 32768, 0],
3703 [3246, 9278, 14497, 32768, 0],
3704 [29715, 32625, 32712, 32768, 0],
3705 [20958, 31011, 32283, 32768, 0],
3706 [11233, 23671, 28806, 32768, 0],
3707 [6012, 16128, 22868, 32768, 0],
3708 [3427, 9851, 15414, 32768, 0],
3709 [8192, 16384, 24576, 32768, 0],
3710];
3711
3712/// COEFF_BASE_LUMA_8_Q3, q-context 3: the same table as [`COEFF_BASE_LUMA_8`], for `base_q_idx` 121..=255.
3713pub const COEFF_BASE_LUMA_8_Q3: [[u16; 5]; 42] = [
3714 [7754, 16948, 22142, 32768, 0],
3715 [25670, 32330, 32691, 32768, 0],
3716 [15663, 29225, 31994, 32768, 0],
3717 [9878, 23288, 29158, 32768, 0],
3718 [6419, 17088, 24336, 32768, 0],
3719 [3859, 11003, 17039, 32768, 0],
3720 [27562, 32595, 32725, 32768, 0],
3721 [17575, 30588, 32399, 32768, 0],
3722 [10819, 24838, 30309, 32768, 0],
3723 [7124, 18686, 25916, 32768, 0],
3724 [4479, 12688, 19340, 32768, 0],
3725 [28385, 32476, 32673, 32768, 0],
3726 [15306, 29005, 31938, 32768, 0],
3727 [8937, 21615, 28322, 32768, 0],
3728 [5982, 15603, 22786, 32768, 0],
3729 [3620, 10267, 16136, 32768, 0],
3730 [27280, 32464, 32667, 32768, 0],
3731 [15607, 29160, 32004, 32768, 0],
3732 [9091, 22135, 28740, 32768, 0],
3733 [6232, 16632, 24020, 32768, 0],
3734 [4047, 11377, 17672, 32768, 0],
3735 [29220, 32630, 32718, 32768, 0],
3736 [19650, 31220, 32462, 32768, 0],
3737 [13050, 26312, 30827, 32768, 0],
3738 [9228, 20870, 27468, 32768, 0],
3739 [6146, 15149, 21971, 32768, 0],
3740 [30169, 32481, 32623, 32768, 0],
3741 [17212, 29311, 31554, 32768, 0],
3742 [9911, 21311, 26882, 32768, 0],
3743 [4487, 13314, 20372, 32768, 0],
3744 [2570, 7772, 12889, 32768, 0],
3745 [30924, 32613, 32708, 32768, 0],
3746 [19490, 30206, 32107, 32768, 0],
3747 [11232, 23998, 29276, 32768, 0],
3748 [6769, 17955, 25035, 32768, 0],
3749 [4398, 12623, 19214, 32768, 0],
3750 [30609, 32627, 32722, 32768, 0],
3751 [19370, 30582, 32287, 32768, 0],
3752 [10457, 23619, 29409, 32768, 0],
3753 [6443, 17637, 24834, 32768, 0],
3754 [4645, 13236, 20106, 32768, 0],
3755 [8192, 16384, 24576, 32768, 0],
3756];
3757
3758/// COEFF_BASE_CHROMA_4_Q0, q-context 0: the same table as [`COEFF_BASE_CHROMA_4`], for `base_q_idx` 0..=20.
3759pub const COEFF_BASE_CHROMA_4_Q0: [[u16; 5]; 42] = [
3760 [6302, 16444, 21761, 32768, 0],
3761 [23040, 31538, 32475, 32768, 0],
3762 [15196, 28452, 31496, 32768, 0],
3763 [10020, 22946, 28514, 32768, 0],
3764 [6533, 16862, 23501, 32768, 0],
3765 [3538, 9816, 15076, 32768, 0],
3766 [24444, 31875, 32525, 32768, 0],
3767 [15881, 28924, 31635, 32768, 0],
3768 [9922, 22873, 28466, 32768, 0],
3769 [6527, 16966, 23691, 32768, 0],
3770 [4114, 11303, 17220, 32768, 0],
3771 [8192, 16384, 24576, 32768, 0],
3772 [8192, 16384, 24576, 32768, 0],
3773 [8192, 16384, 24576, 32768, 0],
3774 [8192, 16384, 24576, 32768, 0],
3775 [8192, 16384, 24576, 32768, 0],
3776 [8192, 16384, 24576, 32768, 0],
3777 [8192, 16384, 24576, 32768, 0],
3778 [8192, 16384, 24576, 32768, 0],
3779 [8192, 16384, 24576, 32768, 0],
3780 [8192, 16384, 24576, 32768, 0],
3781 [20201, 30770, 32209, 32768, 0],
3782 [14754, 28071, 31258, 32768, 0],
3783 [8378, 20186, 26517, 32768, 0],
3784 [5916, 15299, 21978, 32768, 0],
3785 [4268, 11583, 17901, 32768, 0],
3786 [24361, 32025, 32581, 32768, 0],
3787 [18673, 30105, 31943, 32768, 0],
3788 [10196, 22244, 27576, 32768, 0],
3789 [5495, 14349, 20417, 32768, 0],
3790 [2676, 7415, 11498, 32768, 0],
3791 [24678, 31958, 32585, 32768, 0],
3792 [18629, 29906, 31831, 32768, 0],
3793 [9364, 20724, 26315, 32768, 0],
3794 [4641, 12318, 18094, 32768, 0],
3795 [2758, 7387, 11579, 32768, 0],
3796 [25433, 31842, 32469, 32768, 0],
3797 [18795, 29289, 31411, 32768, 0],
3798 [7644, 17584, 23592, 32768, 0],
3799 [3408, 9014, 15047, 32768, 0],
3800 [8192, 16384, 24576, 32768, 0],
3801 [8192, 16384, 24576, 32768, 0],
3802];
3803
3804/// COEFF_BASE_CHROMA_4_Q1, q-context 1: the same table as [`COEFF_BASE_CHROMA_4`], for `base_q_idx` 21..=60.
3805pub const COEFF_BASE_CHROMA_4_Q1: [[u16; 5]; 42] = [
3806 [8455, 19003, 24368, 32768, 0],
3807 [23563, 32021, 32604, 32768, 0],
3808 [16237, 29446, 31935, 32768, 0],
3809 [10724, 23999, 29358, 32768, 0],
3810 [6725, 17528, 24416, 32768, 0],
3811 [3927, 10927, 16825, 32768, 0],
3812 [26313, 32288, 32634, 32768, 0],
3813 [17430, 30095, 32095, 32768, 0],
3814 [11116, 24606, 29679, 32768, 0],
3815 [7195, 18384, 25269, 32768, 0],
3816 [4726, 12852, 19315, 32768, 0],
3817 [8192, 16384, 24576, 32768, 0],
3818 [8192, 16384, 24576, 32768, 0],
3819 [8192, 16384, 24576, 32768, 0],
3820 [8192, 16384, 24576, 32768, 0],
3821 [8192, 16384, 24576, 32768, 0],
3822 [8192, 16384, 24576, 32768, 0],
3823 [8192, 16384, 24576, 32768, 0],
3824 [8192, 16384, 24576, 32768, 0],
3825 [8192, 16384, 24576, 32768, 0],
3826 [8192, 16384, 24576, 32768, 0],
3827 [22822, 31648, 32483, 32768, 0],
3828 [16724, 29633, 31929, 32768, 0],
3829 [10261, 23033, 28725, 32768, 0],
3830 [7029, 17840, 24528, 32768, 0],
3831 [4867, 13886, 21502, 32768, 0],
3832 [25298, 31892, 32491, 32768, 0],
3833 [17809, 29330, 31512, 32768, 0],
3834 [9668, 21329, 26579, 32768, 0],
3835 [4774, 12956, 18976, 32768, 0],
3836 [2322, 7030, 11540, 32768, 0],
3837 [25472, 31920, 32543, 32768, 0],
3838 [17957, 29387, 31632, 32768, 0],
3839 [9196, 20593, 26400, 32768, 0],
3840 [4680, 12705, 19202, 32768, 0],
3841 [2917, 8456, 13436, 32768, 0],
3842 [26471, 32059, 32574, 32768, 0],
3843 [18458, 29783, 31909, 32768, 0],
3844 [8400, 19464, 25956, 32768, 0],
3845 [3812, 10973, 17206, 32768, 0],
3846 [8192, 16384, 24576, 32768, 0],
3847 [8192, 16384, 24576, 32768, 0],
3848];
3849
3850/// a 4x4 chroma coefficient's base level.
3851pub const COEFF_BASE_CHROMA_4: [[u16; 5]; 42] = [
3852 [10808, 22056, 26896, 32768, 0],
3853 [25739, 32313, 32676, 32768, 0],
3854 [17288, 30203, 32221, 32768, 0],
3855 [11359, 24878, 29896, 32768, 0],
3856 [6949, 17767, 24893, 32768, 0],
3857 [4287, 11796, 18071, 32768, 0],
3858 [27880, 32521, 32705, 32768, 0],
3859 [19038, 31004, 32414, 32768, 0],
3860 [12564, 26345, 30768, 32768, 0],
3861 [8269, 19947, 26779, 32768, 0],
3862 [5674, 14657, 21674, 32768, 0],
3863 [8192, 16384, 24576, 32768, 0],
3864 [8192, 16384, 24576, 32768, 0],
3865 [8192, 16384, 24576, 32768, 0],
3866 [8192, 16384, 24576, 32768, 0],
3867 [8192, 16384, 24576, 32768, 0],
3868 [8192, 16384, 24576, 32768, 0],
3869 [8192, 16384, 24576, 32768, 0],
3870 [8192, 16384, 24576, 32768, 0],
3871 [8192, 16384, 24576, 32768, 0],
3872 [8192, 16384, 24576, 32768, 0],
3873 [25742, 32319, 32671, 32768, 0],
3874 [19557, 31164, 32454, 32768, 0],
3875 [13381, 26381, 30755, 32768, 0],
3876 [10101, 21466, 26722, 32768, 0],
3877 [9209, 19650, 26825, 32768, 0],
3878 [27107, 31917, 32432, 32768, 0],
3879 [18056, 28893, 31203, 32768, 0],
3880 [10200, 21434, 26764, 32768, 0],
3881 [4660, 12913, 19502, 32768, 0],
3882 [2368, 6930, 12504, 32768, 0],
3883 [26960, 32158, 32613, 32768, 0],
3884 [18628, 30005, 32031, 32768, 0],
3885 [10233, 22442, 28232, 32768, 0],
3886 [5471, 14630, 21516, 32768, 0],
3887 [3235, 10767, 17109, 32768, 0],
3888 [27696, 32440, 32692, 32768, 0],
3889 [20032, 31167, 32438, 32768, 0],
3890 [8700, 21341, 28442, 32768, 0],
3891 [5662, 14831, 21795, 32768, 0],
3892 [8192, 16384, 24576, 32768, 0],
3893 [8192, 16384, 24576, 32768, 0],
3894];
3895
3896/// COEFF_BASE_CHROMA_4_Q3, q-context 3: the same table as [`COEFF_BASE_CHROMA_4`], for `base_q_idx` 121..=255.
3897pub const COEFF_BASE_CHROMA_4_Q3: [[u16; 5]; 42] = [
3898 [9320, 22102, 27840, 32768, 0],
3899 [27057, 32464, 32724, 32768, 0],
3900 [16331, 30268, 32309, 32768, 0],
3901 [10319, 23935, 29720, 32768, 0],
3902 [6189, 16448, 24106, 32768, 0],
3903 [3589, 10884, 18808, 32768, 0],
3904 [29026, 32624, 32748, 32768, 0],
3905 [19226, 31507, 32587, 32768, 0],
3906 [12692, 26921, 31203, 32768, 0],
3907 [7049, 19532, 27635, 32768, 0],
3908 [7727, 15669, 23252, 32768, 0],
3909 [8192, 16384, 24576, 32768, 0],
3910 [8192, 16384, 24576, 32768, 0],
3911 [8192, 16384, 24576, 32768, 0],
3912 [8192, 16384, 24576, 32768, 0],
3913 [8192, 16384, 24576, 32768, 0],
3914 [8192, 16384, 24576, 32768, 0],
3915 [8192, 16384, 24576, 32768, 0],
3916 [8192, 16384, 24576, 32768, 0],
3917 [8192, 16384, 24576, 32768, 0],
3918 [8192, 16384, 24576, 32768, 0],
3919 [28056, 32625, 32748, 32768, 0],
3920 [22383, 32075, 32669, 32768, 0],
3921 [15417, 27098, 31749, 32768, 0],
3922 [18127, 26493, 27190, 32768, 0],
3923 [5461, 16384, 21845, 32768, 0],
3924 [27982, 32091, 32584, 32768, 0],
3925 [19045, 29868, 31972, 32768, 0],
3926 [10397, 22266, 27932, 32768, 0],
3927 [5990, 13697, 21500, 32768, 0],
3928 [1792, 6912, 15104, 32768, 0],
3929 [28198, 32501, 32718, 32768, 0],
3930 [21534, 31521, 32569, 32768, 0],
3931 [11109, 25217, 30017, 32768, 0],
3932 [5671, 15124, 26151, 32768, 0],
3933 [4681, 14043, 18725, 32768, 0],
3934 [28688, 32580, 32741, 32768, 0],
3935 [22576, 32079, 32661, 32768, 0],
3936 [10627, 22141, 28340, 32768, 0],
3937 [9362, 14043, 28087, 32768, 0],
3938 [8192, 16384, 24576, 32768, 0],
3939 [8192, 16384, 24576, 32768, 0],
3940];
3941
3942/// COEFF_BASE_EOB_LUMA_8_Q0, q-context 0: the same table as [`COEFF_BASE_EOB_LUMA_8`], for `base_q_idx` 0..=20.
3943pub const COEFF_BASE_EOB_LUMA_8_Q0: [[u16; 4]; 4] = [
3944 [5717, 26477, 32768, 0],
3945 [30491, 31703, 32768, 0],
3946 [31550, 32158, 32768, 0],
3947 [29648, 31491, 32768, 0],
3948];
3949
3950/// COEFF_BASE_EOB_LUMA_8_Q1, q-context 1: the same table as [`COEFF_BASE_EOB_LUMA_8`], for `base_q_idx` 21..=60.
3951pub const COEFF_BASE_EOB_LUMA_8_Q1: [[u16; 4]; 4] = [
3952 [15239, 29932, 32768, 0],
3953 [31315, 32095, 32768, 0],
3954 [32130, 32434, 32768, 0],
3955 [30864, 31996, 32768, 0],
3956];
3957
3958/// the last coefficient's base level, for an 8x8 luma transform.
3959pub const COEFF_BASE_EOB_LUMA_8: [[u16; 4]; 4] = [
3960 [18049, 30489, 32768, 0],
3961 [31706, 32286, 32768, 0],
3962 [32163, 32473, 32768, 0],
3963 [31550, 32184, 32768, 0],
3964];
3965
3966/// COEFF_BASE_EOB_LUMA_8_Q3, q-context 3: the same table as [`COEFF_BASE_EOB_LUMA_8`], for `base_q_idx` 121..=255.
3967pub const COEFF_BASE_EOB_LUMA_8_Q3: [[u16; 4]; 4] = [
3968 [21457, 31043, 32768, 0],
3969 [31951, 32483, 32768, 0],
3970 [32153, 32562, 32768, 0],
3971 [31473, 32215, 32768, 0],
3972];
3973
3974/// COEFF_BASE_EOB_CHROMA_4_Q0, q-context 0: the same table as [`COEFF_BASE_EOB_CHROMA_4`], for `base_q_idx` 0..=20.
3975pub const COEFF_BASE_EOB_CHROMA_4_Q0: [[u16; 4]; 4] = [
3976 [21365, 30026, 32768, 0],
3977 [30512, 32423, 32768, 0],
3978 [31658, 32621, 32768, 0],
3979 [29630, 31881, 32768, 0],
3980];
3981
3982/// COEFF_BASE_EOB_CHROMA_4_Q1, q-context 1: the same table as [`COEFF_BASE_EOB_CHROMA_4`], for `base_q_idx` 21..=60.
3983pub const COEFF_BASE_EOB_CHROMA_4_Q1: [[u16; 4]; 4] = [
3984 [26594, 31212, 32768, 0],
3985 [31208, 32582, 32768, 0],
3986 [31835, 32637, 32768, 0],
3987 [30595, 32206, 32768, 0],
3988];
3989
3990/// the same, for a 4x4 chroma transform.
3991pub const COEFF_BASE_EOB_CHROMA_4: [[u16; 4]; 4] = [
3992 [27258, 31095, 32768, 0],
3993 [31804, 32623, 32768, 0],
3994 [31763, 32528, 32768, 0],
3995 [31438, 32506, 32768, 0],
3996];
3997
3998/// COEFF_BASE_EOB_CHROMA_4_Q3, q-context 3: the same table as [`COEFF_BASE_EOB_CHROMA_4`], for `base_q_idx` 121..=255.
3999pub const COEFF_BASE_EOB_CHROMA_4_Q3: [[u16; 4]; 4] = [
4000 [27877, 31584, 32768, 0],
4001 [32170, 32728, 32768, 0],
4002 [32155, 32688, 32768, 0],
4003 [32219, 32702, 32768, 0],
4004];
4005
4006/// COEFF_BR_LUMA_8_Q0, q-context 0: the same table as [`COEFF_BR_LUMA_8`], for `base_q_idx` 0..=20.
4007pub const COEFF_BR_LUMA_8_Q0: [[u16; 5]; 21] = [
4008 [14406, 20862, 24414, 32768, 0],
4009 [11824, 18907, 23109, 32768, 0],
4010 [8257, 14393, 18803, 32768, 0],
4011 [5860, 10747, 14778, 32768, 0],
4012 [4475, 8486, 11984, 32768, 0],
4013 [3606, 6954, 10043, 32768, 0],
4014 [1736, 3410, 5048, 32768, 0],
4015 [14430, 20046, 22882, 32768, 0],
4016 [15593, 22899, 26709, 32768, 0],
4017 [12102, 19368, 23811, 32768, 0],
4018 [9059, 15584, 20262, 32768, 0],
4019 [6999, 12603, 17048, 32768, 0],
4020 [5684, 10497, 14553, 32768, 0],
4021 [2822, 5438, 7862, 32768, 0],
4022 [15785, 21585, 24359, 32768, 0],
4023 [18347, 25229, 28266, 32768, 0],
4024 [14974, 22487, 26389, 32768, 0],
4025 [11423, 18681, 23271, 32768, 0],
4026 [8863, 15350, 20008, 32768, 0],
4027 [7153, 12852, 17278, 32768, 0],
4028 [3707, 7036, 9982, 32768, 0],
4029];
4030
4031/// COEFF_BR_LUMA_8_Q1, q-context 1: the same table as [`COEFF_BR_LUMA_8`], for `base_q_idx` 21..=60.
4032pub const COEFF_BR_LUMA_8_Q1: [[u16; 5]; 21] = [
4033 [15999, 22208, 25449, 32768, 0],
4034 [13050, 19988, 24122, 32768, 0],
4035 [8594, 14864, 19378, 32768, 0],
4036 [6033, 11079, 15238, 32768, 0],
4037 [4554, 8683, 12347, 32768, 0],
4038 [3672, 7139, 10337, 32768, 0],
4039 [1900, 3771, 5576, 32768, 0],
4040 [15788, 21340, 23949, 32768, 0],
4041 [16825, 24235, 27758, 32768, 0],
4042 [12873, 20402, 24810, 32768, 0],
4043 [9590, 16363, 21094, 32768, 0],
4044 [7352, 13209, 17733, 32768, 0],
4045 [5960, 10989, 15184, 32768, 0],
4046 [3232, 6234, 9007, 32768, 0],
4047 [15761, 20716, 23224, 32768, 0],
4048 [19318, 25989, 28759, 32768, 0],
4049 [15529, 23094, 26929, 32768, 0],
4050 [11662, 18989, 23641, 32768, 0],
4051 [8955, 15568, 20366, 32768, 0],
4052 [7281, 13106, 17708, 32768, 0],
4053 [4248, 8059, 11440, 32768, 0],
4054];
4055
4056/// the base-range tail of an 8x8 luma coefficient.
4057pub const COEFF_BR_LUMA_8: [[u16; 5]; 21] = [
4058 [16214, 22380, 25770, 32768, 0],
4059 [14213, 21304, 25295, 32768, 0],
4060 [9213, 15823, 20455, 32768, 0],
4061 [6395, 11758, 16139, 32768, 0],
4062 [4779, 9187, 13066, 32768, 0],
4063 [3821, 7501, 10953, 32768, 0],
4064 [2293, 4567, 6795, 32768, 0],
4065 [15859, 21283, 23820, 32768, 0],
4066 [18404, 25602, 28726, 32768, 0],
4067 [14325, 21980, 26206, 32768, 0],
4068 [10669, 17937, 22720, 32768, 0],
4069 [8297, 14642, 19447, 32768, 0],
4070 [6746, 12389, 16893, 32768, 0],
4071 [4324, 8251, 11770, 32768, 0],
4072 [16532, 21631, 24475, 32768, 0],
4073 [20667, 27150, 29668, 32768, 0],
4074 [16728, 24510, 28175, 32768, 0],
4075 [12861, 20645, 25332, 32768, 0],
4076 [10076, 17361, 22417, 32768, 0],
4077 [8395, 14940, 19963, 32768, 0],
4078 [5731, 10683, 14912, 32768, 0],
4079];
4080
4081/// COEFF_BR_LUMA_8_Q3, q-context 3: the same table as [`COEFF_BR_LUMA_8`], for `base_q_idx` 121..=255.
4082pub const COEFF_BR_LUMA_8_Q3: [[u16; 5]; 21] = [
4083 [18274, 24813, 27890, 32768, 0],
4084 [15537, 23149, 27003, 32768, 0],
4085 [9449, 16740, 21827, 32768, 0],
4086 [6700, 12498, 17261, 32768, 0],
4087 [4988, 9866, 14198, 32768, 0],
4088 [4236, 8147, 11902, 32768, 0],
4089 [2867, 5860, 8654, 32768, 0],
4090 [17124, 23171, 26101, 32768, 0],
4091 [20396, 27477, 30148, 32768, 0],
4092 [16573, 24629, 28492, 32768, 0],
4093 [12749, 20846, 25674, 32768, 0],
4094 [10233, 17878, 22818, 32768, 0],
4095 [8525, 15332, 20363, 32768, 0],
4096 [6283, 11632, 16255, 32768, 0],
4097 [20466, 26511, 29286, 32768, 0],
4098 [23059, 29174, 31191, 32768, 0],
4099 [19481, 27263, 30241, 32768, 0],
4100 [15458, 23631, 28137, 32768, 0],
4101 [12416, 20608, 25693, 32768, 0],
4102 [10261, 18011, 23261, 32768, 0],
4103 [8016, 14655, 19666, 32768, 0],
4104];
4105
4106/// COEFF_BR_CHROMA_4_Q0, q-context 0: the same table as [`COEFF_BR_CHROMA_4`], for `base_q_idx` 0..=20.
4107pub const COEFF_BR_CHROMA_4_Q0: [[u16; 5]; 21] = [
4108 [15967, 22905, 26286, 32768, 0],
4109 [13534, 20654, 24579, 32768, 0],
4110 [9504, 16092, 20535, 32768, 0],
4111 [6975, 12568, 16903, 32768, 0],
4112 [5364, 10091, 14020, 32768, 0],
4113 [4357, 8370, 11857, 32768, 0],
4114 [2506, 4934, 7218, 32768, 0],
4115 [23032, 28815, 30936, 32768, 0],
4116 [19540, 26704, 29719, 32768, 0],
4117 [15158, 22969, 27097, 32768, 0],
4118 [11408, 18865, 23650, 32768, 0],
4119 [8885, 15448, 20250, 32768, 0],
4120 [7108, 12853, 17416, 32768, 0],
4121 [4231, 8041, 11480, 32768, 0],
4122 [19823, 26490, 29156, 32768, 0],
4123 [18890, 25929, 28932, 32768, 0],
4124 [15660, 23491, 27433, 32768, 0],
4125 [12147, 19776, 24488, 32768, 0],
4126 [9728, 16774, 21649, 32768, 0],
4127 [7919, 14277, 19066, 32768, 0],
4128 [5440, 10170, 14185, 32768, 0],
4129];
4130
4131/// COEFF_BR_CHROMA_4_Q1, q-context 1: the same table as [`COEFF_BR_CHROMA_4`], for `base_q_idx` 21..=60.
4132pub const COEFF_BR_CHROMA_4_Q1: [[u16; 5]; 21] = [
4133 [15571, 22232, 25749, 32768, 0],
4134 [14506, 21575, 25374, 32768, 0],
4135 [10189, 17089, 21569, 32768, 0],
4136 [7316, 13301, 17915, 32768, 0],
4137 [5783, 10912, 15190, 32768, 0],
4138 [4760, 9155, 13088, 32768, 0],
4139 [2993, 5966, 8774, 32768, 0],
4140 [23424, 28903, 30778, 32768, 0],
4141 [20775, 27666, 30290, 32768, 0],
4142 [16474, 24410, 28299, 32768, 0],
4143 [12471, 20180, 24987, 32768, 0],
4144 [9410, 16487, 21439, 32768, 0],
4145 [7536, 13614, 18529, 32768, 0],
4146 [5048, 9586, 13549, 32768, 0],
4147 [21090, 27290, 29756, 32768, 0],
4148 [20796, 27402, 30026, 32768, 0],
4149 [17819, 25485, 28969, 32768, 0],
4150 [13860, 21909, 26462, 32768, 0],
4151 [11002, 18494, 23529, 32768, 0],
4152 [8953, 15929, 20897, 32768, 0],
4153 [6448, 11918, 16454, 32768, 0],
4154];
4155
4156/// the base-range tail of a 4x4 chroma coefficient.
4157pub const COEFF_BR_CHROMA_4: [[u16; 5]; 21] = [
4158 [17394, 24501, 27895, 32768, 0],
4159 [15889, 23420, 27185, 32768, 0],
4160 [11561, 19133, 23870, 32768, 0],
4161 [8285, 14812, 19844, 32768, 0],
4162 [6496, 12043, 16550, 32768, 0],
4163 [4771, 9574, 13677, 32768, 0],
4164 [3603, 6830, 10144, 32768, 0],
4165 [21656, 27704, 30200, 32768, 0],
4166 [21324, 27915, 30511, 32768, 0],
4167 [17327, 25336, 28997, 32768, 0],
4168 [13417, 21381, 26033, 32768, 0],
4169 [10132, 17425, 22338, 32768, 0],
4170 [8580, 15016, 19633, 32768, 0],
4171 [5694, 11477, 16411, 32768, 0],
4172 [24116, 29780, 31450, 32768, 0],
4173 [23853, 29695, 31591, 32768, 0],
4174 [20085, 27614, 30428, 32768, 0],
4175 [15326, 24335, 28575, 32768, 0],
4176 [11814, 19472, 24810, 32768, 0],
4177 [10221, 18611, 24767, 32768, 0],
4178 [7689, 14558, 20321, 32768, 0],
4179];
4180
4181/// COEFF_BR_CHROMA_4_Q3, q-context 3: the same table as [`COEFF_BR_CHROMA_4`], for `base_q_idx` 121..=255.
4182pub const COEFF_BR_CHROMA_4_Q3: [[u16; 5]; 21] = [
4183 [21425, 27952, 30388, 32768, 0],
4184 [18062, 25838, 29034, 32768, 0],
4185 [11956, 19881, 24808, 32768, 0],
4186 [7718, 15000, 20980, 32768, 0],
4187 [5702, 11254, 16143, 32768, 0],
4188 [4898, 9088, 16864, 32768, 0],
4189 [3679, 6776, 11907, 32768, 0],
4190 [23294, 30160, 31663, 32768, 0],
4191 [24397, 29896, 31836, 32768, 0],
4192 [19245, 27128, 30593, 32768, 0],
4193 [13202, 19825, 26404, 32768, 0],
4194 [11578, 19297, 23957, 32768, 0],
4195 [8073, 13297, 21370, 32768, 0],
4196 [5461, 10923, 19745, 32768, 0],
4197 [27367, 30521, 31934, 32768, 0],
4198 [24904, 30671, 31940, 32768, 0],
4199 [23075, 28460, 31299, 32768, 0],
4200 [14400, 23658, 30417, 32768, 0],
4201 [13885, 23882, 28325, 32768, 0],
4202 [14746, 22938, 27853, 32768, 0],
4203 [5461, 16384, 27307, 32768, 0],
4204];
4205
4206/// `Default_Intra_Ext_Tx_Cdf`'s `TX_SET_INTRA_1` (`EXT_TX_SET_DTT4_IDTX_1DDCT`)
4207/// row for `TX_8X8` (spec 9.4): the transform type of an intra 8x8 transform
4208/// when `reduced_tx_set` is false. Unused while this crate's key frames set
4209/// `reduced_tx_set: true` (`get_tx_set`'s intra branch then returns
4210/// `TX_SET_INTRA_2` -- [`INTRA_TX_TYPE_SET2_8`] -- at every size up to 16x16,
4211/// not only 16x16; r11 lane-av1-rect). Kept named for the day a non-reduced
4212/// path exists.
4213pub const INTRA_TX_TYPE_SET1_8: [[u16; 8]; 13] = [
4214 [1870, 13742, 14530, 16498, 23770, 27698, 32768, 0],
4215 [326, 8796, 14632, 15079, 19272, 27486, 32768, 0],
4216 [484, 7576, 7712, 14443, 19159, 22591, 32768, 0],
4217 [1126, 15340, 15895, 17023, 20896, 30279, 32768, 0],
4218 [655, 4854, 5249, 5913, 22099, 27138, 32768, 0],
4219 [1299, 6458, 8885, 9290, 14851, 25497, 32768, 0],
4220 [311, 5295, 5552, 6885, 16107, 22672, 32768, 0],
4221 [883, 8059, 8270, 11258, 17289, 21549, 32768, 0],
4222 [741, 7580, 9318, 10345, 16688, 29046, 32768, 0],
4223 [110, 7406, 7915, 9195, 16041, 23329, 32768, 0],
4224 [363, 7974, 9357, 10673, 15629, 24474, 32768, 0],
4225 [153, 7647, 8112, 9936, 15307, 19996, 32768, 0],
4226 [3511, 6332, 11165, 15335, 19323, 23594, 32768, 0],
4227];
4228
4229/// `Default_Intra_Ext_Tx_Cdf`'s `TX_SET_INTRA_2` (`EXT_TX_SET_DTT4_IDTX`) row
4230/// for `TX_8X8` (spec 9.4, entropymode.c's `eset==2`/`TX_8X8` slot): the
4231/// transform type of an intra 8x8 transform when `reduced_tx_set` is true,
4232/// which this crate's key frames always set. libaom leaves this exact slot
4233/// at the flat 5-way default (unlike its trained `TX_16X16` neighbour,
4234/// [`INTRA_TX_TYPE_SET2_16`]) -- every mode reads the same uniform CDF.
4235pub const INTRA_TX_TYPE_SET2_8: [[u16; 6]; 13] = [[6554, 13107, 19661, 26214, 32768, 0]; 13];
4236/// The full luma sub-range of spec `TXB_SKIP_CONTEXTS` (contexts 0..6, the
4237/// `plane_bsize != tx_size` `skip_contexts[top][left]` table plus its own
4238/// single `plane_bsize == tx_size` context 0), for a `TxMode::Select` block
4239/// whose luma transform is split into several transform units smaller than
4240/// the block itself -- the single-context `TXB_SKIP_LUMA_*` constants above
4241/// stay for every other caller, which only ever reads context 0.
4242pub const TXB_SKIP_LUMA_8_Q0_CTX: [[u16; 3]; 7] = [
4243 [31548, 32768, 0],
4244 [1549, 32768, 0],
4245 [10130, 32768, 0],
4246 [16656, 32768, 0],
4247 [18591, 32768, 0],
4248 [26308, 32768, 0],
4249 [32537, 32768, 0],
4250];
4251pub const TXB_SKIP_LUMA_8_Q1_CTX: [[u16; 3]; 7] = [
4252 [31782, 32768, 0],
4253 [1836, 32768, 0],
4254 [10689, 32768, 0],
4255 [17604, 32768, 0],
4256 [21622, 32768, 0],
4257 [27518, 32768, 0],
4258 [32399, 32768, 0],
4259];
4260pub const TXB_SKIP_LUMA_8_CTX: [[u16; 3]; 7] = [
4261 [31957, 32768, 0],
4262 [3230, 32768, 0],
4263 [11153, 32768, 0],
4264 [18123, 32768, 0],
4265 [20143, 32768, 0],
4266 [26536, 32768, 0],
4267 [31986, 32768, 0],
4268];
4269pub const TXB_SKIP_LUMA_8_Q3_CTX: [[u16; 3]; 7] = [
4270 [31903, 32768, 0],
4271 [2044, 32768, 0],
4272 [7528, 32768, 0],
4273 [14618, 32768, 0],
4274 [16182, 32768, 0],
4275 [24168, 32768, 0],
4276 [31037, 32768, 0],
4277];
4278pub const TXB_SKIP_LUMA_16_Q0_CTX: [[u16; 3]; 7] = [
4279 [29957, 32768, 0],
4280 [5391, 32768, 0],
4281 [18039, 32768, 0],
4282 [23566, 32768, 0],
4283 [22431, 32768, 0],
4284 [25822, 32768, 0],
4285 [32197, 32768, 0],
4286];
4287pub const TXB_SKIP_LUMA_16_Q1_CTX: [[u16; 3]; 7] = [
4288 [31901, 32768, 0],
4289 [10311, 32768, 0],
4290 [18047, 32768, 0],
4291 [24806, 32768, 0],
4292 [23288, 32768, 0],
4293 [27914, 32768, 0],
4294 [32296, 32768, 0],
4295];
4296pub const TXB_SKIP_LUMA_16_CTX: [[u16; 3]; 7] = [
4297 [32363, 32768, 0],
4298 [10692, 32768, 0],
4299 [19090, 32768, 0],
4300 [24357, 32768, 0],
4301 [24442, 32768, 0],
4302 [28312, 32768, 0],
4303 [32169, 32768, 0],
4304];
4305pub const TXB_SKIP_LUMA_16_Q3_CTX: [[u16; 3]; 7] = [
4306 [32510, 32768, 0],
4307 [8430, 32768, 0],
4308 [17318, 32768, 0],
4309 [24154, 32768, 0],
4310 [23674, 32768, 0],
4311 [28789, 32768, 0],
4312 [32139, 32768, 0],
4313];
4314pub const TXB_SKIP_LUMA_32_Q0_CTX: [[u16; 3]; 7] = [
4315 [17920, 32768, 0],
4316 [1818, 32768, 0],
4317 [7282, 32768, 0],
4318 [25273, 32768, 0],
4319 [10923, 32768, 0],
4320 [31554, 32768, 0],
4321 [32624, 32768, 0],
4322];
4323pub const TXB_SKIP_LUMA_32_Q1_CTX: [[u16; 3]; 7] = [
4324 [26726, 32768, 0],
4325 [1045, 32768, 0],
4326 [11703, 32768, 0],
4327 [20590, 32768, 0],
4328 [18554, 32768, 0],
4329 [25970, 32768, 0],
4330 [31938, 32768, 0],
4331];
4332pub const TXB_SKIP_LUMA_32_CTX: [[u16; 3]; 7] = [
4333 [30669, 32768, 0],
4334 [3832, 32768, 0],
4335 [11663, 32768, 0],
4336 [18889, 32768, 0],
4337 [19782, 32768, 0],
4338 [23313, 32768, 0],
4339 [31330, 32768, 0],
4340];
4341pub const TXB_SKIP_LUMA_32_Q3_CTX: [[u16; 3]; 7] = [
4342 [31671, 32768, 0],
4343 [2056, 32768, 0],
4344 [11746, 32768, 0],
4345 [16852, 32768, 0],
4346 [18635, 32768, 0],
4347 [24715, 32768, 0],
4348 [31484, 32768, 0],
4349];
4350pub const TXB_SKIP_LUMA_64_Q0_CTX: [[u16; 3]; 7] = [
4351 [6308, 32768, 0],
4352 [117, 32768, 0],
4353 [1638, 32768, 0],
4354 [2161, 32768, 0],
4355 [16384, 32768, 0],
4356 [10923, 32768, 0],
4357 [30247, 32768, 0],
4358];
4359pub const TXB_SKIP_LUMA_64_Q1_CTX: [[u16; 3]; 7] = [
4360 [26584, 32768, 0],
4361 [188, 32768, 0],
4362 [8847, 32768, 0],
4363 [24519, 32768, 0],
4364 [22938, 32768, 0],
4365 [30583, 32768, 0],
4366 [32608, 32768, 0],
4367];
4368pub const TXB_SKIP_LUMA_64_CTX: [[u16; 3]; 7] = [
4369 [28573, 32768, 0],
4370 [3183, 32768, 0],
4371 [17802, 32768, 0],
4372 [25977, 32768, 0],
4373 [26677, 32768, 0],
4374 [27832, 32768, 0],
4375 [32387, 32768, 0],
4376];
4377pub const TXB_SKIP_LUMA_64_Q3_CTX: [[u16; 3]; 7] = [
4378 [31539, 32768, 0],
4379 [8433, 32768, 0],
4380 [20576, 32768, 0],
4381 [27904, 32768, 0],
4382 [27852, 32768, 0],
4383 [30026, 32768, 0],
4384 [32441, 32768, 0],
4385];
4386
4387// The tables below extend the `_LUMA_8`/`Luma8Set1` straddling-16x16 support
4388// above to a resolved `TX4` (spec `TX_4X4`) luma transform unit: a
4389// `TxMode::Select` 8x8 leaf or 16x16 block whose `tx_depth` read exhausts
4390// down to the smallest size (lane-av1tx4). Extracted byte-exact from
4391// libaom's `token_cdfs.h` `TX_SIZES` idx0 (`TX_4X4`)/`PLANE_TYPES` idx0
4392// (luma), the same indexing method that verified the `_LUMA_8`/`COEFF_BR_LUMA_8`
4393// families above.
4394
4395/// The full luma sub-range of spec `TXB_SKIP_CONTEXTS` (contexts 0..6) for a
4396/// resolved 4x4 luma transform, same convention as [`TXB_SKIP_LUMA_8_CTX`].
4397pub const TXB_SKIP_LUMA_4_Q0_CTX: [[u16; 3]; 7] = [
4398 [31849, 32768, 0],
4399 [5892, 32768, 0],
4400 [12112, 32768, 0],
4401 [21935, 32768, 0],
4402 [20289, 32768, 0],
4403 [27473, 32768, 0],
4404 [32487, 32768, 0],
4405];
4406pub const TXB_SKIP_LUMA_4_Q1_CTX: [[u16; 3]; 7] = [
4407 [30371, 32768, 0],
4408 [7570, 32768, 0],
4409 [13155, 32768, 0],
4410 [20751, 32768, 0],
4411 [20969, 32768, 0],
4412 [27067, 32768, 0],
4413 [32013, 32768, 0],
4414];
4415pub const TXB_SKIP_LUMA_4_CTX: [[u16; 3]; 7] = [
4416 [29614, 32768, 0],
4417 [9068, 32768, 0],
4418 [12924, 32768, 0],
4419 [19538, 32768, 0],
4420 [17737, 32768, 0],
4421 [24619, 32768, 0],
4422 [30642, 32768, 0],
4423];
4424pub const TXB_SKIP_LUMA_4_Q3_CTX: [[u16; 3]; 7] = [
4425 [26887, 32768, 0],
4426 [6729, 32768, 0],
4427 [10361, 32768, 0],
4428 [17442, 32768, 0],
4429 [15045, 32768, 0],
4430 [22478, 32768, 0],
4431 [29072, 32768, 0],
4432];
4433
4434/// The end-of-block group of a 4x4 luma transform (`av1_default_eob_multi16_cdfs`,
4435/// `PLANE_TYPES` idx0 luma).
4436pub const EOB_PT_16_LUMA_Q0: [u16; 6] = [840, 1039, 1980, 4895, 32768, 0];
4437pub const EOB_PT_16_LUMA_Q1: [u16; 6] = [2125, 2551, 5165, 8946, 32768, 0];
4438pub const EOB_PT_16_LUMA: [u16; 6] = [4016, 4897, 8881, 14968, 32768, 0];
4439pub const EOB_PT_16_LUMA_Q3: [u16; 6] = [6708, 8958, 14746, 22133, 32768, 0];
4440
4441/// The `TX_CLASS_HORIZ`/`TX_CLASS_VERT` (non-2D-scan) sibling of
4442/// [`EOB_PT_16_LUMA`] (`av1_default_eob_multi16_cdfs[q][0][1]`) -- read
4443/// instead of the 2D table whenever a 4x4 luma TU's `tx_type` resolves to
4444/// `V_DCT`/`H_DCT` (lane-av1tx4 r5: the class dimension libaom always keeps,
4445/// this crate never carried at all until a real aomdec trace showed the
4446/// desync starting exactly at this read).
4447pub const EOB_PT_16_LUMA_CLASS1_Q0: [u16; 6] = [370, 671, 1883, 4471, 32768, 0];
4448pub const EOB_PT_16_LUMA_CLASS1_Q1: [u16; 6] = [513, 765, 1859, 6339, 32768, 0];
4449pub const EOB_PT_16_LUMA_CLASS1: [u16; 6] = [716, 1105, 2646, 10056, 32768, 0];
4450pub const EOB_PT_16_LUMA_CLASS1_Q3: [u16; 6] = [1222, 2074, 4783, 15410, 32768, 0];
4451
4452// EOB_EXTRA_LUMA_4
4453pub const EOB_EXTRA_LUMA_4_Q0: [[u16; 3]; 9] = [
4454 [16961, 32768, 0],
4455 [17223, 32768, 0],
4456 [7621, 32768, 0],
4457 [16384, 32768, 0],
4458 [16384, 32768, 0],
4459 [16384, 32768, 0],
4460 [16384, 32768, 0],
4461 [16384, 32768, 0],
4462 [16384, 32768, 0],
4463];
4464
4465pub const EOB_EXTRA_LUMA_4_Q1: [[u16; 3]; 9] = [
4466 [17471, 32768, 0],
4467 [20223, 32768, 0],
4468 [11357, 32768, 0],
4469 [16384, 32768, 0],
4470 [16384, 32768, 0],
4471 [16384, 32768, 0],
4472 [16384, 32768, 0],
4473 [16384, 32768, 0],
4474 [16384, 32768, 0],
4475];
4476
4477pub const EOB_EXTRA_LUMA_4: [[u16; 3]; 9] = [
4478 [18983, 32768, 0],
4479 [20512, 32768, 0],
4480 [14885, 32768, 0],
4481 [16384, 32768, 0],
4482 [16384, 32768, 0],
4483 [16384, 32768, 0],
4484 [16384, 32768, 0],
4485 [16384, 32768, 0],
4486 [16384, 32768, 0],
4487];
4488
4489pub const EOB_EXTRA_LUMA_4_Q3: [[u16; 3]; 9] = [
4490 [20177, 32768, 0],
4491 [20789, 32768, 0],
4492 [20262, 32768, 0],
4493 [16384, 32768, 0],
4494 [16384, 32768, 0],
4495 [16384, 32768, 0],
4496 [16384, 32768, 0],
4497 [16384, 32768, 0],
4498 [16384, 32768, 0],
4499];
4500
4501// COEFF_BASE_LUMA_4
4502pub const COEFF_BASE_LUMA_4_Q0: [[u16; 5]; 42] = [
4503 [4034, 8930, 12727, 32768, 0],
4504 [18082, 29741, 31877, 32768, 0],
4505 [12596, 26124, 30493, 32768, 0],
4506 [9446, 21118, 27005, 32768, 0],
4507 [6308, 15141, 21279, 32768, 0],
4508 [2463, 6357, 9783, 32768, 0],
4509 [20667, 30546, 31929, 32768, 0],
4510 [13043, 26123, 30134, 32768, 0],
4511 [8151, 18757, 24778, 32768, 0],
4512 [5255, 12839, 18632, 32768, 0],
4513 [2820, 7206, 11161, 32768, 0],
4514 [8192, 16384, 24576, 32768, 0],
4515 [8192, 16384, 24576, 32768, 0],
4516 [8192, 16384, 24576, 32768, 0],
4517 [8192, 16384, 24576, 32768, 0],
4518 [8192, 16384, 24576, 32768, 0],
4519 [8192, 16384, 24576, 32768, 0],
4520 [8192, 16384, 24576, 32768, 0],
4521 [8192, 16384, 24576, 32768, 0],
4522 [8192, 16384, 24576, 32768, 0],
4523 [8192, 16384, 24576, 32768, 0],
4524 [15736, 27553, 30604, 32768, 0],
4525 [11210, 23794, 28787, 32768, 0],
4526 [5947, 13874, 19701, 32768, 0],
4527 [4215, 9323, 13891, 32768, 0],
4528 [2833, 6462, 10059, 32768, 0],
4529 [19605, 30393, 31582, 32768, 0],
4530 [13523, 26252, 30248, 32768, 0],
4531 [8446, 18622, 24512, 32768, 0],
4532 [3818, 10343, 15974, 32768, 0],
4533 [1481, 4117, 6796, 32768, 0],
4534 [22649, 31302, 32190, 32768, 0],
4535 [14829, 27127, 30449, 32768, 0],
4536 [8313, 17702, 23304, 32768, 0],
4537 [3022, 8301, 12786, 32768, 0],
4538 [1536, 4412, 7184, 32768, 0],
4539 [22354, 29774, 31372, 32768, 0],
4540 [14723, 25472, 29214, 32768, 0],
4541 [6673, 13745, 18662, 32768, 0],
4542 [2068, 5766, 9322, 32768, 0],
4543 [8192, 16384, 24576, 32768, 0],
4544 [8192, 16384, 24576, 32768, 0],
4545];
4546
4547pub const COEFF_BASE_LUMA_4_Q1: [[u16; 5]; 42] = [
4548 [6041, 11854, 15927, 32768, 0],
4549 [20326, 30905, 32251, 32768, 0],
4550 [14164, 26831, 30725, 32768, 0],
4551 [9760, 20647, 26585, 32768, 0],
4552 [6416, 14953, 21219, 32768, 0],
4553 [2966, 7151, 10891, 32768, 0],
4554 [23567, 31374, 32254, 32768, 0],
4555 [14978, 27416, 30946, 32768, 0],
4556 [9434, 20225, 26254, 32768, 0],
4557 [6658, 14558, 20535, 32768, 0],
4558 [3916, 8677, 12989, 32768, 0],
4559 [8192, 16384, 24576, 32768, 0],
4560 [8192, 16384, 24576, 32768, 0],
4561 [8192, 16384, 24576, 32768, 0],
4562 [8192, 16384, 24576, 32768, 0],
4563 [8192, 16384, 24576, 32768, 0],
4564 [8192, 16384, 24576, 32768, 0],
4565 [8192, 16384, 24576, 32768, 0],
4566 [8192, 16384, 24576, 32768, 0],
4567 [8192, 16384, 24576, 32768, 0],
4568 [8192, 16384, 24576, 32768, 0],
4569 [18088, 29545, 31587, 32768, 0],
4570 [13062, 25843, 30073, 32768, 0],
4571 [8940, 16827, 22251, 32768, 0],
4572 [7654, 13220, 17973, 32768, 0],
4573 [5733, 10316, 14456, 32768, 0],
4574 [22879, 31388, 32114, 32768, 0],
4575 [15215, 27993, 30955, 32768, 0],
4576 [9397, 19445, 24978, 32768, 0],
4577 [3442, 9813, 15344, 32768, 0],
4578 [1368, 3936, 6532, 32768, 0],
4579 [25494, 32033, 32406, 32768, 0],
4580 [16772, 27963, 30718, 32768, 0],
4581 [9419, 18165, 23260, 32768, 0],
4582 [2677, 7501, 11797, 32768, 0],
4583 [1516, 4344, 7170, 32768, 0],
4584 [26556, 31454, 32101, 32768, 0],
4585 [17128, 27035, 30108, 32768, 0],
4586 [8324, 15344, 20249, 32768, 0],
4587 [1903, 5696, 9469, 32768, 0],
4588 [8192, 16384, 24576, 32768, 0],
4589 [8192, 16384, 24576, 32768, 0],
4590];
4591
4592pub const COEFF_BASE_LUMA_4: [[u16; 5]; 42] = [
4593 [8896, 16227, 20630, 32768, 0],
4594 [23629, 31782, 32527, 32768, 0],
4595 [15173, 27755, 31321, 32768, 0],
4596 [10158, 21233, 27382, 32768, 0],
4597 [6420, 14857, 21558, 32768, 0],
4598 [3269, 8155, 12646, 32768, 0],
4599 [24835, 32009, 32496, 32768, 0],
4600 [16509, 28421, 31579, 32768, 0],
4601 [10957, 21514, 27418, 32768, 0],
4602 [7881, 15930, 22096, 32768, 0],
4603 [5388, 10960, 15918, 32768, 0],
4604 [8192, 16384, 24576, 32768, 0],
4605 [8192, 16384, 24576, 32768, 0],
4606 [8192, 16384, 24576, 32768, 0],
4607 [8192, 16384, 24576, 32768, 0],
4608 [8192, 16384, 24576, 32768, 0],
4609 [8192, 16384, 24576, 32768, 0],
4610 [8192, 16384, 24576, 32768, 0],
4611 [8192, 16384, 24576, 32768, 0],
4612 [8192, 16384, 24576, 32768, 0],
4613 [8192, 16384, 24576, 32768, 0],
4614 [20745, 30773, 32093, 32768, 0],
4615 [15200, 27221, 30861, 32768, 0],
4616 [13032, 20873, 25667, 32768, 0],
4617 [12285, 18663, 23494, 32768, 0],
4618 [11563, 17481, 21489, 32768, 0],
4619 [26260, 31982, 32320, 32768, 0],
4620 [15397, 28083, 31100, 32768, 0],
4621 [9742, 19217, 24824, 32768, 0],
4622 [3261, 9629, 15362, 32768, 0],
4623 [1480, 4322, 7499, 32768, 0],
4624 [27599, 32256, 32460, 32768, 0],
4625 [16857, 27659, 30774, 32768, 0],
4626 [9551, 18290, 23748, 32768, 0],
4627 [3052, 8933, 14103, 32768, 0],
4628 [2021, 5910, 9787, 32768, 0],
4629 [29005, 32015, 32392, 32768, 0],
4630 [17677, 27694, 30863, 32768, 0],
4631 [9204, 17356, 23219, 32768, 0],
4632 [2403, 7516, 12814, 32768, 0],
4633 [8192, 16384, 24576, 32768, 0],
4634 [8192, 16384, 24576, 32768, 0],
4635];
4636
4637pub const COEFF_BASE_LUMA_4_Q3: [[u16; 5]; 42] = [
4638 [7062, 16472, 22319, 32768, 0],
4639 [24538, 32261, 32674, 32768, 0],
4640 [13675, 28041, 31779, 32768, 0],
4641 [8590, 20674, 27631, 32768, 0],
4642 [5685, 14675, 22013, 32768, 0],
4643 [3655, 9898, 15731, 32768, 0],
4644 [26493, 32418, 32658, 32768, 0],
4645 [16376, 29342, 32090, 32768, 0],
4646 [10594, 22649, 28970, 32768, 0],
4647 [8176, 17170, 24303, 32768, 0],
4648 [5605, 12694, 19139, 32768, 0],
4649 [8192, 16384, 24576, 32768, 0],
4650 [8192, 16384, 24576, 32768, 0],
4651 [8192, 16384, 24576, 32768, 0],
4652 [8192, 16384, 24576, 32768, 0],
4653 [8192, 16384, 24576, 32768, 0],
4654 [8192, 16384, 24576, 32768, 0],
4655 [8192, 16384, 24576, 32768, 0],
4656 [8192, 16384, 24576, 32768, 0],
4657 [8192, 16384, 24576, 32768, 0],
4658 [8192, 16384, 24576, 32768, 0],
4659 [23888, 31902, 32542, 32768, 0],
4660 [18612, 29687, 31987, 32768, 0],
4661 [16245, 24852, 29249, 32768, 0],
4662 [15765, 22608, 27559, 32768, 0],
4663 [19895, 24699, 27510, 32768, 0],
4664 [28401, 32212, 32457, 32768, 0],
4665 [15274, 27825, 30980, 32768, 0],
4666 [9364, 18128, 24332, 32768, 0],
4667 [2283, 8193, 15082, 32768, 0],
4668 [1228, 3972, 7881, 32768, 0],
4669 [29455, 32469, 32620, 32768, 0],
4670 [17981, 28245, 31388, 32768, 0],
4671 [10921, 20098, 26240, 32768, 0],
4672 [3743, 11829, 18657, 32768, 0],
4673 [2374, 9593, 15715, 32768, 0],
4674 [31068, 32466, 32635, 32768, 0],
4675 [20321, 29572, 31971, 32768, 0],
4676 [10771, 20255, 27119, 32768, 0],
4677 [2795, 10410, 17361, 32768, 0],
4678 [8192, 16384, 24576, 32768, 0],
4679 [8192, 16384, 24576, 32768, 0],
4680];
4681
4682// COEFF_BASE_EOB_LUMA_4
4683pub const COEFF_BASE_EOB_LUMA_4_Q0: [[u16; 4]; 4] = [
4684 [17837, 29055, 32768, 0],
4685 [29600, 31446, 32768, 0],
4686 [30844, 31878, 32768, 0],
4687 [24926, 28948, 32768, 0],
4688];
4689
4690pub const COEFF_BASE_EOB_LUMA_4_Q1: [[u16; 4]; 4] = [
4691 [17560, 29888, 32768, 0],
4692 [29671, 31549, 32768, 0],
4693 [31007, 32056, 32768, 0],
4694 [27286, 30006, 32768, 0],
4695];
4696
4697pub const COEFF_BASE_EOB_LUMA_4: [[u16; 4]; 4] = [
4698 [20092, 30774, 32768, 0],
4699 [30695, 32020, 32768, 0],
4700 [31131, 32103, 32768, 0],
4701 [28666, 30870, 32768, 0],
4702];
4703
4704pub const COEFF_BASE_EOB_LUMA_4_Q3: [[u16; 4]; 4] = [
4705 [22497, 31198, 32768, 0],
4706 [31715, 32495, 32768, 0],
4707 [31606, 32337, 32768, 0],
4708 [30388, 31990, 32768, 0],
4709];
4710
4711// COEFF_BR_LUMA_4
4712pub const COEFF_BR_LUMA_4_Q0: [[u16; 5]; 21] = [
4713 [14298, 20718, 24174, 32768, 0],
4714 [12536, 19601, 23789, 32768, 0],
4715 [8712, 15051, 19503, 32768, 0],
4716 [6170, 11327, 15434, 32768, 0],
4717 [4742, 8926, 12538, 32768, 0],
4718 [3803, 7317, 10546, 32768, 0],
4719 [1696, 3317, 4871, 32768, 0],
4720 [14392, 19951, 22756, 32768, 0],
4721 [15978, 23218, 26818, 32768, 0],
4722 [12187, 19474, 23889, 32768, 0],
4723 [9176, 15640, 20259, 32768, 0],
4724 [7068, 12655, 17028, 32768, 0],
4725 [5656, 10442, 14472, 32768, 0],
4726 [2580, 4992, 7244, 32768, 0],
4727 [12136, 18049, 21426, 32768, 0],
4728 [13784, 20721, 24481, 32768, 0],
4729 [10836, 17621, 21900, 32768, 0],
4730 [8372, 14444, 18847, 32768, 0],
4731 [6523, 11779, 16000, 32768, 0],
4732 [5337, 9898, 13760, 32768, 0],
4733 [3034, 5860, 8462, 32768, 0],
4734];
4735
4736pub const COEFF_BR_LUMA_4_Q1: [[u16; 5]; 21] = [
4737 [14995, 21341, 24749, 32768, 0],
4738 [13158, 20289, 24601, 32768, 0],
4739 [8941, 15326, 19876, 32768, 0],
4740 [6297, 11541, 15807, 32768, 0],
4741 [4817, 9029, 12776, 32768, 0],
4742 [3731, 7273, 10627, 32768, 0],
4743 [1847, 3617, 5354, 32768, 0],
4744 [14472, 19659, 22343, 32768, 0],
4745 [16806, 24162, 27533, 32768, 0],
4746 [12900, 20404, 24713, 32768, 0],
4747 [9411, 16112, 20797, 32768, 0],
4748 [7056, 12697, 17148, 32768, 0],
4749 [5544, 10339, 14460, 32768, 0],
4750 [2954, 5704, 8319, 32768, 0],
4751 [12464, 18071, 21354, 32768, 0],
4752 [15482, 22528, 26034, 32768, 0],
4753 [12070, 19269, 23624, 32768, 0],
4754 [8953, 15406, 20106, 32768, 0],
4755 [7027, 12730, 17220, 32768, 0],
4756 [5887, 10913, 15140, 32768, 0],
4757 [3793, 7278, 10447, 32768, 0],
4758];
4759
4760pub const COEFF_BR_LUMA_4: [[u16; 5]; 21] = [
4761 [16138, 22223, 25509, 32768, 0],
4762 [15347, 22430, 26332, 32768, 0],
4763 [9614, 16736, 21332, 32768, 0],
4764 [6600, 12275, 16907, 32768, 0],
4765 [4811, 9424, 13547, 32768, 0],
4766 [3748, 7809, 11420, 32768, 0],
4767 [2254, 4587, 6890, 32768, 0],
4768 [15196, 20284, 23177, 32768, 0],
4769 [18317, 25469, 28451, 32768, 0],
4770 [13918, 21651, 25842, 32768, 0],
4771 [10052, 17150, 21995, 32768, 0],
4772 [7499, 13630, 18587, 32768, 0],
4773 [6158, 11417, 16003, 32768, 0],
4774 [4014, 7785, 11252, 32768, 0],
4775 [15048, 21067, 24384, 32768, 0],
4776 [18202, 25346, 28553, 32768, 0],
4777 [14302, 22019, 26356, 32768, 0],
4778 [10839, 18139, 23166, 32768, 0],
4779 [8715, 15744, 20806, 32768, 0],
4780 [7536, 13576, 18544, 32768, 0],
4781 [5413, 10335, 14498, 32768, 0],
4782];
4783
4784pub const COEFF_BR_LUMA_4_Q3: [[u16; 5]; 21] = [
4785 [18315, 24289, 27551, 32768, 0],
4786 [16854, 24068, 27835, 32768, 0],
4787 [10140, 17927, 23173, 32768, 0],
4788 [6722, 12982, 18267, 32768, 0],
4789 [4661, 9826, 14706, 32768, 0],
4790 [3832, 8165, 12294, 32768, 0],
4791 [2795, 6098, 9245, 32768, 0],
4792 [17145, 23326, 26672, 32768, 0],
4793 [20733, 27680, 30308, 32768, 0],
4794 [16032, 24461, 28546, 32768, 0],
4795 [11653, 20093, 25081, 32768, 0],
4796 [9290, 16429, 22086, 32768, 0],
4797 [7796, 14598, 19982, 32768, 0],
4798 [6502, 12378, 17441, 32768, 0],
4799 [21681, 27732, 30320, 32768, 0],
4800 [22389, 29044, 31261, 32768, 0],
4801 [19027, 26731, 30087, 32768, 0],
4802 [14739, 23755, 28624, 32768, 0],
4803 [11358, 20778, 25511, 32768, 0],
4804 [10995, 18073, 24190, 32768, 0],
4805 [9162, 14990, 20617, 32768, 0],
4806];
4807
4808/// `Default_Intra_Ext_Tx_Cdf`'s `TX_SET_INTRA_1` row for `TX_4X4` (spec
4809/// 9.4): the transform type of an intra 4x4 transform when `reduced_tx_set`
4810/// is false. Same `Luma8`/`Luma8Set1` split as [`INTRA_TX_TYPE_SET1_8`],
4811/// kept named for the day a non-reduced path exists.
4812pub const INTRA_TX_TYPE_SET1_4: [[u16; 8]; 13] = [
4813 [1535, 8035, 9461, 12751, 23467, 27825, 32768, 0],
4814 [564, 3335, 9709, 10870, 18143, 28094, 32768, 0],
4815 [672, 3247, 3676, 11982, 19415, 23127, 32768, 0],
4816 [5279, 13885, 15487, 18044, 23527, 30252, 32768, 0],
4817 [4423, 6074, 7985, 10416, 25693, 29298, 32768, 0],
4818 [1486, 4241, 9460, 10662, 16456, 27694, 32768, 0],
4819 [439, 2838, 3522, 6737, 18058, 23754, 32768, 0],
4820 [1190, 4233, 4855, 11670, 20281, 24377, 32768, 0],
4821 [1045, 4312, 8647, 10159, 18644, 29335, 32768, 0],
4822 [202, 3734, 4747, 7298, 17127, 24016, 32768, 0],
4823 [447, 4312, 6819, 8884, 16010, 23858, 32768, 0],
4824 [277, 4369, 5255, 8905, 16465, 22271, 32768, 0],
4825 [3409, 5436, 10599, 15599, 19687, 24040, 32768, 0],
4826];