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