• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17  extern "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  
29  typedef enum BLOCK_SIZE {
30    BLOCK_4X4,
31    BLOCK_4X8,
32    BLOCK_8X4,
33    BLOCK_8X8,
34    BLOCK_8X16,
35    BLOCK_16X8,
36    BLOCK_16X16,
37    BLOCK_16X32,
38    BLOCK_32X16,
39    BLOCK_32X32,
40    BLOCK_32X64,
41    BLOCK_64X32,
42    BLOCK_64X64,
43    BLOCK_SIZES,
44    BLOCK_INVALID = BLOCK_SIZES
45  } BLOCK_SIZE;
46  
47  typedef enum PARTITION_TYPE {
48    PARTITION_NONE,
49    PARTITION_HORZ,
50    PARTITION_VERT,
51    PARTITION_SPLIT,
52    PARTITION_TYPES,
53    PARTITION_INVALID = PARTITION_TYPES
54  } PARTITION_TYPE;
55  
56  #define PARTITION_PLOFFSET   4  // number of probability models per block size
57  #define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET)
58  
59  // block transform size
60  typedef enum {
61    TX_4X4 = 0,                      // 4x4 transform
62    TX_8X8 = 1,                      // 8x8 transform
63    TX_16X16 = 2,                    // 16x16 transform
64    TX_32X32 = 3,                    // 32x32 transform
65    TX_SIZES
66  } TX_SIZE;
67  
68  // frame transform mode
69  typedef enum {
70    ONLY_4X4            = 0,        // only 4x4 transform used
71    ALLOW_8X8           = 1,        // allow block transform size up to 8x8
72    ALLOW_16X16         = 2,        // allow block transform size up to 16x16
73    ALLOW_32X32         = 3,        // allow block transform size up to 32x32
74    TX_MODE_SELECT      = 4,        // transform specified for each block
75    TX_MODES            = 5,
76  } TX_MODE;
77  
78  typedef enum {
79    DCT_DCT   = 0,                      // DCT  in both horizontal and vertical
80    ADST_DCT  = 1,                      // ADST in vertical, DCT in horizontal
81    DCT_ADST  = 2,                      // DCT  in vertical, ADST in horizontal
82    ADST_ADST = 3,                      // ADST in both directions
83    TX_TYPES = 4
84  } TX_TYPE;
85  
86  typedef enum {
87    UNKNOWN    = 0,
88    BT_601     = 1,  // YUV
89    BT_709     = 2,  // YUV
90    SMPTE_170  = 3,  // YUV
91    SMPTE_240  = 4,  // YUV
92    RESERVED_1 = 5,
93    RESERVED_2 = 6,
94    SRGB       = 7   // RGB
95  } COLOR_SPACE;
96  
97  typedef enum {
98    VP9_LAST_FLAG = 1 << 0,
99    VP9_GOLD_FLAG = 1 << 1,
100    VP9_ALT_FLAG = 1 << 2,
101  } VP9_REFFRAME;
102  
103  #ifdef __cplusplus
104  }  // extern "C"
105  #endif
106  
107  #endif  // VP9_COMMON_VP9_ENUMS_H_
108