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-2016, 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 | #if SVC_EXTENSION |
---|
45 | #include "TLibCommon/NAL.h" |
---|
46 | #endif |
---|
47 | |
---|
48 | //! \ingroup TLibCommon |
---|
49 | //! \{ |
---|
50 | class TComSPS; |
---|
51 | #if O0164_MULTI_LAYER_HRD |
---|
52 | class TComHRD; |
---|
53 | #endif |
---|
54 | |
---|
55 | /** |
---|
56 | * Abstract class representing an SEI message with lightweight RTTI. |
---|
57 | */ |
---|
58 | class SEI |
---|
59 | { |
---|
60 | public: |
---|
61 | enum PayloadType |
---|
62 | { |
---|
63 | BUFFERING_PERIOD = 0, |
---|
64 | PICTURE_TIMING = 1, |
---|
65 | PAN_SCAN_RECT = 2, |
---|
66 | FILLER_PAYLOAD = 3, |
---|
67 | USER_DATA_REGISTERED_ITU_T_T35 = 4, |
---|
68 | USER_DATA_UNREGISTERED = 5, |
---|
69 | RECOVERY_POINT = 6, |
---|
70 | SCENE_INFO = 9, |
---|
71 | FULL_FRAME_SNAPSHOT = 15, |
---|
72 | PROGRESSIVE_REFINEMENT_SEGMENT_START = 16, |
---|
73 | PROGRESSIVE_REFINEMENT_SEGMENT_END = 17, |
---|
74 | FILM_GRAIN_CHARACTERISTICS = 19, |
---|
75 | POST_FILTER_HINT = 22, |
---|
76 | TONE_MAPPING_INFO = 23, |
---|
77 | FRAME_PACKING = 45, |
---|
78 | DISPLAY_ORIENTATION = 47, |
---|
79 | GREEN_METADATA = 56, |
---|
80 | SOP_DESCRIPTION = 128, |
---|
81 | ACTIVE_PARAMETER_SETS = 129, |
---|
82 | DECODING_UNIT_INFO = 130, |
---|
83 | TEMPORAL_LEVEL0_INDEX = 131, |
---|
84 | DECODED_PICTURE_HASH = 132, |
---|
85 | SCALABLE_NESTING = 133, |
---|
86 | REGION_REFRESH_INFO = 134, |
---|
87 | NO_DISPLAY = 135, |
---|
88 | TIME_CODE = 136, |
---|
89 | MASTERING_DISPLAY_COLOUR_VOLUME = 137, |
---|
90 | SEGM_RECT_FRAME_PACKING = 138, |
---|
91 | TEMP_MOTION_CONSTRAINED_TILE_SETS = 139, |
---|
92 | CHROMA_RESAMPLING_FILTER_HINT = 140, |
---|
93 | KNEE_FUNCTION_INFO = 141, |
---|
94 | COLOUR_REMAPPING_INFO = 142, |
---|
95 | #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI |
---|
96 | ALTERNATIVE_TRANSFER_CHARACTERISTICS = 182, |
---|
97 | #endif |
---|
98 | #if LAYERS_NOT_PRESENT_SEI |
---|
99 | LAYERS_NOT_PRESENT = 160, |
---|
100 | #endif |
---|
101 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
102 | INTER_LAYER_CONSTRAINED_TILE_SETS = 161, |
---|
103 | #endif |
---|
104 | #if O0164_MULTI_LAYER_HRD |
---|
105 | BSP_NESTING = 162, |
---|
106 | BSP_INITIAL_ARRIVAL_TIME = 163, |
---|
107 | #endif |
---|
108 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
109 | SUB_BITSTREAM_PROPERTY = 164, |
---|
110 | #endif |
---|
111 | #if P0123_ALPHA_CHANNEL_SEI |
---|
112 | ALPHA_CHANNEL_INFO = 165, |
---|
113 | #endif |
---|
114 | #if Q0096_OVERLAY_SEI |
---|
115 | OVERLAY_INFO = 166, |
---|
116 | #endif |
---|
117 | #if Q0189_TMVP_CONSTRAINTS |
---|
118 | TMVP_CONSTRAINTS = 167, |
---|
119 | #endif |
---|
120 | #if Q0247_FRAME_FIELD_INFO |
---|
121 | FRAME_FIELD_INFO = 168, |
---|
122 | #endif |
---|
123 | }; |
---|
124 | |
---|
125 | SEI() {} |
---|
126 | virtual ~SEI() {} |
---|
127 | |
---|
128 | static const TChar *getSEIMessageString(SEI::PayloadType payloadType); |
---|
129 | |
---|
130 | virtual PayloadType payloadType() const = 0; |
---|
131 | }; |
---|
132 | |
---|
133 | static const UInt ISO_IEC_11578_LEN=16; |
---|
134 | |
---|
135 | class SEIuserDataUnregistered : public SEI |
---|
136 | { |
---|
137 | public: |
---|
138 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
139 | |
---|
140 | SEIuserDataUnregistered() |
---|
141 | : userData(0) |
---|
142 | {} |
---|
143 | |
---|
144 | virtual ~SEIuserDataUnregistered() |
---|
145 | { |
---|
146 | delete userData; |
---|
147 | } |
---|
148 | |
---|
149 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
150 | UInt userDataLength; |
---|
151 | UChar *userData; |
---|
152 | }; |
---|
153 | |
---|
154 | class SEIDecodedPictureHash : public SEI |
---|
155 | { |
---|
156 | public: |
---|
157 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
158 | |
---|
159 | SEIDecodedPictureHash() {} |
---|
160 | virtual ~SEIDecodedPictureHash() {} |
---|
161 | |
---|
162 | HashType method; |
---|
163 | |
---|
164 | TComPictureHash m_pictureHash; |
---|
165 | }; |
---|
166 | |
---|
167 | class SEIActiveParameterSets : public SEI |
---|
168 | { |
---|
169 | public: |
---|
170 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
171 | |
---|
172 | SEIActiveParameterSets() |
---|
173 | : activeVPSId (0) |
---|
174 | , m_selfContainedCvsFlag (false) |
---|
175 | , m_noParameterSetUpdateFlag (false) |
---|
176 | , numSpsIdsMinus1 (0) |
---|
177 | {} |
---|
178 | virtual ~SEIActiveParameterSets() {} |
---|
179 | |
---|
180 | Int activeVPSId; |
---|
181 | Bool m_selfContainedCvsFlag; |
---|
182 | Bool m_noParameterSetUpdateFlag; |
---|
183 | Int numSpsIdsMinus1; |
---|
184 | std::vector<Int> activeSeqParameterSetId; |
---|
185 | #if R0247_SEI_ACTIVE |
---|
186 | std::vector<Int> layerSpsIdx; |
---|
187 | #endif |
---|
188 | }; |
---|
189 | |
---|
190 | class SEIBufferingPeriod : public SEI |
---|
191 | { |
---|
192 | public: |
---|
193 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
194 | void copyTo (SEIBufferingPeriod& target); |
---|
195 | |
---|
196 | SEIBufferingPeriod() |
---|
197 | : m_bpSeqParameterSetId (0) |
---|
198 | , m_rapCpbParamsPresentFlag (false) |
---|
199 | , m_cpbDelayOffset (0) |
---|
200 | , m_dpbDelayOffset (0) |
---|
201 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
202 | , m_useAltCpbParamsFlagPresent(false) |
---|
203 | , m_useAltCpbParamsFlag (false) |
---|
204 | #endif |
---|
205 | { |
---|
206 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
207 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
208 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
209 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
210 | } |
---|
211 | virtual ~SEIBufferingPeriod() {} |
---|
212 | |
---|
213 | UInt m_bpSeqParameterSetId; |
---|
214 | Bool m_rapCpbParamsPresentFlag; |
---|
215 | UInt m_cpbDelayOffset; |
---|
216 | UInt m_dpbDelayOffset; |
---|
217 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
218 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
219 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
220 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
221 | Bool m_concatenationFlag; |
---|
222 | UInt m_auCpbRemovalDelayDelta; |
---|
223 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
224 | Bool m_useAltCpbParamsFlagPresent; |
---|
225 | Bool m_useAltCpbParamsFlag; |
---|
226 | #endif |
---|
227 | }; |
---|
228 | class SEIPictureTiming : public SEI |
---|
229 | { |
---|
230 | public: |
---|
231 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
232 | void copyTo (SEIPictureTiming& target); |
---|
233 | |
---|
234 | SEIPictureTiming() |
---|
235 | : m_picStruct (0) |
---|
236 | , m_sourceScanType (0) |
---|
237 | , m_duplicateFlag (false) |
---|
238 | , m_picDpbOutputDuDelay (0) |
---|
239 | {} |
---|
240 | virtual ~SEIPictureTiming() |
---|
241 | { |
---|
242 | } |
---|
243 | |
---|
244 | UInt m_picStruct; |
---|
245 | UInt m_sourceScanType; |
---|
246 | Bool m_duplicateFlag; |
---|
247 | |
---|
248 | UInt m_auCpbRemovalDelay; |
---|
249 | UInt m_picDpbOutputDelay; |
---|
250 | UInt m_picDpbOutputDuDelay; |
---|
251 | UInt m_numDecodingUnitsMinus1; |
---|
252 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
253 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
254 | std::vector<UInt> m_numNalusInDuMinus1; |
---|
255 | std::vector<UInt> m_duCpbRemovalDelayMinus1; |
---|
256 | }; |
---|
257 | |
---|
258 | class SEIDecodingUnitInfo : public SEI |
---|
259 | { |
---|
260 | public: |
---|
261 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
262 | |
---|
263 | SEIDecodingUnitInfo() |
---|
264 | : m_decodingUnitIdx(0) |
---|
265 | , m_duSptCpbRemovalDelay(0) |
---|
266 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
267 | , m_picSptDpbOutputDuDelay(0) |
---|
268 | {} |
---|
269 | virtual ~SEIDecodingUnitInfo() {} |
---|
270 | Int m_decodingUnitIdx; |
---|
271 | Int m_duSptCpbRemovalDelay; |
---|
272 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
273 | Int m_picSptDpbOutputDuDelay; |
---|
274 | }; |
---|
275 | |
---|
276 | class SEIRecoveryPoint : public SEI |
---|
277 | { |
---|
278 | public: |
---|
279 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
280 | |
---|
281 | SEIRecoveryPoint() {} |
---|
282 | virtual ~SEIRecoveryPoint() {} |
---|
283 | |
---|
284 | Int m_recoveryPocCnt; |
---|
285 | Bool m_exactMatchingFlag; |
---|
286 | Bool m_brokenLinkFlag; |
---|
287 | }; |
---|
288 | |
---|
289 | class SEIFramePacking : public SEI |
---|
290 | { |
---|
291 | public: |
---|
292 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
293 | |
---|
294 | SEIFramePacking() {} |
---|
295 | virtual ~SEIFramePacking() {} |
---|
296 | |
---|
297 | Int m_arrangementId; |
---|
298 | Bool m_arrangementCancelFlag; |
---|
299 | Int m_arrangementType; |
---|
300 | Bool m_quincunxSamplingFlag; |
---|
301 | Int m_contentInterpretationType; |
---|
302 | Bool m_spatialFlippingFlag; |
---|
303 | Bool m_frame0FlippedFlag; |
---|
304 | Bool m_fieldViewsFlag; |
---|
305 | Bool m_currentFrameIsFrame0Flag; |
---|
306 | Bool m_frame0SelfContainedFlag; |
---|
307 | Bool m_frame1SelfContainedFlag; |
---|
308 | Int m_frame0GridPositionX; |
---|
309 | Int m_frame0GridPositionY; |
---|
310 | Int m_frame1GridPositionX; |
---|
311 | Int m_frame1GridPositionY; |
---|
312 | Int m_arrangementReservedByte; |
---|
313 | Bool m_arrangementPersistenceFlag; |
---|
314 | Bool m_upsampledAspectRatio; |
---|
315 | }; |
---|
316 | |
---|
317 | class SEISegmentedRectFramePacking : public SEI |
---|
318 | { |
---|
319 | public: |
---|
320 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
321 | |
---|
322 | SEISegmentedRectFramePacking() {} |
---|
323 | virtual ~SEISegmentedRectFramePacking() {} |
---|
324 | |
---|
325 | Bool m_arrangementCancelFlag; |
---|
326 | Int m_contentInterpretationType; |
---|
327 | Bool m_arrangementPersistenceFlag; |
---|
328 | }; |
---|
329 | |
---|
330 | class SEIDisplayOrientation : public SEI |
---|
331 | { |
---|
332 | public: |
---|
333 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
334 | |
---|
335 | SEIDisplayOrientation() |
---|
336 | : cancelFlag(true) |
---|
337 | , persistenceFlag(0) |
---|
338 | , extensionFlag(false) |
---|
339 | {} |
---|
340 | virtual ~SEIDisplayOrientation() {} |
---|
341 | |
---|
342 | Bool cancelFlag; |
---|
343 | Bool horFlip; |
---|
344 | Bool verFlip; |
---|
345 | |
---|
346 | UInt anticlockwiseRotation; |
---|
347 | Bool persistenceFlag; |
---|
348 | Bool extensionFlag; |
---|
349 | }; |
---|
350 | |
---|
351 | class SEITemporalLevel0Index : public SEI |
---|
352 | { |
---|
353 | public: |
---|
354 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
355 | |
---|
356 | SEITemporalLevel0Index() |
---|
357 | : tl0Idx(0) |
---|
358 | , rapIdx(0) |
---|
359 | {} |
---|
360 | virtual ~SEITemporalLevel0Index() {} |
---|
361 | |
---|
362 | UInt tl0Idx; |
---|
363 | UInt rapIdx; |
---|
364 | }; |
---|
365 | |
---|
366 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
367 | { |
---|
368 | public: |
---|
369 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
370 | |
---|
371 | SEIGradualDecodingRefreshInfo() |
---|
372 | : m_gdrForegroundFlag(0) |
---|
373 | {} |
---|
374 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
375 | |
---|
376 | Bool m_gdrForegroundFlag; |
---|
377 | }; |
---|
378 | |
---|
379 | class SEINoDisplay : public SEI |
---|
380 | { |
---|
381 | public: |
---|
382 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
383 | |
---|
384 | SEINoDisplay() |
---|
385 | : m_noDisplay(false) |
---|
386 | {} |
---|
387 | virtual ~SEINoDisplay() {} |
---|
388 | |
---|
389 | Bool m_noDisplay; |
---|
390 | }; |
---|
391 | |
---|
392 | class SEISOPDescription : public SEI |
---|
393 | { |
---|
394 | public: |
---|
395 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
396 | |
---|
397 | SEISOPDescription() {} |
---|
398 | virtual ~SEISOPDescription() {} |
---|
399 | |
---|
400 | UInt m_sopSeqParameterSetId; |
---|
401 | UInt m_numPicsInSopMinus1; |
---|
402 | |
---|
403 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
404 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
405 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
406 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
407 | }; |
---|
408 | |
---|
409 | class SEIToneMappingInfo : public SEI |
---|
410 | { |
---|
411 | public: |
---|
412 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
413 | SEIToneMappingInfo() {} |
---|
414 | virtual ~SEIToneMappingInfo() {} |
---|
415 | |
---|
416 | Int m_toneMapId; |
---|
417 | Bool m_toneMapCancelFlag; |
---|
418 | Bool m_toneMapPersistenceFlag; |
---|
419 | Int m_codedDataBitDepth; |
---|
420 | Int m_targetBitDepth; |
---|
421 | Int m_modelId; |
---|
422 | Int m_minValue; |
---|
423 | Int m_maxValue; |
---|
424 | Int m_sigmoidMidpoint; |
---|
425 | Int m_sigmoidWidth; |
---|
426 | std::vector<Int> m_startOfCodedInterval; |
---|
427 | Int m_numPivots; |
---|
428 | std::vector<Int> m_codedPivotValue; |
---|
429 | std::vector<Int> m_targetPivotValue; |
---|
430 | Int m_cameraIsoSpeedIdc; |
---|
431 | Int m_cameraIsoSpeedValue; |
---|
432 | Int m_exposureIndexIdc; |
---|
433 | Int m_exposureIndexValue; |
---|
434 | Bool m_exposureCompensationValueSignFlag; |
---|
435 | Int m_exposureCompensationValueNumerator; |
---|
436 | Int m_exposureCompensationValueDenomIdc; |
---|
437 | Int m_refScreenLuminanceWhite; |
---|
438 | Int m_extendedRangeWhiteLevel; |
---|
439 | Int m_nominalBlackLevelLumaCodeValue; |
---|
440 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
441 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
442 | }; |
---|
443 | |
---|
444 | class SEIKneeFunctionInfo : public SEI |
---|
445 | { |
---|
446 | public: |
---|
447 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
448 | SEIKneeFunctionInfo() {} |
---|
449 | virtual ~SEIKneeFunctionInfo() {} |
---|
450 | |
---|
451 | Int m_kneeId; |
---|
452 | Bool m_kneeCancelFlag; |
---|
453 | Bool m_kneePersistenceFlag; |
---|
454 | Int m_kneeInputDrange; |
---|
455 | Int m_kneeInputDispLuminance; |
---|
456 | Int m_kneeOutputDrange; |
---|
457 | Int m_kneeOutputDispLuminance; |
---|
458 | Int m_kneeNumKneePointsMinus1; |
---|
459 | std::vector<Int> m_kneeInputKneePoint; |
---|
460 | std::vector<Int> m_kneeOutputKneePoint; |
---|
461 | }; |
---|
462 | |
---|
463 | class SEIColourRemappingInfo : public SEI |
---|
464 | { |
---|
465 | public: |
---|
466 | |
---|
467 | struct CRIlut |
---|
468 | { |
---|
469 | Int codedValue; |
---|
470 | Int targetValue; |
---|
471 | bool operator < (const CRIlut& a) const |
---|
472 | { |
---|
473 | return codedValue < a.codedValue; |
---|
474 | } |
---|
475 | }; |
---|
476 | |
---|
477 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
478 | SEIColourRemappingInfo() {} |
---|
479 | ~SEIColourRemappingInfo() {} |
---|
480 | |
---|
481 | Void copyFrom( const SEIColourRemappingInfo &seiCriInput) |
---|
482 | { |
---|
483 | (*this) = seiCriInput; |
---|
484 | } |
---|
485 | |
---|
486 | UInt m_colourRemapId; |
---|
487 | Bool m_colourRemapCancelFlag; |
---|
488 | Bool m_colourRemapPersistenceFlag; |
---|
489 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
490 | Bool m_colourRemapFullRangeFlag; |
---|
491 | Int m_colourRemapPrimaries; |
---|
492 | Int m_colourRemapTransferFunction; |
---|
493 | Int m_colourRemapMatrixCoefficients; |
---|
494 | Int m_colourRemapInputBitDepth; |
---|
495 | Int m_colourRemapBitDepth; |
---|
496 | Int m_preLutNumValMinus1[3]; |
---|
497 | std::vector<CRIlut> m_preLut[3]; |
---|
498 | Bool m_colourRemapMatrixPresentFlag; |
---|
499 | Int m_log2MatrixDenom; |
---|
500 | Int m_colourRemapCoeffs[3][3]; |
---|
501 | Int m_postLutNumValMinus1[3]; |
---|
502 | std::vector<CRIlut> m_postLut[3]; |
---|
503 | }; |
---|
504 | |
---|
505 | class SEIChromaResamplingFilterHint : public SEI |
---|
506 | { |
---|
507 | public: |
---|
508 | PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;} |
---|
509 | SEIChromaResamplingFilterHint() {} |
---|
510 | virtual ~SEIChromaResamplingFilterHint() {} |
---|
511 | |
---|
512 | Int m_verChromaFilterIdc; |
---|
513 | Int m_horChromaFilterIdc; |
---|
514 | Bool m_verFilteringFieldProcessingFlag; |
---|
515 | Int m_targetFormatIdc; |
---|
516 | Bool m_perfectReconstructionFlag; |
---|
517 | std::vector<std::vector<Int> > m_verFilterCoeff; |
---|
518 | std::vector<std::vector<Int> > m_horFilterCoeff; |
---|
519 | }; |
---|
520 | |
---|
521 | class SEIMasteringDisplayColourVolume : public SEI |
---|
522 | { |
---|
523 | public: |
---|
524 | PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; } |
---|
525 | SEIMasteringDisplayColourVolume() {} |
---|
526 | virtual ~SEIMasteringDisplayColourVolume(){} |
---|
527 | |
---|
528 | TComSEIMasteringDisplay values; |
---|
529 | }; |
---|
530 | |
---|
531 | typedef std::list<SEI*> SEIMessages; |
---|
532 | |
---|
533 | /// output a selection of SEI messages by payload type. Ownership stays in original message list. |
---|
534 | SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
535 | |
---|
536 | /// remove a selection of SEI messages by payload type from the original list and return them in a new list. |
---|
537 | SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); |
---|
538 | |
---|
539 | /// delete list of SEI messages (freeing the referenced objects) |
---|
540 | Void deleteSEIs (SEIMessages &seiList); |
---|
541 | |
---|
542 | class SEIScalableNesting : public SEI |
---|
543 | { |
---|
544 | public: |
---|
545 | PayloadType payloadType() const { return SCALABLE_NESTING; } |
---|
546 | |
---|
547 | SEIScalableNesting() {} |
---|
548 | |
---|
549 | virtual ~SEIScalableNesting() |
---|
550 | { |
---|
551 | deleteSEIs(m_nestedSEIs); |
---|
552 | } |
---|
553 | |
---|
554 | Bool m_bitStreamSubsetFlag; |
---|
555 | Bool m_nestingOpFlag; |
---|
556 | Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 |
---|
557 | UInt m_nestingNumOpsMinus1; // -"- |
---|
558 | UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- |
---|
559 | UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- |
---|
560 | |
---|
561 | Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 |
---|
562 | UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
563 | UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
564 | 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 |
---|
565 | |
---|
566 | SEIMessages m_nestedSEIs; |
---|
567 | }; |
---|
568 | |
---|
569 | class SEITimeCode : public SEI |
---|
570 | { |
---|
571 | public: |
---|
572 | PayloadType payloadType() const { return TIME_CODE; } |
---|
573 | SEITimeCode() {} |
---|
574 | virtual ~SEITimeCode(){} |
---|
575 | |
---|
576 | UInt numClockTs; |
---|
577 | TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS]; |
---|
578 | }; |
---|
579 | |
---|
580 | //definition according to P1005_v1; |
---|
581 | class SEITempMotionConstrainedTileSets: public SEI |
---|
582 | { |
---|
583 | struct TileSetData |
---|
584 | { |
---|
585 | protected: |
---|
586 | std::vector<Int> m_top_left_tile_index; //[tileSetIdx][tileIdx]; |
---|
587 | std::vector<Int> m_bottom_right_tile_index; |
---|
588 | |
---|
589 | public: |
---|
590 | Int m_mcts_id; |
---|
591 | Bool m_display_tile_set_flag; |
---|
592 | Int m_num_tile_rects_in_set; //_minus1; |
---|
593 | Bool m_exact_sample_value_match_flag; |
---|
594 | Bool m_mcts_tier_level_idc_present_flag; |
---|
595 | Bool m_mcts_tier_flag; |
---|
596 | Int m_mcts_level_idc; |
---|
597 | |
---|
598 | Void setNumberOfTileRects(const Int number) |
---|
599 | { |
---|
600 | m_top_left_tile_index .resize(number); |
---|
601 | m_bottom_right_tile_index.resize(number); |
---|
602 | } |
---|
603 | |
---|
604 | Int getNumberOfTileRects() const |
---|
605 | { |
---|
606 | assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size()); |
---|
607 | return Int(m_top_left_tile_index.size()); |
---|
608 | } |
---|
609 | |
---|
610 | Int &topLeftTileIndex (const Int tileRectIndex) { return m_top_left_tile_index [tileRectIndex]; } |
---|
611 | Int &bottomRightTileIndex(const Int tileRectIndex) { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
612 | const Int &topLeftTileIndex (const Int tileRectIndex) const { return m_top_left_tile_index [tileRectIndex]; } |
---|
613 | const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
614 | }; |
---|
615 | |
---|
616 | protected: |
---|
617 | std::vector<TileSetData> m_tile_set_data; |
---|
618 | |
---|
619 | public: |
---|
620 | |
---|
621 | Bool m_mc_all_tiles_exact_sample_value_match_flag; |
---|
622 | Bool m_each_tile_one_tile_set_flag; |
---|
623 | Bool m_limited_tile_set_display_flag; |
---|
624 | Bool m_max_mcs_tier_level_idc_present_flag; |
---|
625 | Bool m_max_mcts_tier_flag; |
---|
626 | Int m_max_mcts_level_idc; |
---|
627 | |
---|
628 | PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; } |
---|
629 | |
---|
630 | Void setNumberOfTileSets(const Int number) { m_tile_set_data.resize(number); } |
---|
631 | Int getNumberOfTileSets() const { return Int(m_tile_set_data.size()); } |
---|
632 | |
---|
633 | TileSetData &tileSetData (const Int index) { return m_tile_set_data[index]; } |
---|
634 | const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; } |
---|
635 | |
---|
636 | }; |
---|
637 | |
---|
638 | #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI |
---|
639 | class SEIAlternativeTransferCharacteristics : public SEI |
---|
640 | { |
---|
641 | public: |
---|
642 | PayloadType payloadType() const { return ALTERNATIVE_TRANSFER_CHARACTERISTICS; } |
---|
643 | |
---|
644 | SEIAlternativeTransferCharacteristics() : m_preferredTransferCharacteristics(18) |
---|
645 | { } |
---|
646 | |
---|
647 | virtual ~SEIAlternativeTransferCharacteristics() {} |
---|
648 | |
---|
649 | UInt m_preferredTransferCharacteristics; |
---|
650 | }; |
---|
651 | #endif |
---|
652 | |
---|
653 | class SEIGreenMetadataInfo : public SEI |
---|
654 | { |
---|
655 | public: |
---|
656 | PayloadType payloadType() const { return GREEN_METADATA; } |
---|
657 | SEIGreenMetadataInfo() {} |
---|
658 | |
---|
659 | virtual ~SEIGreenMetadataInfo() {} |
---|
660 | |
---|
661 | UInt m_greenMetadataType; |
---|
662 | UInt m_xsdMetricType; |
---|
663 | UInt m_xsdMetricValue; |
---|
664 | }; |
---|
665 | |
---|
666 | #if P0123_ALPHA_CHANNEL_SEI |
---|
667 | class SEIAlphaChannelInfo : public SEI |
---|
668 | { |
---|
669 | public: |
---|
670 | PayloadType payloadType() const { return ALPHA_CHANNEL_INFO; } |
---|
671 | SEIAlphaChannelInfo() {} |
---|
672 | virtual ~SEIAlphaChannelInfo() {} |
---|
673 | Bool m_alphaChannelCancelFlag; |
---|
674 | UInt m_alphaChannelUseIdc; |
---|
675 | UInt m_alphaChannelBitDepthMinus8; |
---|
676 | UInt m_alphaTransparentValue; |
---|
677 | UInt m_alphaOpaqueValue; |
---|
678 | Bool m_alphaChannelIncrFlag; |
---|
679 | Bool m_alphaChannelClipFlag; |
---|
680 | Bool m_alphaChannelClipTypeFlag; |
---|
681 | }; |
---|
682 | #endif |
---|
683 | |
---|
684 | #if Q0096_OVERLAY_SEI |
---|
685 | class SEIOverlayInfo : public SEI |
---|
686 | { |
---|
687 | public: |
---|
688 | PayloadType payloadType() const { return OVERLAY_INFO; } |
---|
689 | SEIOverlayInfo() |
---|
690 | : m_numOverlaysMinus1(-1) |
---|
691 | {} |
---|
692 | |
---|
693 | virtual ~SEIOverlayInfo() |
---|
694 | { |
---|
695 | for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++) |
---|
696 | { |
---|
697 | delete [] m_overlayLanguage[i]; |
---|
698 | delete [] m_overlayName[i]; |
---|
699 | for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++) |
---|
700 | { |
---|
701 | delete [] m_overlayElementName[i][j]; |
---|
702 | } |
---|
703 | } |
---|
704 | } |
---|
705 | |
---|
706 | Bool m_overlayInfoCancelFlag; |
---|
707 | UInt m_overlayContentAuxIdMinus128; |
---|
708 | UInt m_overlayLabelAuxIdMinus128; |
---|
709 | UInt m_overlayAlphaAuxIdMinus128; |
---|
710 | UInt m_overlayElementLabelValueLengthMinus8; |
---|
711 | UInt m_numOverlaysMinus1; |
---|
712 | std::vector<UInt> m_overlayIdx; |
---|
713 | std::vector<Bool> m_languageOverlayPresentFlag; |
---|
714 | std::vector<UInt> m_overlayContentLayerId; |
---|
715 | std::vector<Bool> m_overlayLabelPresentFlag; |
---|
716 | std::vector<UInt> m_overlayLabelLayerId; |
---|
717 | std::vector<Bool> m_overlayAlphaPresentFlag; |
---|
718 | std::vector<UInt> m_overlayAlphaLayerId; |
---|
719 | std::vector<UInt> m_numOverlayElementsMinus1; |
---|
720 | std::vector< std::vector<UInt> > m_overlayElementLabelMin; |
---|
721 | std::vector< std::vector<UInt> > m_overlayElementLabelMax; |
---|
722 | std::vector<UChar*> m_overlayLanguage; |
---|
723 | std::vector<UInt> m_overlayLanguageLength; |
---|
724 | std::vector<UChar*> m_overlayName; |
---|
725 | std::vector<UInt> m_overlayNameLength; |
---|
726 | std::vector< std::vector<UChar*> > m_overlayElementName; |
---|
727 | std::vector< std::vector<UInt> > m_overlayElementNameLength; |
---|
728 | Bool m_overlayInfoPersistenceFlag; |
---|
729 | }; |
---|
730 | #endif |
---|
731 | |
---|
732 | #if LAYERS_NOT_PRESENT_SEI |
---|
733 | class SEILayersNotPresent : public SEI |
---|
734 | { |
---|
735 | public: |
---|
736 | PayloadType payloadType() const { return LAYERS_NOT_PRESENT; } |
---|
737 | |
---|
738 | SEILayersNotPresent() {} |
---|
739 | virtual ~SEILayersNotPresent() {} |
---|
740 | |
---|
741 | UInt m_activeVpsId; |
---|
742 | UInt m_vpsMaxLayers; |
---|
743 | Bool m_layerNotPresentFlag[MAX_LAYERS]; |
---|
744 | }; |
---|
745 | #endif |
---|
746 | |
---|
747 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
748 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
749 | { |
---|
750 | public: |
---|
751 | PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
752 | |
---|
753 | SEIInterLayerConstrainedTileSets() {} |
---|
754 | virtual ~SEIInterLayerConstrainedTileSets() {} |
---|
755 | |
---|
756 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
757 | Bool m_ilOneTilePerTileSetFlag; |
---|
758 | UInt m_ilNumSetsInMessageMinus1; |
---|
759 | Bool m_skippedTileSetPresentFlag; |
---|
760 | UInt m_ilctsId[256]; |
---|
761 | UInt m_ilNumTileRectsInSetMinus1[256]; |
---|
762 | UInt m_ilTopLeftTileIndex[256][440]; |
---|
763 | UInt m_ilBottomRightTileIndex[256][440]; |
---|
764 | UInt m_ilcIdc[256]; |
---|
765 | Bool m_ilExactSampleValueMatchFlag[256]; |
---|
766 | UInt m_allTilesIlcIdc; |
---|
767 | }; |
---|
768 | #endif |
---|
769 | |
---|
770 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
771 | class SEISubBitstreamProperty : public SEI |
---|
772 | { |
---|
773 | public: |
---|
774 | PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; } |
---|
775 | |
---|
776 | SEISubBitstreamProperty(); |
---|
777 | virtual ~SEISubBitstreamProperty() {} |
---|
778 | |
---|
779 | Int m_activeVpsId; |
---|
780 | Int m_numAdditionalSubStreams; |
---|
781 | Int m_subBitstreamMode [MAX_SUB_STREAMS]; |
---|
782 | Int m_outputLayerSetIdxToVps [MAX_SUB_STREAMS]; |
---|
783 | Int m_highestSublayerId [MAX_SUB_STREAMS]; |
---|
784 | Int m_avgBitRate [MAX_SUB_STREAMS]; |
---|
785 | Int m_maxBitRate [MAX_SUB_STREAMS]; |
---|
786 | }; |
---|
787 | #endif |
---|
788 | |
---|
789 | #if Q0189_TMVP_CONSTRAINTS |
---|
790 | class SEITMVPConstrains : public SEI |
---|
791 | { |
---|
792 | public: |
---|
793 | PayloadType payloadType() const { return TMVP_CONSTRAINTS; } |
---|
794 | |
---|
795 | SEITMVPConstrains() |
---|
796 | : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) |
---|
797 | {} |
---|
798 | |
---|
799 | virtual ~SEITMVPConstrains() |
---|
800 | { |
---|
801 | } |
---|
802 | |
---|
803 | UInt prev_pics_not_used_flag; |
---|
804 | UInt no_intra_layer_col_pic_flag; |
---|
805 | }; |
---|
806 | #endif |
---|
807 | |
---|
808 | #if Q0247_FRAME_FIELD_INFO |
---|
809 | class SEIFrameFieldInfo: public SEI |
---|
810 | { |
---|
811 | public: |
---|
812 | PayloadType payloadType() const { return FRAME_FIELD_INFO; } |
---|
813 | |
---|
814 | SEIFrameFieldInfo() |
---|
815 | : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) |
---|
816 | {} |
---|
817 | |
---|
818 | virtual ~SEIFrameFieldInfo() |
---|
819 | { |
---|
820 | } |
---|
821 | |
---|
822 | UInt m_ffinfo_picStruct; |
---|
823 | UInt m_ffinfo_sourceScanType; |
---|
824 | Bool m_ffinfo_duplicateFlag; |
---|
825 | }; |
---|
826 | #endif |
---|
827 | |
---|
828 | #if O0164_MULTI_LAYER_HRD |
---|
829 | class SEIBspNesting : public SEI |
---|
830 | { |
---|
831 | public: |
---|
832 | PayloadType payloadType() const { return BSP_NESTING; } |
---|
833 | |
---|
834 | SEIBspNesting() |
---|
835 | : m_callerOwnsSEIs(false) |
---|
836 | {} |
---|
837 | virtual ~SEIBspNesting() |
---|
838 | { |
---|
839 | if (!m_callerOwnsSEIs) |
---|
840 | { |
---|
841 | deleteSEIs(m_nestedSEIs); |
---|
842 | } |
---|
843 | } |
---|
844 | |
---|
845 | Int m_bspIdx; |
---|
846 | Bool m_callerOwnsSEIs; |
---|
847 | SEIMessages m_nestedSEIs; |
---|
848 | Int m_seiPartitioningSchemeIdx; |
---|
849 | Int m_seiOlsIdx; |
---|
850 | }; |
---|
851 | |
---|
852 | class SEIBspInitialArrivalTime : public SEI |
---|
853 | { |
---|
854 | public: |
---|
855 | PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
856 | |
---|
857 | SEIBspInitialArrivalTime () {} |
---|
858 | virtual ~SEIBspInitialArrivalTime () {} |
---|
859 | |
---|
860 | UInt m_nalInitialArrivalDelay[256]; |
---|
861 | UInt m_vclInitialArrivalDelay[256]; |
---|
862 | }; |
---|
863 | #endif |
---|
864 | |
---|
865 | #endif |
---|
866 | //! \} |
---|