00001
00022 #ifndef _DEFINES_H_
00023 #define _DEFINES_H_
00024
00025 #if defined _DEBUG
00026 # define TRACE 0
00027 #else
00028 # define TRACE 0
00029 #endif
00030
00031 #define DUMP_DPB 0
00032 #define PAIR_FIELDS_IN_OUTPUT 0
00033 #define IMGTYPE 1
00034 #define ENABLE_HIGH444_CTX 1
00035 #define ZEROSNR 0
00036 #define ENABLE_OUTPUT_TONEMAPPING 1
00037
00038
00039
00040 #define MAX_NUM_SLICES 50
00041 #define MAX_REFERENCE_PICTURES 32
00042 #define MAX_CODED_FRAME_SIZE 8000000
00043
00044
00045 #define BASELINE 66
00046 #define MAIN 77
00047 #define EXTENDED 88
00048 #define FREXT_HP 100
00049 #define FREXT_Hi10P 110
00050 #define FREXT_Hi422 122
00051 #define FREXT_Hi444 244
00052 #define FREXT_CAVLC444 44
00053
00054
00055 #define FILE_NAME_SIZE 255
00056
00057 #if (ENABLE_HIGH444_CTX == 1)
00058 # define NUM_BLOCK_TYPES 22
00059 #else
00060 # define NUM_BLOCK_TYPES 10
00061 #endif
00062
00063
00064
00065
00066 #define BLOCK_SHIFT 2
00067 #define BLOCK_SIZE 4
00068 #define BLOCK_SIZE_8x8 8
00069 #define SMB_BLOCK_SIZE 8
00070 #define BLOCK_PIXELS 16
00071 #define MB_BLOCK_SIZE 16
00072 #define MB_PIXELS 256 // MB_BLOCK_SIZE * MB_BLOCK_SIZE
00073 #define MB_PIXELS_SHIFT 8 // log2(MB_BLOCK_SIZE * MB_BLOCK_SIZE)
00074 #define MB_BLOCK_SHIFT 4
00075 #define BLOCK_MULTIPLE 4 // (MB_BLOCK_SIZE/BLOCK_SIZE)
00076 #define MB_BLOCK_PARTITIONS 16 // (BLOCK_MULTIPLE * BLOCK_MULTIPLE)
00077 #define BLOCK_CONTEXT 64 // (4 * MB_BLOCK_PARTITIONS)
00078
00079
00080 #define BLOCK_SIZE_SP 16 // BLOCK_SIZE << 2
00081 #define BLOCK_SIZE_8x8_SP 32 // BLOCK_SIZE8x8 << 2
00082
00083
00084 typedef unsigned char byte;
00085 typedef unsigned char uint8;
00086 typedef unsigned short uint16;
00087 typedef unsigned int uint32;
00088
00089 #if (IMGTYPE == 0)
00090 typedef byte imgpel;
00091 typedef unsigned short distpel;
00092 #else
00093 typedef unsigned short imgpel;
00094 typedef int distpel;
00095 #endif
00096
00097
00098 enum {
00099 PSKIP = 0,
00100 BSKIP_DIRECT = 0,
00101 P16x16 = 1,
00102 P16x8 = 2,
00103 P8x16 = 3,
00104 SMB8x8 = 4,
00105 SMB8x4 = 5,
00106 SMB4x8 = 6,
00107 SMB4x4 = 7,
00108 P8x8 = 8,
00109 I4MB = 9,
00110 I16MB = 10,
00111 IBLOCK = 11,
00112 SI4MB = 12,
00113 I8MB = 13,
00114 IPCM = 14,
00115 MAXMODE = 15
00116 } MBModeTypes;
00117
00118
00119 #define NO_INTRA_PMODE 9
00120
00121
00122 enum {
00123 DIR_TEMPORAL = 0,
00124 DIR_SPATIAL = 1
00125 } DirectModes;
00126
00127
00128 enum {
00129 LUMA = 0,
00130 LUMA_INTRA16x16DC = 1,
00131 LUMA_INTRA16x16AC = 2,
00132 CB = 3,
00133 CB_INTRA16x16DC = 4,
00134 CB_INTRA16x16AC = 5,
00135 CR = 8,
00136 CR_INTRA16x16DC = 9,
00137 CR_INTRA16x16AC = 10
00138 } CAVLCBlockTypes;
00139
00140
00141 enum {
00142 LUMA_16DC = 0,
00143 LUMA_16AC = 1,
00144 LUMA_8x8 = 2,
00145 LUMA_8x4 = 3,
00146 LUMA_4x8 = 4,
00147 LUMA_4x4 = 5,
00148 CHROMA_DC = 6,
00149 CHROMA_AC = 7,
00150 CHROMA_DC_2x4 = 8,
00151 CHROMA_DC_4x4 = 9,
00152 CB_16DC = 10,
00153 CB_16AC = 11,
00154 CB_8x8 = 12,
00155 CB_8x4 = 13,
00156 CB_4x8 = 14,
00157 CB_4x4 = 15,
00158 CR_16DC = 16,
00159 CR_16AC = 17,
00160 CR_8x8 = 18,
00161 CR_8x4 = 19,
00162 CR_4x8 = 20,
00163 CR_4x4 = 21
00164 } CABACBlockTypes;
00165
00166
00167 #define IS_INTRA(MB) ((MB)->mb_type==I4MB || (MB)->mb_type==I16MB ||(MB)->mb_type==IPCM || (MB)->mb_type==I8MB || (MB)->mb_type==SI4MB)
00168 #define IS_I16MB(MB) ((MB)->mb_type==I16MB || (MB)->mb_type==IPCM)
00169
00170 #define IS_INTER(MB) ((MB)->mb_type!=I4MB && (MB)->mb_type!=I16MB && (MB)->mb_type!=I8MB && (MB)->mb_type!=IPCM)
00171 #define IS_INTERMV(MB) ((MB)->mb_type!=I4MB && (MB)->mb_type!=I16MB && (MB)->mb_type!=I8MB && (MB)->mb_type!=0 && (MB)->mb_type!=IPCM)
00172 #define IS_DIRECT(MB) ((MB)->mb_type==0 && (img->type==B_SLICE ))
00173 #define IS_SKIP(MB) ((MB)->mb_type==0 && (img->type==P_SLICE || img->type==SP_SLICE))
00174
00175 #define TOTRUN_NUM 15
00176 #define RUNBEFORE_NUM 7
00177 #define RUNBEFORE_NUM_M1 6
00178
00179
00180 #define MIN_QP 0
00181 #define MAX_QP 51
00182
00183 enum {
00184 VERT_PRED = 0,
00185 HOR_PRED = 1,
00186 DC_PRED = 2,
00187 DIAG_DOWN_LEFT_PRED = 3,
00188 DIAG_DOWN_RIGHT_PRED = 4,
00189 VERT_RIGHT_PRED = 5,
00190 HOR_DOWN_PRED = 6,
00191 VERT_LEFT_PRED = 7,
00192 HOR_UP_PRED = 8
00193 } I4x4PredModes;
00194
00195
00196 enum {
00197 VERT_PRED_16 = 0,
00198 HOR_PRED_16 = 1,
00199 DC_PRED_16 = 2,
00200 PLANE_16 = 3
00201 } I16x16PredModes;
00202
00203
00204 enum {
00205 DC_PRED_8 = 0,
00206 HOR_PRED_8 = 1,
00207 VERT_PRED_8 = 2,
00208 PLANE_8 = 3
00209 } I8x8PredModes;
00210
00211 enum {
00212 EOS = 1,
00213 SOP = 2,
00214 SOS = 3
00215 };
00216
00217
00218 enum {
00219 MVPRED_MEDIAN = 0,
00220 MVPRED_L = 1,
00221 MVPRED_U = 2,
00222 MVPRED_UR = 3
00223 } MVPredTypes;
00224
00225 enum {
00226 DECODING_OK = 0,
00227 SEARCH_SYNC = 1,
00228 PICTURE_DECODED = 2
00229 };
00230
00231 #define INVALIDINDEX (-135792468)
00232
00233
00234
00235 #define ZEROBYTES_SHORTSTARTCODE 2 //indicates the number of zero bytes in the short start-code prefix
00236
00237 #define MAX_PLANE 3
00238 #define IS_INDEPENDENT(IMG) ((IMG)->separate_colour_plane_flag)
00239 #define IS_FREXT_PROFILE(profile_idc) ( profile_idc>=FREXT_HP || profile_idc == FREXT_CAVLC444 )
00240 #define HI_INTRA_ONLY_PROFILE (((active_sps->profile_idc>=FREXT_Hi10P)&&(active_sps->constrained_set3_flag))||(active_sps->profile_idc==FREXT_CAVLC444))
00241 #endif
00242