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-2015, 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 | #ifndef __SEI__ |
---|
35 | #define __SEI__ |
---|
36 | |
---|
37 | #pragma once |
---|
38 | #include <list> |
---|
39 | #include <vector> |
---|
40 | #include <cstring> |
---|
41 | |
---|
42 | #include "CommonDef.h" |
---|
43 | #include "libmd5/MD5.h" |
---|
44 | |
---|
45 | |
---|
46 | #if NH_MV |
---|
47 | #include "TAppCommon/program_options_lite.h" |
---|
48 | using namespace std; |
---|
49 | namespace po = df::program_options_lite; |
---|
50 | #endif |
---|
51 | |
---|
52 | //! \ingroup TLibCommon |
---|
53 | //! \{ |
---|
54 | class TComSPS; |
---|
55 | #if NH_MV |
---|
56 | class TComSlice; |
---|
57 | class SEIScalableNesting; |
---|
58 | #endif |
---|
59 | |
---|
60 | /** |
---|
61 | * Abstract class representing an SEI message with lightweight RTTI. |
---|
62 | */ |
---|
63 | class SEI |
---|
64 | { |
---|
65 | public: |
---|
66 | enum PayloadType |
---|
67 | { |
---|
68 | BUFFERING_PERIOD = 0, |
---|
69 | PICTURE_TIMING = 1, |
---|
70 | PAN_SCAN_RECT = 2, |
---|
71 | FILLER_PAYLOAD = 3, |
---|
72 | USER_DATA_REGISTERED_ITU_T_T35 = 4, |
---|
73 | USER_DATA_UNREGISTERED = 5, |
---|
74 | RECOVERY_POINT = 6, |
---|
75 | SCENE_INFO = 9, |
---|
76 | FULL_FRAME_SNAPSHOT = 15, |
---|
77 | PROGRESSIVE_REFINEMENT_SEGMENT_START = 16, |
---|
78 | PROGRESSIVE_REFINEMENT_SEGMENT_END = 17, |
---|
79 | FILM_GRAIN_CHARACTERISTICS = 19, |
---|
80 | POST_FILTER_HINT = 22, |
---|
81 | TONE_MAPPING_INFO = 23, |
---|
82 | FRAME_PACKING = 45, |
---|
83 | DISPLAY_ORIENTATION = 47, |
---|
84 | SOP_DESCRIPTION = 128, |
---|
85 | ACTIVE_PARAMETER_SETS = 129, |
---|
86 | DECODING_UNIT_INFO = 130, |
---|
87 | TEMPORAL_LEVEL0_INDEX = 131, |
---|
88 | DECODED_PICTURE_HASH = 132, |
---|
89 | SCALABLE_NESTING = 133, |
---|
90 | REGION_REFRESH_INFO = 134, |
---|
91 | NO_DISPLAY = 135, |
---|
92 | TIME_CODE = 136, |
---|
93 | MASTERING_DISPLAY_COLOUR_VOLUME = 137, |
---|
94 | SEGM_RECT_FRAME_PACKING = 138, |
---|
95 | TEMP_MOTION_CONSTRAINED_TILE_SETS = 139, |
---|
96 | CHROMA_RESAMPLING_FILTER_HINT = 140, |
---|
97 | KNEE_FUNCTION_INFO = 141, |
---|
98 | COLOUR_REMAPPING_INFO = 142, |
---|
99 | DEINTERLACED_FIELD_IDENTIFICATION = 143, |
---|
100 | LAYERS_NOT_PRESENT = 160, |
---|
101 | INTER_LAYER_CONSTRAINED_TILE_SETS = 161, |
---|
102 | BSP_NESTING = 162, |
---|
103 | BSP_INITIAL_ARRIVAL_TIME = 163, |
---|
104 | SUB_BITSTREAM_PROPERTY = 164, |
---|
105 | ALPHA_CHANNEL_INFO = 165, |
---|
106 | OVERLAY_INFO = 166, |
---|
107 | TEMPORAL_MV_PREDICTION_CONSTRAINTS = 167, |
---|
108 | FRAME_FIELD_INFO = 168, |
---|
109 | THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO = 176, |
---|
110 | DEPTH_REPRESENTATION_INFO = 177, |
---|
111 | MULTIVIEW_SCENE_INFO = 178, |
---|
112 | MULTIVIEW_ACQUISITION_INFO = 179, |
---|
113 | MULTIVIEW_VIEW_POSITION = 180 |
---|
114 | |
---|
115 | }; |
---|
116 | |
---|
117 | #if NH_MV |
---|
118 | SEI(); |
---|
119 | #else |
---|
120 | SEI() {} |
---|
121 | #endif |
---|
122 | |
---|
123 | |
---|
124 | virtual ~SEI() {} |
---|
125 | |
---|
126 | static const TChar *getSEIMessageString(SEI::PayloadType payloadType); |
---|
127 | |
---|
128 | virtual PayloadType payloadType() const = 0; |
---|
129 | |
---|
130 | #if NH_MV |
---|
131 | virtual SEI* getCopy( ) const; |
---|
132 | static SEI* getNewSEIMessage ( SEI::PayloadType payloadType ); |
---|
133 | Bool insertSei ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const; |
---|
134 | |
---|
135 | |
---|
136 | virtual Void setupFromSlice ( const TComSlice* slice ); |
---|
137 | virtual Void setupFromCfgFile ( const TChar* cfgFile ); |
---|
138 | virtual Bool checkCfg ( const TComSlice* slice ); |
---|
139 | |
---|
140 | Void xPrintCfgErrorIntro(); |
---|
141 | Void xCheckCfgRange ( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const TChar* seName ); |
---|
142 | Void xCheckCfg ( Bool& wrongConfig, Bool cond, const TChar* errStr ); |
---|
143 | Void xAddGeneralOpts ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, |
---|
144 | Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder ); |
---|
145 | // Filters where to insert SEI in the bitstream. |
---|
146 | // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used. |
---|
147 | IntAry1d m_applicableLayerIds; |
---|
148 | IntAry1d m_applicablePocs; |
---|
149 | IntAry1d m_applicableTids; |
---|
150 | IntAry1d m_applicableVclNaluTypes; |
---|
151 | |
---|
152 | Int m_payloadType; // Payload type |
---|
153 | Int m_seiNaluId; // Identifies to which NAL unit the SEI is added. |
---|
154 | Int m_positionInSeiNalu; // Identifies the order within the NAL unit |
---|
155 | Bool m_modifyByEncoder; // Don't use the SEI cfg-file, but let let the encoder setup the NALU. |
---|
156 | |
---|
157 | SEIScalableNesting* m_scalNestSeiContThisSei; // Pointer to scalable nesting SEI containing the SEI. When NULL, the SEI is not nested. |
---|
158 | #endif |
---|
159 | }; |
---|
160 | |
---|
161 | static const UInt ISO_IEC_11578_LEN=16; |
---|
162 | |
---|
163 | class SEIuserDataUnregistered : public SEI |
---|
164 | { |
---|
165 | public: |
---|
166 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
167 | |
---|
168 | SEIuserDataUnregistered() |
---|
169 | : userData(0) |
---|
170 | {} |
---|
171 | |
---|
172 | virtual ~SEIuserDataUnregistered() |
---|
173 | { |
---|
174 | delete userData; |
---|
175 | } |
---|
176 | |
---|
177 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
178 | UInt userDataLength; |
---|
179 | UChar *userData; |
---|
180 | }; |
---|
181 | |
---|
182 | class SEIDecodedPictureHash : public SEI |
---|
183 | { |
---|
184 | public: |
---|
185 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
186 | |
---|
187 | SEIDecodedPictureHash() {} |
---|
188 | virtual ~SEIDecodedPictureHash() {} |
---|
189 | |
---|
190 | HashType method; |
---|
191 | |
---|
192 | TComPictureHash m_pictureHash; |
---|
193 | }; |
---|
194 | |
---|
195 | class SEIActiveParameterSets : public SEI |
---|
196 | { |
---|
197 | public: |
---|
198 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
199 | |
---|
200 | SEIActiveParameterSets() |
---|
201 | : activeVPSId (0) |
---|
202 | , m_selfContainedCvsFlag (false) |
---|
203 | , m_noParameterSetUpdateFlag (false) |
---|
204 | , numSpsIdsMinus1 (0) |
---|
205 | {} |
---|
206 | virtual ~SEIActiveParameterSets() {} |
---|
207 | |
---|
208 | Int activeVPSId; |
---|
209 | Bool m_selfContainedCvsFlag; |
---|
210 | Bool m_noParameterSetUpdateFlag; |
---|
211 | Int numSpsIdsMinus1; |
---|
212 | std::vector<Int> activeSeqParameterSetId; |
---|
213 | }; |
---|
214 | |
---|
215 | class SEIBufferingPeriod : public SEI |
---|
216 | { |
---|
217 | public: |
---|
218 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
219 | void copyTo (SEIBufferingPeriod& target); |
---|
220 | |
---|
221 | SEIBufferingPeriod() |
---|
222 | : m_bpSeqParameterSetId (0) |
---|
223 | , m_rapCpbParamsPresentFlag (false) |
---|
224 | , m_cpbDelayOffset (0) |
---|
225 | , m_dpbDelayOffset (0) |
---|
226 | { |
---|
227 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
228 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
229 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
230 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
231 | } |
---|
232 | virtual ~SEIBufferingPeriod() {} |
---|
233 | |
---|
234 | UInt m_bpSeqParameterSetId; |
---|
235 | Bool m_rapCpbParamsPresentFlag; |
---|
236 | UInt m_cpbDelayOffset; |
---|
237 | UInt m_dpbDelayOffset; |
---|
238 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
239 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
240 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
241 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
242 | Bool m_concatenationFlag; |
---|
243 | UInt m_auCpbRemovalDelayDelta; |
---|
244 | }; |
---|
245 | class SEIPictureTiming : public SEI |
---|
246 | { |
---|
247 | public: |
---|
248 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
249 | void copyTo (SEIPictureTiming& target); |
---|
250 | |
---|
251 | SEIPictureTiming() |
---|
252 | : m_picStruct (0) |
---|
253 | , m_sourceScanType (0) |
---|
254 | , m_duplicateFlag (false) |
---|
255 | , m_picDpbOutputDuDelay (0) |
---|
256 | {} |
---|
257 | virtual ~SEIPictureTiming() |
---|
258 | { |
---|
259 | } |
---|
260 | |
---|
261 | UInt m_picStruct; |
---|
262 | UInt m_sourceScanType; |
---|
263 | Bool m_duplicateFlag; |
---|
264 | |
---|
265 | UInt m_auCpbRemovalDelay; |
---|
266 | UInt m_picDpbOutputDelay; |
---|
267 | UInt m_picDpbOutputDuDelay; |
---|
268 | UInt m_numDecodingUnitsMinus1; |
---|
269 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
270 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
271 | std::vector<UInt> m_numNalusInDuMinus1; |
---|
272 | std::vector<UInt> m_duCpbRemovalDelayMinus1; |
---|
273 | }; |
---|
274 | |
---|
275 | class SEIDecodingUnitInfo : public SEI |
---|
276 | { |
---|
277 | public: |
---|
278 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
279 | |
---|
280 | SEIDecodingUnitInfo() |
---|
281 | : m_decodingUnitIdx(0) |
---|
282 | , m_duSptCpbRemovalDelay(0) |
---|
283 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
284 | , m_picSptDpbOutputDuDelay(0) |
---|
285 | {} |
---|
286 | virtual ~SEIDecodingUnitInfo() {} |
---|
287 | Int m_decodingUnitIdx; |
---|
288 | Int m_duSptCpbRemovalDelay; |
---|
289 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
290 | Int m_picSptDpbOutputDuDelay; |
---|
291 | }; |
---|
292 | |
---|
293 | class SEIRecoveryPoint : public SEI |
---|
294 | { |
---|
295 | public: |
---|
296 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
297 | |
---|
298 | SEIRecoveryPoint() {} |
---|
299 | virtual ~SEIRecoveryPoint() {} |
---|
300 | |
---|
301 | Int m_recoveryPocCnt; |
---|
302 | Bool m_exactMatchingFlag; |
---|
303 | Bool m_brokenLinkFlag; |
---|
304 | }; |
---|
305 | |
---|
306 | class SEIFramePacking : public SEI |
---|
307 | { |
---|
308 | public: |
---|
309 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
310 | |
---|
311 | SEIFramePacking() {} |
---|
312 | virtual ~SEIFramePacking() {} |
---|
313 | |
---|
314 | Int m_arrangementId; |
---|
315 | Bool m_arrangementCancelFlag; |
---|
316 | Int m_arrangementType; |
---|
317 | Bool m_quincunxSamplingFlag; |
---|
318 | Int m_contentInterpretationType; |
---|
319 | Bool m_spatialFlippingFlag; |
---|
320 | Bool m_frame0FlippedFlag; |
---|
321 | Bool m_fieldViewsFlag; |
---|
322 | Bool m_currentFrameIsFrame0Flag; |
---|
323 | Bool m_frame0SelfContainedFlag; |
---|
324 | Bool m_frame1SelfContainedFlag; |
---|
325 | Int m_frame0GridPositionX; |
---|
326 | Int m_frame0GridPositionY; |
---|
327 | Int m_frame1GridPositionX; |
---|
328 | Int m_frame1GridPositionY; |
---|
329 | Int m_arrangementReservedByte; |
---|
330 | Bool m_arrangementPersistenceFlag; |
---|
331 | Bool m_upsampledAspectRatio; |
---|
332 | }; |
---|
333 | |
---|
334 | class SEISegmentedRectFramePacking : public SEI |
---|
335 | { |
---|
336 | public: |
---|
337 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
338 | |
---|
339 | SEISegmentedRectFramePacking() {} |
---|
340 | virtual ~SEISegmentedRectFramePacking() {} |
---|
341 | |
---|
342 | Bool m_arrangementCancelFlag; |
---|
343 | Int m_contentInterpretationType; |
---|
344 | Bool m_arrangementPersistenceFlag; |
---|
345 | }; |
---|
346 | |
---|
347 | class SEIDisplayOrientation : public SEI |
---|
348 | { |
---|
349 | public: |
---|
350 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
351 | |
---|
352 | SEIDisplayOrientation() |
---|
353 | : cancelFlag(true) |
---|
354 | , persistenceFlag(0) |
---|
355 | , extensionFlag(false) |
---|
356 | {} |
---|
357 | virtual ~SEIDisplayOrientation() {} |
---|
358 | |
---|
359 | Bool cancelFlag; |
---|
360 | Bool horFlip; |
---|
361 | Bool verFlip; |
---|
362 | |
---|
363 | UInt anticlockwiseRotation; |
---|
364 | Bool persistenceFlag; |
---|
365 | Bool extensionFlag; |
---|
366 | }; |
---|
367 | |
---|
368 | class SEITemporalLevel0Index : public SEI |
---|
369 | { |
---|
370 | public: |
---|
371 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
372 | |
---|
373 | SEITemporalLevel0Index() |
---|
374 | : tl0Idx(0) |
---|
375 | , rapIdx(0) |
---|
376 | {} |
---|
377 | virtual ~SEITemporalLevel0Index() {} |
---|
378 | |
---|
379 | UInt tl0Idx; |
---|
380 | UInt rapIdx; |
---|
381 | }; |
---|
382 | |
---|
383 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
384 | { |
---|
385 | public: |
---|
386 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
387 | |
---|
388 | SEIGradualDecodingRefreshInfo() |
---|
389 | : m_gdrForegroundFlag(0) |
---|
390 | {} |
---|
391 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
392 | |
---|
393 | Bool m_gdrForegroundFlag; |
---|
394 | }; |
---|
395 | |
---|
396 | class SEINoDisplay : public SEI |
---|
397 | { |
---|
398 | public: |
---|
399 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
400 | |
---|
401 | SEINoDisplay() |
---|
402 | : m_noDisplay(false) |
---|
403 | {} |
---|
404 | virtual ~SEINoDisplay() {} |
---|
405 | |
---|
406 | Bool m_noDisplay; |
---|
407 | }; |
---|
408 | |
---|
409 | class SEISOPDescription : public SEI |
---|
410 | { |
---|
411 | public: |
---|
412 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
413 | |
---|
414 | SEISOPDescription() {} |
---|
415 | virtual ~SEISOPDescription() {} |
---|
416 | |
---|
417 | UInt m_sopSeqParameterSetId; |
---|
418 | UInt m_numPicsInSopMinus1; |
---|
419 | |
---|
420 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
421 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
422 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
423 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
424 | }; |
---|
425 | |
---|
426 | class SEIToneMappingInfo : public SEI |
---|
427 | { |
---|
428 | public: |
---|
429 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
430 | SEIToneMappingInfo() {} |
---|
431 | virtual ~SEIToneMappingInfo() {} |
---|
432 | |
---|
433 | Int m_toneMapId; |
---|
434 | Bool m_toneMapCancelFlag; |
---|
435 | Bool m_toneMapPersistenceFlag; |
---|
436 | Int m_codedDataBitDepth; |
---|
437 | Int m_targetBitDepth; |
---|
438 | Int m_modelId; |
---|
439 | Int m_minValue; |
---|
440 | Int m_maxValue; |
---|
441 | Int m_sigmoidMidpoint; |
---|
442 | Int m_sigmoidWidth; |
---|
443 | std::vector<Int> m_startOfCodedInterval; |
---|
444 | Int m_numPivots; |
---|
445 | std::vector<Int> m_codedPivotValue; |
---|
446 | std::vector<Int> m_targetPivotValue; |
---|
447 | Int m_cameraIsoSpeedIdc; |
---|
448 | Int m_cameraIsoSpeedValue; |
---|
449 | Int m_exposureIndexIdc; |
---|
450 | Int m_exposureIndexValue; |
---|
451 | Bool m_exposureCompensationValueSignFlag; |
---|
452 | Int m_exposureCompensationValueNumerator; |
---|
453 | Int m_exposureCompensationValueDenomIdc; |
---|
454 | Int m_refScreenLuminanceWhite; |
---|
455 | Int m_extendedRangeWhiteLevel; |
---|
456 | Int m_nominalBlackLevelLumaCodeValue; |
---|
457 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
458 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
459 | }; |
---|
460 | |
---|
461 | class SEIKneeFunctionInfo : public SEI |
---|
462 | { |
---|
463 | public: |
---|
464 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
465 | SEIKneeFunctionInfo() {} |
---|
466 | virtual ~SEIKneeFunctionInfo() {} |
---|
467 | |
---|
468 | Int m_kneeId; |
---|
469 | Bool m_kneeCancelFlag; |
---|
470 | Bool m_kneePersistenceFlag; |
---|
471 | Int m_kneeInputDrange; |
---|
472 | Int m_kneeInputDispLuminance; |
---|
473 | Int m_kneeOutputDrange; |
---|
474 | Int m_kneeOutputDispLuminance; |
---|
475 | Int m_kneeNumKneePointsMinus1; |
---|
476 | std::vector<Int> m_kneeInputKneePoint; |
---|
477 | std::vector<Int> m_kneeOutputKneePoint; |
---|
478 | }; |
---|
479 | |
---|
480 | class SEIColourRemappingInfo : public SEI |
---|
481 | { |
---|
482 | public: |
---|
483 | |
---|
484 | struct CRIlut |
---|
485 | { |
---|
486 | Int codedValue; |
---|
487 | Int targetValue; |
---|
488 | bool operator < (const CRIlut& a) const |
---|
489 | { |
---|
490 | return codedValue < a.codedValue; |
---|
491 | } |
---|
492 | }; |
---|
493 | |
---|
494 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
495 | SEIColourRemappingInfo() {} |
---|
496 | ~SEIColourRemappingInfo() {} |
---|
497 | |
---|
498 | Void copyFrom( const SEIColourRemappingInfo &seiCriInput) |
---|
499 | { |
---|
500 | (*this) = seiCriInput; |
---|
501 | } |
---|
502 | |
---|
503 | UInt m_colourRemapId; |
---|
504 | Bool m_colourRemapCancelFlag; |
---|
505 | Bool m_colourRemapPersistenceFlag; |
---|
506 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
507 | Bool m_colourRemapFullRangeFlag; |
---|
508 | Int m_colourRemapPrimaries; |
---|
509 | Int m_colourRemapTransferFunction; |
---|
510 | Int m_colourRemapMatrixCoefficients; |
---|
511 | Int m_colourRemapInputBitDepth; |
---|
512 | Int m_colourRemapBitDepth; |
---|
513 | Int m_preLutNumValMinus1[3]; |
---|
514 | std::vector<CRIlut> m_preLut[3]; |
---|
515 | Bool m_colourRemapMatrixPresentFlag; |
---|
516 | Int m_log2MatrixDenom; |
---|
517 | Int m_colourRemapCoeffs[3][3]; |
---|
518 | Int m_postLutNumValMinus1[3]; |
---|
519 | std::vector<CRIlut> m_postLut[3]; |
---|
520 | }; |
---|
521 | |
---|
522 | class SEIChromaResamplingFilterHint : public SEI |
---|
523 | { |
---|
524 | public: |
---|
525 | PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;} |
---|
526 | SEIChromaResamplingFilterHint() {} |
---|
527 | virtual ~SEIChromaResamplingFilterHint() {} |
---|
528 | |
---|
529 | Int m_verChromaFilterIdc; |
---|
530 | Int m_horChromaFilterIdc; |
---|
531 | Bool m_verFilteringFieldProcessingFlag; |
---|
532 | Int m_targetFormatIdc; |
---|
533 | Bool m_perfectReconstructionFlag; |
---|
534 | std::vector<std::vector<Int> > m_verFilterCoeff; |
---|
535 | std::vector<std::vector<Int> > m_horFilterCoeff; |
---|
536 | }; |
---|
537 | |
---|
538 | class SEIMasteringDisplayColourVolume : public SEI |
---|
539 | { |
---|
540 | public: |
---|
541 | PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; } |
---|
542 | SEIMasteringDisplayColourVolume() {} |
---|
543 | virtual ~SEIMasteringDisplayColourVolume(){} |
---|
544 | |
---|
545 | TComSEIMasteringDisplay values; |
---|
546 | }; |
---|
547 | |
---|
548 | typedef std::list<SEI*> SEIMessages; |
---|
549 | |
---|
550 | /// output a selection of SEI messages by payload type. Ownership stays in original message list. |
---|
551 | SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
552 | |
---|
553 | /// remove a selection of SEI messages by payload type from the original list and return them in a new list. |
---|
554 | SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
555 | |
---|
556 | /// delete list of SEI messages (freeing the referenced objects) |
---|
557 | Void deleteSEIs (SEIMessages &seiList); |
---|
558 | |
---|
559 | class SEIScalableNesting : public SEI |
---|
560 | { |
---|
561 | public: |
---|
562 | PayloadType payloadType() const { return SCALABLE_NESTING; } |
---|
563 | |
---|
564 | SEIScalableNesting() {} |
---|
565 | |
---|
566 | virtual ~SEIScalableNesting() |
---|
567 | { |
---|
568 | deleteSEIs(m_nestedSEIs); |
---|
569 | } |
---|
570 | |
---|
571 | Bool m_bitStreamSubsetFlag; |
---|
572 | Bool m_nestingOpFlag; |
---|
573 | Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 |
---|
574 | UInt m_nestingNumOpsMinus1; // -"- |
---|
575 | UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- |
---|
576 | UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- |
---|
577 | |
---|
578 | Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 |
---|
579 | UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
580 | UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
581 | UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER]; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values |
---|
582 | |
---|
583 | SEIMessages m_nestedSEIs; |
---|
584 | }; |
---|
585 | |
---|
586 | class SEITimeCode : public SEI |
---|
587 | { |
---|
588 | public: |
---|
589 | PayloadType payloadType() const { return TIME_CODE; } |
---|
590 | SEITimeCode() {} |
---|
591 | virtual ~SEITimeCode(){} |
---|
592 | |
---|
593 | UInt numClockTs; |
---|
594 | TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS]; |
---|
595 | }; |
---|
596 | |
---|
597 | //definition according to P1005_v1; |
---|
598 | class SEITempMotionConstrainedTileSets: public SEI |
---|
599 | { |
---|
600 | struct TileSetData |
---|
601 | { |
---|
602 | protected: |
---|
603 | std::vector<Int> m_top_left_tile_index; //[tileSetIdx][tileIdx]; |
---|
604 | std::vector<Int> m_bottom_right_tile_index; |
---|
605 | |
---|
606 | public: |
---|
607 | Int m_mcts_id; |
---|
608 | Bool m_display_tile_set_flag; |
---|
609 | Int m_num_tile_rects_in_set; //_minus1; |
---|
610 | Bool m_exact_sample_value_match_flag; |
---|
611 | Bool m_mcts_tier_level_idc_present_flag; |
---|
612 | Bool m_mcts_tier_flag; |
---|
613 | Int m_mcts_level_idc; |
---|
614 | |
---|
615 | Void setNumberOfTileRects(const Int number) |
---|
616 | { |
---|
617 | m_top_left_tile_index .resize(number); |
---|
618 | m_bottom_right_tile_index.resize(number); |
---|
619 | } |
---|
620 | |
---|
621 | Int getNumberOfTileRects() const |
---|
622 | { |
---|
623 | assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size()); |
---|
624 | return Int(m_top_left_tile_index.size()); |
---|
625 | } |
---|
626 | |
---|
627 | Int &topLeftTileIndex (const Int tileRectIndex) { return m_top_left_tile_index [tileRectIndex]; } |
---|
628 | Int &bottomRightTileIndex(const Int tileRectIndex) { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
629 | const Int &topLeftTileIndex (const Int tileRectIndex) const { return m_top_left_tile_index [tileRectIndex]; } |
---|
630 | const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
631 | }; |
---|
632 | |
---|
633 | protected: |
---|
634 | std::vector<TileSetData> m_tile_set_data; |
---|
635 | |
---|
636 | public: |
---|
637 | |
---|
638 | Bool m_mc_all_tiles_exact_sample_value_match_flag; |
---|
639 | Bool m_each_tile_one_tile_set_flag; |
---|
640 | Bool m_limited_tile_set_display_flag; |
---|
641 | Bool m_max_mcs_tier_level_idc_present_flag; |
---|
642 | Bool m_max_mcts_tier_flag; |
---|
643 | Int m_max_mcts_level_idc; |
---|
644 | |
---|
645 | PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; } |
---|
646 | |
---|
647 | Void setNumberOfTileSets(const Int number) { m_tile_set_data.resize(number); } |
---|
648 | Int getNumberOfTileSets() const { return Int(m_tile_set_data.size()); } |
---|
649 | |
---|
650 | TileSetData &tileSetData (const Int index) { return m_tile_set_data[index]; } |
---|
651 | const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; } |
---|
652 | |
---|
653 | }; |
---|
654 | #if NH_MV |
---|
655 | class SEILayersNotPresent : public SEI |
---|
656 | { |
---|
657 | public: |
---|
658 | PayloadType payloadType( ) const { return LAYERS_NOT_PRESENT; } |
---|
659 | SEILayersNotPresent ( ) { }; |
---|
660 | ~SEILayersNotPresent( ) { }; |
---|
661 | SEI* getCopy( ) const { return new SEILayersNotPresent(*this); }; |
---|
662 | |
---|
663 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
664 | Bool checkCfg ( const TComSlice* slice ); |
---|
665 | |
---|
666 | Int m_lnpSeiActiveVpsId; |
---|
667 | UInt m_lnpSeiMaxLayers; |
---|
668 | BoolAry1d m_layerNotPresentFlag; |
---|
669 | |
---|
670 | Void resizeDimI( Int sizeDimI ) |
---|
671 | { |
---|
672 | m_layerNotPresentFlag.resize( sizeDimI ); |
---|
673 | } |
---|
674 | }; |
---|
675 | |
---|
676 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
677 | { |
---|
678 | public: |
---|
679 | PayloadType payloadType( ) const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
680 | SEIInterLayerConstrainedTileSets ( ) { }; |
---|
681 | ~SEIInterLayerConstrainedTileSets( ) { }; |
---|
682 | SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); }; |
---|
683 | |
---|
684 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
685 | Bool checkCfg ( const TComSlice* slice ); |
---|
686 | |
---|
687 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
688 | Bool m_ilOneTilePerTileSetFlag; |
---|
689 | Int m_ilNumSetsInMessageMinus1; |
---|
690 | Bool m_skippedTileSetPresentFlag; |
---|
691 | IntAry1d m_ilctsId; |
---|
692 | IntAry1d m_ilNumTileRectsInSetMinus1; |
---|
693 | IntAry2d m_ilTopLeftTileIndex; |
---|
694 | IntAry2d m_ilBottomRightTileIndex; |
---|
695 | IntAry1d m_ilcIdc; |
---|
696 | BoolAry1d m_ilExactSampleValueMatchFlag; |
---|
697 | Int m_allTilesIlcIdc; |
---|
698 | |
---|
699 | Void resizeDimI( Int sizeDimI ) |
---|
700 | { |
---|
701 | m_ilctsId .resize( sizeDimI ); |
---|
702 | m_ilNumTileRectsInSetMinus1 .resize( sizeDimI ); |
---|
703 | m_ilTopLeftTileIndex .resize( sizeDimI ); |
---|
704 | m_ilBottomRightTileIndex .resize( sizeDimI ); |
---|
705 | m_ilcIdc .resize( sizeDimI ); |
---|
706 | m_ilExactSampleValueMatchFlag.resize( sizeDimI ); |
---|
707 | } |
---|
708 | |
---|
709 | Void resizeDimJ( Int i, Int sizeDimJ ) |
---|
710 | { |
---|
711 | m_ilTopLeftTileIndex [i].resize( sizeDimJ ); |
---|
712 | m_ilBottomRightTileIndex[i].resize( sizeDimJ ); |
---|
713 | } |
---|
714 | |
---|
715 | }; |
---|
716 | |
---|
717 | #if NH_MV_TBD |
---|
718 | class SEIBspNesting : public SEI |
---|
719 | { |
---|
720 | public: |
---|
721 | PayloadType payloadType( ) const { return BSP_NESTING; } |
---|
722 | SEIBspNesting ( ) { }; |
---|
723 | ~SEIBspNesting( ) { }; |
---|
724 | SEI* getCopy( ) const { return new SEIBspNesting(*this); }; |
---|
725 | |
---|
726 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
727 | Void setupFromSlice ( const TComSlice* slice ); |
---|
728 | Bool checkCfg ( const TComSlice* slice ); |
---|
729 | |
---|
730 | Int m_seiOlsIdx; |
---|
731 | Int m_seiPartitioningSchemeIdx; |
---|
732 | Int m_bspIdx; |
---|
733 | Int m_bspNestingZeroBit; |
---|
734 | Int m_numSeisInBspMinus1; |
---|
735 | }; |
---|
736 | |
---|
737 | class SEIBspInitialArrivalTime : public SEI |
---|
738 | { |
---|
739 | public: |
---|
740 | PayloadType payloadType( ) const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
741 | SEIBspInitialArrivalTime ( ) { }; |
---|
742 | ~SEIBspInitialArrivalTime( ) { }; |
---|
743 | SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); }; |
---|
744 | |
---|
745 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
746 | Void setupFromSlice ( const TComSlice* slice ); |
---|
747 | Bool checkCfg ( const TComSlice* slice ); |
---|
748 | |
---|
749 | IntAry1d m_nalInitialArrivalDelay; |
---|
750 | IntAry1d m_vclInitialArrivalDelay; |
---|
751 | }; |
---|
752 | #endif |
---|
753 | |
---|
754 | class SEISubBitstreamProperty : public SEI |
---|
755 | { |
---|
756 | public: |
---|
757 | PayloadType payloadType( ) const { return SUB_BITSTREAM_PROPERTY; } |
---|
758 | SEISubBitstreamProperty ( ) { }; |
---|
759 | ~SEISubBitstreamProperty( ) { }; |
---|
760 | SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); }; |
---|
761 | |
---|
762 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
763 | Bool checkCfg ( const TComSlice* slice ); |
---|
764 | Void resizeArrays ( ); |
---|
765 | |
---|
766 | Int m_sbPropertyActiveVpsId; |
---|
767 | Int m_numAdditionalSubStreamsMinus1; |
---|
768 | IntAry1d m_subBitstreamMode; |
---|
769 | IntAry1d m_olsIdxToVps; |
---|
770 | IntAry1d m_highestSublayerId; |
---|
771 | IntAry1d m_avgSbPropertyBitRate; |
---|
772 | IntAry1d m_maxSbPropertyBitRate; |
---|
773 | }; |
---|
774 | |
---|
775 | class SEIAlphaChannelInfo : public SEI |
---|
776 | { |
---|
777 | public: |
---|
778 | PayloadType payloadType( ) const { return ALPHA_CHANNEL_INFO; } |
---|
779 | SEIAlphaChannelInfo ( ) { }; |
---|
780 | ~SEIAlphaChannelInfo( ) { }; |
---|
781 | SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); }; |
---|
782 | |
---|
783 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
784 | Bool checkCfg ( const TComSlice* slice ); |
---|
785 | |
---|
786 | Bool m_alphaChannelCancelFlag; |
---|
787 | Int m_alphaChannelUseIdc; |
---|
788 | Int m_alphaChannelBitDepthMinus8; |
---|
789 | Int m_alphaTransparentValue; |
---|
790 | Int m_alphaOpaqueValue; |
---|
791 | Bool m_alphaChannelIncrFlag; |
---|
792 | Bool m_alphaChannelClipFlag; |
---|
793 | Bool m_alphaChannelClipTypeFlag; |
---|
794 | }; |
---|
795 | |
---|
796 | class SEIOverlayInfo : public SEI |
---|
797 | { |
---|
798 | public: |
---|
799 | PayloadType payloadType( ) const { return OVERLAY_INFO; } |
---|
800 | SEIOverlayInfo ( ); |
---|
801 | ~SEIOverlayInfo( ) { }; |
---|
802 | SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; |
---|
803 | |
---|
804 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
805 | Bool checkCfg ( const TComSlice* slice ); |
---|
806 | |
---|
807 | const Int m_numOverlaysMax; |
---|
808 | const Int m_numOverlayElementsMax; |
---|
809 | const Int m_numStringBytesMax; //incl. null termination byte |
---|
810 | |
---|
811 | Bool m_overlayInfoCancelFlag; |
---|
812 | Int m_overlayContentAuxIdMinus128; |
---|
813 | Int m_overlayLabelAuxIdMinus128; |
---|
814 | Int m_overlayAlphaAuxIdMinus128; |
---|
815 | Int m_overlayElementLabelValueLengthMinus8; |
---|
816 | Int m_numOverlaysMinus1; |
---|
817 | IntAry1d m_overlayIdx; |
---|
818 | BoolAry1d m_languageOverlayPresentFlag; |
---|
819 | IntAry1d m_overlayContentLayerId; |
---|
820 | BoolAry1d m_overlayLabelPresentFlag; |
---|
821 | IntAry1d m_overlayLabelLayerId; |
---|
822 | BoolAry1d m_overlayAlphaPresentFlag; |
---|
823 | IntAry1d m_overlayAlphaLayerId; |
---|
824 | IntAry1d m_numOverlayElementsMinus1; |
---|
825 | IntAry2d m_overlayElementLabelMin; |
---|
826 | IntAry2d m_overlayElementLabelMax; |
---|
827 | StringAry1d m_overlayLanguage; |
---|
828 | StringAry1d m_overlayName; |
---|
829 | StringAry2d m_overlayElementName; |
---|
830 | Bool m_overlayInfoPersistenceFlag; |
---|
831 | }; |
---|
832 | |
---|
833 | class SEITemporalMvPredictionConstraints : public SEI |
---|
834 | { |
---|
835 | public: |
---|
836 | PayloadType payloadType( ) const { return TEMPORAL_MV_PREDICTION_CONSTRAINTS; } |
---|
837 | SEITemporalMvPredictionConstraints ( ) { }; |
---|
838 | ~SEITemporalMvPredictionConstraints( ) { }; |
---|
839 | SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); }; |
---|
840 | |
---|
841 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
842 | Bool checkCfg ( const TComSlice* slice ); |
---|
843 | |
---|
844 | Bool m_prevPicsNotUsedFlag; |
---|
845 | Bool m_noIntraLayerColPicFlag; |
---|
846 | }; |
---|
847 | |
---|
848 | #if NH_MV_SEI_TBD |
---|
849 | class SEIFrameFieldInfo : public SEI |
---|
850 | { |
---|
851 | public: |
---|
852 | PayloadType payloadType( ) const { return FRAME_FIELD_INFO; } |
---|
853 | SEIFrameFieldInfo ( ) { }; |
---|
854 | ~SEIFrameFieldInfo( ) { }; |
---|
855 | SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); }; |
---|
856 | |
---|
857 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
858 | Void setupFromSlice ( const TComSlice* slice ); |
---|
859 | Bool checkCfg ( const TComSlice* slice ); |
---|
860 | |
---|
861 | Int m_ffinfoPicStruct; |
---|
862 | Int m_ffinfoSourceScanType; |
---|
863 | Bool m_ffinfoDuplicateFlag; |
---|
864 | }; |
---|
865 | #endif |
---|
866 | |
---|
867 | class SEIThreeDimensionalReferenceDisplaysInfo : public SEI |
---|
868 | { |
---|
869 | public: |
---|
870 | PayloadType payloadType( ) const { return THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO; } |
---|
871 | SEIThreeDimensionalReferenceDisplaysInfo ( ) { }; |
---|
872 | ~SEIThreeDimensionalReferenceDisplaysInfo( ) { }; |
---|
873 | SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); }; |
---|
874 | |
---|
875 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
876 | Bool checkCfg ( const TComSlice* slice ); |
---|
877 | |
---|
878 | Int getNumRefDisplaysMinus1( ) const |
---|
879 | { |
---|
880 | return m_numRefDisplaysMinus1; |
---|
881 | } |
---|
882 | |
---|
883 | Int m_precRefDisplayWidth; |
---|
884 | Bool m_refViewingDistanceFlag; |
---|
885 | Int m_precRefViewingDist; |
---|
886 | Int m_numRefDisplaysMinus1; |
---|
887 | IntAry1d m_leftViewId; |
---|
888 | IntAry1d m_rightViewId; |
---|
889 | IntAry1d m_exponentRefDisplayWidth; |
---|
890 | IntAry1d m_mantissaRefDisplayWidth; |
---|
891 | IntAry1d m_exponentRefViewingDistance; |
---|
892 | IntAry1d m_mantissaRefViewingDistance; |
---|
893 | BoolAry1d m_additionalShiftPresentFlag; |
---|
894 | IntAry1d m_numSampleShiftPlus512; |
---|
895 | Bool m_threeDimensionalReferenceDisplaysExtensionFlag; |
---|
896 | |
---|
897 | Void resizeArrays( ) |
---|
898 | { |
---|
899 | Int numReferenceDiaplays = getNumRefDisplaysMinus1() + 1; |
---|
900 | |
---|
901 | m_leftViewId .resize( numReferenceDiaplays ); |
---|
902 | m_rightViewId .resize( numReferenceDiaplays ); |
---|
903 | m_exponentRefDisplayWidth .resize( numReferenceDiaplays ); |
---|
904 | m_mantissaRefDisplayWidth .resize( numReferenceDiaplays ); |
---|
905 | m_exponentRefViewingDistance .resize( numReferenceDiaplays ); |
---|
906 | m_mantissaRefViewingDistance .resize( numReferenceDiaplays ); |
---|
907 | m_additionalShiftPresentFlag .resize( numReferenceDiaplays ); |
---|
908 | m_numSampleShiftPlus512 .resize( numReferenceDiaplays ); |
---|
909 | } |
---|
910 | |
---|
911 | UInt getMantissaReferenceDisplayWidthLen ( Int i ) const ; |
---|
912 | UInt getMantissaReferenceViewingDistanceLen ( Int i ) const ; |
---|
913 | private: |
---|
914 | UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; |
---|
915 | }; |
---|
916 | |
---|
917 | class SEIDepthRepresentationInfo : public SEI |
---|
918 | { |
---|
919 | public: |
---|
920 | PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; } |
---|
921 | SEIDepthRepresentationInfo ( ) |
---|
922 | { |
---|
923 | m_currLayerID=-1; |
---|
924 | }; |
---|
925 | ~SEIDepthRepresentationInfo( ) { }; |
---|
926 | SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); }; |
---|
927 | |
---|
928 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
929 | Void setupFromSlice ( const TComSlice* slice ); |
---|
930 | Bool checkCfg ( const TComSlice* slice ); |
---|
931 | Void clear() |
---|
932 | { |
---|
933 | int i; |
---|
934 | m_zNearFlag.clear(); |
---|
935 | m_zFarFlag.clear(); |
---|
936 | m_dMinFlag.clear(); |
---|
937 | m_dMaxFlag.clear(); |
---|
938 | |
---|
939 | for(i=0;i<m_zNear.size();i++) |
---|
940 | m_zNear[i].clear(); |
---|
941 | m_zNear.clear(); |
---|
942 | |
---|
943 | for(i=0;i<m_zFar.size();i++) |
---|
944 | m_zFar[i].clear(); |
---|
945 | m_zFar.clear(); |
---|
946 | |
---|
947 | for(i=0;i<m_dMin.size();i++) |
---|
948 | m_dMin[i].clear(); |
---|
949 | m_dMin.clear(); |
---|
950 | |
---|
951 | for(i=0;i<m_dMax.size();i++) |
---|
952 | m_dMax[i].clear(); |
---|
953 | m_dMax.clear(); |
---|
954 | |
---|
955 | for(i=0;i<m_depthRepresentationType.size();i++) |
---|
956 | m_depthRepresentationType[i].clear(); |
---|
957 | m_depthRepresentationType.clear(); |
---|
958 | |
---|
959 | for(i=0;i<m_disparityRefViewId.size();i++) |
---|
960 | m_disparityRefViewId[i].clear(); |
---|
961 | m_disparityRefViewId.clear(); |
---|
962 | |
---|
963 | for(i=0;i<m_depthNonlinearRepresentationNumMinus1.size();i++) |
---|
964 | m_depthNonlinearRepresentationNumMinus1[i].clear(); |
---|
965 | m_depthNonlinearRepresentationNumMinus1.clear(); |
---|
966 | |
---|
967 | for(i=0;i<m_depth_nonlinear_representation_model.size();i++) |
---|
968 | m_depth_nonlinear_representation_model[i].clear(); |
---|
969 | m_depth_nonlinear_representation_model.clear(); |
---|
970 | |
---|
971 | } |
---|
972 | Int m_currLayerID; |
---|
973 | BoolAry1d m_zNearFlag; |
---|
974 | BoolAry1d m_zFarFlag; |
---|
975 | BoolAry1d m_dMinFlag; |
---|
976 | BoolAry1d m_dMaxFlag; |
---|
977 | BoolAry2d m_depthRepresentationInfoSeiPresentFlag; |
---|
978 | std::vector< std::vector<Double> > m_zNear,m_zFar,m_dMin,m_dMax; |
---|
979 | |
---|
980 | IntAry2d m_depthRepresentationType; |
---|
981 | IntAry2d m_disparityRefViewId; |
---|
982 | IntAry2d m_depthNonlinearRepresentationNumMinus1; |
---|
983 | IntAry2d m_depth_nonlinear_representation_model; |
---|
984 | }; |
---|
985 | |
---|
986 | |
---|
987 | class SEIMultiviewSceneInfo : public SEI |
---|
988 | { |
---|
989 | public: |
---|
990 | PayloadType payloadType( ) const { return MULTIVIEW_SCENE_INFO; } |
---|
991 | SEIMultiviewSceneInfo ( ) { }; |
---|
992 | ~SEIMultiviewSceneInfo( ) { }; |
---|
993 | SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); }; |
---|
994 | |
---|
995 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
996 | Bool checkCfg ( const TComSlice* slice ); |
---|
997 | |
---|
998 | Int m_minDisparity; |
---|
999 | Int m_maxDisparityRange; |
---|
1000 | }; |
---|
1001 | |
---|
1002 | |
---|
1003 | class SEIMultiviewAcquisitionInfo : public SEI |
---|
1004 | { |
---|
1005 | public: |
---|
1006 | PayloadType payloadType( ) const { return MULTIVIEW_ACQUISITION_INFO; } |
---|
1007 | SEIMultiviewAcquisitionInfo ( ) { }; |
---|
1008 | ~SEIMultiviewAcquisitionInfo( ) { }; |
---|
1009 | SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); }; |
---|
1010 | |
---|
1011 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
1012 | Bool checkCfg ( const TComSlice* slice ); |
---|
1013 | |
---|
1014 | Int getNumViewsMinus1( ) const |
---|
1015 | { |
---|
1016 | Int numViewsMinus1; |
---|
1017 | if( m_scalNestSeiContThisSei != NULL ) |
---|
1018 | { |
---|
1019 | numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1; |
---|
1020 | } |
---|
1021 | else |
---|
1022 | { |
---|
1023 | numViewsMinus1 = 0; |
---|
1024 | } |
---|
1025 | return numViewsMinus1; |
---|
1026 | } |
---|
1027 | |
---|
1028 | Void resizeArrays( ) |
---|
1029 | { |
---|
1030 | Int numViews = getNumViewsMinus1() + 1; |
---|
1031 | m_signFocalLengthX .resize( numViews ); |
---|
1032 | m_exponentFocalLengthX .resize( numViews ); |
---|
1033 | m_mantissaFocalLengthX .resize( numViews ); |
---|
1034 | m_signFocalLengthY .resize( numViews ); |
---|
1035 | m_exponentFocalLengthY .resize( numViews ); |
---|
1036 | m_mantissaFocalLengthY .resize( numViews ); |
---|
1037 | m_signPrincipalPointX .resize( numViews ); |
---|
1038 | m_exponentPrincipalPointX.resize( numViews ); |
---|
1039 | m_mantissaPrincipalPointX.resize( numViews ); |
---|
1040 | m_signPrincipalPointY .resize( numViews ); |
---|
1041 | m_exponentPrincipalPointY.resize( numViews ); |
---|
1042 | m_mantissaPrincipalPointY.resize( numViews ); |
---|
1043 | m_signSkewFactor .resize( numViews ); |
---|
1044 | m_exponentSkewFactor .resize( numViews ); |
---|
1045 | m_mantissaSkewFactor .resize( numViews ); |
---|
1046 | |
---|
1047 | m_signR .resize( numViews ); |
---|
1048 | m_exponentR .resize( numViews ); |
---|
1049 | m_mantissaR .resize( numViews ); |
---|
1050 | m_signT .resize( numViews ); |
---|
1051 | m_exponentT .resize( numViews ); |
---|
1052 | m_mantissaT .resize( numViews ); |
---|
1053 | |
---|
1054 | for( Int i = 0; i < numViews ; i++ ) |
---|
1055 | { |
---|
1056 | m_signR [i].resize( 3 ); |
---|
1057 | m_exponentR[i].resize( 3 ); |
---|
1058 | m_mantissaR[i].resize( 3 ); |
---|
1059 | m_signT [i].resize( 3 ); |
---|
1060 | m_exponentT[i].resize( 3 ); |
---|
1061 | m_mantissaT[i].resize( 3 ); |
---|
1062 | |
---|
1063 | for (Int j = 0; j < 3; j++) |
---|
1064 | { |
---|
1065 | m_signR [i][j].resize( 3 ); |
---|
1066 | m_exponentR[i][j].resize( 3 ); |
---|
1067 | m_mantissaR[i][j].resize( 3 ); |
---|
1068 | } |
---|
1069 | } |
---|
1070 | } |
---|
1071 | |
---|
1072 | UInt getMantissaFocalLengthXLen ( Int i ) const ; |
---|
1073 | UInt getMantissaFocalLengthYLen ( Int i ) const ; |
---|
1074 | UInt getMantissaPrincipalPointXLen( Int i ) const ; |
---|
1075 | UInt getMantissaPrincipalPointYLen( Int i ) const ; |
---|
1076 | UInt getMantissaSkewFactorLen ( Int i ) const ; |
---|
1077 | UInt getMantissaRLen ( Int i, Int j, Int k ) const ; |
---|
1078 | UInt getMantissaTLen ( Int i, Int j ) const ; |
---|
1079 | |
---|
1080 | Bool m_intrinsicParamFlag; |
---|
1081 | Bool m_extrinsicParamFlag; |
---|
1082 | Bool m_intrinsicParamsEqualFlag; |
---|
1083 | Int m_precFocalLength; |
---|
1084 | Int m_precPrincipalPoint; |
---|
1085 | Int m_precSkewFactor; |
---|
1086 | BoolAry1d m_signFocalLengthX; |
---|
1087 | IntAry1d m_exponentFocalLengthX; |
---|
1088 | IntAry1d m_mantissaFocalLengthX; |
---|
1089 | BoolAry1d m_signFocalLengthY; |
---|
1090 | IntAry1d m_exponentFocalLengthY; |
---|
1091 | IntAry1d m_mantissaFocalLengthY; |
---|
1092 | BoolAry1d m_signPrincipalPointX; |
---|
1093 | IntAry1d m_exponentPrincipalPointX; |
---|
1094 | IntAry1d m_mantissaPrincipalPointX; |
---|
1095 | BoolAry1d m_signPrincipalPointY; |
---|
1096 | IntAry1d m_exponentPrincipalPointY; |
---|
1097 | IntAry1d m_mantissaPrincipalPointY; |
---|
1098 | BoolAry1d m_signSkewFactor; |
---|
1099 | IntAry1d m_exponentSkewFactor; |
---|
1100 | IntAry1d m_mantissaSkewFactor; |
---|
1101 | Int m_precRotationParam; |
---|
1102 | Int m_precTranslationParam; |
---|
1103 | BoolAry3d m_signR; |
---|
1104 | IntAry3d m_exponentR; |
---|
1105 | IntAry3d m_mantissaR; |
---|
1106 | BoolAry2d m_signT; |
---|
1107 | IntAry2d m_exponentT; |
---|
1108 | IntAry2d m_mantissaT; |
---|
1109 | private: |
---|
1110 | UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; |
---|
1111 | }; |
---|
1112 | |
---|
1113 | |
---|
1114 | |
---|
1115 | class SEIMultiviewViewPosition : public SEI |
---|
1116 | { |
---|
1117 | public: |
---|
1118 | PayloadType payloadType( ) const { return MULTIVIEW_VIEW_POSITION; } |
---|
1119 | SEIMultiviewViewPosition ( ) { }; |
---|
1120 | ~SEIMultiviewViewPosition( ) { }; |
---|
1121 | SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); }; |
---|
1122 | |
---|
1123 | Void setupFromCfgFile( const TChar* cfgFile ); |
---|
1124 | Void setupFromSlice ( const TComSlice* slice ); |
---|
1125 | Bool checkCfg ( const TComSlice* slice ); |
---|
1126 | |
---|
1127 | Int m_numViewsMinus1; |
---|
1128 | IntAry1d m_viewPosition; |
---|
1129 | }; |
---|
1130 | |
---|
1131 | #endif |
---|
1132 | #endif |
---|
1133 | |
---|
1134 | //! \} |
---|