| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef VP9_COMMON_VP9_ENUMS_H_ | 11 #ifndef VP9_COMMON_VP9_ENUMS_H_ |
| 12 #define VP9_COMMON_VP9_ENUMS_H_ | 12 #define VP9_COMMON_VP9_ENUMS_H_ |
| 13 | 13 |
| 14 #include "./vpx_config.h" | 14 #include "./vpx_config.h" |
| 15 #include "vpx/vpx_integer.h" |
| 15 | 16 |
| 16 #ifdef __cplusplus | 17 #ifdef __cplusplus |
| 17 extern "C" { | 18 extern "C" { |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 #define MI_SIZE_LOG2 3 | 21 #define MI_SIZE_LOG2 3 |
| 21 #define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2) // 64 = 2^6 | 22 #define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2) // 64 = 2^6 |
| 22 | 23 |
| 23 #define MI_SIZE (1 << MI_SIZE_LOG2) // pixels per mi-unit | 24 #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 #define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2) // mi-units per max block |
| 25 | 26 |
| 26 #define MI_MASK (MI_BLOCK_SIZE - 1) | 27 #define MI_MASK (MI_BLOCK_SIZE - 1) |
| 27 | 28 |
| 28 // Bitstream profiles indicated by 2-3 bits in the uncompressed header. | 29 // Bitstream profiles indicated by 2-3 bits in the uncompressed header. |
| 29 // 00: Profile 0. 8-bit 4:2:0 only. | 30 // 00: Profile 0. 8-bit 4:2:0 only. |
| 30 // 10: Profile 1. 8-bit 4:4:4, 4:2:2, and 4:4:0. | 31 // 10: Profile 1. 8-bit 4:4:4, 4:2:2, and 4:4:0. |
| 31 // 01: Profile 2. 10-bit and 12-bit color only, with 4:2:0 sampling. | 32 // 01: Profile 2. 10-bit and 12-bit color only, with 4:2:0 sampling. |
| 32 // 110: Profile 3. 10-bit and 12-bit color only, with 4:2:2/4:4:4/4:4:0 | 33 // 110: Profile 3. 10-bit and 12-bit color only, with 4:2:2/4:4:4/4:4:0 |
| 33 // sampling. | 34 // sampling. |
| 34 // 111: Undefined profile. | 35 // 111: Undefined profile. |
| 35 typedef enum BITSTREAM_PROFILE { | 36 typedef enum BITSTREAM_PROFILE { |
| 36 PROFILE_0, | 37 PROFILE_0, |
| 37 PROFILE_1, | 38 PROFILE_1, |
| 38 PROFILE_2, | 39 PROFILE_2, |
| 39 PROFILE_3, | 40 PROFILE_3, |
| 40 MAX_PROFILES | 41 MAX_PROFILES |
| 41 } BITSTREAM_PROFILE; | 42 } BITSTREAM_PROFILE; |
| 42 | 43 |
| 43 typedef enum BLOCK_SIZE { | 44 #define BLOCK_4X4 0 |
| 44 BLOCK_4X4, | 45 #define BLOCK_4X8 1 |
| 45 BLOCK_4X8, | 46 #define BLOCK_8X4 2 |
| 46 BLOCK_8X4, | 47 #define BLOCK_8X8 3 |
| 47 BLOCK_8X8, | 48 #define BLOCK_8X16 4 |
| 48 BLOCK_8X16, | 49 #define BLOCK_16X8 5 |
| 49 BLOCK_16X8, | 50 #define BLOCK_16X16 6 |
| 50 BLOCK_16X16, | 51 #define BLOCK_16X32 7 |
| 51 BLOCK_16X32, | 52 #define BLOCK_32X16 8 |
| 52 BLOCK_32X16, | 53 #define BLOCK_32X32 9 |
| 53 BLOCK_32X32, | 54 #define BLOCK_32X64 10 |
| 54 BLOCK_32X64, | 55 #define BLOCK_64X32 11 |
| 55 BLOCK_64X32, | 56 #define BLOCK_64X64 12 |
| 56 BLOCK_64X64, | 57 #define BLOCK_SIZES 13 |
| 57 BLOCK_SIZES, | 58 #define BLOCK_INVALID BLOCK_SIZES |
| 58 BLOCK_INVALID = BLOCK_SIZES | 59 typedef uint8_t BLOCK_SIZE; |
| 59 } BLOCK_SIZE; | |
| 60 | 60 |
| 61 typedef enum PARTITION_TYPE { | 61 typedef enum PARTITION_TYPE { |
| 62 PARTITION_NONE, | 62 PARTITION_NONE, |
| 63 PARTITION_HORZ, | 63 PARTITION_HORZ, |
| 64 PARTITION_VERT, | 64 PARTITION_VERT, |
| 65 PARTITION_SPLIT, | 65 PARTITION_SPLIT, |
| 66 PARTITION_TYPES, | 66 PARTITION_TYPES, |
| 67 PARTITION_INVALID = PARTITION_TYPES | 67 PARTITION_INVALID = PARTITION_TYPES |
| 68 } PARTITION_TYPE; | 68 } PARTITION_TYPE; |
| 69 | 69 |
| 70 typedef char PARTITION_CONTEXT; | 70 typedef char PARTITION_CONTEXT; |
| 71 #define PARTITION_PLOFFSET 4 // number of probability models per block size | 71 #define PARTITION_PLOFFSET 4 // number of probability models per block size |
| 72 #define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET) | 72 #define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET) |
| 73 | 73 |
| 74 // block transform size | 74 // block transform size |
| 75 typedef enum { | 75 typedef uint8_t TX_SIZE; |
| 76 TX_4X4 = 0, // 4x4 transform | 76 #define TX_4X4 ((TX_SIZE)0) // 4x4 transform |
| 77 TX_8X8 = 1, // 8x8 transform | 77 #define TX_8X8 ((TX_SIZE)1) // 8x8 transform |
| 78 TX_16X16 = 2, // 16x16 transform | 78 #define TX_16X16 ((TX_SIZE)2) // 16x16 transform |
| 79 TX_32X32 = 3, // 32x32 transform | 79 #define TX_32X32 ((TX_SIZE)3) // 32x32 transform |
| 80 TX_SIZES | 80 #define TX_SIZES ((TX_SIZE)4) |
| 81 } TX_SIZE; | |
| 82 | 81 |
| 83 // frame transform mode | 82 // frame transform mode |
| 84 typedef enum { | 83 typedef enum { |
| 85 ONLY_4X4 = 0, // only 4x4 transform used | 84 ONLY_4X4 = 0, // only 4x4 transform used |
| 86 ALLOW_8X8 = 1, // allow block transform size up to 8x8 | 85 ALLOW_8X8 = 1, // allow block transform size up to 8x8 |
| 87 ALLOW_16X16 = 2, // allow block transform size up to 16x16 | 86 ALLOW_16X16 = 2, // allow block transform size up to 16x16 |
| 88 ALLOW_32X32 = 3, // allow block transform size up to 32x32 | 87 ALLOW_32X32 = 3, // allow block transform size up to 32x32 |
| 89 TX_MODE_SELECT = 4, // transform specified for each block | 88 TX_MODE_SELECT = 4, // transform specified for each block |
| 90 TX_MODES = 5, | 89 TX_MODES = 5, |
| 91 } TX_MODE; | 90 } TX_MODE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 103 VP9_GOLD_FLAG = 1 << 1, | 102 VP9_GOLD_FLAG = 1 << 1, |
| 104 VP9_ALT_FLAG = 1 << 2, | 103 VP9_ALT_FLAG = 1 << 2, |
| 105 } VP9_REFFRAME; | 104 } VP9_REFFRAME; |
| 106 | 105 |
| 107 typedef enum { | 106 typedef enum { |
| 108 PLANE_TYPE_Y = 0, | 107 PLANE_TYPE_Y = 0, |
| 109 PLANE_TYPE_UV = 1, | 108 PLANE_TYPE_UV = 1, |
| 110 PLANE_TYPES | 109 PLANE_TYPES |
| 111 } PLANE_TYPE; | 110 } PLANE_TYPE; |
| 112 | 111 |
| 113 typedef enum { | 112 #define DC_PRED 0 // Average of above and left pixels |
| 114 DC_PRED, // Average of above and left pixels | 113 #define V_PRED 1 // Vertical |
| 115 V_PRED, // Vertical | 114 #define H_PRED 2 // Horizontal |
| 116 H_PRED, // Horizontal | 115 #define D45_PRED 3 // Directional 45 deg = round(arctan(1/1) * 180/pi) |
| 117 D45_PRED, // Directional 45 deg = round(arctan(1/1) * 180/pi) | 116 #define D135_PRED 4 // Directional 135 deg = 180 - 45 |
| 118 D135_PRED, // Directional 135 deg = 180 - 45 | 117 #define D117_PRED 5 // Directional 117 deg = 180 - 63 |
| 119 D117_PRED, // Directional 117 deg = 180 - 63 | 118 #define D153_PRED 6 // Directional 153 deg = 180 - 27 |
| 120 D153_PRED, // Directional 153 deg = 180 - 27 | 119 #define D207_PRED 7 // Directional 207 deg = 180 + 27 |
| 121 D207_PRED, // Directional 207 deg = 180 + 27 | 120 #define D63_PRED 8 // Directional 63 deg = round(arctan(2/1) * 180/pi) |
| 122 D63_PRED, // Directional 63 deg = round(arctan(2/1) * 180/pi) | 121 #define TM_PRED 9 // True-motion |
| 123 TM_PRED, // True-motion | 122 #define NEARESTMV 10 |
| 124 NEARESTMV, | 123 #define NEARMV 11 |
| 125 NEARMV, | 124 #define ZEROMV 12 |
| 126 ZEROMV, | 125 #define NEWMV 13 |
| 127 NEWMV, | 126 #define MB_MODE_COUNT 14 |
| 128 MB_MODE_COUNT | 127 typedef uint8_t PREDICTION_MODE; |
| 129 } PREDICTION_MODE; | |
| 130 | 128 |
| 131 #define INTRA_MODES (TM_PRED + 1) | 129 #define INTRA_MODES (TM_PRED + 1) |
| 132 | 130 |
| 133 #define INTER_MODES (1 + NEWMV - NEARESTMV) | 131 #define INTER_MODES (1 + NEWMV - NEARESTMV) |
| 134 | 132 |
| 135 #define SKIP_CONTEXTS 3 | 133 #define SKIP_CONTEXTS 3 |
| 136 #define INTER_MODE_CONTEXTS 7 | 134 #define INTER_MODE_CONTEXTS 7 |
| 137 | 135 |
| 138 /* Segment Feature Masks */ | 136 /* Segment Feature Masks */ |
| 139 #define MAX_MV_REF_CANDIDATES 2 | 137 #define MAX_MV_REF_CANDIDATES 2 |
| 140 | 138 |
| 141 #define INTRA_INTER_CONTEXTS 4 | 139 #define INTRA_INTER_CONTEXTS 4 |
| 142 #define COMP_INTER_CONTEXTS 5 | 140 #define COMP_INTER_CONTEXTS 5 |
| 143 #define REF_CONTEXTS 5 | 141 #define REF_CONTEXTS 5 |
| 144 | 142 |
| 145 #ifdef __cplusplus | 143 #ifdef __cplusplus |
| 146 } // extern "C" | 144 } // extern "C" |
| 147 #endif | 145 #endif |
| 148 | 146 |
| 149 #endif // VP9_COMMON_VP9_ENUMS_H_ | 147 #endif // VP9_COMMON_VP9_ENUMS_H_ |
| OLD | NEW |