1/*
2 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef VP9_COMMON_VP9_ENUMS_H_
12#define VP9_COMMON_VP9_ENUMS_H_
13
14#include "./vpx_config.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define MI_SIZE_LOG2 3
21#define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2)  // 64 = 2^6
22
23#define MI_SIZE (1 << MI_SIZE_LOG2)  // pixels per mi-unit
24#define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2)  // mi-units per max block
25
26#define MI_MASK (MI_BLOCK_SIZE - 1)
27
28// Bitstream profiles indicated by 2 bits in the uncompressed header.
29// 00: Profile 0. 4:2:0 only.
30// 10: Profile 1. adds 4:4:4, 4:2:2, alpha.
31// 01: Profile 2. Supports 10-bit and 12-bit color only.
32// 11: Undefined profile.
33typedef enum BITSTREAM_PROFILE {
34  PROFILE_0,
35  PROFILE_1,
36  PROFILE_2,
37  MAX_PROFILES
38} BITSTREAM_PROFILE;
39
40typedef enum BIT_DEPTH {
41  BITS_8,
42  BITS_10,
43  BITS_12
44} BIT_DEPTH;
45
46typedef enum BLOCK_SIZE {
47  BLOCK_4X4,
48  BLOCK_4X8,
49  BLOCK_8X4,
50  BLOCK_8X8,
51  BLOCK_8X16,
52  BLOCK_16X8,
53  BLOCK_16X16,
54  BLOCK_16X32,
55  BLOCK_32X16,
56  BLOCK_32X32,
57  BLOCK_32X64,
58  BLOCK_64X32,
59  BLOCK_64X64,
60  BLOCK_SIZES,
61  BLOCK_INVALID = BLOCK_SIZES
62} BLOCK_SIZE;
63
64typedef enum PARTITION_TYPE {
65  PARTITION_NONE,
66  PARTITION_HORZ,
67  PARTITION_VERT,
68  PARTITION_SPLIT,
69  PARTITION_TYPES,
70  PARTITION_INVALID = PARTITION_TYPES
71} PARTITION_TYPE;
72
73#define PARTITION_PLOFFSET   4  // number of probability models per block size
74#define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET)
75
76// block transform size
77typedef enum {
78  TX_4X4 = 0,                      // 4x4 transform
79  TX_8X8 = 1,                      // 8x8 transform
80  TX_16X16 = 2,                    // 16x16 transform
81  TX_32X32 = 3,                    // 32x32 transform
82  TX_SIZES
83} TX_SIZE;
84
85// frame transform mode
86typedef enum {
87  ONLY_4X4            = 0,        // only 4x4 transform used
88  ALLOW_8X8           = 1,        // allow block transform size up to 8x8
89  ALLOW_16X16         = 2,        // allow block transform size up to 16x16
90  ALLOW_32X32         = 3,        // allow block transform size up to 32x32
91  TX_MODE_SELECT      = 4,        // transform specified for each block
92  TX_MODES            = 5,
93} TX_MODE;
94
95typedef enum {
96  DCT_DCT   = 0,                      // DCT  in both horizontal and vertical
97  ADST_DCT  = 1,                      // ADST in vertical, DCT in horizontal
98  DCT_ADST  = 2,                      // DCT  in vertical, ADST in horizontal
99  ADST_ADST = 3,                      // ADST in both directions
100  TX_TYPES = 4
101} TX_TYPE;
102
103typedef enum {
104  UNKNOWN    = 0,
105  BT_601     = 1,  // YUV
106  BT_709     = 2,  // YUV
107  SMPTE_170  = 3,  // YUV
108  SMPTE_240  = 4,  // YUV
109  RESERVED_1 = 5,
110  RESERVED_2 = 6,
111  SRGB       = 7   // RGB
112} COLOR_SPACE;
113
114typedef enum {
115  VP9_LAST_FLAG = 1 << 0,
116  VP9_GOLD_FLAG = 1 << 1,
117  VP9_ALT_FLAG = 1 << 2,
118} VP9_REFFRAME;
119
120#ifdef __cplusplus
121}  // extern "C"
122#endif
123
124#endif  // VP9_COMMON_VP9_ENUMS_H_
125