Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
23 May 2013, 15:40:36 (12 years ago)
Author:
tech
Message:

Integrated 3D encoder control, camera parameters, renderer and MV fixes.

Location:
branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/CommonDef.h

    r403 r438  
    5757
    5858#if H_MV
    59 #define NV_VERSION        "0.2"                 ///< Current software version
    60 #define HM_VERSION        "10.1"                ///<
    61 #else
    62 #define NV_VERSION        "10.1"                 ///< Current software version
     59#define NV_VERSION        "0.1"                 ///< Current software version
     60#define HM_VERSION        "10.0"                ///<
     61#else
     62#define NV_VERSION        "10.0"                 ///< Current software version
    6363#endif
    6464
     
    115115#define MAX_NUM_REF_PICS            16          ///< max. number of pictures used for reference
    116116#define MAX_NUM_REF                 16          ///< max. number of entries in picture reference list
    117 #if !L0034_COMBINED_LIST_CLEANUP
    118117#define MAX_NUM_REF_LC              MAX_NUM_REF_PICS  // TODO: remove this macro definition (leftover from combined list concept)
    119 #endif
    120118
    121119#define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
     
    138136template <typename T> inline T ClipY(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); }
    139137template <typename T> inline T ClipC(T x) { return std::min<T>(T((1 << g_bitDepthC)-1), std::max<T>( T(0), x)); }
     138
     139template <typename T> inline T Clip(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); }
    140140
    141141/** clip a, such that minVal <= a <= maxVal */
     
    168168
    169169#endif
     170
    170171
    171172// ====================================================================================================================
     
    215216 
    216217  NAL_UNIT_CODED_SLICE_TSA_N,     // 2
    217   NAL_UNIT_CODED_SLICE_TLA_R,       // 3
     218  NAL_UNIT_CODED_SLICE_TLA,       // 3   // Current name in the spec: TSA_R
    218219 
    219220  NAL_UNIT_CODED_SLICE_STSA_N,    // 4
     
    221222
    222223  NAL_UNIT_CODED_SLICE_RADL_N,    // 6
    223   NAL_UNIT_CODED_SLICE_RADL_R,      // 7
     224  NAL_UNIT_CODED_SLICE_DLP,       // 7 // Current name in the spec: RADL_R
    224225 
    225226  NAL_UNIT_CODED_SLICE_RASL_N,    // 8
    226   NAL_UNIT_CODED_SLICE_RASL_R,      // 9
    227 
    228   NAL_UNIT_RESERVED_VCL_N10,
    229   NAL_UNIT_RESERVED_VCL_R11,
    230   NAL_UNIT_RESERVED_VCL_N12,
    231   NAL_UNIT_RESERVED_VCL_R13,
    232   NAL_UNIT_RESERVED_VCL_N14,
    233   NAL_UNIT_RESERVED_VCL_R15,
    234 
    235   NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
    236   NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
     227  NAL_UNIT_CODED_SLICE_TFD,       // 9 // Current name in the spec: RASL_R
     228
     229  NAL_UNIT_RESERVED_10,
     230  NAL_UNIT_RESERVED_11,
     231  NAL_UNIT_RESERVED_12,
     232  NAL_UNIT_RESERVED_13,
     233  NAL_UNIT_RESERVED_14,
     234  NAL_UNIT_RESERVED_15,
     235
     236  NAL_UNIT_CODED_SLICE_BLA,       // 16   // Current name in the spec: BLA_W_LP
     237  NAL_UNIT_CODED_SLICE_BLANT,     // 17   // Current name in the spec: BLA_W_DLP
    237238  NAL_UNIT_CODED_SLICE_BLA_N_LP,  // 18
    238   NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
     239  NAL_UNIT_CODED_SLICE_IDR,       // 19  // Current name in the spec: IDR_W_DLP
    239240  NAL_UNIT_CODED_SLICE_IDR_N_LP,  // 20
    240241  NAL_UNIT_CODED_SLICE_CRA,       // 21
    241   NAL_UNIT_RESERVED_IRAP_VCL22,
    242   NAL_UNIT_RESERVED_IRAP_VCL23,
    243 
    244   NAL_UNIT_RESERVED_VCL24,
    245   NAL_UNIT_RESERVED_VCL25,
    246   NAL_UNIT_RESERVED_VCL26,
    247   NAL_UNIT_RESERVED_VCL27,
    248   NAL_UNIT_RESERVED_VCL28,
    249   NAL_UNIT_RESERVED_VCL29,
    250   NAL_UNIT_RESERVED_VCL30,
    251   NAL_UNIT_RESERVED_VCL31,
     242  NAL_UNIT_RESERVED_22,
     243  NAL_UNIT_RESERVED_23,
     244
     245  NAL_UNIT_RESERVED_24,
     246  NAL_UNIT_RESERVED_25,
     247  NAL_UNIT_RESERVED_26,
     248  NAL_UNIT_RESERVED_27,
     249  NAL_UNIT_RESERVED_28,
     250  NAL_UNIT_RESERVED_29,
     251  NAL_UNIT_RESERVED_30,
     252  NAL_UNIT_RESERVED_31,
    252253
    253254  NAL_UNIT_VPS,                   // 32
     
    258259  NAL_UNIT_EOB,                   // 37
    259260  NAL_UNIT_FILLER_DATA,           // 38
    260   NAL_UNIT_PREFIX_SEI,              // 39
    261   NAL_UNIT_SUFFIX_SEI,              // 40
    262   NAL_UNIT_RESERVED_NVCL41,
    263   NAL_UNIT_RESERVED_NVCL42,
    264   NAL_UNIT_RESERVED_NVCL43,
    265   NAL_UNIT_RESERVED_NVCL44,
    266   NAL_UNIT_RESERVED_NVCL45,
    267   NAL_UNIT_RESERVED_NVCL46,
    268   NAL_UNIT_RESERVED_NVCL47,
     261  NAL_UNIT_SEI,                   // 39 Prefix SEI
     262  NAL_UNIT_SEI_SUFFIX,            // 40 Suffix SEI
     263  NAL_UNIT_RESERVED_41,
     264  NAL_UNIT_RESERVED_42,
     265  NAL_UNIT_RESERVED_43,
     266  NAL_UNIT_RESERVED_44,
     267  NAL_UNIT_RESERVED_45,
     268  NAL_UNIT_RESERVED_46,
     269  NAL_UNIT_RESERVED_47,
    269270  NAL_UNIT_UNSPECIFIED_48,
    270271  NAL_UNIT_UNSPECIFIED_49,
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/NAL.h

    r368 r438  
    4747  NalUnitType m_nalUnitType; ///< nal_unit_type
    4848  UInt        m_temporalId;  ///< temporal_id
     49
    4950#if H_MV
    5051  Int         m_layerId;     ///< layer id
     
    7980    return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R
    8081        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
    81         || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA_R
     82        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA
    8283        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
    8384        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
    8485        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
    85         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
    86         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     86        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA
     87        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
    8788        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
    88         || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     89        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
    8990        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
    9091        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
    9192        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
    92         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R
     93        || m_nalUnitType == NAL_UNIT_CODED_SLICE_DLP
    9394        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
    94         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
     95        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TFD;
    9596  }
    9697#if L0045_NON_NESTED_SEI_RESTRICTIONS
    9798  Bool isSei()
    9899  {
    99     return m_nalUnitType == NAL_UNIT_PREFIX_SEI
    100         || m_nalUnitType == NAL_UNIT_SUFFIX_SEI;
     100    return m_nalUnitType == NAL_UNIT_SEI
     101        || m_nalUnitType == NAL_UNIT_SEI_SUFFIX;
    101102  }
    102103
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.cpp

    r362 r438  
    3838#include "CommonDef.h"
    3939#include "SEI.h"
    40 
    41 #if J0149_TONE_MAPPING_SEI
    42 //Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator
    43 Int  Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1};
    44 #endif
    4540
    4641SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.h

    r362 r438  
    355355};
    356356
    357 #if L0208_SOP_DESCRIPTION_SEI
    358 class SEISOPDescription : public SEI
    359 {
    360 public:
    361   PayloadType payloadType() const { return SOP_DESCRIPTION; }
    362 
    363   SEISOPDescription() {}
    364   virtual ~SEISOPDescription() {}
    365 
    366   UInt m_sopSeqParameterSetId;
    367   UInt m_numPicsInSopMinus1;
    368 
    369   UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
    370   UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
    371   UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
    372   Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
    373 };
    374 #endif
    375 
    376 #if J0149_TONE_MAPPING_SEI
    377 class SEIToneMappingInfo : public SEI
    378 {
    379 public:
    380   PayloadType payloadType() const { return TONE_MAPPING_INFO; }
    381   SEIToneMappingInfo() {}
    382   virtual ~SEIToneMappingInfo() {}
    383 
    384   Int    m_toneMapId;
    385   Bool   m_toneMapCancelFlag;
    386   Bool   m_toneMapPersistenceFlag;
    387   Int    m_codedDataBitDepth;
    388   Int    m_targetBitDepth;
    389   Int    m_modelId;
    390   Int    m_minValue;
    391   Int    m_maxValue;
    392   Int    m_sigmoidMidpoint;
    393   Int    m_sigmoidWidth;
    394   std::vector<Int> m_startOfCodedInterval;
    395   Int    m_numPivots;
    396   std::vector<Int> m_codedPivotValue;
    397   std::vector<Int> m_targetPivotValue;
    398   Int    m_cameraIsoSpeedIdc;
    399   Int    m_cameraIsoSpeedValue;
    400   Int    m_exposureCompensationValueSignFlag;
    401   Int    m_exposureCompensationValueNumerator;
    402   Int    m_exposureCompensationValueDenomIdc;
    403   Int    m_refScreenLuminanceWhite;
    404   Int    m_extendedRangeWhiteLevel;
    405   Int    m_nominalBlackLevelLumaCodeValue;
    406   Int    m_nominalWhiteLevelLumaCodeValue;
    407   Int    m_extendedWhiteLevelLumaCodeValue;
    408 };
    409 #endif
    410 
    411357typedef std::list<SEI*> SEIMessages;
    412358
     
    420366Void deleteSEIs (SEIMessages &seiList);
    421367
    422 #if K0180_SCALABLE_NESTING_SEI
    423 class SEIScalableNesting : public SEI
    424 {
    425 public:
    426   PayloadType payloadType() const { return SCALABLE_NESTING; }
    427 
    428   SEIScalableNesting() {}
    429   virtual ~SEIScalableNesting()
    430   {
    431     if (!m_callerOwnsSEIs)
    432     {
    433       deleteSEIs(m_nestedSEIs);
    434     }
    435   }
    436 
    437   Bool  m_bitStreamSubsetFlag;
    438   Bool  m_nestingOpFlag;
    439   Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
    440   UInt  m_nestingNumOpsMinus1;                       // -"-
    441   UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
    442   UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
    443 
    444   Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
    445   UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    446   UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    447   UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 unsigned char values
    448 
    449   Bool  m_callerOwnsSEIs;
    450   SEIMessages m_nestedSEIs;
    451 };
    452 #endif
    453 
    454368//! \}
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.cpp

    r362 r438  
    177177  }
    178178}
    179 
    180179Void TComOutputBitstream::writeByteAlignment()
    181180{
     
    183182  writeAlignZero();
    184183}
    185 
    186 Int TComOutputBitstream::countStartCodeEmulations()
    187 {
    188   UInt cnt = 0;
    189   vector<uint8_t>& rbsp   = getFIFO();
    190   for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
    191   {
    192     vector<uint8_t>::iterator found = it;
    193     do
    194     {
    195       // find the next emulated 00 00 {00,01,02,03}
    196       // NB, end()-1, prevents finding a trailing two byte sequence
    197       found = search_n(found, rbsp.end()-1, 2, 0);
    198       found++;
    199       // if not found, found == end, otherwise found = second zero byte
    200       if (found == rbsp.end())
    201       {
    202         break;
    203       }
    204       if (*(++found) <= 3)
    205       {
    206         break;
    207       }
    208     } while (true);
    209     it = found;
    210     if (found != rbsp.end())
    211     {
    212       cnt++;
    213     }
    214   }
    215   return cnt;
    216 }
    217 
    218184/**
    219185 * read #uiNumberOfBits# from bitstream without updating the bitstream
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.h

    r362 r438  
    154154  Void          addSubstream    ( TComOutputBitstream* pcSubstream );
    155155  Void writeByteAlignment();
    156 
    157   //! returns the number of start code emulations contained in the current buffer
    158   Int countStartCodeEmulations();
    159156};
    160157
     
    166163{
    167164  std::vector<uint8_t> *m_fifo; /// FIFO for storage of complete bytes
    168   std::vector<UInt> m_emulationPreventionByteLocation;
    169165
    170166protected:
     
    210206  UInt  getNumBitsRead() { return m_numBitsRead; }
    211207  Void readByteAlignment();
    212 
    213   Void      pushEmulationPreventionByteLocation ( UInt pos )                  { m_emulationPreventionByteLocation.push_back( pos ); }
    214   UInt      numEmulationPreventionBytesRead     ()                            { return (UInt) m_emulationPreventionByteLocation.size();    }
    215   std::vector<UInt>  getEmulationPreventionByteLocation  ()                   { return m_emulationPreventionByteLocation;           }
    216   UInt      getEmulationPreventionByteLocation  ( UInt idx )                  { return m_emulationPreventionByteLocation[ idx ];    }
    217   Void      clearEmulationPreventionByteLocation()                            { m_emulationPreventionByteLocation.clear();          }
    218   Void      setEmulationPreventionByteLocation  ( std::vector<UInt> vec )     { m_emulationPreventionByteLocation = vec;            }
    219208};
    220209
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r364 r438  
    32003200  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
    32013201  Bool bIsNeibRefLongTerm = false;
     3202
    32023203  //---------------  V1 (END) ------------------//
    32033204  if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0)
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r362 r438  
    5757// ====================================================================================================================
    5858
    59 const UChar TComLoopFilter::sm_tcTable[54] =
     59const UChar tctable_8x8[54] =
    6060{
    6161  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,8,9,10,11,13,14,16,18,20,22,24
    6262};
    6363
    64 const UChar TComLoopFilter::sm_betaTable[52] =
     64const UChar betatable_8x8[52] =
    6565{
    6666  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
     
    585585      Int iIndexB = Clip3(0, MAX_QP, iQP + (betaOffsetDiv2 << 1));
    586586     
    587       Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
    588       Int iBeta = sm_betaTable[iIndexB]*iBitdepthScale;
     587      Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
     588      Int iBeta = betatable_8x8[iIndexB]*iBitdepthScale;
    589589      Int iSideThreshold = (iBeta+(iBeta>>1))>>3;
    590590      Int iThrCut = iTc*10;
     
    735735
    736736        Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (tcOffsetDiv2 << 1));
    737         Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
     737        Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
    738738
    739739        for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ )
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.h

    r362 r438  
    9999  __inline Int xCalcDQ( Pel* piSrc, Int iOffset);
    100100 
    101   static const UChar sm_tcTable[54];
    102   static const UChar sm_betaTable[52];
    103 
    104101public:
    105102  TComLoopFilter();
     
    114111  /// picture-level deblocking filter
    115112  Void loopFilterPic( TComPic* pcPic );
    116 
    117   static Int getBeta( Int qp )
    118   {
    119     Int indexB = Clip3( 0, MAX_QP, qp );
    120     return sm_betaTable[ indexB ];
    121   }
    122113};
    123114
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.cpp

    r368 r438  
    481481#endif
    482482
    483 
    484483//! \}
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.h

    r368 r438  
    9393#endif
    9494#endif
     95
    9596public:
    9697  TComPic();
     
    115116#endif
    116117#endif
     118
    117119  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
    118120  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
     
    184186  Void          print( Bool legend );
    185187#endif
     188
     189
     190
    186191  /** transfer ownership of seis to this picture */
    187192  void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r362 r438  
    8383  if( m_piYuvExt == NULL )
    8484  {
    85     Int extWidth  = MAX_CU_SIZE + 16;
    86     Int extHeight = MAX_CU_SIZE + 1;
     85    Int extWidth  = g_uiMaxCUWidth + 16;
     86    Int extHeight = g_uiMaxCUHeight + 1;
    8787    Int i, j;
    8888    for (i = 0; i < 4; i++)
     
    9494      }
    9595    }
    96     m_iYuvExtHeight  = ((MAX_CU_SIZE + 2) << 4);
    97     m_iYuvExtStride = ((MAX_CU_SIZE  + 8) << 4);
     96    m_iYuvExtHeight  = ((g_uiMaxCUHeight + 2) << 4);
     97    m_iYuvExtStride = ((g_uiMaxCUWidth  + 8) << 4);
    9898    m_piYuvExt = new Int[ m_iYuvExtStride * m_iYuvExtHeight ];
    9999
    100100    // new structure
    101     m_acYuvPred[0] .create( MAX_CU_SIZE, MAX_CU_SIZE );
    102     m_acYuvPred[1] .create( MAX_CU_SIZE, MAX_CU_SIZE );
    103 
    104     m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE );
    105   }
    106 
    107   if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1)
    108   {
    109     m_iLumaRecStride =  (MAX_CU_SIZE>>1) + 1;
     101    m_acYuvPred[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     102    m_acYuvPred[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     103
     104    m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     105  }
     106
     107  if (m_iLumaRecStride != (g_uiMaxCUWidth>>1) + 1)
     108  {
     109    m_iLumaRecStride =  (g_uiMaxCUWidth>>1) + 1;
    110110    if (!m_pLumaRecBuffer)
    111111    {
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComRom.cpp

    r362 r438  
    6262  g_aucConvertToBit[ i ] = c;
    6363 
     64  // g_auiFrameScanXY[ g_aucConvertToBit[ transformSize ] ]: zigzag scan array for transformSize
    6465  c=2;
    6566  for ( i=0; i<MAX_CU_DEPTH; i++ )
     
    7677Void destroyROM()
    7778{
    78   for (Int i=0; i<MAX_CU_DEPTH; i++ )
     79  Int i;
     80 
     81  for ( i=0; i<MAX_CU_DEPTH; i++ )
    7982  {
    8083    delete[] g_auiSigLastScan[0][i];
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.cpp

    r396 r438  
    4949, m_iPOC                          ( 0 )
    5050, m_iLastIDR                      ( 0 )
    51 , m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
     51, m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR )
    5252, m_eSliceType                    ( I_SLICE )
    5353, m_iSliceQp                      ( 0 )
     
    6060, m_deblockingFilterBetaOffsetDiv2 ( 0 )
    6161, m_deblockingFilterTcOffsetDiv2   ( 0 )
    62 #if !L0034_COMBINED_LIST_CLEANUP
    6362, m_bRefPicListModificationFlagLC ( false )
    6463, m_bRefPicListCombinationFlag    ( false )
    65 #endif
    6664, m_bCheckLDC                     ( false )
    6765, m_iSliceQpDelta                 ( 0 )
     
    8179, m_dLambda                       ( 0.0 )
    8280#endif
    83 #if !L0034_COMBINED_LIST_CLEANUP
    8481, m_bNoBackPredFlag               ( false )
    85 #endif
    8682, m_uiTLayer                      ( 0 )
    8783, m_bTLayerSwitchingFlag          ( false )
     
    115111#endif
    116112{
    117 #if L0034_COMBINED_LIST_CLEANUP
    118   m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
    119 #else
    120113  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
    121 #endif
    122114 
    123115  initEqualRef();
    124116 
    125 #if L0034_COMBINED_LIST_CLEANUP
    126   for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
    127   {
    128     m_list1IdxToList0Idx[idx] = -1;
    129   }
    130 #else
    131117  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    132118  {
     
    138124    m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    139125  }   
    140 #endif
    141126  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
    142127  {
     
    150135#endif
    151136  }
    152   resetWpScaling();
     137  resetWpScaling(m_weightPredTable);
    153138  initWpAcDcParam();
    154139  m_saoEnabledFlag = false;
     
    171156  m_colRefIdx = 0;
    172157  initEqualRef();
    173 #if !L0034_COMBINED_LIST_CLEANUP
    174158  m_bNoBackPredFlag = false;
    175159  m_bRefPicListCombinationFlag = false;
    176160  m_bRefPicListModificationFlagLC = false;
    177 #endif
    178161  m_bCheckLDC = false;
    179162  m_iSliceQpDeltaCb = 0;
    180163  m_iSliceQpDeltaCr = 0;
    181164
    182 #if !L0034_COMBINED_LIST_CLEANUP
    183165  m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
    184 #endif
    185166
    186167  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
     
    196177Bool TComSlice::getRapPicFlag()
    197178{
    198   return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     179  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
    199180      || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    200181      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    201       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    202       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     182      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     183      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    203184      || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
    204185}
     
    270251
    271252
    272 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb)
     253TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic,
     254                                        Int                 poc)
    273255{
    274256  TComList<TComPic*>::iterator  iterPic = rcListPic.begin(); 
    275257  TComPic*                      pcPic = *(iterPic);
    276258  TComPic*                      pcStPic = pcPic;
    277  
    278   Int pocCycle = 1 << getSPS()->getBitsForPOC();
    279   if (!pocHasMsb)
    280   {
    281     poc = poc % pocCycle;
    282   }
    283  
    284259  while ( iterPic != rcListPic.end() )
    285260  {
    286261    pcPic = *(iterPic);
    287     if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced())
    288     {
    289       Int picPoc = pcPic->getPOC();
    290       if (!pocHasMsb)
    291       {
    292         picPoc = picPoc % pocCycle;
    293       }
    294      
    295       if (poc == picPoc)
     262    if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC())))
    296263    {
    297264      if(pcPic->getIsLongTerm())
     
    305272      break;
    306273    }
    307     }
    308274
    309275    iterPic++;
    310276  }
    311  
    312277  return  pcStPic;
    313278}
     
    328293}
    329294
    330 #if L0034_COMBINED_LIST_CLEANUP
    331 Void TComSlice::setList1IdxToList0Idx()
    332 {
    333   Int idxL0, idxL1;
    334   for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ )
    335   {
    336     m_list1IdxToList0Idx[idxL1] = -1;
    337     for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ )
    338     {
    339       if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() )
    340       {
    341         m_list1IdxToList0Idx[idxL1] = idxL0;
    342         break;
    343       }
    344     }
    345   }
    346 }
    347 #else
    348295Void TComSlice::generateCombinedList()
    349296{
     
    418365  }
    419366}
    420 #endif
    421367
    422368#if H_MV
    423 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
    424 #else
    425 #if FIX1071
    426 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
     369Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer )
    427370#else
    428371Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
    429372#endif
    430 #endif
    431 {
    432 #if FIX1071
    433   if (!checkNumPocTotalCurr)
    434 #endif
    435   {
    436     if (m_eSliceType == I_SLICE)
    437     {
    438       ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    439       ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    440      
    441       return;
    442     }
     373{
     374  if (m_eSliceType == I_SLICE)
     375  {
     376    ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     377    ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    443378   
     379    return;
     380  }
     381 
    444382#if !H_MV
    445     m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    446     m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    447 #endif
    448   }
     383  m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     384  m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     385#endif
    449386
    450387  TComPic*  pcRefPic= NULL;
     
    473410    }
    474411  }
    475  
    476412  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
    477413  {
     
    486422    }
    487423  }
    488  
    489424  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
    490425  {
    491426    if(m_pcRPS->getUsed(i))
    492427    {
    493       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     428      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
    494429      pcRefPic->setIsLongTerm(1);
    495430      pcRefPic->getPicYuvRec()->extendPicBorder();
     
    499434    if(pcRefPic==NULL)
    500435    {
    501       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     436      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
    502437    }
    503438    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     
    513448  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    514449#endif
    515 #if FIX1071
    516   if (checkNumPocTotalCurr)
    517   {
    518     // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
     450
     451  {
     452    Int cIdx = 0;
     453    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     454    {
     455      rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
     456    }
     457    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     458    {
     459      rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
     460    }
     461    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     462    {
     463      rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
     464    }
    519465#if H_MV
    520     // – If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    521     // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    522     if ( getRapPicFlag() && m_layerId == 0 )
    523 #else
    524     // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    525     // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    526     if (getRapPicFlag())
    527 #endif
    528     {
    529       assert(numPocTotalCurr == 0);
    530     }
    531 
    532     if (m_eSliceType == I_SLICE)
    533     {
    534       ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    535       ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    536      
    537       return;
    538     }
    539    
    540     assert(numPocTotalCurr != 0);
    541    
    542     m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    543     m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    544   }
    545 #endif
    546 
    547   Int cIdx = 0;
    548   for ( i=0; i<NumPocStCurr0; i++, cIdx++)
    549   {
    550     rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
    551   }
    552   for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    553   {
    554     rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
    555   }
    556   for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
    557   {
    558     rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    559   }
    560 #if H_MV
    561   for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
    562   {
    563     if( cIdx <= MAX_NUM_REF )
    564     {
    565       rpsCurrList0[cIdx] = refPicSetInterLayer[i];
    566     }
    567   }
    568 #endif
     466    for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
     467    {
     468      if( cIdx <= MAX_NUM_REF )
     469      {
     470        rpsCurrList0[cIdx] = refPicSetInterLayer[i];
     471      }
     472    }
     473#endif
     474  }
    569475
    570476  if (m_eSliceType==B_SLICE)
    571477  {
    572     cIdx = 0;
     478    Int cIdx = 0;
    573479    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    574480    {
     
    679585}
    680586
    681 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
     587Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA)
    682588{
    683589  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    692598    if(pocCRA < MAX_UINT && getPOC() > pocCRA)
    693599    {
    694       if (!pReferencePictureSet->getCheckLTMSBPresent(i))
    695       {
    696         assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA);
    697       }
    698       else
    699       {
    700600      assert(pReferencePictureSet->getPOC(i) >= pocCRA);
    701601    }
    702602  }
    703   }
    704   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
     603  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
    705604  {
    706605    pocCRA = getPOC();
     
    712611    prevRAPisBLA = false;
    713612  }
    714   else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    715          || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     613  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
     614         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
    716615         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
    717616  {
     
    744643  Int pocCurr = getPOC();
    745644
    746   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    747     || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     645  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
     646    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
    748647    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    749     || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     648    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
    750649    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )  // IDR or BLA picture
    751650  {
     
    759658      iterPic++;
    760659    }
    761     if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    762       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     660    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
     661      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
    763662      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
    764663    {
     
    774673      {
    775674        rpcPic = *(iterPic);
    776         if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA)
    777         {
    778           rpcPic->getSlice(0)->setReferenced(false);
    779         }
     675        if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false);
    780676        iterPic++;
    781677      }
     
    811707  m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
    812708 
    813 #if L0034_COMBINED_LIST_CLEANUP
    814   for (i = 0; i < 2; i++)
    815 #else
    816709  for (i = 0; i < 3; i++)
    817 #endif
    818710  {
    819711    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    820712  }
    821713
    822 #if L0034_COMBINED_LIST_CLEANUP
    823   for (i = 0; i < MAX_NUM_REF; i++)
    824   {
    825     m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
    826   }
    827 #else
    828714  for (i = 0; i < 2; i++)
    829715  {
     
    842728  m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
    843729  m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
    844 #endif
    845730  m_bCheckLDC             = pSrc->m_bCheckLDC;
    846731  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    900785  }
    901786
    902 #if !L0034_COMBINED_LIST_CLEANUP
    903787  m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
    904 #endif
    905788  m_uiTLayer                      = pSrc->m_uiTLayer;
    906789  m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
     
    936819
    937820Int TComSlice::m_prevPOC = 0;
    938 
    939821/** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
    940822 * \param uiTLayer Temporal layer ID of the current slice
     
    997879  Int i, isReference;
    998880
     881  Int j = 0;
    999882  // loop through all pictures in the reference picture buffer
    1000883  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    1001884  while ( iterPic != rcListPic.end())
    1002885  {
     886    j++;
    1003887    rpcPic = *(iterPic++);
    1004 
    1005     if(!rpcPic->getSlice( 0 )->isReferenced())
    1006     {
    1007       continue;
    1008     }
    1009888
    1010889    isReference = 0;
     
    1045924    {           
    1046925      rpcPic->getSlice( 0 )->setReferenced( false );   
    1047       rpcPic->setUsedByCurr(0);
    1048926      rpcPic->setIsLongTerm(0);
    1049927    }
     
    1051929    assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer());
    1052930    //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
    1053     if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
     931    if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
    1054932    {
    1055933      assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer());
    1056934    }
     935
    1057936    //check that pictures marked as temporal layer non-reference pictures are not used for reference
    1058937    if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && rpcPic->getTLayer()==this->getTLayer())
     
    1068947{
    1069948  TComPic* rpcPic;
    1070   Int i, isAvailable;
     949  Int i, isAvailable, j;
    1071950  Int atLeastOneLost = 0;
    1072951  Int atLeastOneRemoved = 0;
     
    1077956  for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
    1078957  {
     958    j = 0;
    1079959    isAvailable = 0;
    1080960    // loop through all pictures in the reference picture buffer
     
    1082962    while ( iterPic != rcListPic.end())
    1083963    {
     964      j++;
    1084965      rpcPic = *(iterPic++);
    1085966      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
     
    1104985      while ( iterPic != rcListPic.end())
    1105986      {
     987        j++;
    1106988        rpcPic = *(iterPic++);
    1107989
    1108         Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
    1109         Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC();
    1110         Int refPoc = pReferencePictureSet->getPOC(i);
    1111         if (!pReferencePictureSet->getCheckLTMSBPresent(i))
    1112         {
    1113           curPoc = curPoc % pocCycle;
    1114           refPoc = refPoc % pocCycle;
    1115         }
    1116        
    1117         if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
     990        if((rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == (this->getPOC() + pReferencePictureSet->getDeltaPOC(i))%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced())
    1118991        {
    1119992          isAvailable = 1;
     
    11531026  for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
    11541027  {
     1028    j = 0;
    11551029    isAvailable = 0;
    11561030    // loop through all pictures in the reference picture buffer
     
    11581032    while ( iterPic != rcListPic.end())
    11591033    {
     1034      j++;
    11601035      rpcPic = *(iterPic++);
    11611036
     
    11741049        {
    11751050          if(printErrors)
    1176           {
    11771051            printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
    1178           }
    11791052          atLeastOneRemoved = 1;
    11801053        }
     
    11821055        {
    11831056          if(printErrors)
    1184           {
    11851057            printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
    1186           }
    11871058          atLeastOneLost = 1;
    11881059          iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
     
    13301201 * \returns Void
    13311202 */
    1332 Void  TComSlice::resetWpScaling()
     1203Void  TComSlice::resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
    13331204{
    13341205  for ( Int e=0 ; e<2 ; e++ )
     
    13381209      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    13391210      {
    1340         wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
     1211        wpScalingParam  *pwp = &(wp[e][i][yuv]);
    13411212        pwp->bPresentFlag      = false;
    13421213        pwp->uiLog2WeightDenom = 0;
     
    13541225Void  TComSlice::initWpScaling()
    13551226{
     1227  initWpScaling(m_weightPredTable);
     1228}
     1229
     1230/** set WP tables
     1231 * \param wpScalingParam
     1232 * \returns Void
     1233 */
     1234Void  TComSlice::initWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
     1235{
    13561236  for ( Int e=0 ; e<2 ; e++ )
    13571237  {
     
    13601240      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    13611241      {
    1362         wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
    1363         if ( !pwp->bPresentFlag )
    1364         {
     1242        wpScalingParam  *pwp = &(wp[e][i][yuv]);
     1243        if ( !pwp->bPresentFlag ) {
    13651244          // Inferring values not present :
    13661245          pwp->iWeight = (1 << pwp->uiLog2WeightDenom);
     
    13961275, m_cprmsPresentFlag          (NULL)
    13971276{
     1277
    13981278  for( Int i = 0; i < MAX_TLAYER; i++)
    13991279  {
    14001280    m_numReorderPics[i] = 0;
    1401 #if L0323_DPB
    1402     m_uiMaxDecPicBuffering[i] = 1;
    1403 #else
    14041281    m_uiMaxDecPicBuffering[i] = 0;
    1405 #endif
    14061282    m_uiMaxLatencyIncrease[i] = 0;
    14071283  }
     
    14571333TComVPS::~TComVPS()
    14581334{
    1459 if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
    1460   if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
    1461   if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
     1335  if( m_hrdParameters    != NULL )     delete m_hrdParameters;
     1336  if( m_hrdOpSetIdx      != NULL )     delete m_hrdOpSetIdx;
     1337  if( m_cprmsPresentFlag != NULL )     delete m_cprmsPresentFlag;
    14621338}
    14631339
     
    15491425}
    15501426#endif
     1427
    15511428// ------------------------------------------------------------------------------------------------
    15521429// Sequence parameter set (SPS)
     
    15611438, m_picWidthInLumaSamples     (352)
    15621439, m_picHeightInLumaSamples    (288)
    1563 , m_log2MinCodingBlockSize    (  0)
    1564 , m_log2DiffMaxMinCodingBlockSize (0)
    15651440, m_uiMaxCUWidth              ( 32)
    15661441, m_uiMaxCUHeight             ( 32)
    15671442, m_uiMaxCUDepth              (  3)
     1443, m_uiMinTrDepth              (  0)
     1444, m_uiMaxTrDepth              (  1)
    15681445, m_bLongTermRefsPresent      (false)
    15691446, m_uiQuadtreeTULog2MaxSize   (  0)
     
    15751452, m_pcmLog2MaxSize            (  5)
    15761453, m_uiPCMLog2MinSize          (  7)
    1577 #if !L0034_COMBINED_LIST_CLEANUP
    15781454, m_bUseLComb                 (false)
    1579 #endif
    15801455, m_bitDepthY                 (  8)
    15811456, m_bitDepthC                 (  8)
     
    15951470, m_vuiParametersPresentFlag  (false)
    15961471, m_vuiParameters             ()
    1597 #if H_MV
    1598 , m_interViewMvVertConstraintFlag (false)
    1599 #endif
    16001472{
    16011473  for ( Int i = 0; i < MAX_TLAYER; i++ )
    16021474  {
    16031475    m_uiMaxLatencyIncrease[i] = 0;
    1604 #if L0323_DPB
    1605     m_uiMaxDecPicBuffering[i] = 1;
    1606 #else
    16071476    m_uiMaxDecPicBuffering[i] = 0;
    1608 #endif
    16091477    m_numReorderPics[i]       = 0;
    16101478  }
     
    16251493  m_RPSList.create(numRPS);
    16261494}
    1627 
    16281495Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
    16291496{
     
    18701737  return m_POC[bufferNum];
    18711738}
    1872 
    18731739Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC)
    18741740{
    18751741  m_POC[bufferNum] = POC;
    18761742}
    1877 
    18781743Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum)
    18791744{
    18801745  return m_bCheckLTMSB[bufferNum];
    18811746}
    1882 
    18831747Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b)
    18841748{
     
    21482012}
    21492013#endif
     2014
    21502015/** get scaling matrix from RefMatrixID
    21512016 * \param sizeId size index
     
    21572022  ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
    21582023}
    2159 
    21602024/** parse syntax infomation
    21612025 *  \param pchFile syntax infomation
     
    22502114  m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32
    22512115}
    2252 
    22532116/** destroy quantization matrix array
    22542117 */
     
    22632126  }
    22642127}
    2265 
    22662128/** get default address of quantization matrix
    22672129 * \param sizeId size index
     
    22932155  return src;
    22942156}
    2295 
    22962157/** process of default matrix
    22972158 * \param sizeId size index
     
    23032164  setScalingListDC(sizeId,listId,SCALING_LIST_DC);
    23042165}
    2305 
    23062166/** check DC value of matrix for default matrix signaling
    23072167 */
     
    23642224//! activate a PPS and depending on isIDR parameter also SPS and VPS
    23652225//! \returns true, if activation is successful
    2366 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
     2226Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR)
    23672227{
    23682228  TComPPS *pps = m_ppsMap.getPS(ppsId);
     
    23732233    // active parameter sets per layer should be used here
    23742234#else
    2375     if (!isIRAP && (spsId != m_activeSPSId))
    2376     {
    2377       printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
     2235    if (!isIDR && (spsId != m_activeSPSId))
     2236    {
     2237      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
    23782238      return false;
    23792239    }
     
    23832243    {
    23842244      Int vpsId = sps->getVPSId();
    2385       if (!isIRAP && (vpsId != m_activeVPSId))
    2386       {
    2387         printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
     2245      if (!isIDR && (vpsId != m_activeVPSId))
     2246      {
     2247        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
    23882248        return false;
    23892249      }
     
    24442304}
    24452305#endif
     2306
    24462307#if SIGNAL_BITRATE_PICRATE_IN_VPS
    24472308TComBitRatePicRateInfo::TComBitRatePicRateInfo()
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.h

    r368 r438  
    248248  ProfileTierLevel* getGeneralPTL()  { return &m_generalPTL; }
    249249  ProfileTierLevel* getSubLayerPTL(Int i)  { return &m_subLayerPTL[i]; }
     250
    250251#if H_MV
    251252  Void copyLevelFrom( TComPTL* source );
     
    535536
    536537#endif
     538
    537539public:
    538540  TComVPS();
     
    594596  TComPTL* getPTL() { return &m_pcPTL; }
    595597#endif
     598
    596599#if SIGNAL_BITRATE_PICRATE_IN_VPS
    597600  TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; }
     
    600603  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    601604#endif
     605
    602606#if H_MV
    603607  Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
     
    901905  UInt        m_picHeightInLumaSamples;
    902906 
    903   Int         m_log2MinCodingBlockSize;
    904   Int         m_log2DiffMaxMinCodingBlockSize;
     907  Window      m_conformanceWindow;
     908
    905909  UInt        m_uiMaxCUWidth;
    906910  UInt        m_uiMaxCUHeight;
    907911  UInt        m_uiMaxCUDepth;
    908 
    909   Window      m_conformanceWindow;
    910 
     912  UInt        m_uiMinTrDepth;
     913  UInt        m_uiMaxTrDepth;
    911914  TComRPSList m_RPSList;
    912915  Bool        m_bLongTermRefsPresent;
     
    924927  Bool        m_useAMP;
    925928
    926 #if !L0034_COMBINED_LIST_CLEANUP
    927929  Bool        m_bUseLComb;
    928 #endif
    929930 
    930931  // Parameter
     
    967968  static const Int   m_winUnitY[MAX_CHROMA_FORMAT_IDC+1];
    968969  TComPTL     m_pcPTL;
    969 #if H_MV
    970   Bool        m_interViewMvVertConstraintFlag;
    971 #endif
    972970public:
    973971  TComSPS();
     
    1001999  Bool getUsedByCurrPicLtSPSFlag(Int i)        {return m_usedByCurrPicLtSPSFlag[i];}
    10021000  Void setUsedByCurrPicLtSPSFlag(Int i, Bool x)      { m_usedByCurrPicLtSPSFlag[i] = x;}
    1003 
    1004   Int  getLog2MinCodingBlockSize() const           { return m_log2MinCodingBlockSize; }
    1005   Void setLog2MinCodingBlockSize(Int val)          { m_log2MinCodingBlockSize = val; }
    1006   Int  getLog2DiffMaxMinCodingBlockSize() const    { return m_log2DiffMaxMinCodingBlockSize; }
    1007   Void setLog2DiffMaxMinCodingBlockSize(Int val)   { m_log2DiffMaxMinCodingBlockSize = val; }
    1008 
    10091001  Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
    10101002  UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
     
    10231015  Bool getUseAMP() { return m_useAMP; }
    10241016  Void setUseAMP( Bool b ) { m_useAMP = b; }
     1017  Void setMinTrDepth  ( UInt u ) { m_uiMinTrDepth = u;      }
     1018  UInt getMinTrDepth  ()         { return  m_uiMinTrDepth;  }
     1019  Void setMaxTrDepth  ( UInt u ) { m_uiMaxTrDepth = u;      }
     1020  UInt getMaxTrDepth  ()         { return  m_uiMaxTrDepth;  }
    10251021  Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u;    }
    10261022  UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
     
    10441040 
    10451041  // Tool list
    1046 #if !L0034_COMBINED_LIST_CLEANUP
    10471042  Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
    10481043  Bool getUseLComb    ()         { return m_bUseLComb;      }
    1049 #endif
    10501044
    10511045  Bool getUseLossless ()         { return m_useLossless; }
     
    11001094
    11011095  TComPTL* getPTL()     { return &m_pcPTL; }
    1102 #if H_MV
    1103   Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }
    1104   Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
    1105 #endif
    11061096};
    11071097
     
    11301120  Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; }
    11311121  UInt       getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; }
     1122
    11321123#if H_MV
    11331124  // Why not an listIdx for all members, would avoid code duplication??
     
    13661357  Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
    13671358  Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    1368 #if L0034_COMBINED_LIST_CLEANUP
    1369   Int         m_list1IdxToList0Idx[MAX_NUM_REF];
    1370   Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
    1371 #else
     1359 
    13721360  Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
    13731361
     
    13791367  Bool        m_bRefPicListModificationFlagLC;
    13801368  Bool        m_bRefPicListCombinationFlag;
    1381 #endif
    13821369
    13831370  Bool        m_bCheckLDC;
     
    14201407
    14211408  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
    1422 #if !L0034_COMBINED_LIST_CLEANUP
     1409 
    14231410  Bool        m_bNoBackPredFlag;
    1424 #endif
    14251411  UInt        m_uiTLayer;
    14261412  Bool        m_bTLayerSwitchingFlag;
     
    14571443
    14581444  Bool       m_enableTMVPFlag;
     1445
    14591446#if H_MV
    14601447  Int        m_layerId;
     
    14641451#endif
    14651452#endif
     1453
    14661454public:
    14671455  TComSlice();
     
    15281516  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
    15291517  Int       getNumRpsCurrTempList();
    1530 #if L0034_COMBINED_LIST_CLEANUP
    1531   Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
    1532 #else
    15331518  Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
    15341519  Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
     
    15401525  Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
    15411526  Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}   
    1542 #endif
    15431527  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    15441528  Bool      isReferenced()                                      { return m_bRefenced; }
    15451529  Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
    15461530  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
    1547   NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
     1531  NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
    15481532  Bool      getRapPicFlag       (); 
    1549   Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    1550   Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 
    1551   Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);
     1533  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
     1534  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA);
    15521535  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
    15531536  Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
     
    15751558#endif
    15761559#if H_MV
    1577   Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );
    1578 #else
    1579 #if FIX1071
    1580   Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
     1560  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet );
    15811561#else
    15821562  Void      setRefPicList       ( TComList<TComPic*>& rcListPic );
    1583 #endif
    15841563#endif
    15851564  Void      setRefPOCList       ();
     
    16151594 
    16161595  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    1617 #if L0034_COMBINED_LIST_CLEANUP
    1618   Void setList1IdxToList0Idx();
    1619 #else
     1596 
    16201597  Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
    16211598  Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
    16221599  Void generateCombinedList       ();
    1623 #endif
    16241600
    16251601  UInt getTLayer             ()                            { return m_uiTLayer;                      }
     
    16291605  Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
    16301606  Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
     1607
    16311608#if H_MV
    16321609  Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );
     
    16371614  Void xPrintRefPicList();
    16381615#endif
     1616
    16391617  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    16401618  Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
     
    16771655  Void  getWpScaling    ( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
    16781656
    1679   Void  resetWpScaling  ();
     1657  Void  resetWpScaling  (wpScalingParam  wp[2][MAX_NUM_REF][3]);
     1658  Void  initWpScaling    (wpScalingParam  wp[2][MAX_NUM_REF][3]);
    16801659  Void  initWpScaling   ();
    16811660  inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); }
     
    17231702#endif
    17241703#endif
     1704
    17251705protected:
    17261706  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
    17271707                         Int                 poc);
    1728 TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
     1708  TComPic*  xGetLongTermRefPic  (TComList<TComPic*>& rcListPic,
     1709                         Int                 poc);
    17291710#if H_MV
    17301711  TComPic*  xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );
     
    18131794  //! activate a PPS and depending on isIDR parameter also SPS and VPS
    18141795  //! \returns true, if activation is successful
    1815   Bool activatePPS(Int ppsId, Bool isIRAP);
     1796  Bool activatePPS(Int ppsId, Bool isIDR);
    18161797
    18171798  TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r362 r438  
    19861986          }
    19871987         
    1988           if(piDstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768)
     1988          if(piQCoef[minPos] == 32767 || piQCoef[minPos] == -32768)
    19891989          {
    19901990            finalChange = -1;
  • branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TypeDef.h

    r368 r438  
    4949#endif
    5050
    51 ///// ***** HM 10.1 *********
    52 #define FIX1071 1 ///< Temporary fix for issue #1071
    53 
    54 #define L0208_SOP_DESCRIPTION_SEI     1 ///< L0208: add SOP descrioption SEI
    55 #define MAX_NUM_PICS_IN_SOP           1024
    56 
    57 #define K0180_SCALABLE_NESTING_SEI  1   ///JCTVC-K0180 scalable nesting sei message
    58 #define MAX_NESTING_NUM_OPS         1024
    59 #define MAX_NESTING_NUM_LAYER       64
    60 
    61 #define J0149_TONE_MAPPING_SEI        1 ///< J0149: Tone mapping information SEI
     51///// ***** HM 10.0 *********
     52
    6253#define L0363_DU_BIT_RATE             1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters
    6354#define L0328_SPLICING                1 ///< L0328: splicing support in HRD
     
    8475#define SIGNAL_BITRATE_PICRATE_IN_VPS               0  ///< K0125: Signal bit_rate and pic_rate in VPS
    8576#define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
    86 #define L0386_DB_METRIC            1  ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream)
    87 #define L0323_DPB                     1 ///< L0323: Specification of active reference indices and decoded picture buffer
    88 
    89 #define L0034_COMBINED_LIST_CLEANUP 1
    9077
    9178#define MAX_VPS_NUM_HRD_PARAMETERS                1
    9279#define MAX_VPS_OP_SETS_PLUS1                     1024
     80
    9381#if H_MV
    9482#define MAX_VPS_NUH_LAYER_ID_PLUS1  64
     
    10492#define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
    10593#define MAX_NUM_LAYER_IDS               64
    106 #if H_MV
    10794#define MAX_NUM_LAYERS                  64
    108 #endif
    10995
    11096#define COEF_REMAIN_BIN_REDUCTION        3 ///< indicates the level at which the VLC
     
    426412  REF_PIC_LIST_0 = 0,   ///< reference list 0
    427413  REF_PIC_LIST_1 = 1,   ///< reference list 1
    428 #if !L0034_COMBINED_LIST_CLEANUP
    429414  REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
    430 #endif
    431415  REF_PIC_LIST_X = 100  ///< special mark
    432416};
     
    570554#endif
    571555#endif
     556
Note: See TracChangeset for help on using the changeset viewer.