Changeset 778 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
28 May 2014, 13:26:07 (11 years ago)
Author:
nokia
Message:

JCTVC-Q0078/R0042: Additional layer sets and independent non-base layer rewriting tool (utils/BLRewrite)

Location:
branches/SHM-6-dev/source/Lib/TLibEncoder
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r776 r778  
    130130    break;
    131131#endif
     132#if Q0078_ADD_LAYER_SETS
     133  case SEI::OUTPUT_LAYER_SET_NESTING:
     134    fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n");
     135    break;
     136  case SEI::VPS_REWRITING:
     137    fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n");
     138    break;
     139#endif
    132140#endif //SVC_EXTENSION
    133141  default:
     
    227235   case SEI::BSP_HRD:
    228236     xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei);
     237     break;
     238#endif
     239#if Q0078_ADD_LAYER_SETS
     240   case SEI::OUTPUT_LAYER_SET_NESTING:
     241     xWriteSEIOutputLayerSetNesting(bs, *static_cast<const SEIOutputLayerSetNesting*>(&sei), vps, sps);
     242     break;
     243   case SEI::VPS_REWRITING:
     244     xWriteSEIVPSRewriting(*static_cast<const SEIVPSRewriting*>(&sei));
    229245     break;
    230246#endif
     
    10351051#endif
    10361052
     1053#if Q0078_ADD_LAYER_SETS
     1054
     1055Void SEIWriter::xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps)
     1056{
     1057  WRITE_FLAG(sei.m_olsFlag, "ols_flag");
     1058  WRITE_UVLC(sei.m_numOlsIndicesMinus1, "num_ols_indices_minus1");
     1059
     1060  for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++)
     1061  {
     1062    WRITE_UVLC(sei.m_olsIdx[i], "ols_idx[i]");
     1063  }
     1064
     1065  while (m_pcBitIf->getNumberOfWrittenBits() % 8 != 0)
     1066  {
     1067    WRITE_FLAG(0, "ols_nesting_zero_bit");
     1068  }
     1069
     1070  // write nested SEI messages
     1071  for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++)
     1072  {
     1073    writeSEImessage(bs, *(*it), vps, sps);
     1074  }
     1075}
     1076
     1077Void SEIWriter::xWriteSEIVPSRewriting(const SEIVPSRewriting &sei)
     1078{
     1079  //sei.nalu->
     1080}
     1081
     1082#endif
     1083
    10371084#endif //SVC_EXTENSION
    10381085
  • branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.h

    r776 r778  
    101101  Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    102102#endif
     103#if Q0078_ADD_LAYER_SETS
     104  Void xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps);
     105  Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei);
     106#endif
    103107#endif //SVC_EXTENSION
    104108};
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r763 r778  
    10001000#endif
    10011001
     1002#if Q0078_ADD_LAYER_SETS
     1003  if (vps->getNumIndependentLayers() > 1)
     1004  {
     1005    WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" );
     1006    for (Int i = 0; i < vps->getNumAddLayerSets(); i++)
     1007    {
     1008      for (Int j = 1; j < vps->getNumIndependentLayers(); j++)
     1009      {
     1010        int len = 1;
     1011        while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1))
     1012        {
     1013          len++;
     1014        }
     1015        WRITE_CODE(vps->getHighestLayerIdxPlus1(i, j), len, "highest_layer_idx_plus1[i][j]");
     1016      }
     1017    }
     1018  }
     1019#endif
     1020
    10021021#if !VPS_EXTN_UEV_CODING
    10031022  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r776 r778  
    21702170      nalu = NALUnit(NAL_UNIT_SPS);
    21712171#endif
     2172#if Q0078_ADD_LAYER_SETS
     2173      if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
     2174      {
     2175        nalu.m_layerId = 0; // For independent base layer rewriting
     2176      }
     2177#endif
    21722178      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    21732179      if (m_bSeqFirst)
     
    22072213#else
    22082214      nalu = NALUnit(NAL_UNIT_PPS);
     2215#endif
     2216#if Q0078_ADD_LAYER_SETS
     2217      if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
     2218      {
     2219        nalu.m_layerId = 0; // For independent base layer rewriting
     2220      }
    22092221#endif
    22102222      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r762 r778  
    912912{
    913913#if SVC_EXTENSION
     914#if Q0078_ADD_LAYER_SETS
     915  if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0)
     916  {
     917    m_cSPS.setLayerId(0); // layer ID 0 for independent layers
     918  }
     919  else
     920  {
     921    m_cSPS.setLayerId(m_layerId);
     922  }
     923#else
    914924  m_cSPS.setLayerId(m_layerId);
     925#endif
    915926  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
    916927  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
     
    11711182#endif
    11721183
     1184#if Q0078_ADD_LAYER_SETS
     1185  if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0)
     1186  {
     1187    m_cPPS.setLayerId(0); // layer ID 0 for independent layers
     1188  }
     1189#endif
     1190
    11731191  if( m_layerId > 0 )
    11741192  {
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.h

    r652 r778  
    154154  Bool                    m_interLayerWeightedPredFlag;
    155155#endif
     156#if Q0078_ADD_LAYER_SETS
     157  int                     m_numAddLayerSets;
     158#endif
    156159#endif //SVC_EXTENSION
    157160protected:
     
    268271  Void setNoOutputOfPriorPicsFlags(Bool x)   { m_noOutputOfPriorPicsFlags = x;   }
    269272#endif
     273#if Q0078_ADD_LAYER_SETS
     274  Void setNumAddLayerSets(Int x)             { m_numAddLayerSets = x; }
     275  Int  getNumAddLayerSets()                  { return m_numAddLayerSets; }
     276#endif
    270277#else //SVC_EXTENSION
    271278  Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.