Changeset 544 in SHVCSoftware for branches/SHM-4.1-dev/source


Ignore:
Timestamp:
11 Jan 2014, 01:46:01 (11 years ago)
Author:
seregin
Message:

JCTVC-O0109. Patch was provided by Yongjin Cho <choyongjin@…>

Location:
branches/SHM-4.1-dev/source
Files:
6 edited

Legend:

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

    r537 r544  
    11711171  vps->setNumOutputLayerSets(vps->getNumLayerSets());
    11721172  vps->setNumProfileTierLevel(vps->getNumLayerSets());
     1173#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     1174  vps->setDefaultOneTargetOutputLayerIdc(1);
     1175#else
    11731176  vps->setDefaultOneTargetOutputLayerFlag(true);
     1177#endif
    11741178  for(i = 1; i < vps->getNumLayerSets(); i++)
    11751179  {
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r542 r544  
    20382038, m_moreOutputLayerSetsThanDefaultFlag (false)
    20392039, m_numAddOutputLayerSets     (0)
     2040#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     2041, m_defaultOneTargetOutputLayerIdc     (0)
     2042#else
    20402043, m_defaultOneTargetOutputLayerFlag    (false)
     2044#endif
    20412045#if VPS_VUI_BITRATE_PICRATE
    20422046, m_bitRatePresentVpsFlag     (false)
     
    20482052#endif
    20492053#if VIEW_ID_RELATED_SIGNALING
     2054#if O0109_VIEW_ID_LEN
     2055, m_viewIdLen                (0)
     2056#else
    20502057, m_viewIdLenMinus1           (0)
     2058#endif
    20512059#endif
    20522060#if VPS_VUI_OFFSET
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h

    r542 r544  
    540540  Bool       m_moreOutputLayerSetsThanDefaultFlag;
    541541  Int        m_numAddOutputLayerSets;
     542#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     543  UInt       m_defaultOneTargetOutputLayerIdc;
     544#else
    542545  Bool       m_defaultOneTargetOutputLayerFlag;
     546#endif
    543547  Int        m_profileLevelTierIdx[64];     
    544548#if JCTVC_M0458_INTERLAYER_RPS_SIG
     
    622626#endif
    623627#if VIEW_ID_RELATED_SIGNALING
     628#if O0109_VIEW_ID_LEN
     629  Int         m_viewIdLen;
     630#else
    624631  Int         m_viewIdLenMinus1;
     632#endif
    625633  Int         m_viewIdVal                [MAX_LAYERS];
    626634#endif
     
    642650  Int     m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
    643651#endif
     652
     653#if O0109_MOVE_VPS_VUI_FLAG
     654  Bool       m_vpsVuiPresentFlag;
     655#endif
     656
    644657#endif //SVC_EXTENSION
    645658#if VPS_VUI_OFFSET
     
    814827  Void   setNumAddOutputLayerSets(Int x)                         { m_numAddOutputLayerSets = x   ; }
    815828
     829#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     830  UInt   getDefaultOneTargetOutputLayerIdc()                 { return m_defaultOneTargetOutputLayerIdc;}
     831  Void   setDefaultOneTargetOutputLayerIdc(UInt x)           { m_defaultOneTargetOutputLayerIdc= x    ;}
     832#else
    816833  Bool   getDefaultOneTargetOutputLayerFlag()                 { return m_defaultOneTargetOutputLayerFlag;}
    817834  Void   setDefaultOneTargetOutputLayerFlag(Bool x)           { m_defaultOneTargetOutputLayerFlag= x    ;}
    818 
     835#endif
    819836  Int    getProfileLevelTierIdx(Int i)                        { return m_profileLevelTierIdx[i]; }
    820837  Void   setProfileLevelTierIdx(Int i, Int x)                 { m_profileLevelTierIdx[i] = x   ; }
     
    949966#endif
    950967#if VIEW_ID_RELATED_SIGNALING
     968#if O0109_VIEW_ID_LEN
     969  Void    setViewIdLen( Int  val )                                   { m_viewIdLen = val; }
     970  Int     getViewIdLen(  )                                           { return m_viewIdLen; }
     971#else
    951972  Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; }
    952973  Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; }
     974#endif
    953975
    954976  Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; }
     
    9891011  Void    setNumSubDpbs(Int i, Int x)                   { m_numSubDpbs[i] = x;    }
    9901012#endif
     1013
     1014#if O0109_MOVE_VPS_VUI_FLAG
     1015  Bool   getVpsVuiPresentFlag()                                 { return m_vpsVuiPresentFlag; }
     1016  Void   setVpsVuiPresentFlag(Bool x)                           { m_vpsVuiPresentFlag = x; }
     1017#endif
     1018
    9911019#if VPS_VUI_OFFSET
    9921020  Int     getVpsVuiOffset()         { return m_vpsVuiOffset; }
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h

    r543 r544  
    4949#define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
    5050
     51#define O0109_O0199_FLAGS_TO_VUI         1      ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui
     52#define O0109_VIEW_ID_LEN                1      ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews
     53#define O0109_PROF_REF_MINUS1            1      ///< JCTVC-O0109: constraint that profile_ref_minus1[i] shall be less than or equal to i
     54#define O0109_DEFAULT_ONE_OUT_LAYER_IDC  1      ///< JCTVC-O0109: default_one_target_output_layer_flag to default_one_target_output_layer_idc
     55#define O0109_MOVE_VPS_VUI_FLAG          1      ///< JCTVC-O0109: move vps_vui_present_flag before vps_vui_offset
     56
    5157#define O0194_DIFFERENT_BITDEPTH_EL_BL   1      ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled)
    5258#if O0194_DIFFERENT_BITDEPTH_EL_BL
     
    179185#define RC_SHVC_HARMONIZATION            1      ///< JCTVC-M0037: rate control for SHVC
    180186
    181 #define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id_len_minus1 and view_id_val
     187#define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id and view_id_val
    182188#define M0043_LAYERS_PRESENT_SEI         0      ///< JCTVC-M0043: add layers present SEI. Macro shall be equal to 0 according to the JCTVC-N0174 discussion. The code is to be removed.
    183189#define N0383_IL_CONSTRAINED_TILE_SETS_SEI  1
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r542 r544  
    990990
    991991  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
     992
     993#if O0109_MOVE_VPS_VUI_FLAG
     994  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
     995  if ( uiCode )
     996  {
     997#endif
    992998#if VPS_VUI_OFFSET
    993999  READ_CODE( 16, uiCode, "vps_vui_offset" );  vps->setVpsVuiOffset( uiCode );
     1000#endif
     1001#if O0109_MOVE_VPS_VUI_FLAG
     1002  }
    9941003#endif
    9951004  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
     
    10511060  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    10521061  {
     1062#if O0109_VIEW_ID_LEN
     1063    READ_CODE( 4, uiCode, "view_id_len" ); vps->setViewIdLen( uiCode );
     1064#else
    10531065    READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode );
    1054   }
    1055 
     1066#endif
     1067  }
     1068
     1069#if O0109_VIEW_ID_LEN
     1070  if ( vps->getViewIdLen() > 0 )
     1071  {
     1072    for(  i = 0; i < vps->getNumViews(); i++ )
     1073    {
     1074      READ_CODE( vps->getViewIdLen( ), uiCode, "view_id_val[i]" ); vps->setViewIdVal( i, uiCode );
     1075    }
     1076  }
     1077#else
    10561078  for(  i = 0; i < vps->getNumViews(); i++ )
    10571079  {
     
    10591081  }
    10601082#endif
     1083#endif // view id related signaling
    10611084#if VPS_EXTN_DIRECT_REF_LAYERS
    10621085  // For layer 0
     
    11681191    {
    11691192      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     1193#if O0109_PROF_REF_MINUS1
     1194      assert( vps->getProfileLayerSetRef(idx) <= idx );
     1195#else
    11701196      assert( vps->getProfileLayerSetRef(idx) < idx );
    1171 
     1197#endif
    11721198      // Copy profile information as indicated
    11731199      vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
     
    11901216  if( numOutputLayerSets > 1 )
    11911217  {
     1218#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     1219    READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" );   vps->setDefaultOneTargetOutputLayerIdc( uiCode );
     1220#else
    11921221    READ_FLAG( uiCode, "default_one_target_output_layer_flag" );   vps->setDefaultOneTargetOutputLayerFlag( uiCode ? true : false );
     1222#endif
    11931223  }
    11941224  vps->setNumOutputLayerSets( numOutputLayerSets );
     
    12181248      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
    12191249      Int lsIdx = i;
     1250#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     1251      if( vps->getDefaultOneTargetOutputLayerIdc() == 1 )
     1252      {
     1253        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1254        {
     1255          vps->setOutputLayerFlag(i, j, (j == (vps->getNumLayersInIdList(lsIdx)-1)));
     1256        }
     1257      }
     1258      else if ( vps->getDefaultOneTargetOutputLayerIdc() == 0 )
     1259      {
     1260        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1261        {
     1262          vps->setOutputLayerFlag(i, j, 1);
     1263        }
     1264      }
     1265      else
     1266      {
     1267        // Other values of default_one_target_output_layer_idc than 0 and 1 are reserved for future use.
     1268      }
     1269#else
    12201270      if( vps->getDefaultOneTargetOutputLayerFlag() )
    12211271      {
     
    12321282        }
    12331283      }
     1284#endif
    12341285    }
    12351286    Int numBits = 1;
     
    14111462#endif
    14121463
     1464#if !O0109_O0199_FLAGS_TO_VUI
    14131465#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    14141466  READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false);
     
    14171469  READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
    14181470#endif
    1419 
     1471#endif
     1472
     1473#if O0109_MOVE_VPS_VUI_FLAG
     1474  if ( vps->getVpsVuiPresentFlag() )
     1475#else
    14201476  READ_FLAG( uiCode,  "vps_vui_present_flag" );
    14211477  if (uiCode)
     1478#endif
    14221479  {
    14231480#if VPS_VUI
     
    15961653  }
    15971654#endif
     1655
     1656#if O0109_O0199_FLAGS_TO_VUI
     1657#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1658  READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false);
     1659#endif
     1660#if HIGHER_LAYER_IRAP_SKIP_FLAG
     1661  READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
     1662#endif
     1663#endif
     1664
    15981665#if N0160_VUI_EXT_ILP_REF
    15991666    READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 );
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r542 r544  
    798798
    799799  WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
     800#if O0109_MOVE_VPS_VUI_FLAG
     801#if !VPS_VUI
     802  WRITE_FLAG( 0,                     "vps_vui_present_flag" );
     803  vps->setVpsVuiPresentFlag(false);
     804#else
     805  WRITE_FLAG( 1,                     "vps_vui_present_flag" );
     806  vps->setVpsVuiPresentFlag(true);
     807#endif
     808  if ( vps->getVpsVuiPresentFlag() )
     809  {
     810#if VPS_VUI_OFFSET
     811    WRITE_CODE( vps->getVpsVuiOffset(  ), 16,             "vps_vui_offset" );
     812#endif
     813    WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
     814  }
     815#else
    800816#if VPS_VUI_OFFSET
    801817  WRITE_CODE( vps->getVpsVuiOffset(  ), 16,             "vps_vui_offset" ); 
    802818#endif
    803819  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
     820#endif // O0109_MOVE_VPS_VUI_FLAG
    804821
    805822  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     
    847864  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    848865  {
     866#if O0109_VIEW_ID_LEN
     867    WRITE_CODE( vps->getViewIdLen( ), 4, "view_id_len" );
     868    assert ( vps->getNumViews() >= (1<<vps->getViewIdLen()) );
     869#else
    849870    WRITE_CODE( vps->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
    850   }
    851 
     871#endif
     872  }
     873
     874#if O0109_VIEW_ID_LEN
     875  if ( vps->getViewIdLen() > 0 )
     876  {
     877#endif
    852878  for(  i = 0; i < vps->getNumViews(); i++ )
    853879  {
     880#if O0109_VIEW_ID_LEN
     881    WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLen( ), "view_id_val[i]" );
     882#else
    854883    WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    855   }
    856 #endif
     884#endif
     885  }
     886#if O0109_VIEW_ID_LEN
     887  }
     888#endif
     889#endif // VIEW_ID_RELATED_SIGNALING
     890
    857891#if VPS_EXTN_DIRECT_REF_LAYERS
    858892  for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     
    937971  if( numOutputLayerSets > 1 )
    938972  {
     973#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     974    WRITE_CODE( vps->getDefaultOneTargetOutputLayerIdc(), 2, "default_one_target_output_layer_idc" );   
     975#else
    939976    WRITE_FLAG( vps->getDefaultOneTargetOutputLayerFlag(), "default_one_target_output_layer_flag" );   
     977#endif
    940978  }
    941979
     
    10781116#endif
    10791117#endif
     1118
     1119#if !O0109_O0199_FLAGS_TO_VUI
    10801120#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    10811121  WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" );
     
    10841124  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
    10851125#endif
    1086 
     1126#endif
     1127
     1128#if !O0109_MOVE_VPS_VUI_FLAG
    10871129#if !VPS_VUI
    10881130  WRITE_FLAG( 0,                     "vps_vui_present_flag" );
     
    11031145  }
    11041146#endif
     1147#else
     1148  if(vps->getVpsVuiPresentFlag())   // Should be conditioned on the value of vps_vui_present_flag
     1149  {
     1150    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
     1151    {
     1152      WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
     1153    }
     1154#if VPS_VUI_OFFSET
     1155    Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
     1156    assert( vpsVuiOffsetValeInBits % 8 == 0 );
     1157    vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
     1158#endif
     1159    codeVPSVUI(vps); 
     1160  }
     1161#endif // 0109_MOVE_VPS_FLAG
    11051162}
    11061163#endif
     
    12361293    }
    12371294  }
     1295#endif
     1296
     1297#if O0109_O0199_FLAGS_TO_VUI
     1298#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1299  WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" );
     1300#endif
     1301#if HIGHER_LAYER_IRAP_SKIP_FLAG
     1302  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
     1303#endif
    12381304#endif
    12391305#if N0160_VUI_EXT_ILP_REF
Note: See TracChangeset for help on using the changeset viewer.