123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- #ifndef H264_DEFINES_H_
- #define H264_DEFINES_H_
- #pragma once
- #if defined _DEBUG
- # define TRACE 0
- #else
- # define TRACE 0
- #endif
- #define JM "16.1 (FRExt)"
- #define VERSION "16.1"
- #define EXT_VERSION "(FRExt)"
- #define DUMP_DPB 0
- #define PAIR_FIELDS_IN_OUTPUT 0
- #define IMGTYPE 0
- #define ENABLE_FIELD_CTX 1
- #define ENABLE_HIGH444_CTX 1
- #define ZEROSNR 0
- #define ENABLE_OUTPUT_TONEMAPPING 1
- #include "typedefs.h"
- #define H264_MEMORY_ALIGNMENT 32
- #define MAX_NUM_SLICES 50
- #define MAX_REFERENCE_PICTURES 32
- #define MAX_CODED_FRAME_SIZE 8000000
- #define BASELINE 66
- #define MAIN 77
- #define EXTENDED 88
- #define FREXT_HP 100
- #define FREXT_Hi10P 110
- #define FREXT_Hi422 122
- #define FREXT_Hi444 244
- #define FREXT_CAVLC444 44
- #define FILE_NAME_SIZE 255
- #define INPUT_TEXT_SIZE 1024
- #if (ENABLE_HIGH444_CTX == 1)
- # define NUM_BLOCK_TYPES 22
- #else
- # define NUM_BLOCK_TYPES 10
- #endif
- #define BLOCK_SHIFT 2
- #define BLOCK_SIZE 4
- #define BLOCK_SIZE_8x8 8
- #define SMB_BLOCK_SIZE 8
- #define BLOCK_PIXELS 16
- #define MB_BLOCK_SIZE 16
- #define MB_PIXELS 256
- #define MB_PIXELS_SHIFT 8
- #define MB_BLOCK_SHIFT 4
- #define BLOCK_MULTIPLE 4
- #define MB_BLOCK_PARTITIONS 16
- #define BLOCK_CONTEXT 64
- #define BLOCK_SIZE_SP 16
- #define BLOCK_SIZE_8x8_SP 32
- enum {
- PSKIP = 0,
- BSKIP_DIRECT = 0,
- P16x16 = 1,
- P16x8 = 2,
- P8x16 = 3,
- SMB8x8 = 4,
- SMB8x4 = 5,
- SMB4x8 = 6,
- SMB4x4 = 7,
- P8x8 = 8,
- I4MB = 9,
- I16MB = 10,
- IBLOCK = 11,
- SI4MB = 12,
- I8MB = 13,
- IPCM = 14,
- MAXMODE = 15
- } ;
- #define NO_INTRA_PMODE 9
- enum {
- DIR_TEMPORAL = 0,
- DIR_SPATIAL = 1
- } ;
- enum {
- LUMA = 0,
- LUMA_INTRA16x16DC = 1,
- LUMA_INTRA16x16AC = 2,
- CB = 3,
- CB_INTRA16x16DC = 4,
- CB_INTRA16x16AC = 5,
- CR = 8,
- CR_INTRA16x16DC = 9,
- CR_INTRA16x16AC = 10
- } ;
- enum {
- LUMA_16DC = 0,
- LUMA_16AC = 1,
- LUMA_8x8 = 2,
- LUMA_8x4 = 3,
- LUMA_4x8 = 4,
- LUMA_4x4 = 5,
- CHROMA_DC = 6,
- CHROMA_AC = 7,
- CHROMA_DC_2x4 = 8,
- CHROMA_DC_4x4 = 9,
- CB_16DC = 10,
- CB_16AC = 11,
- CB_8x8 = 12,
- CB_8x4 = 13,
- CB_4x8 = 14,
- CB_4x4 = 15,
- CR_16DC = 16,
- CR_16AC = 17,
- CR_8x8 = 18,
- CR_8x4 = 19,
- CR_4x8 = 20,
- CR_4x4 = 21
- } ;
- #define Q_BITS 15
- #define DQ_BITS 6
- #define Q_BITS_8 16
- #define DQ_BITS_8 6
- #define IS_INTRA(MB) (!!((1 << (MB)->mb_type) & ((1<<I4MB) | (1<<I16MB) | (1<<IPCM) | (1<<I8MB) | (1<<SI4MB))))
- #define IS_I16MB(MB) ((MB)->mb_type==I16MB || (MB)->mb_type==IPCM)
- #define IS_INTER(MB) (!IS_INTRA(MB))
- #define IS_INTERMV(MB) ((MB)->mb_type!=I4MB && (MB)->mb_type!=I16MB && (MB)->mb_type!=I8MB && (MB)->mb_type!=0 && (MB)->mb_type!=IPCM)
- #define IS_DIRECT(MB) ((MB)->mb_type==0 && (currSlice->slice_type == B_SLICE ))
- #define IS_SKIP(MB) ((MB)->mb_type==0 && (currSlice->slice_type == P_SLICE || currSlice->slice_type == SP_SLICE))
- #define TOTRUN_NUM 15
- #define RUNBEFORE_NUM 7
- #define RUNBEFORE_NUM_M1 6
- #define MIN_QP 0
- #define MAX_QP 51
- enum {
- VERT_PRED = 0,
- HOR_PRED = 1,
- DC_PRED = 2,
- DIAG_DOWN_LEFT_PRED = 3,
- DIAG_DOWN_RIGHT_PRED = 4,
- VERT_RIGHT_PRED = 5,
- HOR_DOWN_PRED = 6,
- VERT_LEFT_PRED = 7,
- HOR_UP_PRED = 8
- } ;
- enum {
- VERT_PRED_16 = 0,
- HOR_PRED_16 = 1,
- DC_PRED_16 = 2,
- PLANE_16 = 3
- } ;
- enum {
- DC_PRED_8 = 0,
- HOR_PRED_8 = 1,
- VERT_PRED_8 = 2,
- PLANE_8 = 3
- } ;
- enum {
- EOS = 1,
- SOP = 2,
- SOS = 3
- };
- enum {
- MVPRED_MEDIAN = 0,
- MVPRED_L = 1,
- MVPRED_U = 2,
- MVPRED_UR = 3
- } ;
- enum {
- DECODING_OK = 0,
- SEARCH_SYNC = 1,
- PICTURE_DECODED = 2
- };
- #define LAMBDA_ACCURACY_BITS 16
- #define INVALIDINDEX (-135792468)
- #define RC_MAX_TEMPORAL_LEVELS 5
- #define ZEROBYTES_SHORTSTARTCODE 2
- #define MAX_PLANE 3
- #define IS_INDEPENDENT(IMG) ((IMG)->separate_colour_plane_flag)
- #define IS_FREXT_PROFILE(profile_idc) ( profile_idc>=FREXT_HP || profile_idc == FREXT_CAVLC444 )
- #define HI_INTRA_ONLY_PROFILE (((p_Vid->active_sps->profile_idc>=FREXT_Hi10P)&&(p_Vid->active_sps->constrained_set3_flag))||(p_Vid->active_sps->profile_idc==FREXT_CAVLC444))
- enum
- {
- VUI_AR_UNDEFINED = 0,
- VUI_AR_SQUARE = 1,
- VUI_AR_12_11 = 2,
- VUI_AR_10_11 = 3,
- VUI_AR_16_11 = 4,
- VUI_AR_40_33 = 5,
- VUI_AR_24_11 = 6,
- VUI_AR_20_11 = 7,
- VUI_AR_32_11 = 8,
- VUI_AR_80_33 = 9,
- VUI_AR_18_11 = 10,
- VUI_AR_15_11 = 11,
- VUI_AR_64_33 = 12,
- VUI_AR_160_99 = 13,
- VUI_AR_4_3 = 14,
- VUI_AR_3_2 = 15,
- VUI_AR_2_1 = 16,
-
- VUI_EXTENDED_SAR = 255,
- };
- #endif
|