summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/common/enums.h
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
commit7369c7d7a5eed32963d8af37658286617919f91c (patch)
tree5397ce7ee9bca1641118fdc3187bd9e2b24fdc9c /third_party/aom/av1/common/enums.h
parent77887af9c4ad1420bbdb33984af4f74b55ca59db (diff)
downloadUXP-7369c7d7a5eed32963d8af37658286617919f91c.tar
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.gz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.lz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.xz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.zip
Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918
Diffstat (limited to 'third_party/aom/av1/common/enums.h')
-rw-r--r--third_party/aom/av1/common/enums.h156
1 files changed, 145 insertions, 11 deletions
diff --git a/third_party/aom/av1/common/enums.h b/third_party/aom/av1/common/enums.h
index 0cce8f0ee..2b18d32a9 100644
--- a/third_party/aom/av1/common/enums.h
+++ b/third_party/aom/av1/common/enums.h
@@ -54,9 +54,6 @@ extern "C" {
// Maximum number of tile rows and tile columns
#if CONFIG_EXT_TILE
-#define TILE_NORMAL 0
-#define TILE_VR 1
-
#define MAX_TILE_ROWS 1024
#define MAX_TILE_COLS 1024
#else
@@ -68,6 +65,8 @@ extern "C" {
#define MAX_VARTX_DEPTH 2
#endif
+#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
+
// Bitstream profiles indicated by 2-3 bits in the uncompressed header.
// 00: Profile 0. 8-bit 4:2:0 only.
// 10: Profile 1. 8-bit 4:4:4, 4:2:2, and 4:4:0.
@@ -87,7 +86,7 @@ typedef enum BITSTREAM_PROFILE {
// type, so that we can save memory when they are used in structs/arrays.
typedef enum ATTRIBUTE_PACKED {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BLOCK_2X2,
BLOCK_2X4,
BLOCK_4X2,
@@ -130,6 +129,8 @@ typedef enum {
PARTITION_HORZ_B, // HORZ split and the right partition is split again
PARTITION_VERT_A, // VERT split and the top partition is split again
PARTITION_VERT_B, // VERT split and the bottom partition is split again
+ PARTITION_HORZ_4, // 4:1 horizontal partition
+ PARTITION_VERT_4, // 4:1 vertical partition
EXT_PARTITION_TYPES,
#endif // CONFIG_EXT_PARTITION_TYPES
PARTITION_TYPES = PARTITION_SPLIT + 1,
@@ -193,6 +194,22 @@ typedef enum ATTRIBUTE_PACKED {
#define MAX_NUM_TXB (1 << (MAX_SB_SIZE_LOG2 - MIN_TX_SIZE_LOG2))
+#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
+typedef enum ATTRIBUTE_PACKED {
+ NO_OVERLAP,
+ NCOBMC_MODE_1,
+ NCOBMC_MODE_2,
+ NCOBMC_MODE_3,
+ NCOBMC_MODE_4,
+ NCOBMC_MODE_5,
+ NCOBMC_MODE_6,
+ NCOBMC_MODE_7,
+ NCOBMC_MODE_8,
+ MAX_NCOBMC_MODES
+} NCOBMC_MODE;
+// #define MAX_INTRPL_MODES 9
+#endif
+
// frame transform mode
typedef enum {
ONLY_4X4 = 0, // only 4x4 transform used
@@ -212,6 +229,8 @@ typedef enum {
ADST_1D = 1,
FLIPADST_1D = 2,
IDTX_1D = 3,
+ // TODO(sarahparker) need to eventually put something here for the
+ // mrc experiment to make this work with the ext-tx pruning functions
TX_TYPES_1D = 4,
} TX_TYPE_1D;
@@ -234,9 +253,18 @@ typedef enum {
V_FLIPADST = 14,
H_FLIPADST = 15,
#endif // CONFIG_EXT_TX
+#if CONFIG_MRC_TX
+ MRC_DCT, // DCT in both directions with mrc based bitmask
+#endif // CONFIG_MRC_TX
TX_TYPES,
} TX_TYPE;
+#if CONFIG_EXT_TX
+#define IS_2D_TRANSFORM(tx_type) (tx_type < IDTX)
+#else
+#define IS_2D_TRANSFORM(tx_type) 1
+#endif
+
typedef enum {
TILE_LEFT_BOUNDARY = 1,
TILE_RIGHT_BOUNDARY = 2,
@@ -252,10 +280,15 @@ typedef enum {
#if CONFIG_CHROMA_2X2
#define EXT_TX_SIZES 5 // number of sizes that use extended transforms
#else
-#define EXT_TX_SIZES 4 // number of sizes that use extended transforms
-#endif // CONFIG_CHROMA_2X2
+#define EXT_TX_SIZES 4 // number of sizes that use extended transforms
+#endif // CONFIG_CHROMA_2X2
+#if CONFIG_MRC_TX
+#define EXT_TX_SETS_INTER 5 // Sets of transform selections for INTER
+#define EXT_TX_SETS_INTRA 4 // Sets of transform selections for INTRA
+#else // CONFIG_MRC_TX
#define EXT_TX_SETS_INTER 4 // Sets of transform selections for INTER
#define EXT_TX_SETS_INTRA 3 // Sets of transform selections for INTRA
+#endif // CONFIG_MRC_TX
#else
#if CONFIG_CHROMA_2X2
#define EXT_TX_SIZES 4 // number of sizes that use extended transforms
@@ -271,15 +304,33 @@ typedef enum {
AOM_LAST3_FLAG = 1 << 2,
AOM_GOLD_FLAG = 1 << 3,
AOM_BWD_FLAG = 1 << 4,
+#if CONFIG_ALTREF2
+ AOM_ALT2_FLAG = 1 << 5,
+ AOM_ALT_FLAG = 1 << 6,
+ AOM_REFFRAME_ALL = (1 << 7) - 1
+#else // !CONFIG_ALTREF2
AOM_ALT_FLAG = 1 << 5,
AOM_REFFRAME_ALL = (1 << 6) - 1
-#else
+#endif // CONFIG_ALTREF2
+#else // !CONFIG_EXT_REFS
AOM_GOLD_FLAG = 1 << 1,
AOM_ALT_FLAG = 1 << 2,
AOM_REFFRAME_ALL = (1 << 3) - 1
#endif // CONFIG_EXT_REFS
} AOM_REFFRAME;
+#if CONFIG_EXT_COMP_REFS
+#define USE_UNI_COMP_REFS 1
+
+typedef enum {
+ UNIDIR_COMP_REFERENCE = 0,
+ BIDIR_COMP_REFERENCE = 1,
+ COMP_REFERENCE_TYPES = 2,
+} COMP_REFERENCE_TYPE;
+#else // !CONFIG_EXT_COMP_REFS
+#define USE_UNI_COMP_REFS 0
+#endif // CONFIG_EXT_COMP_REFS
+
typedef enum { PLANE_TYPE_Y = 0, PLANE_TYPE_UV = 1, PLANE_TYPES } PLANE_TYPE;
#if CONFIG_CFL
@@ -318,6 +369,8 @@ typedef enum {
} PALETTE_COLOR;
#endif // CONFIG_PALETTE
+// Note: All directional predictors must be between V_PRED and D63_PRED (both
+// inclusive).
typedef enum ATTRIBUTE_PACKED {
DC_PRED, // Average of above and left pixels
V_PRED, // Vertical
@@ -344,7 +397,7 @@ typedef enum ATTRIBUTE_PACKED {
#if CONFIG_COMPOUND_SINGLEREF
// Single ref compound modes
SR_NEAREST_NEARMV,
- SR_NEAREST_NEWMV,
+ // SR_NEAREST_NEWMV,
SR_NEAR_NEWMV,
SR_ZERO_NEWMV,
SR_NEW_NEWMV,
@@ -360,10 +413,41 @@ typedef enum ATTRIBUTE_PACKED {
NEW_NEWMV,
#endif // CONFIG_EXT_INTER
MB_MODE_COUNT,
- INTRA_MODES = TM_PRED + 1,
+ INTRA_MODES = TM_PRED + 1, // TM_PRED has to be the last intra mode.
INTRA_INVALID = MB_MODE_COUNT // For uv_mode in inter blocks
} PREDICTION_MODE;
+#if CONFIG_CFL
+// TODO(ltrudeau) Do we really want to pack this?
+// TODO(ltrudeau) Do we match with PREDICTION_MODE?
+typedef enum ATTRIBUTE_PACKED {
+ UV_DC_PRED, // Average of above and left pixels
+ UV_V_PRED, // Vertical
+ UV_H_PRED, // Horizontal
+ UV_D45_PRED, // Directional 45 deg = round(arctan(1/1) * 180/pi)
+ UV_D135_PRED, // Directional 135 deg = 180 - 45
+ UV_D117_PRED, // Directional 117 deg = 180 - 63
+ UV_D153_PRED, // Directional 153 deg = 180 - 27
+ UV_D207_PRED, // Directional 207 deg = 180 + 27
+ UV_D63_PRED, // Directional 63 deg = round(arctan(2/1) * 180/pi)
+#if CONFIG_ALT_INTRA
+ UV_SMOOTH_PRED, // Combination of horizontal and vertical interpolation
+#if CONFIG_SMOOTH_HV
+ UV_SMOOTH_V_PRED, // Vertical interpolation
+ UV_SMOOTH_H_PRED, // Horizontal interpolation
+#endif // CONFIG_SMOOTH_HV
+#endif // CONFIG_ALT_INTRA
+ UV_TM_PRED, // True-motion
+ UV_INTRA_MODES,
+ UV_MODE_INVALID, // For uv_mode in inter blocks
+} UV_PREDICTION_MODE;
+#else
+#define UV_INTRA_MODES (INTRA_MODES)
+#define UV_PREDICTION_MODE PREDICTION_MODE
+#define UV_DC_PRED (DC_PRED)
+#define UV_MODE_INVALID (INTRA_INVALID)
+#endif // CONFIG_CFL
+
typedef enum {
SIMPLE_TRANSLATION = 0,
#if CONFIG_MOTION_VAR
@@ -372,9 +456,23 @@ typedef enum {
#if CONFIG_WARPED_MOTION
WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
+ NCOBMC_ADAPT_WEIGHT,
+#endif
MOTION_MODES
} MOTION_MODE;
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
+typedef enum {
+ ADAPT_OVERLAP_BLOCK_8X8,
+ ADAPT_OVERLAP_BLOCK_16X16,
+ ADAPT_OVERLAP_BLOCK_32X32,
+ ADAPT_OVERLAP_BLOCK_64X64,
+ ADAPT_OVERLAP_BLOCKS,
+ ADAPT_OVERLAP_BLOCK_INVALID = 255
+} ADAPT_OVERLAP_BLOCK;
+#endif
+
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
typedef enum {
@@ -479,6 +577,12 @@ typedef enum {
#define INTRA_INTER_CONTEXTS 4
#define COMP_INTER_CONTEXTS 5
#define REF_CONTEXTS 5
+
+#if CONFIG_EXT_COMP_REFS
+#define COMP_REF_TYPE_CONTEXTS 5
+#define UNI_COMP_REF_CONTEXTS 3
+#endif // CONFIG_EXT_COMP_REFS
+
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#define COMP_INTER_MODE_CONTEXTS 4
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
@@ -497,9 +601,16 @@ typedef uint8_t TXFM_CONTEXT;
#define LAST3_FRAME 3
#define GOLDEN_FRAME 4
#define BWDREF_FRAME 5
+
+#if CONFIG_ALTREF2
+#define ALTREF2_FRAME 6
+#define ALTREF_FRAME 7
+#else // !CONFIG_ALTREF2
#define ALTREF_FRAME 6
+#endif // CONFIG_ALTREF2
+
#define LAST_REF_FRAMES (LAST3_FRAME - LAST_FRAME + 1)
-#else
+#else // !CONFIG_EXT_REFS
#define GOLDEN_FRAME 2
#define ALTREF_FRAME 3
#endif // CONFIG_EXT_REFS
@@ -518,7 +629,18 @@ typedef uint8_t TXFM_CONTEXT;
#endif // CONFIG_EXT_REFS
#define SINGLE_REFS (FWD_REFS + BWD_REFS)
+#if CONFIG_EXT_COMP_REFS
+typedef enum {
+ LAST_LAST2_FRAMES, // { LAST_FRAME, LAST2_FRAME }
+ LAST_LAST3_FRAMES, // { LAST_FRAME, LAST3_FRAME }
+ LAST_GOLDEN_FRAMES, // { LAST_FRAME, GOLDEN_FRAME }
+ BWDREF_ALTREF_FRAMES, // { BWDREF_FRAME, ALTREF_FRAME }
+ UNIDIR_COMP_REFS
+} UNIDIR_COMP_REF;
+#define COMP_REFS (FWD_REFS * BWD_REFS + UNIDIR_COMP_REFS)
+#else // !CONFIG_EXT_COMP_REFS
#define COMP_REFS (FWD_REFS * BWD_REFS)
+#endif // CONFIG_EXT_COMP_REFS
#define MODE_CTX_REF_FRAMES (TOTAL_REFS_PER_FRAME + COMP_REFS)
@@ -539,11 +661,23 @@ typedef enum {
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_FRAME_SUPERRES
-#define SUPERRES_SCALE_DENOMINATOR 16
#define SUPERRES_SCALE_BITS 3
#define SUPERRES_SCALE_NUMERATOR_MIN 8
#endif // CONFIG_FRAME_SUPERRES
+#if CONFIG_LPF_DIRECT
+typedef enum {
+ VERT_HORZ,
+ DEGREE_30,
+ DEGREE_45,
+ DEGREE_60,
+ DEGREE_120,
+ DEGREE_135,
+ DEGREE_150,
+ FILTER_DEGREES,
+} FILTER_DEGREE;
+#endif // CONFIG_LPF_DIRECT
+
#ifdef __cplusplus
} // extern "C"
#endif