source: SHVCSoftware/branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp @ 1294

Last change on this file since 1294 was 1287, checked in by seregin, 10 years ago

port rev 4322 (g_bitDepth)

File size: 36.2 KB
Line 
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#include "TLibCommon/CommonDef.h"
35#include "TLibCommon/SEI.h"
36#include "TEncGOP.h"
37#include "TEncTop.h"
38
39//! \ingroup TLibEncoder
40//! \{
41
42Void SEIEncoder::initSEIActiveParameterSets (SEIActiveParameterSets *seiActiveParameterSets, const TComVPS *vps, const TComSPS *sps)
43{
44  assert (m_isInitialized);
45  assert (seiActiveParameterSets!=NULL);
46  assert (vps!=NULL);
47  assert (sps!=NULL);
48
49  seiActiveParameterSets->activeVPSId = vps->getVPSId(); 
50  seiActiveParameterSets->m_selfContainedCvsFlag = false;
51  seiActiveParameterSets->m_noParameterSetUpdateFlag = false;
52#if R0247_SEI_ACTIVE
53  seiActiveParameterSets->numSpsIdsMinus1 = m_pcCfg->getNumLayer()-1;
54  seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
55  seiActiveParameterSets->layerSpsIdx.resize(seiActiveParameterSets->numSpsIdsMinus1+ 1); 
56  for (Int c=0; c <= seiActiveParameterSets->numSpsIdsMinus1; c++)
57  {
58     seiActiveParameterSets->activeSeqParameterSetId[c] = c;
59  }
60  for (Int c=1; c <= seiActiveParameterSets->numSpsIdsMinus1; c++)
61  {
62     seiActiveParameterSets->layerSpsIdx[c] = c;
63  }
64#else
65  seiActiveParameterSets->numSpsIdsMinus1 = 0;
66  seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
67  seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId();
68#endif
69}
70
71Void SEIEncoder::initSEIFramePacking(SEIFramePacking *seiFramePacking, Int currPicNum)
72{
73  assert (m_isInitialized);
74  assert (seiFramePacking!=NULL);
75
76  seiFramePacking->m_arrangementId = m_pcCfg->getFramePackingArrangementSEIId();
77  seiFramePacking->m_arrangementCancelFlag = 0;
78  seiFramePacking->m_arrangementType = m_pcCfg->getFramePackingArrangementSEIType();
79  assert((seiFramePacking->m_arrangementType > 2) && (seiFramePacking->m_arrangementType < 6) );
80  seiFramePacking->m_quincunxSamplingFlag = m_pcCfg->getFramePackingArrangementSEIQuincunx();
81  seiFramePacking->m_contentInterpretationType = m_pcCfg->getFramePackingArrangementSEIInterpretation();
82  seiFramePacking->m_spatialFlippingFlag = 0;
83  seiFramePacking->m_frame0FlippedFlag = 0;
84  seiFramePacking->m_fieldViewsFlag = (seiFramePacking->m_arrangementType == 2);
85  seiFramePacking->m_currentFrameIsFrame0Flag = ((seiFramePacking->m_arrangementType == 5) && (currPicNum&1) );
86  seiFramePacking->m_frame0SelfContainedFlag = 0;
87  seiFramePacking->m_frame1SelfContainedFlag = 0;
88  seiFramePacking->m_frame0GridPositionX = 0;
89  seiFramePacking->m_frame0GridPositionY = 0;
90  seiFramePacking->m_frame1GridPositionX = 0;
91  seiFramePacking->m_frame1GridPositionY = 0;
92  seiFramePacking->m_arrangementReservedByte = 0;
93  seiFramePacking->m_arrangementPersistenceFlag = true;
94  seiFramePacking->m_upsampledAspectRatio = 0;
95}
96
97Void SEIEncoder::initSEISegmentedRectFramePacking(SEISegmentedRectFramePacking *seiSegmentedRectFramePacking)
98{
99  assert (m_isInitialized);
100  assert (seiSegmentedRectFramePacking!=NULL);
101
102  seiSegmentedRectFramePacking->m_arrangementCancelFlag = m_pcCfg->getSegmentedRectFramePackingArrangementSEICancel();
103  seiSegmentedRectFramePacking->m_contentInterpretationType = m_pcCfg->getSegmentedRectFramePackingArrangementSEIType();
104  seiSegmentedRectFramePacking->m_arrangementPersistenceFlag = m_pcCfg->getSegmentedRectFramePackingArrangementSEIPersistence();
105}
106
107Void SEIEncoder::initSEIDisplayOrientation(SEIDisplayOrientation* seiDisplayOrientation)
108{
109  assert (m_isInitialized);
110  assert (seiDisplayOrientation!=NULL);
111
112  seiDisplayOrientation->cancelFlag = false;
113  seiDisplayOrientation->horFlip = false;
114  seiDisplayOrientation->verFlip = false;
115  seiDisplayOrientation->anticlockwiseRotation = m_pcCfg->getDisplayOrientationSEIAngle();
116}
117
118Void SEIEncoder::initSEIToneMappingInfo(SEIToneMappingInfo *seiToneMappingInfo)
119{
120  assert (m_isInitialized);
121  assert (seiToneMappingInfo!=NULL);
122
123  seiToneMappingInfo->m_toneMapId = m_pcCfg->getTMISEIToneMapId();
124  seiToneMappingInfo->m_toneMapCancelFlag = m_pcCfg->getTMISEIToneMapCancelFlag();
125  seiToneMappingInfo->m_toneMapPersistenceFlag = m_pcCfg->getTMISEIToneMapPersistenceFlag();
126
127  seiToneMappingInfo->m_codedDataBitDepth = m_pcCfg->getTMISEICodedDataBitDepth();
128  assert(seiToneMappingInfo->m_codedDataBitDepth >= 8 && seiToneMappingInfo->m_codedDataBitDepth <= 14);
129  seiToneMappingInfo->m_targetBitDepth = m_pcCfg->getTMISEITargetBitDepth();
130  assert(seiToneMappingInfo->m_targetBitDepth >= 1 && seiToneMappingInfo->m_targetBitDepth <= 17);
131  seiToneMappingInfo->m_modelId = m_pcCfg->getTMISEIModelID();
132  assert(seiToneMappingInfo->m_modelId >=0 &&seiToneMappingInfo->m_modelId<=4);
133
134  switch( seiToneMappingInfo->m_modelId)
135  {
136  case 0:
137    {
138      seiToneMappingInfo->m_minValue = m_pcCfg->getTMISEIMinValue();
139      seiToneMappingInfo->m_maxValue = m_pcCfg->getTMISEIMaxValue();
140      break;
141    }
142  case 1:
143    {
144      seiToneMappingInfo->m_sigmoidMidpoint = m_pcCfg->getTMISEISigmoidMidpoint();
145      seiToneMappingInfo->m_sigmoidWidth = m_pcCfg->getTMISEISigmoidWidth();
146      break;
147    }
148  case 2:
149    {
150      UInt num = 1u<<(seiToneMappingInfo->m_targetBitDepth);
151      seiToneMappingInfo->m_startOfCodedInterval.resize(num);
152      Int* ptmp = m_pcCfg->getTMISEIStartOfCodedInterva();
153      if(ptmp)
154      {
155        for(Int i=0; i<num;i++)
156        {
157          seiToneMappingInfo->m_startOfCodedInterval[i] = ptmp[i];
158        }
159      }
160      break;
161    }
162  case 3:
163    {
164      seiToneMappingInfo->m_numPivots = m_pcCfg->getTMISEINumPivots();
165      seiToneMappingInfo->m_codedPivotValue.resize(seiToneMappingInfo->m_numPivots);
166      seiToneMappingInfo->m_targetPivotValue.resize(seiToneMappingInfo->m_numPivots);
167      Int* ptmpcoded = m_pcCfg->getTMISEICodedPivotValue();
168      Int* ptmptarget = m_pcCfg->getTMISEITargetPivotValue();
169      if(ptmpcoded&&ptmptarget)
170      {
171        for(Int i=0; i<(seiToneMappingInfo->m_numPivots);i++)
172        {
173          seiToneMappingInfo->m_codedPivotValue[i]=ptmpcoded[i];
174          seiToneMappingInfo->m_targetPivotValue[i]=ptmptarget[i];
175        }
176      }
177      break;
178    }
179  case 4:
180    {
181      seiToneMappingInfo->m_cameraIsoSpeedIdc = m_pcCfg->getTMISEICameraIsoSpeedIdc();
182      seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue();
183      assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 );
184      seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc();
185      seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue();
186      assert( seiToneMappingInfo->m_exposureIndexValue !=0 );
187      seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag();
188      seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator();
189      seiToneMappingInfo->m_exposureCompensationValueDenomIdc = m_pcCfg->getTMISEIExposureCompensationValueDenomIdc();
190      seiToneMappingInfo->m_refScreenLuminanceWhite = m_pcCfg->getTMISEIRefScreenLuminanceWhite();
191      seiToneMappingInfo->m_extendedRangeWhiteLevel = m_pcCfg->getTMISEIExtendedRangeWhiteLevel();
192      assert( seiToneMappingInfo->m_extendedRangeWhiteLevel >= 100 );
193      seiToneMappingInfo->m_nominalBlackLevelLumaCodeValue = m_pcCfg->getTMISEINominalBlackLevelLumaCodeValue();
194      seiToneMappingInfo->m_nominalWhiteLevelLumaCodeValue = m_pcCfg->getTMISEINominalWhiteLevelLumaCodeValue();
195      assert( seiToneMappingInfo->m_nominalWhiteLevelLumaCodeValue > seiToneMappingInfo->m_nominalBlackLevelLumaCodeValue );
196      seiToneMappingInfo->m_extendedWhiteLevelLumaCodeValue = m_pcCfg->getTMISEIExtendedWhiteLevelLumaCodeValue();
197      assert( seiToneMappingInfo->m_extendedWhiteLevelLumaCodeValue >= seiToneMappingInfo->m_nominalWhiteLevelLumaCodeValue );
198      break;
199    }
200  default:
201    {
202      assert(!"Undefined SEIToneMapModelId");
203      break;
204    }
205  }
206}
207
208Void SEIEncoder::initSEISOPDescription(SEISOPDescription *sopDescriptionSEI, TComSlice *slice, Int picInGOP, Int lastIdr, Int currGOPSize)
209{
210  assert (m_isInitialized);
211  assert (sopDescriptionSEI != NULL);
212  assert (slice != NULL);
213
214  Int sopCurrPOC = slice->getPOC();
215  sopDescriptionSEI->m_sopSeqParameterSetId = slice->getSPS()->getSPSId();
216
217  Int i = 0;
218  Int prevEntryId = picInGOP;
219  for (Int j = picInGOP; j < currGOPSize; j++)
220  {
221    Int deltaPOC = m_pcCfg->getGOPEntry(j).m_POC - m_pcCfg->getGOPEntry(prevEntryId).m_POC;
222    if ((sopCurrPOC + deltaPOC) < m_pcCfg->getFramesToBeEncoded())
223    {
224      sopCurrPOC += deltaPOC;
225      sopDescriptionSEI->m_sopDescVclNaluType[i] = m_pcEncGOP->getNalUnitType(sopCurrPOC, lastIdr, slice->getPic()->isField());
226      sopDescriptionSEI->m_sopDescTemporalId[i] = m_pcCfg->getGOPEntry(j).m_temporalId;
227      sopDescriptionSEI->m_sopDescStRpsIdx[i] = m_pcEncTop->getReferencePictureSetIdxForSOP(slice, sopCurrPOC, j);
228      sopDescriptionSEI->m_sopDescPocDelta[i] = deltaPOC;
229
230      prevEntryId = j;
231      i++;
232    }
233  }
234
235  sopDescriptionSEI->m_numPicsInSopMinus1 = i - 1;
236}
237
238Void SEIEncoder::initSEIBufferingPeriod(SEIBufferingPeriod *bufferingPeriodSEI, TComSlice *slice)
239{
240  assert (m_isInitialized);
241  assert (bufferingPeriodSEI != NULL);
242  assert (slice != NULL);
243
244  UInt uiInitialCpbRemovalDelay = (90000/2);                      // 0.5 sec
245  bufferingPeriodSEI->m_initialCpbRemovalDelay      [0][0]     = uiInitialCpbRemovalDelay;
246  bufferingPeriodSEI->m_initialCpbRemovalDelayOffset[0][0]     = uiInitialCpbRemovalDelay;
247  bufferingPeriodSEI->m_initialCpbRemovalDelay      [0][1]     = uiInitialCpbRemovalDelay;
248  bufferingPeriodSEI->m_initialCpbRemovalDelayOffset[0][1]     = uiInitialCpbRemovalDelay;
249
250  Double dTmp = (Double)slice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)slice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale();
251
252  UInt uiTmp = (UInt)( dTmp * 90000.0 );
253  uiInitialCpbRemovalDelay -= uiTmp;
254  uiInitialCpbRemovalDelay -= uiTmp / ( slice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 );
255  bufferingPeriodSEI->m_initialAltCpbRemovalDelay      [0][0]  = uiInitialCpbRemovalDelay;
256  bufferingPeriodSEI->m_initialAltCpbRemovalDelayOffset[0][0]  = uiInitialCpbRemovalDelay;
257  bufferingPeriodSEI->m_initialAltCpbRemovalDelay      [0][1]  = uiInitialCpbRemovalDelay;
258  bufferingPeriodSEI->m_initialAltCpbRemovalDelayOffset[0][1]  = uiInitialCpbRemovalDelay;
259
260  bufferingPeriodSEI->m_rapCpbParamsPresentFlag = 0;
261  //for the concatenation, it can be set to one during splicing.
262  bufferingPeriodSEI->m_concatenationFlag = 0;
263  //since the temporal layer HRD is not ready, we assumed it is fixed
264  bufferingPeriodSEI->m_auCpbRemovalDelayDelta = 1;
265  bufferingPeriodSEI->m_cpbDelayOffset = 0;
266  bufferingPeriodSEI->m_dpbDelayOffset = 0;
267}
268
269Void SEIEncoder::initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, SEIMessages &nestedSEIs)
270{
271  assert (m_isInitialized);
272  assert (scalableNestingSEI != NULL);
273
274  scalableNestingSEI->m_bitStreamSubsetFlag           = 1;      // If the nested SEI messages are picture buffering SEI messages, picture timing SEI messages or sub-picture timing SEI messages, bitstream_subset_flag shall be equal to 1
275  scalableNestingSEI->m_nestingOpFlag                 = 0;
276  scalableNestingSEI->m_nestingNumOpsMinus1           = 0;      //nesting_num_ops_minus1
277  scalableNestingSEI->m_allLayersFlag                 = 0;
278  scalableNestingSEI->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1;  //nesting_no_op_max_temporal_id_plus1
279  scalableNestingSEI->m_nestingNumLayersMinus1        = 1 - 1;  //nesting_num_layers_minus1
280  scalableNestingSEI->m_nestingLayerId[0]             = 0;
281  scalableNestingSEI->m_callerOwnsSEIs                = true;
282
283  scalableNestingSEI->m_nestedSEIs.clear();
284  for (SEIMessages::iterator it=nestedSEIs.begin(); it!=nestedSEIs.end(); it++)
285  {
286    scalableNestingSEI->m_nestedSEIs.push_back((*it));
287  }
288}
289
290Void SEIEncoder::initSEIRecoveryPoint(SEIRecoveryPoint *recoveryPointSEI, TComSlice *slice)
291{
292  assert (m_isInitialized);
293  assert (recoveryPointSEI != NULL);
294  assert (slice != NULL);
295
296  recoveryPointSEI->m_recoveryPocCnt    = 0;
297#if SVC_EXTENSION
298  recoveryPointSEI->m_exactMatchingFlag = ( slice->getPocValueBeforeReset() == 0 ) ? (true) : (false);
299#else 
300  recoveryPointSEI->m_exactMatchingFlag = ( slice->getPOC() == 0 ) ? (true) : (false);
301#endif
302  recoveryPointSEI->m_brokenLinkFlag    = false;
303}
304
305//! calculate hashes for entire reconstructed picture
306Void SEIEncoder::initDecodedPictureHashSEI(SEIDecodedPictureHash *decodedPictureHashSEI, TComPic *pcPic, std::string &rHashString, const BitDepths &bitDepths)
307{
308  assert (m_isInitialized);
309  assert (decodedPictureHashSEI!=NULL);
310  assert (pcPic!=NULL);
311
312  if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 1)
313  {
314    decodedPictureHashSEI->method = SEIDecodedPictureHash::MD5;
315    UInt numChar=calcMD5(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
316    rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
317  }
318  else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 2)
319  {
320    decodedPictureHashSEI->method = SEIDecodedPictureHash::CRC;
321    UInt numChar=calcCRC(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
322    rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
323  }
324  else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 3)
325  {
326    decodedPictureHashSEI->method = SEIDecodedPictureHash::CHECKSUM;
327    UInt numChar=calcChecksum(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
328    rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
329  }
330}
331
332Void SEIEncoder::initTemporalLevel0IndexSEI(SEITemporalLevel0Index *temporalLevel0IndexSEI, TComSlice *slice)
333{
334  assert (m_isInitialized);
335  assert (temporalLevel0IndexSEI!=NULL);
336  assert (slice!=NULL);
337
338  if (slice->getRapPicFlag())
339  {
340    m_tl0Idx = 0;
341    m_rapIdx = (m_rapIdx + 1) & 0xFF;
342  }
343  else
344  {
345    m_tl0Idx = (m_tl0Idx + (slice->getTLayer() ? 0 : 1)) & 0xFF;
346  }
347  temporalLevel0IndexSEI->tl0Idx = m_tl0Idx;
348  temporalLevel0IndexSEI->rapIdx = m_rapIdx;
349}
350
351Void SEIEncoder::initSEITempMotionConstrainedTileSets (SEITempMotionConstrainedTileSets *sei, const TComPPS *pps)
352{
353  assert (m_isInitialized);
354  assert (sei!=NULL);
355  assert (pps!=NULL);
356
357  if(pps->getTilesEnabledFlag())
358  {
359    sei->m_mc_all_tiles_exact_sample_value_match_flag = false;
360    sei->m_each_tile_one_tile_set_flag                = false;
361    sei->m_limited_tile_set_display_flag              = false;
362    sei->setNumberOfTileSets((pps->getNumTileColumnsMinus1() + 1) * (pps->getNumTileRowsMinus1() + 1));
363
364    for(Int i=0; i < sei->getNumberOfTileSets(); i++)
365    {
366      sei->tileSetData(i).m_mcts_id = i;  //depends the application;
367      sei->tileSetData(i).setNumberOfTileRects(1);
368
369      for(Int j=0; j<sei->tileSetData(i).getNumberOfTileRects(); j++)
370      {
371        sei->tileSetData(i).topLeftTileIndex(j)     = i+j;
372        sei->tileSetData(i).bottomRightTileIndex(j) = i+j;
373      }
374
375      sei->tileSetData(i).m_exact_sample_value_match_flag    = false;
376      sei->tileSetData(i).m_mcts_tier_level_idc_present_flag = false;
377    }
378  }
379  else
380  {
381    assert(!"Tile is not enabled");
382  }
383}
384
385Void SEIEncoder::initSEIKneeFunctionInfo(SEIKneeFunctionInfo *seiKneeFunctionInfo)
386{
387  assert (m_isInitialized);
388  assert (seiKneeFunctionInfo!=NULL);
389
390  seiKneeFunctionInfo->m_kneeId = m_pcCfg->getKneeSEIId();
391  seiKneeFunctionInfo->m_kneeCancelFlag = m_pcCfg->getKneeSEICancelFlag();
392  if ( !seiKneeFunctionInfo->m_kneeCancelFlag )
393  {
394    seiKneeFunctionInfo->m_kneePersistenceFlag = m_pcCfg->getKneeSEIPersistenceFlag();
395    seiKneeFunctionInfo->m_kneeInputDrange = m_pcCfg->getKneeSEIInputDrange();
396    seiKneeFunctionInfo->m_kneeInputDispLuminance = m_pcCfg->getKneeSEIInputDispLuminance();
397    seiKneeFunctionInfo->m_kneeOutputDrange = m_pcCfg->getKneeSEIOutputDrange();
398    seiKneeFunctionInfo->m_kneeOutputDispLuminance = m_pcCfg->getKneeSEIOutputDispLuminance();
399
400    seiKneeFunctionInfo->m_kneeNumKneePointsMinus1 = m_pcCfg->getKneeSEINumKneePointsMinus1();
401    Int* piInputKneePoint  = m_pcCfg->getKneeSEIInputKneePoint();
402    Int* piOutputKneePoint = m_pcCfg->getKneeSEIOutputKneePoint();
403    if(piInputKneePoint&&piOutputKneePoint)
404    {
405      seiKneeFunctionInfo->m_kneeInputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1);
406      seiKneeFunctionInfo->m_kneeOutputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1);
407      for(Int i=0; i<=seiKneeFunctionInfo->m_kneeNumKneePointsMinus1; i++)
408      {
409        seiKneeFunctionInfo->m_kneeInputKneePoint[i] = piInputKneePoint[i];
410        seiKneeFunctionInfo->m_kneeOutputKneePoint[i] = piOutputKneePoint[i];
411      }
412    }
413  }
414}
415
416Void SEIEncoder::initSEIChromaSamplingFilterHint(SEIChromaSamplingFilterHint *seiChromaSamplingFilterHint, Bool bChromaLocInfoPresent, Int iHorFilterIndex, Int iVerFilterIndex)
417{
418  assert (m_isInitialized);
419  assert (seiChromaSamplingFilterHint!=NULL);
420
421  seiChromaSamplingFilterHint->m_verChromaFilterIdc = iVerFilterIndex;
422  seiChromaSamplingFilterHint->m_horChromaFilterIdc = iHorFilterIndex;
423  seiChromaSamplingFilterHint->m_verFilteringProcessFlag = 1;
424  seiChromaSamplingFilterHint->m_targetFormatIdc = 3;
425  seiChromaSamplingFilterHint->m_perfectReconstructionFlag = false;
426  if(seiChromaSamplingFilterHint->m_verChromaFilterIdc == 1)
427  {
428    seiChromaSamplingFilterHint->m_numVerticalFilters = 1;
429    seiChromaSamplingFilterHint->m_verTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int));
430    seiChromaSamplingFilterHint->m_verFilterCoeff =    (Int**)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int*));
431    for(Int i = 0; i < seiChromaSamplingFilterHint->m_numVerticalFilters; i ++)
432    {
433      seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] = 0;
434      seiChromaSamplingFilterHint->m_verFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] * sizeof(Int));
435      for(Int j = 0; j < seiChromaSamplingFilterHint->m_verTapLengthMinus1[i]; j ++)
436      {
437        seiChromaSamplingFilterHint->m_verFilterCoeff[i][j] = 0;
438      }
439    }
440  }
441  else
442  {
443    seiChromaSamplingFilterHint->m_numVerticalFilters = 0;
444    seiChromaSamplingFilterHint->m_verTapLengthMinus1 = NULL;
445    seiChromaSamplingFilterHint->m_verFilterCoeff = NULL;
446  }
447  if(seiChromaSamplingFilterHint->m_horChromaFilterIdc == 1)
448  {
449    seiChromaSamplingFilterHint->m_numHorizontalFilters = 1;
450    seiChromaSamplingFilterHint->m_horTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int));
451    seiChromaSamplingFilterHint->m_horFilterCoeff = (Int**)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int*));
452    for(Int i = 0; i < seiChromaSamplingFilterHint->m_numHorizontalFilters; i ++)
453    {
454      seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] = 0;
455      seiChromaSamplingFilterHint->m_horFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] * sizeof(Int));
456      for(Int j = 0; j < seiChromaSamplingFilterHint->m_horTapLengthMinus1[i]; j ++)
457      {
458        seiChromaSamplingFilterHint->m_horFilterCoeff[i][j] = 0;
459      }
460    }
461  }
462  else
463  {
464    seiChromaSamplingFilterHint->m_numHorizontalFilters = 0;
465    seiChromaSamplingFilterHint->m_horTapLengthMinus1 = NULL;
466    seiChromaSamplingFilterHint->m_horFilterCoeff = NULL;
467  }
468}
469
470Void SEIEncoder::initSEITimeCode(SEITimeCode *seiTimeCode)
471{
472  assert (m_isInitialized);
473  assert (seiTimeCode!=NULL);
474  //  Set data as per command line options
475  seiTimeCode->numClockTs = m_pcCfg->getNumberOfTimesets();
476  for(Int i = 0; i < seiTimeCode->numClockTs; i++)
477  {
478    seiTimeCode->timeSetArray[i] = m_pcCfg->getTimeSet(i);
479  }
480}
481
482#if LAYERS_NOT_PRESENT_SEI
483Void SEIEncoder::initSEILayersNotPresent(SEILayersNotPresent *seiLayersNotPresent)
484{
485  UInt i = 0;
486  seiLayersNotPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId(); 
487  seiLayersNotPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
488  for ( ; i < seiLayersNotPresent->m_vpsMaxLayers; i++)
489  {
490    seiLayersNotPresent->m_layerNotPresentFlag[i] = true; 
491  }
492  for ( ; i < MAX_LAYERS; i++)
493  {
494    seiLayersNotPresent->m_layerNotPresentFlag[i] = false; 
495  }
496}
497#endif
498
499#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
500Void SEIEncoder::initSEIInterLayerConstrainedTileSets(SEIInterLayerConstrainedTileSets *seiInterLayerConstrainedTileSets)
501{
502  seiInterLayerConstrainedTileSets->m_ilAllTilesExactSampleValueMatchFlag = false;
503  seiInterLayerConstrainedTileSets->m_ilOneTilePerTileSetFlag = false;
504  if (!seiInterLayerConstrainedTileSets->m_ilOneTilePerTileSetFlag)
505  {
506    seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1 = m_pcCfg->getIlNumSetsInMessage() - 1;
507    if (seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1)
508    {
509      seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag = m_pcCfg->getSkippedTileSetPresentFlag();
510    }
511    else
512    {
513      seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag = false;
514    }
515    seiInterLayerConstrainedTileSets->m_ilNumSetsInMessageMinus1 += seiInterLayerConstrainedTileSets->m_skippedTileSetPresentFlag ? 1 : 0;
516    for (UInt i = 0; i < m_pcCfg->getIlNumSetsInMessage(); i++)
517    {
518      seiInterLayerConstrainedTileSets->m_ilctsId[i] = i;
519      seiInterLayerConstrainedTileSets->m_ilNumTileRectsInSetMinus1[i] = 0;
520      for( UInt j = 0; j <= seiInterLayerConstrainedTileSets->m_ilNumTileRectsInSetMinus1[i]; j++)
521      {
522        seiInterLayerConstrainedTileSets->m_ilTopLeftTileIndex[i][j]     = m_pcCfg->getTopLeftTileIndex(i);
523        seiInterLayerConstrainedTileSets->m_ilBottomRightTileIndex[i][j] = m_pcCfg->getBottomRightTileIndex(i);
524      }
525      seiInterLayerConstrainedTileSets->m_ilcIdc[i] = m_pcCfg->getIlcIdc(i);
526      if (seiInterLayerConstrainedTileSets->m_ilAllTilesExactSampleValueMatchFlag)
527      {
528        seiInterLayerConstrainedTileSets->m_ilExactSampleValueMatchFlag[i] = false;
529      }
530    }
531  }
532}
533#endif
534
535#if P0123_ALPHA_CHANNEL_SEI
536Void SEIEncoder::initSEIAlphaChannelInfo(SEIAlphaChannelInfo *seiAlphaChannelInfo)
537{
538  seiAlphaChannelInfo->m_alphaChannelCancelFlag = m_pcCfg->getAlphaCancelFlag();
539  if(!seiAlphaChannelInfo->m_alphaChannelCancelFlag)
540  {
541    seiAlphaChannelInfo->m_alphaChannelUseIdc = m_pcCfg->getAlphaUseIdc();
542    seiAlphaChannelInfo->m_alphaChannelBitDepthMinus8 = m_pcCfg->getAlphaBitDepthMinus8();
543    seiAlphaChannelInfo->m_alphaTransparentValue = m_pcCfg->getAlphaTransparentValue();
544    seiAlphaChannelInfo->m_alphaOpaqueValue = m_pcCfg->getAlphaOpaqueValue();
545    seiAlphaChannelInfo->m_alphaChannelIncrFlag = m_pcCfg->getAlphaIncrementFlag();
546    seiAlphaChannelInfo->m_alphaChannelClipFlag = m_pcCfg->getAlphaClipFlag();
547    seiAlphaChannelInfo->m_alphaChannelClipTypeFlag = m_pcCfg->getAlphaClipTypeFlag();
548  }
549}
550#endif
551
552#if Q0096_OVERLAY_SEI
553Void SEIEncoder::initSEIOverlayInfo(SEIOverlayInfo *seiOverlayInfo)
554{ 
555  seiOverlayInfo->m_overlayInfoCancelFlag = m_pcCfg->getOverlaySEICancelFlag();   
556  if ( !seiOverlayInfo->m_overlayInfoCancelFlag )
557  {
558    seiOverlayInfo->m_overlayContentAuxIdMinus128          = m_pcCfg->getOverlaySEIContentAuxIdMinus128(); 
559    seiOverlayInfo->m_overlayLabelAuxIdMinus128            = m_pcCfg->getOverlaySEILabelAuxIdMinus128(); 
560    seiOverlayInfo->m_overlayAlphaAuxIdMinus128            = m_pcCfg->getOverlaySEIAlphaAuxIdMinus128(); 
561    seiOverlayInfo->m_overlayElementLabelValueLengthMinus8 = m_pcCfg->getOverlaySEIElementLabelValueLengthMinus8(); 
562    seiOverlayInfo->m_numOverlaysMinus1                    = m_pcCfg->getOverlaySEINumOverlaysMinus1();     
563    seiOverlayInfo->m_overlayIdx                           = m_pcCfg->getOverlaySEIIdx();           
564    seiOverlayInfo->m_languageOverlayPresentFlag           = m_pcCfg->getOverlaySEILanguagePresentFlag();
565    seiOverlayInfo->m_overlayContentLayerId                = m_pcCfg->getOverlaySEIContentLayerId();   
566    seiOverlayInfo->m_overlayLabelPresentFlag              = m_pcCfg->getOverlaySEILabelPresentFlag();   
567    seiOverlayInfo->m_overlayLabelLayerId                  = m_pcCfg->getOverlaySEILabelLayerId();   
568    seiOverlayInfo->m_overlayAlphaPresentFlag              = m_pcCfg->getOverlaySEIAlphaPresentFlag();   
569    seiOverlayInfo->m_overlayAlphaLayerId                  = m_pcCfg->getOverlaySEIAlphaLayerId();   
570    seiOverlayInfo->m_numOverlayElementsMinus1             = m_pcCfg->getOverlaySEINumElementsMinus1();
571    seiOverlayInfo->m_overlayElementLabelMin               = m_pcCfg->getOverlaySEIElementLabelMin();
572    seiOverlayInfo->m_overlayElementLabelMax               = m_pcCfg->getOverlaySEIElementLabelMax();   
573    seiOverlayInfo->m_overlayLanguage.resize               ( seiOverlayInfo->m_numOverlaysMinus1+1, NULL );
574    seiOverlayInfo->m_overlayLanguageLength.resize         ( seiOverlayInfo->m_numOverlaysMinus1+1 );
575    seiOverlayInfo->m_overlayName.resize                   ( seiOverlayInfo->m_numOverlaysMinus1+1, NULL );
576    seiOverlayInfo->m_overlayNameLength.resize             ( seiOverlayInfo->m_numOverlaysMinus1+1 );
577    seiOverlayInfo->m_overlayElementName.resize            ( seiOverlayInfo->m_numOverlaysMinus1+1 );
578    seiOverlayInfo->m_overlayElementNameLength.resize      ( seiOverlayInfo->m_numOverlaysMinus1+1 ); 
579
580    Int i,j;
581    string strTmp;
582    Int nBytes;
583    assert( m_pcCfg->getOverlaySEILanguage().size()    == seiOverlayInfo->m_numOverlaysMinus1+1 );
584    assert( m_pcCfg->getOverlaySEIName().size()        == seiOverlayInfo->m_numOverlaysMinus1+1 );
585    assert( m_pcCfg->getOverlaySEIElementName().size() == seiOverlayInfo->m_numOverlaysMinus1+1 );
586   
587    for ( i=0 ; i<=seiOverlayInfo->m_numOverlaysMinus1; i++ )
588    {     
589      //language tag
590      if ( seiOverlayInfo->m_languageOverlayPresentFlag[i] )
591      {               
592        strTmp = m_pcCfg->getOverlaySEILanguage()[i];
593        nBytes = (Int)m_pcCfg->getOverlaySEILanguage()[i].size();       
594        assert( nBytes>0 );
595        seiOverlayInfo->m_overlayLanguage[i] = new UChar[nBytes];
596        memcpy(seiOverlayInfo->m_overlayLanguage[i], strTmp.c_str(), nBytes);       
597        seiOverlayInfo->m_overlayLanguageLength[i] = nBytes;       
598      }
599
600      //overlay name
601      strTmp = m_pcCfg->getOverlaySEIName()[i];
602      nBytes = (Int)m_pcCfg->getOverlaySEIName()[i].size();       
603      assert( nBytes>0 );
604      seiOverlayInfo->m_overlayName[i] = new UChar[nBytes];     
605      memcpy(seiOverlayInfo->m_overlayName[i], strTmp.c_str(), nBytes);       
606      seiOverlayInfo->m_overlayNameLength[i] = nBytes;
607
608      //overlay element names
609      if ( seiOverlayInfo->m_overlayLabelPresentFlag[i] )
610      {       
611        seiOverlayInfo->m_overlayElementName[i].resize( seiOverlayInfo->m_numOverlayElementsMinus1[i]+1, NULL );
612        seiOverlayInfo->m_overlayElementNameLength[i].resize( seiOverlayInfo->m_numOverlayElementsMinus1[i]+1 );
613        assert( m_pcCfg->getOverlaySEIElementName()[i].size() == seiOverlayInfo->m_numOverlayElementsMinus1[i]+1 );       
614        for ( j=0 ; j<=seiOverlayInfo->m_numOverlayElementsMinus1[i] ; j++)
615        {
616          strTmp = m_pcCfg->getOverlaySEIElementName()[i][j];
617          nBytes = (Int)m_pcCfg->getOverlaySEIElementName()[i][j].size();       
618          assert( nBytes>0 );
619          seiOverlayInfo->m_overlayElementName[i][j] = new UChar[nBytes];
620          memcpy(seiOverlayInfo->m_overlayElementName[i][j], strTmp.c_str(), nBytes);       
621          seiOverlayInfo->m_overlayElementNameLength[i][j] = nBytes;
622        }
623      }
624    }
625  seiOverlayInfo->m_overlayInfoPersistenceFlag = true;
626  }
627}
628#endif
629
630#if Q0074_COLOUR_REMAPPING_SEI
631Void SEIEncoder::initSEIColourRemappingInfo(SEIColourRemappingInfo *seiColourRemappingInfo, TComSEIColourRemappingInfo* cfgSeiColourRemappingInfo)
632{
633  seiColourRemappingInfo->m_colourRemapId         = cfgSeiColourRemappingInfo->m_colourRemapSEIId;
634  seiColourRemappingInfo->m_colourRemapCancelFlag = cfgSeiColourRemappingInfo->m_colourRemapSEICancelFlag;
635  printf("xCreateSEIColourRemappingInfo - m_colourRemapId = %d m_colourRemapCancelFlag = %d \n",seiColourRemappingInfo->m_colourRemapId, seiColourRemappingInfo->m_colourRemapCancelFlag); 
636
637  if( !seiColourRemappingInfo->m_colourRemapCancelFlag )
638  {
639    seiColourRemappingInfo->m_colourRemapPersistenceFlag            = cfgSeiColourRemappingInfo->m_colourRemapSEIPersistenceFlag;
640    seiColourRemappingInfo->m_colourRemapVideoSignalInfoPresentFlag = cfgSeiColourRemappingInfo->m_colourRemapSEIVideoSignalInfoPresentFlag;
641    if( seiColourRemappingInfo->m_colourRemapVideoSignalInfoPresentFlag )
642    {
643      seiColourRemappingInfo->m_colourRemapFullRangeFlag           = cfgSeiColourRemappingInfo->m_colourRemapSEIFullRangeFlag;
644      seiColourRemappingInfo->m_colourRemapPrimaries               = cfgSeiColourRemappingInfo->m_colourRemapSEIPrimaries;
645      seiColourRemappingInfo->m_colourRemapTransferFunction        = cfgSeiColourRemappingInfo->m_colourRemapSEITransferFunction;
646      seiColourRemappingInfo->m_colourRemapMatrixCoefficients      = cfgSeiColourRemappingInfo->m_colourRemapSEIMatrixCoefficients;
647    }
648    seiColourRemappingInfo->m_colourRemapInputBitDepth             = cfgSeiColourRemappingInfo->m_colourRemapSEIInputBitDepth;
649    seiColourRemappingInfo->m_colourRemapBitDepth                  = cfgSeiColourRemappingInfo->m_colourRemapSEIBitDepth;
650    for( Int c=0 ; c<3 ; c++ )
651    {
652      seiColourRemappingInfo->m_preLutNumValMinus1[c] = cfgSeiColourRemappingInfo->m_colourRemapSEIPreLutNumValMinus1[c];
653      if( seiColourRemappingInfo->m_preLutNumValMinus1[c]>0 )
654      {
655        seiColourRemappingInfo->m_preLutCodedValue[c].resize(seiColourRemappingInfo->m_preLutNumValMinus1[c]+1);
656        seiColourRemappingInfo->m_preLutTargetValue[c].resize(seiColourRemappingInfo->m_preLutNumValMinus1[c]+1);
657        for( Int i=0 ; i<=seiColourRemappingInfo->m_preLutNumValMinus1[c] ; i++)
658        {
659          seiColourRemappingInfo->m_preLutCodedValue[c][i]  = cfgSeiColourRemappingInfo->m_colourRemapSEIPreLutCodedValue[c][i];
660          seiColourRemappingInfo->m_preLutTargetValue[c][i] = cfgSeiColourRemappingInfo->m_colourRemapSEIPreLutTargetValue[c][i];
661        }
662      }
663    }
664    seiColourRemappingInfo->m_colourRemapMatrixPresentFlag = cfgSeiColourRemappingInfo->m_colourRemapSEIMatrixPresentFlag;
665    if( seiColourRemappingInfo->m_colourRemapMatrixPresentFlag )
666    {
667      seiColourRemappingInfo->m_log2MatrixDenom = cfgSeiColourRemappingInfo->m_colourRemapSEILog2MatrixDenom;
668      for( Int c=0 ; c<3 ; c++ )
669        for( Int i=0 ; i<3 ; i++ )
670          seiColourRemappingInfo->m_colourRemapCoeffs[c][i] = cfgSeiColourRemappingInfo->m_colourRemapSEICoeffs[c][i];
671    }
672    for( Int c=0 ; c<3 ; c++ )
673    {
674      seiColourRemappingInfo->m_postLutNumValMinus1[c] = cfgSeiColourRemappingInfo->m_colourRemapSEIPostLutNumValMinus1[c];
675      if( seiColourRemappingInfo->m_postLutNumValMinus1[c]>0 )
676      {
677        seiColourRemappingInfo->m_postLutCodedValue[c].resize(seiColourRemappingInfo->m_postLutNumValMinus1[c]+1);
678        seiColourRemappingInfo->m_postLutTargetValue[c].resize(seiColourRemappingInfo->m_postLutNumValMinus1[c]+1);
679        for( Int i=0 ; i<=seiColourRemappingInfo->m_postLutNumValMinus1[c] ; i++)
680        {
681          seiColourRemappingInfo->m_postLutCodedValue[c][i]  = cfgSeiColourRemappingInfo->m_colourRemapSEIPostLutCodedValue[c][i];
682          seiColourRemappingInfo->m_postLutTargetValue[c][i] = cfgSeiColourRemappingInfo->m_colourRemapSEIPostLutTargetValue[c][i];
683        }
684      }
685    }
686  }
687}
688#endif
689
690
691#if O0164_MULTI_LAYER_HRD
692Void SEIEncoder::initBspNestingSEI(SEIScalableNesting *seiScalableNesting, const TComVPS *vps, const TComSPS *sps, Int olsIdx, Int partitioningSchemeIdx, Int bspIdx)
693{
694  SEIBspInitialArrivalTime *seiBspInitialArrivalTime = new SEIBspInitialArrivalTime();
695  SEIBspNesting *seiBspNesting = new SEIBspNesting();
696  SEIBufferingPeriod *seiBufferingPeriod = new SEIBufferingPeriod();
697
698  // Scalable nesting SEI
699
700  seiScalableNesting->m_bitStreamSubsetFlag           = 1;      // If the nested SEI messages are picture buffereing SEI mesages, picure timing SEI messages or sub-picture timing SEI messages, bitstream_subset_flag shall be equal to 1
701  seiScalableNesting->m_nestingOpFlag                 = 1;
702  seiScalableNesting->m_defaultOpFlag                 = 0;
703  seiScalableNesting->m_nestingNumOpsMinus1           = 0;      //nesting_num_ops_minus1
704  seiScalableNesting->m_nestingOpIdx[0]               = vps->getOutputLayerSetIdx(olsIdx);
705  seiScalableNesting->m_nestingMaxTemporalIdPlus1[0]  = 6 + 1;
706  seiScalableNesting->m_allLayersFlag                 = 0;
707  seiScalableNesting->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1;  //nesting_no_op_max_temporal_id_plus1
708  seiScalableNesting->m_nestingNumLayersMinus1        = 1 - 1;  //nesting_num_layers_minus1
709  seiScalableNesting->m_nestingLayerId[0]             = 0;
710  seiScalableNesting->m_callerOwnsSEIs                = true;
711
712  // Bitstream partition nesting SEI
713
714  seiBspNesting->m_bspIdx = 0;
715  seiBspNesting->m_callerOwnsSEIs = true;
716
717  // Buffering period SEI
718
719  UInt uiInitialCpbRemovalDelay = (90000/2);                      // 0.5 sec
720  seiBufferingPeriod->m_initialCpbRemovalDelay      [0][0]     = uiInitialCpbRemovalDelay;
721  seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][0]     = uiInitialCpbRemovalDelay;
722  seiBufferingPeriod->m_initialCpbRemovalDelay      [0][1]     = uiInitialCpbRemovalDelay;
723  seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][1]     = uiInitialCpbRemovalDelay;
724
725  Double dTmp = (Double)sps->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)sps->getVuiParameters()->getTimingInfo()->getTimeScale();
726
727  UInt uiTmp = (UInt)( dTmp * 90000.0 ); 
728  uiInitialCpbRemovalDelay -= uiTmp;
729  uiInitialCpbRemovalDelay -= uiTmp / ( sps->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 );
730  seiBufferingPeriod->m_initialAltCpbRemovalDelay      [0][0]  = uiInitialCpbRemovalDelay;
731  seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][0]  = uiInitialCpbRemovalDelay;
732  seiBufferingPeriod->m_initialAltCpbRemovalDelay      [0][1]  = uiInitialCpbRemovalDelay;
733  seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][1]  = uiInitialCpbRemovalDelay;
734
735  seiBufferingPeriod->m_rapCpbParamsPresentFlag              = 0;
736  //for the concatenation, it can be set to one during splicing.
737  seiBufferingPeriod->m_concatenationFlag = 0;
738  //since the temporal layer HRD is not ready, we assumed it is fixed
739  seiBufferingPeriod->m_auCpbRemovalDelayDelta = 1;
740  seiBufferingPeriod->m_cpbDelayOffset = 0;
741  seiBufferingPeriod->m_dpbDelayOffset = 0;
742
743  // Intial arrival time SEI message
744
745  seiBspInitialArrivalTime->m_nalInitialArrivalDelay[0] = 0;
746  seiBspInitialArrivalTime->m_vclInitialArrivalDelay[0] = 0;
747
748
749  seiBspNesting->m_nestedSEIs.push_back(seiBufferingPeriod);
750  seiBspNesting->m_nestedSEIs.push_back(seiBspInitialArrivalTime);
751  seiBspNesting->m_bspIdx = bspIdx;
752  seiBspNesting->m_seiOlsIdx = olsIdx;
753  seiBspNesting->m_seiPartitioningSchemeIdx = partitioningSchemeIdx;
754  seiScalableNesting->m_nestedSEIs.push_back(seiBspNesting); // BSP nesting SEI is contained in scalable nesting SEI
755}
756#endif
757
758//! \}
Note: See TracBrowser for help on using the repository browser.