Changeset 962 in 3DVCSoftware


Ignore:
Timestamp:
2 Jul 2014, 18:11:25 (10 years ago)
Author:
tech
Message:

Update to HM-14.0

Integration of:

#define H_MV_HLS_8_SYN_Q0041_03 1 #3 Syntax only (HS /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows …: #define H_MV_HLS_7_OTHER_P0187_1 0 (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
#define H_MV_HLS_8_SYN_39_19 1
#39 Syntax only + (PS/Q0165,Q0078/presence of num_add_output_layer_sets) proposal 2. change condition for presence of num_add_output_layer_sets to avoid sending it when there is only one layer set.
#define H_MV_HLS_8_HRD_Q0101_04 1 #4 (HRD /Q0101/Bitstream part buffer) On Bitstream Partition Buffer. Decision (BF/Cleanup): Adopt (sub-proposals 1–11, refined as described).
#define H_MV_HLS_8_PPS_NODOC_NN 1
#NN (PPS /NODOC/reserved flag): Add a flag in PPS for SHVC color gamut scalability
#define H_MV_HLS_8_MIS_Q0177_47 1 #47 (MISC /Q0177/EOS NAL) proposal 2: clarification of description of end of sequence NAL unit
#define H_MV_HLS_8_HRD_Q0182_05 1
#5 (HRD /Q0182/Bitstream part buffer) Decision (BF/Cleanup/Ed): Adopted (such that we use the main proposal for sub-proposal 1, and alternative 1 for sub-proposal 2). + #define H_MV_HLS_8_HRD_Q0182_06 0 #6 (HRD /Q0182/hrd_parameters) Sub-proposal 2 Alternative 1: Clarify that the VPS hrd_parameters( ) syntax structure that applies to the layer set which is associated with the bitstream partition initial arrival time SEI message is used to determine the lengths of the nal_initial_arrival_delay[ i ] and vcl_initial_arrival_delay[ i ] syntax elements. Decision (BF/Cleanup/Ed): Adopted alternative 1 for sub-proposal 2
#define H_MV_HLS_8_SPS_NODOC_48 1
#48 (SPS /NODOC/PPS extension cleanups) Alignment with RExt
#define H_MV_HLS_8_DBP_NODOC_42 1 #42 (DBP /NODOC/sharing) Remove sub-DPB sharing and processes that mark inter-layer reference pictures as "unused for reference"
#define H_MV_HLS_8_RPS_Q0100_36 1
#36 (RPS /Q0100/constraint to semantics) v3, add constraint to RPS semantics
#define H_MV_HLS_8_POC_Q0142_32 1 #32 (POC /Q0142/poc_lsb_not_present_flag) v2: Add semantic constraints to poc_lsb_not_present_flag.
#define H_MV_HLS_8_HRD_Q0102_08 1
#8 (HRD /Q0102/sps_max_dec_pic_buffering_minus1) Sub-proposal 2: A semantics bug fix is proposed for sps_max_dec_pic_buffering_minus1 as a bug-fix. In discussion, the first option was preferred. Decision (BF/Cleanup/Ed.): Adopt.
#define H_MV_HLS_8_MIS_Q0102_30 1 #30 (MISC /Q0102/loop index) proposal 3, change the max loop index for signaling bit rate and pic rate info to MaxSubLayersInLayerSetMinus1
#define H_MV_HLS_8_GEN_Q0108_13 1
#13 (GEN /Q0108/STSA TemporalId) Agreed to remove restriction from proposal 2, to allow STSA pics of non-base layers to have TemporalId equal to 0.
#define H_MV_HLS_8_PMS_Q0195_21 1 #21 (PS /Q0195/constraint update_ref_format_flag) proposal 2: add a semantic constraint on the value of update_ref_format_flag
#define H_MV_HLS_8_PMS_Q0195_20 1
#20 (PS /Q0195/syntax table rep format) proposal 1: restructure syntax table for sending of rep_format_idx_present_flag and vps_num_ref_formats_minus1
#define H_MV_HLS_8_MIS_Q0177_22 1 #22 (MISC /Q0177/inference sps_temporal_id_nesting_flag) proposal 1: modify inference rule for sps_temporal_id_nesting_flag when it is not present
#define H_MV_HLS_8_PMS_Q0165_18 1
#18 (PS /Q0165/disallow an empty layer set) proposal 1.a), add a constraint to disallow an empty layer set
#define H_MV_HLS_8_RPS_Q0060_17 1 #17 (RPS /Q0060/condition refLayerPicIdc) Proposal 2: Add a condition to the derivation of refLayerPicIdc of (TemporalId == 0)
#define H_MV_HLS_8_POC_Q0146_15 1
#15 (POC /Q0146/inference of poc_msb_val_present_flag) Proposal 1.1: Change inference rule in semantics of poc_msb_val_present_flag

Location:
branches/HTM-11.0-dev0
Files:
48 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.0-dev0/cfg/MV-HEVC/NonCTC/layerwise_startup_IBP_3view.cfg

    r872 r962  
    1111LayerIdsInSet_0               : 0            # Indices in VPS of layers in layer set 0
    1212LayerIdsInSet_1               : 0 1          # Indices in VPS of layers in layer set 1
    13 LayerIdsInSet_3               : 0 1 2        # Indices in VPS of layers in layer set 3
     13LayerIdsInSet_2               : 0 1 2        # Indices in VPS of layers in layer set 3
    1414
    1515DefaultTargetOutputLayerIdc   : 0            # Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet
  • branches/HTM-11.0-dev0/cfg/MV-HEVC/baseCfg_3view.cfg

    r872 r962  
    3131LayerIdsInSet_2               : 0 2          # Indices in VPS of layers in layer set 2
    3232LayerIdsInSet_3               : 0 1 2        # Indices in VPS of layers in layer set 3
     33LayerIdsInSet_4               :
     34LayerIdsInSet_5               :
     35LayerIdsInSet_6               :
     36
    3337
    3438DefaultTargetOutputLayerIdc   : 0            # Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet
     
    3741LayerIdsInAddOutputLayerSet_0 : 1            # Indices in VPS of output layers in additional output layer set 0
    3842LayerIdsInAddOutputLayerSet_1 : 2            # Indices in VPS of output layers in additional output layer set 1
     43LayerIdsInAddOutputLayerSet_2 :              # Indices in VPS of output layers in additional output layer set 1
     44LayerIdsInAddOutputLayerSet_3 :              # Indices in VPS of output layers in additional output layer set 1
     45LayerIdsInAddOutputLayerSet_4 :              # Indices in VPS of output layers in additional output layer set 1
    3946
    4047ProfileLevelTierIdx           : 0 0 0 0 0 0  # Indices to profile level tier (TBD)
  • branches/HTM-11.0-dev0/doc/Doxyfile

    r872 r962  
    3333# if some version control system is used.
    3434
    35 PROJECT_NUMBER         = HM-13.0
     35PROJECT_NUMBER         = HM-14.0
    3636
    3737# Using the PROJECT_BRIEF tag one can provide an optional one line description
  • branches/HTM-11.0-dev0/doc/software-manual.tex

    r872 r962  
    105105        \and
    106106        Karsten S\"uhring
    107         \email{Karsten.Suehring@hhi.fraunhofer.de}
     107        \email{karsten.suehring@hhi.fraunhofer.de}
    108108}
    109109
     
    118118\begin{abstract}
    119119This document is a user manual describing usage of reference software
    120 for the HEVC project. It applies to version 13.0
     120for the HEVC project. It applies to version 14.0
    121121of the software.
    122122\end{abstract}
     
    177177\end{tabular}
    178178\end{table}
     179
     180For encoding large picture sizes (like UHDTV) it is strongly advised to build 64-bit
     181binaries and to use a 64-bit OS. This will allow the software to use more than 2GB of RAM.
    179182
    180183%%%%
     
    16021605\par
    16031606\begin{tabular}{cp{0.45\textwidth}}
    1604   0 & Checkerboard \\
    1605   1 & Line Alternate \\
    1606   2 & Column Alternate \\
    16071607  3 & Side by Side \\
    16081608  4 & Top Bottom \\
    16091609  5 & Frame Alternate \\
    1610   6 & 2D Image \\
    1611   7 & Tile Format \\
    16121610\end{tabular}
    16131611\\
     
    17631761\Option{SEIToneMapCameraIsoSpeedValue} &
    17641762\ShortOption{\None} &
    1765 \Default{420} &
     1763\Default{400} &
    17661764Specifies the camera ISO speed for daylight illumination of Extended_ISO.
     1765\\
     1766\Option{SEIToneMapExposureIndexIdc} &
     1767\ShortOption{\None} &
     1768\Default{0} &
     1769Indicates the exposure index setting of the camera.
     1770\\
     1771\Option{SEIToneMapExposureIndexValue} &
     1772\ShortOption{\None} &
     1773\Default{400} &
     1774Specifies the exposure index setting of the cameran of Extended_ISO.
    17671775\\
    17681776\Option{SEIToneMapExposureCompensationValueSignFlag} &
  • branches/HTM-11.0-dev0/source/App/TAppDecoder/TAppDecCfg.h

    r872 r962  
    4545#include "TLibCommon/CommonDef.h"
    4646#include <vector>
    47 
    4847//! \ingroup TAppDecoder
    4948//! \{
  • branches/HTM-11.0-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r884 r962  
    7070    m_pScaleOffsetFile  = 0;
    7171#endif
     72
     73#if H_MV_HLS_7_VPS_P0300_27
     74    m_markedForOutput = false;
     75#endif
     76
    7277}
    7378
     
    152157  Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen)
    153158#else
    154 #if H_3D
     159
    155160  Int  pocCurrPic        = -MAX_INT;     
    156161  Int  pocLastPic        = -MAX_INT;   
    157 #endif
    158 
     162
     163#if H_MV_HLS_7_VPS_P0300_27
     164  Int  layerIdLastPic    = -MAX_INT;
     165#endif
    159166  Int  layerIdCurrPic    = 0;
    160167
     
    188195    Bool newSliceDiffPoc   = false;
    189196    Bool newSliceDiffLayer = false;
    190     Bool sliceSkippedFlag = false;
    191 #if H_3D
     197    Bool sliceSkippedFlag  = false;
    192198    Bool allLayersDecoded  = false;     
    193 #endif
    194199#endif
    195200    if (nalUnit.empty())
     
    210215          || nalu.m_layerId > MAX_NUM_LAYER_IDS-1
    211216          || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0)           
    212           || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)           
     217          || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)   
     218#if H_MV_HLS_8_MIS_Q0177_47
     219          || (nalu.m_nalUnitType == NAL_UNIT_EOS && nalu.m_layerId > 0)   
     220#endif
    213221         )
    214222      {
     
    229237        // - nalu.isSlice() == true     
    230238
     239#if H_MV_HLS_7_VPS_P0300_27
     240        if ( nalu.m_nalUnitType == NAL_UNIT_VPS )
     241        {
     242          m_vps = m_tDecTop[decIdx]->getPrefetchedVPS();
     243          if ( m_targetDecLayerIdSetFileEmpty )
     244          {
     245            TComVPS* vps = m_vps;
     246#else
    231247        // Update TargetDecLayerIdList only when not specified by layer id file, specification by file might actually out of conformance.
    232248        if (nalu.m_nalUnitType == NAL_UNIT_VPS && m_targetDecLayerIdSetFileEmpty )
    233249        {
    234250          TComVPS* vps = m_tDecTop[decIdx]->getPrefetchedVPS();
     251#endif
    235252          if ( m_targetOptLayerSetIdx == -1 )
    236253          {
     
    238255            m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1();
    239256          }
     257#if H_MV_HLS_8_HRD_Q0102_08
     258          for (Int dI = 0; dI < m_numDecoders; dI++ )
     259          {
     260            m_tDecTop[decIdx]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );
     261          }
     262#endif
    240263
    241264          if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
     
    246269          m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
    247270        }
    248 
     271#if H_MV_HLS_7_VPS_P0300_27
     272      }
     273#endif
    249274#if H_3D
    250275        if (nalu.m_nalUnitType == NAL_UNIT_VPS )
     
    257282        {
    258283          layerIdCurrPic = nalu.m_layerId;
    259 #if H_3D
    260284          pocCurrPic     = m_tDecTop[decIdx]->getCurrPoc();
    261 #endif
    262285          decIdxCurrPic  = decIdx;
    263286          firstSlice     = false;
     
    266289        if ( bNewPicture || !bitstreamFile )
    267290        {
     291#if H_MV_HLS_7_VPS_P0300_27
     292          layerIdLastPic    = layerIdCurrPic;
     293#endif
    268294          layerIdCurrPic    = nalu.m_layerId;
    269 #if H_3D         
    270295          pocLastPic        = pocCurrPic;
    271296          pocCurrPic        = m_tDecTop[decIdx]->getCurrPoc();
    272 #endif         
    273297          decIdxLastPic     = decIdxCurrPic;
    274298          decIdxCurrPic     = decIdx;
    275 #if H_3D
    276299          allLayersDecoded = ( pocCurrPic != pocLastPic );
    277 #endif
    278300        }
    279301#else
     
    318340        assert( decIdxLastPic != -1 );
    319341        m_tDecTop[decIdxLastPic]->endPicDecoding(poc, pcListPic, m_targetDecLayerIdSet );
     342#if H_MV_HLS_7_VPS_P0300_27
     343        xMarkForOutput( allLayersDecoded, poc, layerIdLastPic );
     344#endif
    320345#else
    321346        m_cTDecTop.executeLoopFilters(poc, pcListPic);
     
    324349      loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    325350    }
     351#if !FIX_WRITING_OUTPUT
     352#if SETTING_NO_OUT_PIC_PRIOR
     353    if (bNewPicture && m_cTDecTop.getIsNoOutputPriorPics())
     354    {
     355      m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     356    }
     357#endif
     358#endif
    326359#if H_3D
    327360    if ( allLayersDecoded || !bitstreamFile )
     
    351384        m_reconOpen[decIdxLastPic] = true;
    352385      }
     386#if FIX_WRITING_OUTPUT
     387      // write reconstruction to file
     388      if( bNewPicture )
     389      {
     390        // Bumping after picture has been decoded
     391#if ENC_DEC_TRACE
     392        g_bJustDoIt = true; 
     393        writeToTraceFile( "Bumping after decoding \n", g_decTracePicOutput  );         
     394        g_bJustDoIt = false; 
     395#endif
     396        xWriteOutput( pcListPic, decIdxLastPic, nalu.m_temporalId );
     397      }
     398#if SETTING_NO_OUT_PIC_PRIOR
     399      if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_tDecTop[decIdxLastPic]->getNoOutputPriorPicsFlag() )
     400      {
     401        m_tDecTop[decIdxLastPic]->checkNoOutputPriorPics( pcListPic );
     402        m_tDecTop[decIdxLastPic]->setNoOutputPriorPicsFlag (false);
     403      }
     404#endif
     405#endif
    353406      if ( bNewPicture && newSliceDiffPoc &&
    354407#else
     
    356409        openedReconFile  = true;
    357410      }
     411#if FIX_WRITING_OUTPUT
     412      // write reconstruction to file
     413      if( bNewPicture )
     414      {
     415        xWriteOutput( pcListPic, nalu.m_temporalId );
     416      }
     417#if SETTING_NO_OUT_PIC_PRIOR
     418      if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() )
     419      {
     420        m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     421        m_cTDecTop.setNoOutputPriorPicsFlag (false);
     422      }
     423#endif
     424#endif
    358425      if ( bNewPicture &&
    359426#endif
     
    373440      {
    374441#if H_MV
     442#if FIX_OUTPUT_EOS
     443        xWriteOutput( pcListPic, decIdxLastPic, nalu.m_temporalId );
     444#else
    375445        xFlushOutput( pcListPic, decIdxLastPic );
     446#endif
     447#else
     448#if FIX_OUTPUT_EOS
     449        xWriteOutput( pcListPic, nalu.m_temporalId );
    376450#else
    377451        xFlushOutput( pcListPic );
    378452#endif
    379       }
    380       // write reconstruction to file
     453
     454#endif
     455      }
     456      // write reconstruction to file -- for additional bumping as defined in C.5.2.3
     457#if H_MV
     458      // Above comment seems to be wrong
     459#endif
     460#if FIX_WRITING_OUTPUT
     461      if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
     462#else
    381463      if(bNewPicture)
    382       {
    383 #if H_MV
    384         xWriteOutput( pcListPic, decIdxLastPic, nalu.m_temporalId );
    385       }
    386     }
    387   }
    388 
     464#endif
     465      {
     466#if H_MV       
     467        // Bumping after reference picture set has been applied (here after first vcl nalu.
     468#if ENC_DEC_TRACE
     469        g_bJustDoIt = true; 
     470        writeToTraceFile( "Bumping after reference picture set has been applied \n", g_decTracePicOutput  );         
     471        g_bJustDoIt = false; 
     472#endif
     473
     474        xWriteOutput( m_tDecTop[decIdxCurrPic]->getListPic(), decIdxCurrPic, nalu.m_temporalId );
     475#else
     476        xWriteOutput( pcListPic, nalu.m_temporalId );
     477#endif
     478      }
     479    }
     480  }
     481#if H_MV
    389482#if H_3D
    390483  if( m_cCamParsCollector.isInitialized() )
     
    397490    xFlushOutput( m_tDecTop[decIdx]->getListPic(), decIdx );
    398491  }
    399 #else
    400         xWriteOutput( pcListPic, nalu.m_temporalId );
    401       }
    402     }
    403   }
    404  
     492#else 
    405493  xFlushOutput( pcListPic );
    406494  // delete buffers
     
    497585  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    498586  Int numPicsNotYetDisplayed = 0;
     587  Int dpbFullness = 0;
     588#if H_MV
     589  // preliminary fix
     590  TComSPS* activeSPS = m_tDecTop[0]->getActiveSPS();
     591#else
     592  TComSPS* activeSPS = m_cTDecTop.getActiveSPS();
     593#endif
     594  UInt numReorderPicsHighestTid;
     595  UInt maxDecPicBufferingHighestTid;
     596  UInt maxNrSublayers = activeSPS->getMaxTLayers();
     597
     598  if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers)
     599  {
     600    numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1);
     601    maxDecPicBufferingHighestTid =  activeSPS->getMaxDecPicBuffering(maxNrSublayers-1);
     602  }
     603  else
     604  {
     605    numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer);
     606    maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer);
     607  }
    499608 
    500609  while (iterPic != pcListPic->end())
     
    508617    {
    509618      numPicsNotYetDisplayed++;
     619      dpbFullness++;
     620    }
     621    else if(pcPic->getSlice( 0 )->isReferenced())
     622    {
     623      dpbFullness++;
    510624    }
    511625    iterPic++;
     
    533647          && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_pocLastDisplay[decIdx]+1 || m_pocLastDisplay[decIdx]<0)))
    534648#else
    535       if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed >  pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1)
    536           && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0)))
     649      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
     650          (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
     651          (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&
     652          (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0))
    537653#endif
    538654      {
     
    552668        assert( conf   .getScaledFlag() );
    553669        assert( defDisp.getScaledFlag() );
     670#if ENC_DEC_TRACE
     671        g_bJustDoIt = true; 
     672        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     673        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     674        g_bJustDoIt = false; 
     675#endif
    554676        m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    555677#else
     
    613735
    614736#if H_MV
    615       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx]))
     737      if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx] &&
     738        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    616739#else     
    617       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))
     740      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
     741        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    618742#endif
    619743      {
    620744        // write to file
    621745        numPicsNotYetDisplayed--;
     746        if(pcPic->getSlice(0)->isReferenced() == false)
     747        {
     748          dpbFullness--;
     749        }
    622750#if H_MV
    623751      if ( m_pchReconFiles[decIdx] )
     
    631759        assert( conf   .getScaledFlag() );
    632760        assert( defDisp.getScaledFlag() );
     761#if ENC_DEC_TRACE
     762        g_bJustDoIt = true; 
     763        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     764        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     765        g_bJustDoIt = false;
     766#endif
    633767        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    634768#else
     
    665799        }
    666800        pcPic->setOutputMark(false);
     801#if H_MV_HLS_7_VPS_P0300_27
     802        pcPic->setPicOutputFlag(false);
     803#endif
    667804      }
    668805     
     
    715852        assert( conf   .getScaledFlag() );
    716853        assert( defDisp.getScaledFlag() );
     854#if ENC_DEC_TRACE
     855        g_bJustDoIt = true; 
     856        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     857        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     858        g_bJustDoIt = false; 
     859#endif
    717860        m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    718861#else
     
    802945        assert( conf   .getScaledFlag() );
    803946        assert( defDisp.getScaledFlag() );
     947#if ENC_DEC_TRACE
     948        g_bJustDoIt = true; 
     949        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  );
     950        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
     951        g_bJustDoIt = false; 
     952#endif
    804953        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    805954#else
     
    836985        }
    837986        pcPic->setOutputMark(false);
     987#if H_MV_HLS_7_VPS_P0300_27
     988        pcPic->setPicOutputFlag(false);
     989#endif
    838990      }
    839991#if !H_MV
     
    9091061    m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );
    9101062    m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags );
     1063#if    H_MV_HLS_8_HRD_Q0102_08
     1064    m_tDecTop[ decIdx ]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );   
     1065#endif
    9111066
    9121067#if H_3D
     
    9411096  };
    9421097  return decIdx;
     1098
    9431099}
     1100
     1101
     1102#if H_MV_HLS_7_VPS_P0300_27
     1103Void TAppDecTop::xMarkForOutput( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic )
     1104
     1105  vector<Int> targetOptLayerIdList = m_vps->getTargetOptLayerIdList( m_targetOptLayerSetIdx );
     1106
     1107  if (m_vps->getAltOutputLayerFlagVar( m_targetOptLayerSetIdx ) )
     1108  {
     1109    assert( targetOptLayerIdList.size() == 1 );
     1110    Int targetLayerId = targetOptLayerIdList[0];     
     1111
     1112    TComPic* curPic = m_ivPicLists.getPic( layerIdLastPic, pocLastPic );
     1113    assert( curPic != NULL );
     1114
     1115    if ( layerIdLastPic == targetLayerId )
     1116    {
     1117      if ( curPic->getPicOutputFlag() )
     1118      {
     1119        curPic->setOutputMark( true );
     1120      }
     1121      else
     1122      {       
     1123        xMarkAltOutPic( targetLayerId, pocLastPic );
     1124      }
     1125      m_markedForOutput = true;
     1126    }
     1127    else if ( ( layerIdLastPic > targetLayerId || allLayersDecoded ) && !m_markedForOutput )
     1128    {
     1129      xMarkAltOutPic( targetLayerId, pocLastPic );
     1130    }
     1131
     1132    if ( allLayersDecoded )
     1133    {
     1134      m_markedForOutput = false;
     1135    }
     1136  }
     1137  else
     1138  {
     1139    for( Int dI = 0; dI < m_numDecoders; dI++ )
     1140    {     
     1141      Int layerId = m_tDecTop[dI]->getLayerId();
     1142      TComPic* curPic = m_ivPicLists.getPic( layerId, pocLastPic );
     1143      if ( curPic != NULL )
     1144      {
     1145        if ( curPic->getReconMark() )
     1146        {
     1147          Bool isTargetOptLayer = std::find(targetOptLayerIdList.begin(), targetOptLayerIdList.end(), layerId) != targetOptLayerIdList.end();
     1148          curPic->setOutputMark( isTargetOptLayer ? curPic->getPicOutputFlag() : false );
     1149        }
     1150      }
     1151    }
     1152  }
     1153}
     1154#endif
    9441155#endif
    9451156//! \}
  • branches/HTM-11.0-dev0/source/App/TAppDecoder/TAppDecTop.h

    r872 r962  
    6868  TComPicLists                    m_ivPicLists;                                ///< picture buffers of decoder instances
    6969  Bool                            m_layerInitilizedFlags[ MAX_NUM_LAYER_IDS ]; ///< for layerwise startup
    70 
     70#if H_MV_HLS_7_VPS_P0300_27
     71  TComVPS*                        m_vps;                                ///< active VPS
     72#endif
    7173#else
    7274  TDecTop                         m_cTDecTop;                     ///< decoder class
     
    8082  Int                             m_iPOCLastDisplay;              ///< last POC in display order
    8183#endif
     84#if H_MV_HLS_7_VPS_P0300_27
     85  Bool                            m_markedForOutput;
     86#endif
     87
     88
    8289#if H_3D
    8390  FILE*                           m_pScaleOffsetFile;
     
    99106#if H_MV
    100107  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file
     108
     109#if H_MV_HLS_7_VPS_P0300_27
     110  Void  xMarkForOutput   ( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic );         
     111  Void  xMarkAltOutPic    ( Int targetOutputLayer, Int pocLastPic )
     112  {
     113    Int optLayerIdxInVps = m_vps->getLayerIdInNuh( targetOutputLayer );
     114    Int highestNuhLayerId = -1;
     115    TComPic* picWithHighestNuhLayerId = NULL;
     116    for (Int dIdx = 0; dIdx < m_numDecoders; dIdx++)
     117    {
     118      Int curLayerId = m_tDecTop[dIdx]->getLayerId();
     119      Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId  );
     120      if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) )
     121      {
     122        TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic );
     123        if (curPic != NULL)
     124        {
     125          if (curPic->getReconMark() && curPic->getPicOutputFlag() )
     126          {
     127            curPic->setOutputMark   ( false );
     128            curPic->setPicOutputFlag( false );
     129            if ( curLayerId > highestNuhLayerId)
     130            {
     131              highestNuhLayerId = curLayerId ;
     132              picWithHighestNuhLayerId = curPic;
     133            }           
     134          }
     135        }
     136      }
     137    }
     138    if ( picWithHighestNuhLayerId != NULL )
     139    {
     140      picWithHighestNuhLayerId->setPicOutputFlag(true);
     141      picWithHighestNuhLayerId->setOutputMark   (true);
     142    }
     143  }
     144#endif
     145
    101146  Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file
    102147  Int   xGetDecoderIdx    ( Int layerId, Bool createFlag = false );
  • branches/HTM-11.0-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r956 r962  
    388388  ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    389389  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
    390   ("DefaultTargetOutputLayerIdc"     , m_defaultTargetOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
     390  ("DefaultTargetOutputLayerIdc"     , m_defaultOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
    391391  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 
    392392
    393393  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 
    394394  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 
     395#if H_MV_HLS_7_VPS_P0300_27
     396  ("AltOutputLayerFlag",    m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag")
     397#endif
    395398  ("ProfileLevelTierIdx",   m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier")
    396399 
     
    453456("IntraPeriod,-ip",         m_iIntraPeriod,              -1, "Intra period in frames, (-1: only first frame)")
    454457#endif
     458#if ALLOW_RECOVERY_POINT_AS_RAP
     459  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
     460#else
    455461  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
     462#endif
    456463  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
    457464  // motion options
     
    470477  ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5")
    471478  ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6")
    472   ("LambdaModifier7,-LM7", m_adLambdaModifier[ 7 ], ( Double )1.0, "Lambda modifier for temporal layer 7")
    473479
    474480  /* Quantization parameters */
     
    694700  ("SEIToneMapCameraIsoSpeedIdc",                     m_cameraIsoSpeedIdc,                        0, "Indicates the camera ISO speed for daylight illumination")
    695701  ("SEIToneMapCameraIsoSpeedValue",                   m_cameraIsoSpeedValue,                    400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
     702  ("SEIToneMapExposureIndexIdc",                      m_exposureIndexIdc,                         0, "Indicates the exposure index setting of the camera")
     703  ("SEIToneMapExposureIndexValue",                    m_exposureIndexValue,                     400, "Specifies the exposure index setting of the cameran of Extended_ISO")
    696704  ("SEIToneMapExposureCompensationValueSignFlag",     m_exposureCompensationValueSignFlag,        0, "Specifies the sign of ExposureCompensationValue")
    697705  ("SEIToneMapExposureCompensationValueNumerator",    m_exposureCompensationValueNumerator,       0, "Specifies the numerator of ExposureCompensationValue")
     
    724732  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    725733  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
     734#if H_MV
    726735  ("SubBitstreamPropSEIEnabled",              m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
    727736  ("SEISubBitstreamNumAdditionalSubStreams",  m_sbPropNumAdditionalSubStreams,0, "Number of substreams for which additional information is signalled")
     
    731740  ("SEISubBitstreamAvgBitRate",               m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
    732741  ("SEISubBitstreamMaxBitRate",               m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
     742#endif
    733743#if H_3D
    734744  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     
    10471057  xResizeVector( m_loopFilterNotAcrossTilesFlag );
    10481058  xResizeVector( m_wppInUseFlag );
     1059
     1060#if H_MV_HLS_7_VPS_P0300_27
     1061  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + (Int) m_outputLayerSetIdx.size(); olsIdx++)
     1062  {   
     1063    m_altOutputLayerFlag.push_back( false );     
     1064  }
     1065#endif
    10491066#else
    10501067  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
     
    14171434  }
    14181435
    1419   xConfirmPara( m_defaultTargetOutputLayerIdc < 0 || m_defaultTargetOutputLayerIdc > 2, "Default target output layer idc must greater than or equal to 0 and less than or equal to 2." ); 
    1420 
    1421   if( m_defaultTargetOutputLayerIdc != 2 )
     1436  xConfirmPara( m_defaultOutputLayerIdc < 0 || m_defaultOutputLayerIdc > 2, "Default target output layer idc must greater than or equal to 0 and less than or equal to 2." ); 
     1437
     1438  if( m_defaultOutputLayerIdc != 2 )
    14221439  {
    14231440    Bool anyDefaultOutputFlag = false;   
     
    14481465  }
    14491466
     1467#if H_MV_HLS_7_VPS_P0300_27
     1468  xConfirmPara( m_altOutputLayerFlag.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
     1469#endif
    14501470  xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
    14511471
     
    14721492  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
    14731493#endif
     1494#if ALLOW_RECOVERY_POINT_AS_RAP
     1495  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3,                   "Decoding Refresh Type must be comprised between 0 and 3 included" );
     1496  if(m_iDecodingRefreshType == 3)
     1497  {
     1498    xConfirmPara( !m_recoveryPointSEIEnabled,                                               "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" );
     1499  }
     1500#else
    14741501  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2,                   "Decoding Refresh Type must be equal to 0, 1 or 2" );
     1502#endif
    14751503#if H_MV
    14761504  for( Int layer = 0; layer < m_numberOfLayers; layer++ )
     
    21822210    xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
    21832211    xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
     2212    xConfirmPara( m_exposureIndexValue  == 0, "SEIToneMapExposureIndexValue shall not be equal to 0");
    21842213    xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
    21852214    xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
  • branches/HTM-11.0-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r950 r962  
    8989  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    9090  std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set
    91   Int                    m_defaultTargetOutputLayerIdc;       ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
     91  Int                    m_defaultOutputLayerIdc;       ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
    9292  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets 
    9393  std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
    9494  std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
    9595  std::vector<Int>       m_profileLevelTierIdx;               ///< Indices of of profile level tier
    96  
     96  #if H_MV_HLS_7_VPS_P0300_27
     97  std::vector<Bool>      m_altOutputLayerFlag;                ///< Alt output layer flag
     98#endif
     99
    97100  // Dependencies
    98101  std::vector< std::vector<Int> > m_directRefLayers;          ///< LayerIds of direct reference layers
     
    338341  Int       m_cameraIsoSpeedIdc;
    339342  Int       m_cameraIsoSpeedValue;
     343  Int       m_exposureIndexIdc;
     344  Int       m_exposureIndexValue;
    340345  Int       m_exposureCompensationValueSignFlag;
    341346  Int       m_exposureCompensationValueNumerator;
  • branches/HTM-11.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r950 r962  
    5757TAppEncTop::TAppEncTop()
    5858{
     59
     60#if H_MV_HLS_8
     61  m_vps = new TComVPS;
     62#endif
    5963#if !H_MV
    6064  m_iFrameRcvd = 0;
     
    6670TAppEncTop::~TAppEncTop()
    6771{
     72#if H_MV_HLS_8
     73  if (m_vps)
     74  {
     75   delete m_vps;
     76  };
     77#endif
     78
    6879}
    6980
     
    7182{
    7283#if H_MV
     84#if H_MV_HLS_8
     85  TComVPS& vps = (*m_vps);   
     86#else
    7387  TComVPS& vps = m_vps;   
     88#endif
    7489#else
    7590  TComVPS vps;
     
    409424  m_cTEncTop.setTMISEICameraIsoSpeedIdc                   ( m_cameraIsoSpeedIdc );
    410425  m_cTEncTop.setTMISEICameraIsoSpeedValue                 ( m_cameraIsoSpeedValue );
     426  m_cTEncTop.setTMISEIExposureIndexIdc                    ( m_exposureIndexIdc );
     427  m_cTEncTop.setTMISEIExposureIndexValue                  ( m_exposureIndexValue );
    411428  m_cTEncTop.setTMISEIExposureCompensationValueSignFlag   ( m_exposureCompensationValueSignFlag );
    412429  m_cTEncTop.setTMISEIExposureCompensationValueNumerator  ( m_exposureCompensationValueNumerator );
     
    691708{
    692709#if H_3D
     710#if H_MV_HLS_8
     711  for ( Int viewIndex = 0; viewIndex < m_vps->getNumViews(); viewIndex++ )
     712  {
     713    m_vps->initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(),
     714      m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
     715#else
    693716  for ( Int viewIndex = 0; viewIndex < m_vps.getNumViews(); viewIndex++ )
    694717  {
    695     m_vps.initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(),
     718  m_vps.initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(),
    696719      m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
     720#endif
    697721  }
    698722#endif
     
    12751299
    12761300  Int  defaultDirectDependencyType = -1;
     1301#if MV_FIX_DEP_TYPES
     1302  Bool defaultDirectDependencyFlag = false;
     1303#else
    12771304  Bool defaultDirectDependencyFlag = true;
     1305#endif
     1306
    12781307  for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ )
    12791308  {
     
    12931322      {
    12941323        defaultDirectDependencyType = curDirectDependencyType;
     1324#if MV_FIX_DEP_TYPES
     1325        defaultDirectDependencyFlag = true;
     1326#endif
    12951327      }
    12961328     
     
    14821514Void TAppEncTop::xSetRepFormat( TComVPS& vps )
    14831515{
     1516#if H_MV_HLS_8_PMS_Q0195_20
     1517  vps.setRepFormatIdxPresentFlag( false );
     1518#else
    14841519  vps.setRepFormatIdxPresentFlag( true );
     1520#endif
    14851521  vps.setVpsNumRepFormatsMinus1 ( 0    );
    14861522
     
    14991535  vps.setRepFormat( 0 , repFormat );
    15001536
     1537#if !H_MV_HLS_8_PMS_Q0195_20
    15011538  for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ )
    15021539  {
    15031540    vps.setVpsRepFormatIdx( i , 0 );
    15041541  }
     1542#endif
    15051543}
    15061544
     
    15131551  assert ( dpbSize != 0 );
    15141552
     1553#if H_MV_HLS_8_HRD_Q0102_08
     1554  for( Int i = 0; i < vps.getNumOutputLayerSets(); i++ )
     1555#else
    15151556  for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ )
     1557#endif
    15161558  { 
     1559#if H_MV_HLS_8_MIS_Q0102_30
     1560    Int currLsIdx = vps.olsIdxToLsIdx( i );
     1561#endif
    15171562    std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i );
    15181563    Bool subLayerFlagInfoPresentFlag = false;
    15191564
     1565#if H_MV_HLS_8_MIS_Q0102_30
     1566    for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
     1567#else
    15201568    for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1569#endif
    15211570    {   
    15221571      Bool subLayerDpbInfoPresentFlag = false;
    1523       assert( vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i ) ) == targetDecLayerIdList.size() );
    1524       for( Int k = 0; k < vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i )); k++ )   
     1572#if H_MV_HLS_8_MIS_Q0102_30 || H_MV_HLS_8_DBP_NODOC_42
     1573      assert( vps.getNumLayersInIdList( currLsIdx ) == targetDecLayerIdList.size() );
     1574      for( Int k = 0; k < vps.getNumLayersInIdList( currLsIdx ); k++ )   
     1575#else
     1576      assert( vps.getNumSubDpbs( vps.olsIdxToLsIdx( i ) ) == targetDecLayerIdList.size() );
     1577      for( Int k = 0; k < vps.getNumSubDpbs( vps.olsIdxToLsIdx( i )); k++ )   
     1578#endif
    15251579      {
    15261580        Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
     
    15871641  Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size();
    15881642  // Additional output layer sets + profileLevelTierIdx
    1589   vps.setDefaultTargetOutputLayerIdc      ( m_defaultTargetOutputLayerIdc );   
    1590   vps.setNumAddOutputLayerSets            ( numAddOuputLayerSets          );
     1643  vps.setDefaultOutputLayerIdc      ( m_defaultOutputLayerIdc );   
     1644#if H_MV_HLS_8_SYN_39_19
     1645  vps.setNumAddLayerSets            ( 0                             ); 
     1646  vps.setNumAddOlss                 ( numAddOuputLayerSets          );
     1647#else
     1648  vps.setNumAddLayerSets            ( numAddOuputLayerSets          );
     1649#endif
    15911650  vps.initTargetLayerIdLists();
    15921651
     
    15951654    Int addOutLsIdx = olsIdx - m_vpsNumLayerSets;     
    15961655   
    1597     vps.setOutputLayerSetIdxMinus1( olsIdx, ( ( addOutLsIdx < 0 ) ?  olsIdx  : m_outputLayerSetIdx[ addOutLsIdx ] ) - 1 );
    1598 
    1599     std::vector<Int>& layerIdList    = m_layerIdsInSets[ vps.getLayerSetIdxForOutputLayerSet( olsIdx ) ];
    1600 
    1601     if (vps.getDefaultTargetOutputLayerIdc() == 2 || addOutLsIdx >= 0 )
     1656    vps.setLayerSetIdxForOlsMinus1( olsIdx, ( ( addOutLsIdx < 0 ) ?  olsIdx  : m_outputLayerSetIdx[ addOutLsIdx ] ) - 1 );
     1657
     1658    std::vector<Int>& layerIdList    = m_layerIdsInSets[ vps.olsIdxToLsIdx( olsIdx ) ];
     1659
     1660    if (vps.getDefaultOutputLayerIdc() == 2 || addOutLsIdx >= 0 )
    16021661    {
    16031662      for ( Int i = 0; i < layerIdList.size(); i++)
     
    16371696      vps.setProfileLevelTierIdx( olsIdx, m_profileLevelTierIdx[ olsIdx ] );
    16381697    }
    1639 
     1698#if H_MV_HLS_7_VPS_P0300_27
     1699    if ( vps.getNumOutputLayersInOutputLayerSet( olsIdx ) == 1 &&
     1700        vps.getNumDirectRefLayers( vps.getOlsHighestOutputLayerId( olsIdx ) ) )
     1701    {   
     1702      vps.setAltOutputLayerFlag( olsIdx , m_altOutputLayerFlag[ olsIdx ]);
     1703    }
     1704    else
     1705    {
     1706      vps.setAltOutputLayerFlag( olsIdx , false );
     1707      if ( m_altOutputLayerFlag[ olsIdx ] )
     1708      {
     1709        printf( "\nWarning: Ignoring AltOutputLayerFlag for output layer set %d, since more than one output layer or no dependent layers.\n", olsIdx );           
     1710      }
     1711    }
     1712#else
    16401713    vps.setAltOutputLayerFlag( olsIdx , false);     
    1641   }
    1642 
     1714#endif
     1715  }
    16431716}
    16441717
  • branches/HTM-11.0-dev0/source/App/TAppEncoder/TAppEncTop.h

    r872 r962  
    7575
    7676  TComPicLists               m_ivPicLists;                  ///< picture buffers of encoder instances
     77#if H_MV_HLS_8
     78  TComVPS*                   m_vps;                         ///< vps
     79#else
    7780  TComVPS                    m_vps;                         ///< vps
     81#endif
    7882#else
    7983  TEncTop                    m_cTEncTop;                    ///< encoder class
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/CommonDef.h

    r951 r962  
    6161#if H_MV
    6262#define NV_VERSION        "11.0"                ///< Current software version
    63 #define HM_VERSION        "13.0"                ///<
     63#define HM_VERSION        "14.0"                ///<
    6464#else
    65 #define NV_VERSION        "13.0"                 ///< Current software version
     65#define NV_VERSION        "14.0"                 ///< Current software version
    6666#endif
    6767
     
    215215
    216216// Explicit temporal layer QP offset
    217 #define MAX_TLAYER                  8           ///< max number of temporal layer
     217#define MAX_TLAYER                  7           ///< max number of temporal layer
    218218#define HB_LAMBDA_FOR_LDC           1           ///< use of B-style lambda for non-key pictures in low-delay mode
    219219
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/SEI.h

    r884 r962  
    128128  SEIActiveParameterSets()
    129129    : activeVPSId            (0)
    130     , m_fullRandomAccessFlag (false)
    131     , m_noParamSetUpdateFlag (false)
     130    , m_selfContainedCvsFlag (false)
     131    , m_noParameterSetUpdateFlag (false)
    132132    , numSpsIdsMinus1        (0)
    133133  {}
     
    135135
    136136  Int activeVPSId;
    137   Bool m_fullRandomAccessFlag;
    138   Bool m_noParamSetUpdateFlag;
     137  Bool m_selfContainedCvsFlag;
     138  Bool m_noParameterSetUpdateFlag;
    139139  Int numSpsIdsMinus1;
    140   std::vector<Int> activeSeqParamSetId;
     140  std::vector<Int> activeSeqParameterSetId;
    141141};
    142142
     
    356356  Int    m_cameraIsoSpeedIdc;
    357357  Int    m_cameraIsoSpeedValue;
     358  Int    m_exposureIndexIdc;
     359  Int    m_exposureIndexValue;
    358360  Int    m_exposureCompensationValueSignFlag;
    359361  Int    m_exposureCompensationValueNumerator;
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r956 r962  
    28832883}
    28842884
    2885 UChar TComDataCU::getNumPartInter()
     2885UChar TComDataCU::getNumPartitions()
    28862886{
    28872887  UChar iNumPart = 0;
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComDataCU.h

    r950 r962  
    559559  Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
    560560#endif
    561   UChar         getNumPartInter       ();
     561UChar         getNumPartitions       ();
    562562  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
    563563
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComPic.cpp

    r872 r962  
    5555, m_bReconstructed                        (false)
    5656, m_bNeededForOutput                      (false)
     57#if H_MV_HLS_7_VPS_P0300_27
     58, m_bPicOutputFlag                        (false)
     59#endif
    5760, m_uiCurrSliceIdx                        (0)
    5861, m_bCheckLTMSB                           (false)
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComPic.h

    r872 r962  
    6969  Bool                  m_bReconstructed;
    7070  Bool                  m_bNeededForOutput;
     71#if H_MV_HLS_7_VPS_P0300_27
     72  Bool                  m_bPicOutputFlag;         // Semantics variable
     73#endif
    7174  UInt                  m_uiCurrSliceIdx;         // Index of current slice
    7275  Bool                  m_bCheckLTMSB;
     
    175178  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
    176179  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
    177  
     180 #if H_MV_HLS_7_VPS_P0300_27
     181  Void          setPicOutputFlag(Bool b) { m_bPicOutputFlag = b;      }
     182  Bool          getPicOutputFlag()       { return m_bPicOutputFlag ;  }
     183#endif
     184
    178185  Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
    179186  Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r950 r962  
    11301130  }
    11311131
    1132   for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ )
     1132  for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ )
    11331133  {
    11341134    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComRom.cpp

    r950 r962  
    381381Bool g_decTraceDispDer       = false;
    382382Bool g_decTraceMvFromMerge   = false;
     383Bool g_decTracePicOutput     = false;
    383384Bool g_stopAtPos             = false;
    384385Bool g_outputPos             = false;
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComRom.h

    r950 r962  
    225225 extern UInt64 g_stopAtCounter;         // Counter to set breakpoint.
    226226 extern Bool   g_traceCopyBack;         // Output samples on copy back 
    227  extern Bool   g_decTraceDispDer; // Trace derived disparity vectors (decoder only)
     227 extern Bool   g_decTraceDispDer;       // Trace derived disparity vectors (decoder only)
    228228 extern Bool   g_decTraceMvFromMerge;   // Trace motion vectors obtained from merge (decoder only)
     229 extern Bool   g_decTracePicOutput;     // Trace output of pictures
    229230 extern Bool   g_stopAtPos;             // Stop at position
    230231 extern Bool   g_outputPos;             // Output position
     
    236237#define DTRACE_PU_S(x)             writeToTraceFile( x,   g_tracePU );
    237238#define DTRACE_TU_S(x)             writeToTraceFile( x,   g_traceTU );
    238 
    239239
    240240 Void           writeToTraceFile( const Char* symbolName, Int val, Bool doIt );
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r872 r962  
    110110    m_offsetClipTable[compIdx] = NULL;
    111111  }
     112#if !SAO_SGN_FUNC
    112113  m_signTable = NULL;
    113 
     114#endif
    114115 
    115116  m_lineBufWidth = 0;
     
    155156  }
    156157
     158#if !SAO_SGN_FUNC
    157159  //look-up table for clipping
     160  Int overallMaxSampleValue=0;
     161#endif
    158162  for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++)
    159163  {
     
    161165    Int maxSampleValue = (1<< bitDepthSample); //exclusive
    162166    Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]);
     167#if !SAO_SGN_FUNC
     168    if (maxSampleValue>overallMaxSampleValue) overallMaxSampleValue=maxSampleValue;
     169#endif
    163170
    164171    m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0
     
    176183      *(offsetClipPtr -k -1 )              = 0;
    177184    }
    178     if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC
    179     {
    180       m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ];
    181       m_sign = &(m_signTable[maxSampleValue-1]);
     185  }
     186
     187#if !SAO_SGN_FUNC
     188  m_signTable = new Short[ 2*(overallMaxSampleValue-1) + 1 ];
     189  m_sign = &(m_signTable[overallMaxSampleValue-1]);
    182190
    183191      m_sign[0] = 0;
    184       for(Int k=1; k< maxSampleValue; k++)
     192  for(Int k=1; k< overallMaxSampleValue; k++)
    185193      {
    186194        m_sign[k] = 1;
    187195        m_sign[-k]= -1;
    188196      }
    189     }
    190   } 
    191 
     197#endif
    192198}
    193199
     
    208214    }
    209215  }
     216#if !SAO_SGN_FUNC
    210217  if( m_signTable )
    211218  {
    212219    delete[] m_signTable; m_signTable = NULL;
    213220  }
     221#endif
    214222}
    215223
     
    388396      for (y=0; y< height; y++)
    389397      {
     398#if SAO_SGN_FUNC
     399        signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     400#else
    390401        signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     402#endif
    391403        for (x=startX; x< endX; x++)
    392404        {
     405#if SAO_SGN_FUNC
     406          signRight = (Char)sgn(srcLine[x] - srcLine[x+1]);
     407#else
    393408          signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]];
     409#endif
    394410          edgeType =  signRight + signLeft;
    395411          signLeft  = -signRight;
     
    419435      for (x=0; x< width; x++)
    420436      {
     437#if SAO_SGN_FUNC
     438        signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
     439#else
    421440        signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]];
     441#endif
    422442      }
    423443
     
    429449        for (x=0; x< width; x++)
    430450        {
     451#if SAO_SGN_FUNC
     452          signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]);
     453#else
    431454          signDown  = (Char)m_sign[srcLine[x] - srcLineBelow[x]];
     455#endif
    432456          edgeType = signDown + signUpLine[x];
    433457          signUpLine[x]= -signDown;
     
    456480      for (x=startX; x< endX+1; x++)
    457481      {
     482#if SAO_SGN_FUNC
     483        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]);
     484#else
    458485        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]];
     486#endif
    459487      }
    460488
     
    465493      for(x= firstLineStartX; x< firstLineEndX; x++)
    466494      {
     495#if SAO_SGN_FUNC
     496        edgeType  =  sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1];
     497#else
    467498        edgeType  =  m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1];
     499#endif
    468500        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    469501      }
     
    479511        for (x=startX; x<endX; x++)
    480512        {
     513#if SAO_SGN_FUNC
     514          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]);
     515#else
    481516          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ;
     517#endif
    482518          edgeType =  signDown + signUpLine[x];
    483519          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
     
    485521          signDownLine[x+1] = -signDown;
    486522        }
     523#if SAO_SGN_FUNC
     524        signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
     525#else
    487526        signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]];
     527#endif
    488528
    489529        signTmpLine  = signUpLine;
     
    501541      for(x= lastLineStartX; x< lastLineEndX; x++)
    502542      {
     543#if SAO_SGN_FUNC
     544        edgeType =  sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x];
     545#else
    503546        edgeType =  m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x];
     547#endif
    504548        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    505549
     
    519563      for (x=startX-1; x< endX; x++)
    520564      {
     565#if SAO_SGN_FUNC
     566        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
     567#else
    521568        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]];
     569#endif
    522570      }
    523571
     
    529577      for(x= firstLineStartX; x< firstLineEndX; x++)
    530578      {
     579#if SAO_SGN_FUNC
     580        edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1];
     581#else
    531582        edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1];
     583#endif
    532584        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    533585      }
     
    542594        for(x= startX; x< endX; x++)
    543595        {
     596#if SAO_SGN_FUNC
     597          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
     598#else
    544599          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ;
     600#endif
    545601          edgeType =  signDown + signUpLine[x];
    546602          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    547603          signUpLine[x-1] = -signDown;
    548604        }
     605#if SAO_SGN_FUNC
     606        signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
     607#else
    549608        signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]];
     609#endif
    550610        srcLine  += srcStride;
    551611        resLine += resStride;
     
    558618      for(x= lastLineStartX; x< lastLineEndX; x++)
    559619      {
     620#if SAO_SGN_FUNC
     621        edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x];
     622#else
    560623        edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x];
     624#endif
    561625        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    562626
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r872 r962  
    5555extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
    5656
     57#if SAO_SGN_FUNC
     58template <typename T> int sgn(T val)
     59{
     60  return (T(0) < val) - (val < T(0));
     61}
     62#endif
     63
    5764class TComSampleAdaptiveOffset
    5865{
     
    7986  UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 
    8087  Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation
     88#if !SAO_SGN_FUNC
    8189  Short* m_sign; //sign table for fast operation
     90#endif
    8291  TComPicYuv*   m_tempPicYuv; //temporary buffer
    8392  Int m_picWidth;
     
    96105  Bool m_picSAOEnabled[NUM_SAO_COMPONENTS];
    97106  Int*   m_offsetClipTable[NUM_SAO_COMPONENTS];
     107#if !SAO_SGN_FUNC
    98108  Short* m_signTable;
    99 
     109#endif
    100110};
    101111
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r956 r962  
    1 /* The copyright in this software is being made available under the BSD
     1/* The copyright in this software is being made available under the BSD
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
     
    4545//! \{
    4646
     47
    4748TComSlice::TComSlice()
    4849: m_iPPSId                        ( -1 )
     50#if H_MV_HLS_8_POC_Q0142_32
     51, m_slicePicOrderCntLsb           ( 0 )
     52#endif
    4953, m_iPOC                          ( 0 )
    5054, m_iLastIDR                      ( 0 )
     
    7074, m_pcPic                         ( NULL )
    7175, m_colFromL0Flag                 ( 1 )
     76#if SETTING_NO_OUT_PIC_PRIOR
     77, m_noOutputPriorPicsFlag         ( false )
     78, m_noRaslOutputFlag              ( false )
     79, m_handleCraAsBlaFlag              ( false )
     80#endif
    7281, m_colRefIdx                     ( 0 )
    7382, m_uiTLayer                      ( 0 )
     
    459468  {
    460469    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    461     // ?If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    462     // ?Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     470    // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     471    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    463472    if (getRapPicFlag())
    464473    {
     
    903912      pocCRA = pocCurr;
    904913    }
     914#if EFFICIENT_FIELD_IRAP
     915    bRefreshPending = true;
     916#endif
    905917  }
    906918  else // CRA or No DR
    907919  {
     920#if EFFICIENT_FIELD_IRAP
     921    if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     922    {
     923      if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending
     924      {
     925        TComList<TComPic*>::iterator        iterPic       = rcListPic.begin();
     926        while (iterPic != rcListPic.end())
     927        {
     928          rpcPic = *(iterPic);
     929          if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR)
     930          {
     931            rpcPic->getSlice(0)->setReferenced(false);
     932          }
     933          iterPic++;
     934        }
     935        bRefreshPending = false;
     936      }
     937    }
     938    else
     939    {
     940#endif
    908941    if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending
    909942    {
     
    920953      bRefreshPending = false;
    921954    }
     955#if EFFICIENT_FIELD_IRAP
     956    }
     957#endif
    922958    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    923959    {
     
    11941230    // in decoding order shall precede the IRAP picture in output order.
    11951231    // (Note that any picture following in output order would be present in the DPB)
     1232#if !SETTING_NO_OUT_PIC_PRIOR
    11961233    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1234#else
     1235    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
     1236#endif
    11971237    {
    11981238      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     
    13701410/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    13711411*/
     1412#if ALLOW_RECOVERY_POINT_AS_RAP
     1413Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1414#else
    13721415Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    1373 {
     1416#endif
     1417{
     1418#if ALLOW_RECOVERY_POINT_AS_RAP
     1419  Int atLeastOneUnabledByRecoveryPoint = 0;
     1420  Int atLeastOneFlushedByPreviousIDR = 0;
     1421#endif
    13741422  TComPic* rpcPic;
    13751423  Int i, isAvailable;
     
    13921440        if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced())
    13931441        {
     1442#if ALLOW_RECOVERY_POINT_AS_RAP
     1443          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1444          {
     1445            isAvailable = 0;
     1446          }
     1447          else
     1448          {
    13941449          isAvailable = 1;
     1450        }
     1451#else
     1452          isAvailable = 1;
     1453#endif
    13951454        }
    13961455      }
     
    14021461        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    14031462        {
     1463#if ALLOW_RECOVERY_POINT_AS_RAP
     1464          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1465          {
     1466            isAvailable = 0;
     1467          }
     1468          else
     1469          {
    14041470          isAvailable = 1;
     1471        }
     1472#else
     1473          isAvailable = 1;
     1474#endif
    14051475        }
    14061476      }
     
    14251495        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    14261496        {
     1497#if ALLOW_RECOVERY_POINT_AS_RAP
     1498          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1499          {
     1500            isAvailable = 0;
     1501          }
     1502          else
     1503          {
    14271504          isAvailable = 1;
    14281505          rpcPic->setIsLongTerm(1);
    14291506          break;
     1507        }
     1508#else
     1509          isAvailable = 1;
     1510          rpcPic->setIsLongTerm(1);
     1511          break;
     1512#endif
    14301513        }
    14311514      }
     
    14551538        }
    14561539      }
     1540#if ALLOW_RECOVERY_POINT_AS_RAP
     1541      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1542      {
     1543        atLeastOneUnabledByRecoveryPoint = 1;
     1544      }
     1545      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1546      {
     1547        atLeastOneFlushedByPreviousIDR = 1;
     1548      }
     1549#endif
    14571550    }
    14581551  } 
     
    14701563      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced())
    14711564      {
     1565#if ALLOW_RECOVERY_POINT_AS_RAP
     1566        if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1567        {
     1568          isAvailable = 0;
     1569        }
     1570        else
     1571        {
    14721572        isAvailable = 1;
     1573      }
     1574#else
     1575        isAvailable = 1;
     1576#endif
    14731577      }
    14741578    }
     
    14971601        }
    14981602      }
    1499     }
     1603#if ALLOW_RECOVERY_POINT_AS_RAP
     1604      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1605      {
     1606        atLeastOneUnabledByRecoveryPoint = 1;
     1607    }
     1608      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1609      {
     1610        atLeastOneFlushedByPreviousIDR = 1;
    15001611  }   
     1612#endif
     1613    }
     1614    }
     1615#if ALLOW_RECOVERY_POINT_AS_RAP
     1616  if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR)
     1617  {
     1618    return -1;
     1619  }   
     1620#endif
    15011621  if(atLeastOneLost)
    15021622  {
     
    15151635/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    15161636*/
     1637#if ALLOW_RECOVERY_POINT_AS_RAP
     1638Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1639#else
    15171640Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1641#endif
    15181642{
    15191643  TComPic* rpcPic;
     
    15411665        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
    15421666        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
     1667#if ALLOW_RECOVERY_POINT_AS_RAP
     1668        pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
     1669#endif
    15431670        if(pcRPS->getDeltaPOC(k) < 0)
    15441671        {
     
    15531680    }
    15541681  }
     1682#if EFFICIENT_FIELD_IRAP
     1683  Bool useNewRPS = false;
     1684  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
     1685  if(m_pcPic->isField())
     1686  {
     1687    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1688    while ( iterPic != rcListPic.end())
     1689    {
     1690      rpcPic = *(iterPic++);
     1691      if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
     1692      {
     1693        pcRPS->setDeltaPOC(k, 1);
     1694        pcRPS->setUsed(k, true);
     1695        nrOfPositivePictures++;
     1696        k ++;
     1697        useNewRPS = true;
     1698      }
     1699    }
     1700  }
     1701#endif
    15551702  pcRPS->setNumberOfNegativePictures(nrOfNegativePictures);
    15561703  pcRPS->setNumberOfPositivePictures(nrOfPositivePictures);
     
    15591706  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
    15601707  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
    1561   if (!pReferencePictureSet->getInterRPSPrediction())
     1708  if (!pReferencePictureSet->getInterRPSPrediction()
     1709#if EFFICIENT_FIELD_IRAP
     1710    || useNewRPS
     1711#endif
     1712    )
    15621713  {
    15631714    pcRPS->setInterRPSPrediction(false);
     
    17281879  m_vpsNumProfileTierLevelMinus1 = -1;
    17291880   
    1730   m_numAddOutputLayerSets              = -1;   
    1731   m_defaultTargetOutputLayerIdc     = 0;
     1881  m_numAddLayerSets              = -1;   
     1882  m_defaultOutputLayerIdc     = 0;
    17321883 
    17331884  for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++)
    17341885  {
    1735     m_outputLayerSetIdxMinus1[i]  = -1;
     1886    m_layerSetIdxForOlsMinus1[i]  = -1;
    17361887    m_profileLevelTierIdx[i]      = 0;
    17371888    for ( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++)
     
    17411892    m_altOutputLayerFlag[ i ]       = false;
    17421893  }
     1894
     1895#if H_MV_HLS_8_PMS_Q0195_20
     1896  m_repFormatIdxPresentFlag = false;
     1897#endif
    17431898  m_maxOneActiveRefLayerFlag = false;
    17441899  m_directDepTypeLenMinus2   = 0;         
    17451900 
    17461901
     1902#if H_MV_HLS_8_RPS_Q0100_36
     1903  m_vpsExtensionFlag = true;
     1904#endif
    17471905  m_avcBaseLayerFlag = false;
    17481906  m_vpsNonVuiExtensionLength = 0;
     
    17601918  {
    17611919    m_vpsProfilePresentFlag   [i] = false;
    1762     m_outputLayerSetIdxMinus1       [i] = 0;
     1920    m_layerSetIdxForOlsMinus1       [i] = 0;
    17631921    for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ )
    17641922    {
     
    18642022    assert( getLayerIdInNuh( layer ) > getLayerIdInNuh( layer -1 ) );
    18652023  }
     2024
     2025
     2026#if H_MV_HLS_8_PMS_Q0195_20
     2027  //The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive.
     2028  assert( getVpsNumRepFormatsMinus1() >= 0 );
     2029  assert( getVpsNumRepFormatsMinus1() <= 255 );
     2030#endif
     2031
    18662032  return true;
    18672033}
     
    19072073    }
    19082074  }
     2075
     2076#if H_MV_HLS_8
     2077  for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
     2078  {
     2079    m_numRefLayers[i] = 0;
     2080  }
     2081
     2082  for (Int currLayerId = 0; currLayerId <= 62; currLayerId++ )
     2083  {
     2084    for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
     2085    {
     2086      m_recursiveRefLayerFlag[currLayerId][i] = 0;
     2087    }
     2088  }
     2089
     2090
     2091  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     2092  {
     2093    Int iNuhLId = getLayerIdInNuh( i );
     2094    xSetRefLayerFlags( iNuhLId );
     2095    for( Int j = 0; j < 63; j++ )
     2096    {
     2097      m_numRefLayers[ iNuhLId ]  +=  m_recursiveRefLayerFlag[ iNuhLId ][ j ];
     2098    }
     2099  }
     2100
     2101
     2102  for( Int i = 0; i <= getMaxLayersMinus1(); i++ )  // Bug in spec "<" instead of "<="
     2103  {
     2104    Int iNuhLId = getLayerIdInNuh( i );
     2105    Int predIdx = 0;
     2106    for( Int j = iNuhLId + 1; j < 63; j++ )
     2107    {
     2108      if( m_recursiveRefLayerFlag[ j ][ iNuhLId ] )
     2109      {
     2110        m_predictedLayerId[ iNuhLId ][ predIdx++ ] = j;
     2111      }
     2112    }
     2113    m_numPredictedLayers[ iNuhLId ] = predIdx;
     2114  }
     2115 
     2116  Bool countedLayerIdxFlag[ MAX_NUM_LAYERS ];
     2117  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     2118  {
     2119    countedLayerIdxFlag[ i ] = 0;
     2120  }
     2121 
     2122  for( Int i = 0, k = 0; i  <=  getMaxLayersMinus1(); i++ )
     2123  {
     2124    Int iNuhLId = getLayerIdInNuh( i );
     2125    if( m_numDirectRefLayers[ iNuhLId ]  ==  0 )
     2126    {
     2127      m_treePartitionLayerIdList[ k ][ 0 ] = iNuhLId;
     2128      m_numLayersInTreePartition[ k ]      = 1;
     2129      for( Int j = 0; j < m_numPredictedLayers[ iNuhLId ]; j++ ) 
     2130      {
     2131        if( !countedLayerIdxFlag[ getLayerIdInVps( m_predictedLayerId[ iNuhLId ][ j ] ) ] )   
     2132        {
     2133          m_treePartitionLayerIdList[ k ][ m_numLayersInTreePartition[ k ] ] = m_predictedLayerId[ iNuhLId ][ j ];
     2134          m_numLayersInTreePartition[ k ]++;
     2135          countedLayerIdxFlag[ getLayerIdInVps( m_predictedLayerId[ iNuhLId ][ j ] ) ] = 1;
     2136        }
     2137      }
     2138      k++;
     2139    }
     2140    m_numIndependentLayers = k;
     2141  }
     2142#endif
    19092143}
    19102144
     
    20712305Int    TComVPS::getNumOutputLayerSets()
    20722306{
    2073   return getNumAddOutputLayerSets() + getVpsNumLayerSetsMinus1() + 1;
     2307#if H_MV_HLS_8_SYN_39_19
     2308  return getNumAddOlss() + getNumLayerSets();
     2309#else
     2310  return getNumAddLayerSets() + getVpsNumLayerSetsMinus1() + 1;
     2311#endif
    20742312}
    20752313
     
    21272365Void TComVPS::deriveTargetLayerIdList( Int i )
    21282366
    2129   Int lsIdx = getLayerSetIdxForOutputLayerSet( i );     
     2367  Int lsIdx = olsIdxToLsIdx( i );     
    21302368 
    21312369  for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
     
    21372375    }
    21382376  } 
     2377#if H_MV_HLS_8_PMS_Q0165_18
     2378  assert( getNumOutputLayersInOutputLayerSet( i ) > 0 );
     2379#endif
    21392380}
    21402381
     
    21422383{
    21432384  Bool outputLayerFlag;
    2144   switch ( getDefaultTargetOutputLayerIdc( ) )
     2385  switch ( getDefaultOutputLayerIdc( ) )
    21452386  {
    21462387  case 0:
     
    21482389    break;
    21492390  case 1:
    2150     outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 ); 
     2391    outputLayerFlag = ( j == m_layerSetLayerIdList[ olsIdxToLsIdx( i ) ].size() - 1 ); 
    21512392    break;
    21522393  case 2:
     
    21702411{
    21712412  Int maxSLMinus1 = 0;
    2172   Int optLsIdx    = getLayerSetIdxForOutputLayerSet( i );
     2413#if H_MV_HLS_8_MIS_Q0102_30
     2414  for( Int k = 0; k < getNumLayersInIdList( i ); k++ )
     2415  {
     2416    Int lId = m_layerSetLayerIdList[i][k];
     2417#else 
     2418  Int optLsIdx    = olsIdxToLsIdx( i );
     2419
    21732420  for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
    21742421  {
    21752422    Int lId = m_layerSetLayerIdList[optLsIdx][k];
     2423#endif
    21762424    maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
    21772425  }
    21782426  return maxSLMinus1;
    21792427}
    2180 
     2428#if H_MV_HLS_8_RPS_Q0100_36
     2429Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder )
     2430{
     2431  for( Int j = 0; j <= getMaxSubLayersInLayerSetMinus1( 0 ); j++ )
     2432  {
     2433    Int maxDecPicBufferingMinus1 = sps->getMaxDecPicBuffering( j ) - 1;
     2434    Int numReorderPics           = sps->getNumReorderPics    ( j );
     2435    Int maxLatencyIncreasePlus1  = sps->getMaxLatencyIncrease( j );
     2436
     2437    if ( encoder )
     2438    {
     2439      assert( getDpbSize()->getMaxVpsDecPicBufferingMinus1(0, 0, j ) == maxDecPicBufferingMinus1 );
     2440      assert( getDpbSize()->getMaxVpsNumReorderPics       (0,    j ) == numReorderPics           );
     2441      assert( getDpbSize()->getMaxVpsLatencyIncreasePlus1 (0,    j ) == maxLatencyIncreasePlus1  );
     2442    }
     2443    else
     2444    {
     2445      getDpbSize()->setMaxVpsDecPicBufferingMinus1(0, 0, j, maxDecPicBufferingMinus1 );
     2446      getDpbSize()->setMaxVpsNumReorderPics       (0,    j, numReorderPics           );
     2447      getDpbSize()->setMaxVpsLatencyIncreasePlus1 (0,    j, maxLatencyIncreasePlus1  );       
     2448    }     
     2449  }
     2450}
     2451#endif
    21812452#endif // H_MV
    21822453
     
    22502521  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    22512522#if H_MV
    2252   m_spsExtensionFlag = false;
     2523#if !H_MV_HLS_8_SPS_NODOC_48
     2524  m_spsExtensionPresentFlag = false;
    22532525  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
    22542526  {
    22552527    m_spsExtensionTypeFlag[ i ] = false;
    22562528  }
     2529#else
     2530  m_spsRangeExtensionsFlag     = false;
     2531  m_spsMultilayerExtensionFlag = false;
     2532#if H_3D
     2533  m_spsExtension5bits          = 0;
     2534  m_sps3dExtensionFlag         = false;
     2535#else
     2536  m_spsExtension6bits          = 0;
     2537#endif
     2538#endif
     2539
    22572540  m_numScaledRefLayerOffsets = 0;
    22582541
     
    24342717
    24352718#if H_MV
     2719#if H_MV_HLS_8_SPS_NODOC_48
     2720  m_ppsRangeExtensionsFlag     = false;
     2721  m_ppsMultilayerExtensionFlag = false;
     2722#if !H_3D
     2723  m_ppsExtension6bits          = 0;
     2724#else
     2725  m_pps3dExtensionFlag         = false;
     2726  m_ppsExtension5bits          = 0;
     2727#endif
     2728#else
    24362729  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
    24372730  {
    24382731    m_ppsExtensionTypeFlag[ i ] = false;
    24392732  }
     2733#endif
    24402734#endif
    24412735}
     
    29633257Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
    29643258{
    2965   // Mark as shortterm
     3259  // Mark as short-term
    29663260  for ( Int i = 0; i < refPicSetInterLayer0.size(); i++ )
    29673261  {
     
    29753269
    29763270}
     3271
     3272#if !H_MV_HLS_8_DBP_NODOC_42
    29773273Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    29783274{
     
    30293325  }
    30303326}
    3031 
     3327#endif
    30323328Void TComSlice::printRefPicList()
    30333329
     
    30463342Void TComSlice::markCurrPic( TComPic* currPic )
    30473343{
     3344
     3345#if !H_MV_HLS_8_DBP_NODOC_42
    30483346  if ( !currPic->getSlice(0)->getDiscardableFlag() )
    30493347  {
     3348#endif
    30503349    currPic->getSlice(0)->setReferenced( true ) ;
    30513350    currPic->setIsLongTerm( false );
     3351#if !H_MV_HLS_8_DBP_NODOC_42
    30523352  }
    30533353  else
     
    30553355    currPic->getSlice(0)->setReferenced( false ) ;
    30563356  }
     3357#endif
     3358
     3359#if H_MV_HLS_7_VPS_P0300_27
     3360  currPic->setReconMark( true );
     3361  currPic->setPicOutputFlag( currPic->getSlice(0)->getPicOutputFlag() );
     3362#endif
    30573363}
    30583364
     
    30883394  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) );
    30893395
     3396#if H_MV_HLS_8_RPS_Q0060_17
     3397  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && ( getTLayer() == 0  ) &&
     3398    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
     3399#else
    30903400  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  &&
    30913401    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
     3402#endif
    30923403
    30933404  return refLayerPicFlag;       
     
    39704281    }
    39714282  }
     4283
     4284  // ---------------
     4285  // To be added:
     4286  // When vps_base_layer_internal_flag is equal to 0 and layer_in_bsp_flag[ h ][ i ][ 0 ] is equal to 1 for any value of h in the
     4287  // range of 1 to vps_num_layer_sets_minus1, inclusive, and any value of i in the range of 0 to num_bitstream_partitions[ h ] - 1,
     4288  // inclusive, the value of layer_in_bsp_flag[ h ][ i ][ j ] for at least one value of j in the range of 1 to
     4289  // NumLayersInIdList[ h ] - 1, inclusive, shall be equal to 1.
     4290  // ---------------
     4291
     4292
     4293  // When num_bitstream_partitions[ h ] is equal to 1 for any value of h in the range 1 to vps_num_layer_set_minus1, inclusive,
     4294  // the value of layer_in_bsp_flag[ h ][ 0 ][ j ] should be equal to 0 for at least one value of j in the range 0 to
     4295  // NumLayersInIdList[ h ] − 1, inclusive.
     4296
     4297
     4298  if ( getNumBitstreamPartitions( h ) == 1 )
     4299  {
     4300    Bool atLeastOneZero = false;
     4301    for ( Int j = 0; j <= vps->getNumLayersInIdList( h ) - 1; j++ )
     4302    {
     4303      atLeastOneZero = atLeastOneZero || !getLayerInBspFlag( h, 0, j );
     4304    }   
     4305    assert( atLeastOneZero );
     4306  }
     4307
     4308 
     4309  // For any value of h in the range 1 to vps_num_layer_set_minus1, inclusive, the value of layer_in_bsp_flag[ h ][ i ][ j ]
     4310  // shall be equal to 1 for at most one value of i in the range of 0 to num_bitstream_partitions[ h ] − 1, inclusive.
     4311
     4312  for ( Int j = 0; j <= vps->getNumLayersInIdList( h ) - 1; j++ )
     4313  {
     4314    Int numLayerInBsp = 0;
     4315    for ( Int i = 0; i <= getNumBitstreamPartitions( h ) - 1; i++ )
     4316    {
     4317      numLayerInBsp += ( getLayerInBspFlag( h, i, j ) ? 1 : 0 ); 
     4318    }   
     4319    assert( numLayerInBsp <= 1 );
     4320  }
     4321
    39724322}
    39734323
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComSlice.h

    r950 r962  
    5454class TComPicLists;
    5555class TComVPS;
     56#if H_MV_HLS_8_RPS_Q0100_36
     57class TComSPS;
     58#endif
    5659#endif
    5760// ====================================================================================================================
     
    126129  Void sortDeltaPOC();
    127130  Void printDeltaPOC();
     131
     132#if H_MV_HLS_8_RPS_Q0100_36
     133  Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 )
     134  {
     135    assert( getNumberOfPictures() >= 0 );
     136    if ( nuhLayerId == 0 )
     137    {
     138      assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 );
     139    }
     140
     141    if ( vpsExtensionFlag )
     142    {
     143      assert( getNumberOfPictures() <= maxNumPics );
     144    }
     145  }
     146#endif
    128147};
    129148
     
    231250{
    232251  ProfileTierLevel m_generalPTL;
    233   ProfileTierLevel m_subLayerPTL[6];      // max. value of max_sub_layers_minus1 is 6
    234   Bool m_subLayerProfilePresentFlag[6];
    235   Bool m_subLayerLevelPresentFlag[6];
     252  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6)
     253  Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1];
     254  Bool m_subLayerLevelPresentFlag   [MAX_TLAYER-1];
    236255
    237256public:
     
    436455  Int  m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1];
    437456  Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS];
    438   Int  m_numBspSchedCombinations[MAX_VPS_OP_SETS_PLUS1];
     457  Int  m_numBspSchedCombinationsMinus1[MAX_VPS_OP_SETS_PLUS1];
    439458  Int  m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION];
    440459  Int  m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION];
     
    455474  Void checkLayerInBspFlag ( TComVPS* vps, Int h ); 
    456475
    457   Void setNumBspSchedCombinations( Int h, Int  val ) { m_numBspSchedCombinations[h] = val; }
    458   Int  getNumBspSchedCombinations( Int h ) { return m_numBspSchedCombinations[h]; }
     476  Void setNumBspSchedCombinationsMinus1( Int h, Int  val ) { m_numBspSchedCombinationsMinus1[h] = val; }
     477  Int  getNumBspSchedCombinationsMinus1( Int h ) { return m_numBspSchedCombinationsMinus1[h]; }
    459478
    460479  Void setBspCombHrdIdx( Int h, Int i, Int j, Int  val ) { m_bspCombHrdIdx[h][i][j] = val; }
    461480  Int  getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; }
     481#if H_MV_HLS_8_HRD_Q0101_04
     482  Int  getBspCombHrdIdxLen() { return gCeilLog2( getVpsNumBspHrdParametersMinus1() + 1);  };
     483  Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j ) 
     484  {
     485    // bsp_comb_hrd_idx
     486    assert( getBspCombSchedIdx(h, i, j ) >= 0 );
     487    assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() );
     488
     489    // bsp_comb_sched_idx
     490    assert( getBspCombSchedIdx(h, i, j ) >= 0 );
     491
     492    //* This check needs to activated,  when HighestTid is available here   
     493    //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
     494  }
     495#endif
    462496
    463497  Void setBspCombSchedIdx( Int h, Int i, Int j, Int  val ) { m_bspCombSchedIdx[h][i][j] = val; }
     
    636670  Int   m_maxVpsDecPicBufferingMinus1[MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYER_IDS][MAX_TLAYER];;
    637671  Int   m_maxVpsNumReorderPics       [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER];
    638 #if H_MV_HLS7_GEN
    639   Int  m_maxVpsLayerDecPicBuffMinus1[TO_BE_SPECIFIED][TO_BE_SPECIFIED][TO_BE_SPECIFIED];
    640 #endif
    641672  Int   m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER];
    642673
     
    655686  Void setMaxVpsNumReorderPics( Int i, Int j, Int  val ) { m_maxVpsNumReorderPics[i][j] = val; }
    656687  Int  getMaxVpsNumReorderPics( Int i, Int j ) { return m_maxVpsNumReorderPics[i][j]; }
    657 #if H_MV_HLS7_GEN
    658   Void setMaxVpsLayerDecPicBuffMinus1( Int i, Int k, Int j, Int  val ) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = val; }
    659   Int  getMaxVpsLayerDecPicBuffMinus1( Int i, Int k, Int j ) { return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; }
    660 #endif
     688
    661689  Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int  val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; }
    662690  Int  getMaxVpsLatencyIncreasePlus1( Int i, Int j ) { return m_maxVpsLatencyIncreasePlus1[i][j]; }
     
    667695private:
    668696  Int         m_VPSId;
     697#if H_MV_HLS_8_SYN_Q0041_03
     698  Bool        m_vpsBaseLayerInternalFlag;
     699#endif
     700
    669701  UInt        m_uiMaxTLayers;
    670702
     
    704736  TimingInfo  m_timingInfo;
    705737#if H_MV
     738  #if H_MV_HLS_8_RPS_Q0100_36
     739  Bool        m_vpsExtensionFlag;
     740#endif
    706741  /// VPS EXTENSION SYNTAX ELEMENTS
    707742  Bool        m_avcBaseLayerFlag;
     
    725760  Bool        m_vpsProfilePresentFlag    [MAX_VPS_OP_SETS_PLUS1];
    726761
    727   Int         m_numAddOutputLayerSets;   
    728   Int         m_defaultTargetOutputLayerIdc;
    729 
    730   Int         m_outputLayerSetIdxMinus1  [MAX_VPS_OUTPUTLAYER_SETS]; 
     762  Int         m_numAddLayerSets;   
     763#if H_MV_HLS_8_SYN_39_19
     764  Int         m_highestLayerIdxPlus1     [MAX_VPS_ADD_OUTPUT_LAYER_SETS][MAX_NUM_LAYERS];
     765  Int         m_numAddOlss;
     766#endif
     767  Int         m_defaultOutputLayerIdc;
     768
     769  Int         m_layerSetIdxForOlsMinus1  [MAX_VPS_OUTPUTLAYER_SETS]; 
    731770  Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
    732771  Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
    733772  Bool        m_altOutputLayerFlag       [MAX_VPS_OUTPUTLAYER_SETS];
    734773  Bool        m_repFormatIdxPresentFlag;
     774
    735775  Int         m_vpsNumRepFormatsMinus1;
    736776  Int         m_vpsRepFormatIdx          [MAX_NUM_LAYERS];
     
    762802  Int         m_refLayerId               [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
    763803
     804#if H_MV_HLS_8
     805  Int         m_numRefLayers             [MAX_NUM_LAYER_IDS];
     806  Int         m_numPredictedLayers       [MAX_NUM_LAYERS];
     807  Int         m_predictedLayerId         [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
     808  Int         m_numIndependentLayers;
     809  Int         m_numLayersInTreePartition [MAX_NUM_LAYER_IDS];
     810  Int         m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
     811  Bool        m_recursiveRefLayerFlag    [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
     812#else
     813
    764814  Int         m_numSamplePredRefLayers   [MAX_NUM_LAYERS];
    765815  Bool        m_samplePredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
     
    769819  Bool        m_motionPredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
    770820  Int         m_motionPredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
     821#endif
    771822  Int         m_viewIndex                [MAX_NUM_LAYERS   ];
    772823 
     
    777828
    778829  Int         xGetDimBitOffset( Int j );
    779  
     830
     831#if H_MV_HLS_8
     832  Void xSetRefLayerFlags( Int currLayerId )
     833  {
     834    for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ )
     835    {
     836      Int refLayerId = m_refLayerId[ currLayerId ][ j ];
     837      m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1;
     838      for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
     839      {
     840        m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ]  ||  m_recursiveRefLayerFlag[ refLayerId ][ k ];
     841      }
     842    }
     843  }
     844#endif
    780845  // VPS EXTENSION 2 SYNTAX ELEMENTS
    781846#if H_3D_ARP
     
    837902  Void    setVPSId       (Int i)              { m_VPSId = i;             }
    838903
     904#if H_MV_HLS_8_SYN_Q0041_03
     905  Void    setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; }
     906  Bool    getVpsBaseLayerInternalFlag(  )          { return m_vpsBaseLayerInternalFlag; }
     907#endif
     908
    839909  UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
    840910  Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
     
    887957  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    888958#if H_MV
     959
     960#if H_MV_HLS_8_RPS_Q0100_36
     961  Void    setVpsExtensionFlag( Bool flag )                                 { m_vpsExtensionFlag = flag; }
     962  Bool    getVpsExtensionFlag(  )                                          { return m_vpsExtensionFlag; }
     963#endif
     964#if !H_MV_HLS_8_SYN_Q0041_03
    889965  Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
    890966  Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; }
    891 
     967#endif
    892968  Void    setVpsNonVuiExtensionLength( Int  val )                          { m_vpsNonVuiExtensionLength = val; }
    893969  Int     getVpsNonVuiExtensionLength(  )                                  { return m_vpsNonVuiExtensionLength; }
     
    9471023  Bool    getVpsProfilePresentFlag( Int idx )                              { return m_vpsProfilePresentFlag[idx]; }
    9481024
    949   Void    setNumAddOutputLayerSets( Int val )                              { m_numAddOutputLayerSets = val; }
    950   Int     getNumAddOutputLayerSets( )                                      { return m_numAddOutputLayerSets; }
    951  
    952   Void    setDefaultTargetOutputLayerIdc( Int  val )                       { m_defaultTargetOutputLayerIdc = val; }
    953   Int     getDefaultTargetOutputLayerIdc(  )                               { return m_defaultTargetOutputLayerIdc; }   
    954  
    955   Void    setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val )        { m_outputLayerSetIdxMinus1[ outLayerSetIdx ]  = val; }
    956   Int     getOutputLayerSetIdxMinus1( Int outLayerSetIdx )                 { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; }
     1025  Void    setNumAddLayerSets( Int val )                                    { m_numAddLayerSets = val; }
     1026  Int     getNumAddLayerSets( )                                            { return m_numAddLayerSets; }
     1027 
     1028#if H_MV_HLS_8_SYN_39_19
     1029  Void    setHighestLayerIdxPlus1( Int i, Int j, Int  val )                { m_highestLayerIdxPlus1[i][j] = val; }
     1030  Int     getHighestLayerIdxPlus1( Int i, Int j )                          { return m_highestLayerIdxPlus1[i][j]; }
     1031
     1032  Void    setNumAddOlss( Int  val )                                        { m_numAddOlss = val; }
     1033  Int     getNumAddOlss(  )                                                { return m_numAddOlss; }
     1034#endif
     1035
     1036  Void    setDefaultOutputLayerIdc( Int  val )                             { m_defaultOutputLayerIdc = val; }
     1037  Int     getDefaultOutputLayerIdc(  )                                     { return m_defaultOutputLayerIdc; }   
     1038 
     1039  Void    setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val )        { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]  = val; }
     1040  Int     getLayerSetIdxForOlsMinus1( Int outLayerSetIdx )                 { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; }
    9571041
    9581042  Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; }
     
    9751059  Void    setVpsRepFormatIdx( Int i, Int  val )                            { m_vpsRepFormatIdx[i] = val; }
    9761060  Int     getVpsRepFormatIdx( Int i )                                      { return m_vpsRepFormatIdx[i]; }
     1061
     1062#if H_MV_HLS_8_PMS_Q0195_20
     1063  Int     inferVpsRepFormatIdx( Int i )                                    { return std::min( i, getVpsNumRepFormatsMinus1()  );  }
     1064#endif
    9771065
    9781066  Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
     
    9891077  Void    setDpbSize( TComDpbSize* val )                                   { assert( m_dpbSize != 0 ); m_dpbSize = val; }
    9901078  TComDpbSize* getDpbSize( )                                               { return m_dpbSize;}
     1079#if H_MV_HLS_8_RPS_Q0100_36
     1080  Void    inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder );
     1081#endif
     1082
    9911083
    9921084  Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; }
     
    10231115  Int     getNumDirectRefLayers( Int layerIdInNuh )                        { return m_numDirectRefLayers[ layerIdInNuh ];  };                               
    10241116  Int     getRefLayerId        ( Int layerIdInNuh, Int idx );;
     1117
     1118#if H_MV_HLS_8
     1119  Int     getNumRefLayers            ( Int i )        { return m_numRefLayers[i]; }
     1120  Int     getNumPredictedLayers      ( Int i )        { return m_numPredictedLayers[i]; }
     1121  Int     getPredictedLayerId        ( Int i, Int j ) { return m_predictedLayerId[i][j]; }
     1122  Int     getNumIndependentLayers    (  )             { return m_numIndependentLayers; }
     1123  Int     getNumLayersInTreePartition( Int i )        { return m_numLayersInTreePartition[i]; }
     1124  Int     getTreePartitionLayerIdList( Int i, Int j ) { return m_treePartitionLayerIdList[i][j]; }
     1125  Bool    getRecursiveRefLayerFlag   ( Int i, Int j ) { return m_recursiveRefLayerFlag[i][j]; }
     1126
     1127#endif
     1128
     1129#if H_MV_HLS_8_SYN_39_19
     1130  Int     getNumLayerSets( )                                               { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets();  }; 
     1131#endif
    10251132  Bool    checkVPSExtensionSyntax();
    10261133  Int     scalTypeToScalIdx   ( ScalabilityType scalType );
     
    10301137
    10311138  Int     getNumLayersInIdList ( Int lsIdx );
     1139#if H_MV_HLS_8_RPS_Q0100_36
     1140  Int     getLayerSetLayerIdList(Int lsIdx, Int j )                       { return m_layerSetLayerIdList[ lsIdx ][ j ]; };
     1141#endif
    10321142
    10331143  Int     getNumOutputLayerSets() ;   
     1144#if !H_MV_HLS_8_DBP_NODOC_42
    10341145  Int     getNumSubDpbs( Int i )                                           { return getNumLayersInIdList( i ); }; 
     1146#endif
    10351147  Bool    isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh );   
    10361148  Void    deriveLayerSetLayerIdList();
    10371149
    1038   Int     getLayerSetIdxForOutputLayerSet( Int i )                         { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getOutputLayerSetIdxMinus1( i ) + 1 ; };
     1150  Int     olsIdxToLsIdx( Int i )                                           { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getLayerSetIdxForOlsMinus1( i ) + 1 ; };
    10391151
    10401152  Void    initTargetLayerIdLists  ( );
     
    10481160
    10491161  Int     getMaxSubLayersInLayerSetMinus1( Int i );
     1162
     1163#if H_MV_HLS_8_SYN_39_19
     1164  Int     getHighestLayerIdxPlus1Len( Int j )                                   { return gCeilLog2( getNumLayersInTreePartition( j ) + 1 );   };
     1165#endif
     1166
     1167 
     1168#if H_MV_HLS_7_VPS_P0300_27
     1169  Bool     getAltOutputLayerFlagVar( Int i )
     1170  {  // Semantics variable not syntax element !
     1171
     1172    Bool altOptLayerFlag = false;     
     1173    if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 &&
     1174      getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 )
     1175    {
     1176      altOptLayerFlag = getAltOutputLayerFlag( i );
     1177    }
     1178    return altOptLayerFlag;
     1179  };
     1180#endif
    10501181
    10511182  // inference
     
    10551186  // helpers
    10561187  Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
     1188#if H_MV_HLS_8_RPS_Q0100_36
     1189  Int     getMaxNumPics( Int layerId )
     1190  {   
     1191    Int maxNumPics = MAX_INT;
     1192    for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)
     1193    {
     1194      Int lsIdx = olsIdxToLsIdx( olsIdx );
     1195      for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
     1196      {
     1197        if( getLayerSetLayerIdList(lsIdx, j ) ==  layerId )
     1198        {
     1199          Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx );
     1200          maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j,  maxSL ) );
     1201        }
     1202      }
     1203    }
     1204    assert( maxNumPics != MAX_INT );
     1205    return maxNumPics;
     1206  }
     1207#endif
     1208
    10571209  /// VPS EXTENSION 2 SYNTAX ELEMENTS
    10581210#if H_3D 
     
    14471599
    14481600  UInt        m_uiBitsForPOC;
     1601
    14491602  UInt        m_numLongTermRefPicSPS;
    14501603  UInt        m_ltRefPicPocLsbSps[33];
     
    14761629  TComVPS*    m_pcVPS;
    14771630  // SPS
    1478   Bool        m_spsExtensionFlag;
    1479   Bool        m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM];
     1631  Bool        m_spsExtensionPresentFlag;
     1632#if H_MV_HLS_8_SPS_NODOC_48
     1633  Bool        m_spsRangeExtensionsFlag;
     1634  Bool        m_spsMultilayerExtensionFlag;
     1635#if H_3D
     1636  Bool        m_sps3dExtensionFlag;
     1637  Int         m_spsExtension5bits;
     1638#else
     1639  Int         m_spsExtension6bits;
     1640#endif
     1641#else
     1642  Bool        m_spsExtensionTypeFlag     [PS_EX_T_MAX_NUM];
     1643#endif
    14801644  Bool        m_spsInferScalingListFlag;
    14811645  Int         m_spsScalingListRefLayerId;
     
    15911755  UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
    15921756  Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
     1757#if H_MV_HLS_8
     1758  UInt      getSpsMaxSubLayersMinus1()                { return ( m_uiMaxTLayers - 1); }
     1759#endif
    15931760
    15941761  Bool      getTemporalIdNestingFlag()                { return m_bTemporalIdNestingFlag; }
     
    16221789  TComPTL* getPTL()     { return &m_pcPTL; }
    16231790#if H_MV
    1624   Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; }
    1625   Bool getSpsExtensionFlag( )  { return m_spsExtensionFlag; }
    1626 
    1627   Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; }
    1628   Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; }
     1791
     1792#if H_MV_HLS_8_HRD_Q0102_08
     1793  Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
     1794  {
     1795    const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
     1796
     1797    if (getLayerId() > 0 )
     1798    {
     1799      Int layerIdx = 0;         
     1800      while (layerIdx < (Int) targetDecLayerIdList.size() )
     1801      {
     1802        if ( targetDecLayerIdList[layerIdx] == currLayerId )
     1803        {
     1804          break;
     1805        }
     1806        layerIdx++;
     1807      }
     1808
     1809      assert( layerIdx < (Int) targetDecLayerIdList.size() );
     1810
     1811      for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ )
     1812      {
     1813        Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ;
     1814
     1815        if ( encoder )
     1816        {
     1817          assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 );
     1818        }
     1819        else
     1820        {
     1821          setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 );
     1822        }
     1823      }
     1824    }   
     1825  }
     1826#endif
     1827
     1828  Void setSpsExtensionPresentFlag( Bool flag ) { m_spsExtensionPresentFlag = flag; }
     1829  Bool getSpsExtensionPresentFlag( )           { return m_spsExtensionPresentFlag; }
     1830
     1831#if H_MV_HLS_8_SPS_NODOC_48
     1832  Void setSpsRangeExtensionsFlag( Bool flag )            { m_spsRangeExtensionsFlag = flag; }
     1833  Bool getSpsRangeExtensionsFlag(  )                     { return m_spsRangeExtensionsFlag; }
     1834
     1835  Void setSpsMultilayerExtensionFlag( Bool flag )        { m_spsMultilayerExtensionFlag = flag; }
     1836  Bool getSpsMultilayerExtensionFlag( )                  { return m_spsMultilayerExtensionFlag; }
     1837#if H_3D
     1838  Void setSps3dExtensionFlag( Bool flag )                { m_sps3dExtensionFlag = flag; }
     1839  Bool getSps3dExtensionFlag(  )                        { return m_sps3dExtensionFlag; }
     1840
     1841  Void setSpsExtension5bits( Int  val )                  { m_spsExtension5bits = val; }
     1842  Int  getSpsExtension5bits(  )                          { return m_spsExtension5bits; }
     1843#else
     1844  Void setSpsExtension6bits( Int  val )                  { m_spsExtension6bits = val; }
     1845  Int  getSpsExtension6bits(  )                          { return m_spsExtension6bits; }
     1846#endif
     1847#else
     1848  Void setSpsExtensionTypeFlag( Int i, Bool flag )       { m_spsExtensionTypeFlag[i] = flag; }
     1849  Bool getSpsExtensionTypeFlag( Int i )                  { return m_spsExtensionTypeFlag[i]; }
     1850#endif
     1851 
    16291852  Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
    16301853  TComVPS*  getVPS          () { return m_pcVPS; }
     
    16651888
    16661889  Void inferScalingList( TComSPS* spsSrc );
     1890
     1891#if H_MV_HLS_8_RPS_Q0100_36
     1892  // others
     1893  Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
     1894  {
     1895    // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead
     1896    // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
     1897
     1898    for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
     1899    {
     1900      TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i );
     1901      if ( !rps->getInterRPSPrediction() )
     1902      {
     1903        rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ),
     1904          getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 ); 
     1905      }
     1906    }
     1907  }
     1908#endif
     1909
    16671910#endif
    16681911#if H_3D_QTLPC
     
    17762019  Int  m_ppsScalingListRefLayerId;
    17772020
     2021#if H_MV_HLS_8_SPS_NODOC_48
     2022  Bool m_ppsRangeExtensionsFlag;
     2023  Bool m_ppsMultilayerExtensionFlag;
     2024#if !H_3D
     2025  Int  m_ppsExtension6bits;
     2026#else
     2027  Bool m_pps3dExtensionFlag;
     2028  Int  m_ppsExtension5bits;
     2029#endif
     2030
     2031#else
    17782032  Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM];
     2033#endif
    17792034  Bool m_pocResetInfoPresentFlag;
    17802035#endif
     
    19202175  Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; }
    19212176
     2177#if H_MV_HLS_8_SPS_NODOC_48
     2178  Void setPpsRangeExtensionsFlag( Bool flag ) { m_ppsRangeExtensionsFlag = flag; }
     2179  Bool getPpsRangeExtensionsFlag(  ) { return m_ppsRangeExtensionsFlag; }
     2180
     2181  Void setPpsMultilayerExtensionFlag( Bool flag ) { m_ppsMultilayerExtensionFlag = flag; }
     2182  Bool getPpsMultilayerExtensionFlag(  ) { return m_ppsMultilayerExtensionFlag; }
     2183
     2184#if !H_3D
     2185  Void setPpsExtension6bits( Int  val ) { m_ppsExtension6bits = val; }
     2186  Int  getPpsExtension6bits(  ) { return m_ppsExtension6bits; }
     2187#else
     2188  Void setPps3dExtensionFlag( Bool flag ) { m_pps3dExtensionFlag = flag; }
     2189  Bool getPps3dExtensionFlag(  ) { return m_pps3dExtensionFlag; }
     2190
     2191  Void setPpsExtension5bits( Int  val ) { m_ppsExtension5bits = val; }
     2192  Int  getPpsExtension5bits(  ) { return m_ppsExtension5bits; }
     2193#endif
     2194#else
    19222195  Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; }
    19232196  Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; }
     2197#endif
    19242198
    19252199  Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; }
     
    19572231  Int         m_iPPSId;               ///< picture parameter set ID
    19582232  Bool        m_PicOutputFlag;        ///< pic_output_flag
     2233#if H_MV_HLS_8_POC_Q0142_32
     2234  Int         m_slicePicOrderCntLsb;   
     2235#endif 
    19592236  Int         m_iPOC;
    19602237#if H_MV
     
    20102287  UInt        m_colFromL0Flag;  // collocated picture from List0 flag
    20112288 
     2289#if SETTING_NO_OUT_PIC_PRIOR
     2290  Bool        m_noOutputPriorPicsFlag;
     2291  Bool        m_noRaslOutputFlag;
     2292  Bool        m_handleCraAsBlaFlag;
     2293#endif
     2294 
    20122295  UInt        m_colRefIdx;
    20132296  UInt        m_maxNumMergeCand;
     
    21312414  Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
    21322415  Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
     2416#if H_MV_HLS_8_POC_Q0142_32
     2417  Void      setSlicePicOrderCntLsb( Int i ) { m_slicePicOrderCntLsb = i; };
     2418  Int       getSlicePicOrderCntLsb(  )      { return m_slicePicOrderCntLsb; };
     2419#endif
    21332420  Void      setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; }
    21342421  Bool      getSaoEnabledFlag() { return m_saoEnabledFlag; }
     
    22812568  Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 );
    22822569  static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 );
    2283   static Void markCurrPic                 ( TComPic* currPic );;
     2570  static Void markCurrPic                 ( TComPic* currPic );
     2571#if !H_MV_HLS_8_DBP_NODOC_42
    22842572  static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
     2573#endif
    22852574  Void        printRefPicList();
    22862575#endif
    22872576  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    22882577  Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
     2578#if ALLOW_RECOVERY_POINT_AS_RAP
     2579  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2580  Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2581#else
    22892582  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
    22902583  Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2584#endif
    22912585
    22922586  Void setMaxNumMergeCand               (UInt val )         { m_maxNumMergeCand = val;                    }
    22932587  UInt getMaxNumMergeCand               ()                  { return m_maxNumMergeCand;                   }
     2588
     2589#if SETTING_NO_OUT_PIC_PRIOR
     2590  Void setNoOutputPriorPicsFlag              ( Bool val )         { m_noOutputPriorPicsFlag = val;                    }
     2591  Bool getNoOutputPriorPicsFlag              ()                   { return m_noOutputPriorPicsFlag;                   }
     2592
     2593  Void setNoRaslOutputFlag              ( Bool val )         { m_noRaslOutputFlag = val;                    }
     2594  Bool getNoRaslOutputFlag              ()                   { return m_noRaslOutputFlag;                   }
     2595
     2596  Void setHandleCraAsBlaFlag              ( Bool val )         { m_handleCraAsBlaFlag = val;                    }
     2597  Bool getHandleCraAsBlaFlag              ()                   { return m_handleCraAsBlaFlag;                   }
     2598#endif
    22942599
    22952600  Void setSliceMode                     ( UInt uiMode )     { m_sliceMode = uiMode;                     }
     
    24332738  Void setPocResetIdc( Int  val ) { m_pocResetIdc = val; }
    24342739  Int  getPocResetIdc(  ) { return m_pocResetIdc; }
    2435 
     2740#if H_MV_HLS_8_POC_Q0142_32
     2741  Void checkPocResetIdc( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); } 
     2742#endif
    24362743  Void setPocResetPeriodId( Int  val ) { m_pocResetPeriodId = val; }
    24372744  Int  getPocResetPeriodId(  ) { return m_pocResetPeriodId; }
     
    24422749  Void setPocLsbVal( Int  val ) { m_pocLsbVal = val; }
    24432750  Int  getPocLsbVal(  ) { return m_pocLsbVal; }
     2751#if H_MV_HLS_8_POC_Q0142_32
     2752  Void checkPocLsbVal( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); } 
     2753#endif
    24442754
    24452755  Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; }
     
    24662776
    24672777  // Additional variables derived in slice header semantics
     2778
    24682779  Int  getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerId() )); }
    24692780  Int  getInterLayerPredLayerIdcLen    ( ) { return gCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerId() )); }
     
    24832794  TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId );
    24842795
     2796
     2797#if H_MV_HLS_8_POC_Q0146_15
     2798// Inference
     2799  Bool inferPocMsbValPresentFlag()
     2800  {
     2801    Bool pocMsbValPresentFlag;
     2802    if( getSliceSegmentHeaderExtensionLength() == 0 )
     2803    {
     2804      pocMsbValPresentFlag = false;
     2805    }
     2806    else if ( getPocMsbValRequiredFlag() )
     2807    {
     2808      pocMsbValPresentFlag = true;
     2809    }
     2810    else
     2811    {
     2812      pocMsbValPresentFlag = false;
     2813    }
     2814
     2815    return pocMsbValPresentFlag;
     2816  } 
     2817#endif
    24852818#endif
    24862819#if H_3D_DDD
  • branches/HTM-11.0-dev0/source/Lib/TLibCommon/TypeDef.h

    r960 r962  
    360360#endif
    361361
     362#if H_MV
    362363#define H0044_POC_LSB_NOT_PRESENT        1      ///< JCT3V-H0044: Add constraint checking on the value of poc_reset_idc and poc_lsb_val
    363364#define H0056_EOS_CHECKS                 1      ///< JCT3V-H0056: Put checks on handling EOS
    364 #define H0056_SPS_TEMP_NESTING_FIX       1      ///< JCT3V-H0056: Fix the inference value of sps_temporal_id_nesting_flag when it is not present
     365#endif
    365366/////////////////////////////////////////////////////////////////////////////////////////
    366367///////////////////////////////////   TBD                  //////////////////////////////
    367368/////////////////////////////////////////////////////////////////////////////////////////
    368369
     370
     371#define H_MV_HLS_8                           1 // General changes
     372#define H_MV_HLS_7_VPS_P0300_27              1 // Output part only. (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt.
     373#define MV_FIX_DEP_TYPES                     1
     374
     375
     376#define H_MV_HLS7_GEN                        0  // General changes (not tested)
     377
     378// POC
    369379// #define H_MV_HLS_7_POC_P0041_3            0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above)
    370380// #define H_MV_HLS_7_POC_P0041_FIXES        0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture.
    371381// #define H_MV_HLS_7_POC_P0056_4            0 // (POC/P0056/layer tree poc) #4 Proposal 1: If the POC reset approach is adopted as the basis for multi-layer POC derivation, it is proposed to derive the POC anchor picture from the previous TID0 picture (that is not a RASL picture, a RADL picture or a sub-layer non-reference picture and not with discardable_flag equal to 1) of  the current layer or any of its reference layer. This is asserted to improve loss resilience and reduce bit rate overhead. Decision: Adopt Proposal 1 (with the suggested modifications Ewith text provided as P0297).
    372382
    373 // #define H_MV_HLS_7_SEI_P0133_28           0 // (SEI/P0133/Recovery point SEI) #28 Decision: Adopt change to recover point semantics only (-v3)
    374 // #define H_MV_HLS_7_SEI_P0123_25           0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture.
    375 
     383
     384// OTHERS
    376385// #define H_MV_HLS_7_HRD_P0138_6            0 // (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.
    377 // #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    378 // #define H_MV_HLS_7_VPS_P0300_27           0 // Output part only. (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt.
    379 
    380 #define H_MV_HLS7_GEN                        0  // General changes (not tested)
     386
     387// SEI related
     388//#define H_MV_HLS_8_SEI_NODOC_53  0 // #53 (SEI    /NODOC/Added Multiview view position SEI message) Plain copy from AVC.
     389//#define H_MV_HLS_8_SEI_NODOC_52  0 // #52 (SEI    /NODOC/Added Multiview acquisition information SEI) Plain copy from AVC.
     390//#define H_MV_HLS_8_SEI_NODOC_51  0 // #51 (SEI    /NODOC/Added Multiview scene information SEI message)
     391//#define H_MV_HLS_8_SEI_Q0189_35  0 // #35 (SEI    /Q0189/SEI message for indicating constraints on TMVP) Proposal 2.3,  SEI message for indicating constraints on TMVP
     392//#define H_MV_HLS_8_EDF_Q0116_29  0 // #29 (ED.FIX /Q0116/Recovery point SEI) , consider adding a note regarding how random accessibility is affected by the recovery point SEI message
     393//#define H_MV_HLS_8_GEN_Q0183_23  0 // #23 (GEN    /Q0183/SEI clean-ups) numerous small clean-ups on SEI messages.
     394//#define H_MV_HLS_8_MIS_Q0247_49  0 // #49 (MISC   /Q0247/frame-field information SEI message)
     395//#define H_MV_HLS_8_MIS_Q0189_34  0 // #34 (MISC   /Q0189/slice temporal mvp enabled flag) Proposal 2.2, clarification of semantics of slice temporal mvp enabled flag
     396//#define H_MV_HLS_8_EDF_Q0081_01  0 // #1  (ED.FIX /Q0081/alpha channel persist) On reuse of alpha planes in auxiliary pictures. It was asked why there would not be a presumption that the alpha channel content would simply persist, without needing the flag to indicate it. Decision (Ed.): Delegated to editors to clarify, as necessary, that the alpha channel content persists until cancelled or updated in output order.
     397//#define H_MV_HLS_8_SEI_Q0253_37  0 // #37 (SEI    /Q0253/layer not present), modified semantics of layers not present SEI message to correct bug introduced during editing
     398//#define H_MV_HLS_8_SEI_Q0045_11  0 // #11 (SEI    /Q0045/Overlay) Proposal for an SEI message on selectable overlays. Decision: Adopt (modified for variable-length strings).
     399//#define H_MV_HLS_7_SEI_P0133_28  0 // (SEI/P0133/Recovery point SEI) #28 Decision: Adopt change to recover point semantics only (-v3)
     400//#define H_MV_HLS_7_SEI_P0123_25  0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture.
     401
     402
     403// Auxiliary picture related
     404//#define H_MV_HLS_8_AUX_NODOC_40  0 // #40 (AUX    /NODOC/primary pic) Clarify that an auxiliary picture can be associated with more than one primary picture. Consider if the language associating an alpha auxiliary picture with a primary picture in the semantics of dimension_id[ ][ ] near the AuxId derivation could be moved to the alpha SEI message.
     405//#define H_MV_HLS_8_AUX_Q0081_2   0 // #2  (AUX    /Q0081/primary) Decision: Remove the constraint that an alpha picture must be accompanied by a primary picture.
     406//#define H_MV_HLS_8_AUX_Q0078_44  0 // #44 (AUX    /Q0078/concepts Auxiliary picture concepts:
     407//#define H_MV_HLS_8_AUX_Q0078_39  0 // #39 (AUX    /Q0078/conformance): mechanism for signaling a profile/tier/level conformance point for auxiliary pictures
     408
     409// Profiles
     410//#define H_MV_HLS_8_PRO_NODOC_50  0 // #50 (PROF   /NODOC/Monochrome) Add Monochrome 8-bit profile
     411//#define H_MV_HLS_8_PRO_NODOC_31  0 // #31 (PROF   /NODOC/Profile constraint) Add a profile constraint to the Scalable Main, Scalable Main 10, and Stereo Main profiles against allowing layers with duplicate values of DependencyId (or ViewOrderIdx) when AuxId equal to 0.
     412//#define H_MV_HLS_8_PRO_H0126_45  0 // #45 (PROF   /H0126/Stereo main) Phrasing used in specifying the Stereo Main profile.
     413//#define H_MV_HLS_8_PRO_Q0160_33  0 // #33 (PROF   /Q0160/alt_output_flag) v2: Add constraint to stereo main profile that it must contain exactly two texture views, and add a note to state that the constraint implies a restriction that alt_output_flag equal to 0.
     414
     415// DPB
     416//#define H_MV_HLS_8_HRD_Q0102_09  0 // #9  (HRD    /Q0102/NoOutputOfPriorPicsFlag) It was suggested that also the separate_colour_plane_flag should affect inference of NoOutputOfPriorPicsFlag. Decision (Ed.): Agreed (affects RExt text).
     417//#define H_MV_HLS_8_DBP_Q0154_38  0 // #38 (DBP    /Q0154/VPS DPB) Proposal in C.5.2.1: Add in the decoding process that when a new VPS is activated, all pictures in the DPB are marked as unused for reference
     418//#define H_MV_HLS_8_HRD_Q0154_10  0 // #10 (HRD    /Q0154/DPB Flushing and parameters) On picture flushing and DPB parameters Decision: Adopted (some details to be discussed further in BoG).
     419//#define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
     420
     421// Others
     422//#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows
     423:// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
     424//#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
     425
     426
     427#define H_MV_HLS_8_SYN_Q0041_03    1   // #3  Syntax only (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows
     428:// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
     429#define H_MV_HLS_8_SYN_39_19       1   // #39 Syntax only + (PS/Q0165,Q0078/presence of num_add_output_layer_sets) proposal 2. change condition for presence of num_add_output_layer_sets to avoid sending it when there is only one layer set.
     430#define H_MV_HLS_8_HRD_Q0101_04    1   // #4  (HRD    /Q0101/Bitstream part buffer) On Bitstream Partition Buffer. Decision (BF/Cleanup): Adopt (sub-proposals 1–11, refined as described).
     431#define H_MV_HLS_8_PPS_NODOC_NN    1   // #NN (PPS    /NODOC/reserved flag): Add a flag in PPS for SHVC color gamut scalability
     432#define H_MV_HLS_8_MIS_Q0177_47    1   // #47 (MISC   /Q0177/EOS NAL) proposal 2: clarification of description of end of sequence NAL unit
     433#define H_MV_HLS_8_HRD_Q0182_05    1   // #5  (HRD    /Q0182/Bitstream part buffer) Decision (BF/Cleanup/Ed): Adopted (such that we use the main proposal for sub-proposal 1, and alternative 1 for sub-proposal 2). + #define H_MV_HLS_8_HRD_Q0182_06  0 // #6  (HRD    /Q0182/hrd_parameters) Sub-proposal 2 Alternative 1: Clarify that the VPS hrd_parameters( ) syntax structure that applies to the layer set which is associated with the bitstream partition initial arrival time SEI message is used to determine the lengths of the nal_initial_arrival_delay[ i ] and vcl_initial_arrival_delay[ i ] syntax elements. Decision (BF/Cleanup/Ed): Adopted alternative 1 for sub-proposal 2
     434#define H_MV_HLS_8_SPS_NODOC_48    1   // #48 (SPS    /NODOC/PPS extension cleanups) Alignment with RExt
     435#define H_MV_HLS_8_DBP_NODOC_42    1   // #42 (DBP    /NODOC/sharing) Remove sub-DPB sharing and processes that mark inter-layer reference pictures as "unused for reference"
     436#define H_MV_HLS_8_RPS_Q0100_36    1   // #36 (RPS    /Q0100/constraint to semantics) v3, add constraint to RPS semantics
     437#define H_MV_HLS_8_POC_Q0142_32    1   // #32 (POC    /Q0142/poc_lsb_not_present_flag) v2: Add semantic constraints to poc_lsb_not_present_flag.
     438#define H_MV_HLS_8_HRD_Q0102_08    1   // #8  (HRD    /Q0102/sps_max_dec_pic_buffering_minus1) Sub-proposal 2: A semantics bug fix is proposed for sps_max_dec_pic_buffering_minus1 as a bug-fix. In discussion, the first option was preferred. Decision (BF/Cleanup/Ed.): Adopt.
     439#define H_MV_HLS_8_MIS_Q0102_30    1   // #30 (MISC   /Q0102/loop index) proposal 3, change the max loop index for signaling bit rate and pic rate info to MaxSubLayersInLayerSetMinus1
     440#define H_MV_HLS_8_GEN_Q0108_13    1   // #13 (GEN    /Q0108/STSA TemporalId) Agreed to remove restriction from proposal 2, to allow STSA pics of non-base layers to have TemporalId equal to 0.
     441#define H_MV_HLS_8_PMS_Q0195_21    1   // #21 (PS     /Q0195/constraint update_ref_format_flag) proposal 2: add a semantic constraint on the value of update_ref_format_flag
     442#define H_MV_HLS_8_PMS_Q0195_20    1   // #20 (PS     /Q0195/syntax table rep format) proposal 1: restructure syntax table for sending of rep_format_idx_present_flag and vps_num_ref_formats_minus1
     443#define H_MV_HLS_8_MIS_Q0177_22    1   // #22 (MISC   /Q0177/inference sps_temporal_id_nesting_flag) proposal 1: modify inference rule for sps_temporal_id_nesting_flag when it is not present
     444#define H_MV_HLS_8_PMS_Q0165_18    1   // #18 (PS     /Q0165/disallow an empty layer set) proposal 1.a), add a constraint to disallow an empty layer set
     445#define H_MV_HLS_8_RPS_Q0060_17    1   // #17 (RPS    /Q0060/condition refLayerPicIdc) Proposal 2: Add a condition to the derivation of refLayerPicIdc of (TemporalId == 0)
     446#define H_MV_HLS_8_POC_Q0146_15    1   // #15 (POC    /Q0146/inference of poc_msb_val_present_flag) Proposal 1.1: Change inference rule in semantics of poc_msb_val_present_flag
     447
    381448
    382449
     
    384451///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
    385452/////////////////////////////////////////////////////////////////////////////////////////
    386 #define BUGFIX_INTRAPERIOD 1
     453#define HARMONIZE_GOP_FIRST_FIELD_COUPLE  1
     454#define FIX_FIELD_DEPTH                 1
     455#if H_MV
     456#define EFFICIENT_FIELD_IRAP            0
     457#else
     458#define EFFICIENT_FIELD_IRAP            1
     459#endif
     460#define ALLOW_RECOVERY_POINT_AS_RAP     1
     461#define BUGFIX_INTRAPERIOD              1
    387462#define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1
    388463
     464#define SAO_SGN_FUNC 1
     465
    389466#define FIX1172 1 ///< fix ticket #1172
     467
     468#define SETTING_PIC_OUTPUT_MARK     1
     469#define SETTING_NO_OUT_PIC_PRIOR    1
     470#define FIX_EMPTY_PAYLOAD_NAL       1
     471#define FIX_WRITING_OUTPUT          1
     472#define FIX_OUTPUT_EOS              1
     473
     474#define FIX_POC_CRA_NORASL_OUTPUT   1
    390475
    391476#define MAX_NUM_PICS_IN_SOP           1024
     
    9271012#if H_MV
    9281013
     1014#if !H_MV_HLS_8_SPS_NODOC_48
    9291015enum PpsExtensionTypes
    9301016{
     
    9481034    PS_EX_T_MAX_NUM = 8
    9491035  };
    950 
     1036#endif
    9511037/// scalability types
    9521038  enum ScalabilityType
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/AnnexBread.h

    r872 r962  
    6565  , m_Input(istream)
    6666  {
    67     istream.exceptions(std::istream::eofbit);
     67    istream.exceptions(std::istream::eofbit | std::istream::badbit);
    6868  }
    6969
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/NALread.cpp

    r872 r962  
    127127  else
    128128  {
     129#if H_MV_HLS_8_GEN_Q0108_13
     130
     131    // If nal_unit_type is in the range of BLA_W_LP to RSV_IRAP_VCL23, inclusive, i.e. the coded
     132    // slice segment belongs to an IRAP picture, TemporalId shall be equal to 0.
     133    // Otherwise, when nal_unit_type is equal to TSA_R, TSA_N, STSA_R, or STSA_N, TemporalId shall not be equal to 0.
     134    // Otherwise, if nal_unit_type is equal to TSA or TSA_N, TemporalId shall not be equal to 0.
     135    // Otherwise, when nuh_layer_id is equal to 0 and nal_unit_type is equal to STSA_R or STSA_N,
     136    // TemporalId shall not be equal to 0.
     137
     138    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
     139         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N    );
     140
     141    assert( nalu.m_layerId > 0
     142      || ( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
     143        && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ) );
     144#else
    129145    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    130146         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    131147         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
    132148         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N );
     149#endif
    133150  }
    134151}
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/SEIread.cpp

    r884 r962  
    399399{
    400400  UInt val;
    401   READ_CODE(4, val, "active_vps_id");      sei.activeVPSId = val;
    402   READ_FLAG( val, "full_random_access_flag");  sei.m_fullRandomAccessFlag = val ? true : false;
    403   READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;
     401  READ_CODE(4, val, "active_video_parameter_set_id");   sei.activeVPSId = val;
     402  READ_FLAG(   val, "self_contained_cvs_flag");         sei.m_selfContainedCvsFlag = val ? true : false;
     403  READ_FLAG(   val, "no_parameter_set_update_flag");    sei.m_noParameterSetUpdateFlag = val ? true : false;
    404404  READ_UVLC(   val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
    405405
    406   sei.activeSeqParamSetId.resize(sei.numSpsIdsMinus1 + 1);
     406  sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1);
    407407  for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++)
    408408  {
    409     READ_UVLC(val, "active_seq_param_set_id");  sei.activeSeqParamSetId[i] = val;
    410   }
    411 
    412   UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned();
    413  
    414   while(uibits--)
    415   {
    416     READ_FLAG(val, "alignment_bit");
    417   }
     409    READ_UVLC(val, "active_seq_parameter_set_id");      sei.activeSeqParameterSetId[i] = val;
     410  }
     411
     412  xParseByteAlign();
    418413}
    419414
     
    681676    case 4:
    682677      {
    683         READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedValue = val;
    684         if( sei.m_cameraIsoSpeedValue == 255) //Extended_ISO
     678        READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedIdc = val;
     679        if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
    685680        {
    686681          READ_CODE( 32,   val,   "camera_iso_speed_value" );            sei.m_cameraIsoSpeedValue = val;
     682        }
     683        READ_CODE( 8, val, "exposure_index_idc" );                       sei.m_exposureIndexIdc = val;
     684        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     685        {
     686          READ_CODE( 32,   val,   "exposure_index_value" );              sei.m_exposureIndexValue = val;
    687687        }
    688688        READ_FLAG( val, "exposure_compensation_value_sign_flag" );       sei.m_exposureCompensationValueSignFlag = val;
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r958 r962  
    364364  READ_FLAG( uiCode, "slice_segment_header_extension_present_flag");
    365365  pcPPS->setSliceHeaderExtensionPresentFlag(uiCode);
    366 
     366 
     367#if H_MV
     368  READ_FLAG( uiCode, "pps_extension_present_flag");
     369#else
    367370  READ_FLAG( uiCode, "pps_extension_flag");
     371#endif
    368372  if (uiCode)
    369373  {
     374
    370375#if H_MV
     376#if H_MV_HLS_8_SPS_NODOC_48
     377    READ_FLAG( uiCode, "pps_range_extensions_flag" ); pcPPS->setPpsRangeExtensionsFlag( uiCode == 1 );
     378    READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); pcPPS->setPpsMultilayerExtensionFlag( uiCode == 1 );
     379#if !H_3D
     380    READ_CODE( 6, uiCode, "pps_extension_6bits" ); pcPPS->setPpsExtension6bits( uiCode );
     381#else
     382    READ_FLAG( uiCode, "pps_3d_extension_flag" ); pcPPS->setPps3dExtensionFlag( uiCode == 1 );
     383    READ_CODE( 5, uiCode, "pps_extension_5bits" ); pcPPS->setPpsExtension5bits( uiCode );
     384#endif
     385    if ( pcPPS->getPpsRangeExtensionsFlag() )
     386    {
     387      assert(0);
     388    }
     389
     390    if ( pcPPS->getPpsMultilayerExtensionFlag() )
     391    {
     392        READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
     393#if H_MV_HLS_8_PPS_NODOC_NN
     394        READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
     395#endif
     396    }
     397#if !H_3D
     398    if ( pcPPS->getPpsExtension6bits() )
     399    {
     400#else
     401    if ( pcPPS->getPps3dExtensionFlag() )
     402    {
     403      parsePPSExtension( pcPPS, pcVPS );
     404    }
     405    if ( pcPPS->getPpsExtension5bits() )
     406    {
     407#endif
     408#else
    371409    for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
    372410    {
     
    395433    {
    396434#endif
     435#endif
     436
    397437      while ( xMoreRbspData() )
    398438      {
     
    845885  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    846886  {
    847 #if H_MV
    848887    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    849 #else
    850     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");
    851 #endif
    852888    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    853 #if H_MV
    854889    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    855 #else
    856     READ_UVLC ( uiCode, "sps_num_reorder_pics" );
    857 #endif
    858890    pcSPS->setNumReorderPics(uiCode, i);
    859 #if H_MV
    860891    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    861 #else
    862     READ_UVLC ( uiCode, "sps_max_latency_increase_plus1");
    863 #endif
    864892    pcSPS->setMaxLatencyIncrease( uiCode, i );
    865893
     
    9781006  }
    9791007
     1008
     1009#if H_MV
     1010  READ_FLAG( uiCode, "sps_extension_present_flag");
     1011  pcSPS->setSpsExtensionPresentFlag( uiCode );
     1012  if (pcSPS->getSpsExtensionPresentFlag( ) )
     1013#else
    9801014  READ_FLAG( uiCode, "sps_extension_flag");
     1015  if (uiCode)
     1016#endif
     1017  {
    9811018#if H_MV
    982   pcSPS->setSpsExtensionFlag( uiCode );
    983   if (pcSPS->getSpsExtensionFlag( ) )
    984 #else
    985   if (uiCode)
    986 #endif
    987   {
    988 #if H_MV
     1019#if H_MV_HLS_8_SPS_NODOC_48
     1020    READ_FLAG( uiCode, "sps_range_extensions_flag" ); pcSPS->setSpsRangeExtensionsFlag( uiCode == 1 );
     1021    READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); pcSPS->setSpsMultilayerExtensionFlag( uiCode == 1 );
     1022#if !H_3D
     1023    READ_CODE( 6, uiCode, "sps_extension_6bits" ); pcSPS->setSpsExtension6bits( uiCode );
     1024#else
     1025    READ_FLAG( uiCode, "sps_3d_extension_flag" ); pcSPS->setSps3dExtensionFlag( uiCode == 1 );
     1026    READ_CODE( 5, uiCode, "sps_extension_5bits" ); pcSPS->setSpsExtension5bits( uiCode );
     1027#endif
     1028  }
     1029
     1030  if ( pcSPS->getSpsRangeExtensionsFlag() )
     1031  {
     1032    assert( 0 );
     1033  }
     1034
     1035  if ( pcSPS->getSpsMultilayerExtensionFlag() )
     1036  {
     1037    parseSPSExtension( pcSPS );
     1038  }
     1039
     1040#if H_3D
     1041  if ( pcSPS->getSps3dExtensionFlag() )
     1042  {
     1043    parseSPSExtension2( pcSPS, viewIndex, depthFlag  );
     1044  }
     1045
     1046  if ( pcSPS->getSpsExtension5bits() )
     1047  {
     1048#else
     1049  if ( pcSPS->getSpsExtension6bits() )
     1050  {
     1051#endif
     1052#else
    9891053    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    9901054    {
     
    10121076    {   
    10131077#endif
     1078#endif
    10141079        while ( xMoreRbspData() )
    10151080        {
    10161081          READ_FLAG( uiCode, "sps_extension_data_flag");
    10171082        }
    1018 #if H_MV
     1083#if H_MV && !H_MV_HLS_8_SPS_NODOC_48
    10191084    }
    10201085#endif
     
    10671132 
    10681133  READ_CODE( 4,  uiCode,  "vps_video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
     1134#if H_MV_HLS_8_SYN_Q0041_03
     1135  READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
     1136  READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 );
     1137#else
    10691138  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
     1139#endif
    10701140#if H_MV
    10711141  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) )  );
     
    10731143  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
    10741144#endif
    1075   READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 );
     1145  READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 );    assert(uiCode+1 <= MAX_TLAYER);
    10761146  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    10771147  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     
    11511221    }
    11521222  }
     1223#if H_MV_HLS_8_RPS_Q0100_36
     1224  READ_FLAG( uiCode,  "vps_extension_flag" );                      pcVPS->setVpsExtensionFlag( uiCode == 1 ? true : false );
     1225  if ( pcVPS->getVpsExtensionFlag() )
     1226#else
    11531227  READ_FLAG( uiCode,  "vps_extension_flag" );
    11541228  if (uiCode)
     1229#endif
    11551230  {
    11561231#if H_MV
     
    11871262{
    11881263  UInt uiCode;
     1264#if !H_MV_HLS_8_SYN_Q0041_03
    11891265  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
     1266#endif
    11901267
    11911268  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
     
    12671344      READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode );   
    12681345      pcVPS->checkSubLayersVpsMaxMinus1( i );
    1269 
    12701346    }
    12711347  } 
     
    12941370
    12951371  READ_FLAG( uiCode, "all_ref_layers_active_flag" );             pcVPS->setAllRefLayersActiveFlag( uiCode == 1 );
    1296 
    12971372  READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 
    12981373
     
    13091384  }
    13101385
    1311   READ_UVLC( uiCode, "num_add_output_layer_sets"      ); pcVPS->setNumAddOutputLayerSets( uiCode );
     1386#if H_MV_HLS_8_SYN_39_19
     1387  if ( pcVPS->getNumIndependentLayers() > 1 )
     1388  {
     1389   READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
     1390  }
     1391  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1392  {
     1393    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
     1394    {
     1395      READ_CODE( pcVPS->getHighestLayerIdxPlus1Len( j ) , uiCode, "highest_layer_idx_plus1" ); pcVPS->setHighestLayerIdxPlus1( i, j, uiCode );
     1396    }
     1397  }
     1398  if (pcVPS->getNumLayerSets() > 1)
     1399  {
     1400    READ_UVLC( uiCode, "num_add_olss" ); pcVPS->setNumAddOlss( uiCode );
     1401    READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
     1402  }
     1403
     1404  pcVPS->initTargetLayerIdLists( );
     1405
     1406#else
     1407  READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
    13121408  pcVPS->initTargetLayerIdLists( );
    13131409  if( pcVPS->getNumOutputLayerSets() > 1)
    13141410  {
    1315     READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); pcVPS->setDefaultTargetOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
     1411    READ_CODE( 2, uiCode, "default_output_layer_idc" ); pcVPS->setDefaultOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
    13161412  } 
     1413#endif
    13171414
    13181415  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
    1319   pcVPS->setOutputLayerSetIdxMinus1(0, -1);
     1416  pcVPS->setLayerSetIdxForOlsMinus1(0, -1);
    13201417
    13211418  pcVPS->deriveTargetLayerIdList( 0 );
     1419
    13221420  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    13231421  {
     1422#if H_MV_HLS_8_SYN_39_19
     1423    if( i >= pcVPS->getNumLayerSets( ) )   
     1424#else
    13241425    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
     1426#endif
    13251427    {       
    1326       READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
    1327     }
    1328 
    1329     if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultTargetOutputLayerIdc() == 2 )
     1428      READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode );
     1429    }
     1430
     1431    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 )
    13301432    {       
    1331       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1433      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
    13321434      {
    13331435        READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
     
    13361438    else
    13371439    {
    1338       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1440      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
    13391441      {             
    13401442        pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j ));
     
    13471449      READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
    13481450    }
    1349 
    13501451    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
    13511452    {
     
    13541455  }
    13551456
     1457#if !H_MV_HLS_8_PMS_Q0195_20
    13561458  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    13571459  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    13591461    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
    13601462  }
     1463#else
     1464  READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
     1465#endif
    13611466
    13621467  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
     
    13691474  }
    13701475
     1476#if H_MV_HLS_8_PMS_Q0195_20
     1477  if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
     1478  {
     1479    READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
     1480  }
     1481#endif
    13711482  if( pcVPS->getRepFormatIdxPresentFlag() )
    13721483  {
     1484#if H_MV_HLS_8_SYN_Q0041_03
     1485    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1486#else
    13731487    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1374     {
     1488#endif
     1489    {
     1490#if !H_MV_HLS_8_PMS_Q0195_20
    13751491      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    13761492      {
     1493#endif
    13771494        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    1378       }
    1379     }
    1380   }
     1495#if !H_MV_HLS_8_PMS_Q0195_20
     1496      }
     1497#endif
     1498    }
     1499  }
     1500#if H_MV_HLS_8_PMS_Q0195_20
     1501  else
     1502  {
     1503#if H_MV_HLS_8_SYN_Q0041_03
     1504    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1505#else
     1506    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1507#endif
     1508    {
     1509      pcVPS->setVpsRepFormatIdx( i, pcVPS->inferVpsRepFormatIdx( i ) );
     1510    }
     1511  }
     1512#endif
    13811513
    13821514  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
     
    14031535  }
    14041536
     1537#if H_MV_HLS_8_SYN_Q0041_03
     1538  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1539  {
     1540    for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
     1541#else
    14051542  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    14061543  {
    14071544    for( Int j = 0; j < i; j++ )
     1545#endif
    14081546    {
    14091547      if (pcVPS->getDirectDependencyFlag( i, j) )
     
    14151553        else
    14161554        {
     1555
    14171556          READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
    14181557        }
     
    14201559    }
    14211560  } 
    1422 
    14231561  READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode );
    14241562  for ( Int i = 1; i <= pcVPS->getVpsNonVuiExtensionLength(); i++ )
     
    14371575    pcVPSVUI->inferVpsVui( false );
    14381576  }
    1439 
    14401577  pcVPS->checkVPSExtensionSyntax();
    14411578}
     
    14921629  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    14931630  {
     1631#if H_MV_HLS_8_SYN_Q0041_03
     1632    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1633#else
    14941634    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1495     {
     1635#endif
     1636    {
     1637#if H_MV_HLS_8_MIS_Q0102_30
     1638      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1639#else       
    14961640      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     1641#endif
    14971642      {
    14981643        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     
    15511696    }
    15521697  }
    1553 
    15541698  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
    15551699  if( !pcVPSVUI->getTilesNotInUseFlag() )
    15561700  {     
     1701#if H_MV_HLS_8_SYN_Q0041_03
     1702    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1703#else
    15571704    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1705#endif
    15581706    {
    15591707      READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 );
     
    15631711      }
    15641712    } 
    1565 
    1566     for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1713#if H_MV_HLS_8_SYN_Q0041_03
     1714    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1715#else
     1716    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )     
     1717#endif
    15671718    {
    15681719      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     
    15861737    }
    15871738  }
    1588 
    15891739  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" );
    15901740  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     
    15961746      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    15971747      {
    1598         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
    1599         if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    1600         {
    1601           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag" ); pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, uiCode == 1 );
    1602           if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1748#if H_MV_HLS_8_SYN_Q0041_03
     1749        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1750        {       
     1751#endif
     1752          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     1753          if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
    16031754          {
    1604             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1" ); pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, uiCode );
     1755            READ_FLAG( uiCode, "ctu_based_offset_enabled_flag" ); pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, uiCode == 1 );
     1756            if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1757            {
     1758              READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1" ); pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, uiCode );
     1759            }
    16051760          }
    1606         }
     1761#if H_MV_HLS_8_SYN_Q0041_03
     1762        }
     1763#endif
    16071764      }
    16081765    }
     
    16131770  {
    16141771    parseVpsVuiBspHrdParameters( pcVPS );
    1615 }
     1772  }
    16161773  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    16171774  {
     
    16511808    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
    16521809    {
     1810#if H_MV_HLS_8_HRD_Q0101_04
     1811      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 
     1812      {
     1813        READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
     1814#else
    16531815      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
    16541816      {
     
    16611823          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
    16621824        }
     1825#endif
    16631826      }
    16641827    }
     
    16671830    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
    16681831    { 
    1669       READ_UVLC( uiCode, "num_bsp_sched_combinations" ); vpsVuiBspHrdP->setNumBspSchedCombinations( h, uiCode );
    1670       for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1832      READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1" ); vpsVuiBspHrdP->setNumBspSchedCombinationsMinus1( h, uiCode );
     1833#if H_MV_HLS_8_HRD_Q0182_05
     1834      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1835#else
     1836      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1837#endif
    16711838      {
    16721839        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
    16731840        { 
     1841#if H_MV_HLS_8_HRD_Q0101_04
     1842          READ_CODE( vpsVuiBspHrdP->getBspCombHrdIdxLen(), uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
     1843#else
    16741844          READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
     1845#endif
    16751846          READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
     1847#if H_MV_HLS_8_HRD_Q0101_04
     1848          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j );
     1849#endif
    16761850        } 
    16771851      }
     
    16981872  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
    16991873  { 
     1874#if H_MV_HLS_8_MIS_Q0102_30
     1875    Int currLsIdx = vps->olsIdxToLsIdx( i );
     1876#endif
    17001877    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
     1878#if H_MV_HLS_8_MIS_Q0102_30
     1879    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
     1880#else
    17011881    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1882#endif
    17021883    { 
    17031884      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    17071888      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    17081889      { 
    1709         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
     1890#if H_MV_HLS_8_MIS_Q0102_30
     1891        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
     1892#else
     1893        for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
     1894#endif
    17101895        {
    17111896          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
    17121897        }
    17131898        READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
    1714 #if H_MV_HLS7_GEN
    1715         if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) )
    1716         {
    1717           for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )
    1718           {
    1719             READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1" ); dpbSize->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode );
    1720           }
    1721         }
    1722 #endif
    17231899        READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
    17241900      }
     
    17271903        if ( j > 0 )
    17281904        {
    1729           for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1905#if H_MV_HLS_8_DBP_NODOC_42
     1906          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
     1907#else
     1908          for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
     1909#endif
    17301910          {
    17311911            dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     
    18582038#endif
    18592039
     2040#if H_MV_HLS_8_HRD_Q0102_08
     2041Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)
     2042#else
    18602043Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)
     2044#endif
    18612045{
    18622046  UInt  uiCode;
     
    18762060  if( rpcSlice->getRapPicFlag())
    18772061  {
    1878     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored
    1879   }
     2062    READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored -- updated already
     2063#if SETTING_NO_OUT_PIC_PRIOR
     2064    rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false);
     2065#else
     2066    rpcSlice->setNoOutputPicPrior( false );
     2067#endif
     2068  }
     2069
    18802070  READ_UVLC (    uiCode, "slice_pic_parameter_set_id" );  rpcSlice->setPPSId(uiCode);
    18812071  pps = parameterSetManager->getPrefetchedPPS(uiCode);
     
    18912081  sps->inferRepFormat  ( vps , rpcSlice->getLayerId() );
    18922082  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
     2083#if H_MV_HLS_8_HRD_Q0102_08
     2084  sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false );
     2085#endif
     2086#if H_MV_HLS_8_RPS_Q0100_36
     2087  vps->inferDbpSizeLayerSetZero( sps, false );
     2088#endif
     2089
    18932090  if ( sps->getVuiParametersPresentFlag() )
    18942091  {
     
    20062203      READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");       
    20072204    }   
     2205#if H_MV_HLS_8_POC_Q0142_32
     2206    rpcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb );
     2207#endif
    20082208
    20092209    Bool picOrderCntMSBZeroFlag = false;     
     
    20992299      READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" );
    21002300      if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header
    2101       {
     2301      {       
    21022302        parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
     2303#if H_MV_HLS_8_RPS_Q0100_36
     2304        if ( !rps->getInterRPSPrediction( ) )
     2305        { // check sum of num_positive_pics and num_negative_pics
     2306          rps->checkMaxNumPics(
     2307            vps->getVpsExtensionFlag(),
     2308            vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2309            rpcSlice->getLayerId(),
     2310            sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     2311        }
     2312#endif
    21032313      }
    21042314      else // use reference to short-term reference picture set in PPS
     
    22042414        rps->setNumberOfPictures(offset);       
    22052415      } 
     2416#if H_MV_HLS_8_RPS_Q0100_36
     2417      if ( !rps->getInterRPSPrediction( ) )
     2418      { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics
     2419        rps->checkMaxNumPics(
     2420          vps->getVpsExtensionFlag(),
     2421          vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2422          rpcSlice->getLayerId(),
     2423          sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     2424      }
     2425#endif
    22062426      if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    22072427        || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     
    25842804      rpcSlice->setPocResetIdc( 0 );
    25852805    }
     2806#if H_MV_HLS_8_POC_Q0142_32
     2807    rpcSlice->checkPocResetIdc();
     2808#endif
    25862809
    25872810#if H0044_POC_LSB_NOT_PRESENT
     
    26052828      READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
    26062829      READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
     2830#if !H_MV_HLS_8_POC_Q0142_32
    26072831#if H0044_POC_LSB_NOT_PRESENT
    26082832      if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() )
     
    26112835      }
    26122836#endif
     2837#endif
    26132838    }         
    2614 
    2615     // Derive the value of PocMsbValRequiredFlag
     2839#if H_MV_HLS_8_POC_Q0142_32
     2840    rpcSlice->checkPocLsbVal();
     2841#endif
     2842
     2843    // Derive the value of PocMs8bValRequiredFlag
    26162844    rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()
    26172845                                          /* || TODO related to vps_poc_lsb_aligned_flag */
     
    26242852    else
    26252853    {
     2854#if H_MV_HLS_8_POC_Q0146_15
     2855      rpcSlice->setPocMsbValPresentFlag( rpcSlice->inferPocMsbValPresentFlag( ) );
     2856#else
    26262857      if( rpcSlice->getPocMsbValRequiredFlag() )
    26272858      {
     
    26322863        rpcSlice->setPocMsbValPresentFlag( false );
    26332864      }
     2865#endif
    26342866    }
    26352867
     
    26512883      UInt ignore;
    26522884      READ_CODE(8,ignore,"slice_header_extension_data_byte");
    2653     }
    2654   }
     2885    } 
    26552886#endif
    26562887  }
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r884 r962  
    6767  Int**    m_aaiTempOffset;
    6868#endif
     69
    6970public:
    7071
     
    8081  Void  parseRepFormat      ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
    8182  Void  parseVPSVUI         ( TComVPS* pcVPS );
    82   Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo );
     83  Void  parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo );
    8384  Void  parseDpbSize        ( TComVPS* pcVPS );
    84   Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
     85  Void  parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
    8586#endif
    8687
     
    108109  Void  parseProfileTier    (ProfileTierLevel *ptl);
    109110  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
     111#if H_MV_HLS_8_HRD_Q0102_08
     112  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx);
     113#else
    110114  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager);
     115#endif
    111116  Void  parseTerminatingBit ( UInt& ruiBit );
    112117 
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r950 r962  
    11131113{
    11141114  UInt  uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 );
    1115   UInt  uiNumPart     = pcCU->getNumPartInter();
     1115  UInt  uiNumPart     = pcCU->getNumPartitions();
    11161116  UInt  uiNumQParts   = pcCU->getTotalNumPart() >> 2;
    11171117 
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r884 r962  
    6767  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    6868#if H_3D
    69   virtual Void  parseSPS                  ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag  )         = 0;
     69  virtual Void  parseSPS                  ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag  )                    = 0;
    7070#else
    7171  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
     
    7777#endif
    7878
     79#if H_MV_HLS_8_HRD_Q0102_08
     80  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx )       = 0;
     81#else
    7982  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)       = 0;
     83#endif
    8084
    8185  virtual Void  parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
     
    125129  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
    126130 
    127   virtual ~TDecEntropyIf() {}
     131  virtual ~TDecEntropyIf() {};
    128132};
    129133
     
    160164  Void    decodePPS                   ( TComPPS* pcPPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
    161165#endif
     166#if H_MV_HLS_8_HRD_Q0102_08
     167  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, targetOlsIdx );         }
     168#else
    162169  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager);         }
    163 
     170#endif
    164171  Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
    165172 
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecGop.cpp

    r872 r962  
    249249  }
    250250
     251#if !H_MV_HLS_7_VPS_P0300_27
     252#if SETTING_PIC_OUTPUT_MARK
     253  rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
     254#else
    251255  rpcPic->setOutputMark(true);
     256#endif
    252257  rpcPic->setReconMark(true);
     258#endif
    253259}
    254260
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r950 r962  
    957957        assert(0);
    958958      }
     959#endif
    959960#if H_MV_ENC_DEC_TRAC         
    960961      DTRACE_CU("part_mode", eMode )
    961962#endif
     963#if H_3D_QTLPC
    962964    }
    963965#endif
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r950 r962  
    8787#endif
    8888
     89#if H_MV_HLS_8_HRD_Q0102_08
     90  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/, Int targetOlsIdx ) {}
     91#else
    8992  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
     93#endif
    9094  Void  parseTerminatingBit       ( UInt& ruiBit );
    9195  Void  parseMVPIdx               ( Int& riMVPIdx          );
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r960 r962  
    365365  m_prevSliceSkipped = false;
    366366  m_skippedPOC = 0;
     367#if SETTING_NO_OUT_PIC_PRIOR
     368  m_bFirstSliceInBitstream  = true;
     369  m_lastPOCNoOutputPriorPics = -1;
     370  m_craNoRaslOutputFlag = false;
     371  m_isNoOutputPriorPics = false;
     372#endif
    367373#if H0056_EOS_CHECKS
    368374  m_isLastNALWasEos = false;
     
    375381  m_isDepth = false;
    376382  m_pcCamParsCollector = 0;
     383#endif
     384#if H_MV_HLS_8_HRD_Q0102_08
     385  m_targetOptLayerSetIdx = -1;
    377386#endif
    378387#endif
     
    474483    TComVPS* vps         = pcSlice->getVPS();
    475484    TComDpbSize* dpbSize = vps->getDpbSize();
    476     Int lsIdx            = vps->getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
     485    Int lsIdx            = vps->olsIdxToLsIdx( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
    477486    Int layerIdx         = vps->getIdxInLayerSet     ( lsIdx, getLayerId() );
    478487    Int subDpbIdx        = dpbSize->getSubDpbAssigned( lsIdx, layerIdx );
     
    502511    {
    503512      rpcPic->setOutputMark(false);
     513#if H_MV_HLS_7_VPS_P0300_27
     514      rpcPic->setPicOutputFlag(false);
     515#endif
    504516      bBufferIsAvailable = true;
    505517      break;
     
    509521    {
    510522      rpcPic->setOutputMark(false);
     523#if H_MV_HLS_7_VPS_P0300_27
     524      rpcPic->setPicOutputFlag(false);
     525#endif
    511526      rpcPic->setReconMark( false );
    512527      rpcPic->getPicYuvRec()->setBorderExtension( false );
     
    553568  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    554569  TComSlice::markCurrPic( pcPic );
     570#if !H_MV_HLS_8_DBP_NODOC_42
    555571  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
    556572#endif
     573#endif
    557574  m_bFirstSliceInPicture  = true;
    558575
    559576  return;
    560577}
     578
     579#if SETTING_NO_OUT_PIC_PRIOR
     580Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic)
     581{
     582  if (!rpcListPic || !m_isNoOutputPriorPics) return;
     583
     584  TComList<TComPic*>::iterator  iterPic   = rpcListPic->begin();
     585
     586  while (iterPic != rpcListPic->end())
     587  {
     588    TComPic*& pcPicTmp = *(iterPic++);
     589    if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC())
     590    {
     591      pcPicTmp->setOutputMark(false);
     592#if H_MV_HLS_7_VPS_P0300_27
     593      pcPicTmp->setPicOutputFlag(false);
     594#endif
     595    }
     596  }
     597}
     598#endif
    561599
    562600Void TDecTop::xCreateLostPicture(Int iLostPoc)
     
    623661  TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
    624662  assert (vps != 0);
    625   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
     663  if (!m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
    626664#else
    627665  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
     
    632670  }
    633671
    634 #if H0056_SPS_TEMP_NESTING_FIX
     672#if H_MV_HLS_8_HRD_Q0102_08
     673  sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false );
     674#endif
     675
     676#if H_MV_HLS_8_RPS_Q0100_36
     677  vps->inferDbpSizeLayerSetZero( sps, false );
     678#endif
     679
     680#if H_MV_HLS_8_PMS_Q0195_21
     681  // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
     682  if ( vps->getVpsNumRepFormatsMinus1() == 0 )
     683  {
     684    //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0.
     685    assert( sps->getUpdateRepFormatFlag() == false );
     686  }
     687#endif
     688
     689#if H_MV_HLS_8_RPS_Q0100_36
     690  sps->checkRpsMaxNumPics( vps, getLayerId() );
     691#endif
     692
     693#if H_MV_HLS_8_MIS_Q0177_22
    635694  if( m_layerId > 0 )
    636695  {
     
    729788  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    730789#endif
     790
     791#if H_MV_HLS_8_HRD_Q0102_08
     792  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
     793#else
    731794  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    732 
     795#endif
    733796  // set POC for dependent slices in skipped pictures
    734797  if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
     
    751814#endif
    752815
     816#if SETTING_NO_OUT_PIC_PRIOR
     817  //For inference of NoOutputOfPriorPicsFlag
     818  if (m_apcSlicePilot->getRapPicFlag())
     819  {
     820    if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
     821        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
     822        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
     823    {
     824      m_apcSlicePilot->setNoRaslOutputFlag(true);
     825    }
     826    //the inference for NoOutputPriorPicsFlag
     827    if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag())
     828    {
     829      if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     830      {
     831        m_apcSlicePilot->setNoOutputPriorPicsFlag(true);
     832      }
     833    }
     834    else
     835    {
     836      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
     837    }
     838
     839    if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     840    {
     841      m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag();
     842    }
     843  }
     844  if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag())
     845  {
     846    m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC();
     847    m_isNoOutputPriorPics = true;
     848  }
     849  else
     850  {
     851    m_isNoOutputPriorPics = false;
     852  }
     853
     854  //For inference of PicOutputFlag
     855  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
     856  {
     857    if ( m_craNoRaslOutputFlag )
     858    {
     859      m_apcSlicePilot->setPicOutputFlag(false);
     860    }
     861  }
     862#endif
     863
     864#if FIX_POC_CRA_NORASL_OUTPUT
     865  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
     866  {
     867    Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     868    m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
     869  }
     870#endif
    753871#if H_MV
    754872    xCeckNoClrasOutput();
     
    779897
    780898  //we should only get a different poc for a new picture (with CTU address==0)
    781   if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0))
     899  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0))
    782900  {
    783901    printf ("Warning, the first slice of a picture might have been lost!\n");
     
    820938  }
    821939  m_bFirstSliceInSequence = false;
     940#if SETTING_NO_OUT_PIC_PRIOR 
     941  m_bFirstSliceInBitstream  = false;
     942#endif
    822943  //detect lost reference picture and insert copy of earlier frame.
    823944  Int lostPoc;
     
    11371258#endif
    11381259#if H_3D
    1139   // Preliminary fix. assuming that all sps refer to the same SPS.
     1260  // Preliminary fix. assuming that all sps refer to the same VPS.
    11401261  // Parsing dependency should be resolved!
    11411262  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    1142   assert( vps != 0 ); 
     1263  assert( vps != 0 );
    11431264  m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) );
    11441265#else
     
    11921313      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    11931314      m_parameterSetManagerDecoder.applyPrefetchedPS();
    1194       assert(seiAps->activeSeqParamSetId.size()>0);
    1195 #if H_MV
    1196       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId ))
    1197 #else
    1198       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     1315      assert(seiAps->activeSeqParameterSetId.size()>0);
     1316#if H_MV
     1317      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0], m_layerId ))
     1318#else
     1319      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
    11991320#endif
    12001321      {
     
    13071428      return false;
    13081429     
    1309 #if H0056_EOS_CHECKS
    13101430    case NAL_UNIT_FILLER_DATA:
     1431#if H_MV
    13111432      assert( m_isLastNALWasEos == false );
     1433#endif
    13121434      return false;
    1313 #endif
    13141435     
    13151436    case NAL_UNIT_RESERVED_VCL_N10:
     
    13321453    case NAL_UNIT_RESERVED_VCL31:
    13331454     
    1334 #if !H0056_EOS_CHECKS
    1335     case NAL_UNIT_FILLER_DATA:
    1336 #endif
    13371455    case NAL_UNIT_RESERVED_NVCL41:
    13381456    case NAL_UNIT_RESERVED_NVCL42:
  • branches/HTM-11.0-dev0/source/Lib/TLibDecoder/TDecTop.h

    r959 r962  
    195195  Bool*                    m_layerInitilizedFlag; // initialization Layers
    196196  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     197#if  H_MV_HLS_8_HRD_Q0102_08
     198  Int                      m_targetOptLayerSetIdx;
     199#endif
    197200#else
    198201  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     
    225228  Bool                    m_prevSliceSkipped;
    226229  Int                     m_skippedPOC;
    227 
     230#if SETTING_NO_OUT_PIC_PRIOR 
     231  Bool                    m_bFirstSliceInBitstream;
     232  Int                     m_lastPOCNoOutputPriorPics;
     233  Bool                    m_isNoOutputPriorPics;
     234  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
     235#endif
    228236#if H0056_EOS_CHECKS
    229237  Bool                    m_isLastNALWasEos;
     
    262270 
    263271  Void  deletePicBuffer();
     272#if H_MV
     273#if H_MV_HLS_7_VPS_P0300_27
     274  TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
     275#endif
     276  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
     277#else
     278  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
     279#endif
    264280
    265281#if H_MV
     
    269285#endif
    270286 
     287#if SETTING_NO_OUT_PIC_PRIOR 
     288  Void  checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic);
     289
     290  Bool  getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; }
     291  Void  setNoOutputPriorPicsFlag (bool val) { m_isNoOutputPriorPics = val; }
     292#endif
    271293#if H_MV   
    272294  TComPic*                getPic                ( Int poc );
     
    274296  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    275297  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
     298#if  H_MV_HLS_8_HRD_Q0102_08
     299  Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }   
     300#endif
    276301  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
    277302  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/AnnexBwrite.h

    r872 r962  
    5858
    5959    static const Char start_code_prefix[] = {0,0,0,1};
    60     if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
     60    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
    6161    {
    6262      /* From AVC, When any of the following conditions are fulfilled, the
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/NALwrite.cpp

    r884 r962  
    9191  vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
    9292
    93 #if H_MV  // This will handle situation when writing NAL with zero payload
    94   if (rbsp.size() == 0) return;
    95 #endif
     93  if (rbsp.size() == 0)
     94  {
     95    return;
     96  }
    9697
    9798  for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/SEIwrite.cpp

    r884 r962  
    267267Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei)
    268268{
    269   WRITE_CODE(sei.activeVPSId,     4, "active_vps_id");
    270   WRITE_FLAG(sei.m_fullRandomAccessFlag, "full_random_access_flag");
    271   WRITE_FLAG(sei.m_noParamSetUpdateFlag, "no_param_set_update_flag");
     269  WRITE_CODE(sei.activeVPSId,     4,         "active_video_parameter_set_id");
     270  WRITE_FLAG(sei.m_selfContainedCvsFlag,     "self_contained_cvs_flag");
     271  WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag");
    272272  WRITE_UVLC(sei.numSpsIdsMinus1,    "num_sps_ids_minus1");
    273273
    274   assert (sei.activeSeqParamSetId.size() == (sei.numSpsIdsMinus1 + 1));
    275 
    276   for (Int i = 0; i < sei.activeSeqParamSetId.size(); i++)
    277   {
    278     WRITE_UVLC(sei.activeSeqParamSetId[i], "active_seq_param_set_id");
    279   }
    280 
    281   UInt uiBits = m_pcBitIf->getNumberOfWrittenBits();
    282   UInt uiAlignedBits = ( 8 - (uiBits&7) ) % 8; 
    283   if(uiAlignedBits)
    284   {
    285     WRITE_FLAG(1, "alignment_bit" );
    286     uiAlignedBits--;
    287     while(uiAlignedBits--)
    288     {
    289       WRITE_FLAG(0, "alignment_bit" );
    290     }
    291   }
     274  assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1));
     275
     276  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
     277    {
     278    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
     279  }
     280  xWriteByteAlign();
    292281}
    293282
     
    478467        {
    479468          WRITE_CODE( sei.m_cameraIsoSpeedValue,    32,    "camera_iso_speed_value" );
     469        }
     470        WRITE_CODE( sei.m_exposureIndexIdc,     8,    "exposure_index_idc" );
     471        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     472        {
     473          WRITE_CODE( sei.m_exposureIndexValue,     32,    "exposure_index_value" );
    480474        }
    481475        WRITE_FLAG( sei.m_exposureCompensationValueSignFlag,           "exposure_compensation_value_sign_flag" );
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r950 r962  
    140140    WRITE_UVLC( rps->getNumberOfNegativePictures(), "num_negative_pics" );
    141141    WRITE_UVLC( rps->getNumberOfPositivePictures(), "num_positive_pics" );
     142
    142143    Int prev = 0;
    143144    for(Int j=0 ; j < rps->getNumberOfNegativePictures(); j++)
     
    276277        pcPPS->getLayerId() != 1  )
    277278    {
    278         pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
     279#if H_MV_HLS_8_SPS_NODOC_48
     280      pcPPS->setPps3dExtensionFlag( false );
     281#else
     282      pcPPS->setPpsExtensionTypeFlag( PPS_EX_T_3D, false );
     283#endif
    279284    }
    280285  #endif
     
    283288  WRITE_FLAG( 0, "pps_extension_flag" );
    284289#else
    285   WRITE_FLAG( 1, "pps_extension_flag" );
    286 
     290  WRITE_FLAG( 1, "pps_extension_present_flag" );
     291
     292#if H_MV_HLS_8_SPS_NODOC_48
     293    WRITE_FLAG( pcPPS->getPpsRangeExtensionsFlag( ) ? 1 : 0 , "pps_range_extensions_flag" );
     294    WRITE_FLAG( pcPPS->getPpsMultilayerExtensionFlag( ) ? 1 : 0 , "pps_multilayer_extension_flag" );
     295#if !H_3D
     296    WRITE_CODE( pcPPS->getPpsExtension6bits( ), 6, "pps_extension_6bits" );
     297#else
     298    WRITE_FLAG( pcPPS->getPps3dExtensionFlag( ) ? 1 : 0 , "pps_3d_extension_flag" );
     299    WRITE_CODE( pcPPS->getPpsExtension5bits( ), 5, "pps_extension_5bits" );
     300#endif
     301    if ( pcPPS->getPpsRangeExtensionsFlag() )
     302    {
     303      assert(0);
     304    }
     305
     306    if ( pcPPS->getPpsMultilayerExtensionFlag() )
     307    {
     308      WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
     309#if H_MV_HLS_8_PPS_NODOC_NN
     310      WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" );
     311#endif
     312    }
     313
     314#if H_3D
     315    if( pcPPS->getPps3dExtensionFlag( )  ) // This probably needs to be aligned with Rext and SHVC
     316    {
     317      codePPSExtension( pcPPS );
     318    }
     319#endif
     320#else
    287321  for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
    288322  {
     
    305339    codePPSExtension( pcPPS );
    306340  }
     341#endif
    307342#endif
    308343
     
    822857  WRITE_FLAG( 0, "sps_extension_flag" );
    823858#else
    824   WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" );
    825 
    826   if ( pcSPS->getSpsExtensionFlag() )
    827   {
     859  WRITE_FLAG( pcSPS->getSpsExtensionPresentFlag(), "sps_extension_present_flag" );
     860
     861  if ( pcSPS->getSpsExtensionPresentFlag() )
     862  {
     863#if H_MV_HLS_8_SPS_NODOC_48
     864    WRITE_FLAG( pcSPS->getSpsRangeExtensionsFlag( ) ? 1 : 0 , "sps_range_extensions_flag" );
     865    WRITE_FLAG( pcSPS->getSpsMultilayerExtensionFlag( ) ? 1 : 0 , "sps_multilayer_extension_flag" );
     866#if !H_3D
     867    WRITE_CODE( pcSPS->getSpsExtension6bits( ), 6, "sps_extension_6bits" );
     868#else
     869    WRITE_FLAG( pcSPS->getSps3dExtensionFlag( ) ? 1 : 0 , "sps_3d_extension_flag" );
     870    WRITE_CODE( pcSPS->getSpsExtension5bits( ), 5, "sps_extension_5bits" );
     871#endif
     872 }
     873
     874  if ( pcSPS->getSpsRangeExtensionsFlag() )
     875  {
     876    assert( 0 );
     877  }
     878
     879  if ( pcSPS->getSpsMultilayerExtensionFlag() )
     880  {
     881    codeSPSExtension( pcSPS );
     882  }
     883
     884#if H_3D
     885  if ( pcSPS->getSps3dExtensionFlag() )
     886  {
     887    codeSPSExtension2( pcSPS, viewIndex, depthFlag  );
     888  }
     889
     890#endif
     891#else
    828892    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
    829893    {
     
    848912#endif
    849913  }
     914#endif
    850915#endif
    851916}
     
    890955{
    891956  WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
     957#if H_MV_HLS_8_SYN_Q0041_03
     958  WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" );
     959  WRITE_FLAG( 1                                             , "vps_reserved_one_bit" );
     960#else
    892961  WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
     962#endif
    893963#if H_MV
    894964  WRITE_CODE( pcVPS->getMaxLayersMinus1(),       6,        "vps_max_layers_minus1" );
     
    9721042  }
    9731043#if H_MV
     1044#if H_MV_HLS_8_RPS_Q0100_36
     1045  WRITE_FLAG( pcVPS->getVpsExtensionFlag(),                     "vps_extension_flag" );
     1046#else
    9741047  WRITE_FLAG( 1,                     "vps_extension_flag" );
     1048#endif
    9751049  m_pcBitIf->writeAlignOne();
    9761050  codeVPSExtension( pcVPS );                           
     
    9961070Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS )
    9971071{
     1072 
     1073#if !H_MV_HLS_8_SYN_Q0041_03
    9981074  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
     1075#endif
     1076
    9991077  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    10001078
     
    10101088
    10111089  if ( pcVPS->getSplittingFlag() )
    1012   { // Ignore old dimension id length
     1090  {
    10131091    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 );       
    10141092  }   
     
    10421120  }
    10431121
    1044 
    10451122  WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
    10461123
     
    10681145    }
    10691146  }
     1147
    10701148  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
    10711149  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    11091187  }
    11101188
    1111   WRITE_UVLC( pcVPS->getNumAddOutputLayerSets( ), "num_add_output_layer_sets" );
     1189#if H_MV_HLS_8_SYN_39_19
     1190  if ( pcVPS->getNumIndependentLayers() > 1 )
     1191  {
     1192   WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
     1193  }
     1194  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1195  {
     1196    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
     1197    {
     1198      WRITE_CODE( pcVPS->getHighestLayerIdxPlus1( i, j ), pcVPS->getHighestLayerIdxPlus1Len( j )  , "highest_layer_idx_plus1" );
     1199    }
     1200  }
     1201  if (pcVPS->getNumLayerSets() > 1)
     1202  {
     1203    WRITE_UVLC( pcVPS->getNumAddOlss( ), "num_add_olss" );
     1204    WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
     1205  }
     1206#else
     1207  WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
    11121208
    11131209  if( pcVPS->getNumOutputLayerSets() > 1)
    11141210  {
    1115     WRITE_CODE( pcVPS->getDefaultTargetOutputLayerIdc( ), 2, "default_target_output_layer_idc" );
     1211    WRITE_CODE( pcVPS->getDefaultOutputLayerIdc( ), 2, "default_output_layer_idc" );
    11161212  } 
    1117 
     1213#endif
    11181214
    11191215  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
    1120   assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 );
     1216  assert( pcVPS->getLayerSetIdxForOlsMinus1( 0 ) == -1 );
     1217
     1218
     1219
    11211220
    11221221  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
    11231222  {
     1223#if H_MV_HLS_8_SYN_39_19
     1224    if( i >= pcVPS->getNumLayerSets( ) )   
     1225#else
    11241226    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
     1227#endif
    11251228    {     
    1126       WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
    1127     }
    1128 
    1129     if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultTargetOutputLayerIdc() == 2 )
     1229      WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ),      "layer_set_idx_for_ols_minus1[i]" );
     1230    }
     1231
     1232    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 )
    11301233    {       
    1131       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1234      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
    11321235      {
    11331236        WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
     
    11361239    else
    11371240    {
    1138       for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ) - 1; j++ )
     1241      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ) - 1; j++ )
    11391242      {             
    11401243        assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j ));
    11411244      }
    11421245    }       
     1246
    11431247
    11441248    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     
    11521256  }
    11531257
     1258#if !H_MV_HLS_8_PMS_Q0195_20
    11541259  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
    11551260  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    11571262    WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
    11581263  }
     1264#else
     1265  WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
     1266#endif
    11591267
    11601268  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    11611269  {   
     1270
    11621271    TComRepFormat* curRepFormat = pcVPS->getRepFormat(i);     
    11631272    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
    11641273    codeRepFormat( i, curRepFormat ,  prevRepFormat);
    1165   }
    1166 
     1274
     1275  }
     1276
     1277#if H_MV_HLS_8_PMS_Q0195_20
     1278  if ( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
     1279  {
     1280    WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
     1281  }
     1282#endif
    11671283  if( pcVPS->getRepFormatIdxPresentFlag() )
    11681284  {
     1285#if H_MV_HLS_8_SYN_Q0041_03
     1286    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1287#else
    11691288    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    1170     {
     1289#endif
     1290    {
     1291#if !H_MV_HLS_8_PMS_Q0195_20
    11711292      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    11721293      {
     1294#endif
    11731295        WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" );
    1174       }
    1175     }
    1176   }
     1296#if !H_MV_HLS_8_PMS_Q0195_20
     1297      }
     1298#endif
     1299    }
     1300  }
     1301#if H_MV_HLS_8_PMS_Q0195_20
     1302  else
     1303  {
     1304#if H_MV_HLS_8_SYN_Q0041_03
     1305    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1306#else
     1307    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1308#endif
     1309    {
     1310      assert( pcVPS->getVpsRepFormatIdx( i ) ==  pcVPS->inferVpsRepFormatIdx( i ) );
     1311    }
     1312  }
     1313#endif
     1314
    11771315
    11781316  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     
    11871325    }
    11881326  }
     1327
    11891328  WRITE_FLAG( 0, "vps_reserved_zero_flag" );
    11901329  codeDpbSize( pcVPS );
     
    11931332
    11941333  WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" );
    1195 
    11961334  if ( pcVPS->getDefaultDirectDependencyFlag( ) )
    11971335  { 
     
    11991337  }
    12001338
     1339#if H_MV_HLS_8_SYN_Q0041_03
     1340  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ?  1 : 2; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1341  {
     1342    for( Int j = pcVPS->getVpsBaseLayerInternalFlag() ?  0 : 1; j < i; j++ )
     1343#else
    12011344  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    12021345  {
    12031346    for( Int j = 0; j < i; j++ )
     1347#endif
    12041348    {
    12051349      if (pcVPS->getDirectDependencyFlag( i, j) )
     
    12181362  } 
    12191363  WRITE_UVLC( 0, "vps_non_vui_extension_length" );
    1220   WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
     1364 
     1365
     1366
     1367
     1368WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
    12211369  if( pcVPS->getVpsVuiPresentFlag() )
    12221370  {
     
    12291377    pcVPSVUI->inferVpsVui( true );
    12301378  }
     1379
    12311380}
    12321381
     
    12481397  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
    12491398  { 
     1399#if H_MV_HLS_8_MIS_Q0102_30
     1400    Int currLsIdx = vps->olsIdxToLsIdx( i );
     1401#endif
    12501402    WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
     1403#if H_MV_HLS_8_MIS_Q0102_30
     1404    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
     1405#else
    12511406    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1407#endif
    12521408    { 
    12531409      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    12571413      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    12581414      { 
    1259         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
     1415#if H_MV_HLS_8_MIS_Q0102_30
     1416        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
     1417#else
     1418        for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i )); k++ )   
     1419#endif
    12601420        {
    12611421          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
    12621422        }
    12631423        WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" );
    1264 #if H_MV_HLS7_GEN
    1265         if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) )
    1266         {
    1267           for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )
    1268           {
    1269             WRITE_UVLC( dpbSize->getMaxVpsLayerDecPicBuffMinus1( i, k, j ), "max_vps_layer_dec_pic_buff_minus1" );
    1270           }
    1271         }
    1272 #endif
    12731424        WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" );
    12741425      }
     
    12771428        if ( j > 0 )
    12781429        {
    1279           for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )   
     1430#if H_MV_HLS_8_DBP_NODOC_42
     1431          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
     1432#else
     1433          for( Int k = 0; k < vps->getNumSubDpbs( vps->olsIdxToLsIdx( i ) ); k++ )   
     1434#endif
    12801435          {
    12811436            assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     
    12851440        }
    12861441      }
    1287     }       
    1288   } 
     1442    }
     1443  }
    12891444}
    12901445
     
    13241479  assert( pcVPSVUI );
    13251480
     1481
    13261482  WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" );
    13271483  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     
    13371493  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    13381494  {
     1495#if H_MV_HLS_8_SYN_Q0041_03
     1496    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1497#else
    13391498    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
    1340     {
     1499#endif
     1500    {
     1501#if H_MV_HLS_8_MIS_Q0102_30
     1502      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1503#else         
    13411504      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     1505#endif
    13421506      {
    13431507        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     
    13991563  if( !pcVPSVUI->getTilesNotInUseFlag() )
    14001564  {     
     1565#if H_MV_HLS_8_SYN_Q0041_03
     1566    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1567#else
    14011568    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1569#endif
    14021570    {
    14031571      WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" );
     
    14071575      }
    14081576    } 
    1409 
     1577#if H_MV_HLS_8_SYN_Q0041_03
     1578    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 2; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1579#else
    14101580    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1581#endif
    14111582    {
    14121583      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     
    14391610      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    14401611      {
     1612#if H_MV_HLS_8_SYN_Q0041_03
     1613        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1614        {       
     1615#endif
    14411616        WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
    14421617        if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
     
    14481623          }
    14491624        }
     1625#if H_MV_HLS_8_SYN_Q0041_03
     1626        }
     1627#endif
    14501628      }
    14511629    }
     
    14951673    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
    14961674    {
     1675#if H_MV_HLS_8_HRD_Q0101_04
     1676      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ ) 
     1677      {
     1678        WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
     1679#else
    14971680      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
    14981681      {
     
    15051688          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
    15061689        }
     1690#endif
    15071691      }
    15081692    }
     
    15101694
    15111695    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
    1512     { 
    1513       WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" );
    1514       for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1696    {
     1697      WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ), "num_bsp_sched_combinations_minus1" );
     1698#if H_MV_HLS_8_HRD_Q0182_05
     1699      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1700#else
     1701      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
     1702#endif
    15151703      {
    15161704        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
    15171705        { 
     1706#if H_MV_HLS_8_HRD_Q0101_04
     1707          WRITE_CODE( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ),  vpsVuiBspHrdP->getBspCombHrdIdxLen(), "bsp_comb_hrd_idx" );
     1708#else
    15181709          WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" );
     1710#endif
    15191711          WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
     1712
     1713#if H_MV_HLS_8_HRD_Q0101_04
     1714          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j );
     1715#endif
    15201716        } 
    15211717      }
     
    16361832  if ( pcSlice->getRapPicFlag() )
    16371833  {
     1834#if SETTING_NO_OUT_PIC_PRIOR
     1835    WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" );
     1836#else
    16381837    WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
     1838#endif
    16391839  }
    16401840#if PPS_FIX_DEPTH
     
    17071907      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    17081908      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb");
    1709     }
     1909#if H_MV_HLS_8_POC_Q0142_32
     1910      pcSlice->setSlicePicOrderCntLsb( picOrderCntLSB );
     1911#endif
     1912    }
     1913
    17101914#endif
    17111915    if( !pcSlice->getIdrPicFlag() )
     
    21372341    }
    21382342
     2343#if H_MV_HLS_8_POC_Q0142_32
     2344    pcSlice->checkPocResetIdc();
     2345#endif
     2346
    21392347    if( pcSlice->getPocResetIdc() !=  0 )
    21402348    {
     
    21472355      WRITE_CODE( pcSlice->getPocLsbVal( ), pcSlice->getPocLsbValLen() , "poc_lsb_val" );
    21482356    }             
    2149    
     2357#if H_MV_HLS_8_POC_Q0142_32
     2358    pcSlice->checkPocLsbVal();
     2359#endif
     2360
    21502361    if( !pcSlice->getPocMsbValRequiredFlag() /* TODO &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
    21512362    {
    21522363      WRITE_FLAG( pcSlice->getPocMsbValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" );
    21532364    }
     2365#if H_MV_HLS_8_POC_Q0146_15
     2366    else
     2367    {
     2368      assert( pcSlice->getPocMsbValPresentFlag() ==  pcSlice->inferPocMsbValPresentFlag( ) );
     2369    }
     2370#endif
    21542371   
    21552372    if( pcSlice->getPocMsbValPresentFlag() )
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r950 r962  
    256256  Int       m_cameraIsoSpeedIdc;
    257257  Int       m_cameraIsoSpeedValue;
     258  Int       m_exposureIndexIdc;
     259  Int       m_exposureIndexValue;
    258260  Int       m_exposureCompensationValueSignFlag;
    259261  Int       m_exposureCompensationValueNumerator;
     
    495497  Void      setMaxRefPicNum                 ( Int iMaxRefPicNum )           { m_iMaxRefPicNum = iMaxRefPicNum;  }
    496498
    497   Bool      getMaxTempLayer                 ()                              { return m_maxTempLayer;              }
     499  Int       getMaxTempLayer                 ()                              { return m_maxTempLayer;              }
    498500  Void      setMaxTempLayer                 ( Int maxTempLayer )            { m_maxTempLayer = maxTempLayer;      }
    499501
     
    753755  Void  setTMISEICameraIsoSpeedValue(Int b)                  {  m_cameraIsoSpeedValue = b;  }
    754756  Int   getTMISEICameraIsoSpeedValue()                       {  return m_cameraIsoSpeedValue;  }
     757  Void  setTMISEIExposureIndexIdc(Int b)                     {  m_exposureIndexIdc = b;  }
     758  Int   getTMISEIExposurIndexIdc()                           {  return m_exposureIndexIdc;  }
     759  Void  setTMISEIExposureIndexValue(Int b)                   {  m_exposureIndexValue = b;  }
     760  Int   getTMISEIExposurIndexValue()                         {  return m_exposureIndexValue;  }
    755761  Void  setTMISEIExposureCompensationValueSignFlag(Int b)    {  m_exposureCompensationValueSignFlag = b;  }
    756762  Int   getTMISEIExposureCompensationValueSignFlag()         {  return m_exposureCompensationValueSignFlag;  }
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r884 r962  
    7575  m_iNumPicCoded        = 0; //Niko
    7676  m_bFirst              = true;
     77#if ALLOW_RECOVERY_POINT_AS_RAP
     78  m_iLastRecoveryPicPOC = 0;
     79#endif
    7780 
    7881  m_pcCfg               = NULL;
     
    167170  SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets();
    168171  seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId();
    169   seiActiveParameterSets->m_fullRandomAccessFlag = false;
    170   seiActiveParameterSets->m_noParamSetUpdateFlag = false;
     172  seiActiveParameterSets->m_selfContainedCvsFlag = false;
     173  seiActiveParameterSets->m_noParameterSetUpdateFlag = false;
    171174  seiActiveParameterSets->numSpsIdsMinus1 = 0;
    172   seiActiveParameterSets->activeSeqParamSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
    173   seiActiveParameterSets->activeSeqParamSetId[0] = sps->getSPSId();
     175  seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
     176  seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId();
    174177  return seiActiveParameterSets;
    175178}
     
    274277       seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue();
    275278       assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 );
     279       seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc();
     280       seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue();
     281       assert( seiToneMappingInfo->m_exposureIndexValue !=0 );
    276282       seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag();
    277283       seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator();
     
    428434  UInt *accumNalsDU = NULL;
    429435  SEIDecodingUnitInfo decodingUnitInfoSEI;
     436#if EFFICIENT_FIELD_IRAP
     437  Int IRAPGOPid = -1;
     438  Bool IRAPtoReorder = false;
     439  Bool swapIRAPForward = false;
     440  if(isField)
     441  {
     442    Int pocCurr;
     443#if !H_MV
     444    for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ )
     445#endif
     446    {
     447      // determine actual POC
     448      if(iPOCLast == 0) //case first frame or first top field
     449      {
     450        pocCurr=0;
     451      }
     452      else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value
     453      {
     454        pocCurr = 1;
     455      }
     456      else
     457      {
     458        pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField;
     459      }
     460
     461      // check if POC corresponds to IRAP
     462      NalUnitType tmpUnitType = getNalUnitType(pocCurr, m_iLastIDR, isField);
     463      if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP
     464      {
     465        if(pocCurr%2 == 0 && iGOPid < m_iGopSize-1 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid+1).m_POC-1)
     466        { // if top field and following picture in enc order is associated bottom field
     467          IRAPGOPid = iGOPid;
     468          IRAPtoReorder = true;
     469          swapIRAPForward = true;
     470          break;
     471        }
     472        if(pocCurr%2 != 0 && iGOPid > 0 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid-1).m_POC+1)
     473        {
     474          // if picture is an IRAP remember to process it first
     475          IRAPGOPid = iGOPid;
     476          IRAPtoReorder = true;
     477          swapIRAPForward = false;
     478          break;
     479        }
     480      }
     481    }
     482  }
     483#endif
    430484#if !H_MV
    431485  for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ )
    432486#endif
    433487  {
     488#if EFFICIENT_FIELD_IRAP
     489    if(IRAPtoReorder)
     490    {
     491      if(swapIRAPForward)
     492      {
     493        if(iGOPid == IRAPGOPid)
     494        {
     495          iGOPid = IRAPGOPid +1;
     496        }
     497        else if(iGOPid == IRAPGOPid +1)
     498        {
     499          iGOPid = IRAPGOPid;
     500        }
     501      }
     502      else
     503      {
     504        if(iGOPid == IRAPGOPid -1)
     505        {
     506          iGOPid = IRAPGOPid;
     507        }
     508        else if(iGOPid == IRAPGOPid)
     509        {
     510          iGOPid = IRAPGOPid -1;
     511        }
     512      }
     513    }
     514#endif
    434515    UInt uiColDir = 1;
    435516    //-- For time output for each slice
     
    500581    if(pocCurr>=m_pcCfg->getFramesToBeEncoded())
    501582    {
     583#if EFFICIENT_FIELD_IRAP
     584      if(IRAPtoReorder)
     585      {
     586        if(swapIRAPForward)
     587        {
     588          if(iGOPid == IRAPGOPid)
     589          {
     590            iGOPid = IRAPGOPid +1;
     591            IRAPtoReorder = false;
     592          }
     593          else if(iGOPid == IRAPGOPid +1)
     594          {
     595            iGOPid --;
     596          }
     597        }
     598        else
     599        {
     600          if(iGOPid == IRAPGOPid)
     601          {
     602            iGOPid = IRAPGOPid -1;
     603          }
     604          else if(iGOPid == IRAPGOPid -1)
     605          {
     606            iGOPid = IRAPGOPid;
     607            IRAPtoReorder = false;
     608          }
     609        }
     610      }
     611#endif
    502612#if H_MV
    503613      delete pcBitstreamRedirect;
     
    635745    }
    636746
    637     // Do decoding refresh marking if any
    638     pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic);
    639     m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
    640     pcSlice->getRPS()->setNumberOfLongtermPictures(0);
     747#if EFFICIENT_FIELD_IRAP
    641748#if FIX1172
    642749    if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     
    653760    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    654761#endif
    655 
     762#endif
     763    // Do decoding refresh marking if any
     764    pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic);
     765    m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
     766    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
     767#if EFFICIENT_FIELD_IRAP
     768#else
     769#if FIX1172
     770    if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     771      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     772      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     773      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     774      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
     775      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
     776    {
     777      m_associatedIRAPType = pcSlice->getNalUnitType();
     778      m_associatedIRAPPOC = pocCurr;
     779    }
     780    pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
     781    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     782#endif
     783#endif
     784
     785#if ALLOW_RECOVERY_POINT_AS_RAP
     786    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
     787#if EFFICIENT_FIELD_IRAP
     788      || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
     789#endif
     790      )
     791    {
     792      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3);
     793    }
     794#else
    656795    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
    657796    {
    658797      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
    659798    }
     799#endif
    660800    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    661801
     
    14111551      }
    14121552      pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the .
    1413       pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded;
     1553      pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pcSlice->getPOC() - m_totalCoded;
     1554#if EFFICIENT_FIELD_IRAP
     1555      if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize)
     1556      {
     1557        // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation
     1558        pictureTimingSEI.m_picDpbOutputDelay ++;
     1559      }
     1560#endif
    14141561      Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2;
    14151562      pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay;
     
    15181665      sei_recovery_point.m_exactMatchingFlag = ( pcSlice->getPOC() == 0 ) ? (true) : (false);
    15191666      sei_recovery_point.m_brokenLinkFlag    = false;
     1667#if ALLOW_RECOVERY_POINT_AS_RAP
     1668      if(m_pcCfg->getDecodingRefreshType() == 3)
     1669      {
     1670        m_iLastRecoveryPicPOC = pocCurr;
     1671      }
     1672#endif
    15201673
    15211674      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, pcSlice->getSPS() );
     
    16411794          }
    16421795          m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     1796
     1797#if SETTING_NO_OUT_PIC_PRIOR
     1798          if (pcSlice->isIRAP())
     1799          {
     1800            if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP)
     1801            {
     1802              pcSlice->setNoRaslOutputFlag(true);
     1803            }
     1804            //the inference for NoOutputPriorPicsFlag
     1805            if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag())
     1806            {
     1807              if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     1808              {
     1809                pcSlice->setNoOutputPriorPicsFlag(true);
     1810              }
     1811            }
     1812          }
     1813#endif
     1814
    16431815          tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
    16441816          m_pcEntropyCoder->encodeSliceHeader(pcSlice);
     
    21532325      std::vector<Int> temp;
    21542326      TComSlice::markCurrPic( pcPic );
     2327#if !H_MV_HLS_8_DBP_NODOC_42
    21552328      TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() );
     2329#endif
    21562330#endif
    21572331      m_bFirst = false;
     
    21632337
    21642338      delete[] pcSubstreamsOut;
     2339
     2340#if EFFICIENT_FIELD_IRAP
     2341    if(IRAPtoReorder)
     2342    {
     2343      if(swapIRAPForward)
     2344      {
     2345        if(iGOPid == IRAPGOPid)
     2346        {
     2347          iGOPid = IRAPGOPid +1;
     2348          IRAPtoReorder = false;
     2349        }
     2350        else if(iGOPid == IRAPGOPid +1)
     2351        {
     2352          iGOPid --;
     2353        }
     2354      }
     2355      else
     2356      {
     2357        if(iGOPid == IRAPGOPid)
     2358        {
     2359          iGOPid = IRAPGOPid -1;
     2360        }
     2361        else if(iGOPid == IRAPGOPid -1)
     2362        {
     2363          iGOPid = IRAPGOPid;
     2364          IRAPtoReorder = false;
     2365        }
     2366      }
     2367    }
     2368#endif
    21652369  }
    21662370  delete pcBitstreamRedirect;
     
    24352639    case NAL_UNIT_CODED_SLICE_CRA: return "CRA";
    24362640    case NAL_UNIT_CODED_SLICE_RADL_R:     return "RADL_R";
     2641    case NAL_UNIT_CODED_SLICE_RADL_N:     return "RADL_N";
    24372642    case NAL_UNIT_CODED_SLICE_RASL_R:     return "RASL_R";
     2643    case NAL_UNIT_CODED_SLICE_RASL_N:     return "RASL_N";
    24382644    case NAL_UNIT_VPS: return "VPS";
    24392645    case NAL_UNIT_SPS: return "SPS";
     
    28383044    return NAL_UNIT_CODED_SLICE_IDR_W_RADL;
    28393045  }
     3046#if EFFICIENT_FIELD_IRAP
     3047  if(isField && pocCurr == 1)
     3048  {
     3049    // to avoid the picture becoming an IRAP
     3050    return NAL_UNIT_CODED_SLICE_TRAIL_R;
     3051  }
     3052#endif
     3053
     3054#if ALLOW_RECOVERY_POINT_AS_RAP
     3055  if(m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0)
     3056#else
    28403057  if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0)
     3058#endif
    28413059  {
    28423060    if (m_pcCfg->getDecodingRefreshType() == 1)
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/TEncGOP.h

    r884 r962  
    8585  Int                     m_iNumPicCoded;
    8686  Bool                    m_bFirst;
     87#if ALLOW_RECOVERY_POINT_AS_RAP
     88  Int                     m_iLastRecoveryPicPOC;
     89#endif
    8790 
    8891  //  Access channel
  • branches/HTM-11.0-dev0/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r872 r962  
    920920        for (y=0; y<endY; y++)
    921921        {
     922#if SAO_SGN_FUNC
     923          signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     924#else
    922925          signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     926#endif
    923927          for (x=startX; x<endX; x++)
    924928          {
     929#if SAO_SGN_FUNC
     930            signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
     931#else
    925932            signRight =  (Char)m_sign[srcLine[x] - srcLine[x+1]];
     933#endif
    926934            edgeType  =  signRight + signLeft;
    927935            signLeft  = -signRight;
     
    943951            for(y=0; y<skipLinesB[typeIdx]; y++)
    944952            {
     953#if SAO_SGN_FUNC
     954              signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     955#else
    945956              signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     957#endif
    946958              for (x=startX; x<endX; x++)
    947959              {
     960#if SAO_SGN_FUNC
     961                signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
     962#else
    948963                signRight =  (Char)m_sign[srcLine[x] - srcLine[x+1]];
     964#endif
    949965                edgeType  =  signRight + signLeft;
    950966                signLeft  = -signRight;
     
    9941010#endif
    9951011        {
     1012#if SAO_SGN_FUNC
     1013          signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
     1014#else
    9961015          signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]];
     1016#endif
    9971017        }