Changeset 1334 in 3DVCSoftware for branches


Ignore:
Timestamp:
22 Sep 2015, 23:25:33 (9 years ago)
Author:
tech
Message:

Alpha channel SEI modifications. On behalf of Matteo.

Location:
branches/HTM-15.1-dev0-BBC/source/Lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibCommon/SEI.cpp

    r1332 r1334  
    233233#endif
    234234  case SEI::SUB_BITSTREAM_PROPERTY                :               return new SEISubBitstreamProperty;
     235  case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
    235236#if NH_MV_SEI_TBD
    236   case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
    237237  case SEI::OVERLAY_INFO                          :               return new SEIOverlayInfo;
    238238#endif
     
    682682}
    683683
    684 #if NH_MV_SEI_TBD
    685 
    686 Void SEIAlphaChannelInfo::setupFromSlice  ( const TComSlice* slice )
    687 {
    688   sei.m_alphaChannelCancelFlag =  TBD ;
    689   if( !sei.m_alphaChannelCancelFlag )
    690   {
    691     sei.m_alphaChannelUseIdc =  TBD ;
    692     sei.m_alphaChannelBitDepthMinus8 =  TBD ;
    693     sei.m_alphaTransparentValue =  TBD ;
    694     sei.m_alphaOpaqueValue =  TBD ;
    695     sei.m_alphaChannelIncrFlag =  TBD ;
    696     sei.m_alphaChannelClipFlag =  TBD ;
    697     if( sei.m_alphaChannelClipFlag )
    698     {
    699       sei.m_alphaChannelClipTypeFlag =  TBD ;
    700     }
    701   }
    702 };
    703 
    704684Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
    705685{
     
    708688
    709689  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    710   defAppLayerIds    .push_back( TBD );
    711   defAppPocs        .push_back( TBD );
    712   defAppTids        .push_back( TBD );
    713   defAppVclNaluTypes.push_back( TBD );
     690  defAppLayerIds    .push_back( 0 );
     691  defAppPocs        .push_back( 0 );
     692  defAppTids        .push_back( 0 );
     693  defAppVclNaluTypes.push_back( 0 );
    714694
    715695  Int      defSeiNaluId                  = 0;
    716696  Int      defPositionInSeiNalu          = 0;
    717   Bool     defModifyByEncoder            = TBD;
     697  Bool     defModifyByEncoder            = false;
    718698
    719699  // Setup config file options
     
    726706    ("AlphaChannelBitDepthMinus8"     , m_alphaChannelBitDepthMinus8       , 0                              , "AlphaChannelBitDepthMinus8"       )
    727707    ("AlphaTransparentValue"          , m_alphaTransparentValue            , 0                              , "AlphaTransparentValue"            )
    728     ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 ,                             , "AlphaOpaqueValue"                 )
     708    ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 , 255                            , "AlphaOpaqueValue"                 )
    729709    ("AlphaChannelIncrFlag"           , m_alphaChannelIncrFlag             , false                          , "AlphaChannelIncrFlag"             )
    730710    ("AlphaChannelClipFlag"           , m_alphaChannelClipFlag             , false                          , "AlphaChannelClipFlag"             )
     
    745725  Bool wrongConfig = false;
    746726
    747   // TBD: Add constraints on presence of SEI here.
    748   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    749   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    750 
    751   // TBD: Modify constraints according to the SEI semantics.   
    752   xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , MINVAL , MAXVAL, "alpha_channel_cancel_flag"        );
    753   xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , MINVAL , MAXVAL, "alpha_channel_use_idc");
    754   xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , MINVAL , MAXVAL, "alpha_channel_bit_depth_minus8"   );
    755   xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , MINVAL , MAXVAL, "alpha_transparent_value"          );
    756   xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , MINVAL , MAXVAL, "alpha_opaque_value"   );
    757   xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , MINVAL , MAXVAL, "alpha_channel_incr_flag"          );
    758   xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , MINVAL , MAXVAL, "alpha_channel_clip_flag"          );
    759   xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , MINVAL , MAXVAL, "alpha_channel_clip_type_flag"     );
     727  int maxInterpretationValue = (1 << (m_alphaChannelBitDepthMinus8+9)) - 1;
     728  xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , 0 , 1, "alpha_channel_cancel_flag"        );
     729  xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , 0 , 7, "alpha_channel_use_idc");
     730  xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , 0 , 7, "alpha_channel_bit_depth_minus8"   );
     731  xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , 0 , maxInterpretationValue, "alpha_transparent_value"          );
     732  xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , 0 , maxInterpretationValue, "alpha_opaque_value"   );
     733  xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , 0 , 1, "alpha_channel_incr_flag"          );
     734  xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , 0 , 1, "alpha_channel_clip_flag"          );
     735  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , 0 , 1, "alpha_channel_clip_type_flag"     );
    760736
    761737  return wrongConfig;
    762738
    763739};
    764 
     740#if NH_MV_SEI_TBD
    765741Void SEIOverlayInfo::setupFromSlice  ( const TComSlice* slice )
    766742{
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibCommon/SEI.h

    r1332 r1334  
    782782};
    783783
    784 #if NH_MV_SEI_TBD
    785784class SEIAlphaChannelInfo : public SEI
    786785{
     
    792791
    793792  Void setupFromCfgFile( const Char*      cfgFile );
    794   Void setupFromSlice  ( const TComSlice* slice   );
    795793  Bool checkCfg        ( const TComSlice* slice   );
    796794
     
    805803};
    806804
     805#if NH_MV_SEI_TBD
    807806class SEIOverlayInfo : public SEI
    808807{
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibDecoder/SEIread.cpp

    r1332 r1334  
    336336      xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream );
    337337      break;
    338 #if NH_MV_SEI_TBD
    339338    case SEI::ALPHA_CHANNEL_INFO:
    340339      sei = new SEIAlphaChannelInfo;
    341340      xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    342341      break;
     342#if NH_MV_SEI_TBD
    343343    case SEI::OVERLAY_INFO:
    344344      sei = new SEIOverlayInfo;
     
    13341334};
    13351335
    1336 #if NH_MV_SEI_TBD
    13371336Void SEIReader::xParseSEIAlphaChannelInfo(SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    13381337{
     
    13451344    sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_use_idc" ); sei.m_alphaChannelUseIdc = code;
    13461345    sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_bit_depth_minus8" ); sei.m_alphaChannelBitDepthMinus8 = code;
    1347     sei_read_code( pDecodedMessageOutputStream, getAlphaTransparentValueLen ), code, "alpha_transparent_value" ); sei.m_alphaTransparentValue = code;
    1348     sei_read_code( pDecodedMessageOutputStream, getAlphaOpaqueValueLen ), code, "alpha_opaque_value" ); sei.m_alphaOpaqueValue = code;
     1346    sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_transparent_value" ); sei.m_alphaTransparentValue = code;
     1347    sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_opaque_value" ); sei.m_alphaOpaqueValue = code;
    13491348    sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_incr_flag" ); sei.m_alphaChannelIncrFlag = (code == 1);
    13501349    sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_flag" ); sei.m_alphaChannelClipFlag = (code == 1);
     
    13561355};
    13571356
     1357#if NH_MV_SEI_TBD
    13581358Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    13591359{
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibDecoder/SEIread.h

    r1331 r1334  
    111111#endif
    112112  Void xParseSEISubBitstreamProperty          (SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     113  Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    113114#if NH_MV_SEI_TBD
    114   Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    115115  Void xParseSEIOverlayInfo                   (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    116116#endif
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibEncoder/SEIwrite.cpp

    r1331 r1334  
    148148     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
    149149     break;
    150 #if NH_MV_SEI_TBD
    151150   case SEI::ALPHA_CHANNEL_INFO:
    152151     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
    153      break;
     152     break;
     153#if NH_MV_SEI_TBD
    154154   case SEI::OVERLAY_INFO:
    155155     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
     
    977977  }
    978978};
    979 #if NH_MV_SEI_TBD
     979
    980980Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei)
    981981{
     
    985985    WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" );
    986986    WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" );
    987     WRITE_CODE( sei.m_alphaTransparentValue, getAlphaTransparentValueLen ), "alpha_transparent_value" );
    988     WRITE_CODE( sei.m_alphaOpaqueValue, getAlphaOpaqueValueLen ), "alpha_opaque_value" );
     987    WRITE_CODE( sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" );
     988    WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_opaque_value" );
    989989    WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" );
    990990    WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" );
     
    996996};
    997997
     998#if NH_MV_SEI_TBD
    998999Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei)
    9991000{
  • branches/HTM-15.1-dev0-BBC/source/Lib/TLibEncoder/SEIwrite.h

    r1331 r1334  
    9393#endif
    9494  Void xWriteSEISubBitstreamProperty          ( const SEISubBitstreamProperty& sei);
     95  Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
    9596#if NH_MV_SEI_TBD
    96   Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
    9797  Void xWriteSEIOverlayInfo                   ( const SEIOverlayInfo& sei);
    9898#endif
Note: See TracChangeset for help on using the changeset viewer.