Changeset 1337 in 3DVCSoftware


Ignore:
Timestamp:
23 Sep 2015, 18:32:42 (9 years ago)
Author:
ericsson
Message:

Integration of the 3D reference displays information SEI message.

Location:
branches/HTM-15.1-dev0-Ericsson
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.1-dev0-Ericsson/cfg/SEI/threeDimensionalReferenceDisplaysInfoSei.cfg

    r1328 r1337  
    11
    2 PayloadType                     : TBD
     2PayloadType                     : 176
    33
    44#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
    5 ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
    6 ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
    7 ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
    8 ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
     5ApplicableLayerIds              :                             # LayerIds      of layers   to which the SEI is added. (all when empty)
     6ApplicablePocs                  :                             # POCs          of pictures to which the SEI is added. (all when empty)
     7ApplicableTids                  :                             # Tids          of pictures to which the SEI is added. (all when empty)
     8ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
    99
    1010#======== Position in bit stream  ============
     
    1313
    1414#======== Payload modification =============
    15 ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
     15ModifyByEncoder                 :                             #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
    1616
    1717#======== Payload specification =============
    18 PrecRefDisplayWidth             : 0
    19 RefViewingDistanceFlag          : 0
    20 PrecRefViewingDist              : 0
     18PrecRefDisplayWidth             : 2
     19RefViewingDistanceFlag          : 1
     20PrecRefViewingDist              : 1
    2121NumRefDisplaysMinus1            : 0
    22 LeftViewId                      : 0
    23 RightViewId                     : 0
    24 ExponentRefDisplayWidth         : 0
    25 MantissaRefDisplayWidth         : 0
    26 ExponentRefViewingDistance      : 0
    27 MantissaRefViewingDistance      : 0
    28 AdditionalShiftPresentFlag      : 0
    29 NumSampleShiftPlus512           : 0
     22LeftViewId                      : 3
     23RightViewId                     : 1
     24ExponentRefDisplayWidth         : 36
     25MantissaRefDisplayWidth         : 68
     26ExponentRefViewingDistance      : 37
     27MantissaRefViewingDistance      : 94
     28AdditionalShiftPresentFlag      : 1
     29NumSampleShiftPlus512           : 482
    3030ThreeDimensionalReferenceDisplaysExtensionFlag: 0
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibCommon/SEI.cpp

    r1335 r1337  
    240240#if NH_MV_SEI_TBD
    241241  case SEI::FRAME_FIELD_INFO                      :               return new SEIFrameFieldInfo;
     242#endif
    242243  case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:            return new SEIThreeDimensionalReferenceDisplaysInfo;
     244#if NH_MV_SEI_TBD
    243245  case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo; 
    244246#endif
     
    976978
    977979};
    978 
    979 Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromSlice  ( const TComSlice* slice )
    980 {
    981   sei.m_precRefDisplayWidth =  TBD ;
    982   sei.m_refViewingDistanceFlag =  TBD ;
    983   if( sei.m_refViewingDistanceFlag )
    984   {
    985     sei.m_precRefViewingDist =  TBD ;
    986   }
    987   sei.m_numRefDisplaysMinus1 =  TBD ;
    988   for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
    989   {
    990     sei.m_leftViewId[i] =  TBD ;
    991     sei.m_rightViewId[i] =  TBD ;
    992     sei.m_exponentRefDisplayWidth[i] =  TBD ;
    993     sei.m_mantissaRefDisplayWidth[i] =  TBD ;
    994     if( sei.m_refViewingDistanceFlag )
    995     {
    996       sei.m_exponentRefViewingDistance[i] =  TBD ;
    997       sei.m_mantissaRefViewingDistance[i] =  TBD ;
    998     }
    999     sei.m_additionalShiftPresentFlag[i] =  TBD ;
    1000     if( sei.m_additionalShiftPresentFlag( i ) )
    1001     {
    1002       sei.m_numSampleShiftPlus512[i] =  TBD ;
    1003     }
    1004   }
    1005   sei.m_threeDimensionalReferenceDisplaysExtensionFlag =  TBD ;
    1006 };
     980#endif
    1007981
    1008982Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
     
    1011985  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
    1012986
    1013   // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    1014   defAppLayerIds    .push_back( TBD );
    1015   defAppPocs        .push_back( TBD );
    1016   defAppTids        .push_back( TBD );
    1017   defAppVclNaluTypes.push_back( TBD );
     987  // Default values for which layers, POCS, Tids or Nalu types the SEI should be sent.
     988  defAppLayerIds      .push_back( 0 );
     989  defAppPocs          .push_back( 0 );
     990  defAppTids          .push_back( 0 );
     991  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
    1018992
    1019993  Int      defSeiNaluId                  = 0;
    1020994  Int      defPositionInSeiNalu          = 0;
    1021   Bool     defModifyByEncoder            = TBD;
     995  Bool     defModifyByEncoder            = 0;
    1022996
    1023997  // Setup config file options
     
    10481022};
    10491023
     1024
     1025UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceDisplayWidthLen( Int i ) const
     1026{
     1027  return xGetSyntaxElementLen( m_exponentRefDisplayWidth[i], m_precRefDisplayWidth, m_mantissaRefDisplayWidth[ i ] );
     1028}
     1029
     1030UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceViewingDistanceLen( Int i ) const
     1031{
     1032  return xGetSyntaxElementLen( m_exponentRefViewingDistance[i], m_precRefViewingDist, m_mantissaRefViewingDistance[ i ] );
     1033}
     1034
     1035UInt SEIThreeDimensionalReferenceDisplaysInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
     1036{
     1037  UInt len;
     1038  if( expo == 0 )
     1039  {
     1040    len = std::max(0, prec - 30 );
     1041  }
     1042  else
     1043  {
     1044    len = std::max( 0, expo + prec - 31 );
     1045  }
     1046
     1047  assert( val >= 0 );
     1048  assert( val <= ( ( 1 << len )- 1) );
     1049  return len;
     1050}
     1051
    10501052Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
    10511053{
     
    10531055  Bool wrongConfig = false;
    10541056
    1055   // TBD: Add constraints on presence of SEI here.
    1056   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    1057   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    1058 
    1059   // TBD: Modify constraints according to the SEI semantics.   
    1060   xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , MINVAL , MAXVAL, "prec_ref_display_width"           );
    1061   xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , MINVAL , MAXVAL, "ref_viewing_distance_flag"        );
    1062   xCheckCfgRange( wrongConfig, m_precRefViewingDist             , MINVAL , MAXVAL, "prec_ref_viewing_dist"            );
    1063   xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , MINVAL , MAXVAL, "num_ref_displays_minus1"          );
    1064   xCheckCfgRange( wrongConfig, m_leftViewId[i]                  , MINVAL , MAXVAL, "left_view_id"                     );
    1065   xCheckCfgRange( wrongConfig, m_rightViewId[i]                 , MINVAL , MAXVAL, "right_view_id"                    );
    1066   xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , MINVAL , MAXVAL, "exponent_ref_display_width"       );
    1067   xCheckCfgRange( wrongConfig, m_mantissaRefDisplayWidth[i]     , MINVAL , MAXVAL, "mantissa_ref_display_width"       );
    1068   xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , MINVAL , MAXVAL, "exponent_ref_viewing_distance"    );
    1069   xCheckCfgRange( wrongConfig, m_mantissaRefViewingDistance[i]  , MINVAL , MAXVAL, "mantissa_ref_viewing_distance"    );
    1070   xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , MINVAL , MAXVAL, "additional_shift_present_flag"    );
    1071   xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , MINVAL , MAXVAL, "num_sample_shift_plus512"         );
    1072   xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, MINVAL , MAXVAL, "three_dimensional_reference_displays_extension_flag");
     1057  // The 3D reference display SEI should preferably be sent along with the multiview acquisition SEI. For now the multiview acquisition SEI is restricted to POC = 0, so 3D reference displays SEI is restricted to POC = 0 as well.
     1058  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "The 3D reference displays SEI message currently is associated with an access unit that contains an IRAP picture." ); 
     1059
     1060  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , 0 , 31, "prec_ref_display_width"  );
     1061  xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , 0 , 1, "ref_viewing_distance_flag");
     1062  xCheckCfgRange( wrongConfig, m_precRefViewingDist             , 0 , 31, "prec_ref_viewing_dist"   );
     1063  xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , 0 , 31, "num_ref_displays_minus1" );
     1064
     1065  for (Int i = 0; i <= getNumRefDisplaysMinus1(); i++ )
     1066  { 
     1067    xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , 0 , 62, "exponent_ref_display_width"   );
     1068    xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , 0 , 62, "exponent_ref_viewing_distance");
     1069    xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , 0 , 1, "additional_shift_present_flag" );
     1070    xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , 0 , 1023, "num_sample_shift_plus512"   );
     1071  }
     1072  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, 0 , 1, "three_dimensional_reference_displays_extension_flag");
    10731073
    10741074  return wrongConfig;
     
    10761076};
    10771077
     1078#if NH_MV_SEI_TBD
    10781079Void SEIDepthRepresentationInfo::setupFromSlice  ( const TComSlice* slice )
    10791080{
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibCommon/SEI.h

    r1334 r1337  
    873873  Bool      m_ffinfoDuplicateFlag;
    874874};
     875#endif
    875876
    876877class SEIThreeDimensionalReferenceDisplaysInfo : public SEI
     
    883884
    884885  Void setupFromCfgFile( const Char*      cfgFile );
    885   Void setupFromSlice  ( const TComSlice* slice   );
    886   Bool checkCfg        ( const TComSlice* slice   );
     886  Bool checkCfg        ( const TComSlice* slice   );
     887
     888  Int getNumRefDisplaysMinus1( ) const
     889  {
     890    return m_numRefDisplaysMinus1;
     891  }
    887892
    888893  Int       m_precRefDisplayWidth;
     
    899904  IntAry1d  m_numSampleShiftPlus512;
    900905  Bool      m_threeDimensionalReferenceDisplaysExtensionFlag;
    901 };
    902 
     906
     907  Void resizeArrays( )
     908  {
     909    Int numReferenceDiaplays = getNumRefDisplaysMinus1() + 1;
     910 
     911    m_leftViewId    .resize( numReferenceDiaplays );
     912    m_rightViewId   .resize( numReferenceDiaplays );
     913    m_exponentRefDisplayWidth      .resize( numReferenceDiaplays );
     914    m_mantissaRefDisplayWidth      .resize( numReferenceDiaplays );
     915    m_exponentRefViewingDistance   .resize( numReferenceDiaplays );
     916    m_mantissaRefViewingDistance   .resize( numReferenceDiaplays );
     917    m_additionalShiftPresentFlag   .resize( numReferenceDiaplays );
     918    m_numSampleShiftPlus512        .resize( numReferenceDiaplays );
     919  }
     920
     921  UInt getMantissaReferenceDisplayWidthLen  ( Int i ) const ;
     922  UInt getMantissaReferenceViewingDistanceLen  ( Int i ) const ;
     923private:
     924  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const;
     925};
     926
     927#if NH_MV_SEI_TBD
    903928class SEIDepthRepresentationInfo : public SEI
    904929{
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibDecoder/SEIread.cpp

    r1334 r1337  
    355355      xParseSEIFrameFieldInfo((SEIFrameFieldInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    356356      break;
     357#endif
    357358    case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
    358359      sei = new SEIThreeDimensionalReferenceDisplaysInfo;
    359360      xParseSEIThreeDimensionalReferenceDisplaysInfo((SEIThreeDimensionalReferenceDisplaysInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    360361      break;
     362#if NH_MV_SEI_TBD
    361363    case SEI::DEPTH_REPRESENTATION_INFO:
    362364      sei = new SEIDepthRepresentationInfo;
     
    14371439  sei_read_flag( pDecodedMessageOutputStream, code, "ffinfo_duplicate_flag" ); sei.m_ffinfoDuplicateFlag = (code == 1);
    14381440};
     1441#endif
    14391442
    14401443Void SEIReader::xParseSEIThreeDimensionalReferenceDisplaysInfo(SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
     
    14501453  }
    14511454  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_ref_displays_minus1" ); sei.m_numRefDisplaysMinus1 = code;
    1452   for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
     1455  sei.resizeArrays( );
     1456  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
    14531457  {
    14541458    sei_read_uvlc( pDecodedMessageOutputStream, code, "left_view_id" ); sei.m_leftViewId[i] = code;
    14551459    sei_read_uvlc( pDecodedMessageOutputStream, code, "right_view_id" ); sei.m_rightViewId[i] = code;
    14561460    sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_display_width" ); sei.m_exponentRefDisplayWidth[i] = code;
    1457     sei_read_code( pDecodedMessageOutputStream, getMantissaRefDisplayWidthLen ), code, "mantissa_ref_display_width" ); sei.m_mantissaRefDisplayWidth[i] = code;
     1461    sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceDisplayWidthLen(i), code, "mantissa_ref_display_width" ); sei.m_mantissaRefDisplayWidth[i] =  code      ;
    14581462    if( sei.m_refViewingDistanceFlag )
    14591463    {
    14601464      sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_viewing_distance" ); sei.m_exponentRefViewingDistance[i] = code;
    1461       sei_read_code( pDecodedMessageOutputStream, getMantissaRefViewingDistanceLen ), code, "mantissa_ref_viewing_distance" ); sei.m_mantissaRefViewingDistance[i] = code;
     1465      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceViewingDistanceLen(i), code, "mantissa_ref_viewing_distance" ); sei.m_mantissaRefViewingDistance[i] = code;
    14621466    }
    14631467    sei_read_flag( pDecodedMessageOutputStream, code, "additional_shift_present_flag" ); sei.m_additionalShiftPresentFlag[i] = (code == 1);
    1464     if( sei.m_additionalShiftPresentFlag( i ) )
     1468    if( sei.m_additionalShiftPresentFlag[i] )
    14651469    {
    14661470      sei_read_code( pDecodedMessageOutputStream, 10, code, "num_sample_shift_plus512" ); sei.m_numSampleShiftPlus512[i] = code;
     
    14701474};
    14711475
     1476#if NH_MV_SEI_TBD
    14721477Void SEIReader::xParseSEIDepthRepresentationInfo(SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    14731478{
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibDecoder/SEIread.h

    r1334 r1337  
    118118#if NH_MV_SEI_TBD
    119119  Void xParseSEIFrameFieldInfo                (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     120#endif
    120121  Void xParseSEIThreeDimensionalReferenceDisplaysInfo (SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     122#if NH_MV_SEI_TBD
    121123  Void xParseSEIDepthRepresentationInfo       (SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
    122124
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibEncoder/SEIwrite.cpp

    r1334 r1337  
    163163     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
    164164     break;
     165#endif
    165166   case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
    166167     xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei));
    167168     break;
     169 #if NH_MV_SEI_TBD
    168170   case SEI::DEPTH_REPRESENTATION_INFO:
    169171     xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei));
     
    10691071  WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" );
    10701072};
     1073#endif
    10711074
    10721075Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei)
     
    10791082  }
    10801083  WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" );
    1081   for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
     1084  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
    10821085  {
    10831086    WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" );
    10841087    WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" );
    10851088    WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" );
    1086     WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], getMantissaRefDisplayWidthLen ), "mantissa_ref_display_width" );
     1089    WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" );
    10871090    if( sei.m_refViewingDistanceFlag )
    10881091    {
    10891092      WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" );
    1090       WRITE_CODE( sei.m_mantissaRefViewingDistance[i], getMantissaRefViewingDistanceLen ), "mantissa_ref_viewing_distance" );
     1093      WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" );
    10911094    }
    10921095    WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" );
    1093     if( sei.m_additionalShiftPresentFlag( i ) )
     1096    if( sei.m_additionalShiftPresentFlag[i] )
    10941097    {
    10951098      WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" );
     
    10991102};
    11001103
     1104#if NH_MV_SEI_TBD
    11011105Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei)
    11021106{
  • branches/HTM-15.1-dev0-Ericsson/source/Lib/TLibEncoder/SEIwrite.h

    r1334 r1337  
    100100#if NH_MV_SEI_TBD
    101101  Void xWriteSEIFrameFieldInfo                ( const SEIFrameFieldInfo& sei);
     102#endif
    102103  Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei);
     104#if NH_MV_SEI_TBD
    103105  Void xWriteSEIDepthRepresentationInfo       ( const SEIDepthRepresentationInfo& sei);
    104106  Void xWriteSEIDepthRepInfoElement           ( const SEIDepthRepInfoElement& sei);
Note: See TracChangeset for help on using the changeset viewer.