1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2014, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TypeDef.h |
---|
35 | \brief Define basic types, new types and enumerations |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef _TYPEDEF__ |
---|
39 | #define _TYPEDEF__ |
---|
40 | |
---|
41 | //! \ingroup TLibCommon |
---|
42 | //! \{ |
---|
43 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
44 | ///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// |
---|
45 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
46 | |
---|
47 | /* HEVC_EXT might be defined by compiler/makefile options. |
---|
48 | |
---|
49 | Linux makefiles support the following settings: |
---|
50 | make -> HEVC_EXT not defined |
---|
51 | make HEVC_EXT=0 -> H_MV=0 H_3D=0 --> plain HM |
---|
52 | make HEVC_EXT=1 -> H_MV=1 H_3D=0 --> MV only |
---|
53 | |
---|
54 | */ |
---|
55 | |
---|
56 | #ifndef HEVC_EXT |
---|
57 | #define HEVC_EXT 1 |
---|
58 | #endif |
---|
59 | |
---|
60 | #if ( HEVC_EXT < 0 )||( HEVC_EXT > 1 ) |
---|
61 | #error HEVC_EXT must be in the range of 0 to 1, inclusive. |
---|
62 | #endif |
---|
63 | |
---|
64 | #define H_MV ( HEVC_EXT != 0) |
---|
65 | |
---|
66 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
67 | /////////////////////////////////// MAJOR DEFINES /////////////////////////////////// |
---|
68 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
69 | #if H_MV |
---|
70 | #define H_MV_ENC_DEC_TRAC 1 //< CU/PU level tracking |
---|
71 | #endif |
---|
72 | ///////////////////////////////////////////////////////////////////////////////// |
---|
73 | /////////////////////////////////// MV_HEVC HLS ////////////////////////////// |
---|
74 | ///////////////////////////////////////////////////////////////////////////////// |
---|
75 | // Fixes |
---|
76 | #define H_MV_FIX_REF_LAYER_PIC_FLAG 1 |
---|
77 | #define H_MV_FIX_NUM_VIEWS 1 |
---|
78 | |
---|
79 | #define H_MV_HLS_FIX 1 |
---|
80 | #define H_MV_HLS_PTL_LIMITS 0 |
---|
81 | #define H_MV_HLS7_GEN 0 // General changes (not tested) |
---|
82 | #define H_MV_ALIGN_HM_15 1 |
---|
83 | |
---|
84 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
85 | /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// |
---|
86 | ///////////////////////////////////////////////////////////////////////////////////////// |
---|
87 | #define HARMONIZE_GOP_FIRST_FIELD_COUPLE 1 |
---|
88 | #define FIX_FIELD_DEPTH 1 |
---|
89 | #if H_MV |
---|
90 | #define EFFICIENT_FIELD_IRAP 0 |
---|
91 | #else |
---|
92 | #define EFFICIENT_FIELD_IRAP 1 |
---|
93 | #endif |
---|
94 | #define ALLOW_RECOVERY_POINT_AS_RAP 1 |
---|
95 | #define BUGFIX_INTRAPERIOD 1 |
---|
96 | #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1 |
---|
97 | |
---|
98 | #define SAO_SGN_FUNC 1 |
---|
99 | |
---|
100 | #define TILE_SIZE_CHECK 1 |
---|
101 | |
---|
102 | #define FIX1172 1 ///< fix ticket #1172 |
---|
103 | |
---|
104 | #define SETTING_PIC_OUTPUT_MARK 1 |
---|
105 | #define SETTING_NO_OUT_PIC_PRIOR 1 |
---|
106 | #define FIX_EMPTY_PAYLOAD_NAL 1 |
---|
107 | #define FIX_WRITING_OUTPUT 1 |
---|
108 | #define FIX_OUTPUT_EOS 1 |
---|
109 | |
---|
110 | #define FIX_POC_CRA_NORASL_OUTPUT 1 |
---|
111 | |
---|
112 | #define MAX_NUM_PICS_IN_SOP 1024 |
---|
113 | |
---|
114 | #define MAX_NESTING_NUM_OPS 1024 |
---|
115 | #define MAX_NESTING_NUM_LAYER 64 |
---|
116 | |
---|
117 | #if H_MV |
---|
118 | #define MAX_VPS_NUM_HRD_PARAMETERS 1024 |
---|
119 | #else |
---|
120 | #define MAX_VPS_NUM_HRD_PARAMETERS 1 |
---|
121 | #endif |
---|
122 | #if H_MV |
---|
123 | #define MAX_NUM_SUB_LAYERS 7 |
---|
124 | #define MAX_NUM_SIGNALLED_PARTITIONING_SCHEMES 16 |
---|
125 | #endif |
---|
126 | #define MAX_VPS_OP_SETS_PLUS1 1024 |
---|
127 | #if H_MV |
---|
128 | #define MAX_VPS_NUM_ADD_LAYER_SETS 1024 |
---|
129 | #define MAX_VPS_NUH_LAYER_ID_PLUS1 63 |
---|
130 | #define MAX_NUM_SCALABILITY_TYPES 16 |
---|
131 | #define ENC_CFG_CONSOUT_SPACE 29 |
---|
132 | #else |
---|
133 | #define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 1 |
---|
134 | #endif |
---|
135 | |
---|
136 | |
---|
137 | #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) |
---|
138 | #if H_MV |
---|
139 | #define MAX_NUM_LAYER_IDS 63 |
---|
140 | #define MAX_NUM_LAYERS 63 |
---|
141 | #define MAX_VPS_PROFILE_TIER_LEVEL 64 |
---|
142 | #define MAX_VPS_ADD_OUTPUT_LAYER_SETS 1024 |
---|
143 | #define MAX_VPS_OUTPUTLAYER_SETS ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 + MAX_VPS_OP_SETS_PLUS1 ) |
---|
144 | #define MAX_NUM_VIDEO_SIGNAL_INFO 16 |
---|
145 | #define MAX_NUM_SCALED_REF_LAYERS MAX_NUM_LAYERS-1 |
---|
146 | #else |
---|
147 | #define MAX_NUM_LAYER_IDS 64 |
---|
148 | #endif |
---|
149 | |
---|
150 | #define COEF_REMAIN_BIN_REDUCTION 3 ///< indicates the level at which the VLC |
---|
151 | ///< transitions from Golomb-Rice to TU+EG(k) |
---|
152 | |
---|
153 | #define CU_DQP_TU_CMAX 5 ///< max number bins for truncated unary |
---|
154 | #define CU_DQP_EG_k 0 ///< expgolomb order |
---|
155 | |
---|
156 | #define SBH_THRESHOLD 4 ///< I0156: value of the fixed SBH controlling threshold |
---|
157 | |
---|
158 | #define SEQUENCE_LEVEL_LOSSLESS 0 ///< H0530: used only for sequence or frame-level lossless coding |
---|
159 | |
---|
160 | #define DISABLING_CLIP_FOR_BIPREDME 1 ///< Ticket #175 |
---|
161 | |
---|
162 | #define C1FLAG_NUMBER 8 // maximum number of largerThan1 flag coded in one chunk : 16 in HM5 |
---|
163 | #define C2FLAG_NUMBER 1 // maximum number of largerThan2 flag coded in one chunk: 16 in HM5 |
---|
164 | #define SAO_ENCODING_CHOICE 1 ///< I0184: picture early termination |
---|
165 | #if SAO_ENCODING_CHOICE |
---|
166 | #define SAO_ENCODING_RATE 0.75 |
---|
167 | #define SAO_ENCODING_CHOICE_CHROMA 1 ///< J0044: picture early termination Luma and Chroma are handled separately |
---|
168 | #if SAO_ENCODING_CHOICE_CHROMA |
---|
169 | #define SAO_ENCODING_RATE_CHROMA 0.5 |
---|
170 | #endif |
---|
171 | #endif |
---|
172 | |
---|
173 | #define MAX_NUM_VPS 16 |
---|
174 | #define MAX_NUM_SPS 16 |
---|
175 | #define MAX_NUM_PPS 64 |
---|
176 | |
---|
177 | #define RDOQ_CHROMA_LAMBDA 1 ///< F386: weighting of chroma for RDOQ |
---|
178 | |
---|
179 | #define MIN_SCAN_POS_CROSS 4 |
---|
180 | |
---|
181 | #define FAST_BIT_EST 1 ///< G763: Table-based bit estimation for CABAC |
---|
182 | |
---|
183 | #define MLS_GRP_NUM 64 ///< G644 : Max number of coefficient groups, max(16, 64) |
---|
184 | #define MLS_CG_SIZE 4 ///< G644 : Coefficient group size of 4x4 |
---|
185 | |
---|
186 | #define ADAPTIVE_QP_SELECTION 1 ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection |
---|
187 | #if ADAPTIVE_QP_SELECTION |
---|
188 | #define ARL_C_PRECISION 7 ///< G382: 7-bit arithmetic precision |
---|
189 | #define LEVEL_RANGE 30 ///< G382: max coefficient level in statistics collection |
---|
190 | #endif |
---|
191 | |
---|
192 | #define HHI_RQT_INTRA_SPEEDUP 1 ///< tests one best mode with full rqt |
---|
193 | #define HHI_RQT_INTRA_SPEEDUP_MOD 0 ///< tests two best modes with full rqt |
---|
194 | |
---|
195 | #if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP |
---|
196 | #error |
---|
197 | #endif |
---|
198 | |
---|
199 | #define VERBOSE_RATE 0 ///< Print additional rate information in encoder |
---|
200 | |
---|
201 | #define AMVP_DECIMATION_FACTOR 4 |
---|
202 | |
---|
203 | #define SCAN_SET_SIZE 16 |
---|
204 | #define LOG2_SCAN_SET_SIZE 4 |
---|
205 | |
---|
206 | #define FAST_UDI_MAX_RDMODE_NUM 35 ///< maximum number of RD comparison in fast-UDI estimation loop |
---|
207 | |
---|
208 | #define ZERO_MVD_EST 0 ///< Zero Mvd Estimation in normal mode |
---|
209 | |
---|
210 | #define NUM_INTRA_MODE 36 |
---|
211 | #if !REMOVE_LM_CHROMA |
---|
212 | #define LM_CHROMA_IDX 35 |
---|
213 | #endif |
---|
214 | |
---|
215 | #define WRITE_BACK 1 ///< Enable/disable the encoder to replace the deltaPOC and Used by current from the config file with the values derived by the refIdc parameter. |
---|
216 | #define AUTO_INTER_RPS 1 ///< Enable/disable the automatic generation of refIdc from the deltaPOC and Used by current from the config file. |
---|
217 | #define PRINT_RPS_INFO 0 ///< Enable/disable the printing of bits used to send the RPS. |
---|
218 | // using one nearest frame as reference frame, and the other frames are high quality (POC%4==0) frames (1+X) |
---|
219 | // this should be done with encoder only decision |
---|
220 | // but because of the absence of reference frame management, the related code was hard coded currently |
---|
221 | |
---|
222 | #define RVM_VCEGAM10_M 4 |
---|
223 | |
---|
224 | #define PLANAR_IDX 0 |
---|
225 | #define VER_IDX 26 // index for intra VERTICAL mode |
---|
226 | #define HOR_IDX 10 // index for intra HORIZONTAL mode |
---|
227 | #define DC_IDX 1 // index for intra DC mode |
---|
228 | #define NUM_CHROMA_MODE 5 // total number of chroma modes |
---|
229 | #define DM_CHROMA_IDX 36 // chroma mode index for derived from luma intra mode |
---|
230 | |
---|
231 | |
---|
232 | #define FAST_UDI_USE_MPM 1 |
---|
233 | |
---|
234 | #define RDO_WITHOUT_DQP_BITS 0 ///< Disable counting dQP bits in RDO-based mode decision |
---|
235 | |
---|
236 | #define FULL_NBIT 0 ///< When enabled, compute costs using full sample bitdepth. When disabled, compute costs as if it is 8-bit source video. |
---|
237 | #if FULL_NBIT |
---|
238 | # define DISTORTION_PRECISION_ADJUSTMENT(x) 0 |
---|
239 | #else |
---|
240 | # define DISTORTION_PRECISION_ADJUSTMENT(x) (x) |
---|
241 | #endif |
---|
242 | |
---|
243 | #define LOG2_MAX_NUM_COLUMNS_MINUS1 7 |
---|
244 | #define LOG2_MAX_NUM_ROWS_MINUS1 7 |
---|
245 | #define LOG2_MAX_COLUMN_WIDTH 13 |
---|
246 | #define LOG2_MAX_ROW_HEIGHT 13 |
---|
247 | |
---|
248 | #define MATRIX_MULT 0 // Brute force matrix multiplication instead of partial butterfly |
---|
249 | |
---|
250 | #define REG_DCT 65535 |
---|
251 | |
---|
252 | #define AMP_SAD 1 ///< dedicated SAD functions for AMP |
---|
253 | #define AMP_ENC_SPEEDUP 1 ///< encoder only speed-up by AMP mode skipping |
---|
254 | #if AMP_ENC_SPEEDUP |
---|
255 | #define AMP_MRG 1 ///< encoder only force merge for AMP partition (no motion search for AMP) |
---|
256 | #endif |
---|
257 | |
---|
258 | #define CABAC_INIT_PRESENT_FLAG 1 |
---|
259 | |
---|
260 | // ==================================================================================================================== |
---|
261 | // Basic type redefinition |
---|
262 | // ==================================================================================================================== |
---|
263 | |
---|
264 | typedef void Void; |
---|
265 | typedef bool Bool; |
---|
266 | |
---|
267 | #ifdef __arm__ |
---|
268 | typedef signed char Char; |
---|
269 | #else |
---|
270 | typedef char Char; |
---|
271 | #endif |
---|
272 | typedef unsigned char UChar; |
---|
273 | typedef short Short; |
---|
274 | typedef unsigned short UShort; |
---|
275 | typedef int Int; |
---|
276 | typedef unsigned int UInt; |
---|
277 | typedef double Double; |
---|
278 | typedef float Float; |
---|
279 | |
---|
280 | // ==================================================================================================================== |
---|
281 | // 64-bit integer type |
---|
282 | // ==================================================================================================================== |
---|
283 | |
---|
284 | #ifdef _MSC_VER |
---|
285 | typedef __int64 Int64; |
---|
286 | |
---|
287 | #if _MSC_VER <= 1200 // MS VC6 |
---|
288 | typedef __int64 UInt64; // MS VC6 does not support unsigned __int64 to double conversion |
---|
289 | #else |
---|
290 | typedef unsigned __int64 UInt64; |
---|
291 | #endif |
---|
292 | |
---|
293 | #else |
---|
294 | |
---|
295 | typedef long long Int64; |
---|
296 | typedef unsigned long long UInt64; |
---|
297 | |
---|
298 | #endif |
---|
299 | |
---|
300 | // ==================================================================================================================== |
---|
301 | // Type definition |
---|
302 | // ==================================================================================================================== |
---|
303 | |
---|
304 | typedef UChar Pxl; ///< 8-bit pixel type |
---|
305 | typedef Short Pel; ///< 16-bit pixel type |
---|
306 | typedef Int TCoeff; ///< transform coefficient |
---|
307 | |
---|
308 | /// parameters for adaptive loop filter |
---|
309 | class TComPicSym; |
---|
310 | |
---|
311 | // Slice / Slice segment encoding modes |
---|
312 | enum SliceConstraint |
---|
313 | { |
---|
314 | NO_SLICES = 0, ///< don't use slices / slice segments |
---|
315 | FIXED_NUMBER_OF_LCU = 1, ///< Limit maximum number of largest coding tree blocks in a slice / slice segments |
---|
316 | FIXED_NUMBER_OF_BYTES = 2, ///< Limit maximum number of bytes in a slice / slice segment |
---|
317 | FIXED_NUMBER_OF_TILES = 3, ///< slices / slice segments span an integer number of tiles |
---|
318 | }; |
---|
319 | |
---|
320 | enum SAOComponentIdx |
---|
321 | { |
---|
322 | SAO_Y =0, |
---|
323 | SAO_Cb, |
---|
324 | SAO_Cr, |
---|
325 | NUM_SAO_COMPONENTS |
---|
326 | }; |
---|
327 | |
---|
328 | enum SAOMode //mode |
---|
329 | { |
---|
330 | SAO_MODE_OFF = 0, |
---|
331 | SAO_MODE_NEW, |
---|
332 | SAO_MODE_MERGE, |
---|
333 | NUM_SAO_MODES |
---|
334 | }; |
---|
335 | |
---|
336 | enum SAOModeMergeTypes |
---|
337 | { |
---|
338 | SAO_MERGE_LEFT =0, |
---|
339 | SAO_MERGE_ABOVE, |
---|
340 | NUM_SAO_MERGE_TYPES |
---|
341 | }; |
---|
342 | |
---|
343 | |
---|
344 | enum SAOModeNewTypes |
---|
345 | { |
---|
346 | SAO_TYPE_START_EO =0, |
---|
347 | SAO_TYPE_EO_0 = SAO_TYPE_START_EO, |
---|
348 | SAO_TYPE_EO_90, |
---|
349 | SAO_TYPE_EO_135, |
---|
350 | SAO_TYPE_EO_45, |
---|
351 | |
---|
352 | SAO_TYPE_START_BO, |
---|
353 | SAO_TYPE_BO = SAO_TYPE_START_BO, |
---|
354 | |
---|
355 | NUM_SAO_NEW_TYPES |
---|
356 | }; |
---|
357 | #define NUM_SAO_EO_TYPES_LOG2 2 |
---|
358 | |
---|
359 | enum SAOEOClasses |
---|
360 | { |
---|
361 | SAO_CLASS_EO_FULL_VALLEY = 0, |
---|
362 | SAO_CLASS_EO_HALF_VALLEY = 1, |
---|
363 | SAO_CLASS_EO_PLAIN = 2, |
---|
364 | SAO_CLASS_EO_HALF_PEAK = 3, |
---|
365 | SAO_CLASS_EO_FULL_PEAK = 4, |
---|
366 | NUM_SAO_EO_CLASSES, |
---|
367 | }; |
---|
368 | |
---|
369 | |
---|
370 | #define NUM_SAO_BO_CLASSES_LOG2 5 |
---|
371 | enum SAOBOClasses |
---|
372 | { |
---|
373 | //SAO_CLASS_BO_BAND0 = 0, |
---|
374 | //SAO_CLASS_BO_BAND1, |
---|
375 | //SAO_CLASS_BO_BAND2, |
---|
376 | //... |
---|
377 | //SAO_CLASS_BO_BAND31, |
---|
378 | |
---|
379 | NUM_SAO_BO_CLASSES = (1<<NUM_SAO_BO_CLASSES_LOG2), |
---|
380 | }; |
---|
381 | #define MAX_NUM_SAO_CLASSES 32 //(NUM_SAO_EO_GROUPS > NUM_SAO_BO_GROUPS)?NUM_SAO_EO_GROUPS:NUM_SAO_BO_GROUPS |
---|
382 | |
---|
383 | struct SAOOffset |
---|
384 | { |
---|
385 | Int modeIdc; //NEW, MERGE, OFF |
---|
386 | Int typeIdc; //NEW: EO_0, EO_90, EO_135, EO_45, BO. MERGE: left, above |
---|
387 | Int typeAuxInfo; //BO: starting band index |
---|
388 | Int offset[MAX_NUM_SAO_CLASSES]; |
---|
389 | |
---|
390 | SAOOffset(); |
---|
391 | ~SAOOffset(); |
---|
392 | Void reset(); |
---|
393 | |
---|
394 | const SAOOffset& operator= (const SAOOffset& src); |
---|
395 | }; |
---|
396 | |
---|
397 | struct SAOBlkParam |
---|
398 | { |
---|
399 | |
---|
400 | SAOBlkParam(); |
---|
401 | ~SAOBlkParam(); |
---|
402 | Void reset(); |
---|
403 | const SAOBlkParam& operator= (const SAOBlkParam& src); |
---|
404 | SAOOffset& operator[](Int compIdx){ return offsetParam[compIdx];} |
---|
405 | private: |
---|
406 | SAOOffset offsetParam[NUM_SAO_COMPONENTS]; |
---|
407 | |
---|
408 | }; |
---|
409 | |
---|
410 | /// parameters for deblocking filter |
---|
411 | typedef struct _LFCUParam |
---|
412 | { |
---|
413 | Bool bInternalEdge; ///< indicates internal edge |
---|
414 | Bool bLeftEdge; ///< indicates left edge |
---|
415 | Bool bTopEdge; ///< indicates top edge |
---|
416 | } LFCUParam; |
---|
417 | |
---|
418 | // ==================================================================================================================== |
---|
419 | // Enumeration |
---|
420 | // ==================================================================================================================== |
---|
421 | |
---|
422 | /// supported slice type |
---|
423 | enum SliceType |
---|
424 | { |
---|
425 | B_SLICE, |
---|
426 | P_SLICE, |
---|
427 | I_SLICE |
---|
428 | }; |
---|
429 | |
---|
430 | /// chroma formats (according to semantics of chroma_format_idc) |
---|
431 | enum ChromaFormat |
---|
432 | { |
---|
433 | CHROMA_400 = 0, |
---|
434 | CHROMA_420 = 1, |
---|
435 | CHROMA_422 = 2, |
---|
436 | CHROMA_444 = 3 |
---|
437 | }; |
---|
438 | |
---|
439 | /// supported partition shape |
---|
440 | enum PartSize |
---|
441 | { |
---|
442 | SIZE_2Nx2N, ///< symmetric motion partition, 2Nx2N |
---|
443 | SIZE_2NxN, ///< symmetric motion partition, 2Nx N |
---|
444 | SIZE_Nx2N, ///< symmetric motion partition, Nx2N |
---|
445 | SIZE_NxN, ///< symmetric motion partition, Nx N |
---|
446 | SIZE_2NxnU, ///< asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2) |
---|
447 | SIZE_2NxnD, ///< asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2) |
---|
448 | SIZE_nLx2N, ///< asymmetric motion partition, ( N/2)x2N + (3N/2)x2N |
---|
449 | SIZE_nRx2N, ///< asymmetric motion partition, (3N/2)x2N + ( N/2)x2N |
---|
450 | SIZE_NONE = 15 |
---|
451 | }; |
---|
452 | |
---|
453 | /// supported prediction type |
---|
454 | enum PredMode |
---|
455 | { |
---|
456 | MODE_INTER, ///< inter-prediction mode |
---|
457 | MODE_INTRA, ///< intra-prediction mode |
---|
458 | MODE_NONE = 15 |
---|
459 | }; |
---|
460 | |
---|
461 | /// texture component type |
---|
462 | enum TextType |
---|
463 | { |
---|
464 | TEXT_LUMA, ///< luma |
---|
465 | TEXT_CHROMA, ///< chroma (U+V) |
---|
466 | TEXT_CHROMA_U, ///< chroma U |
---|
467 | TEXT_CHROMA_V, ///< chroma V |
---|
468 | TEXT_ALL, ///< Y+U+V |
---|
469 | TEXT_NONE = 15 |
---|
470 | }; |
---|
471 | |
---|
472 | /// reference list index |
---|
473 | enum RefPicList |
---|
474 | { |
---|
475 | REF_PIC_LIST_0 = 0, ///< reference list 0 |
---|
476 | REF_PIC_LIST_1 = 1, ///< reference list 1 |
---|
477 | REF_PIC_LIST_X = 100 ///< special mark |
---|
478 | }; |
---|
479 | |
---|
480 | /// distortion function index |
---|
481 | enum DFunc |
---|
482 | { |
---|
483 | DF_DEFAULT = 0, |
---|
484 | DF_SSE = 1, ///< general size SSE |
---|
485 | DF_SSE4 = 2, ///< 4xM SSE |
---|
486 | DF_SSE8 = 3, ///< 8xM SSE |
---|
487 | DF_SSE16 = 4, ///< 16xM SSE |
---|
488 | DF_SSE32 = 5, ///< 32xM SSE |
---|
489 | DF_SSE64 = 6, ///< 64xM SSE |
---|
490 | DF_SSE16N = 7, ///< 16NxM SSE |
---|
491 | |
---|
492 | DF_SAD = 8, ///< general size SAD |
---|
493 | DF_SAD4 = 9, ///< 4xM SAD |
---|
494 | DF_SAD8 = 10, ///< 8xM SAD |
---|
495 | DF_SAD16 = 11, ///< 16xM SAD |
---|
496 | DF_SAD32 = 12, ///< 32xM SAD |
---|
497 | DF_SAD64 = 13, ///< 64xM SAD |
---|
498 | DF_SAD16N = 14, ///< 16NxM SAD |
---|
499 | |
---|
500 | DF_SADS = 15, ///< general size SAD with step |
---|
501 | DF_SADS4 = 16, ///< 4xM SAD with step |
---|
502 | DF_SADS8 = 17, ///< 8xM SAD with step |
---|
503 | DF_SADS16 = 18, ///< 16xM SAD with step |
---|
504 | DF_SADS32 = 19, ///< 32xM SAD with step |
---|
505 | DF_SADS64 = 20, ///< 64xM SAD with step |
---|
506 | DF_SADS16N = 21, ///< 16NxM SAD with step |
---|
507 | |
---|
508 | DF_HADS = 22, ///< general size Hadamard with step |
---|
509 | DF_HADS4 = 23, ///< 4xM HAD with step |
---|
510 | DF_HADS8 = 24, ///< 8xM HAD with step |
---|
511 | DF_HADS16 = 25, ///< 16xM HAD with step |
---|
512 | DF_HADS32 = 26, ///< 32xM HAD with step |
---|
513 | DF_HADS64 = 27, ///< 64xM HAD with step |
---|
514 | DF_HADS16N = 28, ///< 16NxM HAD with step |
---|
515 | |
---|
516 | #if AMP_SAD |
---|
517 | DF_SAD12 = 43, |
---|
518 | DF_SAD24 = 44, |
---|
519 | DF_SAD48 = 45, |
---|
520 | |
---|
521 | DF_SADS12 = 46, |
---|
522 | DF_SADS24 = 47, |
---|
523 | DF_SADS48 = 48, |
---|
524 | |
---|
525 | DF_SSE_FRAME = 50 ///< Frame-based SSE |
---|
526 | #else |
---|
527 | DF_SSE_FRAME = 33 ///< Frame-based SSE |
---|
528 | #endif |
---|
529 | }; |
---|
530 | |
---|
531 | /// index for SBAC based RD optimization |
---|
532 | enum CI_IDX |
---|
533 | { |
---|
534 | CI_CURR_BEST = 0, ///< best mode index |
---|
535 | CI_NEXT_BEST, ///< next best index |
---|
536 | CI_TEMP_BEST, ///< temporal index |
---|
537 | CI_CHROMA_INTRA, ///< chroma intra index |
---|
538 | CI_QT_TRAFO_TEST, |
---|
539 | CI_QT_TRAFO_ROOT, |
---|
540 | CI_NUM, ///< total number |
---|
541 | }; |
---|
542 | |
---|
543 | /// motion vector predictor direction used in AMVP |
---|
544 | enum MVP_DIR |
---|
545 | { |
---|
546 | MD_LEFT = 0, ///< MVP of left block |
---|
547 | MD_ABOVE, ///< MVP of above block |
---|
548 | MD_ABOVE_RIGHT, ///< MVP of above right block |
---|
549 | MD_BELOW_LEFT, ///< MVP of below left block |
---|
550 | MD_ABOVE_LEFT ///< MVP of above left block |
---|
551 | }; |
---|
552 | |
---|
553 | /// merging candidates |
---|
554 | |
---|
555 | /// coefficient scanning type used in ACS |
---|
556 | enum COEFF_SCAN_TYPE |
---|
557 | { |
---|
558 | SCAN_DIAG = 0, ///< up-right diagonal scan |
---|
559 | SCAN_HOR, ///< horizontal first scan |
---|
560 | SCAN_VER ///< vertical first scan |
---|
561 | }; |
---|
562 | |
---|
563 | namespace Profile |
---|
564 | { |
---|
565 | enum Name |
---|
566 | { |
---|
567 | NONE = 0, |
---|
568 | MAIN = 1, |
---|
569 | MAIN10 = 2, |
---|
570 | MAINSTILLPICTURE = 3, |
---|
571 | #if H_MV |
---|
572 | MULTIVIEWMAIN = 6, |
---|
573 | #endif |
---|
574 | }; |
---|
575 | } |
---|
576 | |
---|
577 | namespace Level |
---|
578 | { |
---|
579 | enum Tier |
---|
580 | { |
---|
581 | MAIN = 0, |
---|
582 | HIGH = 1, |
---|
583 | }; |
---|
584 | |
---|
585 | enum Name |
---|
586 | { |
---|
587 | NONE = 0, |
---|
588 | LEVEL1 = 30, |
---|
589 | LEVEL2 = 60, |
---|
590 | LEVEL2_1 = 63, |
---|
591 | LEVEL3 = 90, |
---|
592 | LEVEL3_1 = 93, |
---|
593 | LEVEL4 = 120, |
---|
594 | LEVEL4_1 = 123, |
---|
595 | LEVEL5 = 150, |
---|
596 | LEVEL5_1 = 153, |
---|
597 | LEVEL5_2 = 156, |
---|
598 | LEVEL6 = 180, |
---|
599 | LEVEL6_1 = 183, |
---|
600 | LEVEL6_2 = 186, |
---|
601 | }; |
---|
602 | } |
---|
603 | //! \} |
---|
604 | |
---|
605 | #if H_MV |
---|
606 | |
---|
607 | /// scalability types |
---|
608 | enum ScalabilityType |
---|
609 | { |
---|
610 | VIEW_ORDER_INDEX = 1, |
---|
611 | DEPENDENCY_ID = 2, |
---|
612 | AUX_ID = 3, |
---|
613 | }; |
---|
614 | #endif |
---|
615 | #endif |
---|