1 | /* ==================================================================================================================== |
---|
2 | |
---|
3 | The copyright in this software is being made available under the License included below. |
---|
4 | This software may be subject to other third party and contributor rights, including patent rights, and no such |
---|
5 | rights are granted under this license. |
---|
6 | |
---|
7 | Copyright (c) 2010, SAMSUNG ELECTRONICS CO., LTD. and BRITISH BROADCASTING CORPORATION |
---|
8 | All rights reserved. |
---|
9 | |
---|
10 | Redistribution and use in source and binary forms, with or without modification, are permitted only for |
---|
11 | the purpose of developing standards within the Joint Collaborative Team on Video Coding and for testing and |
---|
12 | promoting such standards. The following conditions are required to be met: |
---|
13 | |
---|
14 | * Redistributions of source code must retain the above copyright notice, this list of conditions and |
---|
15 | the following disclaimer. |
---|
16 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and |
---|
17 | the following disclaimer in the documentation and/or other materials provided with the distribution. |
---|
18 | * Neither the name of SAMSUNG ELECTRONICS CO., LTD. nor the name of the BRITISH BROADCASTING CORPORATION |
---|
19 | may be used to endorse or promote products derived from this software without specific prior written permission. |
---|
20 | |
---|
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
---|
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
23 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
---|
24 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
---|
26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
28 | |
---|
29 | * ==================================================================================================================== |
---|
30 | */ |
---|
31 | |
---|
32 | /** \file TypeDef.h |
---|
33 | \brief Define basic types, new types and enumerations |
---|
34 | */ |
---|
35 | |
---|
36 | #ifndef _TYPEDEF__ |
---|
37 | #define _TYPEDEF__ |
---|
38 | |
---|
39 | //////////////////////////// |
---|
40 | // HHI defines section start |
---|
41 | //////////////////////////// |
---|
42 | #define HHI_NAL_UNIT_SYNTAX 1 ///< enable/disable NalUnit syntax |
---|
43 | #define HHI_ALLOW_CIP_SWITCH 1 ///< BB: allow to switch off CIP, via CIP : 0 in cfg file or -0 CIP in command line |
---|
44 | #define HHI_DISABLE_INTER_NxN_SPLIT 0 ///< TN: disable redundant use of pu-mode NxN for CTBs larger 8x8 (inter only) |
---|
45 | #define HHI_RMP_SWITCH 0 |
---|
46 | |
---|
47 | // HHI tools |
---|
48 | #define HHI_RQT 1 ///< MWHK: residual quadtree |
---|
49 | #define HHI_RQT_CHROMA_CBF_MOD 1 ///< HK: alternative syntax for coded block flag coding for chroma |
---|
50 | #define HHI_RQT_INTRA 1 ///< HS: residual quadtree for intra blocks |
---|
51 | #define HHI_ALF 0 ///< MS: separable adaptive loop filter |
---|
52 | #define HHI_AIS 1 ///< BB: adaptive intra smoothing |
---|
53 | #define HHI_INTERP_FILTER 1 ///< HL: interpolation filter |
---|
54 | #define HHI_TRANSFORM_CODING 1 ///< TN: modified transform coefficient coding with RDOQ |
---|
55 | #define HHI_IMVP 1 ///< SOPH: Interleaved Motion Vector Predictor |
---|
56 | #define HHI_MRG 1 ///< SOPH: inter partition merging |
---|
57 | #define HHI_MRG_PU 0 ///< SOPH: inter partition merging on pu basis |
---|
58 | #define HHI_AMVP_OFF 0 ///< SOPH: Advanced Motion Vector Predictor deactivated [not in TMuC] |
---|
59 | #define HHI_DEBLOCKING_FILTER 0 ///< MW: deblocking filter supporting residual quadtrees |
---|
60 | #define HHI_RQT_ROOT 1 ///< PHHK: signaling of residual quadtree root flag |
---|
61 | #define HHI_RQT_FORCE_SPLIT_NxN 0 ///< MSHK: force split flags of residual quadtree for NxN PUs such that transform blocks are guaranteed to not span NxN PUs |
---|
62 | #define HHI_RQT_FORCE_SPLIT_RECT 0 ///< MSHK: force split flags of residual quadtree for rectangular PUs such that transform blocks are guaranteed to not span rectangular PUs |
---|
63 | #define HHI_RQT_FORCE_SPLIT_ASYM 0 ///< MSHK: force split flags of residual quadtree for asymmetric such that transform blocks are guaranteed to not span PUs asymmetric PUs |
---|
64 | #define HHI_RQT_INTRA_SPEEDUP 1 // tests one best mode with full rqt |
---|
65 | #define HHI_RQT_INTRA_SPEEDUP_MOD 0 // tests two best modes with full rqt |
---|
66 | #define HHI_C319_SPS 1 ///< BB: SPS from JCTVC-C319 |
---|
67 | |
---|
68 | #if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP |
---|
69 | #error |
---|
70 | #endif |
---|
71 | |
---|
72 | #if ( HHI_RQT_INTRA && !HHI_RQT ) |
---|
73 | #error "HHI_RQT_INTRA can only be equal to 1 if HHI_RQT is equal to 1" |
---|
74 | #endif |
---|
75 | |
---|
76 | #if ( HHI_RQT_ROOT && !HHI_RQT ) |
---|
77 | #error "HHI_RQT_ROOT can only be equal to 1 if HHI_RQT is equal to 1" |
---|
78 | #endif |
---|
79 | |
---|
80 | #if ( HHI_MRG_PU && !HHI_MRG ) |
---|
81 | #error "HHI_MRG_PU can only be equal to 1 if HHI_MRG is equal to 1" |
---|
82 | #endif |
---|
83 | |
---|
84 | #if ( HHI_RQT_FORCE_SPLIT_NxN || HHI_RQT_FORCE_SPLIT_RECT || HHI_RQT_FORCE_SPLIT_ASYM ) |
---|
85 | #define HHI_RQT_FORCE_SPLIT_ACC2_PU 1 |
---|
86 | #else |
---|
87 | #define HHI_RQT_FORCE_SPLIT_ACC2_PU 0 |
---|
88 | #endif |
---|
89 | |
---|
90 | #if ( HHI_RQT_FORCE_SPLIT_ACC2_PU && !HHI_RQT ) |
---|
91 | #error "HHI_RQT_FORCE_SPLIT_ACC2_PU can only be equal to 1 if HHI_RQT is equal to 1" |
---|
92 | #endif |
---|
93 | |
---|
94 | #if HHI_AIS |
---|
95 | // AIS |
---|
96 | #define DEFAULT_IS 0 ///< BB: set intra filtering always 0:off 1:on if AIS is disabled |
---|
97 | #define AIS_TEST_BEST 0 ///< BB: 0: compare every intra mode with filter on and off (encoder only) |
---|
98 | ///< 1: compare best intra mode with filter on and off (encoder only) |
---|
99 | #endif |
---|
100 | |
---|
101 | #define HHI_INTERP_FILTER_KERNEL_FIX 1 ///< BB: interpolation filter fixed spline kernel |
---|
102 | |
---|
103 | ////////////////////////// |
---|
104 | // HHI defines section end |
---|
105 | ////////////////////////// |
---|
106 | |
---|
107 | |
---|
108 | //////////////////////////// |
---|
109 | // TEN defines section start |
---|
110 | //////////////////////////// |
---|
111 | #define UNIFIED_DIRECTIONAL_INTRA 1 // Unified directional intra prediction as described in JCTVC-B100. ANG_INTRA needs to |
---|
112 | // be set to 2 when this is enabled. Unified intra renders number of old intra prediction |
---|
113 | // functions obsolete, but these functions have not disabled or removed from the code yet. |
---|
114 | |
---|
115 | #if UNIFIED_DIRECTIONAL_INTRA |
---|
116 | #define ANG_INTRA 2 // Enable angular Intra coding (0: All ADI, 1: Ang for 8x8 PUs, 2: Ang for all PU sizes) |
---|
117 | #else |
---|
118 | #define ANG_INTRA 1 // Enable angular Intra coding (0: All ADI, 1: Ang for 8x8 PUs, 2: Ang for all PU sizes) |
---|
119 | #endif |
---|
120 | |
---|
121 | #define PLANAR_INTRA 0 // Enable planar Intra coding |
---|
122 | #define TENTM_DEBLOCKING_FILTER 1 // Enable TENTM deblocking |
---|
123 | #if HHI_INTERP_FILTER |
---|
124 | #define TEN_DIRECTIONAL_INTERP 1 ///< AF: interpolation filter |
---|
125 | #define TEN_DIRECTIONAL_INTERP_CHROMA 0 ///< DIF interpolation filter for chroma |
---|
126 | #endif |
---|
127 | |
---|
128 | #if (HHI_DEBLOCKING_FILTER && TENTM_DEBLOCKING_FILTER) |
---|
129 | #error "Only one of TENTM_DEBLOCKING_FILTER and HHI_DEBLOCKING_FILTER can be defined" |
---|
130 | #endif |
---|
131 | |
---|
132 | #define LCEC_PHASE1 1 // LCEC - integration phase 1 |
---|
133 | #define LCEC_PHASE2 1 // LCEC - integration phase 2 |
---|
134 | #define LCEC_STAT 0 // LCEC - support for LCEC bitusage statistics |
---|
135 | ////////////////////////// |
---|
136 | // TEN defines section end |
---|
137 | ////////////////////////// |
---|
138 | |
---|
139 | #define BUGFIX_119 0 |
---|
140 | |
---|
141 | ///////////////////////////////// |
---|
142 | // QUALCOMM defines section start |
---|
143 | ///////////////////////////////// |
---|
144 | |
---|
145 | #define LCEC_PHASE1_ADAPT_ENABLE 1 // Enable CU level VLC adaptation |
---|
146 | #define LCEC_CBP_YUV_ROOT 1 // enable VLC phase-2 CBP root coding under RQT |
---|
147 | #define QC_BLK_CBP 1 // block level CBP coding, to be enabled only when LCEC_CBP_YUV_ROOT is enabled |
---|
148 | #if LCEC_CBP_YUV_ROOT==0 && QC_BLK_CBP |
---|
149 | #error |
---|
150 | #endif |
---|
151 | |
---|
152 | //#define QC_AMVRES |
---|
153 | #ifdef QC_AMVRES |
---|
154 | #define QC_AMVRES_LOW_COMPLEXTY |
---|
155 | #endif |
---|
156 | #define QC_CONFIG |
---|
157 | |
---|
158 | #if HHI_INTERP_FILTER |
---|
159 | //#define QC_SIFO |
---|
160 | #define QC_SIFO_PRED |
---|
161 | #if (defined QC_SIFO && TEN_DIRECTIONAL_INTERP==1) |
---|
162 | #define USE_DIAGONAL_FILT 1 |
---|
163 | #endif |
---|
164 | #endif |
---|
165 | |
---|
166 | #define QC_ALF 1 |
---|
167 | #if QC_ALF |
---|
168 | #define ENABLE_FORCECOEFF0 0 |
---|
169 | #define ALF_MEM_PATCH 1 |
---|
170 | #endif |
---|
171 | #if (QC_ALF && HHI_ALF) |
---|
172 | #error "Only one of QC_ALF and HHI_ALF can be defined" |
---|
173 | #endif |
---|
174 | |
---|
175 | #define DISABLE_ROT_LUMA_4x4_8x8 0 |
---|
176 | #define QC_MDDT 0 |
---|
177 | #if QC_MDDT |
---|
178 | #define ROT_CHECK 0 |
---|
179 | #define absm(A) ((A)<(0) ? (-(A)):(A)) |
---|
180 | #define REG_DCT 65535 |
---|
181 | #define COMBINED_MAP |
---|
182 | void InitScanOrderForSlice(); |
---|
183 | #define NUM_SCANS_16x16 9 |
---|
184 | #define NUM_SCANS_32x32 9 |
---|
185 | #define NUM_SCANS_64x64 9 |
---|
186 | void updateScanOrder(int first); |
---|
187 | void normalizeScanStats(); |
---|
188 | #endif |
---|
189 | |
---|
190 | /* Rounding control */ |
---|
191 | #define ROUNDING_CONTROL_BIPRED ///< From JCTVC-B074 |
---|
192 | #define ROUNDING_CONTROL_BIPRED_SPEEDUP_BITEXACT |
---|
193 | |
---|
194 | #define TRANS_PRECISION_EXT ///< From JCTVC-B074 |
---|
195 | |
---|
196 | |
---|
197 | #define BUGFIX48 1 |
---|
198 | #define BUGFIX50 1 |
---|
199 | #define BUGFIX50TMP 0 // for compatibility with previous versions without the crash |
---|
200 | #define SCAN_LUT_FIX 1 |
---|
201 | #define ROUNDING_CONTROL_BIPRED_FIX |
---|
202 | |
---|
203 | #ifdef QC_SIFO |
---|
204 | #define SIFO_DIF_COMPATIBILITY 1 // SIFO Extensions |
---|
205 | #define FIX_TICKET67 1 // solves memory leak problem in SIFO |
---|
206 | #endif |
---|
207 | #define FIX_TICKET92 0 // faster SIFO encoder (encoder only change) |
---|
208 | |
---|
209 | /////////////////////////////// |
---|
210 | // QUALCOMM defines section end |
---|
211 | /////////////////////////////// |
---|
212 | |
---|
213 | |
---|
214 | /////////////////////////////////// |
---|
215 | // Panasonic defines section start |
---|
216 | /////////////////////////////////// |
---|
217 | |
---|
218 | //#define EDGE_BASED_PREDICTION // Enable edge based prediction for intra |
---|
219 | #define BUGFIX51 1 |
---|
220 | |
---|
221 | /////////////////////////////////// |
---|
222 | // Panasonic defines section start |
---|
223 | /////////////////////////////////// |
---|
224 | |
---|
225 | /////////////////////////////// |
---|
226 | // SAMSUNG defines section start |
---|
227 | /////////////////////////////// |
---|
228 | #define SAMSUNG_REMOVE_AMP_FEN_PENALTY 1 ///< removal of FEN penality of AMP |
---|
229 | |
---|
230 | #if HHI_RQT |
---|
231 | #define HHI_RQT_DEPTH 1 ///< controlling max quadtree depth |
---|
232 | #if HHI_RQT_DEPTH |
---|
233 | #define HHI_C319 1 ///< BB: two separate depths for inter and intra from JCTVC-C319 |
---|
234 | #if HHI_C319 |
---|
235 | #define HHI_C319_INTER_FIX 1 ///< BB: forced/inferred splits are counted as depth (exeption: inferred from intra_split) |
---|
236 | #endif // HHI_C319 |
---|
237 | #endif // HHI_RQT_DEPTH |
---|
238 | #define HHI_RQT_DISABLE_SUB 0 ///< disabling subtree whose node size is smaller than partition size |
---|
239 | #if HHI_RQT_DEPTH && HHI_RQT_DISABLE_SUB |
---|
240 | #error "Only one of HHI_RQT_DEPTH and HHI_RQT_DISABLE_SUB can be defined" |
---|
241 | #endif |
---|
242 | #endif |
---|
243 | |
---|
244 | #if HHI_MRG |
---|
245 | #define SAMSUNG_MRG_SKIP_DIRECT 1 ///< enabling of skip and direct when mrg is on |
---|
246 | #endif |
---|
247 | |
---|
248 | #define SAMSUNG_CHROMA_IF_EXT 0 ///< DCT-based Interpolation filter for chroma signal |
---|
249 | |
---|
250 | #if QC_MDDT |
---|
251 | #define QC_MDDT_ROT_UNIFIED 0 ///< better unification of MDDT and ROT |
---|
252 | #endif |
---|
253 | |
---|
254 | #if HHI_TRANSFORM_CODING |
---|
255 | #define HHI_DISABLE_SCAN 0 ///< disable adaptive scan |
---|
256 | #endif |
---|
257 | |
---|
258 | #define FAST_UDI_MAX_RDMODE_NUM 10 ///< maximum number of RD comparison in fast-UDI estimation loop |
---|
259 | |
---|
260 | #define SAMSUNG_FAST_UDI 1 ///< improved mode decision for UDI (JCTVC-C207) |
---|
261 | #if SAMSUNG_FAST_UDI |
---|
262 | #define SAMSUNG_FAST_UDI_MODESET 0 ///< 0: {9,9,4,4,5} (default) and 1: {9,9,9,9,5} for {4x4,8x8,16x16,32x32,64x64} |
---|
263 | #endif |
---|
264 | |
---|
265 | #define BUGFIX_106 1 // bug fix on mapping intra directions from 34 to 9 |
---|
266 | |
---|
267 | /////////////////////////////// |
---|
268 | // SAMSUNG defines section end |
---|
269 | /////////////////////////////// |
---|
270 | |
---|
271 | /////////////////////////////// |
---|
272 | // DOCOMO defines section start |
---|
273 | /////////////////////////////// |
---|
274 | //#define DCM_PBIC //Partition-Based Illumination Compensation |
---|
275 | #define DCM_RDCOST_TEMP_FIX //Enables temporary bug fixes to RD cost computation (does not affect TMuC0.7 performance under current encoder settings, but is needed for proper RD cost computation when DCM_PBIC is enabled) |
---|
276 | |
---|
277 | /////////////////////////////// |
---|
278 | // DOCOMO defines section end |
---|
279 | /////////////////////////////// |
---|
280 | |
---|
281 | //////////////////////////////// |
---|
282 | // TOSHIBA defines section start |
---|
283 | //////////////////////////////// |
---|
284 | #define TSB_ALF_HEADER 1 // Send ALF ON/OFF flag in slice header |
---|
285 | #if (TSB_ALF_HEADER && HHI_ALF) |
---|
286 | #error "Only one of TSB_ALF_HEADER and HHI_ALF can be defined" |
---|
287 | #endif |
---|
288 | //////////////////////////////// |
---|
289 | // TOSHIBA defines section end |
---|
290 | //////////////////////////////// |
---|
291 | |
---|
292 | //////////////////////////////// |
---|
293 | // TI defines section start |
---|
294 | //////////////////////////////// |
---|
295 | #define TI_SIGN_BIN0_PCP 1 // Enable sign and bin0 plane coding |
---|
296 | //////////////////////////////// |
---|
297 | // TI defines section end |
---|
298 | //////////////////////////////// |
---|
299 | |
---|
300 | #define BUGFIX85TMP 1 // Ignore cost of CBF (affects RQT off setting) |
---|
301 | #define BUGFIX102 1 // Do not code terminating bit when using LCEC |
---|
302 | |
---|
303 | |
---|
304 | //////////////////////////////// |
---|
305 | // MICROSOFT&USTC defines section start |
---|
306 | //////////////////////////////// |
---|
307 | #define MS_NO_BACK_PRED_IN_B0 1 // disable backward prediction when list1 == list0, and disable list1 search, JCTVC-C278 |
---|
308 | #define MS_LAST_CBF 1 // last cbf handling, JCTVC-C277 |
---|
309 | //////////////////////////////// |
---|
310 | // MICROSOFT&USTC defines section end |
---|
311 | //////////////////////////////// |
---|
312 | |
---|
313 | // ==================================================================================================================== |
---|
314 | // Basic type redefinition |
---|
315 | // ==================================================================================================================== |
---|
316 | |
---|
317 | typedef void Void; |
---|
318 | typedef bool Bool; |
---|
319 | |
---|
320 | typedef char Char; |
---|
321 | typedef unsigned char UChar; |
---|
322 | typedef short Short; |
---|
323 | typedef unsigned short UShort; |
---|
324 | typedef int Int; |
---|
325 | typedef unsigned int UInt; |
---|
326 | typedef long Long; |
---|
327 | typedef unsigned long ULong; |
---|
328 | typedef double Double; |
---|
329 | |
---|
330 | // ==================================================================================================================== |
---|
331 | // 64-bit integer type |
---|
332 | // ==================================================================================================================== |
---|
333 | |
---|
334 | #ifdef _MSC_VER |
---|
335 | typedef __int64 Int64; |
---|
336 | |
---|
337 | #if _MSC_VER <= 1200 // MS VC6 |
---|
338 | typedef __int64 UInt64; // MS VC6 does not support unsigned __int64 to double conversion |
---|
339 | #else |
---|
340 | typedef unsigned __int64 UInt64; |
---|
341 | #endif |
---|
342 | |
---|
343 | #else |
---|
344 | |
---|
345 | typedef long long Int64; |
---|
346 | typedef unsigned long long UInt64; |
---|
347 | |
---|
348 | #endif |
---|
349 | |
---|
350 | // ==================================================================================================================== |
---|
351 | // Type definition |
---|
352 | // ==================================================================================================================== |
---|
353 | |
---|
354 | typedef UChar Pxl; ///< 8-bit pixel type |
---|
355 | typedef Short Pel; ///< 16-bit pixel type |
---|
356 | typedef Int TCoeff; ///< transform coefficient |
---|
357 | |
---|
358 | /// parameters for adaptive loop filter |
---|
359 | typedef struct _AlfFilter |
---|
360 | { |
---|
361 | Int iFilterLength ; // != number of Coeffs !!! number of tabs |
---|
362 | Int iFilterSymmetry ; |
---|
363 | Int iNumOfCoeffs ; |
---|
364 | Int iOverlap ; |
---|
365 | Bool bIsHorizontal ; |
---|
366 | Bool bIsVertical ; |
---|
367 | Int* aiQuantFilterCoeffs ; |
---|
368 | Int* aiTapCoeffMapping ; |
---|
369 | Int* aiCoeffWeights ; |
---|
370 | Bool bIsValid ; |
---|
371 | Int iHorizontalOverlap ; |
---|
372 | Int iVerticalOverlap ; |
---|
373 | } AlfFilter; |
---|
374 | |
---|
375 | |
---|
376 | /// parameters for adaptive loop filter |
---|
377 | class TComPicSym; |
---|
378 | |
---|
379 | struct _AlfParam |
---|
380 | { |
---|
381 | Int alf_flag; ///< indicates use of ALF |
---|
382 | Int cu_control_flag; ///< coding unit based control flag |
---|
383 | Int chroma_idc; ///< indicates use of ALF for chroma |
---|
384 | Int tap; ///< number of filter taps |
---|
385 | Int num_coeff; ///< number of filter coefficients |
---|
386 | Int *coeff; ///< filter coefficient array |
---|
387 | Int tap_chroma; ///< number of filter taps (chroma) |
---|
388 | Int num_coeff_chroma; ///< number of filter coefficients (chroma) |
---|
389 | Int *coeff_chroma; ///< filter coefficient array (chroma) |
---|
390 | #if QC_ALF |
---|
391 | //CodeAux related |
---|
392 | Int realfiltNo; |
---|
393 | Int filtNo; |
---|
394 | Int filterPattern[16]; |
---|
395 | Int startSecondFilter; |
---|
396 | Int noFilters; |
---|
397 | Int varIndTab[16]; |
---|
398 | |
---|
399 | //Coeff send related |
---|
400 | Int filters_per_group_diff; //this can be updated using codedVarBins |
---|
401 | Int filters_per_group; |
---|
402 | Int codedVarBins[16]; |
---|
403 | Int forceCoeff0; |
---|
404 | Int predMethod; |
---|
405 | Int **coeffmulti; |
---|
406 | Int minKStart; |
---|
407 | Int maxScanVal; |
---|
408 | Int kMinTab[42]; |
---|
409 | #endif |
---|
410 | #if TSB_ALF_HEADER |
---|
411 | UInt num_alf_cu_flag; |
---|
412 | UInt num_cus_in_frame; |
---|
413 | UInt alf_max_depth; |
---|
414 | UInt *alf_cu_flag; |
---|
415 | #endif |
---|
416 | }; |
---|
417 | |
---|
418 | struct _AlfParamHHI |
---|
419 | { |
---|
420 | Int alf_flag; ///< indicates use of ALF |
---|
421 | Int cu_control_flag; ///< coding unit based control flag |
---|
422 | Int chroma_idc; |
---|
423 | |
---|
424 | AlfFilter* acHorizontalAlfFilter ; |
---|
425 | AlfFilter* acVerticalAlfFilter ; |
---|
426 | Bool bSeparateQt; |
---|
427 | TComPicSym* pcQuadTree; |
---|
428 | Int aiPlaneFilterMapping[3] ; |
---|
429 | }; |
---|
430 | |
---|
431 | /// parameters for deblocking filter |
---|
432 | typedef struct _LFCUParam |
---|
433 | { |
---|
434 | Bool bInternalEdge; ///< indicates internal edge |
---|
435 | Bool bLeftEdge; ///< indicates left edge |
---|
436 | Bool bTopEdge; ///< indicates top edge |
---|
437 | #if !HHI_DEBLOCKING_FILTER && !TENTM_DEBLOCKING_FILTER |
---|
438 | Bool bLumaEdgeFilter[2][4]; ///< array of luma edge decisions |
---|
439 | Int iBsEdgeSum[2][4]; ///< array of Bs edge sum values |
---|
440 | #endif |
---|
441 | } LFCUParam; |
---|
442 | |
---|
443 | /// parapeters for TENTM coefficient VLC |
---|
444 | typedef struct _LastCoeffStruct |
---|
445 | { |
---|
446 | int level; |
---|
447 | int last_pos; |
---|
448 | } LastCoeffStruct; |
---|
449 | |
---|
450 | // ==================================================================================================================== |
---|
451 | // Enumeration |
---|
452 | // ==================================================================================================================== |
---|
453 | |
---|
454 | /// supported slice type |
---|
455 | enum SliceType |
---|
456 | { |
---|
457 | I_SLICE, |
---|
458 | P_SLICE, |
---|
459 | B_SLICE |
---|
460 | }; |
---|
461 | |
---|
462 | /// supported partition shape |
---|
463 | enum PartSize |
---|
464 | { |
---|
465 | SIZE_2Nx2N, ///< symmetric motion partition, 2Nx2N |
---|
466 | SIZE_2NxN, ///< symmetric motion partition, 2Nx N |
---|
467 | SIZE_Nx2N, ///< symmetric motion partition, Nx2N |
---|
468 | SIZE_NxN, ///< symmetric motion partition, Nx N |
---|
469 | |
---|
470 | SIZE_2NxnU, ///< asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2) |
---|
471 | SIZE_2NxnD, ///< asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2) |
---|
472 | SIZE_nLx2N, ///< asymmetric motion partition, ( N/2)x2N + (3N/2)x2N |
---|
473 | SIZE_nRx2N, ///< asymmetric motion partition, (3N/2)x2N + ( N/2)x2N |
---|
474 | |
---|
475 | SIZE_NONE = 15 |
---|
476 | }; |
---|
477 | |
---|
478 | /// supported prediction type |
---|
479 | enum PredMode |
---|
480 | { |
---|
481 | MODE_SKIP, ///< SKIP mode |
---|
482 | MODE_INTER, ///< inter-prediction mode |
---|
483 | MODE_INTRA, ///< intra-prediction mode |
---|
484 | MODE_NONE = 15 |
---|
485 | }; |
---|
486 | |
---|
487 | #if PLANAR_INTRA |
---|
488 | enum PlanarType |
---|
489 | { |
---|
490 | PLANAR_FLAG = 0, |
---|
491 | PLANAR_DELTAY = 1, |
---|
492 | PLANAR_DELTAU = 2, |
---|
493 | PLANAR_DELTAV = 3, |
---|
494 | }; |
---|
495 | #endif |
---|
496 | |
---|
497 | /// texture component type |
---|
498 | enum TextType |
---|
499 | { |
---|
500 | TEXT_LUMA, ///< luma |
---|
501 | TEXT_CHROMA, ///< chroma (U+V) |
---|
502 | TEXT_CHROMA_U, ///< chroma U |
---|
503 | TEXT_CHROMA_V, ///< chroma V |
---|
504 | #if LCEC_PHASE2 |
---|
505 | TEXT_ALL, ///< Y+U+V |
---|
506 | #endif |
---|
507 | TEXT_NONE = 15 |
---|
508 | }; |
---|
509 | |
---|
510 | /// reference list index |
---|
511 | enum RefPicList |
---|
512 | { |
---|
513 | REF_PIC_LIST_0 = 0, ///< reference list 0 |
---|
514 | REF_PIC_LIST_1 = 1, ///< reference list 1 |
---|
515 | REF_PIC_LIST_X = 100 ///< special mark |
---|
516 | }; |
---|
517 | |
---|
518 | /// distortion function index |
---|
519 | enum DFunc |
---|
520 | { |
---|
521 | DF_DEFAULT = 0, |
---|
522 | DF_SSE = 1, ///< general size SSE |
---|
523 | DF_SSE4 = 2, ///< 4xM SSE |
---|
524 | DF_SSE8 = 3, ///< 8xM SSE |
---|
525 | DF_SSE16 = 4, ///< 16xM SSE |
---|
526 | DF_SSE32 = 5, ///< 32xM SSE |
---|
527 | DF_SSE64 = 6, ///< 64xM SSE |
---|
528 | DF_SSE16N = 7, ///< 16NxM SSE |
---|
529 | |
---|
530 | DF_SAD = 8, ///< general size SAD |
---|
531 | DF_SAD4 = 9, ///< 4xM SAD |
---|
532 | DF_SAD8 = 10, ///< 8xM SAD |
---|
533 | DF_SAD16 = 11, ///< 16xM SAD |
---|
534 | DF_SAD32 = 12, ///< 32xM SAD |
---|
535 | DF_SAD64 = 13, ///< 64xM SAD |
---|
536 | DF_SAD16N = 14, ///< 16NxM SAD |
---|
537 | |
---|
538 | DF_SADS = 15, ///< general size SAD with step |
---|
539 | DF_SADS4 = 16, ///< 4xM SAD with step |
---|
540 | DF_SADS8 = 17, ///< 8xM SAD with step |
---|
541 | DF_SADS16 = 18, ///< 16xM SAD with step |
---|
542 | DF_SADS32 = 19, ///< 32xM SAD with step |
---|
543 | DF_SADS64 = 20, ///< 64xM SAD with step |
---|
544 | DF_SADS16N = 21, ///< 16NxM SAD with step |
---|
545 | |
---|
546 | DF_HADS = 22, ///< general size Hadamard with step |
---|
547 | DF_HADS4 = 23, ///< 4xM HAD with step |
---|
548 | DF_HADS8 = 24, ///< 8xM HAD with step |
---|
549 | DF_HADS16 = 25, ///< 16xM HAD with step |
---|
550 | DF_HADS32 = 26, ///< 32xM HAD with step |
---|
551 | DF_HADS64 = 27, ///< 64xM HAD with step |
---|
552 | DF_HADS16N = 28, ///< 16NxM HAD with step |
---|
553 | |
---|
554 | DF_SSE_FRAME = 33 ///< Frame-based SSE |
---|
555 | }; |
---|
556 | |
---|
557 | /// index for reference type |
---|
558 | enum ERBIndex |
---|
559 | { |
---|
560 | ERB_NONE = 0, ///< normal case |
---|
561 | ERB_LTR = 1 ///< long-term reference |
---|
562 | }; |
---|
563 | |
---|
564 | /// index for SBAC based RD optimization |
---|
565 | enum CI_IDX |
---|
566 | { |
---|
567 | CI_CURR_BEST = 0, ///< best mode index |
---|
568 | CI_NEXT_BEST, ///< next best index |
---|
569 | CI_TEMP_BEST, ///< temporal index |
---|
570 | CI_CHROMA_INTRA, ///< chroma intra index |
---|
571 | #if HHI_RQT |
---|
572 | CI_QT_TRAFO_TEST, |
---|
573 | CI_QT_TRAFO_ROOT, |
---|
574 | #endif |
---|
575 | CI_NUM, ///< total number |
---|
576 | }; |
---|
577 | |
---|
578 | /// motion vector predictor direction used in AMVP |
---|
579 | enum MVP_DIR |
---|
580 | { |
---|
581 | MD_LEFT = 0, ///< MVP of left block |
---|
582 | MD_ABOVE, ///< MVP of above block |
---|
583 | MD_ABOVE_RIGHT, ///< MVP of above right block |
---|
584 | MD_BELOW_LEFT, ///< MVP of below left block |
---|
585 | MD_ABOVE_LEFT ///< MVP of above left block |
---|
586 | }; |
---|
587 | |
---|
588 | /// motion vector prediction mode used in AMVP |
---|
589 | enum AMVP_MODE |
---|
590 | { |
---|
591 | AM_NONE = 0, ///< no AMVP mode |
---|
592 | AM_EXPL, ///< explicit signalling of motion vector index |
---|
593 | }; |
---|
594 | |
---|
595 | /// effect mode used in GRF |
---|
596 | enum EFF_MODE |
---|
597 | { |
---|
598 | EFF_WP_SO = 0, ///< weighted prediction (scale+offset) |
---|
599 | EFF_WP_O, ///< weighted prediction (offset) |
---|
600 | EFF_NONE |
---|
601 | }; |
---|
602 | |
---|
603 | /// interpolation filter type |
---|
604 | #if HHI_INTERP_FILTER |
---|
605 | enum InterpFilterType |
---|
606 | { |
---|
607 | IPF_SAMSUNG_DIF_DEFAULT = 0, ///< Samsung DCT-based filter |
---|
608 | IPF_HHI_4TAP_MOMS, ///< HHI 4-tap MOMS filter |
---|
609 | IPF_HHI_6TAP_MOMS, ///< HHI 6-tap MOMS filter |
---|
610 | # if TEN_DIRECTIONAL_INTERP |
---|
611 | IPF_TEN_DIF ///< TEN directional filter |
---|
612 | # else |
---|
613 | IPF_TEN_DIF_PLACEHOLDER ///< Place holder to keep ordering if IPF_TEN_DIF not compiled-in |
---|
614 | # endif |
---|
615 | # ifdef QC_SIFO |
---|
616 | ,IPF_QC_SIFO ///< Qualcomm Switched Interpolation Filters with Offsets |
---|
617 | # else |
---|
618 | ,IPF_QC_SIFO_PLACEHOLDER ///< Place holder to keep ordering if IPF_QC_SIFO not compiled-in |
---|
619 | # endif |
---|
620 | ,IPF_LAST |
---|
621 | }; |
---|
622 | #endif |
---|
623 | |
---|
624 | #endif |
---|
625 | |
---|