Changeset 1459 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
20 Aug 2015, 19:49:34 (9 years ago)
Author:
seregin
Message:

port rev 4593

Location:
branches/SHM-dev/source/Lib
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r1442 r1459  
    158158  virtual ~SEIDecodedPictureHash() {}
    159159
    160   enum Method
    161   {
    162     MD5,
    163     CRC,
    164     CHECKSUM,
    165     RESERVED,
    166   } method;
     160  HashType method;
    167161
    168162  TComPictureHash m_pictureHash;
  • TabularUnified branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1442 r1459  
    558558  FIXED_NUMBER_OF_BYTES  = 2,          ///< Limit maximum number of bytes in a slice / slice segment
    559559  FIXED_NUMBER_OF_TILES  = 3,          ///< slices / slice segments span an integer number of tiles
     560  NUMBER_OF_SLICE_CONSTRAINT_MODES = 4
     561};
     562
     563// For use with decoded picture hash SEI messages, generated by encoder.
     564enum HashType
     565{
     566  HASHTYPE_MD5             = 0,
     567  HASHTYPE_CRC             = 1,
     568  HASHTYPE_CHECKSUM        = 2,
     569  HASHTYPE_NONE            = 3,
     570  NUMBER_OF_HASHTYPES      = 4
    560571};
    561572
  • TabularUnified branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1442 r1459  
    520520  UInt val;
    521521  sei_read_code( pDecodedMessageOutputStream, 8, val, "hash_type");
    522   sei.method = static_cast<SEIDecodedPictureHash::Method>(val); bytesRead++;
     522  sei.method = static_cast<HashType>(val); bytesRead++;
    523523
    524524  const TChar *traceString="\0";
    525525  switch (sei.method)
    526526  {
    527     case SEIDecodedPictureHash::MD5: traceString="picture_md5"; break;
    528     case SEIDecodedPictureHash::CRC: traceString="picture_crc"; break;
    529     case SEIDecodedPictureHash::CHECKSUM: traceString="picture_checksum"; break;
     527    case HASHTYPE_MD5: traceString="picture_md5"; break;
     528    case HASHTYPE_CRC: traceString="picture_crc"; break;
     529    case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break;
    530530    default: assert(false); break;
    531531  }
  • TabularUnified branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r1442 r1459  
    9595#if SVC_EXTENSION
    9696Void TDecGop::init( TDecTop**               ppcDecTop,
    97                    TDecEntropy*             pcEntropyDecoder,
     97                    TDecEntropy*            pcEntropyDecoder,
    9898#else
    9999Void TDecGop::init( TDecEntropy*            pcEntropyDecoder,
     
    290290    switch (pictureHashSEI->method)
    291291    {
    292       case SEIDecodedPictureHash::MD5:
     292      case HASHTYPE_MD5:
    293293        {
    294294          hashType = "MD5";
     
    296296          break;
    297297        }
    298       case SEIDecodedPictureHash::CRC:
     298      case HASHTYPE_CRC:
    299299        {
    300300          hashType = "CRC";
     
    302302          break;
    303303        }
    304       case SEIDecodedPictureHash::CHECKSUM:
     304      case HASHTYPE_CHECKSUM:
    305305        {
    306306          hashType = "Checksum";
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp

    r1434 r1459  
    312312  assert (pcPic!=NULL);
    313313
    314   if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 1)
    315   {
    316     decodedPictureHashSEI->method = SEIDecodedPictureHash::MD5;
    317     UInt numChar=calcMD5(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
    318     rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
    319   }
    320   else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 2)
    321   {
    322     decodedPictureHashSEI->method = SEIDecodedPictureHash::CRC;
    323     UInt numChar=calcCRC(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
    324     rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
    325   }
    326   else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 3)
    327   {
    328     decodedPictureHashSEI->method = SEIDecodedPictureHash::CHECKSUM;
    329     UInt numChar=calcChecksum(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
    330     rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
     314  decodedPictureHashSEI->method = m_pcCfg->getDecodedPictureHashSEIType();
     315  switch (m_pcCfg->getDecodedPictureHashSEIType())
     316  {
     317    case HASHTYPE_MD5:
     318      {
     319        UInt numChar=calcMD5(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
     320        rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
     321      }
     322      break;
     323    case HASHTYPE_CRC:
     324      {
     325        UInt numChar=calcCRC(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
     326        rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
     327      }
     328      break;
     329    case HASHTYPE_CHECKSUM:
     330    default:
     331      {
     332        UInt numChar=calcChecksum(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths);
     333        rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar);
     334      }
     335      break;
    331336  }
    332337}
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r1442 r1459  
    309309  switch (sei.method)
    310310  {
    311     case SEIDecodedPictureHash::MD5: traceString="picture_md5"; break;
    312     case SEIDecodedPictureHash::CRC: traceString="picture_crc"; break;
    313     case SEIDecodedPictureHash::CHECKSUM: traceString="picture_checksum"; break;
     311    case HASHTYPE_MD5: traceString="picture_md5"; break;
     312    case HASHTYPE_CRC: traceString="picture_crc"; break;
     313    case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break;
    314314    default: assert(false); break;
    315315  }
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1442 r1459  
    257257  std::vector<Int> m_tileRowHeight;
    258258
    259   Int       m_iWaveFrontSynchro;
    260 
    261   Int       m_decodedPictureHashSEIEnabled;              ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
    262   Int       m_bufferingPeriodSEIEnabled;
    263   Int       m_pictureTimingSEIEnabled;
    264   Int       m_recoveryPointSEIEnabled;
     259  Bool      m_entropyCodingSyncEnabledFlag;
     260
     261  HashType  m_decodedPictureHashSEIType;
     262  Bool      m_bufferingPeriodSEIEnabled;
     263  Bool      m_pictureTimingSEIEnabled;
     264  Bool      m_recoveryPointSEIEnabled;
    265265  Bool      m_toneMappingInfoSEIEnabled;
    266266  Int       m_toneMapId;
     
    290290  Int*      m_codedPivotValue;
    291291  Int*      m_targetPivotValue;
    292   Int       m_framePackingSEIEnabled;
     292  Bool      m_framePackingSEIEnabled;
    293293  Int       m_framePackingSEIType;
    294294  Int       m_framePackingSEIId;
    295295  Int       m_framePackingSEIQuincunx;
    296296  Int       m_framePackingSEIInterpretation;
    297   Int       m_segmentedRectFramePackingSEIEnabled;
     297  Bool      m_segmentedRectFramePackingSEIEnabled;
    298298  Bool      m_segmentedRectFramePackingSEICancel;
    299299  Int       m_segmentedRectFramePackingSEIType;
    300300  Bool      m_segmentedRectFramePackingSEIPersistence;
    301301  Int       m_displayOrientationSEIAngle;
    302   Int       m_temporalLevel0IndexSEIEnabled;
    303   Int       m_gradualDecodingRefreshInfoEnabled;
     302  Bool      m_temporalLevel0IndexSEIEnabled;
     303  Bool      m_gradualDecodingRefreshInfoEnabled;
    304304  Int       m_noDisplaySEITLayer;
    305   Int       m_decodingUnitInfoSEIEnabled;
    306   Int       m_SOPDescriptionSEIEnabled;
    307   Int       m_scalableNestingSEIEnabled;
     305  Bool      m_decodingUnitInfoSEIEnabled;
     306  Bool      m_SOPDescriptionSEIEnabled;
     307  Bool      m_scalableNestingSEIEnabled;
    308308  Bool      m_tmctsSEIEnabled;
    309309  Bool      m_timeCodeSEIEnabled;
     
    780780  UInt  getRowHeight                   ( UInt rowIdx )               { return m_tileRowHeight[rowIdx]; }
    781781  Void  xCheckGSParameters();
    782   Void  setWaveFrontSynchro(Int iWaveFrontSynchro)                   { m_iWaveFrontSynchro = iWaveFrontSynchro; }
    783   Int   getWaveFrontsynchro()                                        { return m_iWaveFrontSynchro; }
    784   Void  setDecodedPictureHashSEIEnabled(Int b)                       { m_decodedPictureHashSEIEnabled = b; }
    785   Int   getDecodedPictureHashSEIEnabled()                            { return m_decodedPictureHashSEIEnabled; }
    786   Void  setBufferingPeriodSEIEnabled(Int b)                          { m_bufferingPeriodSEIEnabled = b; }
    787   Int   getBufferingPeriodSEIEnabled()                               { return m_bufferingPeriodSEIEnabled; }
    788   Void  setPictureTimingSEIEnabled(Int b)                            { m_pictureTimingSEIEnabled = b; }
    789   Int   getPictureTimingSEIEnabled()                                 { return m_pictureTimingSEIEnabled; }
    790   Void  setRecoveryPointSEIEnabled(Int b)                            { m_recoveryPointSEIEnabled = b; }
    791   Int   getRecoveryPointSEIEnabled()                                 { return m_recoveryPointSEIEnabled; }
     782  Void  setEntropyCodingSyncEnabledFlag(Bool b)                      { m_entropyCodingSyncEnabledFlag = b; }
     783  Bool  getEntropyCodingSyncEnabledFlag() const                      { return m_entropyCodingSyncEnabledFlag; }
     784  Void  setDecodedPictureHashSEIType(HashType m)                     { m_decodedPictureHashSEIType = m; }
     785  HashType getDecodedPictureHashSEIType() const                      { return m_decodedPictureHashSEIType; }
     786  Void  setBufferingPeriodSEIEnabled(Bool b)                         { m_bufferingPeriodSEIEnabled = b; }
     787  Bool  getBufferingPeriodSEIEnabled() const                         { return m_bufferingPeriodSEIEnabled; }
     788  Void  setPictureTimingSEIEnabled(Bool b)                           { m_pictureTimingSEIEnabled = b; }
     789  Bool  getPictureTimingSEIEnabled() const                           { return m_pictureTimingSEIEnabled; }
     790  Void  setRecoveryPointSEIEnabled(Bool b)                           { m_recoveryPointSEIEnabled = b; }
     791  Bool  getRecoveryPointSEIEnabled() const                           { return m_recoveryPointSEIEnabled; }
    792792  Void  setToneMappingInfoSEIEnabled(Bool b)                         { m_toneMappingInfoSEIEnabled = b;  }
    793793  Bool  getToneMappingInfoSEIEnabled()                               { return m_toneMappingInfoSEIEnabled;  }
     
    844844  Void  setTMISEIExtendedWhiteLevelLumaCodeValue(Int b)              { m_extendedWhiteLevelLumaCodeValue =b;  }
    845845  Int   getTMISEIExtendedWhiteLevelLumaCodeValue()                   { return m_extendedWhiteLevelLumaCodeValue;  }
    846   Void  setFramePackingArrangementSEIEnabled(Int b)                  { m_framePackingSEIEnabled = b; }
    847   Int   getFramePackingArrangementSEIEnabled()                       { return m_framePackingSEIEnabled; }
     846  Void  setFramePackingArrangementSEIEnabled(Bool b)                 { m_framePackingSEIEnabled = b; }
     847  Bool  getFramePackingArrangementSEIEnabled() const                 { return m_framePackingSEIEnabled; }
    848848  Void  setFramePackingArrangementSEIType(Int b)                     { m_framePackingSEIType = b; }
    849849  Int   getFramePackingArrangementSEIType()                          { return m_framePackingSEIType; }
     
    854854  Void  setFramePackingArrangementSEIInterpretation(Int b)           { m_framePackingSEIInterpretation = b; }
    855855  Int   getFramePackingArrangementSEIInterpretation()                { return m_framePackingSEIInterpretation; }
    856   Void  setSegmentedRectFramePackingArrangementSEIEnabled(Int b)     { m_segmentedRectFramePackingSEIEnabled = b; }
    857   Int   getSegmentedRectFramePackingArrangementSEIEnabled()          { return m_segmentedRectFramePackingSEIEnabled; }
     856  Void  setSegmentedRectFramePackingArrangementSEIEnabled(Bool b)    { m_segmentedRectFramePackingSEIEnabled = b; }
     857  Bool  getSegmentedRectFramePackingArrangementSEIEnabled() const    { return m_segmentedRectFramePackingSEIEnabled; }
    858858  Void  setSegmentedRectFramePackingArrangementSEICancel(Int b)      { m_segmentedRectFramePackingSEICancel = b; }
    859859  Int   getSegmentedRectFramePackingArrangementSEICancel()           { return m_segmentedRectFramePackingSEICancel; }
     
    864864  Void  setDisplayOrientationSEIAngle(Int b)                         { m_displayOrientationSEIAngle = b; }
    865865  Int   getDisplayOrientationSEIAngle()                              { return m_displayOrientationSEIAngle; }
    866   Void  setTemporalLevel0IndexSEIEnabled(Int b)                      { m_temporalLevel0IndexSEIEnabled = b; }
    867   Int   getTemporalLevel0IndexSEIEnabled()                           { return m_temporalLevel0IndexSEIEnabled; }
    868   Void  setGradualDecodingRefreshInfoEnabled(Int b)                  { m_gradualDecodingRefreshInfoEnabled = b;    }
    869   Int   getGradualDecodingRefreshInfoEnabled()                       { return m_gradualDecodingRefreshInfoEnabled; }
     866  Void  setTemporalLevel0IndexSEIEnabled(Bool b)                     { m_temporalLevel0IndexSEIEnabled = b; }
     867  Bool  getTemporalLevel0IndexSEIEnabled() const                     { return m_temporalLevel0IndexSEIEnabled; }
     868  Void  setGradualDecodingRefreshInfoEnabled(Bool b)                 { m_gradualDecodingRefreshInfoEnabled = b;    }
     869  Bool  getGradualDecodingRefreshInfoEnabled() const                 { return m_gradualDecodingRefreshInfoEnabled; }
    870870  Void  setNoDisplaySEITLayer(Int b)                                 { m_noDisplaySEITLayer = b;    }
    871871  Int   getNoDisplaySEITLayer()                                      { return m_noDisplaySEITLayer; }
    872   Void  setDecodingUnitInfoSEIEnabled(Int b)                         { m_decodingUnitInfoSEIEnabled = b;    }
    873   Int   getDecodingUnitInfoSEIEnabled()                              { return m_decodingUnitInfoSEIEnabled; }
    874   Void  setSOPDescriptionSEIEnabled(Int b)                           { m_SOPDescriptionSEIEnabled = b; }
    875   Int   getSOPDescriptionSEIEnabled()                                { return m_SOPDescriptionSEIEnabled; }
    876   Void  setScalableNestingSEIEnabled(Int b)                          { m_scalableNestingSEIEnabled = b; }
    877   Int   getScalableNestingSEIEnabled()                               { return m_scalableNestingSEIEnabled; }
     872  Void  setDecodingUnitInfoSEIEnabled(Bool b)                        { m_decodingUnitInfoSEIEnabled = b;    }
     873  Bool  getDecodingUnitInfoSEIEnabled() const                        { return m_decodingUnitInfoSEIEnabled; }
     874  Void  setSOPDescriptionSEIEnabled(Bool b)                          { m_SOPDescriptionSEIEnabled = b; }
     875  Bool  getSOPDescriptionSEIEnabled() const                          { return m_SOPDescriptionSEIEnabled; }
     876  Void  setScalableNestingSEIEnabled(Bool b)                         { m_scalableNestingSEIEnabled = b; }
     877  Bool  getScalableNestingSEIEnabled() const                         { return m_scalableNestingSEIEnabled; }
    878878  Void  setTMCTSSEIEnabled(Bool b)                                   { m_tmctsSEIEnabled = b; }
    879879  Bool  getTMCTSSEIEnabled()                                         { return m_tmctsSEIEnabled; }
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1442 r1459  
    11391139
    11401140  // The last DU may have a trailing SEI
    1141   if (m_pcCfg->getDecodedPictureHashSEIEnabled())
     1141  if (m_pcCfg->getDecodedPictureHashSEIType()!=HASHTYPE_NONE)
    11421142  {
    11431143    duData.back().accumBitsDU += ( 20 << 3 ); // probably around 20 bytes - should be further adjusted, e.g. by type
     
    14731473  {
    14741474    return 1;
     1475  }
     1476}
     1477
     1478
     1479static Void
     1480printHash(const HashType hashType, const std::string &digestStr)
     1481{
     1482  const TChar *decodedPictureHashModeName;
     1483  switch (hashType)
     1484  {
     1485    case HASHTYPE_MD5:
     1486      decodedPictureHashModeName = "MD5";
     1487      break;
     1488    case HASHTYPE_CRC:
     1489      decodedPictureHashModeName = "CRC";
     1490      break;
     1491    case HASHTYPE_CHECKSUM:
     1492      decodedPictureHashModeName = "Checksum";
     1493      break;
     1494    default:
     1495      decodedPictureHashModeName = NULL;
     1496      break;
     1497  }
     1498  if (decodedPictureHashModeName != NULL)
     1499  {
     1500    if (digestStr.empty())
     1501    {
     1502      printf(" [%s:%s]", decodedPictureHashModeName, "?");
     1503    }
     1504    else
     1505    {
     1506      printf(" [%s:%s]", decodedPictureHashModeName, digestStr.c_str());
     1507    }
    14751508  }
    14761509}
     
    28332866
    28342867    std::string digestStr;
    2835     if (m_pcCfg->getDecodedPictureHashSEIEnabled())
     2868    if (m_pcCfg->getDecodedPictureHashSEIType()!=HASHTYPE_NONE)
    28362869    {
    28372870      SEIDecodedPictureHash *decodedPictureHashSei = new SEIDecodedPictureHash();
     
    28542887    xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE );
    28552888
    2856     if (!digestStr.empty())
    2857     {
    2858       if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 1)
    2859       {
    2860         printf(" [MD5:%s]", digestStr.c_str());
    2861       }
    2862       else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 2)
    2863       {
    2864         printf(" [CRC:%s]", digestStr.c_str());
    2865       }
    2866       else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 3)
    2867       {
    2868         printf(" [Checksum:%s]", digestStr.c_str());
    2869       }
    2870     }
     2889    printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr);
    28712890
    28722891    if ( m_pcCfg->getUseRateCtrl() )
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1401 r1459  
    859859    {
    860860      // This will only occur if dependent slice-segments (m_entropyCodingSyncContextState=true) are being used.
    861       if( pCurrentTile->getTileWidthInCtus() >= 2 || !m_pcCfg->getWaveFrontsynchro() )
     861      if( pCurrentTile->getTileWidthInCtus() >= 2 || !m_pcCfg->getEntropyCodingSyncEnabledFlag() )
    862862      {
    863863        m_pppcRDSbacCoder[0][CI_CURR_BEST]->loadContexts( &m_lastSliceSegmentEndContextState );
     
    884884      m_pppcRDSbacCoder[0][CI_CURR_BEST]->resetEntropy(pcSlice);
    885885    }
    886     else if ( ctuXPosInCtus == tileXPosInCtus && m_pcCfg->getWaveFrontsynchro())
     886    else if ( ctuXPosInCtus == tileXPosInCtus && m_pcCfg->getEntropyCodingSyncEnabledFlag())
    887887    {
    888888      // reset and then update contexts to the state at the end of the top-right CTU (if within current slice and tile).
     
    10071007
    10081008    // Store probabilities of second CTU in line into buffer - used only if wavefront-parallel-processing is enabled.
    1009     if ( ctuXPosInCtus == tileXPosInCtus+1 && m_pcCfg->getWaveFrontsynchro())
     1009    if ( ctuXPosInCtus == tileXPosInCtus+1 && m_pcCfg->getEntropyCodingSyncEnabledFlag())
    10101010    {
    10111011      m_entropyCodingSyncContextState.loadContexts(m_pppcRDSbacCoder[0][CI_CURR_BEST]);
  • TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1442 r1459  
    204204  delete [] m_pppcRDSbacCoder;
    205205  delete [] m_pppcBinCoderCABAC;
    206  
     206
    207207#if SVC_EXTENSION
    208208  for(Int i=0; i<MAX_NUM_REF; i++)
     
    909909
    910910  m_cSPS.setLog2MinCodingBlockSize(log2MinCUSize);
    911  
     911
    912912#if SVC_EXTENSION
    913913  m_cSPS.setSPSId         ( m_iSPSIdCnt       );
    914914#endif
    915  
     915
    916916  m_cSPS.setPCMLog2MinSize (m_uiPCMLog2MinSize);
    917917  m_cSPS.setUsePCM        ( m_usePCM           );
     
    12551255  m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
    12561256
    1257   m_cPPS.setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 );
     1257  m_cPPS.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
    12581258  m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) );
    12591259  m_cPPS.setUseWP( m_useWeightedPred );
Note: See TracChangeset for help on using the changeset viewer.