48 #pragma warning( disable : 4018 )
50 #pragma warning( disable : 4800 )
51 #endif // _MSC_VER > 1000
56 inline Int64 abs (
Int64 x) {
return _abs64(x); };
67 #define NV_VERSION "16.18"
74 #define NVM_COMPILEDBY "[GCC %d.%d.%d]", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
76 #define NVM_ONARCH "[on 64-bit] "
78 #define NVM_ONARCH "[on 32-bit] "
82 #ifdef __INTEL_COMPILER
83 #define NVM_COMPILEDBY "[ICC %d]", __INTEL_COMPILER
85 #define NVM_COMPILEDBY "[VS %d]", _MSC_VER
88 #ifndef NVM_COMPILEDBY
89 #define NVM_COMPILEDBY "[Unk-CXX]"
93 #define NVM_ONOS "[Windows]"
95 #define NVM_ONOS "[Linux]"
97 #define NVM_ONOS "[Cygwin]"
99 #define NVM_ONOS "[Mac OS X]"
101 #define NVM_ONOS "[Unk-OS]"
104 #define NVM_BITS "[%d bit] ", (sizeof(Void*) == 8 ? 64 : 32)
173 #if ADAPTIVE_QP_SELECTION
252 template <
typename T>
inline T
Clip3 (
const T minVal,
const T maxVal,
const T a) {
return std::min<T> (std::max<T> (minVal, a) , maxVal); }
253 template <
typename T>
inline T
ClipBD(
const T x,
const Int bitDepth) {
return Clip3(T(0), T((1 << bitDepth)-1), x); }
255 template <
typename T>
inline Void Check3( T minVal, T maxVal, T a)
257 if ((a > maxVal) || (a < minVal))
259 std::cerr <<
"ERROR: Range check " << minVal <<
" >= " << a <<
" <= " << maxVal <<
" failed" << std::endl;
266 #if DATA_ALIGN && _WIN32 && ( _MSC_VER > 1300 )
267 #define xMalloc( type, len ) _aligned_malloc( sizeof(type)*(len), 32 )
268 #define xFree( ptr ) _aligned_free ( ptr )
270 #define xMalloc( type, len ) malloc ( sizeof(type)*(len) )
271 #define xFree( ptr ) free ( ptr )
274 #define FATAL_ERROR_0(MESSAGE, EXITCODE) \
280 template <
typename ValueType>
inline ValueType
leftShift (
const ValueType value,
const Int shift) {
return (shift >= 0) ? ( value << shift) : ( value >> -shift); }
281 template <
typename ValueType>
inline ValueType
rightShift (
const ValueType value,
const Int shift) {
return (shift >= 0) ? ( value >> shift) : ( value << -shift); }
282 template <
typename ValueType>
inline ValueType
leftShift_round (
const ValueType value,
const Int shift) {
return (shift >= 0) ? ( value << shift) : ((value + (ValueType(1) << (-shift - 1))) >> -shift); }
283 template <
typename ValueType>
inline ValueType
rightShift_round(
const ValueType value,
const Int shift) {
return (shift >= 0) ? ((value + (ValueType(1) << (shift - 1))) >> shift) : ( value << -shift); }
284 #if O0043_BEST_EFFORT_DECODING
289 template <
typename ValueType>
inline ValueType rightShiftEvenRounding(
const ValueType value,
const UInt shift) {
return (shift == 0) ? value : ((value + (1<<(shift-1))-1 + ((value>>shift)&1)) >> shift) ; }
294 #endif // end of #ifndef __COMMONDEF__
static const Int MDCS_MAXIMUM_HEIGHT
(measured in pixels) TUs with height greater than this can only use diagonal scan ...
static const Int SCALING_LIST_REM_NUM
static const Int NOT_VALID
static const Int MAX_NUM_REF_PICS
max. number of pictures used for reference
static const Int MAXIMUM_INTRA_FILTERED_HEIGHT
static const Int SCALING_LIST_NUM
list number for quantization matrix
ValueType leftShift(const ValueType value, const Int shift)
static const Int ARL_C_PRECISION
G382: 7-bit arithmetic precision.
static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP
QP to use for lossless coding.
static const Int AMVP_DECIMATION_FACTOR
static const Int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS
static const Int HOR_IDX
index for intra HORIZONTAL mode
static const Int MAX_NUM_PICS_IN_SOP
static const Int MAX_CU_DEPTH
log2(CTUSize)
static const Int DM_CHROMA_IDX
chroma mode index for derived from luma intra mode
static const Int MAX_NUM_PPS
static const Int NUM_CHROMA_MODE
total number of chroma modes
ValueType leftShift_round(const ValueType value, const Int shift)
static const Int MRG_MAX_NUM_CANDS
MERGE.
static const Int MAX_TU_SIZE
static const Int NUM_LONG_TERM_REF_PIC_SPS
static const Int MAX_NUM_LAYER_IDS
static const Int SCALING_LIST_START_VALUE
start value for dpcm mode
static const Int MLS_GRP_NUM
Max number of coefficient groups, max(16, 64)
static const Int LEVEL_RANGE
G382: max coefficient level in statistics collection.
static const Int MIN_TU_SIZE
static const Int SCALING_LIST_BITS
bit depth of scaling list entries
static const Int MAX_MATRIX_SIZE_NUM
max size number for quantization matrix
static const Int IQUANT_SHIFT
T ClipBD(const T x, const Int bitDepth)
static const Int MAX_NUM_REF
max. number of entries in picture reference list
static const Int MAX_CPB_CNT
Upper bound of (cpb_cnt_minus1 + 1)
static const Int MAX_VPS_NUM_HRD_PARAMETERS
static const Int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS
static const Int LOG2_MAX_NUM_ROWS_MINUS1
static const Int MAX_VPS_OP_SETS_PLUS1
static const Int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS
static const Int LOG2_MAX_NUM_COLUMNS_MINUS1
static const Int MAX_NUM_VPS
static const Int RVM_VCEGAM10_M
static const Int QUANT_SHIFT
Q(4) = 2^14.
static const Int MAX_GOP
max. value of hierarchical GOP size
static const Int MLS_CG_LOG2_WIDTH
static const Int FAST_UDI_MAX_RDMODE_NUM
maximum number of RD comparison in fast-UDI estimation loop
static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME
QP' to use for mixed_lossy_lossless coding.
static const Int VER_IDX
index for intra VERTICAL mode
static const Int MAX_MATRIX_COEF_NUM
max coefficient number for quantization matrix
static const Int AMVP_MAX_NUM_CANDS
AMVP: advanced motion vector prediction - max number of final candidates.
static const Int RExt__GOLOMB_RICE_INCREMENT_DIVISOR
static const Int ADAPT_SR_SCALE
division factor for adaptive search range
static const Int C2FLAG_NUMBER
static const Int RExt__PREDICTION_WEIGHTING_ANALYSIS_DC_PRECISION
Additional fixed bit precision used during encoder-side weighting prediction analysis. Currently only used when high_precision_prediction_weighting_flag is set, for backwards compatibility reasons.
static const Int MAX_INT
max. value of signed 32-bit integer
static const Int LOG2_SCALING_LIST_NEUTRAL_VALUE
log2 of the value that, when used in a scaling list, has no effect on quantisation ...
static const Int CU_DQP_TU_CMAX
max number bins for truncated unary
T Clip3(const T minVal, const T maxVal, const T a)
general min/max clip
ValueType rightShift_round(const ValueType value, const Int shift)
static const Int DC_IDX
index for intra DC mode
ValueType rightShift(const ValueType value, const Int shift)
static const Int MAX_NESTING_NUM_LAYER
static const Int CABAC_INIT_PRESENT_FLAG
static const Int MIN_PU_SIZE
static const UInt LUMA_LEVEL_TO_DQP_LUT_MAXSIZE
max LUT size for QP offset based on luma
static const Int MDCS_ANGLE_LIMIT
0 = Horizontal/vertical only, 1 = Horizontal/vertical +/- 1, 2 = Horizontal/vertical +/- 2 etc...
static const Int NUM_INTRA_MODE
static const Int MAX_TLAYER
Explicit temporal layer QP offset - max number of temporal layer.
static const Int MAX_CU_SIZE
= 1<<(MAX_CU_DEPTH)
static const Int CONTEXT_STATE_BITS
static const Int SCALE_BITS
For fractional bit estimates in RDOQ.
static const Double MAX_DOUBLE
max. value of Double-type value
Void Check3(T minVal, T maxVal, T a)
general min/max clip
static const Int PLANAR_IDX
static const Int MLS_CG_SIZE
Coefficient group size of 4x4; = MLS_CG_LOG2_WIDTH + MLS_CG_LOG2_HEIGHT.
static const Int MAX_NUM_LONG_TERM_REF_PICS
static const Int MLS_CG_LOG2_HEIGHT
static const Int RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS
static const UInt MAX_UINT
max. value of unsigned 32-bit integer
static const Int MAX_NUM_PART_IDXS_IN_CTU_WIDTH
maximum number of partition indices across the width of a CTU (or height of a CTU) ...
static const Int CU_DQP_EG_k
expgolomb order
static const Int MDCS_MAXIMUM_WIDTH
(measured in pixels) TUs with width greater than this can only use diagonal scan
static const Int MAX_TIMECODE_SEI_SETS
Maximum number of time sets.
Define macros, basic types, new types and enumerations.
static const Int MAX_NESTING_NUM_OPS
static const Int MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1
static const Int MAXIMUM_INTRA_FILTERED_WIDTH
static const Int SCALING_LIST_DC
default DC value
static const Int COEF_REMAIN_BIN_REDUCTION
indicates the level at which the VLC transitions from Golomb-Rice to TU+EG(k)
static const Int MAX_NUM_SPS
static const Int LAST_SIGNIFICANT_GROUPS
static const Int MAX_QP_OFFSET_LIST_SIZE
Maximum size of QP offset list is 6 entries.
static const Int SBH_THRESHOLD
value of the fixed SBH controlling threshold
static const Int C1FLAG_NUMBER