1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2014, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | #ifndef __SEI__ |
---|
35 | #define __SEI__ |
---|
36 | |
---|
37 | #pragma once |
---|
38 | #include <list> |
---|
39 | #include <vector> |
---|
40 | #include <cstring> |
---|
41 | |
---|
42 | #include "TypeDef.h" |
---|
43 | #include "libmd5/MD5.h" |
---|
44 | #if Q0078_ADD_LAYER_SETS |
---|
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_SAMPLING_FILTER_HINT = 140, |
---|
92 | KNEE_FUNCTION_INFO = 141, |
---|
93 | #if LAYERS_NOT_PRESENT_SEI |
---|
94 | LAYERS_NOT_PRESENT = 142, |
---|
95 | #endif |
---|
96 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
97 | INTER_LAYER_CONSTRAINED_TILE_SETS = 143, |
---|
98 | #endif |
---|
99 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
100 | SUB_BITSTREAM_PROPERTY = 144, // Final PayloadType to be defined after finalization |
---|
101 | #endif |
---|
102 | #if O0164_MULTI_LAYER_HRD |
---|
103 | BSP_NESTING = 145, |
---|
104 | BSP_INITIAL_ARRIVAL_TIME = 146, |
---|
105 | #if !REMOVE_BSP_HRD_SEI |
---|
106 | BSP_HRD = 147, |
---|
107 | #endif |
---|
108 | #endif |
---|
109 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
110 | COLOUR_REMAPPING_INFO = 148, |
---|
111 | #endif |
---|
112 | #if Q0078_ADD_LAYER_SETS |
---|
113 | OUTPUT_LAYER_SET_NESTING = 149, |
---|
114 | VPS_REWRITING = 150, |
---|
115 | #endif |
---|
116 | #if Q0189_TMVP_CONSTRAINTS |
---|
117 | TMVP_CONSTRAINTS = 151, |
---|
118 | #endif |
---|
119 | #if Q0247_FRAME_FIELD_INFO |
---|
120 | FRAME_FIELD_INFO = 152, |
---|
121 | #endif |
---|
122 | #if Q0096_OVERLAY_SEI |
---|
123 | OVERLAY_INFO = 153, |
---|
124 | #endif |
---|
125 | #if P0123_ALPHA_CHANNEL_SEI |
---|
126 | ALPHA_CHANNEL_INFO = 165, |
---|
127 | #endif |
---|
128 | }; |
---|
129 | |
---|
130 | SEI() {} |
---|
131 | virtual ~SEI() {} |
---|
132 | |
---|
133 | static const Char *getSEIMessageString(SEI::PayloadType payloadType); |
---|
134 | |
---|
135 | virtual PayloadType payloadType() const = 0; |
---|
136 | }; |
---|
137 | |
---|
138 | static const UInt ISO_IEC_11578_LEN=16; |
---|
139 | |
---|
140 | class SEIuserDataUnregistered : public SEI |
---|
141 | { |
---|
142 | public: |
---|
143 | PayloadType payloadType() const { return USER_DATA_UNREGISTERED; } |
---|
144 | |
---|
145 | SEIuserDataUnregistered() |
---|
146 | : userData(0) |
---|
147 | {} |
---|
148 | |
---|
149 | virtual ~SEIuserDataUnregistered() |
---|
150 | { |
---|
151 | delete userData; |
---|
152 | } |
---|
153 | |
---|
154 | UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; |
---|
155 | UInt userDataLength; |
---|
156 | UChar *userData; |
---|
157 | }; |
---|
158 | |
---|
159 | class SEIDecodedPictureHash : public SEI |
---|
160 | { |
---|
161 | public: |
---|
162 | PayloadType payloadType() const { return DECODED_PICTURE_HASH; } |
---|
163 | |
---|
164 | SEIDecodedPictureHash() {} |
---|
165 | virtual ~SEIDecodedPictureHash() {} |
---|
166 | |
---|
167 | enum Method |
---|
168 | { |
---|
169 | MD5, |
---|
170 | CRC, |
---|
171 | CHECKSUM, |
---|
172 | RESERVED, |
---|
173 | } method; |
---|
174 | |
---|
175 | TComDigest m_digest; |
---|
176 | }; |
---|
177 | |
---|
178 | class SEIActiveParameterSets : public SEI |
---|
179 | { |
---|
180 | public: |
---|
181 | PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } |
---|
182 | |
---|
183 | SEIActiveParameterSets() |
---|
184 | : activeVPSId (0) |
---|
185 | , m_selfContainedCvsFlag (false) |
---|
186 | , m_noParameterSetUpdateFlag (false) |
---|
187 | , numSpsIdsMinus1 (0) |
---|
188 | {} |
---|
189 | virtual ~SEIActiveParameterSets() {} |
---|
190 | |
---|
191 | Int activeVPSId; |
---|
192 | Bool m_selfContainedCvsFlag; |
---|
193 | Bool m_noParameterSetUpdateFlag; |
---|
194 | Int numSpsIdsMinus1; |
---|
195 | std::vector<Int> activeSeqParameterSetId; |
---|
196 | #if R0247_SEI_ACTIVE |
---|
197 | std::vector<Int> layerSpsIdx; |
---|
198 | #endif |
---|
199 | }; |
---|
200 | |
---|
201 | class SEIBufferingPeriod : public SEI |
---|
202 | { |
---|
203 | public: |
---|
204 | PayloadType payloadType() const { return BUFFERING_PERIOD; } |
---|
205 | |
---|
206 | SEIBufferingPeriod() |
---|
207 | : m_bpSeqParameterSetId (0) |
---|
208 | , m_rapCpbParamsPresentFlag (false) |
---|
209 | , m_cpbDelayOffset (0) |
---|
210 | , m_dpbDelayOffset (0) |
---|
211 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
212 | , m_useAltCpbParamsFlagPresent(false) |
---|
213 | , m_useAltCpbParamsFlag (false) |
---|
214 | #endif |
---|
215 | { |
---|
216 | ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); |
---|
217 | ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset)); |
---|
218 | ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay)); |
---|
219 | ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); |
---|
220 | } |
---|
221 | virtual ~SEIBufferingPeriod() {} |
---|
222 | |
---|
223 | UInt m_bpSeqParameterSetId; |
---|
224 | Bool m_rapCpbParamsPresentFlag; |
---|
225 | UInt m_cpbDelayOffset; |
---|
226 | UInt m_dpbDelayOffset; |
---|
227 | UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
228 | UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; |
---|
229 | UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; |
---|
230 | UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; |
---|
231 | Bool m_concatenationFlag; |
---|
232 | UInt m_auCpbRemovalDelayDelta; |
---|
233 | #if P0138_USE_ALT_CPB_PARAMS_FLAG |
---|
234 | Bool m_useAltCpbParamsFlagPresent; |
---|
235 | Bool m_useAltCpbParamsFlag; |
---|
236 | #endif |
---|
237 | }; |
---|
238 | class SEIPictureTiming : public SEI |
---|
239 | { |
---|
240 | public: |
---|
241 | PayloadType payloadType() const { return PICTURE_TIMING; } |
---|
242 | |
---|
243 | SEIPictureTiming() |
---|
244 | : m_picStruct (0) |
---|
245 | , m_sourceScanType (0) |
---|
246 | , m_duplicateFlag (false) |
---|
247 | , m_picDpbOutputDuDelay (0) |
---|
248 | , m_numNalusInDuMinus1 (NULL) |
---|
249 | , m_duCpbRemovalDelayMinus1 (NULL) |
---|
250 | {} |
---|
251 | virtual ~SEIPictureTiming() |
---|
252 | { |
---|
253 | if( m_numNalusInDuMinus1 != NULL ) |
---|
254 | { |
---|
255 | delete m_numNalusInDuMinus1; |
---|
256 | } |
---|
257 | if( m_duCpbRemovalDelayMinus1 != NULL ) |
---|
258 | { |
---|
259 | delete m_duCpbRemovalDelayMinus1; |
---|
260 | } |
---|
261 | } |
---|
262 | |
---|
263 | UInt m_picStruct; |
---|
264 | UInt m_sourceScanType; |
---|
265 | Bool m_duplicateFlag; |
---|
266 | |
---|
267 | UInt m_auCpbRemovalDelay; |
---|
268 | UInt m_picDpbOutputDelay; |
---|
269 | UInt m_picDpbOutputDuDelay; |
---|
270 | UInt m_numDecodingUnitsMinus1; |
---|
271 | Bool m_duCommonCpbRemovalDelayFlag; |
---|
272 | UInt m_duCommonCpbRemovalDelayMinus1; |
---|
273 | UInt* m_numNalusInDuMinus1; |
---|
274 | UInt* m_duCpbRemovalDelayMinus1; |
---|
275 | }; |
---|
276 | |
---|
277 | class SEIDecodingUnitInfo : public SEI |
---|
278 | { |
---|
279 | public: |
---|
280 | PayloadType payloadType() const { return DECODING_UNIT_INFO; } |
---|
281 | |
---|
282 | SEIDecodingUnitInfo() |
---|
283 | : m_decodingUnitIdx(0) |
---|
284 | , m_duSptCpbRemovalDelay(0) |
---|
285 | , m_dpbOutputDuDelayPresentFlag(false) |
---|
286 | , m_picSptDpbOutputDuDelay(0) |
---|
287 | {} |
---|
288 | virtual ~SEIDecodingUnitInfo() {} |
---|
289 | Int m_decodingUnitIdx; |
---|
290 | Int m_duSptCpbRemovalDelay; |
---|
291 | Bool m_dpbOutputDuDelayPresentFlag; |
---|
292 | Int m_picSptDpbOutputDuDelay; |
---|
293 | }; |
---|
294 | |
---|
295 | class SEIRecoveryPoint : public SEI |
---|
296 | { |
---|
297 | public: |
---|
298 | PayloadType payloadType() const { return RECOVERY_POINT; } |
---|
299 | |
---|
300 | SEIRecoveryPoint() {} |
---|
301 | virtual ~SEIRecoveryPoint() {} |
---|
302 | |
---|
303 | Int m_recoveryPocCnt; |
---|
304 | Bool m_exactMatchingFlag; |
---|
305 | Bool m_brokenLinkFlag; |
---|
306 | }; |
---|
307 | |
---|
308 | class SEIFramePacking : public SEI |
---|
309 | { |
---|
310 | public: |
---|
311 | PayloadType payloadType() const { return FRAME_PACKING; } |
---|
312 | |
---|
313 | SEIFramePacking() {} |
---|
314 | virtual ~SEIFramePacking() {} |
---|
315 | |
---|
316 | Int m_arrangementId; |
---|
317 | Bool m_arrangementCancelFlag; |
---|
318 | Int m_arrangementType; |
---|
319 | Bool m_quincunxSamplingFlag; |
---|
320 | Int m_contentInterpretationType; |
---|
321 | Bool m_spatialFlippingFlag; |
---|
322 | Bool m_frame0FlippedFlag; |
---|
323 | Bool m_fieldViewsFlag; |
---|
324 | Bool m_currentFrameIsFrame0Flag; |
---|
325 | Bool m_frame0SelfContainedFlag; |
---|
326 | Bool m_frame1SelfContainedFlag; |
---|
327 | Int m_frame0GridPositionX; |
---|
328 | Int m_frame0GridPositionY; |
---|
329 | Int m_frame1GridPositionX; |
---|
330 | Int m_frame1GridPositionY; |
---|
331 | Int m_arrangementReservedByte; |
---|
332 | Bool m_arrangementPersistenceFlag; |
---|
333 | Bool m_upsampledAspectRatio; |
---|
334 | }; |
---|
335 | |
---|
336 | class SEISegmentedRectFramePacking : public SEI |
---|
337 | { |
---|
338 | public: |
---|
339 | PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; } |
---|
340 | |
---|
341 | SEISegmentedRectFramePacking() {} |
---|
342 | virtual ~SEISegmentedRectFramePacking() {} |
---|
343 | |
---|
344 | Bool m_arrangementCancelFlag; |
---|
345 | Int m_contentInterpretationType; |
---|
346 | Bool m_arrangementPersistenceFlag; |
---|
347 | }; |
---|
348 | |
---|
349 | class SEIDisplayOrientation : public SEI |
---|
350 | { |
---|
351 | public: |
---|
352 | PayloadType payloadType() const { return DISPLAY_ORIENTATION; } |
---|
353 | |
---|
354 | SEIDisplayOrientation() |
---|
355 | : cancelFlag(true) |
---|
356 | , persistenceFlag(0) |
---|
357 | , extensionFlag(false) |
---|
358 | {} |
---|
359 | virtual ~SEIDisplayOrientation() {} |
---|
360 | |
---|
361 | Bool cancelFlag; |
---|
362 | Bool horFlip; |
---|
363 | Bool verFlip; |
---|
364 | |
---|
365 | UInt anticlockwiseRotation; |
---|
366 | Bool persistenceFlag; |
---|
367 | Bool extensionFlag; |
---|
368 | }; |
---|
369 | |
---|
370 | class SEITemporalLevel0Index : public SEI |
---|
371 | { |
---|
372 | public: |
---|
373 | PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; } |
---|
374 | |
---|
375 | SEITemporalLevel0Index() |
---|
376 | : tl0Idx(0) |
---|
377 | , rapIdx(0) |
---|
378 | {} |
---|
379 | virtual ~SEITemporalLevel0Index() {} |
---|
380 | |
---|
381 | UInt tl0Idx; |
---|
382 | UInt rapIdx; |
---|
383 | }; |
---|
384 | |
---|
385 | class SEIGradualDecodingRefreshInfo : public SEI |
---|
386 | { |
---|
387 | public: |
---|
388 | PayloadType payloadType() const { return REGION_REFRESH_INFO; } |
---|
389 | |
---|
390 | SEIGradualDecodingRefreshInfo() |
---|
391 | : m_gdrForegroundFlag(0) |
---|
392 | {} |
---|
393 | virtual ~SEIGradualDecodingRefreshInfo() {} |
---|
394 | |
---|
395 | Bool m_gdrForegroundFlag; |
---|
396 | }; |
---|
397 | |
---|
398 | class SEINoDisplay : public SEI |
---|
399 | { |
---|
400 | public: |
---|
401 | PayloadType payloadType() const { return NO_DISPLAY; } |
---|
402 | |
---|
403 | SEINoDisplay() |
---|
404 | : m_noDisplay(false) |
---|
405 | {} |
---|
406 | virtual ~SEINoDisplay() {} |
---|
407 | |
---|
408 | Bool m_noDisplay; |
---|
409 | }; |
---|
410 | |
---|
411 | class SEISOPDescription : public SEI |
---|
412 | { |
---|
413 | public: |
---|
414 | PayloadType payloadType() const { return SOP_DESCRIPTION; } |
---|
415 | |
---|
416 | SEISOPDescription() {} |
---|
417 | virtual ~SEISOPDescription() {} |
---|
418 | |
---|
419 | UInt m_sopSeqParameterSetId; |
---|
420 | UInt m_numPicsInSopMinus1; |
---|
421 | |
---|
422 | UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP]; |
---|
423 | UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP]; |
---|
424 | UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP]; |
---|
425 | Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; |
---|
426 | }; |
---|
427 | |
---|
428 | class SEIToneMappingInfo : public SEI |
---|
429 | { |
---|
430 | public: |
---|
431 | PayloadType payloadType() const { return TONE_MAPPING_INFO; } |
---|
432 | SEIToneMappingInfo() {} |
---|
433 | virtual ~SEIToneMappingInfo() {} |
---|
434 | |
---|
435 | Int m_toneMapId; |
---|
436 | Bool m_toneMapCancelFlag; |
---|
437 | Bool m_toneMapPersistenceFlag; |
---|
438 | Int m_codedDataBitDepth; |
---|
439 | Int m_targetBitDepth; |
---|
440 | Int m_modelId; |
---|
441 | Int m_minValue; |
---|
442 | Int m_maxValue; |
---|
443 | Int m_sigmoidMidpoint; |
---|
444 | Int m_sigmoidWidth; |
---|
445 | std::vector<Int> m_startOfCodedInterval; |
---|
446 | Int m_numPivots; |
---|
447 | std::vector<Int> m_codedPivotValue; |
---|
448 | std::vector<Int> m_targetPivotValue; |
---|
449 | Int m_cameraIsoSpeedIdc; |
---|
450 | Int m_cameraIsoSpeedValue; |
---|
451 | Int m_exposureIndexIdc; |
---|
452 | Int m_exposureIndexValue; |
---|
453 | Int m_exposureCompensationValueSignFlag; |
---|
454 | Int m_exposureCompensationValueNumerator; |
---|
455 | Int m_exposureCompensationValueDenomIdc; |
---|
456 | Int m_refScreenLuminanceWhite; |
---|
457 | Int m_extendedRangeWhiteLevel; |
---|
458 | Int m_nominalBlackLevelLumaCodeValue; |
---|
459 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
460 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
461 | }; |
---|
462 | |
---|
463 | class SEIKneeFunctionInfo : public SEI |
---|
464 | { |
---|
465 | public: |
---|
466 | PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } |
---|
467 | SEIKneeFunctionInfo() {} |
---|
468 | virtual ~SEIKneeFunctionInfo() {} |
---|
469 | |
---|
470 | Int m_kneeId; |
---|
471 | Bool m_kneeCancelFlag; |
---|
472 | Bool m_kneePersistenceFlag; |
---|
473 | Int m_kneeInputDrange; |
---|
474 | Int m_kneeInputDispLuminance; |
---|
475 | Int m_kneeOutputDrange; |
---|
476 | Int m_kneeOutputDispLuminance; |
---|
477 | Int m_kneeNumKneePointsMinus1; |
---|
478 | std::vector<Int> m_kneeInputKneePoint; |
---|
479 | std::vector<Int> m_kneeOutputKneePoint; |
---|
480 | }; |
---|
481 | |
---|
482 | class SEIChromaSamplingFilterHint : public SEI |
---|
483 | { |
---|
484 | public: |
---|
485 | PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;} |
---|
486 | SEIChromaSamplingFilterHint() {} |
---|
487 | virtual ~SEIChromaSamplingFilterHint() { |
---|
488 | if(m_verChromaFilterIdc == 1) |
---|
489 | { |
---|
490 | for(Int i = 0; i < m_numVerticalFilters; i ++) |
---|
491 | { |
---|
492 | free(m_verFilterCoeff[i]); |
---|
493 | } |
---|
494 | free(m_verFilterCoeff); |
---|
495 | free(m_verTapLengthMinus1); |
---|
496 | } |
---|
497 | if(m_horChromaFilterIdc == 1) |
---|
498 | { |
---|
499 | for(Int i = 0; i < m_numHorizontalFilters; i ++) |
---|
500 | { |
---|
501 | free(m_horFilterCoeff[i]); |
---|
502 | } |
---|
503 | free(m_horFilterCoeff); |
---|
504 | free(m_horTapLengthMinus1); |
---|
505 | } |
---|
506 | } |
---|
507 | |
---|
508 | Int m_verChromaFilterIdc; |
---|
509 | Int m_horChromaFilterIdc; |
---|
510 | Bool m_verFilteringProcessFlag; |
---|
511 | Int m_targetFormatIdc; |
---|
512 | Bool m_perfectReconstructionFlag; |
---|
513 | Int m_numVerticalFilters; |
---|
514 | Int* m_verTapLengthMinus1; |
---|
515 | Int** m_verFilterCoeff; |
---|
516 | Int m_numHorizontalFilters; |
---|
517 | Int* m_horTapLengthMinus1; |
---|
518 | 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 | virtual ~SEIScalableNesting() |
---|
549 | { |
---|
550 | if (!m_callerOwnsSEIs) |
---|
551 | { |
---|
552 | deleteSEIs(m_nestedSEIs); |
---|
553 | } |
---|
554 | } |
---|
555 | |
---|
556 | Bool m_bitStreamSubsetFlag; |
---|
557 | Bool m_nestingOpFlag; |
---|
558 | Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0 |
---|
559 | UInt m_nestingNumOpsMinus1; // -"- |
---|
560 | UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]; // -"- |
---|
561 | UInt m_nestingOpIdx[MAX_NESTING_NUM_OPS]; // -"- |
---|
562 | |
---|
563 | Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0 |
---|
564 | UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
565 | UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0 |
---|
566 | 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 |
---|
567 | |
---|
568 | Bool m_callerOwnsSEIs; |
---|
569 | SEIMessages m_nestedSEIs; |
---|
570 | }; |
---|
571 | |
---|
572 | class SEITimeCode : public SEI |
---|
573 | { |
---|
574 | public: |
---|
575 | PayloadType payloadType() const { return TIME_CODE; } |
---|
576 | SEITimeCode() {} |
---|
577 | virtual ~SEITimeCode(){} |
---|
578 | |
---|
579 | UInt numClockTs; |
---|
580 | TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS]; |
---|
581 | }; |
---|
582 | |
---|
583 | //definition according to P1005_v1; |
---|
584 | class SEITempMotionConstrainedTileSets: public SEI |
---|
585 | { |
---|
586 | struct TileSetData |
---|
587 | { |
---|
588 | protected: |
---|
589 | std::vector<Int> m_top_left_tile_index; //[tileSetIdx][tileIdx]; |
---|
590 | std::vector<Int> m_bottom_right_tile_index; |
---|
591 | |
---|
592 | public: |
---|
593 | Int m_mcts_id; |
---|
594 | Bool m_display_tile_set_flag; |
---|
595 | Int m_num_tile_rects_in_set; //_minus1; |
---|
596 | Bool m_exact_sample_value_match_flag; |
---|
597 | Bool m_mcts_tier_level_idc_present_flag; |
---|
598 | Bool m_mcts_tier_flag; |
---|
599 | Int m_mcts_level_idc; |
---|
600 | |
---|
601 | Void setNumberOfTileRects(const Int number) |
---|
602 | { |
---|
603 | m_top_left_tile_index .resize(number); |
---|
604 | m_bottom_right_tile_index.resize(number); |
---|
605 | } |
---|
606 | |
---|
607 | Int getNumberOfTileRects() const |
---|
608 | { |
---|
609 | assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size()); |
---|
610 | return Int(m_top_left_tile_index.size()); |
---|
611 | } |
---|
612 | |
---|
613 | Int &topLeftTileIndex (const Int tileRectIndex) { return m_top_left_tile_index [tileRectIndex]; } |
---|
614 | Int &bottomRightTileIndex(const Int tileRectIndex) { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
615 | const Int &topLeftTileIndex (const Int tileRectIndex) const { return m_top_left_tile_index [tileRectIndex]; } |
---|
616 | const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; } |
---|
617 | }; |
---|
618 | |
---|
619 | protected: |
---|
620 | std::vector<TileSetData> m_tile_set_data; |
---|
621 | |
---|
622 | public: |
---|
623 | |
---|
624 | Bool m_mc_all_tiles_exact_sample_value_match_flag; |
---|
625 | Bool m_each_tile_one_tile_set_flag; |
---|
626 | Bool m_limited_tile_set_display_flag; |
---|
627 | Bool m_max_mcs_tier_level_idc_present_flag; |
---|
628 | Bool m_max_mcts_tier_flag; |
---|
629 | Int m_max_mcts_level_idc; |
---|
630 | |
---|
631 | PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; } |
---|
632 | |
---|
633 | Void setNumberOfTileSets(const Int number) { m_tile_set_data.resize(number); } |
---|
634 | Int getNumberOfTileSets() const { return Int(m_tile_set_data.size()); } |
---|
635 | |
---|
636 | TileSetData &tileSetData (const Int index) { return m_tile_set_data[index]; } |
---|
637 | const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; } |
---|
638 | |
---|
639 | }; |
---|
640 | |
---|
641 | #if Q0078_ADD_LAYER_SETS |
---|
642 | class SEIOutputLayerSetNesting : public SEI |
---|
643 | { |
---|
644 | public: |
---|
645 | PayloadType payloadType() const { return OUTPUT_LAYER_SET_NESTING; } |
---|
646 | |
---|
647 | SEIOutputLayerSetNesting() {} |
---|
648 | virtual ~SEIOutputLayerSetNesting() |
---|
649 | { |
---|
650 | if (!m_callerOwnsSEIs) |
---|
651 | { |
---|
652 | deleteSEIs(m_nestedSEIs); |
---|
653 | } |
---|
654 | } |
---|
655 | |
---|
656 | Bool m_olsFlag; |
---|
657 | UInt m_numOlsIndicesMinus1; |
---|
658 | UInt m_olsIdx[1024]; |
---|
659 | Bool m_callerOwnsSEIs; |
---|
660 | SEIMessages m_nestedSEIs; |
---|
661 | }; |
---|
662 | |
---|
663 | class SEIVPSRewriting : public SEI |
---|
664 | { |
---|
665 | public: |
---|
666 | PayloadType payloadType() const { return VPS_REWRITING; } |
---|
667 | |
---|
668 | SEIVPSRewriting() {} |
---|
669 | virtual ~SEIVPSRewriting() {} |
---|
670 | |
---|
671 | NALUnit* nalu; |
---|
672 | }; |
---|
673 | #endif |
---|
674 | |
---|
675 | #if P0123_ALPHA_CHANNEL_SEI |
---|
676 | class SEIAlphaChannelInfo : public SEI |
---|
677 | { |
---|
678 | public: |
---|
679 | PayloadType payloadType() const { return ALPHA_CHANNEL_INFO; } |
---|
680 | SEIAlphaChannelInfo() {} |
---|
681 | virtual ~SEIAlphaChannelInfo() {} |
---|
682 | Bool m_alphaChannelCancelFlag; |
---|
683 | UInt m_alphaChannelUseIdc; |
---|
684 | UInt m_alphaChannelBitDepthMinus8; |
---|
685 | UInt m_alphaTransparentValue; |
---|
686 | UInt m_alphaOpaqueValue; |
---|
687 | Bool m_alphaChannelIncrFlag; |
---|
688 | Bool m_alphaChannelClipFlag; |
---|
689 | Bool m_alphaChannelClipTypeFlag; |
---|
690 | }; |
---|
691 | #endif |
---|
692 | |
---|
693 | #if Q0096_OVERLAY_SEI |
---|
694 | class SEIOverlayInfo : public SEI |
---|
695 | { |
---|
696 | public: |
---|
697 | PayloadType payloadType() const { return OVERLAY_INFO; } |
---|
698 | SEIOverlayInfo() |
---|
699 | : m_numOverlaysMinus1(-1) |
---|
700 | {} |
---|
701 | |
---|
702 | virtual ~SEIOverlayInfo() |
---|
703 | { |
---|
704 | for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++) |
---|
705 | { |
---|
706 | delete [] m_overlayLanguage[i]; |
---|
707 | delete [] m_overlayName[i]; |
---|
708 | for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++) |
---|
709 | { |
---|
710 | delete [] m_overlayElementName[i][j]; |
---|
711 | } |
---|
712 | } |
---|
713 | } |
---|
714 | |
---|
715 | Bool m_overlayInfoCancelFlag; |
---|
716 | UInt m_overlayContentAuxIdMinus128; |
---|
717 | UInt m_overlayLabelAuxIdMinus128; |
---|
718 | UInt m_overlayAlphaAuxIdMinus128; |
---|
719 | UInt m_overlayElementLabelValueLengthMinus8; |
---|
720 | UInt m_numOverlaysMinus1; |
---|
721 | std::vector<UInt> m_overlayIdx; |
---|
722 | std::vector<Bool> m_languageOverlayPresentFlag; |
---|
723 | std::vector<UInt> m_overlayContentLayerId; |
---|
724 | std::vector<Bool> m_overlayLabelPresentFlag; |
---|
725 | std::vector<UInt> m_overlayLabelLayerId; |
---|
726 | std::vector<Bool> m_overlayAlphaPresentFlag; |
---|
727 | std::vector<UInt> m_overlayAlphaLayerId; |
---|
728 | std::vector<UInt> m_numOverlayElementsMinus1; |
---|
729 | std::vector< std::vector<UInt> > m_overlayElementLabelMin; |
---|
730 | std::vector< std::vector<UInt> > m_overlayElementLabelMax; |
---|
731 | std::vector<UChar*> m_overlayLanguage; |
---|
732 | std::vector<UInt> m_overlayLanguageLength; |
---|
733 | std::vector<UChar*> m_overlayName; |
---|
734 | std::vector<UInt> m_overlayNameLength; |
---|
735 | std::vector< std::vector<UChar*> > m_overlayElementName; |
---|
736 | std::vector< std::vector<UInt> > m_overlayElementNameLength; |
---|
737 | Bool m_overlayInfoPersistenceFlag; |
---|
738 | }; |
---|
739 | #endif |
---|
740 | |
---|
741 | #if LAYERS_NOT_PRESENT_SEI |
---|
742 | class SEILayersNotPresent : public SEI |
---|
743 | { |
---|
744 | public: |
---|
745 | PayloadType payloadType() const { return LAYERS_NOT_PRESENT; } |
---|
746 | |
---|
747 | SEILayersNotPresent() {} |
---|
748 | virtual ~SEILayersNotPresent() {} |
---|
749 | |
---|
750 | UInt m_activeVpsId; |
---|
751 | UInt m_vpsMaxLayers; |
---|
752 | Bool m_layerNotPresentFlag[MAX_LAYERS]; |
---|
753 | }; |
---|
754 | #endif |
---|
755 | |
---|
756 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
757 | class SEIColourRemappingInfo : public SEI |
---|
758 | { |
---|
759 | public: |
---|
760 | PayloadType payloadType() const { return COLOUR_REMAPPING_INFO; } |
---|
761 | SEIColourRemappingInfo() {} |
---|
762 | ~SEIColourRemappingInfo() {} |
---|
763 | |
---|
764 | Int m_colourRemapId; |
---|
765 | Bool m_colourRemapCancelFlag; |
---|
766 | Bool m_colourRemapPersistenceFlag; |
---|
767 | Bool m_colourRemapVideoSignalInfoPresentFlag; |
---|
768 | Bool m_colourRemapFullRangeFlag; |
---|
769 | Int m_colourRemapPrimaries; |
---|
770 | Int m_colourRemapTransferFunction; |
---|
771 | Int m_colourRemapMatrixCoefficients; |
---|
772 | Int m_colourRemapInputBitDepth; |
---|
773 | Int m_colourRemapBitDepth; |
---|
774 | Int m_preLutNumValMinus1[3]; |
---|
775 | std::vector<Int> m_preLutCodedValue[3]; |
---|
776 | std::vector<Int> m_preLutTargetValue[3]; |
---|
777 | Bool m_colourRemapMatrixPresentFlag; |
---|
778 | Int m_log2MatrixDenom; |
---|
779 | Int m_colourRemapCoeffs[3][3]; |
---|
780 | Int m_postLutNumValMinus1[3]; |
---|
781 | std::vector<Int> m_postLutCodedValue[3]; |
---|
782 | std::vector<Int> m_postLutTargetValue[3]; |
---|
783 | }; |
---|
784 | #endif |
---|
785 | |
---|
786 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
787 | class SEIInterLayerConstrainedTileSets : public SEI |
---|
788 | { |
---|
789 | public: |
---|
790 | PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } |
---|
791 | |
---|
792 | SEIInterLayerConstrainedTileSets() {} |
---|
793 | virtual ~SEIInterLayerConstrainedTileSets() {} |
---|
794 | |
---|
795 | Bool m_ilAllTilesExactSampleValueMatchFlag; |
---|
796 | Bool m_ilOneTilePerTileSetFlag; |
---|
797 | UInt m_ilNumSetsInMessageMinus1; |
---|
798 | Bool m_skippedTileSetPresentFlag; |
---|
799 | UInt m_ilctsId[256]; |
---|
800 | UInt m_ilNumTileRectsInSetMinus1[256]; |
---|
801 | UInt m_ilTopLeftTileIndex[256][440]; |
---|
802 | UInt m_ilBottomRightTileIndex[256][440]; |
---|
803 | UInt m_ilcIdc[256]; |
---|
804 | Bool m_ilExactSampleValueMatchFlag[256]; |
---|
805 | UInt m_allTilesIlcIdc; |
---|
806 | }; |
---|
807 | #endif |
---|
808 | |
---|
809 | #if SUB_BITSTREAM_PROPERTY_SEI |
---|
810 | class SEISubBitstreamProperty : public SEI |
---|
811 | { |
---|
812 | public: |
---|
813 | PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; } |
---|
814 | |
---|
815 | SEISubBitstreamProperty(); |
---|
816 | virtual ~SEISubBitstreamProperty() {} |
---|
817 | |
---|
818 | Int m_activeVpsId; |
---|
819 | Int m_numAdditionalSubStreams; |
---|
820 | Int m_subBitstreamMode [MAX_SUB_STREAMS]; |
---|
821 | Int m_outputLayerSetIdxToVps [MAX_SUB_STREAMS]; |
---|
822 | Int m_highestSublayerId [MAX_SUB_STREAMS]; |
---|
823 | Int m_avgBitRate [MAX_SUB_STREAMS]; |
---|
824 | Int m_maxBitRate [MAX_SUB_STREAMS]; |
---|
825 | }; |
---|
826 | #endif |
---|
827 | |
---|
828 | #if Q0189_TMVP_CONSTRAINTS |
---|
829 | class SEITMVPConstrains : public SEI |
---|
830 | { |
---|
831 | public: |
---|
832 | PayloadType payloadType() const { return TMVP_CONSTRAINTS; } |
---|
833 | |
---|
834 | SEITMVPConstrains() |
---|
835 | : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) |
---|
836 | {} |
---|
837 | |
---|
838 | virtual ~SEITMVPConstrains() |
---|
839 | { |
---|
840 | } |
---|
841 | |
---|
842 | UInt prev_pics_not_used_flag; |
---|
843 | UInt no_intra_layer_col_pic_flag; |
---|
844 | }; |
---|
845 | #endif |
---|
846 | |
---|
847 | #if Q0247_FRAME_FIELD_INFO |
---|
848 | class SEIFrameFieldInfo: public SEI |
---|
849 | { |
---|
850 | public: |
---|
851 | PayloadType payloadType() const { return FRAME_FIELD_INFO; } |
---|
852 | |
---|
853 | SEIFrameFieldInfo() |
---|
854 | : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) |
---|
855 | {} |
---|
856 | |
---|
857 | virtual ~SEIFrameFieldInfo() |
---|
858 | { |
---|
859 | } |
---|
860 | |
---|
861 | UInt m_ffinfo_picStruct; |
---|
862 | UInt m_ffinfo_sourceScanType; |
---|
863 | Bool m_ffinfo_duplicateFlag; |
---|
864 | }; |
---|
865 | #endif |
---|
866 | |
---|
867 | #if O0164_MULTI_LAYER_HRD |
---|
868 | |
---|
869 | class SEIBspNesting : public SEI |
---|
870 | { |
---|
871 | public: |
---|
872 | PayloadType payloadType() const { return BSP_NESTING; } |
---|
873 | |
---|
874 | SEIBspNesting() {} |
---|
875 | virtual ~SEIBspNesting() |
---|
876 | { |
---|
877 | if (!m_callerOwnsSEIs) |
---|
878 | { |
---|
879 | deleteSEIs(m_nestedSEIs); |
---|
880 | } |
---|
881 | } |
---|
882 | |
---|
883 | Int m_bspIdx; |
---|
884 | Bool m_callerOwnsSEIs; |
---|
885 | SEIMessages m_nestedSEIs; |
---|
886 | #if VPS_VUI_BSP_HRD_PARAMS |
---|
887 | Int m_seiPartitioningSchemeIdx; |
---|
888 | Int m_seiOlsIdx; |
---|
889 | #endif |
---|
890 | }; |
---|
891 | |
---|
892 | class SEIBspInitialArrivalTime : public SEI |
---|
893 | { |
---|
894 | public: |
---|
895 | PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } |
---|
896 | |
---|
897 | SEIBspInitialArrivalTime () {} |
---|
898 | virtual ~SEIBspInitialArrivalTime () {} |
---|
899 | |
---|
900 | UInt m_nalInitialArrivalDelay[256]; |
---|
901 | UInt m_vclInitialArrivalDelay[256]; |
---|
902 | }; |
---|
903 | |
---|
904 | #if !REMOVE_BSP_HRD_SEI |
---|
905 | class SEIBspHrd : public SEI |
---|
906 | { |
---|
907 | public: |
---|
908 | PayloadType payloadType() const { return BSP_HRD; } |
---|
909 | |
---|
910 | SEIBspHrd () {} |
---|
911 | virtual ~SEIBspHrd () {} |
---|
912 | |
---|
913 | UInt m_seiNumBspHrdParametersMinus1; |
---|
914 | Bool m_seiBspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
915 | UInt m_seiNumBitstreamPartitionsMinus1[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
916 | Bool m_seiLayerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS]; |
---|
917 | UInt m_seiNumBspSchedCombinationsMinus1[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
918 | UInt m_seiBspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; |
---|
919 | UInt m_seiBspCombScheddx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; |
---|
920 | UInt m_vpsMaxLayers; |
---|
921 | Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
922 | |
---|
923 | TComHRD *hrd; |
---|
924 | }; |
---|
925 | #endif |
---|
926 | |
---|
927 | #endif |
---|
928 | |
---|
929 | #endif |
---|
930 | //! \} |
---|