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