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 | #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 | SOP_DESCRIPTION = 128, |
---|
80 | ACTIVE_PARAMETER_SETS = 129, |
---|
81 | DECODING_UNIT_INFO = 130, |
---|
82 | TEMPORAL_LEVEL0_INDEX = 131, |
---|
83 | DECODED_PICTURE_HASH = 132, |
---|
84 | SCALABLE_NESTING = 133, |
---|
85 | REGION_REFRESH_INFO = 134, |
---|
86 | NO_DISPLAY = 135, |
---|
87 | TIME_CODE = 136, |
---|
88 | MASTERING_DISPLAY_COLOUR_VOLUME = 137, |
---|
89 | SEGM_RECT_FRAME_PACKING = 138, |
---|
90 | TEMP_MOTION_CONSTRAINED_TILE_SETS = 139, |
---|
91 | CHROMA_RESAMPLING_FILTER_HINT = 140, |
---|
92 | KNEE_FUNCTION_INFO = 141, |
---|
93 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
94 | COLOUR_REMAPPING_INFO = 142, |
---|
95 | #endif |
---|
96 | #if LAYERS_NOT_PRESENT_SEI |
---|
97 | LAYERS_NOT_PRESENT = 160, |
---|
98 | #endif |
---|
99 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
100 | INTER_LAYER_CONSTRAINED_TILE_SETS = 161, |
---|
101 | #endif |
---|
102 | #if O0164_MULTI_LAYER_HRD |
---|
103 | BSP_NESTING = 162, |
---|
104 | BSP_INITIAL_ARRIVAL_TIME = 163, |
---|
105 | #endif |
---|
106 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
107 | SUB_BITSTREAM_PROPERTY = 164, |
---|
108 | #endif |
---|
109 | #if P0123_ALPHA_CHANNEL_SEI |
---|
110 | ALPHA_CHANNEL_INFO = 165, |
---|
111 | #endif |
---|
112 | #if Q0096_OVERLAY_SEI |
---|
113 | OVERLAY_INFO = 166, |
---|
114 | #endif |
---|
115 | #if Q0189_TMVP_CONSTRAINTS |
---|
116 | TMVP_CONSTRAINTS = 167, |
---|
117 | #endif |
---|
118 | #if Q0247_FRAME_FIELD_INFO |
---|
119 | FRAME_FIELD_INFO = 168, |
---|
120 | #endif |
---|
121 | }; |
---|
122 | |
---|
123 | SEI() {} |
---|
124 | virtual ~SEI() {} |
---|
125 | |
---|
126 | static const TChar *getSEIMessageString(SEI::PayloadType payloadType); |
---|
127 | |
---|
128 | virtual PayloadType payloadType() const = 0; |
---|
129 | }; |
---|
130 | |
---|
131 | static const UInt ISO_IEC_11578_LEN=16; |
---|
132 | |
---|
133 | class SEIuserDataUnregistered : public SEI |
---|
134 | { |
---|
135 | public: |
---|
136 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
137 | |
---|
138 | SEIuserDataUnregistered() |
---|
139 | : userData(0) |
---|
140 | {} |
---|
141 | |
---|
142 | virtual ~SEIuserDataUnregistered() |
---|
143 | { |
---|
144 | delete userData; |
---|
145 | } |
---|
146 | |
---|
147 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
148 | UInt userDataLength; |
---|
149 | UChar *userData; |
---|
150 | }; |
---|
151 | |
---|
152 | class SEIDecodedPictureHash : public SEI |
---|
153 | { |
---|
154 | public: |
---|
155 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
156 | |
---|
157 | SEIDecodedPictureHash() {} |
---|
158 | virtual ~SEIDecodedPictureHash() {} |
---|
159 | |
---|
160 | HashType method; |
---|
161 | |
---|
162 | TComPictureHash m_pictureHash; |
---|
163 | }; |
---|
164 | |
---|
165 | class SEIActiveParameterSets : public SEI |
---|
166 | { |
---|
167 | public: |
---|
168 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
169 | |
---|
170 | SEIActiveParameterSets() |
---|
171 | : activeVPSId (0) |
---|
172 | , m_selfContainedCvsFlag (false) |
---|
173 | , m_noParameterSetUpdateFlag (false) |
---|
174 | , numSpsIdsMinus1 (0) |
---|
175 | {} |
---|
176 | virtual ~SEIActiveParameterSets() {} |
---|
177 | |
---|
178 | Int activeVPSId; |
---|
179 | Bool m_selfContainedCvsFlag; |
---|
180 | Bool m_noParameterSetUpdateFlag; |
---|
181 | Int numSpsIdsMinus1; |
---|
182 | std::vector<Int> activeSeqParameterSetId; |
---|
183 | #if R0247_SEI_ACTIVE |
---|
184 | std::vector<Int> layerSpsIdx; |
---|
185 | #endif |
---|
186 | }; |
---|
187 | |
---|
188 | class SEIBufferingPeriod : public SEI |
---|
189 | { |
---|
190 | public: |
---|
191 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
192 | void copyTo (SEIBufferingPeriod& target); |
---|
193 | |
---|
194 | SEIBufferingPeriod() |
---|
195 | : m_bpSeqParameterSetId (0) |
---|
196 | , m_rapCpbParamsPresentFlag (false) |
---|
197 | , m_cpbDelayOffset (0) |
---|
198 | , m_dpbDelayOffset (0) |
---|
199 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
200 | , m_useAltCpbParamsFlagPresent(false) |
---|
201 | , m_useAltCpbParamsFlag (false) |
---|
202 | #endif |
---|
203 | { |
---|
204 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
205 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
206 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
207 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
208 | } |
---|
209 | virtual ~SEIBufferingPeriod() {} |
---|
210 | |
---|
211 | UInt m_bpSeqParameterSetId; |
---|
212 | Bool m_rapCpbParamsPresentFlag; |
---|
213 | UInt m_cpbDelayOffset; |
---|
214 | UInt m_dpbDelayOffset; |
---|
215 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
216 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
217 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
218 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
219 | Bool m_concatenationFlag; |
---|
220 | UInt m_auCpbRemovalDelayDelta; |
---|
221 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
222 | Bool m_useAltCpbParamsFlagPresent; |
---|
223 | Bool m_useAltCpbParamsFlag; |
---|
224 | #endif |
---|
225 | }; |
---|
226 | class SEIPictureTiming : public SEI |
---|
227 | { |
---|
228 | public: |
---|
229 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
230 | void copyTo (SEIPictureTiming& target); |
---|
231 | |
---|
232 | SEIPictureTiming() |
---|
233 | : m_picStruct (0) |
---|
234 | , m_sourceScanType (0) |
---|
235 | , m_duplicateFlag (false) |
---|
236 | , m_picDpbOutputDuDelay (0) |
---|
237 | {} |
---|
238 | virtual ~SEIPictureTiming() |
---|
239 | { |
---|
240 | } |
---|
241 | |
---|
242 | UInt m_picStruct; |
---|
243 | UInt m_sourceScanType; |
---|
244 | Bool m_duplicateFlag; |
---|
245 | |
---|
246 | UInt m_auCpbRemovalDelay; |
---|
247 | UInt m_picDpbOutputDelay; |
---|
248 | UInt m_picDpbOutputDuDelay; |
---|
249 | UInt m_numDecodingUnitsMinus1; |
---|
250 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
251 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
252 | std::vector<UInt> m_numNalusInDuMinus1; |
---|
253 | std::vector<UInt> m_duCpbRemovalDelayMinus1; |
---|
254 | }; |
---|
255 | |
---|
256 | class SEIDecodingUnitInfo : public SEI |
---|
257 | { |
---|
258 | public: |
---|
259 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
260 | |
---|
261 | SEIDecodingUnitInfo() |
---|
262 | : m_decodingUnitIdx(0) |
---|
263 | , m_duSptCpbRemovalDelay(0) |
---|
264 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
265 | , m_picSptDpbOutputDuDelay(0) |
---|
266 | {} |
---|
267 | virtual ~SEIDecodingUnitInfo() {} |
---|
268 | Int m_decodingUnitIdx; |
---|
269 | Int m_duSptCpbRemovalDelay; |
---|
270 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
271 | Int m_picSptDpbOutputDuDelay; |
---|
272 | }; |
---|
273 | |
---|
274 | class SEIRecoveryPoint : public SEI |
---|
275 | { |
---|
276 | public: |
---|
277 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
278 | |
---|
279 | SEIRecoveryPoint() {} |
---|
280 | virtual ~SEIRecoveryPoint() {} |
---|
281 | |
---|
282 | Int m_recoveryPocCnt; |
---|
283 | Bool m_exactMatchingFlag; |
---|
284 | Bool m_brokenLinkFlag; |
---|
285 | }; |
---|
286 | |
---|
287 | class SEIFramePacking : public SEI |
---|
288 | { |
---|
289 | public: |
---|
290 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
291 | |
---|
292 | SEIFramePacking() {} |
---|
293 | virtual ~SEIFramePacking() {} |
---|
294 | |
---|
295 | Int m_arrangementId; |
---|
296 | Bool m_arrangementCancelFlag; |
---|
297 | Int m_arrangementType; |
---|
298 | Bool m_quincunxSamplingFlag; |
---|
299 | Int m_contentInterpretationType; |
---|
300 | Bool m_spatialFlippingFlag; |
---|
301 | Bool m_frame0FlippedFlag; |
---|
302 | Bool m_fieldViewsFlag; |
---|
303 | Bool m_currentFrameIsFrame0Flag; |
---|
304 | Bool m_frame0SelfContainedFlag; |
---|
305 | Bool m_frame1SelfContainedFlag; |
---|
306 | Int m_frame0GridPositionX; |
---|
307 | Int m_frame0GridPositionY; |
---|
308 | Int m_frame1GridPositionX; |
---|
309 | Int m_frame1GridPositionY; |
---|
310 | Int m_arrangementReservedByte; |
---|
311 | Bool m_arrangementPersistenceFlag; |
---|
312 | Bool m_upsampledAspectRatio; |
---|
313 | }; |
---|
314 | |
---|
315 | class SEISegmentedRectFramePacking : public SEI |
---|
316 | { |
---|
317 | public: |
---|
318 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
319 | |
---|
320 | SEISegmentedRectFramePacking() {} |
---|
321 | virtual ~SEISegmentedRectFramePacking() {} |
---|
322 | |
---|
323 | Bool m_arrangementCancelFlag; |
---|
324 | Int m_contentInterpretationType; |
---|
325 | Bool m_arrangementPersistenceFlag; |
---|
326 | }; |
---|
327 | |
---|
328 | class SEIDisplayOrientation : public SEI |
---|
329 | { |
---|
330 | public: |
---|
331 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
332 | |
---|
333 | SEIDisplayOrientation() |
---|
334 | : cancelFlag(true) |
---|
335 | , persistenceFlag(0) |
---|
336 | , extensionFlag(false) |
---|
337 | {} |
---|
338 | virtual ~SEIDisplayOrientation() {} |
---|
339 | |
---|
340 | Bool cancelFlag; |
---|
341 | Bool horFlip; |
---|
342 | Bool verFlip; |
---|
343 | |
---|
344 | UInt anticlockwiseRotation; |
---|
345 | Bool persistenceFlag; |
---|
346 | Bool extensionFlag; |
---|
347 | }; |
---|
348 | |
---|
349 | class SEITemporalLevel0Index : public SEI |
---|
350 | { |
---|
351 | public: |
---|
352 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
353 | |
---|
354 | SEITemporalLevel0Index() |
---|
355 | : tl0Idx(0) |
---|
356 | , rapIdx(0) |
---|
357 | {} |
---|
358 | virtual ~SEITemporalLevel0Index() {} |
---|
359 | |
---|
360 | UInt tl0Idx; |
---|
361 | UInt rapIdx; |
---|
362 | }; |
---|
363 | |
---|
364 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
365 | { |
---|
366 | public: |
---|
367 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
368 | |
---|
369 | SEIGradualDecodingRefreshInfo() |
---|
370 | : m_gdrForegroundFlag(0) |
---|
371 | {} |
---|
372 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
373 | |
---|
374 | Bool m_gdrForegroundFlag; |
---|
375 | }; |
---|
376 | |
---|
377 | class SEINoDisplay : public SEI |
---|
378 | { |
---|
379 | public: |
---|
380 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
381 | |
---|
382 | SEINoDisplay() |
---|
383 | : m_noDisplay(false) |
---|
384 | {} |
---|
385 | virtual ~SEINoDisplay() {} |
---|
386 | |
---|
387 | Bool m_noDisplay; |
---|
388 | }; |
---|
389 | |
---|
390 | class SEISOPDescription : public SEI |
---|
391 | { |
---|
392 | public: |
---|
393 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
394 | |
---|
395 | SEISOPDescription() {} |
---|
396 | virtual ~SEISOPDescription() {} |
---|
397 | |
---|
398 | UInt m_sopSeqParameterSetId; |
---|
399 | UInt m_numPicsInSopMinus1; |
---|
400 | |
---|
401 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
402 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
403 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
404 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
405 | }; |
---|
406 | |
---|
407 | class SEIToneMappingInfo : public SEI |
---|
408 | { |
---|
409 | public: |
---|
410 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
411 | SEIToneMappingInfo() {} |
---|
412 | virtual ~SEIToneMappingInfo() {} |
---|
413 | |
---|
414 | Int m_toneMapId; |
---|
415 | Bool m_toneMapCancelFlag; |
---|
416 | Bool m_toneMapPersistenceFlag; |
---|
417 | Int m_codedDataBitDepth; |
---|
418 | Int m_targetBitDepth; |
---|
419 | Int m_modelId; |
---|
420 | Int m_minValue; |
---|
421 | Int m_maxValue; |
---|
422 | Int m_sigmoidMidpoint; |
---|
423 | Int m_sigmoidWidth; |
---|
424 | std::vector<Int> m_startOfCodedInterval; |
---|
425 | Int m_numPivots; |
---|
426 | std::vector<Int> m_codedPivotValue; |
---|
427 | std::vector<Int> m_targetPivotValue; |
---|
428 | Int m_cameraIsoSpeedIdc; |
---|
429 | Int m_cameraIsoSpeedValue; |
---|
430 | Int m_exposureIndexIdc; |
---|
431 | Int m_exposureIndexValue; |
---|
432 | Bool m_exposureCompensationValueSignFlag; |
---|
433 | Int m_exposureCompensationValueNumerator; |
---|
434 | Int m_exposureCompensationValueDenomIdc; |
---|
435 | Int m_refScreenLuminanceWhite; |
---|
436 | Int m_extendedRangeWhiteLevel; |
---|
437 | Int m_nominalBlackLevelLumaCodeValue; |
---|
438 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
439 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
440 | }; |
---|
441 | |
---|
442 | class SEIKneeFunctionInfo : public SEI |
---|
443 | { |
---|
444 | public: |
---|
445 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
446 | SEIKneeFunctionInfo() {} |
---|
447 | virtual ~SEIKneeFunctionInfo() {} |
---|
448 | |
---|
449 | Int m_kneeId; |
---|
450 | Bool m_kneeCancelFlag; |
---|
451 | Bool m_kneePersistenceFlag; |
---|
452 | Int m_kneeInputDrange; |
---|
453 | Int m_kneeInputDispLuminance; |
---|
454 | Int m_kneeOutputDrange; |
---|
455 | Int m_kneeOutputDispLuminance; |
---|
456 | Int m_kneeNumKneePointsMinus1; |
---|
457 | std::vector<Int> m_kneeInputKneePoint; |
---|
458 | std::vector<Int> m_kneeOutputKneePoint; |
---|
459 | }; |
---|
460 | |
---|
461 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
462 | class SEIColourRemappingInfo : public SEI |
---|
463 | { |
---|
464 | public: |
---|
465 | |
---|
466 | struct CRIlut |
---|
467 | { |
---|
468 | Int codedValue; |
---|
469 | Int targetValue; |
---|
470 | bool operator < (const CRIlut& a) const |
---|
471 | { |
---|
472 | return codedValue < a.codedValue; |
---|
473 | } |
---|
474 | }; |
---|
475 | |
---|
476 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
477 | SEIColourRemappingInfo() {} |
---|
478 | ~SEIColourRemappingInfo() {} |
---|
479 | |
---|
480 | Void copyFrom( const SEIColourRemappingInfo &seiCriInput) |
---|
481 | { |
---|
482 | (*this) = seiCriInput; |
---|
483 | } |
---|
484 | |
---|
485 | UInt m_colourRemapId; |
---|
486 | Bool m_colourRemapCancelFlag; |
---|
487 | Bool m_colourRemapPersistenceFlag; |
---|
488 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
489 | Bool m_colourRemapFullRangeFlag; |
---|
490 | Int m_colourRemapPrimaries; |
---|
491 | Int m_colourRemapTransferFunction; |
---|
492 | Int m_colourRemapMatrixCoefficients; |
---|
493 | Int m_colourRemapInputBitDepth; |
---|
494 | Int m_colourRemapBitDepth; |
---|
495 | Int m_preLutNumValMinus1[3]; |
---|
496 | std::vector<CRIlut> m_preLut[3]; |
---|
497 | Bool m_colourRemapMatrixPresentFlag; |
---|
498 | Int m_log2MatrixDenom; |
---|
499 | Int m_colourRemapCoeffs[3][3]; |
---|
500 | Int m_postLutNumValMinus1[3]; |
---|
501 | std::vector<CRIlut> m_postLut[3]; |
---|
502 | }; |
---|
503 | #endif |
---|
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 P0123_ALPHA_CHANNEL_SEI |
---|
639 | class SEIAlphaChannelInfo : public SEI |
---|
640 | { |
---|
641 | public: |
---|
642 | PayloadType payloadType() const { return ALPHA_CHANNEL_INFO; } |
---|
643 | SEIAlphaChannelInfo() {} |
---|
644 | virtual ~SEIAlphaChannelInfo() {} |
---|
645 | Bool m_alphaChannelCancelFlag; |
---|
646 | UInt m_alphaChannelUseIdc; |
---|
647 | UInt m_alphaChannelBitDepthMinus8; |
---|
648 | UInt m_alphaTransparentValue; |
---|
649 | UInt m_alphaOpaqueValue; |
---|
650 | Bool m_alphaChannelIncrFlag; |
---|
651 | Bool m_alphaChannelClipFlag; |
---|
652 | Bool m_alphaChannelClipTypeFlag; |
---|
653 | }; |
---|
654 | #endif |
---|
655 | |
---|
656 | #if Q0096_OVERLAY_SEI |
---|
657 | class SEIOverlayInfo : public SEI |
---|
658 | { |
---|
659 | public: |
---|
660 | PayloadType payloadType() const { return OVERLAY_INFO; } |
---|
661 | SEIOverlayInfo() |
---|
662 | : m_numOverlaysMinus1(-1) |
---|
663 | {} |
---|
664 | |
---|
665 | virtual ~SEIOverlayInfo() |
---|
666 | { |
---|
667 | for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++) |
---|
668 | { |
---|
669 | delete [] m_overlayLanguage[i]; |
---|
670 | delete [] m_overlayName[i]; |
---|
671 | for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++) |
---|
672 | { |
---|
673 | delete [] m_overlayElementName[i][j]; |
---|
674 | } |
---|
675 | } |
---|
676 | } |
---|
677 | |
---|
678 | Bool m_overlayInfoCancelFlag; |
---|
679 | UInt m_overlayContentAuxIdMinus128; |
---|
680 | UInt m_overlayLabelAuxIdMinus128; |
---|
681 | UInt m_overlayAlphaAuxIdMinus128; |
---|
682 | UInt m_overlayElementLabelValueLengthMinus8; |
---|
683 | UInt m_numOverlaysMinus1; |
---|
684 | std::vector<UInt> m_overlayIdx; |
---|
685 | std::vector<Bool> m_languageOverlayPresentFlag; |
---|
686 | std::vector<UInt> m_overlayContentLayerId; |
---|
687 | std::vector<Bool> m_overlayLabelPresentFlag; |
---|
688 | std::vector<UInt> m_overlayLabelLayerId; |
---|
689 | std::vector<Bool> m_overlayAlphaPresentFlag; |
---|
690 | std::vector<UInt> m_overlayAlphaLayerId; |
---|
691 | std::vector<UInt> m_numOverlayElementsMinus1; |
---|
692 | std::vector< std::vector<UInt> > m_overlayElementLabelMin; |
---|
693 | std::vector< std::vector<UInt> > m_overlayElementLabelMax; |
---|
694 | std::vector<UChar*> m_overlayLanguage; |
---|
695 | std::vector<UInt> m_overlayLanguageLength; |
---|
696 | std::vector<UChar*> m_overlayName; |
---|
697 | std::vector<UInt> m_overlayNameLength; |
---|
698 | std::vector< std::vector<UChar*> > m_overlayElementName; |
---|
699 | std::vector< std::vector<UInt> > m_overlayElementNameLength; |
---|
700 | Bool m_overlayInfoPersistenceFlag; |
---|
701 | }; |
---|
702 | #endif |
---|
703 | |
---|
704 | #if LAYERS_NOT_PRESENT_SEI |
---|
705 | class SEILayersNotPresent : public SEI |
---|
706 | { |
---|
707 | public: |
---|
708 | PayloadType payloadType() const { return LAYERS_NOT_PRESENT; } |
---|
709 | |
---|
710 | SEILayersNotPresent() {} |
---|
711 | virtual ~SEILayersNotPresent() {} |
---|
712 | |
---|
713 | UInt m_activeVpsId; |
---|
714 | UInt m_vpsMaxLayers; |
---|
715 | Bool m_layerNotPresentFlag[MAX_LAYERS]; |
---|
716 | }; |
---|
717 | #endif |
---|
718 | |
---|
719 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
720 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
721 | { |
---|
722 | public: |
---|
723 | PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
724 | |
---|
725 | SEIInterLayerConstrainedTileSets() {} |
---|
726 | virtual ~SEIInterLayerConstrainedTileSets() {} |
---|
727 | |
---|
728 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
729 | Bool m_ilOneTilePerTileSetFlag; |
---|
730 | UInt m_ilNumSetsInMessageMinus1; |
---|
731 | Bool m_skippedTileSetPresentFlag; |
---|
732 | UInt m_ilctsId[256]; |
---|
733 | UInt m_ilNumTileRectsInSetMinus1[256]; |
---|
734 | UInt m_ilTopLeftTileIndex[256][440]; |
---|
735 | UInt m_ilBottomRightTileIndex[256][440]; |
---|
736 | UInt m_ilcIdc[256]; |
---|
737 | Bool m_ilExactSampleValueMatchFlag[256]; |
---|
738 | UInt m_allTilesIlcIdc; |
---|
739 | }; |
---|
740 | #endif |
---|
741 | |
---|
742 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
743 | class SEISubBitstreamProperty : public SEI |
---|
744 | { |
---|
745 | public: |
---|
746 | PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; } |
---|
747 | |
---|
748 | SEISubBitstreamProperty(); |
---|
749 | virtual ~SEISubBitstreamProperty() {} |
---|
750 | |
---|
751 | Int m_activeVpsId; |
---|
752 | Int m_numAdditionalSubStreams; |
---|
753 | Int m_subBitstreamMode [MAX_SUB_STREAMS]; |
---|
754 | Int m_outputLayerSetIdxToVps [MAX_SUB_STREAMS]; |
---|
755 | Int m_highestSublayerId [MAX_SUB_STREAMS]; |
---|
756 | Int m_avgBitRate [MAX_SUB_STREAMS]; |
---|
757 | Int m_maxBitRate [MAX_SUB_STREAMS]; |
---|
758 | }; |
---|
759 | #endif |
---|
760 | |
---|
761 | #if Q0189_TMVP_CONSTRAINTS |
---|
762 | class SEITMVPConstrains : public SEI |
---|
763 | { |
---|
764 | public: |
---|
765 | PayloadType payloadType() const { return TMVP_CONSTRAINTS; } |
---|
766 | |
---|
767 | SEITMVPConstrains() |
---|
768 | : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) |
---|
769 | {} |
---|
770 | |
---|
771 | virtual ~SEITMVPConstrains() |
---|
772 | { |
---|
773 | } |
---|
774 | |
---|
775 | UInt prev_pics_not_used_flag; |
---|
776 | UInt no_intra_layer_col_pic_flag; |
---|
777 | }; |
---|
778 | #endif |
---|
779 | |
---|
780 | #if Q0247_FRAME_FIELD_INFO |
---|
781 | class SEIFrameFieldInfo: public SEI |
---|
782 | { |
---|
783 | public: |
---|
784 | PayloadType payloadType() const { return FRAME_FIELD_INFO; } |
---|
785 | |
---|
786 | SEIFrameFieldInfo() |
---|
787 | : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) |
---|
788 | {} |
---|
789 | |
---|
790 | virtual ~SEIFrameFieldInfo() |
---|
791 | { |
---|
792 | } |
---|
793 | |
---|
794 | UInt m_ffinfo_picStruct; |
---|
795 | UInt m_ffinfo_sourceScanType; |
---|
796 | Bool m_ffinfo_duplicateFlag; |
---|
797 | }; |
---|
798 | #endif |
---|
799 | |
---|
800 | #if O0164_MULTI_LAYER_HRD |
---|
801 | class SEIBspNesting : public SEI |
---|
802 | { |
---|
803 | public: |
---|
804 | PayloadType payloadType() const { return BSP_NESTING; } |
---|
805 | |
---|
806 | SEIBspNesting() |
---|
807 | : m_callerOwnsSEIs(false) |
---|
808 | {} |
---|
809 | virtual ~SEIBspNesting() |
---|
810 | { |
---|
811 | if (!m_callerOwnsSEIs) |
---|
812 | { |
---|
813 | deleteSEIs(m_nestedSEIs); |
---|
814 | } |
---|
815 | } |
---|
816 | |
---|
817 | Int m_bspIdx; |
---|
818 | Bool m_callerOwnsSEIs; |
---|
819 | SEIMessages m_nestedSEIs; |
---|
820 | Int m_seiPartitioningSchemeIdx; |
---|
821 | Int m_seiOlsIdx; |
---|
822 | }; |
---|
823 | |
---|
824 | class SEIBspInitialArrivalTime : public SEI |
---|
825 | { |
---|
826 | public: |
---|
827 | PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
828 | |
---|
829 | SEIBspInitialArrivalTime () {} |
---|
830 | virtual ~SEIBspInitialArrivalTime () {} |
---|
831 | |
---|
832 | UInt m_nalInitialArrivalDelay[256]; |
---|
833 | UInt m_vclInitialArrivalDelay[256]; |
---|
834 | }; |
---|
835 | #endif |
---|
836 | |
---|
837 | #endif |
---|
838 | //! \} |
---|