common_data.h 69.9 KB
Newer Older
Jingning Han's avatar
Jingning Han committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han's avatar
Jingning Han committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Jingning Han's avatar
Jingning Han committed
10 11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12 13
#ifndef AV1_COMMON_COMMON_DATA_H_
#define AV1_COMMON_COMMON_DATA_H_
Jingning Han's avatar
Jingning Han committed
14

15
#include "av1/common/enums.h"
Yaowu Xu's avatar
Yaowu Xu committed
16 17
#include "aom/aom_integer.h"
#include "aom_dsp/aom_dsp_common.h"
Jingning Han's avatar
Jingning Han committed
18 19 20 21 22

#ifdef __cplusplus
extern "C" {
#endif

23
#if CONFIG_EXT_PARTITION
24
#define IF_EXT_PARTITION(...) __VA_ARGS__,
25
#else
clang-format's avatar
clang-format committed
26
#define IF_EXT_PARTITION(...)
27 28
#endif

Jingning Han's avatar
Jingning Han committed
29
// Log 2 conversion lookup tables for block width and height
30
static const uint8_t b_width_log2_lookup[BLOCK_SIZES_ALL] = {
31
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
32 33 34 35 36 37 38 39 40 41 42 43 44
  0, 0,
  0,
#endif
  0, 0,
  1, 1,
  1, 2,
  2, 2,
  3, 3,
  3, 4,
  4, IF_EXT_PARTITION(4, 5, 5) 0,
  2, 1,
  3, 2,
  4, IF_EXT_PARTITION(3, 5)
clang-format's avatar
clang-format committed
45
};
46
static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = {
47
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
48 49 50 51 52 53 54 55 56 57 58 59 60
  0, 0,
  0,
#endif
  0, 1,
  0, 1,
  2, 1,
  2, 3,
  2, 3,
  4, 3,
  4, IF_EXT_PARTITION(5, 4, 5) 2,
  0, 3,
  1, 4,
  2, IF_EXT_PARTITION(5, 3)
clang-format's avatar
clang-format committed
61
};
Jingning Han's avatar
Jingning Han committed
62
// Log 2 conversion lookup tables for modeinfo width and height
63
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = {
Jingning Han's avatar
Jingning Han committed
64
#if CONFIG_CB4X4
65
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
66 67 68 69 70 71 72 73 74 75 76 77 78
  0, 0,
  0,
#endif
  0, 0,
  1, 1,
  1, 2,
  2, 2,
  3, 3,
  3, 4,
  4, IF_EXT_PARTITION(4, 5, 5) 0,
  2, 1,
  3, 2,
  4, IF_EXT_PARTITION(3, 5)
79
#else  // CONFIG_CB4X4
80 81 82 83 84 85 86 87 88 89
  0, 0,
  0, 0,
  0, 1,
  1, 1,
  2, 2,
  2, 3,
  3, IF_EXT_PARTITION(3, 4, 4) 0,
  1, 0,
  2, 1,
  3, IF_EXT_PARTITION(2, 4)
90
#endif
clang-format's avatar
clang-format committed
91
};
92
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
Jingning Han's avatar
Jingning Han committed
93
#if CONFIG_CB4X4
94
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
95 96 97 98 99 100 101 102 103 104 105 106 107
  0, 0,
  0,
#endif
  0, 1,
  0, 1,
  2, 1,
  2, 3,
  2, 3,
  4, 3,
  4, IF_EXT_PARTITION(5, 4, 5) 2,
  0, 3,
  1, 4,
  2, IF_EXT_PARTITION(5, 3)
108
#else  // CONFIG_CB4X4
109 110 111 112 113 114 115 116 117 118
  0, 0,
  0, 0,
  1, 0,
  1, 2,
  1, 2,
  3, 2,
  3, IF_EXT_PARTITION(4, 3, 4) 1,
  0, 2,
  0, 3,
  1, IF_EXT_PARTITION(2, 4)
119
#endif
clang-format's avatar
clang-format committed
120
};
121

122 123
/* clang-format off */
static const uint8_t mi_size_wide[BLOCK_SIZES_ALL] = {
124
#if CONFIG_CB4X4
125 126 127 128
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
  1, 1, 1,
#endif
  1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16,
129
  IF_EXT_PARTITION(16, 32, 32)  1, 4, 2, 8, 4, 16, IF_EXT_PARTITION(8, 32)
130
#else  // CONFIG_CB4X4
131
  1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4,
132
  2, 8, IF_EXT_PARTITION(4, 16)
133 134
#endif
};
135
static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
136
#if CONFIG_CB4X4
137 138 139 140
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
  1, 1, 1,
#endif
  1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16,
141
  IF_EXT_PARTITION(32, 16, 32)  4, 1, 8, 2, 16, 4, IF_EXT_PARTITION(32, 8)
142
#else  // CONFIG_CB4X4
143
  1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1,
144
  8, 2, IF_EXT_PARTITION(16, 4)
145 146
#endif
};
147
/* clang-format on */
148

149
// Width/height lookup tables in units of various block sizes
150
static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
151
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
152 153
  2,  2,
  4,
Jingning Han's avatar
Jingning Han committed
154
#endif
155 156 157 158 159 160 161 162 163 164
  4,  4,
  8,  8,
  8,  16,
  16, 16,
  32, 32,
  32, 64,
  64, IF_EXT_PARTITION(64, 128, 128) 4,
  16, 8,
  32, 16,
  64, IF_EXT_PARTITION(32, 128)
165
};
166

167
static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
168
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
169 170
  2,  4,
  2,
Jingning Han's avatar
Jingning Han committed
171
#endif
172 173 174 175 176 177 178 179 180 181
  4,  8,
  4,  8,
  16, 8,
  16, 32,
  16, 32,
  64, 32,
  64, IF_EXT_PARTITION(128, 64, 128) 16,
  4,  32,
  8,  64,
  16, IF_EXT_PARTITION(128, 32)
182
};
183

184
static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
185
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
186 187
  1,  1,
  1,
Jingning Han's avatar
Jingning Han committed
188
#endif
189 190 191 192 193 194 195 196 197 198
  1,  1,
  2,  2,
  2,  4,
  4,  4,
  8,  8,
  8,  16,
  16, IF_EXT_PARTITION(16, 32, 32) 1,
  4,  2,
  8,  4,
  16, IF_EXT_PARTITION(8, 32)
clang-format's avatar
clang-format committed
199
};
200
static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES_ALL] = {
201
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
202 203
  1,  1,
  1,
Jingning Han's avatar
Jingning Han committed
204
#endif
205 206 207 208 209 210 211 212 213 214
  1,  2,
  1,  2,
  4,  2,
  4,  8,
  4,  8,
  16, 8,
  16, IF_EXT_PARTITION(32, 16, 32) 4,
  1,  8,
  2,  16,
  4,  IF_EXT_PARTITION(32, 8)
clang-format's avatar
clang-format committed
215
};
216
static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
217
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
218 219
  1, 1,
  1,
Jingning Han's avatar
Jingning Han committed
220
#endif
221 222 223 224 225 226 227 228 229 230
  1, 1,
  1, 1,
  1, 2,
  2, 2,
  4, 4,
  4, 8,
  8, IF_EXT_PARTITION(8, 16, 16) 1,
  2, 1,
  4, 2,
  8, IF_EXT_PARTITION(4, 16)
clang-format's avatar
clang-format committed
231
};
232
static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES_ALL] = {
233
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
234 235
  1, 1,
  1,
Jingning Han's avatar
Jingning Han committed
236
#endif
237 238 239 240 241 242 243 244 245 246
  1, 1,
  1, 1,
  2, 1,
  2, 4,
  2, 4,
  8, 4,
  8, IF_EXT_PARTITION(16, 8, 16) 2,
  1, 4,
  1, 8,
  2, IF_EXT_PARTITION(16, 4)
clang-format's avatar
clang-format committed
247
};
248
static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
249
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
250 251
  1, 1,
  1,
Jingning Han's avatar
Jingning Han committed
252
#endif
253 254 255 256 257 258 259 260 261 262
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  2, 2,
  2, 4,
  4, IF_EXT_PARTITION(4, 8, 8) 1,
  1, 1,
  2, 2,
  4, IF_EXT_PARTITION(2, 8)
clang-format's avatar
clang-format committed
263
};
264
static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = {
265
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
266 267
  1, 1,
  1,
Jingning Han's avatar
Jingning Han committed
268
#endif
269 270 271 272 273 274 275 276 277 278
  1, 1,
  1, 1,
  1, 1,
  1, 2,
  1, 2,
  4, 2,
  4, IF_EXT_PARTITION(8, 4, 8) 1,
  1, 2,
  1, 4,
  2, IF_EXT_PARTITION(8, 2)
clang-format's avatar
clang-format committed
279
};
Jingning Han's avatar
Jingning Han committed
280

Yaowu Xu's avatar
Yaowu Xu committed
281
// AOMMIN(3, AOMMIN(b_width_log2(bsize), b_height_log2(bsize)))
282
static const uint8_t size_group_lookup[BLOCK_SIZES_ALL] = {
283
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
284 285 286 287 288 289 290 291 292 293 294 295 296
  0, 0,
  0,
#endif
  0, 0,
  0, 1,
  1, 1,
  2, 2,
  2, 3,
  3, 3,
  3, IF_EXT_PARTITION(3, 3, 3) 0,
  0, 1,
  1, 2,
  2, IF_EXT_PARTITION(3, 3)
clang-format's avatar
clang-format committed
297
};
Jingning Han's avatar
Jingning Han committed
298

299
static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
300
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
301 302 303 304 305 306 307 308 309 310 311 312 313
  2,  3,
  3,
#endif
  4,  5,
  5,  6,
  7,  7,
  8,  9,
  9,  10,
  11, 11,
  12, IF_EXT_PARTITION(13, 13, 14) 6,
  6,  8,
  8,  10,
  10, IF_EXT_PARTITION(12, 12)
clang-format's avatar
clang-format committed
314
};
Jingning Han's avatar
Jingning Han committed
315

clang-format's avatar
clang-format committed
316
/* clang-format off */
317
#if CONFIG_EXT_PARTITION_TYPES
318
static const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][BLOCK_SIZES_ALL] =
319
#else
320
static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES_ALL] =
321 322
#endif  // CONFIG_EXT_PARTITION_TYPES
{
323
  {     // PARTITION_NONE
324
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
325 326 327
    // 2X2,        2X4,           4X2,
    BLOCK_2X2,     BLOCK_2X4,     BLOCK_4X2,
#endif
328 329 330 331 332 333 334 335 336 337 338 339 340 341
    //                            4X4
                                  BLOCK_4X4,
    // 4X8,        8X4,           8X8
    BLOCK_4X8,     BLOCK_8X4,     BLOCK_8X8,
    // 8X16,       16X8,          16X16
    BLOCK_8X16,    BLOCK_16X8,    BLOCK_16X16,
    // 16X32,      32X16,         32X32
    BLOCK_16X32,   BLOCK_32X16,   BLOCK_32X32,
    // 32X64,      64X32,         64X64
    BLOCK_32X64,   BLOCK_64X32,   BLOCK_64X64,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_64X128,  BLOCK_128X64,  BLOCK_128X128,
#endif  // CONFIG_EXT_PARTITION
342 343
    // 4X16,       16X4,          8X32
    BLOCK_4X16,    BLOCK_16X4,    BLOCK_8X32,
344 345
    // 32X8,       16X64,         64X16
    BLOCK_32X8,    BLOCK_16X64,   BLOCK_64X16,
346 347 348 349
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_32X128,  BLOCK_128X32
#endif  // CONFIG_EXT_PARTITION
350
  }, {  // PARTITION_HORZ
351
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
352 353
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
354 355 356
    //                            4X4
                                  BLOCK_4X2,
#else
357 358
    //                            4X4
                                  BLOCK_INVALID,
359
#endif
360 361 362 363 364 365 366 367 368 369 370 371
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X4,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X8,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X16,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X32,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif  // CONFIG_EXT_PARTITION
372 373
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
374 375
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
376 377 378 379
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
380
  }, {  // PARTITION_VERT
381
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
382 383
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
384 385 386
    //                            4X4
                                  BLOCK_2X4,
#else
387 388
    //                            4X4
                                  BLOCK_INVALID,
389
#endif
390 391 392 393 394 395 396 397 398 399 400 401
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X8,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X16,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X32,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X64,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif  // CONFIG_EXT_PARTITION
402 403
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
404 405
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
406 407 408 409
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
410
  }, {  // PARTITION_SPLIT
411
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
412 413 414
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
415 416 417 418 419 420 421 422 423 424 425 426 427 428
    //                            4X4
                                  BLOCK_INVALID,
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X4,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X8,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X16,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X32,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X64,
#endif  // CONFIG_EXT_PARTITION
429 430
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
431 432
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
433 434 435 436
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
437
#if CONFIG_EXT_PARTITION_TYPES
438
  }, {  // PARTITION_HORZ_A
439
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
440 441 442
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
443 444 445 446 447 448 449 450 451 452 453 454 455 456
    //                            4X4
                                  BLOCK_INVALID,
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X4,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X8,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X16,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X32,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif  // CONFIG_EXT_PARTITION
457 458
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
459 460
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
461 462 463 464
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
465
  }, {  // PARTITION_HORZ_B
466
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
467 468 469
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
470 471 472 473 474 475 476 477 478 479 480 481 482 483
    //                            4X4
                                  BLOCK_INVALID,
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X4,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X8,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X16,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X32,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif  // CONFIG_EXT_PARTITION
484 485
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
486 487
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
488 489 490 491
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
492
  }, {  // PARTITION_VERT_A
493
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
494 495 496
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
497 498 499 500 501 502 503 504 505 506 507 508 509 510
    //                            4X4
                                  BLOCK_INVALID,
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X8,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X16,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X32,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X64,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif  // CONFIG_EXT_PARTITION
511 512
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
513 514
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
515 516 517 518
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
519
  }, {  // PARTITION_VERT_B
520
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
521 522 523
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif
524 525 526 527 528 529 530 531 532 533 534 535 536 537
    //                            4X4
                                  BLOCK_INVALID,
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X8,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X16,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X32,
    // 32X64,      64X32,         64X64
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X64,
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif  // CONFIG_EXT_PARTITION
538 539
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
540 541
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
542 543 544 545
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
  }, {  // PARTITION_HORZ_4
#if CONFIG_CB4X4
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
    //                            4X4
                                  BLOCK_INVALID,
#else
    //                            4X4
                                  BLOCK_INVALID,
#endif
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X4,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X8,
    // 32X64,      64X32,         64X64
563
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X16,
564 565
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
566
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X32,
567 568 569
#endif  // CONFIG_EXT_PARTITION
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
570 571
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
572 573 574 575
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592
  }, {  // PARTITION_VERT_4
#if CONFIG_CB4X4
    // 2X2,        2X4,           4X2,
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
    //                            4X4
                                  BLOCK_INVALID,
#else
    //                            4X4
                                  BLOCK_INVALID,
#endif
    // 4X8,        8X4,           8X8
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
    // 8X16,       16X8,          16X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X16,
    // 16X32,      32X16,         32X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X32,
    // 32X64,      64X32,         64X64
593
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X64,
594 595
#if CONFIG_EXT_PARTITION
    // 64x128,     128x64,        128x128
596
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X128,
597 598 599
#endif  // CONFIG_EXT_PARTITION
    // 4X16,       16X4,          8X32
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
600 601
    // 32X8,       16X64,         64X16
    BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
602 603 604 605
#if CONFIG_EXT_PARTITION
    // 32x128,     128x32
    BLOCK_INVALID, BLOCK_INVALID
#endif  // CONFIG_EXT_PARTITION
606
#endif  // CONFIG_EXT_PARTITION_TYPES
Jingning Han's avatar
Jingning Han committed
607 608 609
  }
};

610
static const TX_SIZE max_txsize_lookup[BLOCK_SIZES_ALL] = {
Jingning Han's avatar
Jingning Han committed
611
  // 2X2,    2X4,      4X2,
612
#if CONFIG_CHROMA_2X2
Jingning Han's avatar
Jingning Han committed
613
  TX_2X2,    TX_2X2,   TX_2X2,
614
#elif CONFIG_CHROMA_SUB8X8
615
  TX_4X4,    TX_4X4,   TX_4X4,
Jingning Han's avatar
Jingning Han committed
616
#endif
617 618 619 620 621 622 623 624
  //                   4X4
                       TX_4X4,
  // 4X8,    8X4,      8X8
  TX_4X4,    TX_4X4,   TX_8X8,
  // 8X16,   16X8,     16X16
  TX_8X8,    TX_8X8,   TX_16X16,
  // 16X32,  32X16,    32X32
  TX_16X16,  TX_16X16, TX_32X32,
625 626 627 628 629 630 631 632 633 634 635 636
  // 32X64,  64X32,
  TX_32X32,  TX_32X32,
#if CONFIG_TX64X64
  // 64X64
  TX_64X64,
#if CONFIG_EXT_PARTITION
  // 64x128, 128x64,   128x128
  TX_64X64,  TX_64X64, TX_64X64,
#endif  // CONFIG_EXT_PARTITION
#else
  // 64X64
  TX_32X32,
637 638 639 640
#if CONFIG_EXT_PARTITION
  // 64x128, 128x64,   128x128
  TX_32X32,  TX_32X32, TX_32X32,
#endif  // CONFIG_EXT_PARTITION
641
#endif  // CONFIG_TX64X64
642 643
  // 4x16,   16x4,     8x32
  TX_4X4,    TX_4X4,   TX_8X8,
644
  // 32x8,   16x64     64x16
645 646 647 648 649
  TX_8X8,    TX_16X16, TX_16X16,
#if CONFIG_EXT_PARTITION
  // 32x128  128x32
  TX_32X32,  TX_32X32
#endif  // CONFIG_EXT_PARTITION
Jingning Han's avatar
Jingning Han committed
650 651
};

652
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
653
static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES_ALL] = {
Jingning Han's avatar
Jingning Han committed
654
  // 2X2,    2X4,      4X2,
655
#if CONFIG_CHROMA_2X2
Jingning Han's avatar
Jingning Han committed
656
  TX_2X2,    TX_2X2,   TX_2X2,
657
#elif CONFIG_CHROMA_SUB8X8
658
  TX_4X4,    TX_4X4,   TX_4X4,
659
#endif  // CONFIG_CHROMA_SUB8X8
660 661 662 663 664
  //                   4X4
                       TX_4X4,
  // 4X8,    8X4,      8X8
  TX_4X8,    TX_8X4,   TX_8X8,
  // 8X16,   16X8,     16X16
665
  TX_8X16,   TX_16X8,  TX_16X16,
666
  // 16X32,  32X16,    32X32
667
  TX_16X32,  TX_32X16, TX_32X32,
668
#if CONFIG_TX64X64
669
  // 32X64,  64X32,
670
  TX_32X64,  TX_64X32,
671 672 673 674 675 676 677
  // 64X64
  TX_64X64,
#if CONFIG_EXT_PARTITION
  // 64x128, 128x64,   128x128
  TX_64X64,  TX_64X64, TX_64X64,
#endif  // CONFIG_EXT_PARTITION
#else
678 679
  // 32X64,  64X32,
  TX_32X32,  TX_32X32,
680 681
  // 64X64
  TX_32X32,
682 683 684 685
#if CONFIG_EXT_PARTITION
  // 64x128, 128x64,   128x128
  TX_32X32,  TX_32X32, TX_32X32,
#endif  // CONFIG_EXT_PARTITION
686
#endif  // CONFIG_TX64X64
Yue Chen's avatar
Yue Chen committed
687 688 689 690
#if CONFIG_RECT_TX_EXT
  // 4x16,   16x4,     8x32
  TX_4X16,   TX_16X4,  TX_8X32,
  // 32x8
691
  TX_32X8,
Yue Chen's avatar
Yue Chen committed
692
#else
693 694 695
  // 4x16,   16x4,     8x32
  TX_4X8,    TX_8X4,   TX_8X16,
  // 32x8
696
  TX_16X8,
Yue Chen's avatar
Yue Chen committed
697
#endif
698 699 700 701 702 703
  // 16x64,  64x16
  TX_16X32,  TX_32X16,
#if CONFIG_EXT_PARTITION
  // 32x128  128x32
  TX_32X32,  TX_32X32
#endif  // CONFIG_EXT_PARTITION
704
};
705

Yue Chen's avatar
Yue Chen committed
706
#if CONFIG_RECT_TX_EXT
707
static const TX_SIZE quarter_txsize_lookup[BLOCK_SIZES_ALL] = {
708
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
  //     2X2,        2X4,        4X2,
  TX_INVALID, TX_INVALID, TX_INVALID,
#endif
  //                             4x4,
                          TX_INVALID,
  //     4x8,        8x4,        8x8,
  TX_INVALID, TX_INVALID, TX_INVALID,
  // 8x16, 16x8, 16x16,
  TX_4X16, TX_16X4, TX_INVALID,
  // 16x32, 32x16, 32x32,
  TX_8X32, TX_32X8, TX_INVALID,
  // 32x64, 64x32, 64x64
  TX_INVALID, TX_INVALID, TX_INVALID,
#if CONFIG_EXT_PARTITION
  // 64x128, 128x64, 128x128
  TX_INVALID, TX_INVALID, TX_INVALID,
#endif
726 727
  // 4x16,    16x4,       8x32
  TX_4X16,    TX_16X4,    TX_8X32,
728
  // 32x8     16x64       64x16
729 730 731 732 733
  TX_32X8,    TX_INVALID, TX_INVALID,
#if CONFIG_EXT_PARTITION
  // 32x128   128x32
  TX_INVALID, TX_INVALID
#endif  // CONFIG_EXT_PARTITION
734
};
Yue Chen's avatar
Yue Chen committed
735
#endif
Jingning Han's avatar
Jingning Han committed
736 737
#else
#define max_txsize_rect_lookup max_txsize_lookup
738
#endif  // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
739

740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755
static const TX_TYPE_1D vtx_tab[TX_TYPES] = {
  DCT_1D,      ADST_1D, DCT_1D,      ADST_1D,
#if CONFIG_EXT_TX
  FLIPADST_1D, DCT_1D,  FLIPADST_1D, ADST_1D, FLIPADST_1D, IDTX_1D,
  DCT_1D,      IDTX_1D, ADST_1D,     IDTX_1D, FLIPADST_1D, IDTX_1D,
#endif  // CONFIG_EXT_TX
};

static const TX_TYPE_1D htx_tab[TX_TYPES] = {
  DCT_1D,  DCT_1D,      ADST_1D,     ADST_1D,
#if CONFIG_EXT_TX
  DCT_1D,  FLIPADST_1D, FLIPADST_1D, FLIPADST_1D, ADST_1D, IDTX_1D,
  IDTX_1D, DCT_1D,      IDTX_1D,     ADST_1D,     IDTX_1D, FLIPADST_1D,
#endif  // CONFIG_EXT_TX
};

756
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
757 758 759
// Same as "max_txsize_lookup[bsize] - TX_8X8", except for rectangular
// block which may use a rectangular transform, in which  case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
760
static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
Jingning Han's avatar
Jingning Han committed
761
#if CONFIG_CB4X4
762
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
763 764
  // 2X2,             2X4,                4X2,
  INT32_MIN,          INT32_MIN,          INT32_MIN,
765
#endif
766 767 768 769
  //                                      4X4,
                                          INT32_MIN,
  // 4X8,             8X4,                8X8,
  TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,
770
#else  // CONFIG_CB4X4
771 772 773 774
  //                                      4X4
                                          INT32_MIN,
  // 4X8,             8X4,                8X8
  INT32_MIN,          INT32_MIN,          TX_8X8 - TX_8X8,
775
#endif  // CONFIG_CB4X4
776
  // 8X16,            16X8,               16X16
777
  TX_16X16 - TX_8X8,  TX_16X16 - TX_8X8,  TX_16X16 - TX_8X8,
778
  // 16X32,           32X16,              32X32
779
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,
780
#if CONFIG_TX64X64
781 782
  // 32X64,           64X32,
  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,
783 784 785 786 787 788 789
  // 64X64
  TX_64X64 - TX_8X8,
#if CONFIG_EXT_PARTITION
  // 64x128,          128x64,             128x128
  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,
#endif  // CONFIG_EXT_PARTITION
#else
790 791
  // 32X64,           64X32,
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,
792 793
  // 64X64
  TX_32X32 - TX_8X8,
794 795 796 797
#if CONFIG_EXT_PARTITION
  // 64x128,          128x64,             128x128
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,
#endif  // CONFIG_EXT_PARTITION
798
#endif  // CONFIG_TX64X64
799 800
  // TODO(david.barker): Change these if we support rectangular transforms
  // for 4:1 shaped partitions
801 802 803
  // 4x16,            16x4,               8x32
  TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,
  // 32x8,            16x64,              64x16
804 805 806 807 808
  TX_8X8 - TX_8X8,    TX_16X16 - TX_8X8,  TX_16X16 - TX_8X8,
#if CONFIG_EXT_PARTITION
  // 32x128,          128x32
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8
#endif  // CONFIG_EXT_PARTITION
809
};
810 811
#else
// Same as "max_txsize_lookup[bsize] - TX_8X8", invalid for bsize < 8X8
812
static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
813
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
Jingning Han's avatar
Jingning Han committed
814 815 816
  // 2X2,             2X4,                4X2,
  INT32_MIN,          INT32_MIN,          INT32_MIN,
#endif
817 818 819
  //                                      4X4
                                          INT32_MIN,
  // 4X8,             8X4,                8X8
820
  INT32_MIN,          INT32_MIN,          TX_8X8 - TX_8X8,
821
  // 8X16,            16X8,               16X16
822
  TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,    TX_16X16 - TX_8X8,
823
  // 16X32,           32X16,              32X32
824
  TX_16X16 - TX_8X8,  TX_16X16 - TX_8X8,  TX_32X32 - TX_8X8,
825
#if CONFIG_TX64X64
826 827
  // 32X64,           64X32,
  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,
828 829 830 831 832 833 834
  // 64X64
  TX_64X64 - TX_8X8,
#if CONFIG_EXT_PARTITION
  // 64x128,          128x64,             128x128
  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,  TX_64X64 - TX_8X8,
#endif  // CONFIG_EXT_PARTITION
#else
835 836
  // 32X64,           64X32,
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,
837 838
  // 64X64
  TX_32X32 - TX_8X8,
839 840 841 842
#if CONFIG_EXT_PARTITION
  // 64x128,          128x64,             128x128
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8,
#endif  // CONFIG_EXT_PARTITION
843
#endif  // CONFIG_TX64X64
844 845 846
  // 4x16,            16x4,               8x32
  TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,    TX_8X8 - TX_8X8,
  // 32x8             16x64,              64x16
Debargha Mukherjee's avatar
Debargha Mukherjee committed
847
  TX_8X8 - TX_8X8,    TX_16X16 - TX_8X8,  TX_16X16 - TX_8X8,
848 849 850 851
#if CONFIG_EXT_PARTITION
  // 32x128,          128x32
  TX_32X32 - TX_8X8,  TX_32X32 - TX_8X8
#endif  // CONFIG_EXT_PARTITION
852
};
853
#endif  // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
854

855 856
#define inter_tx_size_cat_lookup intra_tx_size_cat_lookup

clang-format's avatar
clang-format committed
857
/* clang-format on */
858

859
static const TX_SIZE sub_tx_size_map[TX_SIZES_ALL] = {
860
#if CONFIG_CHROMA_2X2
861 862 863 864 865 866
  TX_2X2,  // TX_2X2
#endif
  TX_4X4,    // TX_4X4
  TX_4X4,    // TX_8X8
  TX_8X8,    // TX_16X16
  TX_16X16,  // TX_32X32
867 868 869
#if CONFIG_TX64X64
  TX_32X32,  // TX_64X64
#endif       // CONFIG_TX64X64
870 871 872 873 874
  TX_4X4,    // TX_4X8
  TX_4X4,    // TX_8X4
  TX_8X8,    // TX_8X16
  TX_8X8,    // TX_16X8
  TX_16X16,  // TX_16X32
875
  TX_16X16,  // TX_32X16
876 877 878 879
#if CONFIG_TX64X64
  TX_32X32,  // TX_32X64
  TX_32X32,  // TX_64X32
#endif       // CONFIG_TX64X64
880 881 882 883
  TX_4X4,    // TX_4X16
  TX_4X4,    // TX_16X4
  TX_8X8,    // TX_8X32
  TX_8X8,    // TX_32X8
884 885
};

886
static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = {
887
#if CONFIG_CHROMA_2X2
888 889
  TX_2X2,  // TX_2X2
#endif
890 891 892 893
  TX_4X4,    // TX_4X4
  TX_8X8,    // TX_8X8
  TX_16X16,  // TX_16X16
  TX_32X32,  // TX_32X32
894 895 896
#if CONFIG_TX64X64
  TX_64X64,  // TX_64X64
#endif       // CONFIG_TX64X64
897 898 899 900 901
  TX_4X4,    // TX_4X8
  TX_8X8,    // TX_8X4
  TX_8X8,    // TX_8X16
  TX_16X16,  // TX_16X8
  TX_16X16,  // TX_16X32
902
  TX_32X32,  // TX_32X16
903 904 905 906
#if CONFIG_TX64X64
  TX_32X32,  // TX_32X64
  TX_64X64,  // TX_64X32
#endif       // CONFIG_TX64X64
907 908 909 910
  TX_4X4,    // TX_4X16
  TX_16X16,  // TX_16X4
  TX_8X8,    // TX_8X32
  TX_32X32,  // TX_32X8
911 912 913
};

static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
914
#if CONFIG_CHROMA_2X2
915 916
  TX_2X2,  // TX_2X2
#endif
917 918 919 920
  TX_4X4,    // TX_4X4
  TX_8X8,    // TX_8X8
  TX_16X16,  // TX_16X16
  TX_32X32,  // TX_32X32
921 922 923
#if CONFIG_TX64X64
  TX_64X64,  // TX_64X64
#endif       // CONFIG_TX64X64
924 925 926 927 928
  TX_8X8,    // TX_4X8
  TX_4X4,    // TX_8X4
  TX_16X16,  // TX_8X16
  TX_8X8,    // TX_16X8
  TX_32X32,  // TX_16X32
929
  TX_16X16,  // TX_32X16
930 931 932 933
#if CONFIG_TX64X64
  TX_64X64,  // TX_32X64
  TX_32X32,  // TX_64X32
#endif       // CONFIG_TX64X64
934 935 936 937
  TX_16X16,  // TX_4X16
  TX_4X4,    // TX_16X4
  TX_32X32,  // TX_8X32
  TX_8X8,    // TX_32X8
938 939
};

940
#if CONFIG_CHROMA_2X2
Angie Chiang's avatar
Angie Chiang committed
941 942 943 944 945
#define TX_SIZE_W_MIN 2
#else
#define TX_SIZE_W_MIN 4
#endif

946 947
// Transform block width in pixels
static const int tx_size_wide[TX_SIZES_ALL] = {
948
#if CONFIG_CHROMA_2X2
949 950
  2,
#endif
951
  4,  8,  16, 32,
952 953 954
#if CONFIG_TX64X64
  64,
#endif  // CONFIG_TX64X64
955 956 957 958 959
  4,  8,  8,  16, 16, 32,
#if CONFIG_TX64X64
  32, 64,
#endif  // CONFIG_TX64X64
  4,  16, 8,  32
960 961
};

962
#if CONFIG_CHROMA_2X2
Angie Chiang's avatar
Angie Chiang committed
963 964 965 966 967
#define TX_SIZE_H_MIN 2
#else
#define TX_SIZE_H_MIN 4
#endif

968 969
// Transform block height in pixels
static const int tx_size_high[TX_SIZES_ALL] = {
970
#if CONFIG_CHROMA_2X2
971 972
  2,
#endif
973
  4,  8,  16, 32,
974 975 976
#if CONFIG_TX64X64
  64,
#endif  // CONFIG_TX64X64
977 978 979 980 981
  8,  4,  16, 8,  32, 16,
#if CONFIG_TX64X64
  64, 32,
#endif  // CONFIG_TX64X64
  16, 4,  32, 8
982 983 984 985
};

// Transform block width in unit
static const int tx_size_wide_unit[TX_SIZES_ALL] = {
986
#if CONFIG_CHROMA_2X2
987
  1,  2,  4, 8, 16,
988 989 990
#if CONFIG_TX64X64
  32,
#endif  // CONFIG_TX64X64
991