Changeset 912 in SHVCSoftware for branches/SHM-dev


Ignore:
Timestamp:
31 Oct 2014, 18:18:38 (10 years ago)
Author:
seregin
Message:

Overlay SEI with macro Q0096_OVERLAY_SEI, patch was provided by Nikolce Stefanoski <stefanos@…>

Location:
branches/SHM-dev/source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r910 r912  
    620620  string cfg_kneeSEIInputKneePointValue;
    621621  string cfg_kneeSEIOutputKneePointValue;
     622#endif
     623#if Q0096_OVERLAY_SEI
     624  const Int CFG_MAX_OVERLAYS = 3;
     625  UInt   cfg_overlaySEIIdx[CFG_MAX_OVERLAYS]; 
     626  Bool   cfg_overlaySEILanguagePresentFlag[CFG_MAX_OVERLAYS]; 
     627  UInt   cfg_overlaySEIContentLayerId[CFG_MAX_OVERLAYS];
     628  Bool   cfg_overlaySEILabelPresentFlag[CFG_MAX_OVERLAYS];
     629  UInt   cfg_overlaySEILabelLayerId[CFG_MAX_OVERLAYS];
     630  Bool   cfg_overlaySEIAlphaPresentFlag[CFG_MAX_OVERLAYS];
     631  UInt   cfg_overlaySEIAlphaLayerId[CFG_MAX_OVERLAYS];
     632  UInt   cfg_overlaySEINumElementsMinus1[CFG_MAX_OVERLAYS];
     633  string cfg_overlaySEIElementLabelRanges[CFG_MAX_OVERLAYS]; 
     634  string cfg_overlaySEILanguage[CFG_MAX_OVERLAYS]; 
     635  string cfg_overlaySEIName[CFG_MAX_OVERLAYS]; 
     636  string cfg_overlaySEIElementNames[CFG_MAX_OVERLAYS]; 
    622637#endif
    623638
     
    11181133  ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue,    string("100 250 450"), "Array of output knee point")
    11191134#endif
     1135#if Q0096_OVERLAY_SEI
     1136  ("SEIOverlayInfo",                          m_overlaySEIEnabled,                      false, "Control generation of Selectable Overlays SEI messages")
     1137  ("SEIOverlayCancelFlag",                    m_overlayInfoCancelFlag,                   true, "Indicates that Selectable Overlay SEI message cancels the persistance or follows (default: 1)")
     1138  ("SEIOverlayContentAuxIdMinus128",          m_overlayContentAuxIdMinus128,          UInt(0), "Indicates the AuxId value of auxiliary pictures containing overlay content - 128")
     1139  ("SEIOverlayLabelAuxIdMinus128",            m_overlayLabelAuxIdMinus128,            UInt(1), "Indicates the AuxId value of auxiliary pictures containing label content - 128")
     1140  ("SEIOverlayAlphaAuxIdMinus128",            m_overlayAlphaAuxIdMinus128,            UInt(2), "Indicates the AuxId value of auxiliary pictures containing alpha content - 128")
     1141  ("SEIOverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, UInt(0), "Indicates the number of bits used for coding min and max label values - 8")
     1142  ("SEIOverlayNumOverlaysMinus1",             m_numOverlaysMinus1,                    UInt(0), "Specifies the number of overlays described by this SEI message - 1")
     1143  ("SEIOverlayIdx0",                          cfg_overlaySEIIdx[0],                   UInt(0), "Indicates the index of overlay 0")
     1144  ("SEIOverlayIdx1",                          cfg_overlaySEIIdx[1],                   UInt(1), "Indicates the index of overlay 1")
     1145  ("SEIOverlayIdx2",                          cfg_overlaySEIIdx[2],                   UInt(2), "Indicates the index of overlay 2")
     1146  ("SEIOverlayLanguagePresentFlag0",          cfg_overlaySEILanguagePresentFlag[0],     false, "Indicates if the language for overlay 0 is specified")
     1147  ("SEIOverlayLanguagePresentFlag1",          cfg_overlaySEILanguagePresentFlag[1],     false, "Indicates if the language for overlay 1 is specified")
     1148  ("SEIOverlayLanguagePresentFlag2",          cfg_overlaySEILanguagePresentFlag[2],     false, "Indicates if the language for overlay 2 is specified")
     1149  ("SEIOverlayContentLayerId0",               cfg_overlaySEIContentLayerId[0],        UInt(0), "Indicates the nuh_layer_id value of the overlay content of overlay 0") 
     1150  ("SEIOverlayContentLayerId1",               cfg_overlaySEIContentLayerId[1],        UInt(0), "Indicates the nuh_layer_id value of the overlay content of overlay 1") 
     1151  ("SEIOverlayContentLayerId2",               cfg_overlaySEIContentLayerId[2],        UInt(0), "Indicates the nuh_layer_id value of the overlay content of overlay 2") 
     1152  ("SEIOverlayLabelPresentFlag0",             cfg_overlaySEILabelPresentFlag[0],        false, "Specifies if label content 0 is present") 
     1153  ("SEIOverlayLabelPresentFlag1",             cfg_overlaySEILabelPresentFlag[1],        false, "Specifies if label content 1 is present") 
     1154  ("SEIOverlayLabelPresentFlag2",             cfg_overlaySEILabelPresentFlag[2],        false, "Specifies if label content 2 is present") 
     1155  ("SEIOverlayLabelLayerId0",                 cfg_overlaySEILabelLayerId[0],          UInt(0), "Specifies the nuh_layer_id value of the label content of overlay 0") 
     1156  ("SEIOverlayLabelLayerId1",                 cfg_overlaySEILabelLayerId[1],          UInt(0), "Specifies the nuh_layer_id value of the label content of overlay 1") 
     1157  ("SEIOverlayLabelLayerId2",                 cfg_overlaySEILabelLayerId[2],          UInt(0), "Specifies the nuh_layer_id value of the label content of overlay 2") 
     1158  ("SEIOverlayAlphaPresentFlag0",             cfg_overlaySEIAlphaPresentFlag[0],        false, "Specifies if alpha content 0 is present") 
     1159  ("SEIOverlayAlphaPresentFlag1",             cfg_overlaySEIAlphaPresentFlag[1],        false, "Specifies if alpha content 1 is present") 
     1160  ("SEIOverlayAlphaPresentFlag2",             cfg_overlaySEIAlphaPresentFlag[2],        false, "Specifies if alpha content 2 is present") 
     1161  ("SEIOverlayAlphaLayerId0",                 cfg_overlaySEIAlphaLayerId[0],          UInt(0), "Specifies the nuh_layer_id value of the alpha content of overlay 0") 
     1162  ("SEIOverlayAlphaLayerId1",                 cfg_overlaySEIAlphaLayerId[1],          UInt(0), "Specifies the nuh_layer_id value of the alpha content of overlay 1") 
     1163  ("SEIOverlayAlphaLayerId2",                 cfg_overlaySEIAlphaLayerId[2],          UInt(0), "Specifies the nuh_layer_id value of the alpha content of overlay 2") 
     1164  ("SEIOverlayNumElementsMinus1_0",           cfg_overlaySEINumElementsMinus1[0],     UInt(0), "Specifies the number of overlay elements in overlay 0") 
     1165  ("SEIOverlayNumElementsMinus1_1",           cfg_overlaySEINumElementsMinus1[1],     UInt(0), "Specifies the number of overlay elements in overlay 1") 
     1166  ("SEIOverlayNumElementsMinus1_2",           cfg_overlaySEINumElementsMinus1[2],     UInt(0), "Specifies the number of overlay elements in overlay 2") 
     1167  ("SEIOverlayElementLabelRange0",            cfg_overlaySEIElementLabelRanges[0], string(""), "Array of minimum and maximum values in order min0, max0, min1, max1, etc.\n"""
     1168                                                                                               "indicating the range of sample values corresponding to overlay elements of overlay 0")   
     1169  ("SEIOverlayElementLabelRange1",            cfg_overlaySEIElementLabelRanges[1], string(""), "Array of minimum and maximum values in order min0, max0, min1, max1, etc.\n"""
     1170                                                                                               "indicating the range of sample values corresponding to overlay elements of overlay 1")   
     1171  ("SEIOverlayElementLabelRange2",            cfg_overlaySEIElementLabelRanges[2], string(""), "Array of minimum and maximum values in order min0, max0, min1, max1, etc.\n"""
     1172                                                                                               "indicating the range of sample values corresponding to overlay elements of overlay 2") 
     1173  ("SEIOverlayLanguage0",                     cfg_overlaySEILanguage[0],           string(""), "Indicates the language of overlay 0 by a language tag according to RFC 5646")
     1174  ("SEIOverlayLanguage1",                     cfg_overlaySEILanguage[1],           string(""), "Indicates the language of overlay 1 by a language tag according to RFC 5646")
     1175  ("SEIOverlayLanguage2",                     cfg_overlaySEILanguage[2],           string(""), "Indicates the language of overlay 2 by a language tag according to RFC 5646")
     1176  ("SEIOverlayName0",                         cfg_overlaySEIName[0],       string("Overlay0"), "Indicates the name of overlay 0")
     1177  ("SEIOverlayName1",                         cfg_overlaySEIName[1],       string("Overlay1"), "Indicates the name of overlay 1")
     1178  ("SEIOverlayName2",                         cfg_overlaySEIName[2],       string("Overlay2"), "Indicates the name of overlay 2")
     1179  ("SEIOverlayElementNames0",                 cfg_overlaySEIElementNames[0],       string(""), "Indicates the names of all overlay elements of overlay 0 in the format name1|name2|name3|...")                                                                                       
     1180  ("SEIOverlayElementNames1",                 cfg_overlaySEIElementNames[1],       string(""), "Indicates the names of all overlay elements of overlay 1 in the format name1|name2|name3|...")                                                                                       
     1181  ("SEIOverlayElementNames2",                 cfg_overlaySEIElementNames[2],       string(""), "Indicates the names of all overlay elements of overlay 2 in the format name1|name2|name3|...")                                                                                       
     1182  ("SEIOverlayPersistenceFlag",               m_overlayInfoPersistenceFlag,              true, "Indicates if the SEI message applies to the current picture only (0) or also to following pictures (1)")
     1183#endif
    11201184#if Q0189_TMVP_CONSTRAINTS
    11211185  ("SEITemporalMotionVectorPredictionConstraints",             m_TMVPConstraintsSEIEnabled,              0, "Control generation of TMVP constrants SEI message")
     
    20972161      pcOutputKneePointValue = NULL;
    20982162    }
     2163  }
     2164#endif
     2165#if Q0096_OVERLAY_SEI
     2166  if( m_overlaySEIEnabled && !m_overlayInfoCancelFlag )
     2167  {
     2168    m_overlayIdx.resize                 ( m_numOverlaysMinus1+1 ); 
     2169    m_overlayLanguagePresentFlag.resize ( m_numOverlaysMinus1+1 );
     2170    m_overlayContentLayerId.resize      ( m_numOverlaysMinus1+1 );
     2171    m_overlayLabelPresentFlag.resize    ( m_numOverlaysMinus1+1 );
     2172    m_overlayLabelLayerId.resize        ( m_numOverlaysMinus1+1 );
     2173    m_overlayAlphaPresentFlag.resize    ( m_numOverlaysMinus1+1 );
     2174    m_overlayAlphaLayerId.resize        ( m_numOverlaysMinus1+1 );
     2175    m_numOverlayElementsMinus1.resize   ( m_numOverlaysMinus1+1 );
     2176    m_overlayElementLabelMin.resize     ( m_numOverlaysMinus1+1 );
     2177    m_overlayElementLabelMax.resize     ( m_numOverlaysMinus1+1 ); 
     2178    m_overlayLanguage.resize            ( m_numOverlaysMinus1+1 );     
     2179    m_overlayName.resize                ( m_numOverlaysMinus1+1 );     
     2180    m_overlayElementName.resize         ( m_numOverlaysMinus1+1 );     
     2181    for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++)
     2182    {
     2183      m_overlayIdx[i]                  = cfg_overlaySEIIdx[i];
     2184      m_overlayLanguagePresentFlag[i]  = cfg_overlaySEILanguagePresentFlag[i];
     2185      m_overlayContentLayerId[i]       = cfg_overlaySEIContentLayerId[i];
     2186      m_overlayLabelPresentFlag[i]     = cfg_overlaySEILabelPresentFlag[i];
     2187      m_overlayLabelLayerId[i]         = cfg_overlaySEILabelLayerId[i];
     2188      m_overlayAlphaPresentFlag[i]     = cfg_overlaySEIAlphaPresentFlag[i];
     2189      m_overlayAlphaLayerId[i]         = cfg_overlaySEIAlphaLayerId[i];
     2190      m_numOverlayElementsMinus1[i]    = cfg_overlaySEINumElementsMinus1[i];
     2191      m_overlayLanguage[i]             = cfg_overlaySEILanguage[i];
     2192      m_overlayName[i]                 = cfg_overlaySEIName[i];
     2193     
     2194      //parse min and max values of label elements
     2195      istringstream ranges(cfg_overlaySEIElementLabelRanges[i]);
     2196      string range;         
     2197      UInt val;       
     2198      vector<UInt> vRanges;
     2199      while ( getline(ranges, range, ' ') )
     2200      {       
     2201        istringstream(range) >> val;       
     2202        vRanges.push_back(val);
     2203      }     
     2204      assert( vRanges.size()%2==0 );
     2205      assert( vRanges.size()==2*(m_numOverlayElementsMinus1[i]+1) );
     2206      m_overlayElementLabelMin[i].resize( m_numOverlayElementsMinus1[i]+1 );
     2207      m_overlayElementLabelMax[i].resize( m_numOverlayElementsMinus1[i]+1 );
     2208      for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++)
     2209      {
     2210        m_overlayElementLabelMin[i][j] = vRanges[2*j];
     2211        m_overlayElementLabelMax[i][j] = vRanges[2*j+1];
     2212      }
     2213     
     2214      //parse overlay element names
     2215      istringstream elementNames(cfg_overlaySEIElementNames[i]);
     2216      string elementName;               
     2217      vector<string> vElementName;               
     2218      while ( getline(elementNames, elementName, '|') )
     2219      {       
     2220        vElementName.push_back(elementName);         
     2221      }     
     2222      if ( m_overlayLabelPresentFlag[i] )
     2223      {
     2224        m_overlayElementName[i].resize( m_numOverlayElementsMinus1[i]+1 );     
     2225        for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++)
     2226        {
     2227          if (j < vElementName.size())
     2228          {
     2229            m_overlayElementName[i][j] = vElementName[j];
     2230          }
     2231          else
     2232          {
     2233            m_overlayElementName[i][j] = string("NoElementName");
     2234          }
     2235        }
     2236      }           
     2237    }       
    20992238  }
    21002239#endif
     
    33573496  }
    33583497#endif
     3498#if Q0096_OVERLAY_SEI
     3499  if( m_overlaySEIEnabled && !m_overlayInfoCancelFlag )
     3500  {
     3501    xConfirmPara( m_overlayContentAuxIdMinus128 < 0 || m_overlayContentAuxIdMinus128 > 31, "SEIOverlayContentAuxIdMinus128 must be in the range of 0 to 31");
     3502    xConfirmPara( m_overlayLabelAuxIdMinus128 < 0 || m_overlayLabelAuxIdMinus128 > 31, "SEIOverlayLabelAuxIdMinus128 must be in the range of 0 to 31");
     3503    xConfirmPara( m_overlayAlphaAuxIdMinus128 < 0 || m_overlayAlphaAuxIdMinus128 > 31, "SEIOverlayAlphaAuxIdMinus128 must be in the range of 0 to 31");
     3504    xConfirmPara( m_numOverlaysMinus1 < 0 || m_numOverlaysMinus1 > 15, "SEIOverlayNumOverlaysMinus1 must be in the range of 0 to 15");
     3505    for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++ )
     3506    {
     3507      xConfirmPara( m_overlayIdx[i] < 0 || m_overlayIdx[i] > 255, "SEIOverlayIdx must be in the range of 0 to 255");
     3508      xConfirmPara( m_numOverlayElementsMinus1[i] < 0 || m_numOverlayElementsMinus1[i] > 255, "SEIOverlayNumElementsMinus1 must be in the range of 0 to 255");
     3509    }
     3510  }
     3511#endif
    33593512#if Q0074_COLOUR_REMAPPING_SEI
    33603513#if !SVC_EXTENSION
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r877 r912  
    451451  Int*      m_kneeSEIOutputKneePoint;
    452452#endif
     453#if Q0096_OVERLAY_SEI
     454  Bool                                m_overlaySEIEnabled;
     455  Bool                                m_overlayInfoCancelFlag;
     456  UInt                                m_overlayContentAuxIdMinus128;
     457  UInt                                m_overlayLabelAuxIdMinus128;
     458  UInt                                m_overlayAlphaAuxIdMinus128;
     459  UInt                                m_overlayElementLabelValueLengthMinus8;
     460  UInt                                m_numOverlaysMinus1;
     461  std::vector<UInt>                   m_overlayIdx; 
     462  std::vector<Bool>                   m_overlayLanguagePresentFlag;
     463  std::vector<UInt>                   m_overlayContentLayerId;
     464  std::vector<Bool>                   m_overlayLabelPresentFlag;
     465  std::vector<UInt>                   m_overlayLabelLayerId;
     466  std::vector<Bool>                   m_overlayAlphaPresentFlag;
     467  std::vector<UInt>                   m_overlayAlphaLayerId;
     468  std::vector<UInt>                   m_numOverlayElementsMinus1;
     469  std::vector< std::vector<UInt> >    m_overlayElementLabelMin;
     470  std::vector< std::vector<UInt> >    m_overlayElementLabelMax;
     471  std::vector<string>                 m_overlayLanguage; 
     472  std::vector<string>                 m_overlayName; 
     473  std::vector< std::vector<string> >  m_overlayElementName; 
     474  Bool                                m_overlayInfoPersistenceFlag;
     475#endif
    453476#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
    454477  Bool      m_crossLayerAlignedIdrOnlyFlag;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r910 r912  
    549549    m_acTEncTop[layer].setKneeSEIInputKneePoint                     ( m_kneeSEIInputKneePoint );
    550550    m_acTEncTop[layer].setKneeSEIOutputKneePoint                    ( m_kneeSEIOutputKneePoint );
     551#endif
     552#if Q0096_OVERLAY_SEI
     553    m_acTEncTop[layer].setOverlaySEIEnabled                         ( m_overlaySEIEnabled );
     554    m_acTEncTop[layer].setOverlaySEICancelFlag                      ( m_overlayInfoCancelFlag );
     555    m_acTEncTop[layer].setOverlaySEIContentAuxIdMinus128            ( m_overlayContentAuxIdMinus128 );
     556    m_acTEncTop[layer].setOverlaySEILabelAuxIdMinus128              ( m_overlayLabelAuxIdMinus128 );
     557    m_acTEncTop[layer].setOverlaySEIAlphaAuxIdMinus128              ( m_overlayAlphaAuxIdMinus128 );
     558    m_acTEncTop[layer].setOverlaySEIElementLabelValueLengthMinus8   ( m_overlayElementLabelValueLengthMinus8 );
     559    m_acTEncTop[layer].setOverlaySEINumOverlaysMinus1               ( m_numOverlaysMinus1 );
     560    m_acTEncTop[layer].setOverlaySEIIdx                             ( m_overlayIdx );
     561    m_acTEncTop[layer].setOverlaySEILanguagePresentFlag             ( m_overlayLanguagePresentFlag );
     562    m_acTEncTop[layer].setOverlaySEIContentLayerId                  ( m_overlayContentLayerId );
     563    m_acTEncTop[layer].setOverlaySEILabelPresentFlag                ( m_overlayLabelPresentFlag );
     564    m_acTEncTop[layer].setOverlaySEILabelLayerId                    ( m_overlayLabelLayerId );
     565    m_acTEncTop[layer].setOverlaySEIAlphaPresentFlag                ( m_overlayAlphaPresentFlag );
     566    m_acTEncTop[layer].setOverlaySEIAlphaLayerId                    ( m_overlayAlphaLayerId );
     567    m_acTEncTop[layer].setOverlaySEINumElementsMinus1               ( m_numOverlayElementsMinus1 );
     568    m_acTEncTop[layer].setOverlaySEIElementLabelMin                 ( m_overlayElementLabelMin );
     569    m_acTEncTop[layer].setOverlaySEIElementLabelMax                 ( m_overlayElementLabelMax );
     570    m_acTEncTop[layer].setOverlaySEILanguage                        ( m_overlayLanguage );
     571    m_acTEncTop[layer].setOverlaySEIName                            ( m_overlayName );
     572    m_acTEncTop[layer].setOverlaySEIElementName                     ( m_overlayElementName );
     573    m_acTEncTop[layer].setOverlaySEIPersistenceFlag                 ( m_overlayInfoPersistenceFlag );
    551574#endif
    552575#if Q0074_COLOUR_REMAPPING_SEI
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r894 r912  
    111111    FRAME_FIELD_INFO                     = 147,
    112112#endif
     113#if Q0096_OVERLAY_SEI
     114    OVERLAY_INFO                         = 166,   
     115#endif
    113116  };
    114117 
     
    699702#endif
    700703
     704#if Q0096_OVERLAY_SEI
     705class SEIOverlayInfo : public SEI
     706{
     707public:
     708  PayloadType payloadType() const { return OVERLAY_INFO; }
     709  SEIOverlayInfo()
     710    :  m_numOverlaysMinus1(-1)
     711    {}
     712
     713  virtual ~SEIOverlayInfo()
     714  {
     715    for (Int i=0 ; i<=m_numOverlaysMinus1 ; i++)
     716    {
     717      delete [] m_overlayLanguage[i];         
     718      delete [] m_overlayName[i];
     719      for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; j++)
     720      {
     721        delete [] m_overlayElementName[i][j];
     722      }
     723    }
     724  }
     725
     726  Bool                                m_overlayInfoCancelFlag;
     727  UInt                                m_overlayContentAuxIdMinus128;
     728  UInt                                m_overlayLabelAuxIdMinus128;
     729  UInt                                m_overlayAlphaAuxIdMinus128;
     730  UInt                                m_overlayElementLabelValueLengthMinus8;
     731  UInt                                m_numOverlaysMinus1;
     732  std::vector<UInt>                   m_overlayIdx;
     733  std::vector<Bool>                   m_languageOverlayPresentFlag;
     734  std::vector<UInt>                   m_overlayContentLayerId;
     735  std::vector<Bool>                   m_overlayLabelPresentFlag;
     736  std::vector<UInt>                   m_overlayLabelLayerId;
     737  std::vector<Bool>                   m_overlayAlphaPresentFlag;
     738  std::vector<UInt>                   m_overlayAlphaLayerId;
     739  std::vector<UInt>                   m_numOverlayElementsMinus1;
     740  std::vector< std::vector<UInt> >    m_overlayElementLabelMin;
     741  std::vector< std::vector<UInt> >    m_overlayElementLabelMax;
     742  std::vector<UChar*>                 m_overlayLanguage;
     743  std::vector<UInt>                   m_overlayLanguageLength;
     744  std::vector<UChar*>                 m_overlayName;
     745  std::vector<UInt>                   m_overlayNameLength;
     746  std::vector< std::vector<UChar*> >  m_overlayElementName;
     747  std::vector< std::vector<UInt> >    m_overlayElementNameLength;
     748  Bool                                m_overlayInfoPersistenceFlag;
     749};
     750#endif
     751
    701752//! \}
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r910 r912  
    320320#define Q0247_FRAME_FIELD_INFO           1      ///< JCTVC-Q0247: field_frame_info SEI message
    321321#define R0247_SEI_ACTIVE                 1      ///< JCTVC-R0247: active parameter sets SEI message
     322#define Q0096_OVERLAY_SEI                1      ///< JCTVC-Q0096, JCTVC-Q0045: selectable overlays SEI message
     323#if Q0096_OVERLAY_SEI
     324# define MAX_OVERLAYS                    16
     325# define MAX_OVERLAY_ELEMENTS            256
     326# define MAX_OVERLAY_STRING_BYTES        256
     327#endif
    322328
    323329#endif // SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r900 r912  
    146146    break;
    147147#endif
     148#if Q0096_OVERLAY_SEI
     149  case SEI::OVERLAY_INFO:
     150    fprintf( g_hTrace, "=========== Overlay Information SEI message ===========\n");
     151    break;
     152#endif
    148153#endif //SVC_EXTENSION
    149154  default:
     
    412417     break;
    413418#endif
     419#if Q0096_OVERLAY_SEI
     420   case SEI::OVERLAY_INFO:
     421     sei = new SEIOverlayInfo;
     422     xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize);
     423     break;
     424#endif
    414425#endif //SVC_EXTENSION
    415426      break;
     
    17261737#endif
    17271738
     1739#if Q0096_OVERLAY_SEI
     1740Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt /*payloadSize*/){
     1741  Int i, j;
     1742  UInt val;
     1743  READ_FLAG( val, "overlay_info_cancel_flag" );                 sei.m_overlayInfoCancelFlag = val;
     1744  if ( !sei.m_overlayInfoCancelFlag )
     1745  {
     1746    READ_UVLC( val, "overlay_content_aux_id_minus128" );            sei.m_overlayContentAuxIdMinus128 = val;
     1747    READ_UVLC( val, "overlay_label_aux_id_minus128" );              sei.m_overlayLabelAuxIdMinus128 = val;
     1748    READ_UVLC( val, "overlay_alpha_aux_id_minus128" );              sei.m_overlayAlphaAuxIdMinus128 = val;
     1749    READ_UVLC( val, "overlay_element_label_value_length_minus8" );  sei.m_overlayElementLabelValueLengthMinus8 = val;
     1750    READ_UVLC( val, "num_overlays_minus1" );                        sei.m_numOverlaysMinus1 = val;
     1751
     1752    assert( sei.m_numOverlaysMinus1 < MAX_OVERLAYS );
     1753    sei.m_overlayIdx.resize( sei.m_numOverlaysMinus1+1 );
     1754    sei.m_languageOverlayPresentFlag.resize( sei.m_numOverlaysMinus1+1 );
     1755    sei.m_overlayContentLayerId.resize( sei.m_numOverlaysMinus1+1 );
     1756    sei.m_overlayLabelPresentFlag.resize( sei.m_numOverlaysMinus1+1 );
     1757    sei.m_overlayLabelLayerId.resize( sei.m_numOverlaysMinus1+1 );
     1758    sei.m_overlayAlphaPresentFlag.resize( sei.m_numOverlaysMinus1+1 );
     1759    sei.m_overlayAlphaLayerId.resize( sei.m_numOverlaysMinus1+1 );
     1760    sei.m_numOverlayElementsMinus1.resize( sei.m_numOverlaysMinus1+1 );
     1761    sei.m_overlayElementLabelMin.resize( sei.m_numOverlaysMinus1+1 );
     1762    sei.m_overlayElementLabelMax.resize( sei.m_numOverlaysMinus1+1 );
     1763    for ( i=0 ; i<=sei.m_numOverlaysMinus1 ; i++ )
     1764    {
     1765      READ_UVLC( val, "overlay_idx" );                      sei.m_overlayIdx[i] = val;
     1766      READ_FLAG( val, "language_overlay_present_flag" );    sei.m_languageOverlayPresentFlag[i] = val;
     1767      READ_CODE( 6, val, "overlay_content_layer_id");       sei.m_overlayContentLayerId[i] = val;
     1768      READ_FLAG( val, "overlay_label_present_flag" );       sei.m_overlayLabelPresentFlag[i] = val;
     1769      if ( sei.m_overlayLabelPresentFlag[i] )
     1770      {
     1771        READ_CODE( 6, val, "overlay_label_layer_id");     sei.m_overlayLabelLayerId[i] = val;
     1772      }
     1773      READ_FLAG( val, "overlay_alpha_present_flag" );       sei.m_overlayAlphaPresentFlag[i] = val;
     1774      if ( sei.m_overlayAlphaPresentFlag[i] )
     1775      {
     1776        READ_CODE( 6, val, "overlay_alpha_layer_id");     sei.m_overlayAlphaLayerId[i] = val;
     1777      }
     1778      if ( sei.m_overlayLabelPresentFlag[i] )
     1779      {
     1780        READ_UVLC( val, "num_overlay_elements_minus1");   sei.m_numOverlayElementsMinus1[i] = val;
     1781        assert( sei.m_numOverlayElementsMinus1[i] < MAX_OVERLAY_ELEMENTS );
     1782        sei.m_overlayElementLabelMin[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
     1783        sei.m_overlayElementLabelMax[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
     1784        for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++ )
     1785        {
     1786          READ_CODE(sei.m_overlayElementLabelValueLengthMinus8 + 8, val, "overlay_element_label_min"); sei.m_overlayElementLabelMin[i][j] = val;
     1787          READ_CODE(sei.m_overlayElementLabelValueLengthMinus8 + 8, val, "overlay_element_label_max"); sei.m_overlayElementLabelMax[i][j] = val;
     1788        }     
     1789      }
     1790      else
     1791      {
     1792        sei.m_numOverlayElementsMinus1[i] = 0;
     1793      }
     1794    }
     1795
     1796    // byte alignment
     1797    while ( m_pcBitstream->getNumBitsRead() % 8 != 0 )
     1798    {
     1799      READ_FLAG( val, "overlay_zero_bit" );
     1800      assert( val==0 );
     1801    }
     1802
     1803    UChar* sval = new UChar[MAX_OVERLAY_STRING_BYTES];
     1804    UInt slen;   
     1805    sei.m_overlayLanguage.resize( sei.m_numOverlaysMinus1+1, NULL );
     1806    sei.m_overlayLanguageLength.resize( sei.m_numOverlaysMinus1+1 );
     1807    sei.m_overlayName.resize( sei.m_numOverlaysMinus1+1, NULL );
     1808    sei.m_overlayNameLength.resize( sei.m_numOverlaysMinus1+1 );
     1809    sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1+1 );
     1810    sei.m_overlayElementNameLength.resize( sei.m_numOverlaysMinus1+1 );
     1811    for ( i=0 ; i<=sei.m_numOverlaysMinus1 ; i++ )
     1812    {
     1813      if ( sei.m_languageOverlayPresentFlag[i] )
     1814      {
     1815        READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_language" );
     1816        sei.m_overlayLanguage[i] = new UChar[slen];
     1817        memcpy(sei.m_overlayLanguage[i], sval, slen);
     1818        sei.m_overlayLanguageLength[i] = slen;
     1819      }
     1820      READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_name" );
     1821      sei.m_overlayName[i] = new UChar[slen];
     1822      memcpy(sei.m_overlayName[i], sval, slen);
     1823      sei.m_overlayNameLength[i] = slen;
     1824      if ( sei.m_overlayLabelPresentFlag[i] )
     1825      {
     1826        sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1, NULL );
     1827        sei.m_overlayElementNameLength[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
     1828        for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++)
     1829        {
     1830          READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_element_name" );
     1831          sei.m_overlayElementName[i][j] = new UChar[slen];
     1832          memcpy(sei.m_overlayElementName[i][j], sval, slen);
     1833          sei.m_overlayElementNameLength[i][j] = slen;
     1834        }
     1835      }
     1836    }
     1837    READ_FLAG( val, "overlay_info_persistence_flag" );        sei.m_overlayInfoPersistenceFlag = val;
     1838  }
     1839  xParseByteAlign();
     1840}
     1841#endif
     1842
    17281843#endif //SVC_EXTENSION
    17291844
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h

    r900 r912  
    146146  Void xParseSEIFrameFieldInfo    (SEIFrameFieldInfo& sei, UInt payloadSize);
    147147#endif
     148#if Q0096_OVERLAY_SEI
     149  Void xParseSEIOverlayInfo           (SEIOverlayInfo& sei, UInt payloadSize);
     150#endif
    148151  Void xParseByteAlign();
    149152};
  • branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r595 r912  
    8585}
    8686
     87#if Q0096_OVERLAY_SEI
     88Void  SyntaxElementParser::xReadStringTr        (UInt buSize, UChar *pValue, UInt& rLength, const Char *pSymbolName)
     89{
     90  xReadString(buSize, pValue, rLength);
     91  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     92  fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, rLength, pValue );
     93  fflush ( g_hTrace );
     94}
     95#endif
     96
    8797#endif
    8898
     
    153163}
    154164
     165#if Q0096_OVERLAY_SEI
     166Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength)
     167{
     168  assert( m_pcBitstream->getNumBitsRead() % 8 == 0 ); //always start reading at a byte-aligned position
     169  assert ( bufSize > 1 ); //last byte always used for null-termination
     170  UInt val;
     171  UInt i;
     172  for (i=0 ; i<bufSize ; ++i )
     173  {
     174    m_pcBitstream->readByte( val );
     175    pVal[i] = val;
     176    if ( val == 0)
     177    {
     178      break;
     179    }
     180  }
     181  rLength = i;
     182  assert( pVal[rLength] == 0 );
     183}
     184#endif
    155185
    156186//! \}
  • branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.h

    r595 r912  
    5151#define READ_SVLC(        code, name)     xReadSvlcTr (         code, name )
    5252#define READ_FLAG(        code, name)     xReadFlagTr (         code, name )
     53#if Q0096_OVERLAY_SEI
     54#define READ_STRING(bufSize, code, length, name)   xReadStringTr ( bufSize, code, length, name )
     55#endif
    5356
    5457#else
     
    5861#define READ_SVLC(        code, name)     xReadSvlc (         code )
    5962#define READ_FLAG(        code, name)     xReadFlag (         code )
     63#if Q0096_OVERLAY_SEI
     64#define READ_STRING(bufSize, code, length, name)   xReadString ( bufSize, code, length )
     65#endif
    6066
    6167#endif
     
    8288  Void  xReadSvlc    ( Int&   val );
    8389  Void  xReadFlag    ( UInt&  val );
     90#if Q0096_OVERLAY_SEI
     91  Void  xReadString  (UInt bufSize, UChar *val, UInt& length);
     92#endif
    8493#if ENC_DEC_TRACE
    8594  Void  xReadCodeTr  (UInt  length, UInt& rValue, const Char *pSymbolName);
     
    8796  Void  xReadSvlcTr  (               Int& rValue, const Char *pSymbolName);
    8897  Void  xReadFlagTr  (              UInt& rValue, const Char *pSymbolName);
     98#if Q0096_OVERLAY_SEI
     99  Void  xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName);
     100#endif
    89101#endif
    90102public:
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r894 r912  
    140140    break;
    141141#endif
     142#if Q0096_OVERLAY_SEI
     143  case SEI::OVERLAY_INFO:
     144    fprintf( g_hTrace, "=========== Overlay Information SEI message ===========\n");
     145    break;
     146#endif
    142147#endif //SVC_EXTENSION
    143148  default:
     
    285290   case SEI::FRAME_FIELD_INFO:
    286291     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
     292     break;
     293#endif
     294#if Q0096_OVERLAY_SEI
     295   case SEI::OVERLAY_INFO:
     296     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
    287297     break;
    288298#endif
     
    13301340#endif
    13311341
     1342#if Q0096_OVERLAY_SEI
     1343Void SEIWriter::xWriteSEIOverlayInfo(const SEIOverlayInfo &sei)
     1344{
     1345  Int i,j;
     1346  WRITE_FLAG( sei.m_overlayInfoCancelFlag, "overlay_info_cancel_flag" );
     1347  if ( !sei.m_overlayInfoCancelFlag )
     1348  {
     1349    WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" );
     1350    WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" );
     1351    WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" );
     1352    WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" );
     1353    assert( sei.m_numOverlaysMinus1 < MAX_OVERLAYS );
     1354    WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" );
     1355    for (i=0 ; i<=sei.m_numOverlaysMinus1 ; i++)
     1356    {
     1357      WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" );
     1358      WRITE_FLAG( sei.m_languageOverlayPresentFlag[i], "language_overlay_present_flag" );
     1359      WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id");
     1360      WRITE_FLAG( sei.m_overlayLabelPresentFlag[i], "overlay_label_present_flag" );
     1361      if ( sei.m_overlayLabelPresentFlag[i] )
     1362      {
     1363        WRITE_CODE(  sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id");
     1364      }
     1365      WRITE_FLAG( sei.m_overlayAlphaPresentFlag[i], "overlay_alpha_present_flag" );
     1366      if ( sei.m_overlayAlphaPresentFlag[i] )
     1367      {
     1368        WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id");
     1369      }
     1370      if ( sei.m_overlayLabelPresentFlag[i] )
     1371      {
     1372        assert( sei.m_numOverlayElementsMinus1[i] < MAX_OVERLAY_ELEMENTS );
     1373        WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1");
     1374        for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++ )
     1375        {
     1376          WRITE_CODE(sei.m_overlayElementLabelMin[i][j], sei.m_overlayElementLabelValueLengthMinus8 + 8, "overlay_element_label_min");
     1377          WRITE_CODE(sei.m_overlayElementLabelMax[i][j], sei.m_overlayElementLabelValueLengthMinus8 + 8, "overlay_element_label_max");
     1378        }
     1379      }
     1380    }
     1381
     1382
     1383    // byte alignment
     1384    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
     1385    {
     1386      WRITE_FLAG( 0, "overlay_zero_bit" );
     1387    }
     1388
     1389    for ( i=0 ; i<=sei.m_numOverlaysMinus1 ; i++ )
     1390    {
     1391      if ( sei.m_languageOverlayPresentFlag[i] )
     1392      {
     1393        WRITE_STRING( sei.m_overlayLanguage[i], sei.m_overlayLanguageLength[i], "overlay_language" );    //WRITE_STRING adds zero-termination byte
     1394      }
     1395      WRITE_STRING( sei.m_overlayName[i], sei.m_overlayNameLength[i], "overlay_name" );
     1396      if ( sei.m_overlayLabelPresentFlag[i] )
     1397      {
     1398        for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++)
     1399        {
     1400          WRITE_STRING( sei.m_overlayElementName[i][j], sei.m_overlayElementNameLength[i][j], "overlay_element_name" );
     1401        }
     1402      }
     1403    }
     1404    WRITE_FLAG( sei.m_overlayInfoPersistenceFlag, "overlay_info_persistence_flag" );
     1405  }
     1406  xWriteByteAlign();
     1407}
     1408#endif
     1409
    13321410#endif //SVC_EXTENSION
    13331411
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h

    r894 r912  
    123123  Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei);
    124124#endif
     125#if Q0096_OVERLAY_SEI
     126  Void xWriteSEIOverlayInfo(const SEIOverlayInfo &sei);
     127#endif
    125128#endif //SVC_EXTENSION
    126129};
  • branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp

    r595 r912  
    9191}
    9292
     93#if Q0096_OVERLAY_SEI
     94Void  SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName)
     95{
     96  xWriteString(value, length);
     97  if( g_HLSTraceEnable )
     98  {
     99    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     100    fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, length, value );
     101  }
     102}
     103#endif
     104
    93105#endif
    94106
     
    130142}
    131143
     144#if Q0096_OVERLAY_SEI
     145Void  SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength)
     146{
     147  assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 );
     148  for (Int i=0 ; i<uiLength; i++)
     149  {
     150    m_pcBitIf->write( sCode[i], 8 );
     151  }
     152  m_pcBitIf->write( 0, 8 ); //zero-termination byte
     153}
     154#endif
     155
    132156//! \}
  • branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h

    r595 r912  
    5656#define WRITE_SVLC( value,         name)    xWriteSvlcTr ( value,         name )
    5757#define WRITE_FLAG( value,         name)    xWriteFlagTr ( value,         name )
     58#if Q0096_OVERLAY_SEI
     59#define WRITE_STRING( value, length, name)   xWriteStringTr( value, length, name )
     60#endif
    5861
    5962#else
     
    6366#define WRITE_SVLC( value,         name)     xWriteSvlc ( value )
    6467#define WRITE_FLAG( value,         name)     xWriteFlag ( value )
     68#if Q0096_OVERLAY_SEI
     69#define WRITE_STRING( value, length, name)   xWriteString( value, length )
     70#endif
    6571
    6672#endif
     
    8288  Void  xWriteSvlc            ( Int  iCode   );
    8389  Void  xWriteFlag            ( UInt uiCode );
     90#if Q0096_OVERLAY_SEI
     91  Void  xWriteString          ( UChar* sCode, UInt uiLength);
     92#endif
    8493#if ENC_DEC_TRACE
    8594  Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
     
    8796  Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
    8897  Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
     98#if Q0096_OVERLAY_SEI
     99  Void  xWriteStringTr        ( UChar* value, UInt length, const Char *pSymbolName);
     100#endif
    89101#endif
    90102
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r877 r912  
    387387  Int*      m_kneeSEIInputKneePoint;
    388388  Int*      m_kneeSEIOutputKneePoint;
     389#endif
     390#if Q0096_OVERLAY_SEI
     391  Bool                                m_overlaySEIEnabled;
     392  Bool                                m_overlayInfoCancelFlag;
     393  UInt                                m_overlayContentAuxIdMinus128;
     394  UInt                                m_overlayLabelAuxIdMinus128;
     395  UInt                                m_overlayAlphaAuxIdMinus128;
     396  UInt                                m_overlayElementLabelValueLengthMinus8;
     397  UInt                                m_numOverlaysMinus1;
     398  std::vector<UInt>                   m_overlayIdx; 
     399  std::vector<Bool>                   m_overlayLanguagePresentFlag;
     400  std::vector<UInt>                   m_overlayContentLayerId;
     401  std::vector<Bool>                   m_overlayLabelPresentFlag;
     402  std::vector<UInt>                   m_overlayLabelLayerId;
     403  std::vector<Bool>                   m_overlayAlphaPresentFlag;
     404  std::vector<UInt>                   m_overlayAlphaLayerId;
     405  std::vector<UInt>                   m_numOverlayElementsMinus1;
     406  std::vector< std::vector<UInt> >    m_overlayElementLabelMin;
     407  std::vector< std::vector<UInt> >    m_overlayElementLabelMax;
     408  std::vector<string>                 m_overlayLanguage; 
     409  std::vector<string>                 m_overlayName; 
     410  std::vector< std::vector<string> >  m_overlayElementName; 
     411  Bool                                m_overlayInfoPersistenceFlag;
    389412#endif
    390413#if Q0189_TMVP_CONSTRAINTS
     
    9941017  UInt  getIlcIdc(UInt b)                                  { return m_ilcIdc[b]; }
    9951018#endif
     1019#if Q0096_OVERLAY_SEI 
     1020  Void                                setOverlaySEIEnabled(Int b)                                              { m_overlaySEIEnabled = b; }
     1021  Bool                                getOverlaySEIEnabled()                                                   { return m_overlaySEIEnabled; }
     1022  Void                                setOverlaySEICancelFlag(Int b)                                           { m_overlayInfoCancelFlag = b; }
     1023  Bool                                getOverlaySEICancelFlag()                                                { return m_overlayInfoCancelFlag; }
     1024  Void                                setOverlaySEIContentAuxIdMinus128(UInt b)                                { m_overlayContentAuxIdMinus128 = b; }     
     1025  UInt                                getOverlaySEIContentAuxIdMinus128()                                      { return m_overlayContentAuxIdMinus128; }     
     1026  Void                                setOverlaySEILabelAuxIdMinus128(UInt b)                                  { m_overlayLabelAuxIdMinus128 = b; }     
     1027  UInt                                getOverlaySEILabelAuxIdMinus128()                                        { return m_overlayLabelAuxIdMinus128; } 
     1028  Void                                setOverlaySEIAlphaAuxIdMinus128(UInt b)                                  { m_overlayAlphaAuxIdMinus128 = b; }     
     1029  UInt                                getOverlaySEIAlphaAuxIdMinus128()                                        { return m_overlayAlphaAuxIdMinus128; } 
     1030  Void                                setOverlaySEIElementLabelValueLengthMinus8(UInt b)                       { m_overlayElementLabelValueLengthMinus8 = b; }     
     1031  UInt                                getOverlaySEIElementLabelValueLengthMinus8()                             { return m_overlayElementLabelValueLengthMinus8; } 
     1032  Void                                setOverlaySEINumOverlaysMinus1(UInt b)                                   { m_numOverlaysMinus1 = b; }     
     1033  UInt                                getOverlaySEINumOverlaysMinus1()                                         { return m_numOverlaysMinus1; }     
     1034  Void                                setOverlaySEIIdx(const std::vector<UInt>& b)                             { m_overlayIdx = b; }     
     1035  std::vector<UInt>                   getOverlaySEIIdx()                                                       { return m_overlayIdx; }     
     1036  Void                                setOverlaySEILanguagePresentFlag(const std::vector<Bool>& b)             { m_overlayLanguagePresentFlag = b; }     
     1037  std::vector<Bool>                   getOverlaySEILanguagePresentFlag()                                       { return m_overlayLanguagePresentFlag; }   
     1038  Void                                setOverlaySEIContentLayerId(const std::vector<UInt>& b)                  { m_overlayContentLayerId = b; }     
     1039  std::vector<UInt>                   getOverlaySEIContentLayerId()                                            { return m_overlayContentLayerId; }     
     1040  Void                                setOverlaySEILabelPresentFlag(const std::vector<Bool>& b)                { m_overlayLabelPresentFlag = b; }     
     1041  std::vector<Bool>                   getOverlaySEILabelPresentFlag()                                          { return m_overlayLabelPresentFlag; }
     1042  Void                                setOverlaySEILabelLayerId(const std::vector<UInt>& b)                    { m_overlayLabelLayerId = b; }     
     1043  std::vector<UInt>                   getOverlaySEILabelLayerId()                                              { return m_overlayLabelLayerId; }   
     1044  Void                                setOverlaySEIAlphaPresentFlag(const std::vector<Bool>& b)                { m_overlayAlphaPresentFlag = b; }     
     1045  std::vector<Bool>                   getOverlaySEIAlphaPresentFlag()                                          { return m_overlayAlphaPresentFlag; }     
     1046  Void                                setOverlaySEIAlphaLayerId(const std::vector<UInt>& b)                    { m_overlayAlphaLayerId = b; }     
     1047  std::vector<UInt>                   getOverlaySEIAlphaLayerId()                                              { return m_overlayAlphaLayerId; }   
     1048  Void                                setOverlaySEINumElementsMinus1(const std::vector<UInt>& b)               { m_numOverlayElementsMinus1 = b; }     
     1049  std::vector<UInt>                   getOverlaySEINumElementsMinus1()                                         { return m_numOverlayElementsMinus1; }     
     1050  Void                                setOverlaySEIElementLabelMin(const std::vector< std::vector<UInt> >& b)  { m_overlayElementLabelMin = b; }     
     1051  std::vector< std::vector<UInt> >    getOverlaySEIElementLabelMin()                                           { return m_overlayElementLabelMin; }   
     1052  Void                                setOverlaySEIElementLabelMax(const std::vector< std::vector<UInt> >& b)  { m_overlayElementLabelMax = b; }     
     1053  std::vector< std::vector<UInt> >    getOverlaySEIElementLabelMax()                                           { return m_overlayElementLabelMax; }             
     1054  Void                                setOverlaySEILanguage(const std::vector<string>& b)                      { m_overlayLanguage = b; }     
     1055  std::vector<string>                 getOverlaySEILanguage()                                                  { return m_overlayLanguage; }   
     1056  Void                                setOverlaySEIName(const std::vector<string>& b)                          { m_overlayName = b; }     
     1057  std::vector<string>                 getOverlaySEIName()                                                      { return m_overlayName; }   
     1058  Void                                setOverlaySEIElementName(const std::vector< std::vector<string> >& b)    { m_overlayElementName = b; }     
     1059  std::vector< std::vector<string> >  getOverlaySEIElementName()                                               { return m_overlayElementName; }   
     1060  Void                                setOverlaySEIPersistenceFlag(Int b)                                      { m_overlayInfoPersistenceFlag = b; }
     1061  Bool                                getOverlaySEIPersistenceFlag()                                           { return m_overlayInfoPersistenceFlag; }
     1062#endif
    9961063#if Q0048_CGS_3D_ASYMLUT
    9971064  Void      setCGSFlag(Int n)             { m_nCGSFlag = n;    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r904 r912  
    382382#endif
    383383
     384#if Q0096_OVERLAY_SEI
     385SEIOverlayInfo* TEncGOP::xCreateSEIOverlayInfo()
     386
     387  SEIOverlayInfo *sei = new SEIOverlayInfo(); 
     388  sei->m_overlayInfoCancelFlag = m_pcCfg->getOverlaySEICancelFlag();   
     389  if ( !sei->m_overlayInfoCancelFlag )
     390  {
     391    sei->m_overlayContentAuxIdMinus128          = m_pcCfg->getOverlaySEIContentAuxIdMinus128();
     392    sei->m_overlayLabelAuxIdMinus128            = m_pcCfg->getOverlaySEILabelAuxIdMinus128(); 
     393    sei->m_overlayAlphaAuxIdMinus128            = m_pcCfg->getOverlaySEIAlphaAuxIdMinus128();
     394    sei->m_overlayElementLabelValueLengthMinus8 = m_pcCfg->getOverlaySEIElementLabelValueLengthMinus8();
     395    sei->m_numOverlaysMinus1                    = m_pcCfg->getOverlaySEINumOverlaysMinus1();     
     396    sei->m_overlayIdx                           = m_pcCfg->getOverlaySEIIdx();           
     397    sei->m_languageOverlayPresentFlag           = m_pcCfg->getOverlaySEILanguagePresentFlag();
     398    sei->m_overlayContentLayerId                = m_pcCfg->getOverlaySEIContentLayerId();   
     399    sei->m_overlayLabelPresentFlag              = m_pcCfg->getOverlaySEILabelPresentFlag();   
     400    sei->m_overlayLabelLayerId                  = m_pcCfg->getOverlaySEILabelLayerId();   
     401    sei->m_overlayAlphaPresentFlag              = m_pcCfg->getOverlaySEIAlphaPresentFlag();   
     402    sei->m_overlayAlphaLayerId                  = m_pcCfg->getOverlaySEIAlphaLayerId();   
     403    sei->m_numOverlayElementsMinus1             = m_pcCfg->getOverlaySEINumElementsMinus1();
     404    sei->m_overlayElementLabelMin               = m_pcCfg->getOverlaySEIElementLabelMin();
     405    sei->m_overlayElementLabelMax               = m_pcCfg->getOverlaySEIElementLabelMax();   
     406    sei->m_overlayLanguage.resize               ( sei->m_numOverlaysMinus1+1, NULL );
     407    sei->m_overlayLanguageLength.resize         ( sei->m_numOverlaysMinus1+1 );
     408    sei->m_overlayName.resize                   ( sei->m_numOverlaysMinus1+1, NULL );
     409    sei->m_overlayNameLength.resize             ( sei->m_numOverlaysMinus1+1 );
     410    sei->m_overlayElementName.resize            ( sei->m_numOverlaysMinus1+1 );
     411    sei->m_overlayElementNameLength.resize      ( sei->m_numOverlaysMinus1+1 ); 
     412
     413    Int i,j;
     414    string strTmp;
     415    Int nBytes;
     416    assert( m_pcCfg->getOverlaySEILanguage().size()    == sei->m_numOverlaysMinus1+1 );
     417    assert( m_pcCfg->getOverlaySEIName().size()        == sei->m_numOverlaysMinus1+1 );
     418    assert( m_pcCfg->getOverlaySEIElementName().size() == sei->m_numOverlaysMinus1+1 );
     419   
     420    for ( i=0 ; i<=sei->m_numOverlaysMinus1; i++ )
     421    {     
     422      //language tag
     423      if ( sei->m_languageOverlayPresentFlag[i] )
     424      {               
     425        strTmp = m_pcCfg->getOverlaySEILanguage()[i];
     426        nBytes = m_pcCfg->getOverlaySEILanguage()[i].size();       
     427        assert( nBytes>0 );
     428        sei->m_overlayLanguage[i] = new UChar[nBytes];
     429        memcpy(sei->m_overlayLanguage[i], strTmp.c_str(), nBytes);       
     430        sei->m_overlayLanguageLength[i] = nBytes;       
     431      }
     432
     433      //overlay name
     434      strTmp = m_pcCfg->getOverlaySEIName()[i];
     435      nBytes = m_pcCfg->getOverlaySEIName()[i].size();       
     436      assert( nBytes>0 );
     437      sei->m_overlayName[i] = new UChar[nBytes];     
     438      memcpy(sei->m_overlayName[i], strTmp.c_str(), nBytes);       
     439      sei->m_overlayNameLength[i] = nBytes;
     440
     441      //overlay element names
     442      if ( sei->m_overlayLabelPresentFlag[i] )
     443      {       
     444        sei->m_overlayElementName[i].resize( sei->m_numOverlayElementsMinus1[i]+1, NULL );
     445        sei->m_overlayElementNameLength[i].resize( sei->m_numOverlayElementsMinus1[i]+1 );
     446        assert( m_pcCfg->getOverlaySEIElementName()[i].size() == sei->m_numOverlayElementsMinus1[i]+1 );       
     447        for ( j=0 ; j<=sei->m_numOverlayElementsMinus1[i] ; j++)
     448        {
     449          strTmp = m_pcCfg->getOverlaySEIElementName()[i][j];
     450          nBytes = m_pcCfg->getOverlaySEIElementName()[i][j].size();       
     451          assert( nBytes>0 );
     452          sei->m_overlayElementName[i][j] = new UChar[nBytes];
     453          memcpy(sei->m_overlayElementName[i][j], strTmp.c_str(), nBytes);       
     454          sei->m_overlayElementNameLength[i][j] = nBytes;
     455        }
     456      }
     457    }
     458  sei->m_overlayInfoPersistenceFlag = true;
     459  }
     460  return sei;
     461}
     462#endif
     463
    384464#if Q0074_COLOUR_REMAPPING_SEI
    385465SEIColourRemappingInfo*  TEncGOP::xCreateSEIColourRemappingInfo()
     
    574654
    575655    nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_pcCfg->getNumLayer()-1); // For highest layer
     656    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     657#if O0164_MULTI_LAYER_HRD
     658    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     659#else
     660    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     661#endif
     662    writeRBSPTrailingBits(nalu.m_Bitstream);
     663    accessUnit.push_back(new NALUnitEBSP(nalu));
     664    delete sei;
     665  }
     666#endif
     667
     668#if Q0096_OVERLAY_SEI
     669  if(m_pcCfg->getOverlaySEIEnabled())
     670  {   
     671    SEIOverlayInfo *sei = xCreateSEIOverlayInfo();       
    576672    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    577673#if O0164_MULTI_LAYER_HRD
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h

    r896 r912  
    259259#endif
    260260#endif
     261#if Q0096_OVERLAY_SEI
     262  SEIOverlayInfo* xCreateSEIOverlayInfo();
     263#endif
    261264#if Q0048_CGS_3D_ASYMLUT
    262265  Void xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS );
Note: See TracChangeset for help on using the changeset viewer.