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