#ifndef DAV1D_SRC_WEDGE_H
#define DAV1D_SRC_WEDGE_H
#include "src/levels.h"
typedef struct {
struct {
uint16_t wedge[2 ][16 ];
uint16_t ii[N_INTER_INTRA_PRED_MODES];
} offsets[3 ][BS_8x8 - BS_32x32 + 1];
uint8_t ALIGN(wedge_444_32x32[ 16 * 32 * 32], 64);
uint8_t ALIGN(wedge_444_32x16[ 16 * 32 * 16], 64);
uint8_t ALIGN(wedge_444_32x8 [ 16 * 32 * 8], 64);
uint8_t ALIGN(wedge_444_16x32[ 16 * 16 * 32], 64);
uint8_t ALIGN(wedge_444_16x16[ 16 * 16 * 16], 64);
uint8_t ALIGN(wedge_444_16x8 [ 16 * 16 * 8], 64);
uint8_t ALIGN(wedge_444_8x32 [ 16 * 8 * 32], 64);
uint8_t ALIGN(wedge_444_8x16 [ 16 * 8 * 16], 64);
uint8_t ALIGN(wedge_444_8x8 [ 16 * 8 * 8], 64);
uint8_t ALIGN(wedge_422_16x32[2 * 16 * 16 * 32], 64);
uint8_t ALIGN(wedge_422_16x16[2 * 16 * 16 * 16], 64);
uint8_t ALIGN(wedge_422_16x8 [2 * 16 * 16 * 8], 64);
uint8_t ALIGN(wedge_422_8x32 [2 * 16 * 8 * 32], 64);
uint8_t ALIGN(wedge_422_8x16 [2 * 16 * 8 * 16], 64);
uint8_t ALIGN(wedge_422_8x8 [2 * 16 * 8 * 8], 64);
uint8_t ALIGN(wedge_422_4x32 [2 * 16 * 4 * 32], 64);
uint8_t ALIGN(wedge_422_4x16 [2 * 16 * 4 * 16], 64);
uint8_t ALIGN(wedge_422_4x8 [2 * 16 * 4 * 8], 64);
uint8_t ALIGN(wedge_420_16x16[2 * 16 * 16 * 16], 64);
uint8_t ALIGN(wedge_420_16x8 [2 * 16 * 16 * 8], 64);
uint8_t ALIGN(wedge_420_16x4 [2 * 16 * 16 * 4], 64);
uint8_t ALIGN(wedge_420_8x16 [2 * 16 * 8 * 16], 64);
uint8_t ALIGN(wedge_420_8x8 [2 * 16 * 8 * 8], 64);
uint8_t ALIGN(wedge_420_8x4 [2 * 16 * 8 * 4], 64);
uint8_t ALIGN(wedge_420_4x16 [2 * 16 * 4 * 16], 64);
uint8_t ALIGN(wedge_420_4x8 [2 * 16 * 4 * 8], 64);
uint8_t ALIGN(wedge_420_4x4 [2 * 16 * 4 * 4], 64);
uint8_t ALIGN(ii_dc [ 32 * 32], 64);
uint8_t ALIGN(ii_nondc_32x32[3 * 32 * 32], 64);
uint8_t ALIGN(ii_nondc_16x32[3 * 16 * 32], 64);
uint8_t ALIGN(ii_nondc_16x16[3 * 16 * 16], 64);
uint8_t ALIGN(ii_nondc_8x32 [3 * 8 * 32], 64);
uint8_t ALIGN(ii_nondc_8x16 [3 * 8 * 16], 64);
uint8_t ALIGN(ii_nondc_8x8 [3 * 8 * 8], 64);
uint8_t ALIGN(ii_nondc_4x16 [3 * 4 * 16], 64);
uint8_t ALIGN(ii_nondc_4x8 [3 * 4 * 8], 32);
uint8_t ALIGN(ii_nondc_4x4 [3 * 4 * 4], 16);
} Dav1dMasks;
#define II_MASK(c, bs, b) \
((const uint8_t*)((uintptr_t)&dav1d_masks + \
(size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
#define WEDGE_MASK(c, bs, sign, idx) \
((const uint8_t*)((uintptr_t)&dav1d_masks + \
(size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
EXTERN Dav1dMasks dav1d_masks;
void dav1d_init_ii_wedge_masks(void);
#endif