blob: 225040e0db356e38272329d052e804b95d0b2a79 [file] [log] [blame]
/*
* Copyright (c) 2021, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 3-Clause Clear License
* and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
* License was not distributed with this source code in the LICENSE file, you
* can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. 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
* aomedia.org/license/patent-license/.
*/
#ifndef AOM_AV1_COMMON_COMMON_DATA_H_
#define AOM_AV1_COMMON_COMMON_DATA_H_
#include <assert.h>
#include <stdbool.h>
#include "av1/common/enums.h"
#include "aom/aom_integer.h"
#include "aom_dsp/aom_dsp_common.h"
#ifdef __cplusplus
extern "C" {
#endif
// Log 2 conversion lookup tables in units of mode info (4x4).
// The Mi_Width_Log2 table in the spec (Section 9.3. Conversion tables).
static const uint8_t mi_size_wide_log2[BLOCK_SIZES_ALL] = {
0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 0, 2, 1, 3, 2, 4
};
// The Mi_Height_Log2 table in the spec (Section 9.3. Conversion tables).
static const uint8_t mi_size_high_log2[BLOCK_SIZES_ALL] = {
0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 2, 0, 3, 1, 4, 2
};
// Width/height lookup tables in units of mode info (4x4).
// The Num_4x4_Blocks_Wide table in the spec (Section 9.3. Conversion tables).
static const uint8_t mi_size_wide[BLOCK_SIZES_ALL] = {
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 1, 4, 2, 8, 4, 16
};
// The Num_4x4_Blocks_High table in the spec (Section 9.3. Conversion tables).
static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 4, 1, 8, 2, 16, 4
};
// Width/height lookup tables in units of samples.
// The Block_Width table in the spec (Section 9.3. Conversion tables).
static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32,
64, 64, 64, 128, 128, 4, 16, 8, 32, 16, 64
};
// The Block_Height table in the spec (Section 9.3. Conversion tables).
static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64,
32, 64, 128, 64, 128, 16, 4, 32, 8, 64, 16
};
// Maps a block size to a context.
// The Size_Group table in the spec (Section 9.3. Conversion tables).
// AOMMIN(3, AOMMIN(mi_size_wide_log2(bsize), mi_size_high_log2(bsize)))
static const uint8_t size_group_lookup[BLOCK_SIZES_ALL] = {
0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 0, 0, 1, 1, 2, 2
};
static const uint8_t fsc_bsize_groups[BLOCK_SIZES_ALL] = {
0, 1, 1, 2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 5, 5, 5, 5
};
static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 6, 6, 8, 8, 10, 10
};
#if CONFIG_EXT_RECUR_PARTITIONS
/*! \brief Maps the symbol transmitted through the bitstream to the partition
* type for a wide block. */
static const PARTITION_TYPE
partition_map_from_symbol_block_wgth[PARTITION_TYPES_REC] = {
PARTITION_NONE,
PARTITION_VERT,
PARTITION_VERT_3,
PARTITION_HORZ,
};
/*! \brief Maps the partition type to the symbol to be transmitted through the
* bitstream for a wide block. */
static const PARTITION_TYPE_REC
symbol_map_from_partition_block_wgth[EXT_PARTITION_TYPES] = {
PARTITION_NONE_REC, PARTITION_SHORT_SIDE_2_REC,
PARTITION_LONG_SIDE_2_REC, PARTITION_INVALID_REC,
PARTITION_LONG_SIDE_3_REC,
};
/*! \brief Maps the symbol transmitted through the bitstream to the partition
* type for a tall block. */
static const PARTITION_TYPE
partition_map_from_symbol_block_hgtw[PARTITION_TYPES_REC] = {
PARTITION_NONE,
PARTITION_HORZ,
PARTITION_HORZ_3,
PARTITION_VERT,
};
/*! \brief Maps the partition type to the symbol to be transmitted through the
* bitstream for a tall block. */
static const PARTITION_TYPE_REC
symbol_map_from_partition_block_hgtw[EXT_PARTITION_TYPES] = {
PARTITION_NONE_REC, PARTITION_LONG_SIDE_2_REC,
PARTITION_SHORT_SIDE_2_REC, PARTITION_LONG_SIDE_3_REC,
PARTITION_INVALID_REC,
};
/* clang-format off */
// This table covers all square blocks and 1:2/2:1 rectangular blocks
static const BLOCK_SIZE
subsize_lookup[EXT_PARTITION_TYPES + 1][BLOCK_SIZES_ALL] = {
{ // PARTITION_NONE
BLOCK_4X4, BLOCK_4X8, BLOCK_8X4, BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
BLOCK_16X16, BLOCK_16X32, BLOCK_32X16, BLOCK_32X32, BLOCK_32X64,
BLOCK_64X32, BLOCK_64X64, BLOCK_64X128, BLOCK_128X64, BLOCK_128X128,
BLOCK_4X16, BLOCK_16X4, BLOCK_8X32, BLOCK_32X8, BLOCK_16X64, BLOCK_64X16,
}, { // PARTITION_HORZ
BLOCK_INVALID, BLOCK_4X4, BLOCK_INVALID, BLOCK_8X4, BLOCK_8X8, BLOCK_16X4,
BLOCK_16X8, BLOCK_16X16, BLOCK_32X8, BLOCK_32X16, BLOCK_32X32, BLOCK_64X16,
BLOCK_64X32, BLOCK_64X64, BLOCK_INVALID, BLOCK_128X64,
BLOCK_4X8, BLOCK_INVALID, BLOCK_8X16, BLOCK_INVALID, BLOCK_16X32,
BLOCK_INVALID,
}, { // PARTITION_VERT
BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X4, BLOCK_4X8, BLOCK_4X16, BLOCK_8X8,
BLOCK_8X16, BLOCK_8X32, BLOCK_16X16, BLOCK_16X32, BLOCK_16X64, BLOCK_32X32,
BLOCK_32X64, BLOCK_INVALID, BLOCK_64X64, BLOCK_64X128,
BLOCK_INVALID, BLOCK_8X4, BLOCK_INVALID, BLOCK_16X8, BLOCK_INVALID,
BLOCK_32X16,
}, { // PARTITION_HORZ_3
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X4,
BLOCK_INVALID, BLOCK_16X4, BLOCK_16X8, BLOCK_INVALID, BLOCK_32X8,
BLOCK_32X16, BLOCK_INVALID, BLOCK_64X16, BLOCK_INVALID, BLOCK_INVALID,
BLOCK_INVALID, BLOCK_4X4, BLOCK_INVALID, BLOCK_8X8, BLOCK_INVALID,
BLOCK_16X16, BLOCK_INVALID,
}, { // PARTITION_VERT_3
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
BLOCK_4X8, BLOCK_4X16, BLOCK_INVALID, BLOCK_8X16, BLOCK_8X32, BLOCK_INVALID,
BLOCK_16X32, BLOCK_16X64, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
BLOCK_INVALID, BLOCK_4X4, BLOCK_INVALID, BLOCK_8X8, BLOCK_INVALID,
BLOCK_16X16,
}, { // PARTITION_SPLIT
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X4, BLOCK_INVALID,
BLOCK_INVALID, BLOCK_8X8, BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X16,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_32X32, BLOCK_INVALID, BLOCK_INVALID,
BLOCK_64X64, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
BLOCK_INVALID, BLOCK_INVALID,
},
};
static AOM_INLINE PARTITION_TYPE sdp_chroma_part_from_luma(BLOCK_SIZE bsize,
PARTITION_TYPE luma_part, int ssx,
int ssy) {
const int bh_chr = block_size_high[bsize] >> ssy;
const int bw_chr = block_size_wide[bsize] >> ssx;
switch (luma_part) {
case PARTITION_NONE: return PARTITION_NONE;
case PARTITION_HORZ: return (bh_chr < 8) ? PARTITION_NONE : PARTITION_HORZ;
case PARTITION_HORZ_3:
if (bh_chr >= 16)
return PARTITION_HORZ_3;
else
return (bh_chr < 8) ? PARTITION_NONE : PARTITION_HORZ;
case PARTITION_VERT: return (bw_chr < 8) ? PARTITION_NONE : PARTITION_VERT;
case PARTITION_VERT_3:
if (bw_chr >= 16)
return PARTITION_VERT_3;
else
return (bw_chr < 8) ? PARTITION_NONE : PARTITION_VERT;
default: assert(0);
}
return PARTITION_INVALID;
}
#else // CONFIG_EXT_RECUR_PARTITIONS
// A compressed version of the Partition_Subsize table in the spec (9.3.
// Conversion tables), for square block sizes only.
/* clang-format off */
static const BLOCK_SIZE subsize_lookup[EXT_PARTITION_TYPES][SQR_BLOCK_SIZES] = {
{ // PARTITION_NONE
BLOCK_4X4, BLOCK_8X8, BLOCK_16X16,
BLOCK_32X32, BLOCK_64X64, BLOCK_128X128
}, { // PARTITION_HORZ
BLOCK_INVALID, BLOCK_8X4, BLOCK_16X8,
BLOCK_32X16, BLOCK_64X32, BLOCK_128X64
}, { // PARTITION_VERT
BLOCK_INVALID, BLOCK_4X8, BLOCK_8X16,
BLOCK_16X32, BLOCK_32X64, BLOCK_64X128
}, { // PARTITION_SPLIT
BLOCK_INVALID, BLOCK_4X4, BLOCK_8X8,
BLOCK_16X16, BLOCK_32X32, BLOCK_64X64
}, { // PARTITION_HORZ_A
BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X8,
BLOCK_32X16, BLOCK_64X32, BLOCK_128X64
}, { // PARTITION_HORZ_B
BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X8,
BLOCK_32X16, BLOCK_64X32, BLOCK_128X64
}, { // PARTITION_VERT_A
BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X16,
BLOCK_16X32, BLOCK_32X64, BLOCK_64X128
}, { // PARTITION_VERT_B
BLOCK_INVALID, BLOCK_INVALID, BLOCK_8X16,
BLOCK_16X32, BLOCK_32X64, BLOCK_64X128
}, { // PARTITION_HORZ_4
BLOCK_INVALID, BLOCK_INVALID, BLOCK_16X4,
BLOCK_32X8, BLOCK_64X16, BLOCK_INVALID
}, { // PARTITION_VERT_4
BLOCK_INVALID, BLOCK_INVALID, BLOCK_4X16,
BLOCK_8X32, BLOCK_16X64, BLOCK_INVALID
}
};
#endif // CONFIG_EXT_RECUR_PARTITIONS
static const TX_SIZE max_txsize_lookup[BLOCK_SIZES_ALL] = {
// 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,
// 32X64, 64X32,
TX_32X32, TX_32X32,
// 64X64
TX_64X64,
// 64x128, 128x64, 128x128
TX_64X64, TX_64X64, TX_64X64,
// 4x16, 16x4, 8x32
TX_4X4, TX_4X4, TX_8X8,
// 32x8, 16x64 64x16
TX_8X8, TX_16X16, TX_16X16
};
static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES_ALL] = {
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
TX_4X8, TX_8X4, TX_8X8,
// 8X16, 16X8, 16X16
TX_8X16, TX_16X8, TX_16X16,
// 16X32, 32X16, 32X32
TX_16X32, TX_32X16, TX_32X32,
// 32X64, 64X32,
TX_32X64, TX_64X32,
// 64X64
TX_64X64,
// 64x128, 128x64, 128x128
TX_64X64, TX_64X64, TX_64X64,
// 4x16, 16x4,
TX_4X16, TX_16X4,
// 8x32, 32x8
TX_8X32, TX_32X8,
// 16x64, 64x16
TX_16X64, TX_64X16
};
static const TX_TYPE_1D vtx_tab[TX_TYPES] = {
DCT_1D, ADST_1D, DCT_1D, ADST_1D,
FLIPADST_1D, DCT_1D, FLIPADST_1D, ADST_1D, FLIPADST_1D, IDTX_1D,
DCT_1D, IDTX_1D, ADST_1D, IDTX_1D, FLIPADST_1D, IDTX_1D,
};
static const TX_TYPE_1D htx_tab[TX_TYPES] = {
DCT_1D, DCT_1D, ADST_1D, ADST_1D,
DCT_1D, FLIPADST_1D, FLIPADST_1D, FLIPADST_1D, ADST_1D, IDTX_1D,
IDTX_1D, DCT_1D, IDTX_1D, ADST_1D, IDTX_1D, FLIPADST_1D,
};
#define TXSIZE_CAT_INVALID (-1)
/* clang-format on */
#if CONFIG_NEW_TX_PARTITION
// Smallest sub_tx size units. Used to compute the index in the
// tx type map.
static const TX_SIZE smallest_sub_tx_size_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_4X4, // TX_8X8
TX_4X4, // TX_16X16
TX_8X8, // TX_32X32
TX_16X16, // TX_64X64
TX_4X4, // TX_4X8
TX_4X4, // TX_8X4
TX_4X4, // TX_8X16
TX_4X4, // TX_16X8
TX_4X8, // TX_16X32
TX_8X4, // TX_32X16
TX_8X16, // TX_32X64
TX_16X8, // TX_64X32
TX_4X4, // TX_4X16
TX_4X4, // TX_16X4
TX_4X8, // TX_8X32
TX_8X4, // TX_32X8
TX_4X16, // TX_16X64
TX_16X4, // TX_64X16
};
#endif // CONFIG_NEW_TX_PARTITION
static const TX_SIZE sub_tx_size_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_4X4, // TX_8X8
TX_8X8, // TX_16X16
TX_16X16, // TX_32X32
TX_32X32, // TX_64X64
TX_4X4, // TX_4X8
TX_4X4, // TX_8X4
TX_8X8, // TX_8X16
TX_8X8, // TX_16X8
TX_16X16, // TX_16X32
TX_16X16, // TX_32X16
TX_32X32, // TX_32X64
TX_32X32, // TX_64X32
TX_4X8, // TX_4X16
TX_8X4, // TX_16X4
TX_8X16, // TX_8X32
TX_16X8, // TX_32X8
TX_16X32, // TX_16X64
TX_32X16, // TX_64X16
};
static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
TX_64X64, // TX_64X64
TX_4X4, // TX_4X8
TX_8X8, // TX_8X4
TX_8X8, // TX_8X16
TX_16X16, // TX_16X8
TX_16X16, // TX_16X32
TX_32X32, // TX_32X16
TX_32X32, // TX_32X64
TX_64X64, // TX_64X32
TX_4X4, // TX_4X16
TX_16X16, // TX_16X4
TX_8X8, // TX_8X32
TX_32X32, // TX_32X8
TX_16X16, // TX_16X64
TX_64X64, // TX_64X16
};
static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
TX_64X64, // TX_64X64
TX_8X8, // TX_4X8
TX_4X4, // TX_8X4
TX_16X16, // TX_8X16
TX_8X8, // TX_16X8
TX_32X32, // TX_16X32
TX_16X16, // TX_32X16
TX_64X64, // TX_32X64
TX_32X32, // TX_64X32
TX_16X16, // TX_4X16
TX_4X4, // TX_16X4
TX_32X32, // TX_8X32
TX_8X8, // TX_32X8
TX_64X64, // TX_16X64
TX_16X16, // TX_64X16
};
#define TX_SIZE_W_MIN 4
// Transform block width in pixels
static const int tx_size_wide[TX_SIZES_ALL] = {
4, 8, 16, 32, 64, 4, 8, 8, 16, 16, 32, 32, 64, 4, 16, 8, 32, 16, 64,
};
#define TX_SIZE_H_MIN 4
// Transform block height in pixels
static const int tx_size_high[TX_SIZES_ALL] = {
4, 8, 16, 32, 64, 8, 4, 16, 8, 32, 16, 64, 32, 16, 4, 32, 8, 64, 16,
};
// Transform block width in unit
static const int tx_size_wide_unit[TX_SIZES_ALL] = {
1, 2, 4, 8, 16, 1, 2, 2, 4, 4, 8, 8, 16, 1, 4, 2, 8, 4, 16,
};
// Transform block height in unit
static const int tx_size_high_unit[TX_SIZES_ALL] = {
1, 2, 4, 8, 16, 2, 1, 4, 2, 8, 4, 16, 8, 4, 1, 8, 2, 16, 4,
};
// Transform block width in log2
static const int tx_size_wide_log2[TX_SIZES_ALL] = {
2, 3, 4, 5, 6, 2, 3, 3, 4, 4, 5, 5, 6, 2, 4, 3, 5, 4, 6,
};
// Transform block height in log2
static const int tx_size_high_log2[TX_SIZES_ALL] = {
2, 3, 4, 5, 6, 3, 2, 4, 3, 5, 4, 6, 5, 4, 2, 5, 3, 6, 4,
};
static const int tx_size_2d[TX_SIZES_ALL + 1] = {
16, 64, 256, 1024, 4096, 32, 32, 128, 128, 512,
512, 2048, 2048, 64, 64, 256, 256, 1024, 1024,
};
static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = {
BLOCK_4X4, // TX_4X4
BLOCK_8X8, // TX_8X8
BLOCK_16X16, // TX_16X16
BLOCK_32X32, // TX_32X32
BLOCK_64X64, // TX_64X64
BLOCK_4X8, // TX_4X8
BLOCK_8X4, // TX_8X4
BLOCK_8X16, // TX_8X16
BLOCK_16X8, // TX_16X8
BLOCK_16X32, // TX_16X32
BLOCK_32X16, // TX_32X16
BLOCK_32X64, // TX_32X64
BLOCK_64X32, // TX_64X32
BLOCK_4X16, // TX_4X16
BLOCK_16X4, // TX_16X4
BLOCK_8X32, // TX_8X32
BLOCK_32X8, // TX_32X8
BLOCK_16X64, // TX_16X64
BLOCK_64X16, // TX_64X16
};
static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
TX_64X64, // TX_64X64
TX_4X4, // TX_4X8
TX_4X4, // TX_8X4
TX_8X8, // TX_8X16
TX_8X8, // TX_16X8
TX_16X16, // TX_16X32
TX_16X16, // TX_32X16
TX_32X32, // TX_32X64
TX_32X32, // TX_64X32
TX_4X4, // TX_4X16
TX_4X4, // TX_16X4
TX_8X8, // TX_8X32
TX_8X8, // TX_32X8
TX_16X16, // TX_16X64
TX_16X16, // TX_64X16
};
static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
TX_64X64, // TX_64X64
TX_8X8, // TX_4X8
TX_8X8, // TX_8X4
TX_16X16, // TX_8X16
TX_16X16, // TX_16X8
TX_32X32, // TX_16X32
TX_32X32, // TX_32X16
TX_64X64, // TX_32X64
TX_64X64, // TX_64X32
TX_16X16, // TX_4X16
TX_16X16, // TX_16X4
TX_32X32, // TX_8X32
TX_32X32, // TX_32X8
TX_64X64, // TX_16X64
TX_64X64, // TX_64X16
};
static const int8_t txsize_log2_minus4[TX_SIZES_ALL] = {
0, // TX_4X4
2, // TX_8X8
4, // TX_16X16
6, // TX_32X32
6, // TX_64X64
1, // TX_4X8
1, // TX_8X4
3, // TX_8X16
3, // TX_16X8
5, // TX_16X32
5, // TX_32X16
6, // TX_32X64
6, // TX_64X32
2, // TX_4X16
2, // TX_16X4
4, // TX_8X32
4, // TX_32X8
5, // TX_16X64
5, // TX_64X16
};
/* clang-format off */
static const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
TX_4X4, // ONLY_4X4
TX_64X64, // TX_MODE_LARGEST
TX_64X64, // TX_MODE_SELECT
};
// The Subsampled_Size table in the spec (Section 5.11.38. Get plane residual
// size function).
#if CONFIG_EXT_RECUR_PARTITIONS
static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES_ALL][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
{ { BLOCK_4X4, BLOCK_4X4 }, { BLOCK_4X4, BLOCK_4X4 } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_4X4 } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X4 } },
{ { BLOCK_8X8, BLOCK_8X4 }, { BLOCK_4X8, BLOCK_4X4 } },
{ { BLOCK_8X16, BLOCK_8X8 }, { BLOCK_4X16, BLOCK_4X8 } },
{ { BLOCK_16X8, BLOCK_16X4 }, { BLOCK_8X8, BLOCK_8X4 } },
{ { BLOCK_16X16, BLOCK_16X8 }, { BLOCK_8X16, BLOCK_8X8 } },
{ { BLOCK_16X32, BLOCK_16X16 }, { BLOCK_8X32, BLOCK_8X16 } },
{ { BLOCK_32X16, BLOCK_32X8 }, { BLOCK_16X16, BLOCK_16X8 } },
{ { BLOCK_32X32, BLOCK_32X16 }, { BLOCK_16X32, BLOCK_16X16 } },
{ { BLOCK_32X64, BLOCK_32X32 }, { BLOCK_16X64, BLOCK_16X32 } },
{ { BLOCK_64X32, BLOCK_64X16 }, { BLOCK_32X32, BLOCK_32X16 } },
{ { BLOCK_64X64, BLOCK_64X32 }, { BLOCK_32X64, BLOCK_32X32 } },
{ { BLOCK_64X128, BLOCK_64X64 }, { BLOCK_INVALID, BLOCK_32X64 } },
{ { BLOCK_128X64, BLOCK_INVALID }, { BLOCK_64X64, BLOCK_64X32 } },
{ { BLOCK_128X128, BLOCK_128X64 }, { BLOCK_64X128, BLOCK_64X64 } },
{ { BLOCK_4X16, BLOCK_4X8 }, { BLOCK_INVALID, BLOCK_4X8 } },
{ { BLOCK_16X4, BLOCK_INVALID }, { BLOCK_8X4, BLOCK_8X4 } },
{ { BLOCK_8X32, BLOCK_8X16 }, { BLOCK_INVALID, BLOCK_4X16 } },
{ { BLOCK_32X8, BLOCK_INVALID }, { BLOCK_16X8, BLOCK_16X4 } },
{ { BLOCK_16X64, BLOCK_16X32 }, { BLOCK_INVALID, BLOCK_8X32 } },
{ { BLOCK_64X16, BLOCK_INVALID }, { BLOCK_32X16, BLOCK_32X8 } }
};
#else
static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES_ALL][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
{ { BLOCK_4X4, BLOCK_4X4 }, { BLOCK_4X4, BLOCK_4X4 } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_4X4 } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X4 } },
{ { BLOCK_8X8, BLOCK_8X4 }, { BLOCK_4X8, BLOCK_4X4 } },
{ { BLOCK_8X16, BLOCK_8X8 }, { BLOCK_INVALID, BLOCK_4X8 } },
{ { BLOCK_16X8, BLOCK_INVALID }, { BLOCK_8X8, BLOCK_8X4 } },
{ { BLOCK_16X16, BLOCK_16X8 }, { BLOCK_8X16, BLOCK_8X8 } },
{ { BLOCK_16X32, BLOCK_16X16 }, { BLOCK_INVALID, BLOCK_8X16 } },
{ { BLOCK_32X16, BLOCK_INVALID }, { BLOCK_16X16, BLOCK_16X8 } },
{ { BLOCK_32X32, BLOCK_32X16 }, { BLOCK_16X32, BLOCK_16X16 } },
{ { BLOCK_32X64, BLOCK_32X32 }, { BLOCK_INVALID, BLOCK_16X32 } },
{ { BLOCK_64X32, BLOCK_INVALID }, { BLOCK_32X32, BLOCK_32X16 } },
{ { BLOCK_64X64, BLOCK_64X32 }, { BLOCK_32X64, BLOCK_32X32 } },
{ { BLOCK_64X128, BLOCK_64X64 }, { BLOCK_INVALID, BLOCK_32X64 } },
{ { BLOCK_128X64, BLOCK_INVALID }, { BLOCK_64X64, BLOCK_64X32 } },
{ { BLOCK_128X128, BLOCK_128X64 }, { BLOCK_64X128, BLOCK_64X64 } },
{ { BLOCK_4X16, BLOCK_4X8 }, { BLOCK_INVALID, BLOCK_4X8 } },
{ { BLOCK_16X4, BLOCK_INVALID }, { BLOCK_8X4, BLOCK_8X4 } },
{ { BLOCK_8X32, BLOCK_8X16 }, { BLOCK_INVALID, BLOCK_4X16 } },
{ { BLOCK_32X8, BLOCK_INVALID }, { BLOCK_16X8, BLOCK_16X4 } },
{ { BLOCK_16X64, BLOCK_16X32 }, { BLOCK_INVALID, BLOCK_8X32 } },
{ { BLOCK_64X16, BLOCK_INVALID }, { BLOCK_32X16, BLOCK_32X8 } }
};
#endif // CONFIG_EXT_RECUR_PARTITIONS
/* clang-format on */
// Generates 5 bit field in which each bit set to 1 represents
// a blocksize partition 11111 means we split 128x128, 64x64, 32x32, 16x16
// and 8x8. 10000 means we just split the 128x128 to 64x64
/* clang-format off */
static const struct {
PARTITION_CONTEXT above;
PARTITION_CONTEXT left;
} partition_context_lookup[BLOCK_SIZES_ALL] = {
{ 31, 31 }, // 4X4 - {0b11111, 0b11111}
{ 31, 30 }, // 4X8 - {0b11111, 0b11110}
{ 30, 31 }, // 8X4 - {0b11110, 0b11111}
{ 30, 30 }, // 8X8 - {0b11110, 0b11110}
{ 30, 28 }, // 8X16 - {0b11110, 0b11100}
{ 28, 30 }, // 16X8 - {0b11100, 0b11110}
{ 28, 28 }, // 16X16 - {0b11100, 0b11100}
{ 28, 24 }, // 16X32 - {0b11100, 0b11000}
{ 24, 28 }, // 32X16 - {0b11000, 0b11100}
{ 24, 24 }, // 32X32 - {0b11000, 0b11000}
{ 24, 16 }, // 32X64 - {0b11000, 0b10000}
{ 16, 24 }, // 64X32 - {0b10000, 0b11000}
{ 16, 16 }, // 64X64 - {0b10000, 0b10000}
{ 16, 0 }, // 64X128- {0b10000, 0b00000}
{ 0, 16 }, // 128X64- {0b00000, 0b10000}
{ 0, 0 }, // 128X128-{0b00000, 0b00000}
{ 31, 28 }, // 4X16 - {0b11111, 0b11100}
{ 28, 31 }, // 16X4 - {0b11100, 0b11111}
{ 30, 24 }, // 8X32 - {0b11110, 0b11000}
{ 24, 30 }, // 32X8 - {0b11000, 0b11110}
{ 28, 16 }, // 16X64 - {0b11100, 0b10000}
{ 16, 28 }, // 64X16 - {0b10000, 0b11100}
};
/* clang-format on */
static const int intra_mode_context[INTRA_MODES] = {
0, 1, 2, 3, 4, 4, 4, 4, 3, 0, 1, 2, 0,
};
// Note: this is also used in unit tests. So whenever one changes the table,
// the unit tests need to be changed accordingly.
static const int quant_dist_weight[4][2] = {
{ 2, 3 }, { 2, 5 }, { 2, 7 }, { 1, MAX_FRAME_DISTANCE }
};
static const int quant_dist_lookup_table[4][2] = {
{ 9, 7 },
{ 11, 5 },
{ 12, 4 },
{ 13, 3 },
};
#if CONFIG_ATC_NEWTXSETS
// Mapping of mode dependent TX based on intra modes.
static const int av1_md_class[INTRA_MODES] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
};
// Mapping between mode dependent TX size groups based on allowed TX sizes.
static const int av1_size_class[MODE_DEPTX_TXSIZES] = {
0, 1, 2, 3, 3, 0, 0, 1, 1, 2, 2, 3, 3, 0, 0, 1, 1, 2, 2,
};
#endif // CONFIG_ATC_NEWTXSETS
static AOM_INLINE bool is_bsize_geq(BLOCK_SIZE bsize1, BLOCK_SIZE bsize2) {
if (bsize1 == BLOCK_INVALID || bsize2 == BLOCK_INVALID) {
return false;
}
return block_size_wide[bsize1] >= block_size_wide[bsize2] &&
block_size_high[bsize1] >= block_size_high[bsize2];
}
static AOM_INLINE bool is_bsize_gt(BLOCK_SIZE bsize1, BLOCK_SIZE bsize2) {
if (bsize1 == BLOCK_INVALID || bsize2 == BLOCK_INVALID) {
return false;
}
return block_size_wide[bsize1] > block_size_wide[bsize2] &&
block_size_high[bsize1] > block_size_high[bsize2];
}
// Mapping of intra modes to IST kernel set
// Secondary transforms are enabled only intra modes < PAETH_PRED.
// Thus, the array size is kept as INTRA_MODES - 1
static const uint8_t stx_transpose_mapping[INTRA_MODES - 1] = {
// Array index :
0, // DC_PRED
1, // V_PRED
1, // H_PRED
2, // D45_PRED
3, // D135_PRED
4, // D113_PRED
4, // D157_PRED
5, // D203_PRED
5, // D67_PRED
6, // SMOOTH_PRED
1, // SMOOTH_V_PRED
1, // SMOOTH_H_PRED
};
// Scan order of primary transform coefficients for 4x4 IST when transpose
// mapping is used
static const int16_t stx_scan_orders_transpose_4x4[TX_SIZES][IST_4x4_WIDTH] = {
// TX_4XN
{ 0, 4, 1, 2, 5, 8, 12, 9, 6, 3, 7, 10, 13, 14, 11, 15 },
// TX_8XN
{ 0, 8, 1, 2, 9, 16, 24, 17, 10, 3, 11, 18, 25, 26, 19, 27 },
// TX_16XN
{ 0, 16, 1, 2, 17, 32, 48, 33, 18, 3, 19, 34, 49, 50, 35, 51 },
// TX_32XN
{ 0, 32, 1, 2, 33, 64, 96, 65, 34, 3, 35, 66, 97, 98, 67, 99 },
// TX_64XN
{ 0, 32, 1, 2, 33, 64, 96, 65, 34, 3, 35, 66, 97, 98, 67, 99 },
};
// Scan order of primary transform coefficients for 8x8 IST when transpose
// mapping is used
static const int16_t stx_scan_orders_transpose_8x8[TX_SIZES][IST_8x8_WIDTH] = {
// TX_4XN
{ 0 },
// TX_8XN
{ 0, 8, 1, 2, 9, 16, 24, 17, 10, 3, 4, 11, 18, 25, 32, 40,
33, 26, 19, 12, 5, 6, 13, 20, 27, 34, 41, 48, 56, 49, 42, 35,
28, 21, 14, 7, 15, 22, 29, 36, 43, 50, 57, 58, 51, 44, 37, 30,
23, 31, 38, 45, 52, 59, 60, 53, 46, 39, 47, 54, 61, 62, 55, 63 },
// TX_16XN
{ 0, 16, 1, 2, 17, 32, 48, 33, 18, 3, 4, 19, 34, 49, 64, 80,
65, 50, 35, 20, 5, 6, 21, 36, 51, 66, 81, 96, 112, 97, 82, 67,
52, 37, 22, 7, 23, 38, 53, 68, 83, 98, 113, 114, 99, 84, 69, 54,
39, 55, 70, 85, 100, 115, 116, 101, 86, 71, 87, 102, 117, 118, 103, 119 },
// TX_32XN
{ 0, 32, 1, 2, 33, 64, 96, 65, 34, 3, 4, 35, 66,
97, 128, 160, 129, 98, 67, 36, 5, 6, 37, 68, 99, 130,
161, 192, 224, 193, 162, 131, 100, 69, 38, 7, 39, 70, 101,
132, 163, 194, 225, 226, 195, 164, 133, 102, 71, 103, 134, 165,
196, 227, 228, 197, 166, 135, 167, 198, 229, 230, 199, 231 },
// TX_64XN
{ 0, 32, 1, 2, 33, 64, 96, 65, 34, 3, 4, 35, 66,
97, 128, 160, 129, 98, 67, 36, 5, 6, 37, 68, 99, 130,
161, 192, 224, 193, 162, 131, 100, 69, 38, 7, 39, 70, 101,
132, 163, 194, 225, 226, 195, 164, 133, 102, 71, 103, 134, 165,
196, 227, 228, 197, 166, 135, 167, 198, 229, 230, 199, 231 },
};
// Scan order of primary transform coefficients for 4x4 IST
static const int16_t stx_scan_orders_4x4[TX_SIZES][IST_4x4_WIDTH] = {
// TX_4XN
{ 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 },
// TX_8XN
{ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 25, 18, 11, 19, 26, 27 },
// TX_16XN
{ 0, 1, 16, 32, 17, 2, 3, 18, 33, 48, 49, 34, 19, 35, 50, 51 },
// TX_32XN
{ 0, 1, 32, 64, 33, 2, 3, 34, 65, 96, 97, 66, 35, 67, 98, 99 },
// TX_64XN
{ 0, 1, 32, 64, 33, 2, 3, 34, 65, 96, 97, 66, 35, 67, 98, 99 },
};
// Scan order of primary transform coefficients for 8x8 IST
static const int16_t
stx_scan_orders_8x8[TX_SIZES][IST_8x8_WIDTH] = {
// TX_4XN
{ 0 },
// TX_8XN
{ 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 },
// TX_16XN
{ 0, 1, 16, 32, 17, 2, 3, 18, 33, 48, 64, 49, 34,
19, 4, 5, 20, 35, 50, 65, 80, 96, 81, 66, 51, 36,
21, 6, 7, 22, 37, 52, 67, 82, 97, 112, 113, 98, 83,
68, 53, 38, 23, 39, 54, 69, 84, 99, 114, 115, 100, 85,
70, 55, 71, 86, 101, 116, 117, 102, 87, 103, 118, 119 },
// TX_32XN
{ 0, 1, 32, 64, 33, 2, 3, 34, 65, 96, 128, 97, 66,
35, 4, 5, 36, 67, 98, 129, 160, 192, 161, 130, 99, 68,
37, 6, 7, 38, 69, 100, 131, 162, 193, 224, 225, 194, 163,
132, 101, 70, 39, 71, 102, 133, 164, 195, 226, 227, 196, 165,
134, 103, 135, 166, 197, 228, 229, 198, 167, 199, 230, 231 },
// TX_64XN
{ 0, 1, 32, 64, 33, 2, 3, 34, 65, 96, 128, 97, 66,
35, 4, 5, 36, 67, 98, 129, 160, 192, 161, 130, 99, 68,
37, 6, 7, 38, 69, 100, 131, 162, 193, 224, 225, 194, 163,
132, 101, 70, 39, 71, 102, 133, 164, 195, 226, 227, 196, 165,
134, 103, 135, 166, 197, 228, 229, 198, 167, 199, 230, 231 },
};
// IST 4x4 kernel
static const int16_t
ist_4x4_kernel[IST_SET_SIZE][STX_TYPES -
1][IST_4x4_HEIGHT][IST_4x4_WIDTH] = {
{
// DC_PRED; DCT_DCT
{
{ 103, -40, -49, -9, -27, -6, -2, 15, 21, -1, 5, 14, 3, -3, -5,
-5 },
{ -25, -40, -54, 33, 77, 18, -2, 30, 38, 1, -13, -29, -6, -12,
-17, 3 },
{ -50, -6, -5, -4, -60, 0, 2, 50, 60, 8, 17, 44, 11, -22, -31,
-16 },
{ 36, 84, 20, -27, 25, -4, -9, 16, 51, -7, -3, -30, -14, -25, -39,
11 },
{ 17, -55, 81, 27, -11, -28, 1, 34, -1, -4, -35, -36, 5, -24, -18,
19 },
{ 27, 1, 48, 32, 50, 38, -8, 10, -5, -14, 27, 67, 6, -12, -2,
-50 },
{ -2, -12, 6, -65, -2, 70, 12, 63, -36, -11, 8, -17, -23, -12, 20,
12 },
{ 3, 15, 6, -18, 34, -55, 34, 54, 16, 11, 2, 16, 40, 32, 66, 6 },
},
{
{ 113, -35, -36, -11, -27, -11, -2, -1, -1, -2, 3, 8, 2, 4, 4,
0 },
{ 30, 60, 62, -18, -21, -17, -5, -54, -53, -7, -12, -24, -11, 9,
9, 12 },
{ 44, 22, 24, 19, 86, 15, -11, 22, 26, -11, -18, -38, -18, -30,
-32, -5 },
{ 3, 68, -59, -59, 4, 58, 9, 25, -20, -11, 10, 7, -7, -8, 9, -3 },
{ 22, 53, 43, 23, -17, 1, 0, 22, 50, 8, 24, 74, 16, 8, 4, -33 },
{ 6, -44, 62, -24, -1, 39, 23, 62, -47, -24, -19, 16, 22, -6, 15,
-2 },
{ 2, -2, -2, -35, 71, -43, -2, -3, 4, -15, 19, 23, 30, 51, 50,
32 },
{ 12, -9, 1, 59, 19, 73, 15, -28, -16, 39, 24, 0, -18, 33, 44,
19 },
},
{
{ 107, 33, -51, -15, 20, -20, -1, -5, -8, -3, -4, 7, -6, -3, 3,
1 },
{ -57, 85, -57, 7, 18, -2, 0, 35, -26, 2, -1, 12, -8, 4, -5, 3 },
{ -17, 1, 28, -19, 107, -24, 7, -25, 27, 2, -10, 30, -7, -17, 10,
0 },
{ 16, -35, 27, 13, 15, -2, -11, 63, -62, 4, -15, 56, -30, 21, -23,
26 },
{ 29, 62, 79, 15, 16, 24, -1, 35, 5, -9, 9, -47, 9, 8, -20, -12 },
{ 2, -34, -34, -45, 33, 62, 9, 57, 23, -3, 7, -11, 49, 23, 4,
-11 },
{ 14, 21, 4, 42, -16, 64, -9, 5, 55, 4, -12, 65, -14, -26, 32,
12 },
{ 4, -16, -17, 69, 11, -52, 8, 29, 51, 14, 50, 4, 14, 40, -12,
-7 },
},
},
{
// V_PRED, H_PRED, SMOOTH_V_PRED, SMOOTH_H_PRED; DCT_DCT
{
{ 75, 73, -51, 2, -44, 24, -1, -2, -5, -1, 1, -13, 9, -6, 2, 0 },
{ 35, 33, 46, -51, 62, -9, -14, 40, -55, 3, -3, -9, 7, 15, -15,
-11 },
{ -40, 40, 40, -23, -5, 83, 33, -50, -15, 4, -2, 0, -18, -6, -2,
4 },
{ 80, -61, 7, -20, 16, 13, 25, -48, 5, -2, -2, 30, -38, 7, -3,
7 },
{ -3, 49, 36, -4, -16, -48, -48, -44, 29, -9, -16, 59, -17, 29,
-6, 7 },
{ 18, 13, 19, 54, 42, 38, 10, 35, 52, -47, -53, 12, 8, -1, -16,
4 },
{ 10, 21, 37, -10, -14, -57, 87, -1, 16, -3, -3, 2, 27, -49, 6,
6 },
{ 17, -5, 34, 11, 9, -3, -51, -29, -1, -23, -2, -55, 2, -52, 58,
41 },
},
{
{ -81, 82, 37, 2, -24, -19, -5, -19, -10, 3, -1, 12, 14, 3, 1,
-2 },
{ -49, -22, 0, 7, 57, 79, -21, -44, -14, 2, 0, -20, -20, 23, 6,
1 },
{ 67, 59, -34, 2, -4, 11, -51, -61, -11, -1, -1, 9, 13, 23, 3,
-3 },
{ 21, -29, 73, -26, -59, 49, -6, -22, -5, -4, 18, 43, -3, -3, -11,
-16 },
{ -23, -53, -12, 18, 17, -38, -14, -39, -12, -2, 5, 46, 81, -3, 1,
-19 },
{ 29, 13, 31, -11, 43, -24, 86, -40, -42, 1, 5, 6, -14, 16, 23,
-12 },
{ 13, 37, -12, 12, 19, 66, 37, 31, -10, -3, 2, 12, 59, -60, -13,
-8 },
{ -20, -6, -56, -8, -53, 22, 63, -42, 54, 11, -13, 0, 6, 21, 3,
-4 },
},
{
{ 25, 76, -21, 4, -20, -9, -19, 77, -25, -5, 4, -14, 7, 39, -12,
-6 },
{ 91, -9, -27, -5, 59, -42, 4, -5, -7, 1, -3, 32, -26, -10, 2,
8 },
{ 66, -4, -20, -14, -35, 35, -3, -30, 9, 0, -1, -53, 62, -23, 9,
-25 },
{ 27, -62, 61, -17, 13, 4, -17, 37, 28, -6, 4, -11, 17, 68, -15,
-4 },
{ 8, 67, 64, -18, 37, 25, -37, -14, 37, 6, -11, 21, 15, -21, 34,
12 },
{ -42, -8, -18, -18, 60, -50, -16, 15, -14, 11, -11, -17, 65, -13,
8, -47 },
{ -6, -16, -29, -9, 40, 87, 6, 23, -42, 6, -11, 37, 31, 5, -10,
29 },
{ -2, 41, 3, 5, 28, 6, 80, -46, 12, -13, -11, 0, 14, 60, -24,
-26 },
},
},
{
// D45_PRED; DCT_DCT
{
{ 107, -47, -45, -5, -14, -3, -2, 17, 13, -2, 4, 10, 2, -5, -2,
-5 },
{ 56, 86, 25, -27, -28, 1, -1, -43, -38, -1, 3, 2, -5, 16, 14,
4 },
{ 30, 8, 21, -3, 86, 38, 1, 17, -16, -11, -19, -60, -25, -22, -10,
14 },
{ -9, 59, -61, 17, -13, 69, 15, 21, 40, 7, 4, 12, -12, -20, -23,
-17 },
{ 19, 24, 69, 6, -2, -19, 4, 64, 24, -12, -11, 36, 32, -34, -27,
-32 },
{ 19, 11, 8, 65, 55, -6, -17, -45, 42, 1, -8, 37, 9, 52, 2, -14 },
{ -2, -22, 15, -14, 21, 64, 36, 22, -43, 11, 28, 44, 32, 31, 47,
-16 },
{ 9, -38, 53, 49, -52, 50, 20, -37, 2, -8, -15, -8, -40, -22, -4,
-9 },
},
{
{ 91, -37, -76, 14, 12, 3, -1, 11, 18, -1, -5, -9, -2, -2, -2,
3 },
{ -26, -82, 20, -8, 86, -9, -2, 13, -22, 2, -6, -13, -2, 7, 3,
-2 },
{ -31, 34, -46, 70, 37, 34, 1, -46, -35, -16, -10, -16, -4, 14,
24, -1 },
{ -56, -8, -28, 41, -7, -20, -3, 46, 75, -9, -32, -22, 2, -16,
-19, 14 },
{ -12, -28, 2, -31, -5, 77, 20, -54, 56, 18, -14, 5, -35, 12, -10,
9 },
{ -11, -48, -2, 41, -26, -9, -9, -27, 5, -29, 11, 92, 25, 3, -11,
-25 },
{ -20, -34, -12, 15, -39, 45, 28, 42, -28, -13, 69, -19, -24, -38,
19, 4 },
{ 44, -5, 72, 42, -4, 18, 13, 3, 6, -66, -40, -19, -16, -15, 8,
9 },
},
{
{ 118, -17, -35, -15, -22, -14, -1, 3, 4, -3, 4, 8, 3, 1, 2, 0 },
{ 18, 95, 48, -24, -42, -6, -1, -34, -33, -2, -1, -1, -6, 7, 8,
6 },
{ 27, 15, -13, 14, 80, 61, -3, -35, -39, -7, -10, -37, -23, 5, 6,
4 },
{ 16, -66, 90, -20, 21, -27, -11, -18, -33, -12, -2, 2, 7, 13, 16,
2 },
{ 23, 18, 52, -15, 16, 22, 14, 73, 38, -5, -19, -36, -15, -46,
-30, 1 },
{ -6, -34, 12, -34, -53, 98, 4, -11, 9, 9, 25, 15, -17, 5, 9,
-3 },
{ 2, 19, -1, -19, 36, 18, 22, 34, -40, -10, 31, 72, 53, -22, -2,
-36 },
{ 20, 5, 34, 89, -11, 26, -27, -26, 34, -17, -17, 36, 24, -3, -24,
-20 },
},
},
{
// D135_PRED; DCT_DCT
{
{ 93, -22, -5, -19, 63, -15, -1, -21, 12, 2, -12, 38, -9, -12, 11,
13 },
{ 11, -36, 37, -18, -29, 6, -4, -51, 64, 1, 5, -50, 19, -25, 33,
-31 },
{ 65, -14, 5, -5, -26, -15, 9, 37, -20, -16, 27, -56, 8, 51, -43,
-23 },
{ 0, -48, 50, 15, -28, 37, 5, -11, 10, -13, 11, 33, 8, 21, -32,
78 },
{ 24, 78, 56, 3, -11, -10, -13, 44, 42, -6, 3, 6, -9, 14, 40,
24 },
{ -45, 11, 27, -31, 64, -29, 26, -25, 36, -19, 6, -5, -5, 55, -38,
-10 },
{ -10, -44, 65, -3, 2, 5, -6, 37, -25, 9, -30, 33, -46, 5, 10,
-61 },
{ -6, -15, -30, -54, 12, 61, -4, 44, 22, 15, -44, -6, 39, 41, 25,
5 },
},
{
{ 97, 26, -57, -2, 18, -23, -4, 33, -30, 0, 5, -2, 0, 11, -8,
-2 },
{ 12, -39, 31, -20, 78, -6, 11, -11, -11, -3, -20, 66, -26, 18,
-25, 19 },
{ -45, -3, 16, -14, 12, -22, 8, 60, -54, -1, 13, -35, -7, 48, -35,
-43 },
{ -23, 38, -34, 46, -40, 24, 17, 2, 0, -21, -13, 51, -26, 44, -48,
23 },
{ 11, 82, 63, -44, 0, 29, -17, 27, -6, 0, -19, 10, 23, 3, 6, 29 },
{ -44, 3, -27, 23, 23, -18, -18, 37, -42, 20, 29, 18, 8, -37, 31,
70 },
{ 13, -9, 33, 42, 1, -47, -8, 55, 68, -21, -1, -2, -11, 37, 34,
17 },
{ -37, 58, -35, -3, 42, -31, -4, -5, 21, 5, -37, 22, -23, -19, 33,
-58 },
},
{
{ 111, -44, 21, -17, 28, -10, -1, -11, 14, -5, 0, 11, -4, 0, 2,
3 },
{ 20, 63, -60, -10, 61, -33, -1, 34, -34, 1, -9, 28, -14, 10, -7,
4 },
{ -45, -20, 13, -12, 65, -2, 8, -55, 35, 4, -18, 57, -21, -21, 15,
19 },
{ -2, 14, 86, 47, 6, -3, -1, 39, -27, 5, 0, 40, -30, 30, -21,
20 },
{ 19, 87, 43, 10, 3, -22, -12, -26, 49, -2, 8, -27, 13, -24, 35,
-10 },
{ 23, -1, -37, 82, -31, -3, -1, -33, -24, 29, 4, 24, -9, -49, 18,
30 },
{ 15, 27, -4, -36, -30, 76, -19, 31, 16, -6, -27, 47, 14, -14, 25,
42 },
{ -1, -11, -32, 52, 31, 32, 1, 37, 72, -10, 48, -12, -12, 33, 7,
13 },
},
},
{
// D113_PRED, D157_PRED; DCT_DCT
{
{ 98, 39, -28, -8, 30, -29, -10, 43, -22, -3, -1, 4, -1, 16, -7,
-2 },
{ 17, -65, 14, -4, 65, -29, 15, -32, 9, 1, -6, 55, -43, -1, -3,
16 },
{ -58, 21, 36, 5, 23, -22, -4, 69, -16, -4, 0, 21, -24, 62, -19,
-5 },
{ 28, 5, 85, -38, 32, 45, -10, -5, 25, -2, -20, -5, 50, 13, -1,
-11 },
{ 2, 83, 18, 17, -12, 21, -4, -25, 24, -3, -11, 60, -37, -23, 9,
39 },
{ 38, -33, 4, 28, -61, 12, 5, 7, 60, -9, 4, 6, -17, 70, 5, 12 },
{ 1, -9, -39, 6, 12, 86, 36, -3, -47, -3, -5, 30, 12, 29, -41,
11 },
{ -24, 31, -51, 18, 49, -17, 19, -28, 54, 1, -10, 7, 51, 38, 22,
-21 },
},
{
{ 92, -51, -3, -17, 43, -15, 5, -41, 20, 2, -4, 12, -1, -19, 11,
-1 },
{ -1, 47, -32, 18, 56, -39, 0, 17, -34, 4, -6, 64, -43, -15, -2,
21 },
{ 67, 3, 5, 1, -17, -8, -6, 76, -23, -13, 13, -11, -4, 62, -29,
7 },
{ 14, 61, -45, -23, 25, -37, 2, -3, 8, 5, -8, -56, 42, 5, 16,
-50 },
{ 15, 47, 87, -7, -17, -43, -18, 1, 43, -2, 3, 1, -35, -12, 27,
-8 },
{ 6, 17, -4, -28, 25, 70, -39, 37, 34, 18, -33, 31, 16, 14, 52,
6 },
{ -30, 4, 21, -14, 52, -15, 30, -26, 39, -7, 5, 1, 21, 76, -20,
46 },
{ 38, 56, -17, 16, -41, 20, 6, -29, 7, -8, 16, 0, 36, -24, -2,
78 },
},
{
{ 102, -60, 36, -4, 8, -5, 0, -25, 17, 1, 1, 1, 0, -8, 5, 0 },
{ 39, 43, -43, -7, 78, -42, 2, 16, -16, -2, -7, 44, -24, 5, -4,
12 },
{ 49, 26, -1, 6, -39, 5, -11, 80, -37, -5, 10, -32, 12, 44, -24,
-9 },
{ -25, -30, 62, 26, 3, 14, -2, 33, -17, -3, -7, 67, -42, 26, -21,
36 },
{ 10, 79, 76, 5, -10, -28, -23, 0, 37, 6, -2, -3, -8, -16, 34,
-4 },
{ 17, 22, -11, -16, 19, 96, -30, 14, 21, 3, -15, 29, 42, -9, 21,
28 },
{ -22, -11, 34, -47, 58, 2, 9, 9, 39, -21, -2, -24, 23, 64, -23,
-35 },
{ 14, 24, -28, 12, -32, 4, 27, -27, 64, -30, 37, 3, -21, 44, -25,
54 },
},
},
{
// D203_PRED, D67_PRED; DCT_DCT
{
{ 98, -17, 59, 1, -33, -18, -1, -17, -33, -7, -7, 3, 2, 6, 13,
3 },
{ -57, 48, 86, 20, 15, -10, 0, -31, -30, 2, -16, -25, -4, 2, -1,
8 },
{ 48, 14, -16, 50, 73, -8, -10, -13, 31, 12, -28, -49, -11, -10,
-31, 5 },
{ 17, 40, 48, -14, -1, 11, -12, 25, 69, 8, 47, 34, -17, -27, -29,
-31 },
{ -23, -67, 29, 79, -30, 15, 8, 31, 16, 30, -16, 8, 7, -12, -16,
-13 },
{ 8, -7, 10, 28, 67, 51, -7, 25, -41, -24, 28, 38, -11, -7, 53,
-14 },
{ 5, 34, -27, 52, -10, -33, 5, -47, 2, 54, 44, 38, 19, 27, 30,
-9 },
{ 17, 73, -20, 18, -33, 29, 0, 53, -26, 20, -61, 21, 3, -3, -4,
-1 },
},
{
{ 82, -42, -76, 16, 21, -1, -3, 14, 25, 0, -15, -15, 0, -2, -6,
5 },
{ -41, -6, -19, 51, 78, 7, 3, -23, -46, -2, -23, -35, -2, 14, 31,
4 },
{ -62, 33, -42, -7, 20, 1, -4, 18, 74, 16, -12, -22, -2, -15, -47,
12 },
{ -29, -25, -45, -13, 23, 36, -3, 1, -11, -15, 73, 60, -3, -5, -3,
-39 },
{ -38, -21, -43, -38, -42, -10, 13, 45, -6, 11, -19, -10, 0, 19,
78, 8 },
{ -4, 52, -47, 58, -48, -9, 1, -24, -14, 1, -38, 52, 18, 4, -1,
-21 },
{ 25, 41, 28, 31, 30, 3, 2, 37, 44, 40, 17, 10, -22, 2, 56, -51 },
{ 27, 65, -32, -61, 22, -23, 7, -54, -8, 13, 28, -13, 6, 34, 16,
10 },
},
{
{ 101, -33, 50, -6, -43, -10, -3, -5, -20, -8, 1, 7, 1, 4, 6, 1 },
{ -42, 28, 97, 41, 3, -6, 1, -27, -34, 1, -16, -24, -2, 3, -1,
6 },
{ 35, 66, -10, -40, 48, -54, 6, -57, -1, -16, 0, -9, 7, 6, 12,
1 },
{ 43, -20, -13, 70, 59, 6, -8, -4, 33, 16, -27, -49, -13, -10,
-27, 4 },
{ 4, 24, 53, -49, 9, 24, -20, 26, 75, -3, 27, -9, -27, -23, -35,
-6 },
{ 3, -19, 0, -39, 47, 57, -26, 13, -53, -53, -14, -28, -29, 6, 21,
17 },
{ 26, 73, -13, 25, -6, 18, -32, 38, -35, 26, -24, 45, -36, -28,
-5, -9 },
{ 1, -20, 24, 31, 57, -7, 16, 13, 10, -40, 29, 70, 12, -26, 33,
-37 },
},
},
{
// SMOOTH_PRED; DCT_DCT
{
{ 106, -23, -9, -29, 47, -26, -1, -6, 1, -2, -9, 22, -10, 0, 0,
4 },
{ 7, 72, -65, 21, 7, -31, -8, 50, -50, 4, 2, 5, -6, 14, -13, 1 },
{ 4, 81, 88, -23, 11, -16, -17, -3, 5, -16, -14, 17, -10, 4, 6,
6 },
{ 44, 13, 5, -48, -55, 62, -7, 29, -16, 2, 0, -38, 39, 22, -16,
-15 },
{ -42, -10, -12, -52, 62, 56, 1, 12, -27, 5, -34, 41, -3, 14, -21,
15 },
{ 27, 16, 14, 81, 53, 69, -15, -4, 0, -8, 9, -27, 2, -2, -1, -4 },
{ -1, -51, 52, 24, -8, -19, -3, 49, -39, -7, 23, 5, -32, 49, -46,
8 },
{ -4, -3, -10, -2, 10, 4, -14, 83, 89, -11, -9, 4, -10, 15, 22,
0 },
},
{
{ 105, -44, -53, -10, -1, -11, -2, 13, 12, 2, 3, 7, 4, -1, -2,
-1 },
{ 58, 48, 74, -38, -2, -32, -10, -34, -28, -18, -1, 11, -3, 9, 14,
2 },
{ 4, 82, -65, 10, 52, -12, -17, 12, -36, 10, -19, 6, -8, 9, -5,
7 },
{ 18, -26, 37, 23, 89, 35, -18, -1, 17, -20, -27, -38, -29, -8,
-4, 11 },
{ -1, -11, -3, 81, 8, -77, 8, -57, 15, 2, 1, -3, 7, -4, 9, -2 },
{ 34, 32, 9, 69, -55, 53, -8, 5, -23, -6, 10, -51, 5, 6, -10, 0 },
{ 12, 51, 12, 0, -9, -2, -19, 11, 100, 34, 6, 6, -14, -26, -25,
-8 },
{ 6, 9, 26, 36, 2, -22, 36, 79, 1, -54, -24, 44, 19, -19, -12,
-2 },
},
{
{ 118, -22, -24, -20, 16, -27, -3, -1, 0, -3, -1, 6, -2, -1, 1,
1 },
{ 15, 82, 74, -33, 2, -34, -11, -23, -25, -12, -6, 14, -6, 5, 5,
2 },
{ 5, -72, 82, -6, -16, 5, 11, -40, 42, -14, 7, -6, 3, -7, 11,
-2 },
{ 22, 6, 11, -54, -59, 79, -5, 32, -21, 1, 6, -21, 24, 18, -12,
-3 },
{ 6, 1, 18, -3, 94, 69, -25, -1, -1, -9, -28, -16, -25, -1, -4,
8 },
{ 34, 27, 14, 95, -26, 18, -17, -13, -7, -14, 16, -58, -1, 3, 2,
-3 },
{ 0, -32, 39, 27, -5, -22, -23, 84, -26, -24, -4, 31, -32, 29,
-25, 17 },
{ 9, 22, 10, 13, 16, 7, 85, 43, 20, -53, -19, 3, 39, -30, 4, -8 },
},
},
{
// DC_PRED; ADST_ADST
{
{ 106, -50, -45, 4, 7, 5, 1, 12, 10, 0, -4, -12, -6, 2, 2, 1 },
{ -36, -37, -45, 39, 70, 41, -9, -42, -37, -7, 2, 3, 4, 13, 11,
-10 },
{ 4, 72, -70, 51, 2, -57, 10, 10, -9, -5, -6, -1, 6, -4, 5, 0 },
{ 54, 42, 47, 32, 3, 26, -5, -38, -39, -7, 23, 54, 26, -17, -14,
-1 },
{ 21, 54, 28, -3, 59, 32, 28, -3, 35, 39, -14, -47, -10, 33, 24,
-4 },
{ 0, -28, 50, 60, 6, -24, 41, 51, -42, -19, 15, -18, -37, 16, 13,
-6 },
{ -4, 9, 4, 60, -56, 54, -56, 9, 24, -19, -21, -33, 6, 12, 24,
-10 },
{ 5, -24, 20, 11, -15, -43, -16, -31, -27, 69, -64, 9, 12, 3, 39,
-25 },
},
{
{ 121, -10, -11, -6, -35, -5, -2, 6, 7, -2, 1, 12, 1, -3, -3,
-3 },
{ 10, 66, 74, 12, -20, 11, 6, -44, -48, 5, -1, 22, -2, 19, 20,
-15 },
{ 0, 74, -67, -36, 1, 38, 8, -34, 32, -6, 20, 2, -17, 20, -18,
0 },
{ 38, 21, 22, 27, 94, 20, 12, 7, 11, 15, 1, -54, 0, 7, 3, 22 },
{ -2, 32, 46, -42, 15, -34, -12, 36, 40, -19, 53, 24, 42, -25,
-29, 2 },
{ -9, 22, 10, 70, -31, 32, 9, 31, 57, 51, -19, 26, 7, -13, -28,
-4 },
{ -1, -28, 24, -20, -2, 79, 53, 37, -12, -26, 36, 16, -38, -17, 3,
-7 },
{ 4, -24, -24, 31, 45, 13, -9, -11, 4, -6, 33, 67, 40, 41, 31,
-45 },
},
{
{ 124, 3, -20, -12, -17, -14, -2, -2, 4, 1, 0, 8, 3, -1, -1, -1 },
{ 16, 32, 111, -2, -19, 12, -2, -26, -32, -13, 4, 6, -3, 11, 11,
-3 },
{ -10, 115, -43, 7, -7, 4, -9, -24, -11, 6, 0, 10, -5, 11, 0,
-2 },
{ 19, -8, -8, 19, 27, 112, 7, -21, 14, 7, -8, -26, -24, 13, 7,
3 },
{ 16, 0, 3, 43, 95, -38, 15, -18, -44, 16, -25, -12, -4, 0, 15,
8 },
{ 4, -4, 0, 110, -53, -2, -9, 26, -5, -2, -18, -14, 11, -2, 1,
6 },
{ 11, 34, 19, -3, 40, 5, -33, 85, 17, -26, 41, -45, 8, -5, -5,
6 },
{ 2, 20, 29, 11, 17, -16, 13, -30, 101, 15, -30, -11, 36, -26, -8,
5 },
},
},
{
// V_PRED, H_PRED, SMOOTH_V_PRED, SMOOTH_H_PRED; ADST_ADST
{
{ 74, 96, -22, 4, -3, 23, 6, 23, -6, -2, 3, -4, 7, 7, 2, 0 },
{ -61, 26, -5, 2, -46, 84, 39, -18, 9, -3, -4, -16, 18, -12, 4,
0 },
{ -32, 19, 55, -14, 85, 33, 0, 49, -5, 4, 3, 17, 21, 15, 0, 5 },
{ 62, -60, -1, 5, 21, 37, 82, -2, -3, 2, -4, 13, 9, -5, -4, 8 },
{ -14, -29, -55, 7, -19, -10, -1, 84, -20, -8, 3, -24, 59, 15, 2,
-6 },
{ 41, -22, 66, -8, -29, 23, -50, -10, -10, 14, -4, -45, 55, -19,
1, -12 },
{ 12, -11, 8, 41, -24, 15, -27, 16, 86, -9, -15, 58, 18, 30, 13,
14 },
{ 9, -21, -29, -44, -10, 50, -46, -17, -49, 8, -7, 47, -10, 54,
-21, 0 },
},
{
{ 109, -59, -25, 2, 2, 13, 2, 12, 5, 0, -2, -6, -7, 2, 2, 0 },
{ 36, 27, 74, -22, -66, -46, 21, 32, 9, 4, 1, 13, -1, -12, -6,
3 },
{ -24, -62, 70, -15, -18, 75, -25, -8, -6, -1, 4, 9, 0, 1, -1,
-3 },
{ -33, -27, -32, -61, -16, -3, 1, 52, 62, 14, -15, -42, -26, 4, 1,
8 },
{ 36, 85, 3, -25, 11, 75, -14, -1, 32, 10, 3, -8, -3, 4, -2, 1 },
{ -12, 13, -20, 70, -41, 34, -9, 78, -26, -15, -4, -1, -28, 0, 13,
-3 },
{ -7, -5, 18, 6, 30, 27, 115, 10, -6, 13, -9, -4, -8, 16, 19,
-2 },
{ -6, -3, -32, -47, 8, 14, 16, 28, -22, -16, 31, 84, -9, -45, -28,
8 },
},
{
{ 120, -9, 9, -1, 18, -34, 6, -15, 4, 2, 2, 0, -1, -2, -2, -1 },
{ 11, 119, -22, 3, 14, -9, -9, 31, -6, -2, 3, 11, -11, 1, 3, 2 },
{ 33, 20, 27, 5, -38, 102, 21, 1, 6, 3, -1, -18, 37, 9, 0, 4 },
{ -4, -1, -70, -8, 34, 15, 90, -31, -8, -3, -5, 19, 17, -17, 2,
5 },
{ 25, -38, -73, -8, -9, 30, -36, 75, -20, -3, -8, 19, -10, 10, 4,
5 },
{ 0, -4, 7, -11, 86, 58, -43, -29, 18, 4, 7, 7, -44, -19, 4, -8 },
{ -1, -10, 61, 7, 14, 7, 56, 54, -27, 10, 2, 52, -50, 0, -5, 8 },
{ 2, -4, -23, 85, -9, 4, 21, 10, 23, 9, 22, -59, -54, -14, -16,
-6 },
},
},
{
// D45_PRED; ADST_ADST
{
{ 119, 6, 6, -5, -43, -4, 1, 3, 3, 0, 1, 17, 0, -1, -1, -4 },
{ -21, 76, 67, 5, -32, 9, 6, -40, -37, 5, 0, 31, -2, 13, 12,
-13 },
{ 30, -15, -20, 35, 59, 49, 13, -50, -47, 5, -10, -15, -19, 33,
31, -12 },
{ -14, -45, -29, 19, -20, -10, -39, -27, -22, -15, 19, 80, 39, 4,
0, -34 },
{ 3, -48, 63, 40, 5, -46, -1, 37, -35, 19, -33, -15, 17, -13, 39,
-9 },
{ -15, -17, -29, -30, -54, -40, -3, -22, 5, 11, -24, -22, -41, 64,
46, -9 },
{ 0, -25, 6, -4, -23, -15, -34, -48, -47, -25, 1, -22, -27, -38,
-28, 72 },
{ 11, 58, -38, 39, 22, -51, -46, -23, 16, 23, -31, -19, 44, -1, 4,
16 },
},
{
{ 114, -29, -45, 2, -7, -1, 0, 12, 17, 1, -5, -8, -3, 0, -1, 2 },
{ -27, -61, -50, 41, 75, 21, -3, -13, -29, -5, -4, -18, -1, 8, 15,
-3 },
{ -34, -28, -18, -26, -1, -42, 3, 63, 57, 16, -24, -57, -6, -7, 5,
12 },
{ 29, -8, 78, -15, 30, 27, 35, 4, -21, 22, -18, -50, -34, 21, 30,
-3 },
{ 4, 92, -39, 50, 11, -10, 19, -7, 5, 14, -32, -35, -6, 12, 25,
-2 },
{ -17, -20, -35, -34, -49, -8, 2, -39, -2, 3, -9, 6, -40, 70, 45,
-26 },
{ -8, 17, -22, -42, 23, 82, 7, -28, 63, 24, -4, 1, -5, 1, -32,
2 },
{ -4, 7, -3, 21, 14, 12, 61, 61, 22, -23, 53, 35, -14, 36, -1,
-39 },
},
{
{ 121, 1, -26, -8, -25, -7, 2, 5, 12, 1, 1, 7, 0, -1, -4, -1 },
{ 2, 102, 45, -6, -36, -4, 2, -37, -19, 1, 5, 25, 4, 10, 2, -7 },
{ 19, -53, 103, -32, -7, -24, 0, 12, -22, -5, 7, 11, 7, -8, 3,
-2 },
{ 27, -5, 25, 11, 50, 88, 17, -41, -26, 4, -3, -23, -27, 21, 13,
0 },
{ 19, 17, -7, 22, 78, -74, -10, -15, -49, 6, -7, -18, 16, 9, 14,
4 },
{ 5, 43, 23, -14, 25, -5, 57, 63, 30, 8, 0, -54, -25, -28, -13,
22 },
{ 6, -6, 25, 111, -36, 0, 9, 21, -7, -18, -26, -15, 5, -8, 16,
1 },
{ -7, -18, -18, 7, 0, -19, 102, -15, -19, 0, 7, 59, -21, 1, 5,
-13 },
},
},
{
// D135_PRED; ADST_ADST
{
{ 99, -40, 67, 5, -7, 7, 0, -11, 13, 4, 3, -5, 4, -1, 2, -1 },
{ 52, 24, -56, -40, 80, -21, 6, -21, 21, -8, 1, 18, -1, -7, 11,
1 },
{ -45, -35, 21, -34, 8, 4, 0, -65, 68, -15, 17, -38, 12, -15, 10,
-16 },
{ -14, 68, 58, 60, 40, -43, 9, -23, 10, 9, 19, -4, 1, 1, -3, 2 },
{ -24, -58, 5, 32, 31, -7, 1, -39, -26, 38, -37, 61, -12, -29, 22,
10 },
{ -20, 19, 55, -49, 6, 5, -9, 47, 25, -31, -16, 56, -19, -3, 48,
11 },
{ -6, -15, -11, 42, 42, 67, -26, 44, 51, 35, 32, -3, -11, 9, 3,
15 },
{ 18, 49, -18, 16, -39, 37, 3, -19, 12, 27, -19, -4, 9, -55, 63,
-38 },
},
{
{ 110, 33, -51, 10, 3, -7, 3, 13, -13, 1, 3, -4, 1, 0, -1, -1 },
{ -33, 94, -13, 15, -67, 25, 1, 6, 5, -5, 6, -25, 9, -7, 6, -3 },
{ 13, 63, 72, -57, 47, 0, -1, 20, -22, 13, -4, 19, 8, 8, -8, 2 },
{ 42, -6, 43, -8, -23, 53, 10, -58, 67, 2, -12, 16, -1, -21, 20,
13 },
{ -9, -10, -28, -7, 32, 99, 6, -20, -57, 2, 4, -13, 23, -8, -9,
-9 },
{ -24, 38, -34, 39, 45, 5, 10, -22, 15, -23, -16, 79, -29, 18, 0,
27 },
{ 6, 0, 36, 73, 43, 23, -4, 52, 30, -30, 8, -35, 26, 8, 26, 2 },
{ 9, 9, 40, 47, 3, -24, 17, -58, -52, -3, 60, -11, -33, -22, 8,
-4 },
},
{
{ 119, -34, -7, -8, 28, 6, 1, -7, 7, 3, -2, 4, -1, 0, 3, 1 },
{ 17, 56, 99, -21, 17, -39, 5, 3, 22, -1, 5, 19, -1, -1, 6, 5 },
{ 15, 82, -67, 2, 37, -31, 6, 33, -28, -1, -4, 22, -6, 7, -2, 5 },
{ -38, -39, -13, -32, 83, -23, 2, -41, 18, 0, -12, 42, -13, -13,
17, 9 },
{ 4, -15, 5, 95, 4, -64, 15, -32, -13, -5, 31, -6, -21, -12, -4,
-8 },
{ -9, -23, 35, 47, 46, 42, -23, 53, -42, -1, -2, 32, 5, 42, -11,
21 },
{ 1, 50, 0, 37, 36, 71, -12, -53, 22, -15, 18, -16, 30, -21, 22,
-13 },
{ -7, -7, -14, 17, 18, -8, -9, 56, 86, -18, 16, -37, -25, 26, 39,
2 },
},
},
{
// D113_PRED, D157_PRED; ADST_ADST
{
{ 81, 87, -33, 8, -16, 18, 6, 16, -8, -1, 3, -11, 7, 0, 1, -2 },
{ 48, -22, 21, -14, 81, -47, -17, 50, -27, 5, 3, 12, 11, 21, -8,
-1 },
{ 62, -50, -36, 23, -24, -49, 0, -46, 30, -4, -4, 23, -41, -2, 1,
5 },
{ 29, 8, 57, -13, 40, 58, 39, -41, 30, 7, -8, 47, -19, 1, 3, 17 },
{ -39, 52, -4, 15, -2, -31, -25, 19, 35, -8, -13, 60, -33, 61, -4,
11 },
{ 24, -4, 61, 19, -29, -7, -50, 13, 69, -2, -4, -21, 50, -2, 21,
-5 },
{ 6, -43, -38, 45, -2, 45, 42, 43, 20, -17, -23, 15, 44, 42, -20,
-2 },
{ 21, -16, 37, -26, -52, 16, -16, -12, -41, 18, -2, -6, -13, 68,
-49, -33 },
},
{
{ 105, -52, 45, -7, -7, 10, 2, -15, 9, 3, -1, -5, 6, -1, 1, 0 },
{ -41, 1, 91, 36, -63, 12, -6, 12, -4, 1, 6, -23, 7, 11, -6, -1 },
{ -18, -69, -49, -13, -42, 71, -19, 37, -9, 0, -6, -6, -1, 6, -1,
0 },
{ 46, 43, -11, 34, -21, -5, -1, 72, -60, 3, -4, 33, -16, 14, -10,
15 },
{ -9, -46, -23, 89, 15, -16, 13, -46, -45, 20, 4, -2, 9, -5, -17,
0 },
{ -27, -47, 29, -25, -3, -37, 3, 5, -23, -1, -25, 76, -42, -37,
24, 0 },
{ -4, 13, 28, 37, 67, 64, -39, 13, 25, 39, -12, 22, -22, -10, 22,
0 },
{ 1, -26, -4, 27, 16, -27, -14, 37, 40, -41, 69, -16, -59, -7,
-21, -6 },
},
{
{ 114, -37, -37, 6, 24, -3, 5, -2, -2, 1, -1, 2, -3, 0, 1, 1 },
{ 40, 72, 68, -34, 27, -45, 4, 5, 13, 10, 3, 26, -7, -2, 0, 7 },
{ 8, -68, 76, -31, -16, 28, -2, -47, 33, 11, -3, -10, 8, -16, 4,
-5 },
{ -27, -11, -4, 6, 102, 27, -13, -37, -12, -7, 0, 48, -7, -3, 12,
6 },
{ 26, 35, 40, 55, 3, 81, -24, 26, 0, -16, 16, -19, 21, 25, 10,
1 },
{ -3, -5, 19, 86, 7, -58, 10, -38, 19, -30, 28, -25, -15, -21, 13,
-15 },
{ -6, 19, -34, -16, 18, 13, 0, 14, 101, -4, -19, -24, -7, -14, 51,
-4 },
{ -13, -55, 30, 14, 20, -30, -10, 78, 16, -3, -8, 9, -34, 48, 3,
27 },
},
},
{
// D203_PRED, D67_PRED; ADST_ADST
{
{ 122, -3, -7, -4, -35, -2, 0, 2, 7, 2, 0, 13, -1, 0, -3, -3 },
{ 4, 38, 107, 19, -19, -1, 4, -22, -43, 10, -5, 12, 2, 5, 12,
-3 },
{ 20, -48, 4, 85, 50, 6, 0, 11, -15, 32, -35, -35, -2, -1, 12,
8 },
{ 23, 86, -19, -1, 68, 12, 10, -43, 15, 3, 4, -31, -2, 13, -8,
7 },
{ -11, 23, 23, 20, -21, -11, 0, 30, 80, 64, -1, 2, 7, -14, -50,
3 },
{ 19, -37, 59, -49, 56, -3, 4, 32, 25, -33, 30, -35, 2, -19, -16,
9 },
{ 1, -4, 2, 52, 26, 34, -3, 1, 14, -30, 66, 62, 11, 5, -17, -45 },
{ -2, -5, 4, -18, -14, 104, 14, 16, -2, 27, 8, -11, -56, 16, 7,
10 },
},
{
{ 112, -22, -53, 8, -7, 0, -1, 9, 20, 2, -8, -6, -2, 0, -1, 1 },
{ -29, -56, -51, 50, 72, 11, -4, -6, -32, -12, -3, -23, 1, 5, 18,
-2 },
{ -49, -3, -67, -33, -13, -25, -2, 33, 71, 16, -19, -28, -2, -3,
-10, 10 },
{ -12, 75, -61, 48, -15, 8, -1, -42, -2, -8, -2, 43, 9, 7, -14,
-13 },
{ 11, 48, 33, 58, 16, -26, 10, 22, 10, 36, -54, -53, 2, -1, 28,
7 },
{ 4, -3, 17, -10, 44, 65, 2, -38, 48, 66, -9, 9, -4, 27, -28,
-6 },
{ -1, 12, -21, -52, -19, 21, 16, -39, -32, -8, -41, -32, -35, 41,
58, -19 },
{ 10, 41, -6, -16, 48, -17, 32, 27, 17, 3, 82, 0, -12, 31, 42,
-8 },
},
{
{ 124, -8, -4, -7, -26, -5, 0, 4, 4, 1, 0, 7, 0, 0, -1, -2 },
{ 4, 75, 88, 4, -24, -4, 4, -28, -35, 0, -1, 15, 2, 5, 10, -3 },
{ 0, 89, -77, -33, 1, -18, 1, -22, 15, -4, 11, 10, 2, 4, -8, -2 },
{ 22, 27, -18, 82, 59, 17, 3, -15, -17, 33, -34, -37, -8, 9, 7,
8 },
{ 16, -13, 10, -63, 68, 44, 1, -42, -30, -36, 16, -21, -14, 13,
16, 2 },
{ -8, 4, -22, 13, -56, 103, -12, -9, -5, 13, 5, 15, -30, 19, 3,
-7 },
{ 5, 34, 33, -18, 8, 32, 10, 51, 64, 1, 12, -60, -16, -18, -31,
23 },
{ 2, -13, 21, -20, 27, 6, -11, -43, 49, 85, 16, 35, 20, 16, -26,
-11 },
},
},
{
// SMOOTH_PRED; ADST_ADST
{
{ 119, -29, -32, -10, -2, -10, 3, 9, 8, 3, -1, -1, -2, -1, -1,
1 },
{ 38, 96, 60, -21, 4, -27, -2, -14, -19, 2, 6, 18, 7, -1, -1,
-1 },
{ 11, -69, 101, -18, 8, 12, 5, -18, 18, -6, 2, 2, -3, -2, 3, 0 },
{ 8, 7, -4, 14, 118, 40, 5, 0, -17, 4, -5, -6, -10, 8, 4, 0 },
{ 23, 28, 21, 63, -38, 86, -9, 16, 16, -8, 6, -32, 8, 5, 7, -3 },
{ 4, -2, 13, 96, 19, -71, 3, -3, 35, -12, 2, 2, -3, -3, 7, 2 },
{ -8, 10, 17, -21, 12, -8, 13, 113, 44, 12, 5, 3, 2, -2, -15, 6 },
{ -4, 21, -17, -24, 13, 16, -8, -48, 105, 27, 1, 11, 10, -15, 5,
2 },
},
{
{ 125, -5, -1, -7, -24, -7, -1, -1, 0, -2, 1, 6, 1, 1, 0, -1 },
{ 14, 83, 77, 9, 43, 10, 0, -24, -23, 1, -2, -11, -2, 4, 4, 1 },
{ -6, 85, -75, -32, -37, 24, -7, -14, -8, -3, 3, 10, -5, 9, 0,
-2 },
{ 21, 11, -41, 10, 83, 40, 10, 52, 43, 4, -1, -19, -4, -16, -14,
1 },
{ -1, 16, 2, 97, -46, 27, 12, -17, 47, 31, 0, -10, 0, -1, -10,
-1 },
{ -2, -12, 24, -8, -37, 84, 34, 53, -54, -1, -8, -6, 4, -11, 9,
1 },
{ -7, 27, 29, -9, -16, -21, 5, 61, 41, 1, 25, 74, 46, -1, 1,
-17 },
{ -1, -18, 23, -42, 0, 51, 13, -46, 54, -7, 56, 21, -47, -5, 14,
-4 },
},
{
{ 124, 14, 17, -11, 18, -12, 1, -1, -2, 1, -1, 3, -1, 0, -1, 0 },
{ -6, 106, -58, -5, 14, 2, 0, 29, -27, 0, -1, 0, 2, 3, -3, 0 },
{ -27, 50, 102, 1, 52, 3, -4, -5, 7, -1, 1, 2, 0, 0, 0, 0 },
{ -13, -25, -35, -15, 84, -64, -10, 3, 22, -5, -7, 43, -20, 5, 2,
6 },
{ 9, -22, -17, 40, 56, 82, 5, 52, 33, 5, 2, -10, 11, 0, 0, -3 },
{ 7, 24, -8, 98, -13, -36, -10, -29, 48, 12, 24, -15, -21, -6, 5,
-1 },
{ 0, 26, -18, -50, -8, 36, 11, -52, 81, -15, 9, 18, 0, -23, 33,
2 },
{ 0, 7, 20, -7, -44, -31, 4, 80, 50, -1, 17, 45, 35, 19, 7, 0 },
},
},
};
// IST 8x8 kernel
static const int16_t
ist_8x8_kernel[IST_SET_SIZE][STX_TYPES - 1][IST_8x8_HEIGHT]
[IST_8x8_WIDTH] = {
{
// DC_PRED; DCT_DCT
{
{ 102, -43, -51, -8, -23, -5, -3, 15, 18, -2, -2,
5, 12, 2, -1, -1, 3, -3, -5, 2, -1, -1,
1, -2, -5, 0, 1, -1, 0, 1, -1, 1, 1,
-1, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ -19, -33, -44, 31, 84, 19, -3, 26, 34, -1, 5,
-18, -40, -9, 4, -1, 4, -13, -19, 1, 1, 2,
-3, 1, 9, -2, -2, 2, 0, 1, -2, 5, 8,
-1, 0, 0, -1, 0, 2, 1, 2, -1, -1, -1,
1, -2, -3, 1, 0, 0, -1, -1, -1, 1, 0,
0, 1, 0, 0, 0, 0, 0, -1, 0 },
{ -27, 17, 6, -4, -29, 4, -3, 47, 65, 2, -4,
18, 39, 5, -2, 0, 4, -37, -51, -4, 3, 0,
4, -15, -31, -3, 3, -1, 0, 1, -6, 10, 17,
-3, -1, 1, 1, -2, 7, 16, 0, -1, 1, -2,
2, 0, -2, 2, -1, 1, -2, -6, 1, 0, 0,
-1, -1, 0, 0, 1, -1, 1, 1, 0 },
{ 17, 25, 20, -27, -22, -29, -5, 4, 16, -7,
6, -25, -52, -5, 1, -1, 4, -22, -37, -1,
1, -1, -6, 33, 58, 12, -4, 0, 0, 0,
-4, 20, 33, 2, -2, 0, -1, 5, -12, -25,
1, 3, -1, -1, 3, -8, -17, 1, 1, -2,
0, 3, -4, 1, -1, 2, 7, -1, 1, 1,
2, -2, -3, -1 },
{ 27, 14, 16, 9, 24, 11, -13, -42, -37, -22, -8,
-6, -1, -16, 1, -3, 4, -15, -29, 2, 0, -2,
5, -22, -36, -3, 1, 0, -1, 0, -2, 34, 51,
8, -4, 0, 0, -4, 24, 37, 4, -2, 0, 0,
6, -15, -27, 0, 3, 3, -10, -18, 2, 1, -3,
1, 6, -2, 3, 6, -2, 2, 1, -2 },
{ -28, -25, -33, 8, -7, 12, 1, -18, -12, -6, 10,
34, 41, 31, 1, -2, 13, 14, -1, 15, 1, 3,
-3, 11, 16, -3, 2, 2,