Changeset 1349 in 3DVCSoftware


Ignore:
Timestamp:
14 Oct 2015, 04:03:38 (9 years ago)
Author:
nict-htm
Message:

FIX: TAppDecoder No Option (Help View) Abnormal end.
FIX: VC10 Compile order.
ADD: VC12, VC14 support.
NEW: ALTERNATIVE_DEPTH_INFO, not TBD.
BUG: TAppDecoder 15 frame abnormal end. (debug now)

Location:
branches/HTM-15.1-dev0-NICT
Files:
29 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.1-dev0-NICT/build/HM_vc10.sln

    r1313 r1349  
    1 
     1
    22Microsoft Visual Studio Solution File, Format Version 11.00
    33# Visual Studio 2010
     
    2424Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppExtractor", "vc10\TAppExtractor_vc10.vcxproj", "{F46F95E9-7174-4328-90DD-092450E4DCF6}"
    2525EndProject
     26Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibDecoderAnalyser", "vc10\TLibDecoderAnalyser_vc10.vcxproj", "{68C1251A-55D8-47C9-9052-62F785BD437A}"
     27EndProject
    2628Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppDecoderAnalyser", "vc10\TAppDecoderAnalyser_vc10.vcxproj", "{6BB4C8D8-449D-4CC1-A5E1-E98AAF94012F}"
    27 EndProject
    28 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibDecoderAnalyser", "vc10\TLibDecoderAnalyser_vc10.vcxproj", "{68C1251A-55D8-47C9-9052-62F785BD437A}"
    2929EndProject
    3030Global
     
    124124                {F46F95E9-7174-4328-90DD-092450E4DCF6}.Release|x64.ActiveCfg = Release|x64
    125125                {F46F95E9-7174-4328-90DD-092450E4DCF6}.Release|x64.Build.0 = Release|x64
     126                {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|Win32.ActiveCfg = Debug|Win32
     127                {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|Win32.Build.0 = Debug|Win32
     128                {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|x64.ActiveCfg = Debug|x64
     129                {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|x64.Build.0 = Debug|x64
     130                {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|Win32.ActiveCfg = Release|Win32
     131                {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|Win32.Build.0 = Release|Win32
     132                {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.ActiveCfg = Release|x64
     133                {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.Build.0 = Release|x64
    126134                {6BB4C8D8-449D-4CC1-A5E1-E98AAF94012F}.Debug|Win32.ActiveCfg = Debug|Win32
    127135                {6BB4C8D8-449D-4CC1-A5E1-E98AAF94012F}.Debug|Win32.Build.0 = Debug|Win32
     
    132140                {6BB4C8D8-449D-4CC1-A5E1-E98AAF94012F}.Release|x64.ActiveCfg = Release|x64
    133141                {6BB4C8D8-449D-4CC1-A5E1-E98AAF94012F}.Release|x64.Build.0 = Release|x64
    134                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|Win32.ActiveCfg = Debug|Win32
    135                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|Win32.Build.0 = Debug|Win32
    136                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|x64.ActiveCfg = Debug|x64
    137                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Debug|x64.Build.0 = Debug|x64
    138                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|Win32.ActiveCfg = Release|Win32
    139                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|Win32.Build.0 = Release|Win32
    140                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.ActiveCfg = Release|x64
    141                 {68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.Build.0 = Release|x64
    142142        EndGlobalSection
    143143        GlobalSection(SolutionProperties) = preSolution
  • branches/HTM-15.1-dev0-NICT/cfg/SEI/alternativeDepthInfoSei_gvd.cfg

    r1344 r1349  
    33
    44#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
    5 ApplicableLayerIds              :                             # LayerIds      of layers   to which the SEI is added. (all when empty)
    6 ApplicablePocs                  :                             # POCs          of pictures to which the SEI is added. (all when empty)
    7 ApplicableTids                  :                             # Tids          of pictures to which the SEI is added. (all when empty)
    8 ApplicableVclNaluTypes          :                             # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
     5ApplicableLayerIds              :                       # LayerIds      of layers   to which the SEI is added. (all when empty)
     6ApplicablePocs                  :                       # POCs          of pictures to which the SEI is added. (all when empty)
     7ApplicableTids                  :                       # Tids          of pictures to which the SEI is added. (all when empty)
     8ApplicableVclNaluTypes          :                       # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
    99
    1010#======== Position in bit stream  ============
    11 SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added
    12 PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
     11SeiNaluId                       : 0                     # Identifies to which NAL unit  the SEI is added
     12PositionInSeiNalu               : 0                     # Identifies the position within the NAL unit
    1313
    1414#======== Payload modification =============
    15 ModifyByEncoder                 : 0                            # 0: Use payload as specified in cfg file   1: Modify SEI by encoder.
     15ModifyByEncoder                 : 0                     # 0: Use payload as specified in cfg file   1: Modify SEI by encoder.
    1616
    17 #======== Payload specification =============
     17#======== Payload specification =============           # FP Value by ATM 13.3 SEI dump
     18                                                        # Poznan Street
     19#======== Part 0 ============================
    1820AlternativeDepthInfoCancelFlag  : 0
    19 DepthType                       : 0
    20 NumConstituentViewsGvdMinus1    : 0
     21DepthType                       : 0                     # 0: NICT-GVD, 1: Nagoya-Warpmap
     22NumConstituentViewsGvdMinus1    : 1                     # 1: 3View
    2123DepthPresentGvdFlag             : 0
    22 ZGvdFlag                        : 0
    23 IntrinsicParamGvdFlag           : 0
    24 RotationGvdFlag                 : 0
    25 TranslationGvdFlag              : 0
    26 SignGvdZNearFlag                : 0
    27 ExpGvdZNear                     : 0
    28 ManLenGvdZNearMinus1            : 0
    29 ManGvdZNear                     : 0
    30 SignGvdZFarFlag                 : 0
    31 ExpGvdZFar                      : 0
    32 ManLenGvdZFarMinus1             : 0
    33 ManGvdZFar                      : 0
    34 PrecGvdFocalLength              : 0
    35 PrecGvdPrincipalPoint           : 0
    36 PrecGvdRotationParam            : 0
    37 PrecGvdTranslationParam         : 0
    38 SignGvdFocalLengthX             : 0
    39 ExpGvdFocalLengthX              : 0
    40 ManGvdFocalLengthX              : 0
    41 SignGvdFocalLengthY             : 0
    42 ExpGvdFocalLengthY              : 0
    43 ManGvdFocalLengthY              : 0
    44 SignGvdPrincipalPointX          : 0
    45 ExpGvdPrincipalPointX           : 0
    46 ManGvdPrincipalPointX           : 0
    47 SignGvdPrincipalPointY          : 0
    48 ExpGvdPrincipalPointY           : 0
    49 ManGvdPrincipalPointY           : 0
    50 SignGvdR_0_0                    : 0
    51 ExpGvdR_0_0                     : 0
    52 ManGvdR_0_0                     : 0
    53 SignGvdTX                       : 0
    54 ExpGvdTX                        : 0
    55 ManGvdTX                        : 0
     24ZGvdFlag                        : 1
     25IntrinsicParamGvdFlag           : 1
     26RotationGvdFlag                 : 1
     27TranslationGvdFlag              : 1
     28#======== Part 1 ============================
     29#======== 0      ============================
     30SignGvdZNearFlag_0              : 1                     # -34.506386
     31ExpGvdZNear_0                   : 36
     32ManLenGvdZNearMinus1_0          : 24
     33ManGvdZNear_0                   : 2628136
     34SignGvdZFarFlag_0               : 1                     # -2760.510889
     35ExpGvdZFar_0                    : 42
     36ManLenGvdZFarMinus1_0           : 24
     37ManGvdZFar_0                    : 11673778
     38#======== 1      ============================
     39SignGvdZNearFlag_1              : 1                     # -34.506386
     40ExpGvdZNear_1                   : 36
     41ManLenGvdZNearMinus1_1          : 24
     42ManGvdZNear_1                   : 2628136
     43SignGvdZFarFlag_1               : 1                     # -2760.510889
     44ExpGvdZFar_1                    : 42
     45ManLenGvdZFarMinus1_1           : 24
     46ManGvdZFar_1                    : 11673778
     47#======== 2      ============================
     48SignGvdZNearFlag_2              : 1                     # -34.506386
     49ExpGvdZNear_2                   : 36
     50ManLenGvdZNearMinus1_2          : 24
     51ManGvdZNear_2                   : 2628136
     52SignGvdZFarFlag_2               : 1                     # -2760.510889
     53ExpGvdZFar_2                    : 42
     54ManLenGvdZFarMinus1_2           : 24
     55ManGvdZFar_2                    : 11673778
     56#======== Part 2 ============================
     57PrecGvdFocalLength              : 18                    # ATM code embeded value.
     58PrecGvdPrincipalPoint           : 18
     59PrecGvdRotationParam            : 18
     60PrecGvdTranslationParam         : 18
     61#======== Part 3 ============================
     62#======== 0      ============================
     63SignGvdFocalLengthX_0           : 0                     # 1732.875727
     64ExpGvdFocalLengthX_0            : 41
     65ManGvdFocalLengthX_0            : 185827518
     66SignGvdFocalLengthY_0           : 0                     # 1729.908923
     67ExpGvdFocalLengthY_0            : 41
     68ManGvdFocalLengthY_0            : 185049788
     69SignGvdPrincipalPointX_0        : 0                     # 943.231169
     70ExpGvdPrincipalPointX_0         : 40
     71ManGvdPrincipalPointX_0         : 113044663
     72SignGvdPrincipalPointY_0        : 0                     # 548.845040
     73ExpGvdPrincipalPointY_0         : 40
     74ManGvdPrincipalPointY_0         : 9658706
     75SignGvdR_0_0_0                  : 0                     # 1.000000
     76ExpGvdR_0_0_0                   : 31
     77ManGvdR_0_0_0                   : 0
     78SignGvdR_0_0_1                  : 0                     # 0.000000
     79ExpGvdR_0_0_1                   : 0
     80ManGvdR_0_0_1                   : 0
     81SignGvdR_0_0_2                  : 0                     # 0.000000
     82ExpGvdR_0_0_2                   : 0
     83ManGvdR_0_0_2                   : 0
     84SignGvdR_0_1_0                  : 0                     # 0.000000
     85ExpGvdR_0_1_0                   : 0
     86ManGvdR_0_1_0                   : 0
     87SignGvdR_0_1_1                  : 0                     # 1.000000
     88ExpGvdR_0_1_1                   : 31
     89ManGvdR_0_1_1                   : 0
     90SignGvdR_0_1_2                  : 0                     # 0.000000
     91ExpGvdR_0_1_2                   : 0
     92ManGvdR_0_1_2                   : 0
     93SignGvdR_0_2_0                  : 0                     # 0.000000
     94ExpGvdR_0_2_0                   : 0
     95ManGvdR_0_2_0                   : 0
     96SignGvdR_0_2_1                  : 0                     # 0.000000
     97ExpGvdR_0_2_1                   : 0
     98ManGvdR_0_2_1                   : 0
     99SignGvdR_0_2_2                  : 0                     # 1.000000
     100ExpGvdR_0_2_2                   : 31
     101ManGvdR_0_2_2                   : 0
     102SignGvdTX_0                     : 0                     # 6.372093
     103ExpGvdTX_0                      : 33
     104ManGvdTX_0                      : 621829
     105#======== 1      ============================
     106SignGvdFocalLengthX_1           : 0                     # 1732.875727
     107ExpGvdFocalLengthX_1            : 41
     108ManGvdFocalLengthX_1            : 185827518
     109SignGvdFocalLengthY_1           : 0                     # 1729.908923
     110ExpGvdFocalLengthY_1            : 41
     111ManGvdFocalLengthY_1            : 185049788
     112SignGvdPrincipalPointX_1        : 0                     # 943.231169
     113ExpGvdPrincipalPointX_1         : 40
     114ManGvdPrincipalPointX_1         : 113044663
     115SignGvdPrincipalPointY_1        : 0                     # 548.845040
     116ExpGvdPrincipalPointY_1         : 40
     117ManGvdPrincipalPointY_1         : 9658706
     118SignGvdR_1_0_0                  : 0                     # 1.000000
     119ExpGvdR_1_0_0                   : 31
     120ManGvdR_1_0_0                   : 0
     121SignGvdR_1_0_1                  : 0                     # 0.000000
     122ExpGvdR_1_0_1                   : 0
     123ManGvdR_1_0_1                   : 0
     124SignGvdR_1_0_2                  : 0                     # 0.000000
     125ExpGvdR_1_0_2                   : 0
     126ManGvdR_1_0_2                   : 0
     127SignGvdR_1_1_0                  : 0                     # 0.000000
     128ExpGvdR_1_1_0                   : 0
     129ManGvdR_1_1_0                   : 0
     130SignGvdR_1_1_1                  : 0                     # 1.000000
     131ExpGvdR_1_1_1                   : 31
     132ManGvdR_1_1_1                   : 0
     133SignGvdR_1_1_2                  : 0                     # 0.000000
     134ExpGvdR_1_1_2                   : 0
     135ManGvdR_1_1_2                   : 0
     136SignGvdR_1_2_0                  : 0                     # 0.000000
     137ExpGvdR_1_2_0                   : 0
     138ManGvdR_1_2_0                   : 0
     139SignGvdR_1_2_1                  : 0                     # 0.000000
     140ExpGvdR_1_2_1                   : 0
     141ManGvdR_1_2_1                   : 0
     142SignGvdR_1_2_2                  : 0                     # 1.000000
     143ExpGvdR_1_2_2                   : 31
     144ManGvdR_1_2_2                   : 0
     145SignGvdTX_1                     : 0                     # 7.965116
     146ExpGvdTX_1                      : 33
     147ManGvdTX_1                      : 1039431
     148#======== 2      ============================
     149SignGvdFocalLengthX_2           : 0                     # 1732.875727
     150ExpGvdFocalLengthX_2            : 41
     151ManGvdFocalLengthX_2            : 185827518
     152SignGvdFocalLengthY_2           : 0                     # 1729.908923
     153ExpGvdFocalLengthY_2            : 41
     154ManGvdFocalLengthY_2            : 185049788
     155SignGvdPrincipalPointX_2        : 0                     # 943.231169
     156ExpGvdPrincipalPointX_2         : 40
     157ManGvdPrincipalPointX_2         : 113044663
     158SignGvdPrincipalPointY_2        : 0                     # 548.845040
     159ExpGvdPrincipalPointY_2         : 40
     160ManGvdPrincipalPointY_2         : 9658706
     161SignGvdR_2_0_0                  : 0                     # 1.000000
     162ExpGvdR_2_0_0                   : 31
     163ManGvdR_2_0_0                   : 0
     164SignGvdR_2_0_1                  : 0                     # 0.000000
     165ExpGvdR_2_0_1                   : 0
     166ManGvdR_2_0_1                   : 0
     167SignGvdR_2_0_2                  : 0                     # 0.000000
     168ExpGvdR_2_0_2                   : 0
     169ManGvdR_2_0_2                   : 0
     170SignGvdR_2_1_0                  : 0                     # 0.000000
     171ExpGvdR_2_1_0                   : 0
     172ManGvdR_2_1_0                   : 0
     173SignGvdR_2_1_1                  : 0                     # 1.000000
     174ExpGvdR_2_1_1                   : 31
     175ManGvdR_2_1_1                   : 0
     176SignGvdR_2_1_2                  : 0                     # 0.000000
     177ExpGvdR_2_1_2                   : 0
     178ManGvdR_2_1_2                   : 0
     179SignGvdR_2_2_0                  : 0                     # 0.000000
     180ExpGvdR_2_2_0                   : 0
     181ManGvdR_2_2_0                   : 0
     182SignGvdR_2_2_1                  : 0                     # 0.000000
     183ExpGvdR_2_2_1                   : 0
     184ManGvdR_2_2_1                   : 0
     185SignGvdR_2_2_2                  : 0                     # 1.000000
     186ExpGvdR_2_2_2                   : 31
     187ManGvdR_2_2_2                   : 0
     188SignGvdTX_2                     : 0                     # 4.779070
     189ExpGvdTX_2                      : 33
     190ManGvdTX_2                      : 204228
  • branches/HTM-15.1-dev0-NICT/source/App/TAppDecoder/TAppDecCfg.h

    r1321 r1349  
    8282  Int           m_targetOptLayerSetIdx;                 ///< target output layer set index
    8383  Int           m_targetDecLayerSetIdx;
    84   Int           m_baseLayerOutputFlag; 
    85   Int           m_baseLayerPicOutputFlag; 
    86   Int           m_auOutputFlag; 
     84  Int           m_baseLayerOutputFlag;
     85  Int           m_baseLayerPicOutputFlag;
     86  Int           m_auOutputFlag;
    8787  Int           m_maxLayerId;                           ///< maximum nuh_layer_id decoded
    88   std::ifstream m_bitstreamFile; 
     88  std::ifstream m_bitstreamFile;
    8989  Int           m_highestTid;
    9090  Bool          m_targetDecLayerIdSetFileEmpty;       ///< indication if target layers are given by file
    9191
    92   Bool          m_printVpsInfo;                      ///< Output VPS information 
     92  Bool          m_printVpsInfo;                      ///< Output VPS information
    9393  Bool          m_printPicOutput;                     ///< Print information on picture output
    9494  Bool          m_printReceivedNalus;                 ///< Print information on received NAL units
    9595#if NH_3D
    96   Char*         m_pchScaleOffsetFile;                   ///< output coded scale and offset parameters
     96  Char*         m_pchScaleOffsetFile = nullptr;         ///< output coded scale and offset parameters // NICT FIX
    9797  Bool          m_depth420OutputFlag;                   ///< output depth layers in 4:2:0
    9898#endif
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.cpp

    r1347 r1349  
    189189#if NH_MV_SEI_TBD
    190190    //////////////////////////////////////////////////////////////////////////
    191     // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages. 
     191    // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages.
    192192    //////////////////////////////////////////////////////////////////////////
    193193
    194     case SEI::BUFFERING_PERIOD:                     return new SEIBufferingPeriod; 
     194    case SEI::BUFFERING_PERIOD:                     return new SEIBufferingPeriod;
    195195    case SEI::PICTURE_TIMING:                       return new SEIPictureTiming;
    196196    case SEI::PAN_SCAN_RECT:                        return new SEIPanScanRectangle;                    // not currently decoded
    197197    case SEI::FILLER_PAYLOAD:                       return new SEIFillerPaylod;                       // not currently decoded
    198198    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return new SEIUserDataRegistered;                 // not currently decoded
    199     case SEI::USER_DATA_UNREGISTERED:               return new SEIuserDataUnregistered; 
     199    case SEI::USER_DATA_UNREGISTERED:               return new SEIuserDataUnregistered;
    200200    case SEI::RECOVERY_POINT:                       return new SEIRecoveryPoint;
    201201    case SEI::SCENE_INFO:                           return new SEISceneInformation;                    // not currently decoded
     
    215215    case SEI::DECODED_PICTURE_HASH:                 return new SEIDecodedPictureHash;
    216216    case SEI::SCALABLE_NESTING:                     return new SEIScalableNesting;
    217     case SEI::REGION_REFRESH_INFO:                  return new SEIRegionRefreshInfo; 
     217    case SEI::REGION_REFRESH_INFO:                  return new SEIRegionRefreshInfo;
    218218    case SEI::NO_DISPLAY:                           return new SEINoDisplay;
    219219    case SEI::TIME_CODE:                            return new SEITimeCode;
    220220    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return new SEIMasteringDisplayColourVolume;
    221221    case SEI::SEGM_RECT_FRAME_PACKING:              return new SEISegmentedRectFramePacking;
    222     case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return new SEITempMotionConstrainedTileSets; 
     222    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return new SEITempMotionConstrainedTileSets;
    223223    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return new SEIChromaSamplingFilterHint
    224224#endif
     
    241241  case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:            return new SEIThreeDimensionalReferenceDisplaysInfo;
    242242#if SEI_DRI_F0169
    243   case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo; 
    244 #endif 
     243  case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo;
     244#endif
    245245  case SEI::MULTIVIEW_SCENE_INFO                  :               return new SEIMultiviewSceneInfo;
    246246  case SEI::MULTIVIEW_ACQUISITION_INFO            :               return new SEIMultiviewAcquisitionInfo;
     
    262262SEI* SEI::getCopy() const
    263263{
    264   assert( 0 ); 
     264  assert( 0 );
    265265  return NULL;
    266266}
     
    273273Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const
    274274{
    275   Bool insertSeiHere = true;     
     275  Bool insertSeiHere = true;
    276276  if( !m_applicableLayerIds.empty() )
    277277  {
     
    295295Bool SEI::checkCfg( const TComSlice* slice )
    296296{
    297   assert( false ); 
     297  assert( false );
    298298  return true;
    299299}
     
    309309  {
    310310    xPrintCfgErrorIntro();
    311     std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl;       
    312     wrongConfig = true;       
    313   }
    314 }
    315 
    316 Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs, 
    317                                             IntAry1d defAppTids,     IntAry1d defAppVclNaluTypes, 
     311    std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl;
     312    wrongConfig = true;
     313  }
     314}
     315
     316Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs,
     317                                            IntAry1d defAppTids,     IntAry1d defAppVclNaluTypes,
    318318                                            Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder)
    319319{
     
    334334  {
    335335    xPrintCfgErrorIntro();
    336     std::cout << errStr << std::endl;       
    337     wrongConfig = true;       
     336    std::cout << errStr << std::endl;
     337    wrongConfig = true;
    338338  }
    339339}
     
    342342#if NH_MV_LAYERS_NOT_PRESENT_SEI
    343343Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile)
    344 { 
     344{
    345345  // Set default values
    346   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    347 
    348   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     346  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     347
     348  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    349349  // This SEI message doesn't need to be added by default to any Layer / POC / NAL Unit / T Layer. Not sure if empty is right.
    350350  defAppLayerIds    .empty( );
     
    354354
    355355  Int      defSeiNaluId                  = 0;
    356   Int      defPositionInSeiNalu          = 0; 
     356  Int      defPositionInSeiNalu          = 0;
    357357  Bool     defModifyByEncoder            = false;   //0: Use payload as specified in cfg file   1: Modify SEI by encoder
    358358
    359359  // Setup config file options
    360   po::Options opts;     
    361   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     360  po::Options opts;
     361  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    362362
    363363  opts.addOptions()
     
    375375
    376376  Bool SEILayersNotPresent::checkCfg( const TComSlice* slice )
    377   { 
     377  {
    378378  // Check config values
    379     Bool wrongConfig = false; 
     379    Bool wrongConfig = false;
    380380//
    381     const TComVPS* vps = slice->getVPS(); 
    382 //  // TBD: Add constraints on presence of SEI here. 
     381    const TComVPS* vps = slice->getVPS();
     382//  // TBD: Add constraints on presence of SEI here.
    383383    xCheckCfg     ( wrongConfig, m_lnpSeiActiveVpsId == vps->getVPSId(), "The value of lnp_sei_active_vps_id shall be equal to the value of vps_video_parameter_set_id of the active VPS for the VCL NAL units of the access unit containing the SEI message." );
    384384    xCheckCfg     ( wrongConfig, m_lnpSeiMaxLayers == vps->getMaxLayersMinus1(), "The number of LayerNotPresent flags shall be equal to vpsMaxLayersMinus1." );
     
    396396    }
    397397
    398       return wrongConfig; 
     398      return wrongConfig;
    399399  };
    400400#endif
     
    402402
    403403Void SEIInterLayerConstrainedTileSets::setupFromCfgFile(const Char* cfgFile)
    404 { 
     404{
    405405  // Set default values
    406   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    407 
    408   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
    409   defAppLayerIds    .empty( ); 
    410   defAppPocs        .push_back( 0 ); 
    411   defAppTids        .empty( ); 
    412   defAppVclNaluTypes.empty( ); 
    413 
    414   Int      defSeiNaluId                  = 0; 
    415   Int      defPositionInSeiNalu          = 0; 
    416   Bool     defModifyByEncoder            = false; 
     406  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     407
     408  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
     409  defAppLayerIds    .empty( );
     410  defAppPocs        .push_back( 0 );
     411  defAppTids        .empty( );
     412  defAppVclNaluTypes.empty( );
     413
     414  Int      defSeiNaluId                  = 0;
     415  Int      defPositionInSeiNalu          = 0;
     416  Bool     defModifyByEncoder            = false;
    417417
    418418  // Setup config file options
    419   po::Options opts;     
    420   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
    421 
    422   const Int maxNumTileInSet = 100; 
     419  po::Options opts;
     420  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
     421
     422  const Int maxNumTileInSet = 100;
    423423
    424424  opts.addOptions()
     
    444444
    445445Bool SEIInterLayerConstrainedTileSets::checkCfg( const TComSlice* slice )
    446 { 
     446{
    447447  // Check config values
    448   Bool wrongConfig = false; 
    449   const TComPPS* pps = slice->getPPS(); 
    450 
    451   // Currently only the active PPS checked. 
     448  Bool wrongConfig = false;
     449  const TComPPS* pps = slice->getPPS();
     450
     451  // Currently only the active PPS checked.
    452452  xCheckCfg     ( wrongConfig, pps->getTilesEnabledFlag() , "The inter-layer constrained tile sets SEI message shall not be present for the layer with nuh_layer_id equal to targetLayerId when tiles_enabled_flag is equal to 0 for any PPS that is active for the pictures of the CLVS of the layer with nuh_layer_id equal to targetLayerId." );
    453    
     453
    454454  if ( m_ilOneTilePerTileSetFlag )
    455455  {
    456456    xCheckCfg( wrongConfig, ( pps->getNumTileColumnsMinus1() + 1 ) *  ( pps->getNumTileRowsMinus1() + 1 ) <= 256, "It is a requirement of bitstream conformance that when il_one_tile_per_tile_set_flag is equal to 1, the value of ( num_tile_columns_minus1 + 1 ) * ( num_tile_rows_minus1 + 1 ) shall be less than or equal to 256."    );
    457457  }
    458   Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1; 
     458  Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1;
    459459
    460460  for (Int i = 0 ; i < numSignificantSets; i++)
    461461  {
    462462    xCheckCfgRange( wrongConfig, m_ilctsId[i]                         , 0 , (1 << 30) - 1, "ilcts_id"                         );
    463   } 
    464  
    465   return wrongConfig; 
     463  }
     464
     465  return wrongConfig;
    466466};
    467467#if NH_MV_SEI_TBD
     
    484484
    485485Void SEIBspNesting::setupFromCfgFile(const Char* cfgFile)
    486 { 
     486{
    487487  // Set default values
    488   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    489 
    490   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     488  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     489
     490  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    491491  defAppLayerIds    .push_back( TBD );
    492492  defAppPocs        .push_back( TBD );
     
    494494  defAppVclNaluTypes.push_back( TBD );
    495495
    496   Int      defSeiNaluId                  = 0; 
    497   Int      defPositionInSeiNalu          = 0; 
    498   Bool     defModifyByEncoder            = TBD; 
     496  Int      defSeiNaluId                  = 0;
     497  Int      defPositionInSeiNalu          = 0;
     498  Bool     defModifyByEncoder            = TBD;
    499499
    500500  // Setup config file options
    501   po::Options opts;     
    502   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     501  po::Options opts;
     502  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    503503
    504504  opts.addOptions()
     
    518518
    519519Bool SEIBspNesting::checkCfg( const TComSlice* slice )
    520 { 
     520{
    521521  // Check config values
    522   Bool wrongConfig = false; 
    523 
    524   // TBD: Add constraints on presence of SEI here. 
     522  Bool wrongConfig = false;
     523
     524  // TBD: Add constraints on presence of SEI here.
    525525  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    526526  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    527527
    528   // TBD: Modify constraints according to the SEI semantics.   
     528  // TBD: Modify constraints according to the SEI semantics.
    529529  xCheckCfgRange( wrongConfig, m_seiOlsIdx                      , MINVAL , MAXVAL, "sei_ols_idx"          );
    530530  xCheckCfgRange( wrongConfig, m_seiPartitioningSchemeIdx       , MINVAL , MAXVAL, "sei_partitioning_scheme_idx"       );
     
    533533  xCheckCfgRange( wrongConfig, m_numSeisInBspMinus1             , MINVAL , MAXVAL, "num_seis_in_bsp_minus1"           );
    534534
    535   return wrongConfig; 
     535  return wrongConfig;
    536536
    537537};
     
    557557
    558558Void SEIBspInitialArrivalTime::setupFromCfgFile(const Char* cfgFile)
    559 { 
     559{
    560560  // Set default values
    561   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    562 
    563   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     561  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     562
     563  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    564564  defAppLayerIds    .push_back( TBD );
    565565  defAppPocs        .push_back( TBD );
     
    567567  defAppVclNaluTypes.push_back( TBD );
    568568
    569   Int      defSeiNaluId                  = 0; 
    570   Int      defPositionInSeiNalu          = 0; 
    571   Bool     defModifyByEncoder            = TBD; 
     569  Int      defSeiNaluId                  = 0;
     570  Int      defPositionInSeiNalu          = 0;
     571  Bool     defModifyByEncoder            = TBD;
    572572
    573573  // Setup config file options
    574   po::Options opts;     
    575   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     574  po::Options opts;
     575  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    576576
    577577  opts.addOptions()
     
    588588
    589589Bool SEIBspInitialArrivalTime::checkCfg( const TComSlice* slice )
    590 { 
     590{
    591591  // Check config values
    592   Bool wrongConfig = false; 
    593 
    594   // TBD: Add constraints on presence of SEI here. 
     592  Bool wrongConfig = false;
     593
     594  // TBD: Add constraints on presence of SEI here.
    595595  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    596596  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    597597
    598   // TBD: Modify constraints according to the SEI semantics.   
     598  // TBD: Modify constraints according to the SEI semantics.
    599599  xCheckCfgRange( wrongConfig, m_nalInitialArrivalDelay[i]      , MINVAL , MAXVAL, "nal_initial_arrival_delay"        );
    600600  xCheckCfgRange( wrongConfig, m_vclInitialArrivalDelay[i]      , MINVAL , MAXVAL, "vcl_initial_arrival_delay"        );
    601601
    602   return wrongConfig; 
     602  return wrongConfig;
    603603
    604604};
     
    606606
    607607Void SEISubBitstreamProperty::setupFromCfgFile(const Char* cfgFile)
    608 { 
     608{
    609609  // Set default values
    610   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    611 
    612   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     610  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     611
     612  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    613613  defAppLayerIds    .push_back( 0 );
    614614  defAppPocs        .push_back( 0 );
     
    616616  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
    617617
    618   Int      defSeiNaluId                  = 0; 
    619   Int      defPositionInSeiNalu          = 0; 
    620   Bool     defModifyByEncoder            = false; 
     618  Int      defSeiNaluId                  = 0;
     619  Int      defPositionInSeiNalu          = 0;
     620  Bool     defModifyByEncoder            = false;
    621621
    622622  // Setup config file options
    623   po::Options opts;     
    624   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     623  po::Options opts;
     624  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    625625
    626626  opts.addOptions()
     
    642642
    643643Bool SEISubBitstreamProperty::checkCfg( const TComSlice* slice )
    644 { 
     644{
    645645  // Check config values
    646646  Bool wrongConfig = false;
    647647
    648   // For the current encoder, the initial IRAP access unit has always POC zero.   
     648  // For the current encoder, the initial IRAP access unit has always POC zero.
    649649  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0), "When present, the sub-bitstream property SEI message shall be associated with an initial IRAP access unit and the information provided by the SEI messages applies to the bitstream corresponding to the CVS containing the associated initial IRAP access unit.");
    650650
    651   Bool sizeNotCorrect = 
     651  Bool sizeNotCorrect =
    652652    (    ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_subBitstreamMode    .size() )
    653653    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_olsIdxToVps         .size() )
     
    660660
    661661  xCheckCfgRange( wrongConfig, m_numAdditionalSubStreamsMinus1  , 0 , (1 << 10) - 1 , "num_additional_sub_streams_minus1");
    662  
     662
    663663  if ( !sizeNotCorrect )
    664664  {
     
    669669    }
    670670  }
    671   return wrongConfig; 
     671  return wrongConfig;
    672672};
    673673
    674674Void SEISubBitstreamProperty::resizeArrays( )
    675675{
    676   m_subBitstreamMode    .resize( m_numAdditionalSubStreamsMinus1 + 1); 
    677   m_olsIdxToVps         .resize( m_numAdditionalSubStreamsMinus1 + 1); 
    678   m_highestSublayerId   .resize( m_numAdditionalSubStreamsMinus1 + 1); 
    679   m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
    680   m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
     676  m_subBitstreamMode    .resize( m_numAdditionalSubStreamsMinus1 + 1);
     677  m_olsIdxToVps         .resize( m_numAdditionalSubStreamsMinus1 + 1);
     678  m_highestSublayerId   .resize( m_numAdditionalSubStreamsMinus1 + 1);
     679  m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1);
     680  m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1);
    681681}
    682682
    683683Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
    684 { 
     684{
    685685  // Set default values
    686   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    687 
    688   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     686  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     687
     688  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    689689  defAppLayerIds    .clear();
    690690  defAppPocs        .push_back( 0 );
     
    692692  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
    693693
    694   Int      defSeiNaluId                  = 0; 
    695   Int      defPositionInSeiNalu          = 0; 
     694  Int      defSeiNaluId                  = 0;
     695  Int      defPositionInSeiNalu          = 0;
    696696  Bool     defModifyByEncoder            = false;
    697697
    698698  // Setup config file options
    699   po::Options opts;     
    700   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     699  po::Options opts;
     700  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    701701
    702702  opts.addOptions()
     
    720720
    721721Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice )
    722 { 
     722{
    723723  // Check config values
    724   Bool wrongConfig = false; 
     724  Bool wrongConfig = false;
    725725
    726726  int maxInterpretationValue = (1 << (m_alphaChannelBitDepthMinus8+9)) - 1;
     
    734734  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , 0 , 1, "alpha_channel_clip_type_flag"     );
    735735
    736   return wrongConfig; 
    737 
    738 };
    739 
    740 SEIOverlayInfo::SEIOverlayInfo ( ) 
     736  return wrongConfig;
     737
     738};
     739
     740SEIOverlayInfo::SEIOverlayInfo ( )
    741741  : m_numOverlaysMax(16)
    742742  , m_numOverlayElementsMax(256)
     
    745745
    746746Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile)
    747 { 
     747{
    748748  // Set default values
    749   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    750 
    751   // Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     749  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     750
     751  // Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    752752  defAppLayerIds    .clear();
    753753  defAppPocs        .push_back( 0 );
     
    755755  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
    756756
    757   Int      defSeiNaluId                  = 0; 
    758   Int      defPositionInSeiNalu          = 0; 
    759   Bool     defModifyByEncoder            = false; 
     757  Int      defSeiNaluId                  = 0;
     758  Int      defPositionInSeiNalu          = 0;
     759  Bool     defModifyByEncoder            = false;
    760760
    761761  // Setup config file options
    762   po::Options opts;     
    763   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     762  po::Options opts;
     763  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    764764
    765765  opts.addOptions()
     
    779779    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (16,0)                 , "NumOverlayElementsMinus1"         )
    780780    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (256,0) ,16            , "OverlayElementLabelMin"           )
    781     ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (256,0) ,16            , "OverlayElementLabelMax"           )       
     781    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (256,0) ,16            , "OverlayElementLabelMax"           )
    782782    ("OverlayLanguage_%d"             , m_overlayLanguage                  , std::string(""), 16             , "OverlayLanguage"                  )
    783783    ("OverlayName_%d"                 , m_overlayName                      , std::string(""), 16             , "OverlayName"                      )
    784784    ("OverlayElementName_%d_%d"       , m_overlayElementName               , std::string(""), 256 ,16        , "OverlayElementName"               )
    785785    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                           , "OverlayInfoPersistenceFlag"       )
    786     ; 
     786    ;
    787787
    788788  po::setDefaults(opts);
     
    795795
    796796Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
    797 { 
     797{
    798798  // Check config values
    799   Bool wrongConfig = false;   
     799  Bool wrongConfig = false;
    800800
    801801  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , 0 ,   1, "overlay_info_cancel_flag"         );
     
    808808    xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , 0 , 255, "overlay_idx"          );
    809809    xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , 0 ,   1, "language_overlay_present_flag"    );
    810     xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , 0 ,   1, "overlay_label_present_flag"       ); 
     810    xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , 0 ,   1, "overlay_label_present_flag"       );
    811811    xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , 0 ,   1, "overlay_alpha_present_flag"       );
    812812    xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , 0 ,   63, "overlay_content_layer_id"    );
    813813    xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , 0 ,   63, "overlay_label_layer_id"    );
    814     xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , 0 ,   63, "overlay_alpha_layer_id"    );   
    815     xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , 0 , m_numOverlayElementsMax-1, "num_overlay_elements_minus1"       );     
     814    xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , 0 ,   63, "overlay_alpha_layer_id"    );
     815    xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , 0 , m_numOverlayElementsMax-1, "num_overlay_elements_minus1"       );
    816816    for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; ++j)
    817     {     
     817    {
    818818      Int maxLabelMinMaxValue = ( 1 << ( m_overlayElementLabelValueLengthMinus8 + 8 ) )-1;
    819819      xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_min"    );
    820       xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_max"    );       
    821     }       
    822   } 
     820      xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_max"    );
     821    }
     822  }
    823823  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , 0 ,   1, "overlay_info_persistence_flag"    );
    824824
    825   return wrongConfig; 
     825  return wrongConfig;
    826826
    827827};
     
    829829
    830830Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
    831 { 
     831{
    832832  // Set default values
    833   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    834 
    835   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
    836   defAppLayerIds    .clear    (   ); 
     833  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     834
     835  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
     836  defAppLayerIds    .clear    (   );
    837837  defAppPocs        .push_back( 0 );
    838838  defAppTids        .push_back( 0 );
    839839  defAppVclNaluTypes.clear    (   );
    840840
    841   Int      defSeiNaluId                  = 0; 
    842   Int      defPositionInSeiNalu          = 0; 
    843   Bool     defModifyByEncoder            = false; 
     841  Int      defSeiNaluId                  = 0;
     842  Int      defPositionInSeiNalu          = 0;
     843  Bool     defModifyByEncoder            = false;
    844844
    845845  // Setup config file options
    846   po::Options opts;     
    847   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     846  po::Options opts;
     847  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    848848
    849849  opts.addOptions()
     
    860860
    861861Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice )
    862 { 
     862{
    863863  // Check config values
    864   Bool wrongConfig = false; 
     864  Bool wrongConfig = false;
    865865
    866866  xCheckCfg     ( wrongConfig, slice->getTemporalId() == 0 , "The temporal motion vector prediction constraints SEI message may be present in an access unit with TemporalId equal to 0 and shall not be present in an access unit with TemporalId greater than 0." );
    867867
    868   return wrongConfig; 
     868  return wrongConfig;
    869869};
    870870
    871871#if NH_MV_SEI_TBD
    872872Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile)
    873 { 
     873{
    874874  // Set default values
    875   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    876 
    877   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     875  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     876
     877  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    878878  defAppLayerIds    .push_back( TBD );
    879879  defAppPocs        .push_back( TBD );
     
    886886
    887887  // Setup config file options
    888   po::Options opts;     
    889   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     888  po::Options opts;
     889  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    890890
    891891  opts.addOptions()
     
    904904
    905905Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice )
    906 { 
     906{
    907907  // Check config values
    908   Bool wrongConfig = false; 
    909 
    910   // TBD: Add constraints on presence of SEI here. 
     908  Bool wrongConfig = false;
     909
     910  // TBD: Add constraints on presence of SEI here.
    911911  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    912912  xCheckCfg     ( wrongConfig, TBD , "TBD" );
    913913
    914   // TBD: Modify constraints according to the SEI semantics.   
     914  // TBD: Modify constraints according to the SEI semantics.
    915915  xCheckCfgRange( wrongConfig, m_ffinfoPicStruct                , MINVAL , MAXVAL, "ffinfo_pic_struct"                );
    916916  xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType           , MINVAL , MAXVAL, "ffinfo_source_scan_type"          );
    917917  xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag            , MINVAL , MAXVAL, "ffinfo_duplicate_flag"            );
    918918
    919   return wrongConfig; 
     919  return wrongConfig;
    920920
    921921};
     
    923923
    924924Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
    925 { 
     925{
    926926  // Set default values
    927   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    928 
    929   // Default values for which layers, POCS, Tids or Nalu types the SEI should be sent. 
    930   defAppLayerIds      .push_back( 0 ); 
     927  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     928
     929  // Default values for which layers, POCS, Tids or Nalu types the SEI should be sent.
     930  defAppLayerIds      .push_back( 0 );
    931931  defAppPocs          .push_back( 0 );
    932932  defAppTids          .push_back( 0 );
    933933  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
    934934
    935   Int      defSeiNaluId                  = 0; 
    936   Int      defPositionInSeiNalu          = 0; 
    937   Bool     defModifyByEncoder            = 0; 
     935  Int      defSeiNaluId                  = 0;
     936  Int      defPositionInSeiNalu          = 0;
     937  Bool     defModifyByEncoder            = 0;
    938938
    939939  // Setup config file options
    940   po::Options opts;     
    941   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     940  po::Options opts;
     941  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    942942
    943943  opts.addOptions()
     
    977977UInt SEIThreeDimensionalReferenceDisplaysInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
    978978{
    979   UInt len; 
     979  UInt len;
    980980  if( expo == 0 )
    981981  {
     
    987987  }
    988988
    989   assert( val >= 0 ); 
     989  assert( val >= 0 );
    990990  assert( val <= ( ( 1 << len )- 1) );
    991   return len; 
     991  return len;
    992992}
    993993
    994994Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
    995 { 
     995{
    996996  // Check config values
    997   Bool wrongConfig = false; 
    998 
    999   // The 3D reference display SEI should preferably be sent along with the multiview acquisition SEI. For now the multiview acquisition SEI is restricted to POC = 0, so 3D reference displays SEI is restricted to POC = 0 as well. 
    1000   xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "The 3D reference displays SEI message currently is associated with an access unit that contains an IRAP picture." ); 
     997  Bool wrongConfig = false;
     998
     999  // The 3D reference display SEI should preferably be sent along with the multiview acquisition SEI. For now the multiview acquisition SEI is restricted to POC = 0, so 3D reference displays SEI is restricted to POC = 0 as well.
     1000  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "The 3D reference displays SEI message currently is associated with an access unit that contains an IRAP picture." );
    10011001
    10021002  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , 0 , 31, "prec_ref_display_width"  );
     
    10061006
    10071007  for (Int i = 0; i <= getNumRefDisplaysMinus1(); i++ )
    1008   { 
     1008  {
    10091009    xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , 0 , 62, "exponent_ref_display_width"   );
    10101010    xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , 0 , 62, "exponent_ref_viewing_distance");
     
    10141014  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, 0 , 1, "three_dimensional_reference_displays_extension_flag");
    10151015
    1016   return wrongConfig; 
     1016  return wrongConfig;
    10171017
    10181018};
     
    10261026
    10271027Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile)
    1028 { 
     1028{
    10291029  // Set default values
    1030   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    1031 
    1032   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
     1030  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     1031
     1032  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    10331033  //defAppLayerIds    .push_back( TBD );
    10341034  defAppPocs        .push_back( 0 );
     
    10361036  //defAppVclNaluTypes.push_back( TBD );
    10371037
    1038   Int      defSeiNaluId                  = 0; 
    1039   Int      defPositionInSeiNalu          = 0; 
    1040   Bool     defModifyByEncoder            = true; 
     1038  Int      defSeiNaluId                  = 0;
     1039  Int      defPositionInSeiNalu          = 0;
     1040  Bool     defModifyByEncoder            = true;
    10411041
    10421042  // Setup config file options
    1043   po::Options opts; 
    1044 
    1045   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     1043  po::Options opts;
     1044
     1045  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    10461046
    10471047  opts.addOptions()
     
    11651165
    11661166Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice )
    1167 { 
     1167{
    11681168    // Check config values
    1169     Bool wrongConfig = false; 
     1169    Bool wrongConfig = false;
    11701170    assert(m_currLayerID>=0);
    11711171
     
    11751175        assert(false);
    11761176    }
    1177     // TBD: Add constraints on presence of SEI here. 
     1177    // TBD: Add constraints on presence of SEI here.
    11781178    xCheckCfg     ( wrongConfig, m_depthRepresentationType[m_currLayerID][0] >=0 , "depth_representation_type must be equal to or greater than 0" );
    11791179    if ( m_dMaxFlag[m_currLayerID] || m_dMinFlag[m_currLayerID])
    11801180    {
    1181         xCheckCfg( wrongConfig , m_disparityRefViewId[m_currLayerID][0]>=0, "disparity_ref_view_id must be equal to or greater than 0 when d_min or d_max are present"); 
    1182     }
    1183 
    1184     if (m_depthRepresentationType[m_currLayerID][0]==3)         
     1181        xCheckCfg( wrongConfig , m_disparityRefViewId[m_currLayerID][0]>=0, "disparity_ref_view_id must be equal to or greater than 0 when d_min or d_max are present");
     1182    }
     1183
     1184    if (m_depthRepresentationType[m_currLayerID][0]==3)
    11851185    {
    11861186        xCheckCfg(wrongConfig , m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]>=0, "depth_nonlinear_representation_num_minus1 must be greater than or equal to 0");
     
    11931193    }
    11941194
    1195     return wrongConfig; 
     1195    return wrongConfig;
    11961196}
    11971197#endif
    11981198
    11991199Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile)
    1200 { 
     1200{
    12011201  // Set default values
    1202   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    1203 
    1204   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
    1205   defAppLayerIds      .clear(); 
    1206   defAppPocs          .clear(); 
     1202  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     1203
     1204  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
     1205  defAppLayerIds      .clear();
     1206  defAppPocs          .clear();
    12071207  defAppTids          .push_back( 0 );
    12081208  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
    12091209
    1210   Int      defSeiNaluId                  = 0; 
    1211   Int      defPositionInSeiNalu          = 0; 
    1212   Bool     defModifyByEncoder            = false; 
     1210  Int      defSeiNaluId                  = 0;
     1211  Int      defPositionInSeiNalu          = 0;
     1212  Bool     defModifyByEncoder            = false;
    12131213
    12141214  // Setup config file options
    1215   po::Options opts;     
    1216   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     1215  po::Options opts;
     1216  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    12171217
    12181218  opts.addOptions()
     
    12251225  // Parse the cfg file
    12261226  po::ErrorReporter err;
    1227   po::parseConfigFile( opts, cfgFile, err ); 
     1227  po::parseConfigFile( opts, cfgFile, err );
    12281228};
    12291229
    12301230
    12311231Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice )
    1232 { 
     1232{
    12331233  // Check config values
    1234   Bool wrongConfig = false; 
    1235    
     1234  Bool wrongConfig = false;
     1235
    12361236  xCheckCfg     ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." );
    1237      
     1237
    12381238  xCheckCfgRange( wrongConfig, m_minDisparity              , -1024 , 1023, "min_disparity"                    );
    12391239  xCheckCfgRange( wrongConfig, m_maxDisparityRange         ,     0 , 2047, "max_disparity_range"              );
    12401240
    1241   return wrongConfig; 
     1241  return wrongConfig;
    12421242
    12431243};
    12441244
    12451245Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile)
    1246 { 
     1246{
    12471247  // Set default values
    1248   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
    1249 
    1250   defAppLayerIds    .clear(); 
     1248  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
     1249
     1250  defAppLayerIds    .clear();
    12511251  defAppPocs        .push_back( 0 );
    12521252  defAppTids        .push_back( 0 );
    12531253  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
    1254  
    1255 
    1256   Int      defSeiNaluId                  = 0; 
    1257   Int      defPositionInSeiNalu          = 0; 
    1258   Bool     defModifyByEncoder            = false; 
     1254
     1255
     1256  Int      defSeiNaluId                  = 0;
     1257  Int      defPositionInSeiNalu          = 0;
     1258  Bool     defModifyByEncoder            = false;
    12591259
    12601260  // Setup config file options
    1261   po::Options opts;     
    1262   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     1261  po::Options opts;
     1262  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    12631263
    12641264  opts.addOptions()
     
    12981298  // Parse the cfg file
    12991299  po::ErrorReporter err;
    1300   po::parseConfigFile( opts, cfgFile, err ); 
     1300  po::parseConfigFile( opts, cfgFile, err );
    13011301};
    13021302
     
    13071307
    13081308Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice )
    1309 { 
     1309{
    13101310  // Check config values
    1311   Bool wrongConfig = false; 
    1312 
    1313   // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.   
    1314   xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "When present, the multiview acquisition information SEI message that applies to the current layer shall be included in an access unit that contains an IRAP picture that is the first picture of a CLVS of the current layer." ); 
     1311  Bool wrongConfig = false;
     1312
     1313  // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.
     1314  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "When present, the multiview acquisition information SEI message that applies to the current layer shall be included in an access unit that contains an IRAP picture that is the first picture of a CLVS of the current layer." );
    13151315
    13161316  xCheckCfgRange( wrongConfig, m_precFocalLength         , 0, 31, "prec_focal_length"         );
     
    13191319
    13201320  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
    1321   { 
     1321  {
    13221322    xCheckCfgRange( wrongConfig, m_exponentFocalLengthX    [ i ], 0, 62, "exponent_focal_length_x"   );
    13231323    xCheckCfgRange( wrongConfig, m_exponentFocalLengthY    [ i ], 0, 62, "exponent_focal_length_y"   );
     
    13311331
    13321332  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
    1333   { 
     1333  {
    13341334    for (Int j = 0; j <= 2; j++)
    13351335    {
    13361336      xCheckCfgRange( wrongConfig, m_exponentT[i][j]     , 0, 62, "exponent_skew_factor"      );
    13371337      for (Int k = 0; k <= 2; k++ )
    1338       {       
    1339         xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");         
     1338      {
     1339        xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");
    13401340      }
    13411341    }
    1342   } 
    1343 
    1344   return wrongConfig; 
     1342  }
     1343
     1344  return wrongConfig;
    13451345
    13461346};
     
    13781378UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
    13791379{
    1380   UInt len; 
     1380  UInt len;
    13811381  if( expo == 0 )
    13821382  {
     
    13881388  }
    13891389
    1390   assert( val >= 0 ); 
     1390  assert( val >= 0 );
    13911391  assert( val <= ( ( 1 << len )- 1) );
    1392   return len; 
     1392  return len;
    13931393}
    13941394
    13951395Void SEIMultiviewViewPosition::setupFromSlice  ( const TComSlice* slice )
    13961396{
    1397   const TComVPS* vps = slice->getVPS(); 
    1398   m_numViewsMinus1 = vps->getNumViews() - 1; 
    1399   m_viewPosition.resize( m_numViewsMinus1 + 1 ); 
     1397  const TComVPS* vps = slice->getVPS();
     1398  m_numViewsMinus1 = vps->getNumViews() - 1;
     1399  m_viewPosition.resize( m_numViewsMinus1 + 1 );
    14001400  for (Int i = 0; i <= m_numViewsMinus1; i++ )
    14011401  {
    1402     // Assuming that view ids indicate the position 
     1402    // Assuming that view ids indicate the position
    14031403    m_viewPosition[i] = vps->getViewIdVal( i );
    14041404  }
     
    14061406
    14071407Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile)
    1408 { 
     1408{
    14091409  // Set default values
    1410   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
     1410  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
    14111411
    14121412  defAppLayerIds    .push_back( 0 );
    14131413  defAppPocs        .push_back( 0 );
    14141414  defAppTids        .push_back( 0 );
    1415   defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 
    1416 
    1417   Int      defSeiNaluId                  = 0; 
    1418   Int      defPositionInSeiNalu          = 0; 
    1419   Bool     defModifyByEncoder            = true; 
     1415  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
     1416
     1417  Int      defSeiNaluId                  = 0;
     1418  Int      defPositionInSeiNalu          = 0;
     1419  Bool     defModifyByEncoder            = true;
    14201420
    14211421  // Setup config file options
    1422   po::Options opts;     
    1423   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
     1422  po::Options opts;
     1423  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    14241424
    14251425  opts.addOptions()
    14261426    ("NumViewsMinus1"         , m_numViewsMinus1                          , 0                       , "NumViewsMinus1")
    1427     ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  ); 
     1427    ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  );
    14281428  ;
    14291429
     
    14361436
    14371437Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice )
    1438 { 
     1438{
    14391439  // Check config values
    1440   Bool wrongConfig = false; 
    1441 
    1442   // TBD: Add constraints on presence of SEI here. 
     1440  Bool wrongConfig = false;
     1441
     1442  // TBD: Add constraints on presence of SEI here.
    14431443  xCheckCfg     ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit."  );
    14441444
    1445   // TBD: Modify constraints according to the SEI semantics. 
     1445  // TBD: Modify constraints according to the SEI semantics.
    14461446  xCheckCfgRange( wrongConfig, m_numViewsMinus1                 , 0 , 62, "num_views_minus1");
    14471447  for(Int i = 0; i <= m_numViewsMinus1; i++)
     
    14501450  }
    14511451
    1452   return wrongConfig; 
     1452  return wrongConfig;
    14531453
    14541454};
     
    14571457#if NH_3D
    14581458Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile)
    1459 { 
     1459{
    14601460  // Set default values
    1461   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
     1461  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
    14621462
    14631463  defAppLayerIds    .clear();
     
    14651465  defAppTids        .clear();
    14661466  defAppVclNaluTypes.clear();
    1467    
    1468   Int      defSeiNaluId                  = 0; 
    1469   Int      defPositionInSeiNalu          = 0; 
    1470   Bool     defModifyByEncoder            = 0;
     1467
     1468  Int      defSeiNaluId                  = 0;
     1469  Int      defPositionInSeiNalu          = 0;
     1470  Bool     defModifyByEncoder            = false;
    14711471
    14721472  // Setup config file options
    1473   po::Options opts;     
    1474   xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
    1475 
     1473  po::Options opts;
     1474  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
     1475
     1476  // 3 = m_numConstituentViewsGvdMinus1 + 2
    14761477  opts.addOptions()
    1477     ("AlternativeDepthInfoCancelFlag"   , m_alternativeDepthInfoCancelFlag   , false                            , "AlternativeDepthInfoCancelFlag"   )
    1478     ("DepthType"                        , m_depthType                        , 1                                , "DepthType"                        )
    1479 #if NH_MV_SEI_TBD
    1480     ("NumConstituentViewsGvdMinus1"     , m_numConstituentViewsGvdMinus1     , 0                                , "NumConstituentViewsGvdMinus1"     )
    1481     ("DepthPresentGvdFlag"              , m_depthPresentGvdFlag              , false                            , "DepthPresentGvdFlag"              )
    1482     ("ZGvdFlag"                         , m_zGvdFlag                         , false                            , "ZGvdFlag"                         )
    1483     ("IntrinsicParamGvdFlag"            , m_intrinsicParamGvdFlag            , false                            , "IntrinsicParamGvdFlag"            )
    1484     ("RotationGvdFlag"                  , m_rotationGvdFlag                  , false                            , "RotationGvdFlag"                  )
    1485     ("TranslationGvdFlag"               , m_translationGvdFlag               , false                            , "TranslationGvdFlag"               )
    1486     ("SignGvdZNearFlag"                 , m_signGvdZNearFlag                 , BoolAry1d(1,0)                   , "SignGvdZNearFlag"                 )
    1487     ("ExpGvdZNear"                      , m_expGvdZNear                      , IntAry1d (1,0)                   , "ExpGvdZNear"                      )
    1488     ("ManLenGvdZNearMinus1"             , m_manLenGvdZNearMinus1             , IntAry1d (1,0)                   , "ManLenGvdZNearMinus1"             )
    1489     ("ManGvdZNear"                      , m_manGvdZNear                      , IntAry1d (1,0)                   , "ManGvdZNear"                      )
    1490     ("SignGvdZFarFlag"                  , m_signGvdZFarFlag                  , BoolAry1d(1,0)                   , "SignGvdZFarFlag"                  )
    1491     ("ExpGvdZFar"                       , m_expGvdZFar                       , IntAry1d (1,0)                   , "ExpGvdZFar"                       )
    1492     ("ManLenGvdZFarMinus1"              , m_manLenGvdZFarMinus1              , IntAry1d (1,0)                   , "ManLenGvdZFarMinus1"              )
    1493     ("ManGvdZFar"                       , m_manGvdZFar                       , IntAry1d (1,0)                   , "ManGvdZFar"                       )
    1494     ("PrecGvdFocalLength"               , m_precGvdFocalLength               , 0                                , "PrecGvdFocalLength"               )
    1495     ("PrecGvdPrincipalPoint"            , m_precGvdPrincipalPoint            , 0                                , "PrecGvdPrincipalPoint"            )
    1496     ("PrecGvdRotationParam"             , m_precGvdRotationParam             , 0                                , "PrecGvdRotationParam"             )
    1497     ("PrecGvdTranslationParam"          , m_precGvdTranslationParam          , 0                                , "PrecGvdTranslationParam"          )
    1498     ("SignGvdFocalLengthX"              , m_signGvdFocalLengthX              , BoolAry1d(1,0)                   , "SignGvdFocalLengthX"              )
    1499     ("ExpGvdFocalLengthX"               , m_expGvdFocalLengthX               , IntAry1d (1,0)                   , "ExpGvdFocalLengthX"               )
    1500     ("ManGvdFocalLengthX"               , m_manGvdFocalLengthX               , IntAry1d (1,0)                   , "ManGvdFocalLengthX"               )
    1501     ("SignGvdFocalLengthY"              , m_signGvdFocalLengthY              , BoolAry1d(1,0)                   , "SignGvdFocalLengthY"              )
    1502     ("ExpGvdFocalLengthY"               , m_expGvdFocalLengthY               , IntAry1d (1,0)                   , "ExpGvdFocalLengthY"               )
    1503     ("ManGvdFocalLengthY"               , m_manGvdFocalLengthY               , IntAry1d (1,0)                   , "ManGvdFocalLengthY"               )
    1504     ("SignGvdPrincipalPointX"           , m_signGvdPrincipalPointX           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointX"           )
    1505     ("ExpGvdPrincipalPointX"            , m_expGvdPrincipalPointX            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointX"            )
    1506     ("ManGvdPrincipalPointX"            , m_manGvdPrincipalPointX            , IntAry1d (1,0)                   , "ManGvdPrincipalPointX"            )
    1507     ("SignGvdPrincipalPointY"           , m_signGvdPrincipalPointY           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointY"           )
    1508     ("ExpGvdPrincipalPointY"            , m_expGvdPrincipalPointY            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointY"            )
    1509     ("ManGvdPrincipalPointY"            , m_manGvdPrincipalPointY            , IntAry1d (1,0)                   , "ManGvdPrincipalPointY"            )
    1510     ("SignGvdR"                         , m_signGvdR                         , BoolAry1d(1,0)   ,ADDNUM ,ADDNUM , "SignGvdR"                         )
    1511     ("ExpGvdR"                          , m_expGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ExpGvdR"                          )
    1512     ("ManGvdR"                          , m_manGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ManGvdR"                          )
    1513     ("SignGvdTX"                        , m_signGvdTX                        , BoolAry1d(1,0)                   , "SignGvdTX"                        )
    1514     ("ExpGvdTX"                         , m_expGvdTX                         , IntAry1d (1,0)                   , "ExpGvdTX"                         )
    1515     ("ManGvdTX"                         , m_manGvdTX                         , IntAry1d (1,0)                   , "ManGvdTX"                         )
    1516 #endif
    1517     ("MinOffsetXInt"                    , m_minOffsetXInt                    , 0                                , "MinOffsetXInt"                    )
    1518     ("MinOffsetXFrac"                   , m_minOffsetXFrac                   , 0                                , "MinOffsetXFrac"                   )
    1519     ("MaxOffsetXInt"                    , m_maxOffsetXInt                    , 0                                , "MaxOffsetXInt"                    )
    1520     ("MaxOffsetXFrac"                   , m_maxOffsetXFrac                   , 0                                , "MaxOffsetXFrac"                   )
    1521     ("OffsetYPresentFlag"               , m_offsetYPresentFlag               , false                            , "OffsetYPresentFlag"               )
    1522     ("MinOffsetYInt"                    , m_minOffsetYInt                    , 0                                , "MinOffsetYInt"                    )
    1523     ("MinOffsetYFrac"                   , m_minOffsetYFrac                   , 0                                , "MinOffsetYFrac"                   )
    1524     ("MaxOffsetYInt"                    , m_maxOffsetYInt                    , 0                                , "MaxOffsetYInt"                    )
    1525     ("MaxOffsetYFrac"                   , m_maxOffsetYFrac                   , 0                                , "MaxOffsetYFrac"                   )
    1526     ("WarpMapSizePresentFlag"           , m_warpMapSizePresentFlag           , false                            , "WarpMapSizePresentFlag"           )
    1527     ("WarpMapWidthMinus2"               , m_warpMapWidthMinus2               , 0                                , "WarpMapWidthMinus2"               )
    1528     ("WarpMapHeightMinus2"              , m_warpMapHeightMinus2              , 0                                , "WarpMapHeightMinus2"              )
     1478    ("AlternativeDepthInfoCancelFlag" , m_alternativeDepthInfoCancelFlag  , false               , "AlternativeDepthInfoCancelFlag"  )
     1479    ("DepthType"                      , m_depthType                       , 1                   , "DepthType"                       )
     1480    ("NumConstituentViewsGvdMinus1"   , m_numConstituentViewsGvdMinus1    , 1                   , "NumConstituentViewsGvdMinus1"    )
     1481    ("DepthPresentGvdFlag"            , m_depthPresentGvdFlag             , false               , "DepthPresentGvdFlag"             )
     1482    ("ZGvdFlag"                       , m_zGvdFlag                        , false               , "ZGvdFlag"                        )
     1483    ("IntrinsicParamGvdFlag"          , m_intrinsicParamGvdFlag           , false               , "IntrinsicParamGvdFlag"           )
     1484    ("RotationGvdFlag"                , m_rotationGvdFlag                 , false               , "RotationGvdFlag"                 )
     1485    ("TranslationGvdFlag"             , m_translationGvdFlag              , false               , "TranslationGvdFlag"              )
     1486    ("SignGvdZNearFlag_%d"            , m_signGvdZNearFlag                , BoolAry1d(3,0), 3   , "SignGvdZNearFlag"                )
     1487    ("ExpGvdZNear_%d"                 , m_expGvdZNear                     , IntAry1d (3,0), 3   , "ExpGvdZNear"                     )
     1488    ("ManLenGvdZNearMinus1_%d"        , m_manLenGvdZNearMinus1            , IntAry1d (3,0), 3   , "ManLenGvdZNearMinus1"            )
     1489    ("ManGvdZNear_%d"                 , m_manGvdZNear                     , IntAry1d (3,0), 3   , "ManGvdZNear"                     )
     1490    ("SignGvdZFarFlag_%d"             , m_signGvdZFarFlag                 , BoolAry1d(3,0), 3   , "SignGvdZFarFlag"                 )
     1491    ("ExpGvdZFar_%d"                  , m_expGvdZFar                      , IntAry1d (3,0), 3   , "ExpGvdZFar"                      )
     1492    ("ManLenGvdZFarMinus1_%d"         , m_manLenGvdZFarMinus1             , IntAry1d (3,0), 3   , "ManLenGvdZFarMinus1"             )
     1493    ("ManGvdZFar_%d"                  , m_manGvdZFar                      , IntAry1d (3,0), 3   , "ManGvdZFar"                      )
     1494    ("PrecGvdFocalLength"             , m_precGvdFocalLength              , 18                  , "PrecGvdFocalLength"              )
     1495    ("PrecGvdPrincipalPoint"          , m_precGvdPrincipalPoint           , 18                  , "PrecGvdPrincipalPoint"           )
     1496    ("PrecGvdRotationParam"           , m_precGvdRotationParam            , 18                  , "PrecGvdRotationParam"            )
     1497    ("PrecGvdTranslationParam"        , m_precGvdTranslationParam         , 18                  , "PrecGvdTranslationParam"         )
     1498    ("SignGvdFocalLengthX_%d"         , m_signGvdFocalLengthX             , BoolAry1d(3,0), 3   ,"SignGvdFocalLengthX"              )
     1499    ("ExpGvdFocalLengthX_%d"          , m_expGvdFocalLengthX              , IntAry1d (3,0), 3   ,"ExpGvdFocalLengthX"               )
     1500    ("ManGvdFocalLengthX_%d"          , m_manGvdFocalLengthX              , IntAry1d (3,0), 3   ,"ManGvdFocalLengthX"               )
     1501    ("SignGvdFocalLengthY_%d"         , m_signGvdFocalLengthY             , BoolAry1d(3,0), 3   ,"SignGvdFocalLengthY"              )
     1502    ("ExpGvdFocalLengthY_%d"          , m_expGvdFocalLengthY              , IntAry1d (3,0), 3   ,"ExpGvdFocalLengthY"               )
     1503    ("ManGvdFocalLengthY_%d"          , m_manGvdFocalLengthY              , IntAry1d (3,0), 3   ,"ManGvdFocalLengthY"               )
     1504    ("SignGvdPrincipalPointX_%d"      , m_signGvdPrincipalPointX          , BoolAry1d(3,0), 3   ,"SignGvdPrincipalPointX"           )
     1505    ("ExpGvdPrincipalPointX_%d"       , m_expGvdPrincipalPointX           , IntAry1d (3,0), 3   ,"ExpGvdPrincipalPointX"            )
     1506    ("ManGvdPrincipalPointX_%d"       , m_manGvdPrincipalPointX           , IntAry1d (3,0), 3   ,"ManGvdPrincipalPointX"            )
     1507    ("SignGvdPrincipalPointY_%d"      , m_signGvdPrincipalPointY          , BoolAry1d(3,0), 3   ,"SignGvdPrincipalPointY"           )
     1508    ("ExpGvdPrincipalPointY_%d"       , m_expGvdPrincipalPointY           , IntAry1d (3,0), 3   ,"ExpGvdPrincipalPointY"            )
     1509    ("ManGvdPrincipalPointY_%d"       , m_manGvdPrincipalPointY           , IntAry1d (3,0), 3   ,"ManGvdPrincipalPointY"            )
     1510    ("SignGvdR_%d_%d"                 , m_signGvdR                        , BoolAry1d(3,0), 3, 3,"SignGvdR"                         )
     1511    ("ExpGvdR_%d_%d"                  , m_expGvdR                         , IntAry1d (3,0), 3, 3,"ExpGvdR"                          )
     1512    ("ManGvdR_%d_%d"                  , m_manGvdR                         , IntAry1d (3,0), 3, 3,"ManGvdR"                          )
     1513    ("SignGvdTX_%d"                   , m_signGvdTX                       , BoolAry1d(3,0), 3   ,"SignGvdTX"                        )
     1514    ("ExpGvdTX_%d"                    , m_expGvdTX                        , IntAry1d (3,0), 3   ,"ExpGvdTX"                         )
     1515    ("ManGvdTX_%d"                    , m_manGvdTX                        , IntAry1d (3,0), 3   ,"ManGvdTX"                         )
     1516    ("MinOffsetXInt"                  , m_minOffsetXInt                   , 0                   , "MinOffsetXInt"                   )
     1517    ("MinOffsetXFrac"                 , m_minOffsetXFrac                  , 0                   , "MinOffsetXFrac"                  )
     1518    ("MaxOffsetXInt"                  , m_maxOffsetXInt                   , 0                   , "MaxOffsetXInt"                   )
     1519    ("MaxOffsetXFrac"                 , m_maxOffsetXFrac                  , 0                   , "MaxOffsetXFrac"                  )
     1520    ("OffsetYPresentFlag"             , m_offsetYPresentFlag              , false               , "OffsetYPresentFlag"              )
     1521    ("MinOffsetYInt"                  , m_minOffsetYInt                   , 0                   , "MinOffsetYInt"                   )
     1522    ("MinOffsetYFrac"                 , m_minOffsetYFrac                  , 0                   , "MinOffsetYFrac"                  )
     1523    ("MaxOffsetYInt"                  , m_maxOffsetYInt                   , 0                   , "MaxOffsetYInt"                   )
     1524    ("MaxOffsetYFrac"                 , m_maxOffsetYFrac                  , 0                   , "MaxOffsetYFrac"                  )
     1525    ("WarpMapSizePresentFlag"         , m_warpMapSizePresentFlag          , false               , "WarpMapSizePresentFlag"          )
     1526    ("WarpMapWidthMinus2"             , m_warpMapWidthMinus2              , 0                   , "WarpMapWidthMinus2"              )
     1527    ("WarpMapHeightMinus2"            , m_warpMapHeightMinus2             , 0                   , "WarpMapHeightMinus2"             )
    15291528    ;
    15301529
     
    15361535};
    15371536Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice )
    1538 { 
     1537{
    15391538  // Check config values
    1540   Bool wrongConfig = false; 
    1541 
    1542  
     1539  Bool wrongConfig = false;
     1540
     1541
    15431542  xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , 0 , 1, "alternative_depth_info_cancel_flag");
    15441543  xCheckCfgRange( wrongConfig, m_depthType                      , 0 , 1, "depth_type"                       );
    15451544
    1546   // TBD: Modify constraints according to the SEI semantics.   
    1547 #if NH_MV_SEI_TBD
    1548   xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , MINVAL , MAXVAL, "num_constituent_views_gvd_minus1 ");
    1549   xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , MINVAL , MAXVAL, "depth_present_gvd_flag"           );
    1550   xCheckCfgRange( wrongConfig, m_zGvdFlag                       , MINVAL , MAXVAL, "z_gvd_flag"                       );
    1551   xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , MINVAL , MAXVAL, "intrinsic_param_gvd_flag"         );
    1552   xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , MINVAL , MAXVAL, "rotation_gvd_flag"                );
    1553   xCheckCfgRange( wrongConfig, m_translationGvdFlag             , MINVAL , MAXVAL, "translation_gvd_flag"             );
    1554   xCheckCfgRange( wrongConfig, m_signGvdZNearFlag[i]            , MINVAL , MAXVAL, "sign_gvd_z_near_flag"             );
    1555   xCheckCfgRange( wrongConfig, m_expGvdZNear[i]                 , MINVAL , MAXVAL, "exp_gvd_z_near"                   );
    1556   xCheckCfgRange( wrongConfig, m_manLenGvdZNearMinus1[i]        , MINVAL , MAXVAL, "man_len_gvd_z_near_minus1"        );
    1557   xCheckCfgRange( wrongConfig, m_manGvdZNear[i]                 , MINVAL , MAXVAL, "man_gvd_z_near"                   );
    1558   xCheckCfgRange( wrongConfig, m_signGvdZFarFlag[i]             , MINVAL , MAXVAL, "sign_gvd_z_far_flag"              );
    1559   xCheckCfgRange( wrongConfig, m_expGvdZFar[i]                  , MINVAL , MAXVAL, "exp_gvd_z_far"                    );
    1560   xCheckCfgRange( wrongConfig, m_manLenGvdZFarMinus1[i]         , MINVAL , MAXVAL, "man_len_gvd_z_far_minus1"         );
    1561   xCheckCfgRange( wrongConfig, m_manGvdZFar[i]                  , MINVAL , MAXVAL, "man_gvd_z_far"                    );
    1562   xCheckCfgRange( wrongConfig, m_precGvdFocalLength             , MINVAL , MAXVAL, "prec_gvd_focal_length"            );
    1563   xCheckCfgRange( wrongConfig, m_precGvdPrincipalPoint          , MINVAL , MAXVAL, "prec_gvd_principal_point"         );
    1564   xCheckCfgRange( wrongConfig, m_precGvdRotationParam           , MINVAL , MAXVAL, "prec_gvd_rotation_param"          );
    1565   xCheckCfgRange( wrongConfig, m_precGvdTranslationParam        , MINVAL , MAXVAL, "prec_gvd_translation_param"       );
    1566   xCheckCfgRange( wrongConfig, m_signGvdFocalLengthX[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_x"          );
    1567   xCheckCfgRange( wrongConfig, m_expGvdFocalLengthX[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_x"           );
    1568   xCheckCfgRange( wrongConfig, m_manGvdFocalLengthX[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_x"           );
    1569   xCheckCfgRange( wrongConfig, m_signGvdFocalLengthY[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_y"          );
    1570   xCheckCfgRange( wrongConfig, m_expGvdFocalLengthY[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_y"           );
    1571   xCheckCfgRange( wrongConfig, m_manGvdFocalLengthY[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_y"           );
    1572   xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointX[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_x"       );
    1573   xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_x"        );
    1574   xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_x"        );
    1575   xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointY[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_y"       );
    1576   xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_y"        );
    1577   xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_y"        );
    1578   xCheckCfgRange( wrongConfig, m_signGvdR[i][j][k]              , MINVAL , MAXVAL, "sign_gvd_r"                       );
    1579   xCheckCfgRange( wrongConfig, m_expGvdR[i][j][k]               , MINVAL , MAXVAL, "exp_gvd_r"                        );
    1580   xCheckCfgRange( wrongConfig, m_manGvdR[i][j][k]               , MINVAL , MAXVAL, "man_gvd_r"                        );
    1581   xCheckCfgRange( wrongConfig, m_signGvdTX[i]                   , MINVAL , MAXVAL, "sign_gvd_t_x"                     );
    1582   xCheckCfgRange( wrongConfig, m_expGvdTX[i]                    , MINVAL , MAXVAL, "exp_gvd_t_x"                      );
    1583   xCheckCfgRange( wrongConfig, m_manGvdTX[i]                    , MINVAL , MAXVAL, "man_gvd_t_x"                      );
    1584 #endif 
    1585   xCheckCfgRange( wrongConfig, m_minOffsetXFrac                 , 0 , 255, "min_offset_x_frac"                ); 
    1586   xCheckCfgRange( wrongConfig, m_maxOffsetXFrac                 , 0 , 255, "max_offset_x_frac"                );
    1587   xCheckCfgRange( wrongConfig, m_offsetYPresentFlag             , 0 , 1, "offset_y_present_flag"            ); 
    1588   xCheckCfgRange( wrongConfig, m_minOffsetYFrac                 , 0 , 255, "min_offset_y_frac"                ); 
    1589   xCheckCfgRange( wrongConfig, m_maxOffsetYFrac                 , 0 , 255, "max_offset_y_frac"                );
    1590   xCheckCfgRange( wrongConfig, m_warpMapSizePresentFlag         , 0 , 1, "warp_map_size_present_flag"       );
    1591   xCheckCfgRange( wrongConfig, m_warpMapWidthMinus2             , 0 , (slice->getSPS()->getPicWidthInLumaSamples()-2), "warp_map_width_minus2"            );
    1592   xCheckCfgRange( wrongConfig, m_warpMapHeightMinus2            , 0 , ((slice->getSPS()->getPicHeightInLumaSamples()>>(Int)m_offsetYPresentFlag)-2), "warp_map_height_minus2"           );
    1593 
    1594   return wrongConfig;
    1595 
    1596 };
     1545  xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , 1 , 1, "num_constituent_views_gvd_minus1 "); // 1: 3 views only, cuurent.
     1546  xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , 0 , 1, "depth_present_gvd_flag"           );
     1547  xCheckCfgRange( wrongConfig, m_zGvdFlag                       , 0 , 1, "z_gvd_flag"                       );
     1548  xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , 0 , 1, "intrinsic_param_gvd_flag"         );
     1549  xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , 0 , 1, "rotation_gvd_flag"                );
     1550  xCheckCfgRange( wrongConfig, m_translationGvdFlag             , 0 , 1, "translation_gvd_flag"             );
     1551
     1552  return wrongConfig;
     1553
     1554};
     1555
    15971556#endif
    15981557
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/SEI.h

    r1347 r1349  
    4242#include "CommonDef.h"
    4343#include "libmd5/MD5.h"
    44  
     44
    4545
    4646#if NH_MV_SEI
     
    5454class TComSPS;
    5555#if NH_MV_SEI
    56 class TComSlice; 
    57 class SEIScalableNesting; 
     56class TComSlice;
     57class SEIScalableNesting;
    5858#endif
    5959
     
    128128
    129129#if NH_MV_SEI
    130   static SEI*        getNewSEIMessage         ( SEI::PayloadType payloadType ); 
    131   Bool               insertSei                ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const; 
     130  static SEI*        getNewSEIMessage         ( SEI::PayloadType payloadType );
     131  Bool               insertSei                ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const;
    132132
    133133
     
    139139  Void               xCheckCfgRange           ( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName );
    140140  Void               xCheckCfg                ( Bool& wrongConfig, Bool cond, const Char* errStr );
    141   Void               xAddGeneralOpts          ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, 
     141  Void               xAddGeneralOpts          ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes,
    142142                                                Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder );
    143     // Filters where to insert SEI in the bitstream. 
    144   // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used. 
    145   IntAry1d                       m_applicableLayerIds; 
    146   IntAry1d                       m_applicablePocs; 
    147   IntAry1d                       m_applicableTids; 
    148   IntAry1d                       m_applicableVclNaluTypes;     
     143    // Filters where to insert SEI in the bitstream.
     144  // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used.
     145  IntAry1d                       m_applicableLayerIds;
     146  IntAry1d                       m_applicablePocs;
     147  IntAry1d                       m_applicableTids;
     148  IntAry1d                       m_applicableVclNaluTypes;
    149149
    150150  Int                            m_payloadType;              // Payload type
    151   Int                            m_seiNaluId;                // Identifies to which NAL unit  the SEI is added. 
     151  Int                            m_seiNaluId;                // Identifies to which NAL unit  the SEI is added.
    152152  Int                            m_positionInSeiNalu;        // Identifies the order within the NAL unit
    153   Bool                           m_modifyByEncoder;          // Don't use the SEI cfg-file, but let let the encoder setup the NALU.   
     153  Bool                           m_modifyByEncoder;          // Don't use the SEI cfg-file, but let let the encoder setup the NALU.
    154154
    155155  SEIScalableNesting*            m_scalNestSeiContThisSei;   // Pointer to scalable nesting SEI containing the SEI. When NULL, the SEI is not nested.
     
    214214  Bool m_noParameterSetUpdateFlag;
    215215  Int numSpsIdsMinus1;
    216   std::vector<Int> activeSeqParameterSetId; 
     216  std::vector<Int> activeSeqParameterSetId;
    217217};
    218218
     
    527527    SEIMasteringDisplayColourVolume() {}
    528528    virtual ~SEIMasteringDisplayColourVolume(){}
    529    
     529
    530530    TComSEIMasteringDisplay values;
    531531};
     
    611611
    612612    public:
    613       Int     m_mcts_id; 
     613      Int     m_mcts_id;
    614614      Bool    m_display_tile_set_flag;
    615615      Int     m_num_tile_rects_in_set; //_minus1;
     
    667667  SEILayersNotPresent ( ) { };
    668668  ~SEILayersNotPresent( ) { };
    669   SEI* getCopy( ) const { return new SEILayersNotPresent(*this); }; 
     669  SEI* getCopy( ) const { return new SEILayersNotPresent(*this); };
    670670
    671671  Void setupFromCfgFile( const Char*      cfgFile );
     
    689689  SEIInterLayerConstrainedTileSets ( ) { };
    690690  ~SEIInterLayerConstrainedTileSets( ) { };
    691   SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); }; 
     691  SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); };
    692692
    693693  Void setupFromCfgFile( const Char*      cfgFile );
     
    731731  SEIBspNesting ( ) { };
    732732  ~SEIBspNesting( ) { };
    733   SEI* getCopy( ) const { return new SEIBspNesting(*this); }; 
     733  SEI* getCopy( ) const { return new SEIBspNesting(*this); };
    734734
    735735  Void setupFromCfgFile( const Char*      cfgFile );
     
    750750  SEIBspInitialArrivalTime ( ) { };
    751751  ~SEIBspInitialArrivalTime( ) { };
    752   SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); }; 
     752  SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); };
    753753
    754754  Void setupFromCfgFile( const Char*      cfgFile );
     
    767767  SEISubBitstreamProperty ( ) { };
    768768  ~SEISubBitstreamProperty( ) { };
    769   SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); }; 
    770 
    771   Void setupFromCfgFile( const Char*      cfgFile );
    772   Bool checkCfg        ( const TComSlice* slice   );
    773   Void resizeArrays    ( ); 
     769  SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); };
     770
     771  Void setupFromCfgFile( const Char*      cfgFile );
     772  Bool checkCfg        ( const TComSlice* slice   );
     773  Void resizeArrays    ( );
    774774
    775775  Int       m_sbPropertyActiveVpsId;
     
    788788  SEIAlphaChannelInfo ( ) { };
    789789  ~SEIAlphaChannelInfo( ) { };
    790   SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); }; 
     790  SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); };
    791791
    792792  Void setupFromCfgFile( const Char*      cfgFile );
     
    807807public:
    808808  PayloadType payloadType( ) const { return OVERLAY_INFO; }
    809   SEIOverlayInfo ( ); 
     809  SEIOverlayInfo ( );
    810810  ~SEIOverlayInfo( ) { };
    811   SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; 
    812 
    813   Void setupFromCfgFile( const Char*      cfgFile ); 
    814   Bool checkCfg        ( const TComSlice* slice   ); 
    815 
    816   const Int m_numOverlaysMax; 
    817   const Int m_numOverlayElementsMax; 
     811  SEI* getCopy( ) const { return new SEIOverlayInfo(*this); };
     812
     813  Void setupFromCfgFile( const Char*      cfgFile );
     814  Bool checkCfg        ( const TComSlice* slice   );
     815
     816  const Int m_numOverlaysMax;
     817  const Int m_numOverlayElementsMax;
    818818  const Int m_numStringBytesMax;  //incl. null termination byte
    819  
     819
    820820  Bool      m_overlayInfoCancelFlag;
    821821  Int       m_overlayContentAuxIdMinus128;
     
    833833  IntAry1d  m_numOverlayElementsMinus1;
    834834  IntAry2d  m_overlayElementLabelMin;
    835   IntAry2d  m_overlayElementLabelMax; 
     835  IntAry2d  m_overlayElementLabelMax;
    836836  StringAry1d  m_overlayLanguage;
    837837  StringAry1d  m_overlayName;
     
    846846  SEITemporalMvPredictionConstraints ( ) { };
    847847  ~SEITemporalMvPredictionConstraints( ) { };
    848   SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); }; 
     848  SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); };
    849849
    850850  Void setupFromCfgFile( const Char*      cfgFile );
     
    862862  SEIFrameFieldInfo ( ) { };
    863863  ~SEIFrameFieldInfo( ) { };
    864   SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); }; 
     864  SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); };
    865865
    866866  Void setupFromCfgFile( const Char*      cfgFile );
     
    880880  SEIThreeDimensionalReferenceDisplaysInfo ( ) { };
    881881  ~SEIThreeDimensionalReferenceDisplaysInfo( ) { };
    882   SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); }; 
     882  SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); };
    883883
    884884  Void setupFromCfgFile( const Char*      cfgFile );
     
    887887  Int getNumRefDisplaysMinus1( ) const
    888888  {
    889     return m_numRefDisplaysMinus1; 
     889    return m_numRefDisplaysMinus1;
    890890  }
    891891
     
    907907  {
    908908    Int numReferenceDiaplays = getNumRefDisplaysMinus1() + 1;
    909  
     909
    910910    m_leftViewId    .resize( numReferenceDiaplays );
    911911    m_rightViewId   .resize( numReferenceDiaplays );
     
    920920  UInt getMantissaReferenceDisplayWidthLen  ( Int i ) const ;
    921921  UInt getMantissaReferenceViewingDistanceLen  ( Int i ) const ;
    922 private: 
    923   UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 
     922private:
     923  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const;
    924924};
    925925
     
    929929    public:
    930930        PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; }
    931         SEIDepthRepresentationInfo ( ) 
     931        SEIDepthRepresentationInfo ( )
    932932        {
    933933            m_currLayerID=-1;
    934934        };
    935935        ~SEIDepthRepresentationInfo( ) { };
    936         SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); }; 
     936        SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); };
    937937
    938938        Void setupFromCfgFile( const Char*      cfgFile );
     
    977977            for(i=0;i<m_depth_nonlinear_representation_model.size();i++)
    978978                m_depth_nonlinear_representation_model[i].clear();
    979             m_depth_nonlinear_representation_model.clear();           
     979            m_depth_nonlinear_representation_model.clear();
    980980
    981981        }
     
    10011001  SEIMultiviewSceneInfo ( ) { };
    10021002  ~SEIMultiviewSceneInfo( ) { };
    1003   SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); }; 
     1003  SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); };
    10041004
    10051005  Void setupFromCfgFile( const Char*      cfgFile );
     
    10171017  SEIMultiviewAcquisitionInfo ( ) { };
    10181018  ~SEIMultiviewAcquisitionInfo( ) { };
    1019   SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); }; 
     1019  SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); };
    10201020
    10211021  Void setupFromCfgFile( const Char*      cfgFile );
     
    10241024  Int getNumViewsMinus1( ) const
    10251025  {
    1026     Int numViewsMinus1; 
     1026    Int numViewsMinus1;
    10271027    if( m_scalNestSeiContThisSei != NULL )
    10281028    {
    10291029      numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1;
    1030     } 
     1030    }
    10311031    else
    10321032    {
    1033       numViewsMinus1 = 0; 
     1033      numViewsMinus1 = 0;
    10341034    }
    1035     return numViewsMinus1; 
     1035    return numViewsMinus1;
    10361036  }
    1037  
     1037
    10381038  Void resizeArrays( )
    10391039  {
    1040     Int numViews = getNumViewsMinus1() + 1;     
     1040    Int numViews = getNumViewsMinus1() + 1;
    10411041    m_signFocalLengthX       .resize( numViews );
    10421042    m_exponentFocalLengthX   .resize( numViews );
     
    10551055    m_mantissaSkewFactor     .resize( numViews );
    10561056
    1057     m_signR                  .resize( numViews );   
     1057    m_signR                  .resize( numViews );
    10581058    m_exponentR              .resize( numViews );
    1059     m_mantissaR              .resize( numViews ); 
     1059    m_mantissaR              .resize( numViews );
    10601060    m_signT                  .resize( numViews );
    10611061    m_exponentT              .resize( numViews );
     
    10641064    for( Int i = 0; i  < numViews ; i++ )
    10651065    {
    1066       m_signR    [i].resize( 3 );   
     1066      m_signR    [i].resize( 3 );
    10671067      m_exponentR[i].resize( 3 );
    1068       m_mantissaR[i].resize( 3 ); 
     1068      m_mantissaR[i].resize( 3 );
    10691069      m_signT    [i].resize( 3 );
    10701070      m_exponentT[i].resize( 3 );
     
    10731073      for (Int j = 0; j < 3; j++)
    10741074      {
    1075         m_signR    [i][j].resize( 3 );   
     1075        m_signR    [i][j].resize( 3 );
    10761076        m_exponentR[i][j].resize( 3 );
    1077         m_mantissaR[i][j].resize( 3 ); 
     1077        m_mantissaR[i][j].resize( 3 );
    10781078      }
    10791079    }
    10801080  }
    1081  
     1081
    10821082  UInt getMantissaFocalLengthXLen   ( Int i ) const ;
    10831083  UInt getMantissaFocalLengthYLen   ( Int i ) const ;
     
    11171117  IntAry2d  m_exponentT;
    11181118  IntAry2d  m_mantissaT;
    1119 private: 
    1120   UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 
     1119private:
     1120  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const;
    11211121};
    11221122
     
    11291129  SEIMultiviewViewPosition ( ) { };
    11301130  ~SEIMultiviewViewPosition( ) { };
    1131   SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); }; 
     1131  SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); };
    11321132
    11331133  Void setupFromCfgFile( const Char*      cfgFile );
    11341134  Void setupFromSlice  ( const TComSlice* slice   );
    11351135  Bool checkCfg        ( const TComSlice* slice   );
    1136  
     1136
    11371137  Int       m_numViewsMinus1;
    11381138  IntAry1d  m_viewPosition;
     
    11461146  SEIAlternativeDepthInfo ( ) { };
    11471147  ~SEIAlternativeDepthInfo( ) { };
    1148   SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); };
    1149 
    1150   Void setupFromCfgFile( const Char*      cfgFile ); 
    1151   Bool checkCfg        ( const TComSlice* slice   );
     1148  SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); };
     1149
     1150  Void setupFromCfgFile( const Char*      cfgFile );
     1151  Bool checkCfg        ( const TComSlice* slice   );
     1152
     1153  Void resizeArrays( )
     1154  {
     1155    const Int numViews = 3; // getNumConstituentViewsGvdMinus1() + 1;
     1156
     1157    m_signGvdZNearFlag.resize(3);
     1158    m_expGvdZNear.resize(3);
     1159    m_manLenGvdZNearMinus1.resize(3);
     1160    m_manGvdZNear.resize(3);
     1161    m_signGvdZFarFlag.resize(3);
     1162    m_expGvdZFar.resize(3);
     1163    m_manLenGvdZFarMinus1.resize(3);
     1164    m_manGvdZFar.resize(3);
     1165
     1166    m_signGvdFocalLengthX.resize(3);
     1167    m_expGvdFocalLengthX.resize(3);
     1168    m_manGvdFocalLengthX.resize(3);
     1169    m_signGvdFocalLengthY.resize(3);
     1170    m_expGvdFocalLengthY.resize(3);
     1171    m_manGvdFocalLengthY.resize(3);
     1172    m_signGvdPrincipalPointX.resize(3);
     1173    m_expGvdPrincipalPointX.resize(3);
     1174    m_manGvdPrincipalPointX.resize(3);
     1175    m_signGvdPrincipalPointY.resize(3);
     1176    m_expGvdPrincipalPointY.resize(3);
     1177    m_manGvdPrincipalPointY.resize(3);
     1178
     1179    m_signGvdR.resize(3);
     1180    m_expGvdR.resize(3);
     1181    m_manGvdR.resize(3);
     1182
     1183    m_signGvdTX.resize(3);
     1184    m_expGvdTX.resize(3);
     1185    m_manGvdTX.resize(3);
     1186
     1187    for( Int i = 0; i < numViews; i++ )
     1188    {
     1189      m_signGvdZNearFlag[i].resize(3);
     1190      m_expGvdZNear[i].resize(3);
     1191      m_manLenGvdZNearMinus1[i].resize(3);
     1192      m_manGvdZNear[i].resize(3);
     1193      m_signGvdZFarFlag[i].resize(3);
     1194      m_expGvdZFar[i].resize(3);
     1195      m_manLenGvdZFarMinus1[i].resize(3);
     1196      m_manGvdZFar[i].resize(3);
     1197
     1198      m_signGvdFocalLengthX[i].resize(3);
     1199      m_expGvdFocalLengthX[i].resize(3);
     1200      m_manGvdFocalLengthX[i].resize(3);
     1201      m_signGvdFocalLengthY[i].resize(3);
     1202      m_expGvdFocalLengthY[i].resize(3);
     1203      m_manGvdFocalLengthY[i].resize(3);
     1204      m_signGvdPrincipalPointX[i].resize(3);
     1205      m_expGvdPrincipalPointX[i].resize(3);
     1206      m_manGvdPrincipalPointX[i].resize(3);
     1207      m_signGvdPrincipalPointY[i].resize(3);
     1208      m_expGvdPrincipalPointY[i].resize(3);
     1209      m_manGvdPrincipalPointY[i].resize(3);
     1210
     1211      m_signGvdR[i].resize(3);
     1212      m_expGvdR[i].resize(3);
     1213      m_manGvdR[i].resize(3);
     1214      for( Int j = 0; j < 3; j++ )
     1215      {
     1216        m_signGvdR[i][j].resize(3);
     1217        m_expGvdR[i][j].resize(3);
     1218        m_manGvdR[i][j].resize(3);
     1219      }
     1220
     1221      m_signGvdTX[i].resize(3);
     1222      m_expGvdTX[i].resize(3);
     1223      m_manGvdTX[i].resize(3);
     1224    }
     1225
     1226  }
    11521227
    11531228  Bool      m_alternativeDepthInfoCancelFlag;
    11541229  Int       m_depthType;
    1155 #if NH_MV_SEI_TBD
    11561230  Int       m_numConstituentViewsGvdMinus1;
    11571231  Bool      m_depthPresentGvdFlag;
     
    11601234  Bool      m_rotationGvdFlag;
    11611235  Bool      m_translationGvdFlag;
    1162   BoolAry1d m_signGvdZNearFlag;
    1163   IntAry1d  m_expGvdZNear;
    1164   IntAry1d  m_manLenGvdZNearMinus1;
    1165   IntAry1d  m_manGvdZNear;
    1166   BoolAry1d m_signGvdZFarFlag;
    1167   IntAry1d  m_expGvdZFar;
    1168   IntAry1d  m_manLenGvdZFarMinus1;
    1169   IntAry1d  m_manGvdZFar;
     1236  BoolAry2d m_signGvdZNearFlag;
     1237  IntAry2d  m_expGvdZNear;
     1238  IntAry2d  m_manLenGvdZNearMinus1;
     1239  IntAry2d  m_manGvdZNear;
     1240  BoolAry2d m_signGvdZFarFlag;
     1241  IntAry2d  m_expGvdZFar;
     1242  IntAry2d  m_manLenGvdZFarMinus1;
     1243  IntAry2d  m_manGvdZFar;
    11701244  Int       m_precGvdFocalLength;
    11711245  Int       m_precGvdPrincipalPoint;
    11721246  Int       m_precGvdRotationParam;
    11731247  Int       m_precGvdTranslationParam;
    1174   BoolAry1d m_signGvdFocalLengthX;
    1175   IntAry1d  m_expGvdFocalLengthX;
    1176   IntAry1d  m_manGvdFocalLengthX;
    1177   BoolAry1d m_signGvdFocalLengthY;
    1178   IntAry1d  m_expGvdFocalLengthY;
    1179   IntAry1d  m_manGvdFocalLengthY;
    1180   BoolAry1d m_signGvdPrincipalPointX;
    1181   IntAry1d  m_expGvdPrincipalPointX;
    1182   IntAry1d  m_manGvdPrincipalPointX;
    1183   BoolAry1d m_signGvdPrincipalPointY;
    1184   IntAry1d  m_expGvdPrincipalPointY;
    1185   IntAry1d  m_manGvdPrincipalPointY;
     1248  BoolAry2d m_signGvdFocalLengthX;
     1249  IntAry2d  m_expGvdFocalLengthX;
     1250  IntAry2d  m_manGvdFocalLengthX;
     1251  BoolAry2d m_signGvdFocalLengthY;
     1252  IntAry2d  m_expGvdFocalLengthY;
     1253  IntAry2d  m_manGvdFocalLengthY;
     1254  BoolAry2d m_signGvdPrincipalPointX;
     1255  IntAry2d  m_expGvdPrincipalPointX;
     1256  IntAry2d  m_manGvdPrincipalPointX;
     1257  BoolAry2d m_signGvdPrincipalPointY;
     1258  IntAry2d  m_expGvdPrincipalPointY;
     1259  IntAry2d  m_manGvdPrincipalPointY;
    11861260  BoolAry3d m_signGvdR;
    11871261  IntAry3d  m_expGvdR;
    11881262  IntAry3d  m_manGvdR;
    1189   BoolAry1d m_signGvdTX;
    1190   IntAry1d  m_expGvdTX;
    1191   IntAry1d  m_manGvdTX;
    1192 #endif
     1263  BoolAry2d m_signGvdTX;
     1264  IntAry2d  m_expGvdTX;
     1265  IntAry2d  m_manGvdTX;
    11931266  Int       m_minOffsetXInt;
    11941267  Int       m_minOffsetXFrac;
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/TComBitStream.cpp

    r1321 r1349  
    113113{
    114114  assert( uiNumberOfBits <= 32 );
     115#if !NH_3D
    115116  assert( uiNumberOfBits == 32 || (uiBits & (~0 << uiNumberOfBits)) == 0 );
     117#endif
    116118
    117119  /* any modulo 8 remainder of num_total_bits cannot be written this time,
     
    264266  {
    265267      Bool oldJustDoIt = g_bJustDoIt;
    266       g_bJustDoIt = true; 
     268      g_bJustDoIt = true;
    267269      writeToTraceFile( "Bits: ", m_numBitsRead, true );
    268       g_bJustDoIt = oldJustDoIt; 
     270      g_bJustDoIt = oldJustDoIt;
    269271  }
    270272#endif
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibCommon/TypeDef.h

    r1344 r1349  
    4343//! \{
    4444/////////////////////////////////////////////////////////////////////////////////////////
    45 ///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// 
     45///////////////////////////////// EXTENSION SELECTION ///////////////////////////////////
    4646/////////////////////////////////////////////////////////////////////////////////////////
    4747/* HEVC_EXT might be defined by compiler/makefile options.
    48    Linux makefiles support the following settings:   
    49    make             -> HEVC_EXT not defined   
     48   Linux makefiles support the following settings:
     49   make             -> HEVC_EXT not defined
    5050   make HEVC_EXT=0  -> NH_MV=0 H_3D=0   --> plain HM
    51    make HEVC_EXT=1  -> NH_MV=1 H_3D=0   --> MV only 
    52    make HEVC_EXT=2  -> NH_MV=1 H_3D=1   --> full 3D 
     51   make HEVC_EXT=1  -> NH_MV=1 H_3D=0   --> MV only
     52   make HEVC_EXT=2  -> NH_MV=1 H_3D=1   --> full 3D
    5353*/
    5454#ifndef HEVC_EXT
     
    5656#endif
    5757#if ( HEVC_EXT < 0 )||( HEVC_EXT > 2 )
    58 #error HEVC_EXT must be in the range of 0 to 2, inclusive. 
     58#error HEVC_EXT must be in the range of 0 to 2, inclusive.
    5959#endif
    6060#define NH_MV          ( HEVC_EXT != 0)
     
    6666#define NH_MV_SEI_TBD                             0
    6767#define NH_MV_SEI                                 1
    68 #define NH_MV_FIX_TICKET_106                      1 // Identical motion check. 
    69 #define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!! 
    70 #define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 
     68#define NH_MV_FIX_TICKET_106                      1 // Identical motion check.
     69#define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!!
     70#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!!
    7171#define NH_MV_FIX_NUM_POC_TOTAL_CUR               1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!!
    7272#define NH_MV_LAYERS_NOT_PRESENT_SEI              1 // Layers not present SEI message JCTMV-M0043
     
    7979#endif
    8080/////////////////////////////////////////////////////////////////////////////////////////
    81 ///////////////////////////////////   MAJOR DEFINES   /////////////////////////////////// 
     81///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////
    8282/////////////////////////////////////////////////////////////////////////////////////////
    8383#if NH_MV
     
    9696                                             // LGE_ARP_CTX_F0161                JCT3V-F0161
    9797                                             // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    98                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 
     98                                             // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
    9999                                             // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
    100                                              // QC_I0051_ARP_SIMP         
    101                                              // SHARP_ARP_CHROMA_I0104     
     100                                             // QC_I0051_ARP_SIMP
     101                                             // SHARP_ARP_CHROMA_I0104
    102102                                             // MTK_I0072_IVARP_SCALING_FIX
    103103                                             // SEC_ARP_VIEW_REF_CHECK_J0037    Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
    104104                                             // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
    105105#define NH_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
    106                                               // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
     106                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
    107107                                              // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
    108 #define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes: 
     108#define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes:
    109109                                              // HHI_VSO
    110110                                              // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
     
    112112                                              // LGE_WVSO_A0119
    113113                                              // SCU_HS_VSD_BUGFIX_IMPROV_G0163
    114 #define NH_3D_NBDV                         1   // Neighboring block disparity derivation 
    115                                               // QC_JCT3V-A0097 
     114#define NH_3D_NBDV                         1   // Neighboring block disparity derivation
     115                                              // QC_JCT3V-A0097
    116116                                              // LGE_DVMCP_A0126
    117                                               // LGE_DVMCP_MEM_REDUCTION_B0135     
     117                                              // LGE_DVMCP_MEM_REDUCTION_B0135
    118118                                              // QC_SIMPLE_NBDV_B0047
    119119                                              // FIX_LGE_DVMCP_B0133
    120120                                              // QC_NBDV_LDB_FIX_C0055
    121121                                              // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
    122                                               // MTK_SIMPLIFY_DVTC_C0135           
     122                                              // MTK_SIMPLIFY_DVTC_C0135
    123123                                              // QC_CU_NBDV_D0181
    124124                                              // SEC_DEFAULT_DV_D0112
     
    160160                                              // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208
    161161                                              // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208
    162                                               // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 
     162                                              // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120
    163163                                              // SHARP_VSP_BLOCK_IN_AMP_F0102 VSP partitioning for AMP
    164164                                              // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
    165                                               // LGE_SHARP_VSP_INHERIT_F0104 
     165                                              // LGE_SHARP_VSP_INHERIT_F0104
    166166                                              // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
    167167                                              // Restricted bi-prediction for VSP
     
    170170#define NH_3D_MLC                          1
    171171#define NH_3D_IV_MERGE                     1  // Inter-view motion merge candidate
    172                                               // HHI_INTER_VIEW_MOTION_PRED 
     172                                              // HHI_INTER_VIEW_MOTION_PRED
    173173                                              // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
    174174                                              // QC_MRG_CANS_B0048             , JCT3V-B0048, B0086, B0069
    175175                                              // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
    176176                                              // MTK_INTERVIEW_MERGE_A0049     , second part
    177                                               // QC_AMVP_MRG_UNIFY_IVCAN_C0051     
    178                                               // QC_INRIA_MTK_MRG_E0126 
     177                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051
     178                                              // QC_INRIA_MTK_MRG_E0126
    179179                                              // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
    180180                                              // MTK_NBDV_IVREF_FIX_G0067      , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
     
    193193                                              // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
    194194                                              // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
    195 #define NH_3D_TMVP                        1   // QC_TMVP_C0047 
     195#define NH_3D_TMVP                        1   // QC_TMVP_C0047
    196196                                              // Sony_M23639
    197197                                              // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
     
    213213                                              // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
    214214                                              // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  Use only one context for CABAC of dim_not_present_flag
    215                                               // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding 
     215                                              // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding
    216216                                              // MTK_DMM_SIMP_CODE_H0092        Remove CABAC context for DMM1 mode coding
    217217                                              // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
    218218                                              // HS_DMM_SIGNALLING_I0120
    219                                               // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110 
     219                                              // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110
    220220                                              // MTK_DMM_SIM_J0035
    221                                               // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation 
     221                                              // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
    222222#define NH_3D_DLT                         1   // Depth Lookup Table
    223223                                              // HHI_DELTADC_DLT_D0035
    224224                                              // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
    225                                               // SEC_NO_RESI_DLT_H0105   
    226                                               // MTK_DLT_CODING_FIX_H0091 
     225                                              // SEC_NO_RESI_DLT_H0105
     226                                              // MTK_DLT_CODING_FIX_H0091
    227227                                              // H_3D_DELTA_DLT
    228228                                              // RWTH_DLT_CLIP_I0057
    229                                               // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup 
     229                                              // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup
    230230#define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
    231 #define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER 
     231#define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER
    232232                                              // RWTH_SDC_DLT_B0036
    233233                                              // INTEL_SDC64_D0193
     
    255255                                              // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    256256#define NH_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
    257                                               // MTK_DBBP_AMP_REM_H0072   
    258                                               // RWTH_DBBP_NO_SPU_H0057   
    259                                               // SEC_DBBP_FILTERING_H0104 
    260                                               // MTK_DBBP_SIGNALING_H0094   
    261                                               // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 
     257                                              // MTK_DBBP_AMP_REM_H0072
     258                                              // RWTH_DBBP_NO_SPU_H0057
     259                                              // SEC_DBBP_FILTERING_H0104
     260                                              // MTK_DBBP_SIGNALING_H0094
     261                                              // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself.
    262262                                              // SEC_DBBP_EXPLICIT_SIG_I0077 Remove the partition derivation and signal dbbp_flag only when the partition mode is 2NxN/Nx2N, JCT3V-I0077
    263263                                              // Disallow DBBP in 8x8 CU, JCT3V-I0078
     
    267267                                              // RWTH_DBBP_NO_SATD_K0028
    268268                                              // HS_DBBP_CLEAN_K0048
    269 #define NH_3D_DIS                         1   // Depth intra skip 
     269#define NH_3D_DIS                         1   // Depth intra skip
    270270                                              // SEC_DEPTH_INTRA_SKIP_MODE_K0033  Depth intra skip mode
    271271#define H_3D_FCO                          0   // Flexible coding order for 3D
     
    278278                                             // HHI_VPS_3D_EXTENSION_I3_J0107
    279279                                             // HHI_INTER_COMP_PRED_K0052
    280                                              // HHI_RES_PRED_K0052       
    281                                              // HHI_CAM_PARA_K0052       
    282                                              // H_3D_DIRECT_DEP_TYPE     
     280                                             // HHI_RES_PRED_K0052
     281                                             // HHI_CAM_PARA_K0052
     282                                             // H_3D_DIRECT_DEP_TYPE
    283283// Rate Control
    284284#define KWU_FIX_URQ                       0
     
    287287#endif // NH_3D
    288288/////////////////////////////////////////////////////////////////////////////////////////
    289 ///////////////////////////////////   DERIVED DEFINES /////////////////////////////////// 
     289///////////////////////////////////   DERIVED DEFINES ///////////////////////////////////
    290290/////////////////////////////////////////////////////////////////////////////////////////
    291291#if NH_3D
     
    294294#endif
    295295///// ***** VIEW SYNTHESIS OPTIMIZAION *********
    296 #if NH_3D_VSO                                 
     296#if NH_3D_VSO
    297297#define H_3D_VSO_DIST_INT                 1   // Allow negative synthesized view distortion change
    298 #define H_3D_VSO_COLOR_PLANES             1   // Compute VSO distortion on color planes 
     298#define H_3D_VSO_COLOR_PLANES             1   // Compute VSO distortion on color planes
    299299#define H_3D_VSO_EARLY_SKIP               1   // LGE_VSO_EARLY_SKIP_A0093, A0093 modification 4
    300300#define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
     
    338338///////////////////////////////////   MV_HEVC HLS  //////////////////////////////
    339339/////////////////////////////////////////////////////////////////////////////////
    340 // TBD: Check if integration is necessary. 
     340// TBD: Check if integration is necessary.
    341341#define H_MV_HLS_PTL_LIMITS                  0
    342342/////////////////////////////////////////////////////////////////////////////////////////
     
    358358#ifndef RExt__DECODER_DEBUG_BIT_STATISTICS
    359359#define RExt__DECODER_DEBUG_BIT_STATISTICS                0 ///< 0 (default) = decoder reports as normal, 1 = decoder produces bit usage statistics (will impact decoder run time by up to ~10%)
     360#endif
     361#if NH_3D
     362#define DEBUG_NH_3D_SEI                                   0 ///< When enabled, prints out SEI values
    360363#endif
    361364// This can be enabled by the makefile
     
    491494typedef       UInt            Distortion;        ///< distortion measurement
    492495#endif
    493 #if NH_MV                         
    494 typedef std::vector< std::string > StringAry1d; 
    495 typedef std::vector< StringAry1d > StringAry2d; 
     496#if NH_MV
     497typedef std::vector< std::string > StringAry1d;
     498typedef std::vector< StringAry1d > StringAry2d;
    496499typedef std::vector< Int >        IntAry1d;
    497 typedef std::vector< IntAry1d >   IntAry2d; 
    498 typedef std::vector< IntAry2d >   IntAry3d; 
    499 typedef std::vector< IntAry3d >   IntAry4d; 
    500 typedef std::vector< IntAry4d >   IntAry5d; 
     500typedef std::vector< IntAry1d >   IntAry2d;
     501typedef std::vector< IntAry2d >   IntAry3d;
     502typedef std::vector< IntAry3d >   IntAry4d;
     503typedef std::vector< IntAry4d >   IntAry5d;
    501504typedef std::vector< Bool >        BoolAry1d;
    502 typedef std::vector< BoolAry1d >   BoolAry2d; 
    503 typedef std::vector< BoolAry2d >   BoolAry3d; 
    504 typedef std::vector< BoolAry3d >   BoolAry4d; 
    505 typedef std::vector< BoolAry4d >   BoolAry5d; 
     505typedef std::vector< BoolAry1d >   BoolAry2d;
     506typedef std::vector< BoolAry2d >   BoolAry3d;
     507typedef std::vector< BoolAry3d >   BoolAry4d;
     508typedef std::vector< BoolAry4d >   BoolAry5d;
    506509#endif
    507510#if NH_3D_VSO
     
    512515#if H_3D_VSO_DIST_INT
    513516typedef       Int64            Dist;       ///< RDO distortion
    514 typedef       Int64            Dist64; 
     517typedef       Int64            Dist64;
    515518#define       RDO_DIST_MIN     MIN_INT
    516519#define       RDO_DIST_MAX     MAX_INT
    517520#else
    518521typedef       UInt             Dist;       ///< RDO distortion
    519 typedef       UInt64           Dist; 
     522typedef       UInt64           Dist;
    520523#define       RDO_DIST_MIN     0
    521524#define       RDO_DIST_MAX     MAX_UINT
     
    805808  ANNEX_G,
    806809  ANNEX_H,
    807   ANNEX_I 
     810  ANNEX_I
    808811};
    809812#endif
     
    821824    ,MULTIVIEWMAIN = 6,
    822825#if NH_3D
    823     MAIN3D = 8, 
     826    MAIN3D = 8,
    824827#endif
    825828#endif
     
    949952enum ScalabilityType
    950953{
    951   DEPTH_ID = 0,   
     954  DEPTH_ID = 0,
    952955  VIEW_ORDER_INDEX  = 1,
    953956  DEPENDENCY_ID = 2,
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibDecoder/SEIread.cpp

    r1344 r1349  
    100100
    101101Void SEIReader::sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName)
    102 { 
     102{
    103103  READ_STRING(uiBufSize, pucCode, ruiLength, pSymbolName);
    104104  if (pOS)
     
    119119    (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw(seiMessageHdr.size()) << "-" << std::setfill(' ') << "\n" << seiMessageHdr << " (" << payloadSize << " bytes)"<< "\n";
    120120#if NH_MV_SEI
    121     (*pDecodedMessageOutputStream) << std::setfill(' ') << "LayerId: " << m_layerId << std::setw(2) << " Picture: " << m_decOrder << std::setw( 5 ) << std::endl; 
     121    (*pDecodedMessageOutputStream) << std::setfill(' ') << "LayerId: " << m_layerId << std::setw(2) << " Picture: " << m_decOrder << std::setw( 5 ) << std::endl;
    122122#endif
    123123  }
     
    566566Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    567567{
    568   UInt val; 
     568  UInt val;
    569569  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    570570
     
    992992    sei_read_code( pDecodedMessageOutputStream,  16, code, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = code;
    993993    sei_read_code( pDecodedMessageOutputStream,  16, code, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = code;
    994   } 
     994  }
    995995}
    996996
     
    12351235  for (Int i = 0; i < sei.m_lnpSeiMaxLayers; i++)
    12361236  {
    1237     sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" ); 
     1237    sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" );
    12381238    sei.m_layerNotPresentFlag[i] = (code == 1);
    12391239  }
     
    12561256    }
    12571257    Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1;
    1258    
     1258
    12591259    sei.resizeDimI( numSignificantSets );
    12601260    for( Int i = 0; i < numSignificantSets; i++ )
     
    12621262      sei_read_uvlc( pDecodedMessageOutputStream, code, "ilcts_id"                        ); sei.m_ilctsId                  [i] = code;
    12631263      sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_tile_rects_in_set_minus1" ); sei.m_ilNumTileRectsInSetMinus1[i] = code;
    1264      
     1264
    12651265      sei.resizeDimJ( i, sei.m_ilNumTileRectsInSetMinus1[ i ] + 1 );
    12661266      for( Int j = 0; j  <=  sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ )
     
    13321332  sei_read_code( pDecodedMessageOutputStream, 4, code, "sb_property_active_vps_id" ); sei.m_sbPropertyActiveVpsId = code;
    13331333  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_additional_sub_streams_minus1" ); sei.m_numAdditionalSubStreamsMinus1 = code;
    1334   sei.resizeArrays( ); 
     1334  sei.resizeArrays( );
    13351335  for( Int i = 0; i  <=  sei.m_numAdditionalSubStreamsMinus1; i++ )
    13361336  {
     
    14191419    while ( m_pcBitstream->getNumBitsRead() % 8 != 0 )
    14201420    {
    1421       sei_read_flag( pDecodedMessageOutputStream, code, "overlay_zero_bit" ); 
    1422       assert( code==0 );     
    1423     }
    1424    
     1421      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_zero_bit" );
     1422      assert( code==0 );
     1423    }
     1424
    14251425    UChar* sval = new UChar[sei.m_numStringBytesMax];
    1426     UInt slen;   
    1427     sei.m_overlayLanguage   .resize( sei.m_numOverlaysMinus1 + 1 );   
    1428     sei.m_overlayName       .resize( sei.m_numOverlaysMinus1 + 1 );   
    1429     sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1 + 1 );   
     1426    UInt slen;
     1427    sei.m_overlayLanguage   .resize( sei.m_numOverlaysMinus1 + 1 );
     1428    sei.m_overlayName       .resize( sei.m_numOverlaysMinus1 + 1 );
     1429    sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1 + 1 );
    14301430    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
    14311431    {
    14321432      if( sei.m_languageOverlayPresentFlag[i] )
    1433       {       
     1433      {
    14341434        sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_language");
    1435         sei.m_overlayLanguage[i] = std::string((const char*) sval);       
     1435        sei.m_overlayLanguage[i] = std::string((const char*) sval);
    14361436      }
    14371437      sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_name");
    1438       sei.m_overlayName[i] = std::string((const char*) sval);       
     1438      sei.m_overlayName[i] = std::string((const char*) sval);
    14391439      if( sei.m_overlayLabelPresentFlag[i] )
    14401440      {
    1441         sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );       
     1441        sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
    14421442        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
    14431443        {
    14441444          sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_element_name");
    1445           sei.m_overlayElementName[i][j] = std::string((const char*) sval);           
     1445          sei.m_overlayElementName[i][j] = std::string((const char*) sval);
    14461446        }
    14471447      }
     
    14491449    delete [] sval;
    14501450    sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = (code == 1);
    1451   } 
     1451  }
    14521452};
    14531453
     
    16131613{
    16141614  UInt  code;
    1615   Int  sCode; 
     1615  Int  sCode;
    16161616  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    16171617
     
    16361636
    16371637    for( Int i = 0; i  <=  ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ )
    1638     {     
     1638    {
    16391639      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_focal_length_x"        ); sei.m_signFocalLengthX       [i] = (code == 1);
    16401640      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_focal_length_x"    ); sei.m_exponentFocalLengthX   [i] =  code      ;
     
    16851685
    16861686  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_views_minus1" ); sei.m_numViewsMinus1 = code;
    1687   sei.m_viewPosition.resize( sei.m_numViewsMinus1 + 1 ); 
     1687  sei.m_viewPosition.resize( sei.m_numViewsMinus1 + 1 );
    16881688  for( Int i = 0; i  <=  sei.m_numViewsMinus1; i++ )
    16891689  {
     
    16991699  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    17001700
     1701  sei.resizeArrays( );
    17011702  sei_read_flag( pDecodedMessageOutputStream, code, "alternative_depth_info_cancel_flag" ); sei.m_alternativeDepthInfoCancelFlag = (code == 1);
    17021703  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
    17031704  {
    17041705    sei_read_code( pDecodedMessageOutputStream, 2, code, "depth_type" ); sei.m_depthType = code;
    1705 #if NH_MV_SEI_TBD
    17061706    if( sei.m_depthType  ==  0 )
    17071707    {
     
    17141714      if( sei.m_zGvdFlag )
    17151715      {
    1716         for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
    1717         {
    1718           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i] = (code == 1);
    1719           sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i] = code;
    1720           sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i] = code;
    1721           sei_read_code( pDecodedMessageOutputStream, getManGvdZNearLen ), code, "man_gvd_z_near" ); sei.m_manGvdZNear[i] = code;
    1722           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i] = (code == 1);
    1723           sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i] = code;
    1724           sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i] = code;
    1725           sei_read_code( pDecodedMessageOutputStream, getManGvdZFarLen ), code, "man_gvd_z_far" ); sei.m_manGvdZFar[i] = code;
     1716        for( Int i = 0, j = 0; j <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
     1717        {
     1718          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i][j] = (code == 1);
     1719          sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i][j] = code;
     1720          sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i][j] = code;
     1721          sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZNearMinus1[i][j]+1, code, "man_gvd_z_near" ); sei.m_manGvdZNear[i][j] = code;
     1722          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i][j] = (code == 1);
     1723          sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i][j] = code;
     1724          sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i][j] = code;
     1725          sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZFarMinus1[i][j]+1, code, "man_gvd_z_far" ); sei.m_manGvdZFar[i][j] = code;
    17261726        }
    17271727      }
     
    17391739        sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_translation_param" ); sei.m_precGvdTranslationParam = code;
    17401740      }
    1741       for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
     1741      for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
    17421742      {
    17431743        if( sei.m_intrinsicParamGvdFlag )
    17441744        {
    1745           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i] = (code == 1);
    1746           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i] = code;
    1747           sei_read_code( pDecodedMessageOutputStream, getManGvdFocalLengthXLen ), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i] = code;
    1748           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i] = (code == 1);
    1749           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i] = code;
    1750           sei_read_code( pDecodedMessageOutputStream, getManGvdFocalLengthYLen ), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i] = code;
    1751           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i] = (code == 1);
    1752           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i] = code;
    1753           sei_read_code( pDecodedMessageOutputStream, getManGvdPrincipalPointXLen ), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i] = code;
    1754           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i] = (code == 1);
    1755           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i] = code;
    1756           sei_read_code( pDecodedMessageOutputStream, getManGvdPrincipalPointYLen ), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i] = code;
     1745          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i][j] = (code == 1);
     1746          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i][j] = code;
     1747          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;
     1748          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i][j] = (code == 1);
     1749          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i][j] = code;
     1750          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdFocalLength, code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;
     1751          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i][j] = (code == 1);
     1752          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i][j] = code;
     1753          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;
     1754          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i][j] = (code == 1);
     1755          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i][j] = code;
     1756          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdPrincipalPoint, code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;
    17571757        }
    17581758        if( sei.m_rotationGvdFlag )
    17591759        {
    1760           for( Int j = 10; j  <=  3; j++ ) /* row */
     1760          for( Int k = 0; k  <  3; k++ )  /* column */
    17611761          {
    1762             for( Int k = 10; k  <=  3; k++ )  /* column */
    1763             {
    1764               sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r" ); sei.m_signGvdR[i][j][k] = (code == 1);
    1765               sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r" ); sei.m_expGvdR[i][j][k] = code;
    1766               sei_read_code( pDecodedMessageOutputStream, getManGvdRLen ), code, "man_gvd_r" ); sei.m_manGvdR[i][j][k] = code;
    1767             }
     1762            sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r" ); sei.m_signGvdR[i][j][k] = (code == 1);
     1763            sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r" ); sei.m_expGvdR[i][j][k] = code;
     1764            sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r" ); sei.m_manGvdR[i][j][k] = code;
    17681765          }
    17691766        }
    17701767        if( sei.m_translationGvdFlag )
    17711768        {
    1772           sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i] = (code == 1);
    1773           sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i] = code;
    1774           sei_read_code( pDecodedMessageOutputStream, getManGvdTXLen ), code, "man_gvd_t_x" ); sei.m_manGvdTX[i] = code;
    1775         }
    1776       }
    1777     }
    1778 #endif
     1769#if NH_MV_SEI_TBD
     1770          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i][j] = (code == 1);
     1771          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i][j] = code;
     1772          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdTranslationParam, code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;
     1773#endif
     1774        }
     1775      }
     1776    }
    17791777
    17801778    if( sei.m_depthType  ==  1 )
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibDecoder/TDecTop.cpp

    r1331 r1349  
    5959  m_iLog2Precision   = LOG2_DISP_PREC_LUT;
    6060  m_uiBitDepthForLUT = 8; // fixed
    61   m_receivedIdc = NULL; 
    62   m_vps         = NULL; 
     61  m_receivedIdc = NULL;
     62  m_vps         = NULL;
    6363}
    6464
     
    7575  xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
    7676  xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
    77   xDeleteArray( m_receivedIdc, m_vps->getNumViews() );
     77  if (m_receivedIdc != nullptr) // NICT FIX
     78    xDeleteArray( m_receivedIdc, m_vps->getNumViews() );
    7879}
    7980
     
    8485  assert( !isInitialized() ); // Only one initialization currently supported
    8586  m_bInitialized            = true;
    86   m_vps                     = vps; 
    87   m_bCamParsVaryOverTime    = false;   
    88   m_lastPoc                 = -1;   
    89   m_firstReceivedPoc        = -2; 
     87  m_vps                     = vps;
     88  m_bCamParsVaryOverTime    = false;
     89  m_lastPoc                 = -1;
     90  m_firstReceivedPoc        = -2;
    9091
    9192  for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)
    9293  {
    93     Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 
    94     m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );   
    95   }
    96 
    97   assert( m_receivedIdc == NULL ); 
    98   m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 
     94    Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ;
     95    m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );
     96  }
     97
     98  assert( m_receivedIdc == NULL );
     99  m_receivedIdc = new Int*[ m_vps->getNumViews() ];
    99100  for (Int i = 0; i < m_vps->getNumViews(); i++)
    100101  {
    101     m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 
    102   }
    103 
    104   xResetReceivedIdc( true ); 
     102    m_receivedIdc[i] = new Int[ m_vps->getNumViews() ];
     103  }
     104
     105  xResetReceivedIdc( true );
    105106
    106107  for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
    107108  {
    108     if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 
     109    if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) )
    109110    {
    110111      for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
    111       { 
     112      {
    112113        if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
    113114        {
    114           m_receivedIdc   [ baseVoiInVps ][ voiInVps ] = -1; 
     115          m_receivedIdc   [ baseVoiInVps ][ voiInVps ] = -1;
    115116          m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale    (voiInVps) [ baseVoiInVps ];
    116117          m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset   (voiInVps) [ baseVoiInVps ];
    117118
    118           m_receivedIdc   [ voiInVps ][ baseVoiInVps ] = -1; 
     119          m_receivedIdc   [ voiInVps ][ baseVoiInVps ] = -1;
    119120          m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ];
    120121          m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ];
     
    131132{
    132133  for (Int i = 0; i < m_vps->getNumViews(); i++)
    133   { 
     134  {
    134135    for (Int j = 0; j < m_vps->getNumViews(); j++)
    135136    {
    136137      if ( overWriteFlag ||  ( m_receivedIdc[i][j] != -1 ) )
    137138      {
    138         m_receivedIdc[i][j] = 0; 
    139       }     
     139        m_receivedIdc[i][j] = 0;
     140      }
    140141    }
    141142  }
     
    171172}
    172173
    173 Void 
     174Void
    174175  CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
    175176{
     
    234235  if( m_firstReceivedPoc == -2 )
    235236  {
    236     m_firstReceivedPoc = curPoc; 
    237   }
    238 
    239   Bool newPocFlag = ( m_lastPoc != curPoc ); 
     237    m_firstReceivedPoc = curPoc;
     238  }
     239
     240  Bool newPocFlag = ( m_lastPoc != curPoc );
    240241
    241242  if ( newPocFlag )
    242   {   
     243  {
    243244    if( m_lastPoc != -1 )
    244245    {
     
    246247    }
    247248
    248     xResetReceivedIdc( false ); 
     249    xResetReceivedIdc( false );
    249250    m_lastPoc = pcSlice->getPOC();
    250251  }
    251252
    252   UInt voiInVps          = m_vps->getVoiInVps(pcSlice->getViewIndex()); 
     253  UInt voiInVps          = m_vps->getVoiInVps(pcSlice->getViewIndex());
    253254  if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here
    254   {   
     255  {
    255256    for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
    256     {       
     257    {
    257258      if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
    258259      {
    259260        if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 )
    260         {     
     261        {
    261262          AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] );
    262263          AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] );
    263264        }
    264265        else
    265         {         
    266           m_receivedIdc   [ voiInVps ][ baseVoiInVps ]  = 1; 
     266        {
     267          m_receivedIdc   [ voiInVps ][ baseVoiInVps ]  = 1;
    267268          m_aaiCodedScale [ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedScale () [ baseVoiInVps ];
    268269          m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedOffset() [ baseVoiInVps ];
     
    270271        }
    271272        if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 )
    272         {     
     273        {
    273274          AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale    () [ baseVoiInVps ] );
    274275          AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset   () [ baseVoiInVps ] );
    275276        }
    276277        else
    277         {       
    278           m_receivedIdc   [ baseVoiInVps ][ voiInVps ]  = 1; 
     278        {
     279          m_receivedIdc   [ baseVoiInVps ][ voiInVps ]  = 1;
    279280          m_aaiCodedScale [ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedScale    () [ baseVoiInVps ];
    280281          m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedOffset   () [ baseVoiInVps ];
     
    283284      }
    284285    }
    285   } 
     286  }
    286287}
    287288
     
    295296      fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx     ViewIdVal\n" );
    296297      fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" );
    297      
     298
    298299      for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
    299300      {
     
    315316          {
    316317            if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 )
    317             {           
     318            {
    318319              fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
    319                 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 
    320                 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 
     320                iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ),
     321                m_aaiCodedScale [ baseVoiInVps ][ voiInVps ],
    321322                m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() );
    322             }           
     323            }
    323324          }
    324325        }
     
    334335#if !NH_MV
    335336  , m_associatedIRAPType(NAL_UNIT_INVALID)
    336   , m_pocCRA(0) 
     337  , m_pocCRA(0)
    337338  , m_pocRandomAccess(MAX_INT)
    338339  , m_cListPic()
     
    426427    fclose( g_hTrace );
    427428  }
    428 #endif 
     429#endif
    429430#endif
    430431  while (!m_prefixSEINALUs.empty())
     
    465466#endif
    466467#if NH_MV
    467   m_cCavlcDecoder.setDecTop( this ); 
     468  m_cCavlcDecoder.setDecTop( this );
    468469#endif
    469470  m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO);
     
    653654#if NH_MV
    654655    const TComVPS* vps = m_parameterSetManager.getVPS(sps->getVPSId());
    655     assert (vps != 0); 
    656     // TBD: check the condition on m_firstPicInLayerDecodedFlag 
     656    assert (vps != 0);
     657    // TBD: check the condition on m_firstPicInLayerDecodedFlag
    657658    if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP() || !m_firstPicInLayerDecodedFlag[m_layerId] , m_layerId ) )
    658659#else
     
    671672      {
    672673        //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0.
    673         assert( sps->getUpdateRepFormatFlag() == false ); 
    674       }
    675       sps->checkRpsMaxNumPics( vps, getLayerId() ); 
    676 
    677       // It is a requirement of bitstream conformance that, when the SPS is referred to by 
    678       // any current picture that belongs to an independent non-base layer, the value of 
     674        assert( sps->getUpdateRepFormatFlag() == false );
     675      }
     676      sps->checkRpsMaxNumPics( vps, getLayerId() );
     677
     678      // It is a requirement of bitstream conformance that, when the SPS is referred to by
     679      // any current picture that belongs to an independent non-base layer, the value of
    679680      // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0.
    680681
    681682      if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 )
    682       { 
    683         assert( sps->getMultiLayerExtSpsFlag() == 0 ); 
     683      {
     684        assert( sps->getMultiLayerExtSpsFlag() == 0 );
    684685      }
    685686    }
    686687#if NH_MV_SEI
    687     m_seiReader.setLayerId ( newPic->getLayerId      ( ) ); 
     688    m_seiReader.setLayerId ( newPic->getLayerId      ( ) );
    688689    m_seiReader.setDecOrder( newPic->getDecodingOrder( ) );
    689690#endif
     
    711712    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
    712713#else
    713     m_pcPic = newPic; 
     714    m_pcPic = newPic;
    714715#endif
    715716
     
    727728#if NH_MV
    728729    pSlice->setPic( m_pcPic );
    729     vps=pSlice->getVPS(); 
     730    vps=pSlice->getVPS();
    730731    // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
    731     assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) );   
     732    assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) );
    732733    // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
    733734    assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) );
     
    779780  {
    780781#if NH_MV
    781     assert( m_pcPic != NULL ); 
    782     assert( newPic  == NULL ); 
     782    assert( m_pcPic != NULL );
     783    assert( newPic  == NULL );
    783784#endif
    784785    // make the slice-pilot a real slice, and set up the slice-pilot for the next slice
     
    863864  m_cEntropyDecoder.setBitstream      (&(nalu.getBitstream()));
    864865
    865   assert( nalu.m_nuhLayerId == m_layerId );   
     866  assert( nalu.m_nuhLayerId == m_layerId );
    866867  m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice
    867868  // it is not associated with picture, sps or pps structures.
    868   m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 
    869   m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot );   
     869  m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId );
     870  m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot );
    870871  if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() )
    871872  {
    872 #endif 
     873#endif
    873874    m_uiSliceIdx = 0;
    874875  }
     
    916917  if (m_apcSlicePilot->getRapPicFlag())
    917918  {
    918       if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 
     919      if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
    919920        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
    920921        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
     
    932933    else
    933934    {
    934       m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 
     935      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
    935936    }
    936937
     
    958959    }
    959960  }
    960  
     961
    961962  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
    962963  {
     
    10521053  {
    10531054    //Check Multiview Main profile constraint in G.11.1.1
    1054     //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 
    1055     //  for the layer with nuh_layer_id equal to i in subBitstream, 
    1056     //  inter_view_mv_vert_constraint_flag shall be equal to 1 
     1055    //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1
     1056    //  for the layer with nuh_layer_id equal to i in subBitstream,
     1057    //  inter_view_mv_vert_constraint_flag shall be equal to 1
    10571058    //  in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer.
    10581059    if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN
    10591060      &&
    1060       pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 
     1061      pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1
    10611062      )
    10621063    {
     
    10691070    m_pcPic->setViewIndex( getViewIndex() );
    10701071    m_pcPic->setIsDepth  ( getIsDepth  () );
    1071     pcSlice->setIvPicLists( m_dpb );         
    1072 #endif
    1073 #endif
    1074    
     1072    pcSlice->setIvPicLists( m_dpb );
     1073#endif
     1074#endif
     1075
    10751076    // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses.
    10761077    // Now, having set up the maps, convert them to the correct form.
     
    11051106        else
    11061107        {
    1107           assert( false ); 
     1108          assert( false );
    11081109        }
    11091110      }
     
    11121113#endif
    11131114#if NH_3D_ARP
    1114       pcSlice->setPocsInCurrRPSs(); 
     1115      pcSlice->setPocsInCurrRPSs();
    11151116      pcSlice->setARPStepNum(m_dpb);
    1116 #endif     
     1117#endif
    11171118#endif
    11181119
     
    11991200    if ( decProcAnnexI() )
    12001201    {
    1201       pcSlice->checkInCompPredRefLayers(); 
     1202      pcSlice->checkInCompPredRefLayers();
    12021203    }
    12031204#endif
     
    12381239  TComSPS* sps = new TComSPS();
    12391240#if NH_MV
    1240   sps->setLayerId( getLayerId() ); 
     1241  sps->setLayerId( getLayerId() );
    12411242#endif
    12421243#if O0043_BEST_EFFORT_DECODING
     
    12541255  TComPPS* pps = new TComPPS();
    12551256#if NH_MV
    1256   pps->setLayerId( getLayerId() ); 
     1257  pps->setLayerId( getLayerId() );
    12571258#endif
    12581259#if NH_3D_DLT
     
    13441345    case NAL_UNIT_CODED_SLICE_RASL_R:
    13451346#if NH_MV
    1346       assert( false ); 
    1347       return 1; 
     1347      assert( false );
     1348      return 1;
    13481349#else
    13491350      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
     
    15181519{
    15191520  //Output of this process is PicOrderCntVal, the picture order count of the current picture.
    1520   //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
     1521  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
    15211522  //  motion vector prediction and for decoder conformance checking (see clause F.13.5).
    15221523
     
    15251526  TComSlice* slice = m_apcSlicePilot;
    15261527  const Int nuhLayerId   = slice->getLayerId();
    1527   const TComVPS*   vps   = slice->getVPS(); 
    1528   const TComSPS*   sps   = slice->getSPS(); 
    1529 
    1530   Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 
     1528  const TComVPS*   vps   = slice->getVPS();
     1529  const TComSPS*   sps   = slice->getSPS();
     1530
     1531  Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ];
    15311532
    15321533  if ( isFstPicOfAllLayOfPocResetPer )
    15331534  {
    1534     //  When the current picture is the first picture among all layers of a POC resetting period, 
     1535    //  When the current picture is the first picture among all layers of a POC resetting period,
    15351536    //  the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive.
    1536     pocDecrementedInDpbFlag = false; 
     1537    pocDecrementedInDpbFlag = false;
    15371538  }
    15381539
    15391540  //  The variable pocResettingFlag is derived as follows:
    1540   Bool pocResettingFlag; 
     1541  Bool pocResettingFlag;
    15411542  if ( isPocResettingPicture )
    15421543  {
    1543     //-  If the current picture is a POC resetting picture, the following applies:   
     1544    //-  If the current picture is a POC resetting picture, the following applies:
    15441545    if( vps->getVpsPocLsbAlignedFlag()  )
    15451546    {
    15461547      //  -  If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1.
    1547       pocResettingFlag = true; 
     1548      pocResettingFlag = true;
    15481549    }
    15491550    else if ( pocDecrementedInDpbFlag )
    15501551    {
    15511552      //  -  Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0.
    1552       pocResettingFlag = false; 
     1553      pocResettingFlag = false;
    15531554    }
    15541555    else
    15551556    {
    15561557      //  -  Otherwise, pocResettingFlag is set equal to 1.
    1557       pocResettingFlag = true; 
     1558      pocResettingFlag = true;
    15581559    }
    15591560  }
     
    15611562  {
    15621563    //  -  Otherwise, pocResettingFlag is set equal to 0.
    1563     pocResettingFlag = false; 
    1564   }
    1565 
    1566   Int picOrderCntMsb; 
    1567   Int picOrderCntVal; 
     1564    pocResettingFlag = false;
     1565  }
     1566
     1567  Int picOrderCntMsb;
     1568  Int picOrderCntVal;
    15681569
    15691570  //  Depending on pocResettingFlag, the following applies:
     
    15731574    if( slice->getPocResetIdc()  ==  1 )
    15741575    {
    1575       picOrderCntVal = slice->getSlicePicOrderCntLsb(); 
    1576     }
    1577     else if (slice->getPocResetIdc()  ==  2 ) 
    1578     {
    1579       picOrderCntVal = 0; 
     1576      picOrderCntVal = slice->getSlicePicOrderCntLsb();
     1577    }
     1578    else if (slice->getPocResetIdc()  ==  2 )
     1579    {
     1580      picOrderCntVal = 0;
    15801581    }
    15811582    else
    15821583    {
    1583       picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 
    1584       picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
     1584      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() );
     1585      picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
    15851586    }
    15861587  }
     
    15921593    if( slice->getPocMsbCycleValPresentFlag() )
    15931594    {
    1594       picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 
     1595      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();
    15951596    }
    15961597    else if( !firstPicInLayerDecodedFlag  ||
     
    15981599    {
    15991600      picOrderCntMsb = 0; //     (F 62)
    1600     }   
     1601    }
    16011602    else
    16021603    {
    16031604      Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
    1604       Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 
    1605       picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 
    1606     }
    1607     picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
    1608   } 
     1605      Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
     1606      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
     1607    }
     1608    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
     1609  }
    16091610  return picOrderCntVal;
    16101611}
     
    16191620    if ( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] != MIN_INT )
    16201621    {
    1621       // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 
    1622       //   of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 
     1622      // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer
     1623      //   of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the
    16231624      //   poc_reset_period_id of picA.
    16241625
    1625       m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 
     1626      m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] );
    16261627    }
    16271628    else
    16281629    {
    16291630      //- Otherwise, the value of poc_reset_period_id is inferred to be equal to 0.
    1630       m_apcSlicePilot->setPocResetPeriodId( 0 ); 
     1631      m_apcSlicePilot->setPocResetPeriodId( 0 );
    16311632    }
    16321633  }
    16331634  else
    16341635  {
    1635     m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 
     1636    m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId();
    16361637  }
    16371638}
     
    16391640
    16401641Void TDecTop::decodePocAndRps( )
    1641 { 
     1642{
    16421643  assert( m_uiSliceIdx == 0 );
    16431644  Int nuhLayerId = m_pcPic->getLayerId();
     
    16461647    // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0
    16471648
    1648     // Variables and functions relating to picture order count are derived as 
    1649     // specified in clause 8.3.1. This needs to be invoked only for the first slice 
     1649    // Variables and functions relating to picture order count are derived as
     1650    // specified in clause 8.3.1. This needs to be invoked only for the first slice
    16501651    // segment of a picture.
    16511652    x831DecProcForPicOrderCount( );
    16521653
    1653     // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 
    1654     // pictures may be marked as "unused for reference" or "used for long-term 
    1655     // reference". This needs to be invoked only for the first slice segment of a 
     1654    // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference
     1655    // pictures may be marked as "unused for reference" or "used for long-term
     1656    // reference". This needs to be invoked only for the first slice segment of a
    16561657    // picture.
    16571658    x832DecProcForRefPicSet    (  false );
     
    16661667      // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3
    16671668
    1668       // Variables and functions relating to picture order count are derived as 
    1669       // specified in clause 8.3.1. This needs to be invoked only for the first slice 
     1669      // Variables and functions relating to picture order count are derived as
     1670      // specified in clause 8.3.1. This needs to be invoked only for the first slice
    16701671      // segment of a picture.
    16711672      xF831DecProcForPicOrderCount( );
    16721673
    1673       // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 
    1674       // pictures may be marked as "unused for reference" or "used for long-term 
    1675       // reference". This needs to be invoked only for the first slice segment of a 
     1674      // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference
     1675      // pictures may be marked as "unused for reference" or "used for long-term
     1676      // reference". This needs to be invoked only for the first slice segment of a
    16761677      // picture.
    16771678      xF832DecProcForRefPicSet( );
     
    16821683      // nuh_layer_id greater than 0
    16831684
    1684       // Variables and functions relating to picture order count are derived in clause F.8.3.1. 
    1685       // This needs to be invoked only for the first slice segment of a picture. It is a requirement 
    1686       // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 
     1685      // Variables and functions relating to picture order count are derived in clause F.8.3.1.
     1686      // This needs to be invoked only for the first slice segment of a picture. It is a requirement
     1687      // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the
    16871688      // same value during and at the end of decoding of the access unit
    16881689      xF831DecProcForPicOrderCount( );
    16891690
    1690       // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 
    1691       // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 
    1692       // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 
     1691      // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with
     1692      // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for
     1693      // long-term reference" and any picture with a different value of nuh_layer_id is not marked.
    16931694      // This needs to be invoked only for the first slice segment of a picture.
    16941695      xF832DecProcForRefPicSet( );
     
    16971698  else
    16981699  {
    1699     assert( false ); 
     1700    assert( false );
    17001701  }
    17011702}
    17021703
    17031704Void TDecTop::genUnavailableRefPics( )
    1704 { 
     1705{
    17051706  assert( m_uiSliceIdx == 0 );
    17061707  Int nuhLayerId = m_pcPic->getLayerId();
     
    17111712    if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) )
    17121713    {
    1713       // When the current picture is a BLA picture or is a CRA picture 
    1714       // with NoRaslOutputFlag equal to 1, the decoding process for generating 
    1715       // unavailable reference pictures specified in clause 8.3.3 is invoked, 
     1714      // When the current picture is a BLA picture or is a CRA picture
     1715      // with NoRaslOutputFlag equal to 1, the decoding process for generating
     1716      // unavailable reference pictures specified in clause 8.3.3 is invoked,
    17161717      // which needs to be invoked only for the first slice segment of a picture.
    1717       x8331GenDecProcForGenUnavilRefPics();       
     1718      x8331GenDecProcForGenUnavilRefPics();
    17181719    }
    17191720  }
     
    17291730      if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) )
    17301731      {
    1731         // When the current picture is a BLA picture or is a CRA picture 
    1732         // with NoRaslOutputFlag equal to 1, the decoding process for generating 
    1733         // unavailable reference pictures specified in clause 8.3.3 is invoked, 
     1732        // When the current picture is a BLA picture or is a CRA picture
     1733        // with NoRaslOutputFlag equal to 1, the decoding process for generating
     1734        // unavailable reference pictures specified in clause 8.3.3 is invoked,
    17341735        // which needs to be invoked only for the first slice segment of a picture.
    1735         xF833DecProcForGenUnavRefPics(); 
     1736        xF833DecProcForGenUnavRefPics();
    17361737      }
    17371738#if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS
    1738       TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
     1739      TComDecodedRps* decRps = m_pcPic->getDecodedRps();
    17391740      decRps->m_numActiveRefLayerPics0 = 0;
    1740       decRps->m_numActiveRefLayerPics1 = 0;     
     1741      decRps->m_numActiveRefLayerPics1 = 0;
    17411742#endif
    17421743    }
     
    17481749      if ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] )
    17491750      {
    1750         // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 
    1751         // unavailable reference pictures for pictures first in decoding order within a layer specified in 
     1751        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating
     1752        // unavailable reference pictures for pictures first in decoding order within a layer specified in
    17521753        // clause F.8.1.7 is invoked, which needs to be invoked only for the first slice segment of a picture.
    17531754        xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay();
     
    17561757      if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && ( m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) )
    17571758      {
    1758         // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 
    1759         // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 
    1760         // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 
     1759        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP
     1760        // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference
     1761        // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice
    17611762        // segment of a picture.
    1762         xF833DecProcForGenUnavRefPics(); 
     1763        xF833DecProcForGenUnavRefPics();
    17631764      }
    17641765
     
    17721773  else
    17731774  {
    1774     assert( false ); 
    1775   }
    1776 
    1777   xCheckUnavailableRefPics();     
     1775    assert( false );
     1776  }
     1777
     1778  xCheckUnavailableRefPics();
    17781779}
    17791780Void TDecTop::executeLoopFilters( )
    17801781{
    1781   assert( m_pcPic != NULL ); 
     1782  assert( m_pcPic != NULL );
    17821783  if ( !m_pcPic->getHasGeneratedRefPics() && !m_pcPic->getIsGenerated() )
    17831784  {
     
    17911792  if( m_pcPic->isIrap() )
    17921793  {
    1793     m_prevIrapPoc           = m_pcPic->getPOC(); 
    1794     m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 
     1794    m_prevIrapPoc           = m_pcPic->getPOC();
     1795    m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder();
    17951796  }
    17961797  if( m_pcPic->isStsa() )
     
    18031804
    18041805Void TDecTop::initFromActiveVps( const TComVPS* vps )
    1805 {   
    1806   setViewId   ( vps->getViewId   ( getLayerId() )      ); 
     1806{
     1807  setViewId   ( vps->getViewId   ( getLayerId() )      );
    18071808#if NH_3D
    1808   setViewIndex( vps->getViewIndex( getLayerId() )      ); 
    1809   setIsDepth  ( vps->getDepthId  ( getLayerId() ) == 1 ); 
     1809  setViewIndex( vps->getViewIndex( getLayerId() )      );
     1810  setIsDepth  ( vps->getDepthId  ( getLayerId() ) == 1 );
    18101811#endif
    18111812
    18121813  if ( !vps->getVpsExtensionFlag() )
    18131814  {
    1814     m_decodingProcess = CLAUSE_8; 
     1815    m_decodingProcess = CLAUSE_8;
    18151816    m_isInOwnTargetDecLayerIdList = ( getLayerId() ==  0 );
    18161817  }
    18171818  else
    1818   { 
     1819  {
    18191820    if ( m_targetOlsIdx == -1 )
    18201821    {
    1821       // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 
    1822       m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 
    1823     }
    1824 
    1825     Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 
     1822      // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. )
     1823      m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1();
     1824    }
     1825
     1826    Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx );
    18261827
    18271828    if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && vps->getVpsBaseLayerInternalFlag() )
    18281829    {
    1829       m_smallestLayerId = 0; 
     1830      m_smallestLayerId = 0;
    18301831    }
    18311832    else if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && !vps->getVpsBaseLayerInternalFlag() )
    18321833    {
    1833       m_smallestLayerId = 0; 
     1834      m_smallestLayerId = 0;
    18341835    }
    18351836    else if ( targetDecLayerSetIdx > vps->getVpsNumLayerSetsMinus1() && vps->getNumLayersInIdList( targetDecLayerSetIdx) == 1 )
    18361837    {
    1837      
    1838       // m_smallestLayerId = 0;       
    1839       // For now don't do change of layer id here. 
    1840       m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];   
     1838
     1839      // m_smallestLayerId = 0;
     1840      // For now don't do change of layer id here.
     1841      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];
    18411842    }
    18421843    else
    18431844    {
    1844       m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];   
     1845      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];
    18451846    }
    18461847
     
    18481849    // Set profile
    18491850    Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx );
    1850     Int lIdx = -1; 
     1851    Int lIdx = -1;
    18511852    for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ) ; j++ )
    18521853    {
    18531854      if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() )
    1854       {       
    1855         lIdx = j;         
    1856         break; 
    1857       }       
    1858     }
    1859     m_isInOwnTargetDecLayerIdList = (lIdx != -1); 
     1855      {
     1856        lIdx = j;
     1857        break;
     1858      }
     1859    }
     1860    m_isInOwnTargetDecLayerIdList = (lIdx != -1);
    18601861
    18611862    if ( m_isInOwnTargetDecLayerIdList )
    18621863    {
    18631864      Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc();
    1864       assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 
     1865      assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 );
    18651866
    18661867      if (  profileIdc == 6 )
     
    18931894
    18941895  //  Output of this process is PicOrderCntVal, the picture order count of the current picture.
    1895   //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
     1896  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
    18961897  //  motion vector prediction, and for decoder conformance checking (see clause C.5).
    18971898  //  Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal.
    18981899
    1899   const TComSlice* curSlice = m_pcPic->getSlice(0); 
    1900 
    1901   Int prevPicOrderCntLsb = MIN_INT; 
    1902   Int prevPicOrderCntMsb = MIN_INT; 
    1903   if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() )  ) 
    1904   {
    1905     //  When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 
     1900  const TComSlice* curSlice = m_pcPic->getSlice(0);
     1901
     1902  Int prevPicOrderCntLsb = MIN_INT;
     1903  Int prevPicOrderCntMsb = MIN_INT;
     1904  if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() )  )
     1905  {
     1906    //  When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1,
    19061907    //  the variables prevPicOrderCntLsb and prevPicOrderCntMsb are derived as follows:
    19071908
    1908     //  -  Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 
     1909    //  -  Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture,
    19091910    //     a RADL picture or an SLNR picture.
    19101911
    19111912    //  -  The variable prevPicOrderCntLsb is set equal to slice_pic_order_cnt_lsb of prevTid0Pic.
    1912     prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 
     1913    prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb;
    19131914
    19141915    //  -  The variable prevPicOrderCntMsb is set equal to PicOrderCntMsb of prevTid0Pic.
    1915     prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 
    1916   }
    1917 
    1918   //  The variable PicOrderCntMsb of the current picture is derived as follows: 
    1919  
     1916    prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb;
     1917  }
     1918
     1919  //  The variable PicOrderCntMsb of the current picture is derived as follows:
     1920
    19201921  Int slicePicOrderCntLsb = curSlice->getSlicePicOrderCntLsb();
    19211922
    1922   Int picOrderCntMsb; 
     1923  Int picOrderCntMsb;
    19231924
    19241925  if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag()  )
    19251926  {
    19261927    //-  If the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, PicOrderCntMsb is set equal to 0.
    1927     picOrderCntMsb = 0; 
     1928    picOrderCntMsb = 0;
    19281929  }
    19291930  else
    19301931  {
    1931     Int maxPicOrderCntLsb   = curSlice->getSPS()->getMaxPicOrderCntLsb(); 
     1932    Int maxPicOrderCntLsb   = curSlice->getSPS()->getMaxPicOrderCntLsb();
    19321933
    19331934  //  -  Otherwise, PicOrderCntMsb is derived as follows:
     
    19451946    else
    19461947    {
    1947       picOrderCntMsb = prevPicOrderCntMsb; 
    1948     }
    1949   }
    1950  
     1948      picOrderCntMsb = prevPicOrderCntMsb;
     1949    }
     1950  }
     1951
    19511952  //PicOrderCntVal is derived as follows:
    19521953  Int picOrderCntVal = picOrderCntMsb + slicePicOrderCntLsb; //   (8 2)
    19531954
    1954   //  NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 
     1955  //  NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR
    19551956  //  pictures and prevPicOrderCntLsb and prevPicOrderCntMsb are both set equal to 0.
    19561957
    1957   m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 
     1958  m_pcPic->getSlice(0)->setPOC( picOrderCntVal );
    19581959
    19591960  // Update prevTid0Pic
     
    19611962  if( curSlice->getTemporalId() == 0  && !m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() )
    19621963  {
    1963     m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb;     
    1964     m_prevTid0PicPicOrderCntMsb      = picOrderCntMsb; 
     1964    m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb;
     1965    m_prevTid0PicPicOrderCntMsb      = picOrderCntMsb;
    19651966  }
    19661967}
     
    19691970{
    19701971  //Output of this process is PicOrderCntVal, the picture order count of the current picture.
    1971   //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
     1972  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
    19721973  //  motion vector prediction and for decoder conformance checking (see clause F.13.5).
    19731974
    19741975  //  Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal.
    19751976
    1976   const TComSlice* slice = m_pcPic->getSlice(0); 
    1977   const Int nuhLayerId   = m_pcPic->getLayerId(); 
    1978   const TComVPS*   vps   = slice->getVPS(); 
    1979   const TComSPS*   sps   = slice->getSPS(); 
     1977  const TComSlice* slice = m_pcPic->getSlice(0);
     1978  const Int nuhLayerId   = m_pcPic->getLayerId();
     1979  const TComVPS*   vps   = slice->getVPS();
     1980  const TComSPS*   sps   = slice->getSPS();
    19801981  if ( m_pcPic->getIsFstPicOfAllLayOfPocResetPer() )
    19811982  {
    1982     //  When the current picture is the first picture among all layers of a POC resetting period, 
     1983    //  When the current picture is the first picture among all layers of a POC resetting period,
    19831984    //  the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive.
    19841985    for (Int i = 0; i <= 62; i++)
    19851986    {
    1986       m_pocDecrementedInDpbFlag[ i ] = 0; 
     1987      m_pocDecrementedInDpbFlag[ i ] = 0;
    19871988    }
    19881989  }
    19891990
    19901991  //  The variable pocResettingFlag is derived as follows:
    1991   Bool pocResettingFlag; 
     1992  Bool pocResettingFlag;
    19921993  if (m_pcPic->getIsPocResettingPic() )
    19931994  {
    1994     //-  If the current picture is a POC resetting picture, the following applies:   
     1995    //-  If the current picture is a POC resetting picture, the following applies:
    19951996    if( vps->getVpsPocLsbAlignedFlag()  )
    19961997    {
    19971998      //  -  If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1.
    1998       pocResettingFlag = true; 
     1999      pocResettingFlag = true;
    19992000    }
    20002001    else if ( m_pocDecrementedInDpbFlag[ nuhLayerId ] )
    20012002    {
    20022003      //  -  Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0.
    2003       pocResettingFlag = false; 
     2004      pocResettingFlag = false;
    20042005    }
    20052006    else
    20062007    {
    20072008      //  -  Otherwise, pocResettingFlag is set equal to 1.
    2008       pocResettingFlag = true; 
     2009      pocResettingFlag = true;
    20092010    }
    20102011  }
     
    20122013  {
    20132014    //  -  Otherwise, pocResettingFlag is set equal to 0.
    2014     pocResettingFlag = false; 
     2015    pocResettingFlag = false;
    20152016  }
    20162017
    20172018  //  The list affectedLayerList is derived as follows:
    2018   std::vector<Int> affectedLayerList; 
     2019  std::vector<Int> affectedLayerList;
    20192020  if (! vps->getVpsPocLsbAlignedFlag() )
    20202021  {
    20212022    //-  If vps_poc_lsb_aligned_flag is equal to 0, affectedLayerList consists of the nuh_layer_id of the current picture.
    2022     affectedLayerList.push_back( nuhLayerId ); 
     2023    affectedLayerList.push_back( nuhLayerId );
    20232024  }
    20242025  else
    20252026  {
    2026     //  -  Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 
    2027     //     equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 
     2027    //  -  Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values
     2028    //     equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1,
    20282029    //     inclusive, where currNuhLayerId is the nuh_layer_id value of the current picture.
    2029     affectedLayerList.push_back( nuhLayerId ); 
    2030     Int currNuhLayerId = nuhLayerId; 
     2030    affectedLayerList.push_back( nuhLayerId );
     2031    Int currNuhLayerId = nuhLayerId;
    20312032    for (Int j = 0; j <= vps->getNumPredictedLayers( currNuhLayerId )-1; j++ )
    20322033    {
     
    20342035    }
    20352036  }
    2036  
    2037   Int picOrderCntMsb; 
    2038   Int picOrderCntVal; 
     2037
     2038  Int picOrderCntMsb;
     2039  Int picOrderCntVal;
    20392040
    20402041  //  Depending on pocResettingFlag, the following applies:
     
    20452046    {
    20462047      //-  The variables pocMsbDelta, pocLsbDelta and DeltaPocVal are derived as follows:
    2047       Int pocMsbDelta; 
    2048       Int pocLsbDelta; 
    2049       Int deltaPocVal;       
    2050 
    2051       {
    2052         Int pocLsbVal; 
    2053         Int prevPicOrderCntLsb; 
    2054         Int prevPicOrderCntMsb; 
     2048      Int pocMsbDelta;
     2049      Int pocLsbDelta;
     2050      Int deltaPocVal;
     2051
     2052      {
     2053        Int pocLsbVal;
     2054        Int prevPicOrderCntLsb;
     2055        Int prevPicOrderCntMsb;
    20552056
    20562057        if( slice->getPocResetIdc() ==  3 )
    20572058        {
    2058           pocLsbVal = slice->getPocLsbVal(); 
    2059         }     
     2059          pocLsbVal = slice->getPocLsbVal();
     2060        }
    20602061        else
    20612062        {
    2062           pocLsbVal = slice->getSlicePicOrderCntLsb(); 
     2063          pocLsbVal = slice->getSlicePicOrderCntLsb();
    20632064        }
    20642065
     
    20662067        {
    20672068          pocMsbDelta = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();   // (F 60)
    2068         }     
    2069         else
    2070         {
    2071           prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
    2072           prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
    2073 
    2074           pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
    2075         }
    2076 
    2077         if( slice->getPocResetIdc() == 2 ||  ( slice->getPocResetIdc() == 3  &&  slice->getFullPocResetFlag() ) )
    2078         {
    2079           pocLsbDelta = pocLsbVal;
    20802069        }
    20812070        else
    20822071        {
    2083           pocLsbDelta = 0;
     2072          prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
     2073          prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
     2074
     2075          pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
    20842076        }
    2085         deltaPocVal = pocMsbDelta + pocLsbDelta;
    2086       }
    2087 
    2088       //-  The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0
     2077
     2078        if( slice->getPocResetIdc() == 2 ||  ( slice->getPocResetIdc() == 3  &&  slice->getFullPocResetFlag() ) )
     2079        {
     2080          pocLsbDelta = pocLsbVal;
     2081        }
     2082        else
     2083        {
     2084          pocLsbDelta = 0;
     2085        }
     2086        deltaPocVal = pocMsbDelta + pocLsbDelta;
     2087      }
     2088
     2089      //-  The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0
    20892090      //   and that is equal to any value in affectedLayerList is decremented by DeltaPocVal.
    20902091      for (Int i = 0; i < (Int) affectedLayerList.size(); i++ )
     
    20922093        if ( !m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] )
    20932094        {
    2094           m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 
     2095          m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal );
    20952096        }
    20962097      }
     
    20992100      for (Int i = 0; i < (Int) affectedLayerList.size(); i++ )
    21002101      {
    2101         m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 
    2102       }
    2103     } 
     2102        m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true;
     2103      }
     2104    }
    21042105
    21052106    //-  The PicOrderCntVal of the current picture is derived as follows:
    21062107    if( slice->getPocResetIdc()  ==  1 )
    21072108    {
    2108       picOrderCntVal = slice->getSlicePicOrderCntLsb(); 
    2109     }
    2110     else if (slice->getPocResetIdc()  ==  2 ) 
    2111     {
    2112       picOrderCntVal = 0; 
     2109      picOrderCntVal = slice->getSlicePicOrderCntLsb();
     2110    }
     2111    else if (slice->getPocResetIdc()  ==  2 )
     2112    {
     2113      picOrderCntVal = 0;
    21132114    }
    21142115    else
    21152116    {
    2116        picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 
    2117        picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
     2117       picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() );
     2118       picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
    21182119    }
    21192120  }
     
    21222123    //-  Otherwise (pocResettingFlag is equal to 0), the following applies:
    21232124    //-  The PicOrderCntVal of the current picture is derived as follows:
    2124    
     2125
    21252126    if( slice->getPocMsbCycleValPresentFlag() )
    21262127    {
    2127       picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 
     2128      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();
    21282129    }
    21292130    else if( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]  ||
     
    21312132    {
    21322133      picOrderCntMsb = 0; //     (F 62)
    2133     }   
     2134    }
    21342135    else
    21352136    {
    21362137        Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
    2137         Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 
    2138         picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 
    2139     }
    2140     picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
    2141   }
    2142  
    2143   m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 
    2144  
     2138        Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
     2139        picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
     2140    }
     2141    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
     2142  }
     2143
     2144  m_pcPic->getSlice(0)->setPOC( picOrderCntVal );
     2145
    21452146  for (Int lId = 0; lId < (Int) affectedLayerList.size(); lId++ )
    2146   { 
     2147  {
    21472148    //  The value of PrevPicOrderCnt[ lId ] for each of the lId values included in affectedLayerList is derived as follows:
    21482149
    21492150    if (!m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() && slice->getTemporalId() == 0 && !slice->getDiscardableFlag() )
    21502151    {
    2151       //-  If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 
     2152      //-  If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture
    21522153      //   has TemporalId equal to 0 and discardable_flag equal to 0, PrevPicOrderCnt[ lId ] is set equal to PicOrderCntVal.
    2153       m_prevPicOrderCnt = picOrderCntVal; 
     2154      m_prevPicOrderCnt = picOrderCntVal;
    21542155    }
    21552156    else if ( slice->getPocResetIdc() == 3 &&  (
    2156       ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 
    2157       ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 
     2157      ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) ||
     2158      ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() )
    21582159      ) )
    21592160    {
     
    21612162      //     -  FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0.
    21622163      //     -  FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is a POC resetting picture.
    2163       m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 
     2164      m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() );
    21642165    }
    21652166  }
     
    21682169Int TDecTop::xGetCurrMsb( Int cl, Int pl, Int pm, Int ml )
    21692170{
    2170   Int currMsb; 
     2171  Int currMsb;
    21712172  if ((pl - cl) >= (ml/ 2))
    21722173  {
     
    21752176  else if ( (cl - pl) > (ml / 2))
    21762177  {
    2177     currMsb = pm - ml; 
     2178    currMsb = pm - ml;
    21782179  }
    21792180  else
    21802181  {
    2181     currMsb = pm; 
    2182   }
    2183 
    2184   return currMsb; 
    2185 }   
     2182    currMsb = pm;
     2183  }
     2184
     2185  return currMsb;
     2186}
    21862187
    21872188
     
    21932194  ///////////////////////////////////////////////////////////////////////////////////////
    21942195
    2195   TComSlice* slice = m_pcPic->getSlice( 0 ); 
    2196   const TComSPS* sps = slice->getSPS(); 
    2197   //  This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 
    2198   //  to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 
    2199   //  This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 
     2196  TComSlice* slice = m_pcPic->getSlice( 0 );
     2197  const TComSPS* sps = slice->getSPS();
     2198  //  This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior
     2199  //  to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3.
     2200  //  This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or
    22002201  //  "used for long-term reference".
    22012202
    22022203  // The variable currPicLayerId is set equal to nuh_layer_id of the current picture.
    2203   Int currPicLayerId = m_pcPic->getLayerId(); 
    2204   Int picOrderCntVal = m_pcPic->getPOC(); 
     2204  Int currPicLayerId = m_pcPic->getLayerId();
     2205  Int picOrderCntVal = m_pcPic->getPOC();
    22052206
    22062207  if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag()  )
    2207   {     
    2208     // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 
    2209     // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 
     2208  {
     2209    // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1,
     2210    // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the
    22102211    // DPB (if any) are marked as "unused for reference".
    2211     m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 
    2212   }
    2213   // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 
     2212    m_dpb->markSubDpbAsUnusedForReference( currPicLayerId );
     2213  }
     2214  // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by
    22142215  // their PicOrderCntVal values or their slice_pic_order_cnt_lsb values.
    22152216
    2216   // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 
    2217   // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 
     2217  // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore,
     2218  // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll,
    22182219  // NumPocLtCurr and NumPocLtFoll number of elements, respectively. The five lists and the five variables are derived as follows:
    2219  
    2220   TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
     2220
     2221  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
    22212222
    22222223  std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore;
     
    22262227  std::vector<Int>& pocLtFoll       = decRps->m_pocLtFoll;
    22272228
    2228   Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 
     2229  Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore;
    22292230  Int& numPocStCurrAfter  = decRps->m_numPocStCurrAfter;
    22302231  Int& numPocStFoll       = decRps->m_numPocStFoll;
    22312232  Int& numPocLtCurr       = decRps->m_numPocLtCurr;
    2232   Int& numPocLtFoll       = decRps->m_numPocLtFoll;   
    2233 
    2234   std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 
     2233  Int& numPocLtFoll       = decRps->m_numPocLtFoll;
     2234
     2235  std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag;
    22352236
    22362237  if (m_pcPic->isIdr() )
    22372238  {
    2238     // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 
    2239     //   PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 
     2239    // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll,
     2240    //   PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore,
    22402241    //   NumPocStCurrAfter, NumPocStFoll, NumPocLtCurr and NumPocLtFoll are all set equal to 0.
    22412242
     
    22452246    pocLtCurr      .clear();
    22462247    pocLtFoll      .clear();
    2247     numPocStCurrBefore = 0; 
    2248     numPocStCurrAfter  = 0; 
    2249     numPocStFoll       = 0; 
    2250     numPocLtCurr       = 0; 
    2251     numPocLtFoll       = 0; 
     2248    numPocStCurrBefore = 0;
     2249    numPocStCurrAfter  = 0;
     2250    numPocStFoll       = 0;
     2251    numPocLtCurr       = 0;
     2252    numPocLtFoll       = 0;
    22522253  }
    22532254  else
     
    22562257    // -  Otherwise, the following applies:
    22572258
    2258     Int j = 0; 
    2259     Int k = 0; 
     2259    Int j = 0;
     2260    Int k = 0;
    22602261    for( Int i = 0; i < stRps->getNumNegativePicsVar() ; i++ )
    22612262    {
     
    22692270      }
    22702271    }
    2271     numPocStCurrBefore = j;   
    2272 
    2273     j = 0; 
     2272    numPocStCurrBefore = j;
     2273
     2274    j = 0;
    22742275    for (Int i = 0; i < stRps->getNumPositivePicsVar(); i++ )
    22752276    {
    22762277      if (stRps->getUsedByCurrPicS1Var( i ) )
    22772278      {
    2278         pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 
     2279        pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++;
    22792280      }
    22802281      else
     
    22872288
    22882289
    2289     j = 0; 
    2290     k = 0; 
     2290    j = 0;
     2291    k = 0;
    22912292    for( Int i = 0; i < slice->getNumLongTermSps( ) + slice->getNumLongTermPics(); i++ )
    22922293    {
    2293       Int pocLt = slice->getPocLsbLtVar( i ); 
     2294      Int pocLt = slice->getPocLsbLtVar( i );
    22942295      if( slice->getDeltaPocMsbPresentFlag( i ) )
    22952296      {
     
    22982299      }
    22992300
    2300       if( slice->getUsedByCurrPicLtVar(i)) 
     2301      if( slice->getUsedByCurrPicLtVar(i))
    23012302      {
    23022303        pocLtCurr.push_back( pocLt );
    2303         currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 
    2304       } 
     2304        currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++;
     2305      }
    23052306      else
    23062307      {
    23072308        pocLtFoll.push_back( pocLt );
    2308         follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 
     2309        follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++;
    23092310      }
    23102311    }
     
    23152316  assert(numPocStCurrAfter  == pocStCurrAfter   .size() );
    23162317  assert(numPocStCurrBefore == pocStCurrBefore  .size() );
    2317   assert(numPocStFoll       == pocStFoll        .size() ); 
    2318   assert(numPocLtCurr       == pocLtCurr        .size() ); 
     2318  assert(numPocStFoll       == pocStFoll        .size() );
     2319  assert(numPocLtCurr       == pocLtCurr        .size() );
    23192320  assert(numPocLtFoll       == pocLtFoll        .size() );
    23202321
    23212322  // where PicOrderCntVal is the picture order count of the current picture as specified in clause 8.3.1.
    23222323
    2323   //   NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 
    2324   //   indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 
    2325   //   where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 
    2326   //   in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 
     2324  //   NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive,
     2325  //   indicates that a candidate short-term RPS from the active SPS for the current layer is being used,
     2326  //   where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled
     2327  //   in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that
    23272328  //   the short-term RPS of the current picture is directly signalled in the slice header.
    23282329
    23292330  for (Int i = 0; i <= numPocLtCurr - 1; i++  )
    23302331  {
    2331       // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 
     2332      // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1,
    23322333      // it is a requirement of bitstream conformance that the following conditions apply:
    23332334    if ( currDeltaPocMsbPresentFlag[i] )
    23342335    {
    2335       // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
     2336      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
    23362337      //    for which PocLtCurr[ i ] is equal to PocStCurrBefore[ j ].
    23372338      for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
     
    23402341      }
    23412342
    2342       // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 
    2343       //    for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 
     2343      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive,
     2344      //    for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ].
    23442345      for (Int j = 0; j <= numPocStCurrAfter - 1; j++ )
    23452346      {
     
    23472348      }
    23482349
    2349       // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 
     2350      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive,
    23502351      //    for which PocLtCurr[ i ] is equal to PocStFoll[ j ].
    23512352      for (Int j = 0; j <= numPocStFoll - 1; j++ )
     
    23542355      }
    23552356
    2356       // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 
     2357      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive,
    23572358      //    where j is not equal to i, for which PocLtCurr[ i ] is equal to PocLtCurr[ j ].
    23582359      for (Int j = 0; j <= numPocLtCurr - 1; j++ )
    23592360      {
    23602361        if ( i != j )
    2361         {       
     2362        {
    23622363          assert(!( pocLtCurr[ i ] == pocLtCurr[ j ] ) );
    23632364        }
     
    23682369  for (Int i = 0; i <= numPocLtFoll - 1; i++  )
    23692370  {
    2370     // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 
     2371    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1,
    23712372    // it is a requirement of bitstream conformance that the following conditions apply:
    23722373    if ( follDeltaPocMsbPresentFlag[i] )
    23732374    {
    2374       // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
     2375      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
    23752376      //    for which PocLtFoll[ i ] is equal to PocStCurrBefore[ j ].
    23762377      for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
     
    23792380      }
    23802381
    2381       // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 
     2382      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive,
    23822383      //    for which PocLtFoll[ i ] is equal to PocStCurrAfter[ j ].
    23832384      for (Int j = 0; j <= numPocStCurrAfter - 1; j++ )
     
    23862387      }
    23872388
    2388       // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 
     2389      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive,
    23892390      //    for which PocLtFoll[ i ] is equal to PocStFoll[ j ].
    23902391      for (Int j = 0; j <= numPocStFoll - 1; j++ )
     
    23932394      }
    23942395
    2395       // -  There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 
     2396      // -  There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive,
    23962397      //    where j is not equal to i, for which PocLtFoll[ i ] is equal to PocLtFoll[ j ].
    23972398      for (Int j = 0; j <= numPocLtFoll - 1; j++ )
     
    24032404      }
    24042405
    2405       // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 
     2406      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive,
    24062407      //    for which PocLtFoll[ i ] is equal to PocLtCurr[ j ].
    24072408      for (Int j = 0; j <= numPocLtCurr - 1; j++ )
     
    24122413  }
    24132414
    2414   Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 
     2415  Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb();
    24152416  for (Int i = 0; i <= numPocLtCurr - 1; i++  )
    24162417  {
    2417     // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 
     2418    // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0,
    24182419    // it is a requirement of bitstream conformance that the following conditions apply:
    24192420    if ( currDeltaPocMsbPresentFlag[ i ] == 0  )
    24202421    {
    2421       // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
     2422      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
    24222423      //    for which PocLtCurr[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ).
    24232424      for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
     
    24542455  for (Int i = 0; i <= numPocLtFoll - 1; i++  )
    24552456  {
    2456     // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 
     2457    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0,
    24572458    // it is a requirement of bitstream conformance that the following conditions apply:
    24582459    if ( follDeltaPocMsbPresentFlag[ i ] == 0  )
     
    24862487        {
    24872488          assert(!( pocLtFoll[ i ] == ( pocLtFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) );
    2488         }         
     2489        }
    24892490      }
    24902491
     
    24992500
    25002501  if ( !annexFModifications )
    2501   { 
    2502     // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 
     2502  {
     2503    // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2.
    25032504
    25042505    // It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr:
     
    25062507    {
    25072508      // -  If the current picture is a BLA or CRA picture, the value of NumPicTotalCurr shall be equal to 0.
    2508       assert( slice->getNumPicTotalCurr() == 0 ); 
     2509      assert( slice->getNumPicTotalCurr() == 0 );
    25092510    }
    25102511    else
    25112512    {
    2512       // -  Otherwise, 
     2513      // -  Otherwise,
    25132514      if ( slice->isInterP() || slice->isInterB() )
    25142515      {
    25152516        // when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0.
    2516         assert( slice->getNumPicTotalCurr() != 0 ); 
    2517       }
    2518     }
    2519   }
    2520    
    2521   // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 
    2522   // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 
     2517        assert( slice->getNumPicTotalCurr() != 0 );
     2518      }
     2519    }
     2520  }
     2521
     2522  // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll,
     2523  // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively
    25232524  // referred to as the short-term RPS. RefPicSetLtCurr and RefPicSetLtFoll are collectively referred to as the long-term RPS.
    25242525
     
    25282529  std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr      ;
    25292530  std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll      ;
    2530  
     2531
    25312532  std::vector<TComPic*>** refPicSetsCurr       = decRps->m_refPicSetsCurr       ;
    25322533  std::vector<TComPic*>** refPicSetsLt         = decRps->m_refPicSetsLt         ;
    25332534  std::vector<TComPic*>** refPicSetsAll        = decRps->m_refPicSetsAll        ;
    2534   //   NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 
     2535  //   NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be
    25352536  //   used for inter prediction of the current picture and one or more pictures that follow the current picture in decoding order.
    2536   //   RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 
     2537  //   RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current
    25372538  //   picture but may be used in inter prediction for one or more pictures that follow the current picture in decoding order.
    25382539
     
    25402541  // 1.  The following applies:
    25412542
    2542   TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false );   
     2543  TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false );
    25432544  assert( refPicSetLtCurr.empty() );
    2544   for( Int i = 0; i < numPocLtCurr; i++ ) 
    2545   {
    2546     if( !currDeltaPocMsbPresentFlag[ i ] ) 
    2547     {   
    2548       refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) );       
     2545  for( Int i = 0; i < numPocLtCurr; i++ )
     2546  {
     2547    if( !currDeltaPocMsbPresentFlag[ i ] )
     2548    {
     2549      refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) );
    25492550    }
    25502551    else
    25512552    {
    2552       refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] ));       
    2553     }   
     2553      refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] ));
     2554    }
    25542555  }
    25552556
     
    25632564   else
    25642565   {
    2565      refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] ));       
     2566     refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] ));
    25662567   }
    25672568  }
    2568  
    2569   // 2.  All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 
     2569
     2570  // 2.  All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal
    25702571  //     to currPicLayerId are marked as "used for long-term reference".
    25712572  for (Int i = 0; i < numPocLtCurr; i++)
     
    25732574    if ( refPicSetLtCurr[i] != NULL )
    25742575    {
    2575       refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 
    2576     }   
     2576      refPicSetLtCurr[i]->markAsUsedForLongTermReference();
     2577    }
    25772578  }
    25782579
     
    25812582    if ( refPicSetLtFoll[i] != NULL )
    25822583    {
    2583       refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 
    2584     }   
     2584      refPicSetLtFoll[i]->markAsUsedForLongTermReference();
     2585    }
    25852586  }
    25862587
     
    25892590  for( Int i = 0; i < numPocStCurrBefore; i++ )
    25902591  {
    2591     refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 
     2592    refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] ));
    25922593  }
    25932594
     
    25952596  for( Int i = 0; i < numPocStCurrAfter; i++ )
    25962597  {
    2597     refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 
     2598    refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] ));
    25982599  }
    25992600
     
    26012602  for( Int i = 0; i < numPocStFoll; i++ )
    26022603  {
    2603     refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 
    2604   }
    2605  
    2606   // 4.  All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 
     2604    refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] ));
     2605  }
     2606
     2607  // 4.  All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore,
    26072608  //     RefPicSetStCurrAfter, or RefPicSetStFoll and have nuh_layer_id equal to currPicLayerId are marked as "unused for reference".
    2608   TComSubDpb picsToMark = (*dpb); 
     2609  TComSubDpb picsToMark = (*dpb);
    26092610  for (Int j = 0; j < 5; j++ )
    26102611  {
    2611     picsToMark.removePics( *refPicSetsAll[j] ); 
    2612   } 
    2613   picsToMark.markAllAsUnusedForReference(); 
    2614  
    2615   //     NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 
    2616   //     the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 
    2617   //     to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 
     2612    picsToMark.removePics( *refPicSetsAll[j] );
     2613  }
     2614  picsToMark.markAllAsUnusedForReference();
     2615
     2616  //     NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because
     2617  //     the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal
     2618  //     to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in
    26182619  //     RefPicSetStCurrBefore, RefPicSetStCurrAfter, or RefPicSetLtCurr that is equal to "no reference picture".
    26192620
    26202621  //     NOTE 5 - A picture cannot be included in more than one of the five RPS lists.
    26212622
    2622  
     2623
    26232624  // It is a requirement of bitstream conformance that the RPS is restricted as follows:
    26242625
     
    26262627#if NH_MV_FIX_NO_REF_PICS_CHECK
    26272628  if ( !annexFModifications || m_firstPicInLayerDecodedFlag[ m_pcPic->getLayerId() ] )
    2628   { 
     2629  {
    26292630#endif
    26302631    for (Int j = 0; j < 3; j++ )
    26312632    {
    2632       // -  There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 
     2633      // -  There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr
    26332634      //    for which one or more of the following are true:
    26342635
    2635       std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 
     2636      std::vector<TComPic*>* currSet = refPicSetsCurr[j];
    26362637      for (Int i = 0; i < currSet->size(); i++)
    26372638      {
    2638         TComPic* pic = (*currSet)[i]; 
     2639        TComPic* pic = (*currSet)[i];
    26392640
    26402641        // -  The entry is equal to "no reference picture".
    2641         assert( ! (pic == NULL ) ); 
     2642        assert( ! (pic == NULL ) );
    26422643
    26432644        // -  The entry is an SLNR picture and has TemporalId equal to that of the current picture.
    2644         assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 
     2645        assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) );
    26452646
    26462647        // -  The entry is a picture that has TemporalId greater than that of the current picture.
    2647         assert( !(  pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 
    2648       }     
     2648        assert( !(  pic->getTemporalId() > m_pcPic->getTemporalId() ) );
     2649      }
    26492650    }
    26502651#if NH_MV_FIX_NO_REF_PICS_CHECK
    26512652  }
    26522653#endif
    2653  
    2654   //  -  There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 
    2655   //     difference between the picture order count value of the current picture and the picture order count 
     2654
     2655  //  -  There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the
     2656  //     difference between the picture order count value of the current picture and the picture order count
    26562657  //     value of the entry is greater than or equal to 2^24.
    26572658  for (Int j = 0; j < 2; j++ )
    2658   {   
    2659     std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 
     2659  {
     2660    std::vector<TComPic*>* ltSet = refPicSetsLt[j];
    26602661    for (Int i = 0; i < ltSet->size(); i++)
    26612662    {
    2662       TComPic* pic = (*ltSet)[i]; 
     2663      TComPic* pic = (*ltSet)[i];
    26632664      if( pic != NULL )
    26642665      {
    2665         assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 
    2666       }
    2667     }
    2668   }
    2669 
    2670   //   -  When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 
     2666        assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) ));
     2667      }
     2668    }
     2669  }
     2670
     2671  //   -  When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture
    26712672  //      included in the RPS with TemporalId greater than or equal to the TemporalId of the current picture.
    26722673  if (m_pcPic->isTsa() )
    26732674  {
    26742675    for (Int j = 0; j < 5; j++ )
    2675     {   
    2676       std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
     2676    {
     2677      std::vector<TComPic*>* aSet = refPicSetsAll[j];
    26772678      for (Int i = 0; i < aSet->size(); i++)
    26782679      {
    2679         TComPic* pic = (*aSet)[i]; 
     2680        TComPic* pic = (*aSet)[i];
    26802681        if( pic != NULL )
    26812682        {
    2682           assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 
     2683          assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) );
    26832684        }
    26842685      }
     
    26862687  }
    26872688
    2688   //   -  When the current picture is a step-wise temporal sub-layer access (STSA) picture, 
     2689  //   -  When the current picture is a step-wise temporal sub-layer access (STSA) picture,
    26892690  //      there shall be no picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr that has
    26902691  //      TemporalId equal to that of the current picture.
     
    26922693  {
    26932694    for (Int j = 0; j < 3; j++ )
    2694     {   
    2695       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     2695    {
     2696      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    26962697      for (Int i = 0; i < cSet->size(); i++)
    26972698      {
    2698         TComPic* pic = (*cSet)[i]; 
     2699        TComPic* pic = (*cSet)[i];
    26992700        if( pic != NULL )
    27002701        {
    2701           assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 
     2702          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) );
    27022703        }
    27032704      }
     
    27122713  {
    27132714    for (Int j = 0; j < 3; j++ )
    2714     {   
    2715       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     2715    {
     2716      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    27162717      for (Int i = 0; i < cSet->size(); i++)
    27172718      {
    2718         TComPic* pic = (*cSet)[i]; 
     2719        TComPic* pic = (*cSet)[i];
    27192720        if( pic != NULL )
    27202721        {
    2721           assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder  ) ); 
     2722          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder  ) );
    27222723        }
    27232724      }
    27242725    }
    27252726  }
    2726  
     2727
    27272728  //   -  When the current picture is a CRA picture, there shall be no picture included in the RPS that
    27282729  //      precedes, in output order or decoding order, any preceding IRAP picture in decoding order (when present).
     
    27302731  {
    27312732    for (Int j = 0; j < 5; j++ )
    2732     {   
    2733       std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
     2733    {
     2734      std::vector<TComPic*>* aSet = refPicSetsAll[j];
    27342735      for (Int i = 0; i < aSet->size(); i++)
    27352736      {
    27362737        // TBD check whether it sufficient to test only the last IRAP
    2737         TComPic* pic = (*aSet)[i]; 
     2738        TComPic* pic = (*aSet)[i];
    27382739        if( pic != NULL )
    2739         {       
    2740           assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );           
    2741           assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
     2740        {
     2741          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );
     2742          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
    27422743        }
    27432744      }
    27442745    }
    27452746  }
    2746  
     2747
    27472748  Bool isTrailingPicture = ( !m_pcPic->isIrap() ) && ( m_pcPic->getPOC() > m_prevIrapPoc );
    27482749  //   -  When the current picture is a trailing picture, there shall be no picture in RefPicSetStCurrBefore,
     
    27522753  {
    27532754    for (Int j = 0; j < 3; j++ )
    2754     {   
    2755       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     2755    {
     2756      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    27562757      for (Int i = 0; i < cSet->size(); i++)
    27572758      {
    2758         TComPic* pic = (*cSet)[i]; 
     2759        TComPic* pic = (*cSet)[i];
    27592760        if( pic != NULL )
    27602761        {
    2761           assert( ! (pic->getIsGeneratedCl833() ) ); 
     2762          assert( ! (pic->getIsGeneratedCl833() ) );
    27622763        }
    27632764      }
     
    27702771  {
    27712772    for (Int j = 0; j < 5; j++ )
    2772     {   
    2773       std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
     2773    {
     2774      std::vector<TComPic*>* aSet = refPicSetsAll[j];
    27742775      for (Int i = 0; i < aSet->size(); i++)
    27752776      {
    27762777        // TBD check whether it sufficient to test only the last IRAP
    2777          TComPic* pic = (*aSet)[i]; 
     2778         TComPic* pic = (*aSet)[i];
    27782779        if( pic != NULL )
    2779         {         
    2780           assert( ! (pic->getPOC()           < m_prevIrapPoc           ) ); 
    2781           assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
     2780        {
     2781          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );
     2782          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
    27822783        }
    27832784      }
     
    27902791  {
    27912792    for (Int j = 0; j < 3; j++ )
    2792     {   
    2793       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     2793    {
     2794      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    27942795      for (Int i = 0; i < cSet->size(); i++)
    2795       {       
    2796         TComPic* pic = (*cSet)[i]; 
     2796      {
     2797        TComPic* pic = (*cSet)[i];
    27972798        if( pic != NULL )
    2798         {       
     2799        {
    27992800          // -  A RASL picture
    2800           assert( ! (pic->isRasl() ) ); 
    2801           // -  A picture that was generated by the decoding process for generating unavailable reference pictures 
     2801          assert( ! (pic->isRasl() ) );
     2802          // -  A picture that was generated by the decoding process for generating unavailable reference pictures
    28022803          //    as specified in clause 8.3.3
    2803           assert( ! (pic->getIsGeneratedCl833() ) ); 
     2804          assert( ! (pic->getIsGeneratedCl833() ) );
    28042805          // -  A picture that precedes the associated IRAP picture in decoding order
    2805           assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
     2806          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
    28062807        }
    28072808      }
    28082809    }
    28092810  }
    2810  
    2811  
     2811
     2812
    28122813  if ( sps->getTemporalIdNestingFlag() )
    28132814  {
    28142815    // -  When sps_temporal_id_nesting_flag is equal to 1, the following applies:
    28152816    //    -  Let tIdA be the value of TemporalId of the current picture picA.
    2816     TComPic* picA = m_pcPic; 
     2817    TComPic* picA = m_pcPic;
    28172818    Int      tIdA = picA->getTemporalId();
    2818     //   -  Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 
    2819     //      RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 
     2819    //   -  Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in
     2820    //      RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that
    28202821    //      has TemporalId less than tIdB, follows picB in decoding order, and precedes picA in decoding order.
    28212822    for (Int j = 0; j < 3; j++ )
    2822     {   
    2823       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     2823    {
     2824      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    28242825      for (Int i = 0; i < cSet->size(); i++)
    28252826      {
    2826         TComPic* picB = (*cSet)[i]; 
     2827        TComPic* picB = (*cSet)[i];
    28272828        if( picB != NULL )
    28282829        {
    2829           Int tIdB = picB->getTemporalId(); 
     2830          Int tIdB = picB->getTemporalId();
    28302831
    28312832          if (tIdB <= tIdA)
     
    28332834            for ( TComSubDpb::iterator itP = dpb->begin(); itP != dpb->end(); itP++ )
    28342835            {
    2835               TComPic* picC = (*itP); 
    2836               assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder()  )  ); 
     2836              TComPic* picC = (*itP);
     2837              assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder()  )  );
    28372838            }
    28382839          }
     
    28402841      }
    28412842    }
    2842   }   
     2843  }
    28432844}
    28442845
     
    28512852
    28522853  // The specifications in clause 8.3.2 apply with the following changes:
    2853   // -  The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 
     2854  // -  The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to
    28542855  //    clauses F.7.4.7.2, F.8.3.1, F.8.3.3 and F.8.3.4, respectively.
    28552856
    2856   x832DecProcForRefPicSet( true ); 
     2857  x832DecProcForRefPicSet( true );
    28572858
    28582859  // -  The following specifications are added:
    28592860  if (m_pcPic->isIrap() && m_pcPic->getLayerId() == m_smallestLayerId )
    28602861  {
    2861     // -  When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 
    2862     //    all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 
     2862    // -  When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId,
     2863    //    all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked
    28632864    //    as "unused for reference" when at least one of the following conditions is true:
    28642865
     
    28722873
    28732874  // -  It is a requirement of bitstream conformance that the RPS is restricted as follows:
    2874   // -  When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 
     2875  // -  When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter
    28752876  //    or RefPicSetLtCurr.
    28762877
     
    28792880  if ( m_pcPic->isCra() )
    28802881  {
    2881     for (Int j = 0; j < 3; j++ )   
    2882     {   
    2883       std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
    2884       assert ( cSet->size() == 0 ); 
     2882    for (Int j = 0; j < 3; j++ )
     2883    {
     2884      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
     2885      assert ( cSet->size() == 0 );
    28852886    }
    28862887  }
     
    28882889  // -  The constraints specified in clause 8.3.2 on the value of NumPicTotalCurr are replaced with the following:
    28892890  //    -  It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr:
    2890   Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 
    2891   Int currPicLayerId  = m_pcPic->getLayerId(); 
    2892   const TComVPS* vps  = m_pcPic->getSlice(0)->getVPS(); 
     2891  Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr();
     2892  Int currPicLayerId  = m_pcPic->getLayerId();
     2893  const TComVPS* vps  = m_pcPic->getSlice(0)->getVPS();
    28932894
    28942895  if ( ( m_pcPic->isBla() || m_pcPic->isCra() ) && (  (currPicLayerId == 0 ) || ( vps->getNumDirectRefLayers( currPicLayerId ) == 0 ) ) )
    2895   {   
    2896     assert( numPicTotalCurr == 0 ); 
    2897     // -  If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 
     2896  {
     2897    assert( numPicTotalCurr == 0 );
     2898    // -  If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or
    28982899    //     NumDirectRefLayers[ currPicLayerId ] is equal to 0, the value of NumPicTotalCurr shall be equal to 0.
    28992900  }
     
    29042905    {
    29052906      // -  Otherwise, when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0.
    2906       assert( numPicTotalCurr != 0 ); 
     2907      assert( numPicTotalCurr != 0 );
    29072908    }
    29082909  }
     
    29162917  ////////////////////////////////////////////////////////////////////
    29172918
    2918   // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 
     2919  // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1
    29192920  // and the variables NumActiveRefLayerPics0 and NumActiveRefLayerPics1.
    29202921
    2921   TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
    2922   TComSlice* slice       = m_pcPic->getSlice( 0 ); 
    2923   const TComVPS* vps     =  slice->getVPS(); 
     2922  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
     2923  TComSlice* slice       = m_pcPic->getSlice( 0 );
     2924  const TComVPS* vps     =  slice->getVPS();
    29242925
    29252926  Int&                   numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0;
     
    29272928
    29282929  std::vector<TComPic*>& refPicSetInterLayer0   = decRps->m_refPicSetInterLayer0;
    2929   std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1; 
     2930  std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1;
    29302931
    29312932  // The variable currLayerId is set equal to nuh_layer_id of the current picture.
    2932   Int currLayerId = getLayerId(); 
    2933 
    2934   // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 
     2933  Int currLayerId = getLayerId();
     2934
     2935  // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1
    29352936  // are set equal to 0 and the following applies:
    29362937
    2937   refPicSetInterLayer0.clear(); 
    2938   refPicSetInterLayer1.clear(); 
    2939 
    2940   numActiveRefLayerPics0 = 0; 
    2941   numActiveRefLayerPics1 = 0; 
    2942 
    2943   Int viewIdCurrLayerId  = vps->getViewId( currLayerId ); 
     2938  refPicSetInterLayer0.clear();
     2939  refPicSetInterLayer1.clear();
     2940
     2941  numActiveRefLayerPics0 = 0;
     2942  numActiveRefLayerPics1 = 0;
     2943
     2944  Int viewIdCurrLayerId  = vps->getViewId( currLayerId );
    29442945  Int viewId0            = vps->getViewId( 0   );
    29452946
    2946   for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ )   
    2947   {
    2948     Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 
     2947  for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ )
     2948  {
     2949    Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) );
    29492950
    29502951    Bool refPicSet0Flag =
     
    29562957    {
    29572958      // there is a picture picX in the DPB that is in the same access unit as the current picture and has
    2958       // nuh_layer_id equal to RefPicLayerId[ i ] 
     2959      // nuh_layer_id equal to RefPicLayerId[ i ]
    29592960
    29602961      if ( refPicSet0Flag )
     
    29722973      assert( ! picX->getSlice(0)->getDiscardableFlag() );
    29732974
    2974       // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 
     2975      // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1
    29752976      // that is a RASL picture.
    29762977      if ( m_pcPic->isRadl() )
     
    30043005  ///////////////////////////////////////////////////////////////////////////////////////
    30053006
    3006   // This process is invoked once per coded picture when the current picture is a 
     3007  // This process is invoked once per coded picture when the current picture is a
    30073008  // BLA picture or is a CRA picture with NoRaslOutputFlag equal to 1.
    30083009
    30093010  assert( m_pcPic->isBla() || (m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) );
    3010   TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
     3011  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
    30113012
    30123013  std::vector<TComPic*>& refPicSetStFoll      = decRps->m_refPicSetStFoll;
    3013   std::vector<TComPic*>& refPicSetLtFoll      = decRps->m_refPicSetLtFoll; 
     3014  std::vector<TComPic*>& refPicSetLtFoll      = decRps->m_refPicSetLtFoll;
    30143015
    30153016  const std::vector<Int>& pocStFoll             = decRps->m_pocStFoll;
     
    30173018
    30183019  const Int               numPocStFoll          = decRps->m_numPocStFoll;
    3019   const Int               numPocLtFoll          = decRps->m_numPocLtFoll;   
     3020  const Int               numPocLtFoll          = decRps->m_numPocLtFoll;
    30203021
    30213022  // When this process is invoked, the following applies:
     
    30243025    if ( refPicSetStFoll[ i ] == NULL )
    30253026    {
    3026       //-  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 
     3027      //-  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal
    30273028      //   to "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies:
    3028       TComPic* genPic = x8332GenOfOneUnavailPic( true ); 
     3029      TComPic* genPic = x8332GenOfOneUnavailPic( true );
    30293030
    30303031      // -  The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ].
    30313032      genPic->getSlice(0)->setPOC( pocStFoll[ i ] );
    30323033
    3033       //-  The value of PicOutputFlag for the generated picture is set equal to 0. 
    3034       genPic->setPicOutputFlag( false ); 
     3034      //-  The value of PicOutputFlag for the generated picture is set equal to 0.
     3035      genPic->setPicOutputFlag( false );
    30353036
    30363037      // -  The generated picture is marked as "used for short-term reference".
     
    30413042
    30423043      // -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture.
    3043       genPic->setLayerId( m_pcPic-> getLayerId() ); 
     3044      genPic->setLayerId( m_pcPic-> getLayerId() );
    30443045
    30453046      // Insert to DPB
    3046       m_dpb->addNewPic( genPic ); 
     3047      m_dpb->addNewPic( genPic );
    30473048    }
    30483049  }
     
    30523053    if ( refPicSetLtFoll[ i ] == NULL )
    30533054    {
    3054       //-  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 
     3055      //-  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to
    30553056      //   "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies:
    3056       TComPic* genPic = x8332GenOfOneUnavailPic( true ); 
     3057      TComPic* genPic = x8332GenOfOneUnavailPic( true );
    30573058
    30583059      //-  The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ].
     
    30603061
    30613062      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtFoll[ i ] & ( MaxPicOrderCntLsb - 1 ) ).
    3062       genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 
    3063 
    3064       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.   
    3065       genPic->setPicOutputFlag( false ); 
     3063      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) );
     3064
     3065      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
     3066      genPic->setPicOutputFlag( false );
    30663067
    30673068      //  -  The generated picture is marked as "used for long-term reference".
     
    30723073
    30733074      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture.
    3074       genPic->setLayerId( m_pcPic-> getLayerId() ); 
     3075      genPic->setLayerId( m_pcPic-> getLayerId() );
    30753076
    30763077      // Insert to DPB
    3077       m_dpb->addNewPic( genPic ); 
     3078      m_dpb->addNewPic( genPic );
    30783079    }
    30793080  }
     
    30873088  ///////////////////////////////////////////////////////////////////////////////////////
    30883089
    3089   TComPic* genPic = new TComPic; 
    3090   genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 
    3091   genPic->setIsGenerated( true );     
    3092   genPic->setIsGeneratedCl833( calledFromCl8331 ); 
     3090  TComPic* genPic = new TComPic;
     3091  genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true );
     3092  genPic->setIsGenerated( true );
     3093  genPic->setIsGeneratedCl833( calledFromCl8331 );
    30933094  return genPic;
    30943095}
     
    30983099{
    30993100  ///////////////////////////////////////////////////////////////////////////////////////
    3100   // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 
     3101  // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures
    31013102  //         first in decoding order within a layer
    31023103  ///////////////////////////////////////////////////////////////////////////////////////
    31033104
    3104   //  This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0.   
     3105  //  This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0.
    31053106  assert( !m_firstPicInLayerDecodedFlag[ getLayerId() ] );
    31063107
    31073108
    3108   TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
    3109 
    3110   std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 
     3109  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
     3110
     3111  std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore;
    31113112  std::vector<TComPic*>& refPicSetStCurrAfter  = decRps->m_refPicSetStCurrAfter;
    31123113  std::vector<TComPic*>& refPicSetStFoll       = decRps->m_refPicSetStFoll;
    3113   std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr; 
    3114   std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll; 
     3114  std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr;
     3115  std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll;
    31153116
    31163117
     
    31213122  const std::vector<Int>& pocLtFoll            = decRps->m_pocLtFoll;
    31223123
    3123   const Int numPocStCurrBefore                 = decRps->m_numPocStCurrBefore; 
     3124  const Int numPocStCurrBefore                 = decRps->m_numPocStCurrBefore;
    31243125  const Int numPocStCurrAfter                  = decRps->m_numPocStCurrAfter;
    31253126  const Int numPocStFoll                       = decRps->m_numPocStFoll;
    31263127  const Int numPocLtCurr                       = decRps->m_numPocLtCurr;
    3127   const Int numPocLtFoll                       = decRps->m_numPocLtFoll;   
    3128 
    3129   Int nuhLayerId = m_pcPic-> getLayerId(); 
     3128  const Int numPocLtFoll                       = decRps->m_numPocLtFoll;
     3129
     3130  Int nuhLayerId = m_pcPic-> getLayerId();
    31303131  for ( Int i = 0 ; i <= numPocStCurrBefore - 1; i++ )
    31313132  {
    31323133    if ( refPicSetStCurrBefore[ i ] == NULL )
    31333134    {
    3134       //-  For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 
     3135      //-  For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is
    31353136      //  equal to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
    3136       TComPic* genPic = x8332GenOfOneUnavailPic( false ); 
     3137      TComPic* genPic = x8332GenOfOneUnavailPic( false );
    31373138
    31383139      //-  The value of PicOrderCntVal for the generated picture is set equal to PocStCurrBefore[ i ].
     
    31403141
    31413142      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
    3142       genPic->setPicOutputFlag( false ); 
     3143      genPic->setPicOutputFlag( false );
    31433144
    31443145      //  -  The generated picture is marked as "used for short-term reference".
     
    31493150
    31503151      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
    3151       genPic->setLayerId( nuhLayerId ); 
     3152      genPic->setLayerId( nuhLayerId );
    31523153
    31533154      // Insert to DPB
    3154       m_dpb->addNewPic( genPic ); 
     3155      m_dpb->addNewPic( genPic );
    31553156    }
    31563157  }
     
    31603161    if ( refPicSetStCurrAfter[ i ] == NULL )
    31613162    {
    3162       //  -  For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 
     3163      //  -  For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal
    31633164      //     to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
    3164       TComPic* genPic = x8332GenOfOneUnavailPic( false ); 
     3165      TComPic* genPic = x8332GenOfOneUnavailPic( false );
    31653166
    31663167      //  -  The value of PicOrderCntVal for the generated picture is set equal to PocStCurrAfter[ i ].
     
    31683169
    31693170      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
    3170       genPic->setPicOutputFlag( false ); 
     3171      genPic->setPicOutputFlag( false );
    31713172
    31723173      //  -  The generated picture is marked as "used for short-term reference".
     
    31773178
    31783179      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
    3179       genPic->setLayerId( nuhLayerId ); 
     3180      genPic->setLayerId( nuhLayerId );
    31803181
    31813182      // Insert to DPB
    3182       m_dpb->addNewPic( genPic ); 
     3183      m_dpb->addNewPic( genPic );
    31833184
    31843185    }
     
    31893190    if ( refPicSetStFoll[ i ] == NULL )
    31903191    {
    3191       //  -  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 
     3192      //  -  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no
    31923193      //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
    3193       TComPic* genPic = x8332GenOfOneUnavailPic( false ); 
     3194      TComPic* genPic = x8332GenOfOneUnavailPic( false );
    31943195
    31953196      //  -  The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ].
     
    31973198
    31983199      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
    3199       genPic->setPicOutputFlag( false ); 
     3200      genPic->setPicOutputFlag( false );
    32003201
    32013202      //  -  The generated picture is marked as "used for short-term reference".
     
    32063207
    32073208      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
    3208       genPic->setLayerId( nuhLayerId ); 
     3209      genPic->setLayerId( nuhLayerId );
    32093210
    32103211      // Insert to DPB
    3211       m_dpb->addNewPic( genPic ); 
    3212     }
    3213   }
    3214 
    3215   Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 
     3212      m_dpb->addNewPic( genPic );
     3213    }
     3214  }
     3215
     3216  Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb();
    32163217  for ( Int i = 0 ; i <= numPocLtCurr - 1; i++ )
    32173218  {
    32183219    if ( refPicSetLtCurr[ i ] == NULL )
    32193220    {
    3220       //  -  For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 
     3221      //  -  For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no
    32213222      //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
    3222       TComPic* genPic = x8332GenOfOneUnavailPic( false ); 
     3223      TComPic* genPic = x8332GenOfOneUnavailPic( false );
    32233224
    32243225      //  -  The value of PicOrderCntVal for the generated picture is set equal to PocLtCurr[ i ].
    32253226      genPic->getSlice(0)->setPOC( pocLtCurr[ i ] );
    32263227
    3227       //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 
     3228      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & (
    32283229      //     MaxPicOrderCntLsb - 1 ) ).
    3229       genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 
     3230      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) );
    32303231
    32313232      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
    3232       genPic->setPicOutputFlag( false ); 
     3233      genPic->setPicOutputFlag( false );
    32333234
    32343235      //  -  The generated picture is marked as "used for long-term reference".
     
    32393240
    32403241      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
    3241       genPic->setLayerId( nuhLayerId ); 
     3242      genPic->setLayerId( nuhLayerId );
    32423243
    32433244      // Insert to DPB
    3244       m_dpb->addNewPic( genPic ); 
     3245      m_dpb->addNewPic( genPic );
    32453246    }
    32463247  }
     
    32503251    if ( refPicSetLtFoll[ i ] == NULL )
    32513252    {
    3252       //  -  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 
     3253      //  -  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no
    32533254      //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
    3254       TComPic* genPic = x8332GenOfOneUnavailPic( false ); 
     3255      TComPic* genPic = x8332GenOfOneUnavailPic( false );
    32553256
    32563257      //  -  The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ].
    32573258      genPic->getSlice(0)->setPOC( pocLtFoll[ i ] );
    32583259
    3259       //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 
     3260      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & (
    32603261      //     MaxPicOrderCntLsb - 1 ) ).
    3261       genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 
     3262      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) );
    32623263
    32633264      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
    3264       genPic->setPicOutputFlag( false ); 
     3265      genPic->setPicOutputFlag( false );
    32653266
    32663267      //  -  The generated picture is marked as "used for long-term reference".
     
    32713272
    32723273      //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
    3273       genPic->setLayerId( nuhLayerId ); 
     3274      genPic->setLayerId( nuhLayerId );
    32743275
    32753276      // Insert to DPB
    3276       m_dpb->addNewPic( genPic ); 
     3277      m_dpb->addNewPic( genPic );
    32773278    }
    32783279  }
     
    32923293  std::vector<TComPic*>** refPicSetsCurr       = m_pcPic->getDecodedRps()->m_refPicSetsCurr;
    32933294
    3294   Bool hasGeneratedRefPic = false; 
    3295   for (Int j = 0; j < 3; j++ )   
    3296   {   
    3297     std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
     3295  Bool hasGeneratedRefPic = false;
     3296  for (Int j = 0; j < 3; j++ )
     3297  {
     3298    std::vector<TComPic*>* cSet = refPicSetsCurr[j];
    32983299    for (Int i = 0 ; i < cSet->size();  i++ )
    32993300    {
     
    33013302      if ((*cSet)[i]->getIsGenerated() )
    33023303      {
    3303         hasGeneratedRefPic = true; 
    3304       }
    3305     }
    3306   }
    3307   m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 
     3304        hasGeneratedRefPic = true;
     3305      }
     3306    }
     3307  }
     3308  m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic );
    33083309}
    33093310
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/SEIwrite.cpp

    r1344 r1349  
    132132   case SEI::LAYERS_NOT_PRESENT:
    133133       xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
    134      break; 
     134     break;
    135135#endif
    136136   case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
    137137     xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
    138      break; 
     138     break;
    139139#if NH_MV_SEI_TBD
    140140   case SEI::BSP_NESTING:
    141141     xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei));
    142      break; 
     142     break;
    143143   case SEI::BSP_INITIAL_ARRIVAL_TIME:
    144144     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei));
    145      break; 
     145     break;
    146146#endif
    147147   case SEI::SUB_BITSTREAM_PROPERTY:
    148148     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
    149      break; 
     149     break;
    150150   case SEI::ALPHA_CHANNEL_INFO:
    151151     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
     
    153153   case SEI::OVERLAY_INFO:
    154154     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
    155      break; 
     155     break;
    156156   case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
    157157     xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei));
    158      break; 
     158     break;
    159159#if NH_MV_SEI_TBD
    160160   case SEI::FRAME_FIELD_INFO:
    161161     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
    162      break; 
     162     break;
    163163#endif
    164164   case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
    165165     xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei));
    166      break; 
     166     break;
    167167#if SEI_DRI_F0169
    168168   case SEI::DEPTH_REPRESENTATION_INFO:
    169169       xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei));
    170170       break;
    171 #endif 
     171#endif
    172172   case SEI::MULTIVIEW_SCENE_INFO:
    173173     xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei));
    174      break; 
     174     break;
    175175   case SEI::MULTIVIEW_ACQUISITION_INFO:
    176176     xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei));
    177      break; 
     177     break;
    178178
    179179   case SEI::MULTIVIEW_VIEW_POSITION:
    180180     xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei));
    181      break; 
     181     break;
    182182#if NH_3D
    183183   case SEI::ALTERNATIVE_DEPTH_INFO:
    184184     xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei));
    185      break; 
     185     break;
    186186#endif
    187187#endif
     
    307307  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
    308308  {
    309     WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 
     309    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
    310310  }
    311311}
     
    445445{
    446446  WRITE_FLAG( sei.m_arrangementCancelFlag,          "segmented_rect_frame_packing_arrangement_cancel_flag" );
    447   if( sei.m_arrangementCancelFlag == 0 ) 
     447  if( sei.m_arrangementCancelFlag == 0 )
    448448  {
    449449    WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" );
     
    614614{
    615615  //UInt code;
    616   WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 
     616  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag");
    617617  WRITE_FLAG((sei.m_each_tile_one_tile_set_flag                ? 1 : 0), "each_tile_one_tile_set_flag"               );
    618618
     
    629629
    630630        if(sei.m_limited_tile_set_display_flag)
    631         { 
    632           WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 
    633         }
    634 
    635         WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 
    636        
     631        {
     632          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");
     633        }
     634
     635        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1");
     636
    637637        for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++)
    638638        {
    639           WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index"); 
    640           WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 
     639          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");
     640          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");
    641641        }
    642642
    643643        if(!sei.m_mc_all_tiles_exact_sample_value_match_flag)
    644644        {
    645           WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 
     645          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");
    646646        }
    647647
     
    651651        {
    652652          WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag");
    653           WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc"); 
     653          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc");
    654654        }
    655655      }
     
    662662    if(sei.m_max_mcs_tier_level_idc_present_flag)
    663663    {
    664       WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 
    665       WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc"); 
     664      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");
     665      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc");
    666666    }
    667667  }
     
    763763  userVerticalCoefficients[2][2] = 100;
    764764  userVerticalCoefficients[2][3] = -10;
    765  
     765
    766766  Int const iNumHorizontalFilters = 1;
    767767  Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3};
     
    832832{
    833833  WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
    834   WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 
     834  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
    835835  if ( !sei.m_kneeCancelFlag )
    836836  {
     
    863863  WRITE_CODE( sei.values.whitePoint[0],    16,  "white_point_x" );
    864864  WRITE_CODE( sei.values.whitePoint[1],    16,  "white_point_y" );
    865    
     865
    866866  WRITE_CODE( sei.values.maxLuminance,     32,  "max_display_mastering_luminance" );
    867867  WRITE_CODE( sei.values.minLuminance,     32,  "min_display_mastering_luminance" );
     
    10331033
    10341034    // byte alignment
    1035     while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 
     1035    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
    10361036    {
    10371037      WRITE_FLAG( 0, "overlay_zero_bit" );
    10381038    }
    1039    
     1039
    10401040    UChar* stmp;
    10411041    UInt ilength;
     
    10441044      if( sei.m_languageOverlayPresentFlag[i] )
    10451045      {
    1046         stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() );       
     1046        stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() );
    10471047        ilength = (UInt) sei.m_overlayLanguage[i].size();
    10481048        WRITE_STRING( stmp, ilength, "overlay_language" );
     
    10651065    }
    10661066    WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" );
    1067   } 
     1067  }
    10681068};
    10691069
     
    11571157{
    11581158    UInt x_sign, x_exp, x_mantissa,x_mantissa_len;
    1159     if (f < 0) 
     1159    if (f < 0)
    11601160    {
    11611161        f = f * (-1);
     
    13171317  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
    13181318  {
     1319#if DEBUG_NH_3D_SEI
     1320    printf("\n################## xWriteSEIAlternativeDepthInfo() ################\n");
     1321#endif
    13191322    WRITE_CODE( sei.m_depthType, 2, "depth_type" );
    13201323
    1321 #if NH_MV_SEI_TBD
    13221324    if( sei.m_depthType  ==  0 )
    13231325    {
     
    13301332      if( sei.m_zGvdFlag )
    13311333      {
    1332         for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
    1333         {
    1334           WRITE_FLAG( ( sei.m_signGvdZNearFlag[i] ? 1 : 0 ), "sign_gvd_z_near_flag" );
    1335           WRITE_CODE( sei.m_expGvdZNear[i], 7, "exp_gvd_z_near" );
    1336           WRITE_CODE( sei.m_manLenGvdZNearMinus1[i], 5, "man_len_gvd_z_near_minus1" );
    1337           WRITE_CODE( sei.m_manGvdZNear[i], getManGvdZNearLen ), "man_gvd_z_near" );
    1338           WRITE_FLAG( ( sei.m_signGvdZFarFlag[i] ? 1 : 0 ), "sign_gvd_z_far_flag" );
    1339           WRITE_CODE( sei.m_expGvdZFar[i], 7, "exp_gvd_z_far" );
    1340           WRITE_CODE( sei.m_manLenGvdZFarMinus1[i], 5, "man_len_gvd_z_far_minus1" );
    1341           WRITE_CODE( sei.m_manGvdZFar[i], getManGvdZFarLen ), "man_gvd_z_far" );
     1334        for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
     1335        {
     1336#if DEBUG_NH_3D_SEI
     1337          printf("sign_gvd_z_near_flag          : sei.m_signGvdZNearFlag[%d][%d]: %u\n", i, j, sei.m_signGvdZNearFlag[i][j]);
     1338          printf("exp_gvd_z_near                : sei.m_expGvdZNear[%d][%d]: %u\n", i, j, sei.m_expGvdZNear[i][j]);
     1339          printf("man_len_gvd_z_near_minus1     : sei.m_manLenGvdZNearMinus1[%d][%d]: %u\n", i, j, sei.m_manLenGvdZNearMinus1[i][j]);
     1340          printf("man_gvd_z_near                : sei.m_manGvdZNear[%d][%d]: %u\n", i, j, sei.m_manGvdZNear[i][j]);
     1341          printf("sign_gvd_z_far_flag           : sei.m_signGvdZFarFlag[%d][%d]: %u\n", i, j, sei.m_signGvdZFarFlag[i][j]);
     1342          printf("exp_gvd_z_far                 : sei.m_expGvdZFar[%d][%d]: %u\n", i, j, sei.m_expGvdZFar[i][j]);
     1343          printf("man_len_gvd_z_far_minus1      : sei.m_manLenGvdZFarMinus1[%d][%d]: %u\n", i, j, sei.m_manLenGvdZFarMinus1[i][j]);
     1344          printf("man_gvd_z_far                 : sei.m_manGvdZFar[%d][%d]: %u\n", i, j, sei.m_manGvdZFar[i][j]);
     1345#endif
     1346          WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" );
     1347          WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" );
     1348          WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" );
     1349          WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" );
     1350          WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" );
     1351          WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" );
     1352          WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" );
     1353          WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" );
    13421354        }
    13431355      }
    13441356      if( sei.m_intrinsicParamGvdFlag )
    13451357      {
     1358#if DEBUG_NH_3D_SEI
     1359        printf("prec_gvd_focal_length         : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength);
     1360        printf("prec_gvd_principal_point      : sei.m_precGvdPrincipalPoint: %u\n", sei.m_precGvdPrincipalPoint);
     1361#endif
    13461362        WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" );
    13471363        WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" );
     
    13491365      if( sei.m_rotationGvdFlag )
    13501366      {
     1367#if DEBUG_NH_3D_SEI
     1368        printf("prec_gvd_focal_length         : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength);
     1369#endif
    13511370        WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" );
    13521371      }
    13531372      if( sei.m_translationGvdFlag )
    13541373      {
     1374#if DEBUG_NH_3D_SEI
     1375        printf("prec_gvd_focal_length         : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength);
     1376#endif
    13551377        WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" );
    13561378      }
    1357       for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
     1379      for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
    13581380      {
    13591381        if( sei.m_intrinsicParamGvdFlag )
    13601382        {
    1361           WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i] ? 1 : 0 ), "sign_gvd_focal_length_x" );
    1362           WRITE_CODE( sei.m_expGvdFocalLengthX[i], 6, "exp_gvd_focal_length_x" );
    1363           WRITE_CODE( sei.m_manGvdFocalLengthX[i], getManGvdFocalLengthXLen ), "man_gvd_focal_length_x" );
    1364           WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i] ? 1 : 0 ), "sign_gvd_focal_length_y" );
    1365           WRITE_CODE( sei.m_expGvdFocalLengthY[i], 6, "exp_gvd_focal_length_y" );
    1366           WRITE_CODE( sei.m_manGvdFocalLengthY[i], getManGvdFocalLengthYLen ), "man_gvd_focal_length_y" );
    1367           WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i] ? 1 : 0 ), "sign_gvd_principal_point_x" );
    1368           WRITE_CODE( sei.m_expGvdPrincipalPointX[i], 6, "exp_gvd_principal_point_x" );
    1369           WRITE_CODE( sei.m_manGvdPrincipalPointX[i], getManGvdPrincipalPointXLen ), "man_gvd_principal_point_x" );
    1370           WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i] ? 1 : 0 ), "sign_gvd_principal_point_y" );
    1371           WRITE_CODE( sei.m_expGvdPrincipalPointY[i], 6, "exp_gvd_principal_point_y" );
    1372           WRITE_CODE( sei.m_manGvdPrincipalPointY[i], getManGvdPrincipalPointYLen ), "man_gvd_principal_point_y" );
     1383#if DEBUG_NH_3D_SEI
     1384          printf("sign_gvd_focal_length_x       : sei.m_signGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_signGvdFocalLengthX[i][j]);
     1385          printf("exp_gvd_focal_length_x        : sei.m_expGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthX[i][j]);
     1386          printf("man_gvd_focal_length_x        : sei.m_manGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthX[i][j]);
     1387          printf("sign_gvd_focal_length_y       : sei.m_signGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_signGvdFocalLengthY[i][j]);
     1388          printf("exp_gvd_focal_length_y        : sei.m_expGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthY[i][j]);
     1389          printf("man_gvd_focal_length_y        : sei.m_manGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthY[i][j]);
     1390          printf("sign_gvd_principal_point_x    : sei.m_signGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointX[i][j]);
     1391          printf("exp_gvd_principal_point_x     : sei.m_expGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointX[i][j]);
     1392          printf("man_gvd_principal_point_x     : sei.m_manGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointX[i][j]);
     1393          printf("sign_gvd_principal_point_y    : sei.m_signGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointY[i][j]);
     1394          printf("exp_gvd_principal_point_y     : sei.m_expGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointY[i][j]);
     1395          printf("man_gvd_principal_point_y     : sei.m_manGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointY[i][j]);
     1396#endif
     1397          WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" );
     1398          WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" );
     1399          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_x" );
     1400          WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" );
     1401          WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" );
     1402          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_y" );
     1403          WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" );
     1404          WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" );
     1405          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_x" );
     1406          WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" );
     1407          WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" );
     1408          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_y" );
    13731409        }
    13741410        if( sei.m_rotationGvdFlag )
    13751411        {
    1376           for( Int j = 10; j  <=  3; j++ ) /* row */
     1412          for( Int k = 0; k < 3; k++ )  // column
    13771413          {
    1378             for( Int k = 10; k  <=  3; k++ )  /* column */
    1379             {
    1380               WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" );
    1381               WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" );
    1382               WRITE_CODE( sei.m_manGvdR[i][j][k], getManGvdRLen ), "man_gvd_r" );
    1383             }
     1414#if DEBUG_NH_3D_SEI
     1415            printf("sign_gvd_r                    : sei.m_signGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_signGvdR[i][j][k]);
     1416            printf("exp_gvd_r                     : sei.m_expGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_expGvdR[i][j][k]);
     1417            printf("man_gvd_r                     : sei.m_manGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_manGvdR[i][j][k]);
     1418#endif
     1419            WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" );
     1420            WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" );
     1421            WRITE_CODE( sei.m_manGvdR[i][j][k], sei.m_precGvdTranslationParam, "man_gvd_r" );
    13841422          }
    13851423        }
    13861424        if( sei.m_translationGvdFlag )
    13871425        {
    1388           WRITE_FLAG( ( sei.m_signGvdTX[i] ? 1 : 0 ), "sign_gvd_t_x" );
    1389           WRITE_CODE( sei.m_expGvdTX[i], 6, "exp_gvd_t_x" );
    1390           WRITE_CODE( sei.m_manGvdTX[i], getManGvdTXLen ), "man_gvd_t_x" );
    1391         }
    1392       }
    1393     }
    1394 #endif
     1426#if DEBUG_NH_3D_SEI
     1427          printf("sign_gvd_t_x                  : sei.m_signGvdTX[%d][%d]: %u\n", i, j, sei.m_signGvdTX[i][j]);
     1428          printf("exp_gvd_t_x                   : sei.m_expGvdTX[%d][%d]: %u\n", i, j, sei.m_expGvdTX[i][j]);
     1429          printf("man_gvd_t_x                   : sei.m_manGvdTX[%d][%d]: %u\n", i, j, sei.m_manGvdTX[i][j]);
     1430#endif
     1431          WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" );
     1432          WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" );
     1433          WRITE_CODE( sei.m_manGvdTX[i][j], sei.m_numConstituentViewsGvdMinus1, "man_gvd_t_x" );
     1434        }
     1435      }
     1436    }
    13951437
    13961438    if( sei.m_depthType  ==  1 )
  • branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/TEncGOP.cpp

    r1331 r1349  
    100100  m_layerId      = 0;
    101101  m_viewId       = 0;
    102   m_pocLastCoded = -1; 
     102  m_pocLastCoded = -1;
    103103#if NH_3D
    104   m_viewIndex  =   0; 
     104  m_viewIndex  =   0;
    105105  m_isDepth = false;
    106106#endif
     
    147147
    148148#if NH_MV
    149   m_ivPicLists           = pcTEncTop->getIvPicLists(); 
     149  m_ivPicLists           = pcTEncTop->getIvPicLists();
    150150  m_layerId              = pcTEncTop->getLayerId();
    151151  m_viewId               = pcTEncTop->getViewId();
     
    156156#endif
    157157#if NH_3D_IC
    158   m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
    159   m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
     158  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
     159  m_aICEnableNum         = pcTEncTop->getICEnableNum();
    160160#endif
    161161#if KWU_FIX_URQ
     
    207207#if NH_MV
    208208  if ( getLayerId() == 0 )
    209   { 
     209  {
    210210    actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
    211211  }
     
    232232  OutputNALUnit nalu(naluType, temporalId);
    233233#endif
     234  printf("\nDEBUG: TEncGOP::xWriteSEI() call SEIWriter::writeSEImessages()\n");
    234235  m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, sps, false);
    235236  auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu));
     
    277278
    278279  while ( (itNalu!=accessUnit.end())&&
    279     ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 
     280    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
    280281    || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
    281282    || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
     
    288289  SEIMessages localMessages = seiMessages;
    289290  SEIMessages currentMessages;
    290  
     291
    291292#if ENC_DEC_TRACE
    292293  g_HLSTraceEnable = !testWrite;
     
    299300  xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
    300301  xClearSEIs(currentMessages, !testWrite);
    301  
     302
    302303  // Buffering period SEI must always be following active parameter sets
    303304  currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
     
    476477    seiMessages.push_back(sei);
    477478  }
    478    
     479
    479480  if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled)
    480481  {
     
    490491  {
    491492    SEISubBitstreamProperty *sei = new SEISubBitstreamProperty;
    492     m_seiEncoder.initSEISubBitstreamProperty( sei, sps );   
     493    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );
    493494    seiMessages.push_back(sei);
    494495  }
     
    685686      }
    686687    }
    687    
     688
    688689    if( m_pcCfg->getPictureTimingSEIEnabled() )
    689690    {
     
    721722    return;
    722723  }
    723   // fix first 
     724  // fix first
    724725  UInt numNalUnits = (UInt)testAU.size();
    725726  UInt numRBSPBytes = 0;
     
    933934          IRAPGOPid = iGOPid;
    934935          IRAPtoReorder = true;
    935           swapIRAPForward = true; 
     936          swapIRAPForward = true;
    936937          break;
    937938        }
     
    941942          IRAPGOPid = iGOPid;
    942943          IRAPtoReorder = true;
    943           swapIRAPForward = false; 
     944          swapIRAPForward = false;
    944945          break;
    945946        }
     
    10721073#endif
    10731074#if NH_MV
    1074 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 
    1075                                 TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP, 
     1075Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
     1076                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
    10761077                                Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
    10771078#else
     
    11761177    pcPic->setCurrSliceIdx(0);
    11771178#if NH_MV
    1178     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );     
     1179    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );
    11791180#else
    11801181    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
     
    11871188    pcSlice->setSliceIdx(0);
    11881189#if NH_MV
    1189     pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
     1190    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    11901191    pcPic  ->setLayerId     ( getLayerId()   );
    1191     pcPic  ->setViewId      ( getViewId()    );   
     1192    pcPic  ->setViewId      ( getViewId()    );
    11921193#if !NH_3D
    11931194    pcSlice->setLayerId     ( getLayerId() );
    1194     pcSlice->setViewId      ( getViewId()  );   
     1195    pcSlice->setViewId      ( getViewId()  );
    11951196    pcSlice->setVPS         ( m_pcEncTop->getVPS() );
    11961197#else
    1197     pcPic  ->setViewIndex   ( getViewIndex() ); 
     1198    pcPic  ->setViewIndex   ( getViewIndex() );
    11981199    pcPic  ->setIsDepth( getIsDepth() );
    1199     pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );   
    1200 #endif
    1201 #endif 
     1200    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
     1201#endif
     1202#endif
    12021203    //set default slice level flag to the same as SPS level flag
    12031204    pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
     
    12071208    if( pcSlice->getSliceType() == B_SLICE )
    12081209    {
    1209       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1210       { 
     1210      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1211      {
    12111212        pcSlice->setSliceType( P_SLICE );
    12121213      }
     
    12161217    if( pcSlice->getSliceType() == B_SLICE )
    12171218    {
    1218       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 
    1219       { 
     1219      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
     1220      {
    12201221        pcSlice->setSliceType( I_SLICE );
    12211222      }
     
    12311232      pcSlice->setSliceType(I_SLICE);
    12321233    }
    1233    
     1234
    12341235    // Set the nal unit type
    12351236    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
     
    12851286    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    12861287    }
    1287     if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 
     1288    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
    12881289      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
    12891290      )
     
    12941295    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    12951296
    1296     if(pcSlice->getTLayer() > 0 
     1297    if(pcSlice->getTLayer() > 0
    12971298      &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
    12981299          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
     
    13641365    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    13651366    {
    1366       // Some more sophisticated algorithm to determine discardable_flag might be added here. 
    1367       pcSlice->setDiscardableFlag           ( false );     
    1368     }   
    1369 
    1370     const TComVPS*           vps = pcSlice->getVPS();     
     1367      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     1368      pcSlice->setDiscardableFlag           ( false );
     1369    }
     1370
     1371    const TComVPS*           vps = pcSlice->getVPS();
    13711372#if NH_3D
    1372     Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() ); 
     1373    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() );
    13731374#else
    1374     Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
     1375    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    13751376#endif
    13761377#if NH_3D
    1377     pcSlice->setIvPicLists( m_ivPicLists );         
     1378    pcSlice->setIvPicLists( m_ivPicLists );
    13781379
    13791380    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
    1380     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
     1381    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
    13811382#else
    1382     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    1383 #endif
    1384 
    1385 
    1386    
    1387     Bool interLayerPredLayerIdcPresentFlag = false; 
     1383    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );
     1384#endif
     1385
     1386
     1387
     1388    Bool interLayerPredLayerIdcPresentFlag = false;
    13881389    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    1389     {         
    1390       pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     1390    {
     1391      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );
    13911392      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
    13921393      {
    13931394        if ( !vps->getMaxOneActiveRefLayerFlag() )
    1394         {   
    1395           pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 
     1395        {
     1396          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
    13961397        }
    13971398#if NH_3D
     
    14001401        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    14011402#endif
    1402         {       
    1403           interLayerPredLayerIdcPresentFlag = true; 
     1403        {
     1404          interLayerPredLayerIdcPresentFlag = true;
    14041405          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    14051406          {
    1406             pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 
     1407            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
    14071408          }
    14081409        }
     
    14111412    if ( !interLayerPredLayerIdcPresentFlag )
    14121413    {
    1413       for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1414      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )
    14141415      {
    14151416        pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
     
    14181419
    14191420
    1420     assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
    1421    
     1421    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     1422
    14221423#if NH_3D
    14231424    if ( m_pcEncTop->decProcAnnexI() )
    1424     {   
    1425       pcSlice->deriveInCmpPredAndCpAvailFlag( ); 
     1425    {
     1426      pcSlice->deriveInCmpPredAndCpAvailFlag( );
    14261427      if ( pcSlice->getInCmpPredAvailFlag() )
    1427       {     
    1428         pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
     1428      {
     1429        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
    14291430      }
    14301431      else
     
    14401441            printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
    14411442          }
    1442          
     1443
    14431444          exit(EXIT_FAILURE);
    14441445        }
    14451446      }
    1446       pcSlice->init3dToolParameters(); 
    1447       pcSlice->checkInCompPredRefLayers(); 
    1448     }   
     1447      pcSlice->init3dToolParameters();
     1448      pcSlice->checkInCompPredRefLayers();
     1449    }
    14491450#if NH_3D_IV_MERGE
    14501451    // This needs to be done after initialization of 3D tool parameters.
     
    14531454#endif
    14541455
    1455     pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     1456    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    14561457    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
    14571458    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     
    14621463
    14631464    pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    1464    
    1465 
    1466     xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );   
     1465
     1466
     1467    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );
    14671468#else
    14681469    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    14701471#endif
    14711472    //  Set reference list
    1472 #if NH_MV   
    1473     pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 
     1473#if NH_MV
     1474    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
    14741475#else
    14751476    pcSlice->setRefPicList ( rcListPic );
     
    14831484#endif
    14841485#if NH_3D_IC
    1485     pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
    1486     pcSlice->setICEnableNum( m_aICEnableNum );         
     1486    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
     1487    pcSlice->setICEnableNum( m_aICEnableNum );
    14871488#endif
    14881489
     
    14911492    if ( pcSlice->getSliceType() == B_SLICE )
    14921493    {
    1493       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1494       { 
    1495         pcSlice->setSliceType( P_SLICE ); 
     1494      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1495      {
     1496        pcSlice->setSliceType( P_SLICE );
    14961497      }
    14971498    }
     
    15721573
    15731574#if NH_3D_VSO
    1574   // Should be moved to TEncTop !!! 
     1575  // Should be moved to TEncTop !!!
    15751576  Bool bUseVSO = m_pcEncTop->getUseVSO();
    1576  
    1577   TComRdCost* pcRdCost = m_pcEncTop->getRdCost();   
     1577
     1578  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();
    15781579
    15791580  pcRdCost->setUseVSO( bUseVSO );
     
    17311732#endif
    17321733#if NH_3D
    1733       pcSlice->setDepthToDisparityLUTs(); 
     1734      pcSlice->setDepthToDisparityLUTs();
    17341735
    17351736#endif
     
    19901991    cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled());
    19911992#if NH_3D
    1992       pcPic->compressMotion(2); 
     1993      pcPic->compressMotion(2);
    19931994#else
    19941995    pcPic->compressMotion();
     
    20652066    pcPic->setReconMark   ( true );
    20662067#if NH_MV
    2067       TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    2068       std::vector<Int> temp; 
    2069       TComSlice::markCurrPic( pcPic ); 
     2068      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     2069      std::vector<Int> temp;
     2070      TComSlice::markCurrPic( pcPic );
    20702071#endif
    20712072    m_bFirst = false;
     
    21042105  //-- all
    21052106#if NH_MV
    2106   printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );   
     2107  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
    21072108#else
    21082109  printf( "\n\nSUMMARY --------------------------------------------------------\n" );
     
    24122413#if H_3D_VSO_SYNTH_DIST_OUT
    24132414}
    2414 #endif 
    2415 #endif 
     2415#endif
     2416#endif
    24162417  /* calculate the size of the access unit, excluding:
    24172418   *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
     
    25362537
    25372538#if  NH_MV
    2538   assert( 0 ); // Field coding and MV need to be aligned. 
     2539  assert( 0 ); // Field coding and MV need to be aligned.
    25392540#else
    25402541
     
    29792980#if NH_MV
    29802981Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
    2981 { 
    2982  
     2982{
     2983
    29832984  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
    29842985  {
    29852986    return;
    29862987  }
    2987  
     2988
    29882989  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
    2989   assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 
    2990 
    2991   Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList(); 
    2992 
    2993   // GT: check if SliceType should be checked here. 
     2990  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
     2991
     2992  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();
     2993
     2994  // GT: check if SliceType should be checked here.
    29942995  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
    29952996  {
    2996     Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 
    2997            
     2997    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
     2998
    29982999    Int finalIdxToTempIdxMap[16];
    29993000    for( Int k = 0; k < 16; k++ )
     
    30093010        // get position in temp. list
    30103011        Int refPicLayerId = pcSlice->getRefPicLayerId(k);
    3011         Int idxInTempList = 0; 
     3012        Int idxInTempList = 0;
    30123013        for (; idxInTempList < numPicsInTempList; idxInTempList++)
    30133014        {
    30143015          if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
    30153016          {
    3016             break; 
     3017            break;
    30173018          }
    30183019        }
    30193020
    30203021        Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
    3021        
    3022         // Add negative from behind 
    3023         idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 
    3024        
     3022
     3023        // Add negative from behind
     3024        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
     3025
    30253026        Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
    30263027        if ( curIsModified )
    30273028        {
    3028           isModified = true; 
     3029          isModified = true;
    30293030          assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
    30303031        }
    3031         finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;             
     3032        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;
    30323033      }
    30333034    }
    30343035
    30353036    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    3036     refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
     3037    refPicListModification->setRefPicListModificationFlagL( li, isModified );
    30373038
    30383039    if( isModified )
    30393040    {
    30403041      Int refIdx = 0;
    3041      
     3042
    30423043      for( Int i = 0; i < numPicsInFinalRefList; i++ )
    30433044      {
    3044         if( finalIdxToTempIdxMap[i] >= 0 ) 
     3045        if( finalIdxToTempIdxMap[i] >= 0 )
    30453046        {
    30463047          refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
     
    30523053          while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
    30533054          {
    3054             refIdx++; 
     3055            refIdx++;
    30553056          }
    30563057          refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.