Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibDecoder


Ignore:
Timestamp:
10 Dec 2013, 13:50:12 (11 years ago)
Author:
tech
Message:

Merged HTM-9.0-dev0@731. (MV-HEVC 6 HLS)

Location:
trunk/source/Lib/TLibDecoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r724 r738  
    396396
    397397  READ_FLAG(     uiCode, "video_signal_type_present_flag");           pcVUI->setVideoSignalTypePresentFlag(uiCode);
     398#if H_MV_6_PS_O0118_33
     399  assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() );
     400#endif
     401
    398402  if (pcVUI->getVideoSignalTypePresentFlag())
    399403  {
     
    582586  {
    583587    READ_FLAG( uiCode, "update_rep_format_flag" );               pcSPS->setUpdateRepFormatFlag( uiCode == 1 );
     588#if H_MV_6_PS_REP_FORM_18_19_20
     589    if ( pcSPS->getUpdateRepFormatFlag() )
     590    {
     591      READ_CODE( 8, uiCode, "sps_rep_format_idx" );                pcSPS->setSpsRepFormatIdx( uiCode );
     592    }
     593  }
     594  else
     595  {
     596#else
    584597  }
    585598 
    586599  if ( pcSPS->getUpdateRepFormatFlag() )
    587600  {
     601#endif
    588602#endif
    589603  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     
    621635
    622636#if H_MV
     637#if H_MV_6_PS_REP_FORM_18_19_20
     638  if ( pcSPS->getLayerId() == 0 )
     639#else
    623640  if ( pcSPS->getUpdateRepFormatFlag() )
     641#endif
    624642  {
    625643#endif
     
    770788
    771789  READ_FLAG( uiCode, "sps_extension_flag");
    772   if (uiCode)
    773   {
     790#if H_MV_6_PSEM_O0142_3
     791  pcSPS->setSpsExtensionFlag( uiCode );
     792#endif
     793  if (pcSPS->getSpsExtensionFlag( ) )
     794  {
     795#if !H_MV_6_PSEM_O0142_3
    774796#if H_MV
    775797    parseSPSExtension( pcSPS );
     
    784806#endif
    785807#endif
     808#else   
     809    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
     810    {
     811      READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode );
     812#if H_3D
     813      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC );
     814#else
     815      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC );
     816#endif
     817    } 
     818
     819    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
     820    {
     821      parseSPSExtension( pcSPS );
     822    }
     823
     824#if H_3D
     825    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
     826    {
     827      parseSPSExtension2( pcSPS, viewIndex, depthFlag  );
     828    }
     829#endif
     830
     831    if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC ))
     832    {   
     833#endif
    786834        while ( xMoreRbspData() )
    787835        {
    788836          READ_FLAG( uiCode, "sps_extension_data_flag");
    789837        }
     838#if H_MV_6_PSEM_O0142_3
     839    }
     840#else
    790841#if H_MV     
    791842#if H_3D
     
    794845    }
    795846#endif
     847#endif
    796848  }
    797849}
     
    802854  UInt uiCode;
    803855  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
     856#if !H_MV_6_SHVC_O0098_36
    804857  READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" );
     858#else
     859 
     860  READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode );
     861
     862  for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++)
     863  {   
     864    READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode );
     865
     866    Int j = pcSPS->getScaledRefLayerId( i );
     867    Int iCode;
     868    READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); pcSPS->setScaledRefLayerLeftOffset( j, iCode );
     869    READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); pcSPS->setScaledRefLayerTopOffset( j, iCode );
     870    READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode );
     871    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
     872  }
     873#endif 
    805874}
    806875
     
    850919  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
    851920#if H_MV
     921#if H_MV_6_LAYER_ID_32
     922  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) )  );
     923#else
    852924  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( uiCode  );
     925#endif
    853926#else
    854927  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
     
    905978    }
    906979  }
     980#if H_MV_6_HRD_O0217_13
     981  pcVPS->deriveLayerSetLayerIdList();
     982#endif
    907983  TimingInfo *timingInfo = pcVPS->getTimingInfo();
    908984  READ_FLAG(       uiCode, "vps_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
     
    9681044  UInt uiCode;
    9691045  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
     1046#if H_MV_6_PS_O0109_24
     1047  READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );  if ( pcVPS->getVpsVuiPresentFlag() )
     1048  { 
     1049#endif
    9701050  READ_CODE( 16, uiCode, "vps_vui_offset" );                      pcVPS->setVpsVuiOffset( uiCode );
     1051#if H_MV_6_PS_O0109_24
     1052  }
     1053#endif
     1054
    9711055  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
    9721056
     
    10141098  }
    10151099
     1100#if H_MV_6_PS_O0109_22
     1101  READ_CODE( 4, uiCode, "view_id_len" ); pcVPS->setViewIdLen( uiCode );
     1102
     1103  if ( pcVPS->getViewIdLen( ) > 0 )
     1104  {   
     1105    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
     1106    {
     1107      READ_CODE( pcVPS->getViewIdLen( ), uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode );
     1108    }
     1109  }
     1110  else
     1111  {
     1112    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
     1113    {
     1114      pcVPS->setViewIdVal( i, 0 ); 
     1115    }
     1116  }
     1117#else
    10161118  // GT spec says: trac #39
    10171119  // if ( pcVPS->getNumViews() > 1 ) 
     
    10251127    READ_CODE( pcVPS->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode );
    10261128  }
     1129#endif
     1130
    10271131
    10281132  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     
    10331137    }
    10341138  }
    1035 
     1139#if H_MV_6_MISC_O0062_31
     1140  pcVPS->setRefLayers();
     1141#endif
     1142#if H_MV_6_ILDSD_O0120_26
     1143  READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 );
     1144  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     1145  {
     1146    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     1147    {
     1148      READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode );   
     1149      pcVPS->checkSubLayersVpsMaxMinus1( i );
     1150
     1151    }
     1152  } 
     1153  else
     1154  {
     1155    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     1156    {
     1157      pcVPS->setSubLayersVpsMaxMinus1( i, pcVPS->getMaxTLayers( ) - 1);   
     1158    }
     1159  }
     1160#endif
    10361161  READ_FLAG( uiCode, "max_tid_ref_present_flag" ); pcVPS->setMaxTidRefPresentFlag( uiCode == 1 );
    10371162
     
    10401165    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    10411166    {
     1167#if H_MV_6_ILDDS_O0225_30
     1168      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
     1169      {
     1170        if ( pcVPS->getDirectDependencyFlag(j,i) )
     1171        {
     1172          READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1" ); pcVPS->setMaxTidIlRefPicsPlus1( i, j, uiCode );
     1173        }
     1174      }
     1175#else
    10421176      READ_CODE( 3, uiCode,       "max_tid_il_ref_pics_plus1[i]" );      pcVPS->setMaxTidIlRefPicPlus1( i , uiCode );
     1177#endif
    10431178    }
    10441179  }
     
    10541189    {
    10551190      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
     1191#if H_MV_6_PS_O0109_23
     1192      pcVPS->checkProfileRefMinus1( i );     
     1193#endif
    10561194    }
    10571195    parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     
    10761214  if( numOutputLayerSets > 1)
    10771215  {
     1216#if H_MV_6_PS_0109_25
     1217    READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode );
     1218    pcVPS->checkDefaultOneTargetOutputLayerIdc();
     1219#else
    10781220    READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag(  uiCode == 1);
     1221#endif
    10791222  } 
    10801223
     1224#if H_MV_6_HRD_O0217_13
     1225  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
     1226  pcVPS->setOutputLayerSetIdxMinus1(0, -1);
     1227#endif
    10811228  for( Int i = 1; i < numOutputLayerSets; i++ )
    10821229  {
     
    10891236      }       
    10901237    }
     1238#if H_MV_6_HRD_O0217_13
     1239    else
     1240    { // These inference rules would also be helpful in spec text
     1241      pcVPS->setOutputLayerSetIdxMinus1(i, i - 1 );
     1242      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
     1243      {             
     1244        pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j ));
     1245      }
     1246    }
     1247#endif
     1248
    10911249    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    10921250    {     
     
    10941252    }
    10951253  }
    1096 
     1254#if H_MV_6_GEN_0153_28
     1255  if( pcVPS->getMaxLayersMinus1() > 0 )
     1256  {
     1257    READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 );
     1258  }
     1259#endif
     1260#if H_MV_6_HRD_O0217_13
     1261  pcVPS->deriveTargetLayerIdLists();
     1262#endif
    10971263  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    10981264  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    11031269  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    11041270  {
     1271#if H_MV_6_PS_REP_FORM_18_19_20
     1272    assert( pcVPS->getRepFormat(i) == NULL );
     1273    TComRepFormat* curRepFormat = new TComRepFormat();
     1274    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
     1275    parseRepFormat( i, curRepFormat ,  prevRepFormat);
     1276    pcVPS->setRepFormat(i, curRepFormat );
     1277#else
    11051278    assert( pcVPS->getRepFormat(i) == NULL );
    11061279    TComRepFormat* repFormat = new TComRepFormat();
    11071280    parseRepFormat( repFormat );
    11081281    pcVPS->setRepFormat(i, repFormat );
     1282#endif
    11091283  }
    11101284
     
    11151289      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    11161290      {
     1291#if H_MV_6_PS_REP_FORM_18_19_20
     1292        READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     1293#else
    11171294        READ_CODE( 4, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     1295#endif
    11181296      }
    11191297    }
     
    11211299
    11221300  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
     1301#if H_MV_6_MISC_O0062_31
     1302  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1303  {
     1304    if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) )  ==  0 )
     1305    {     
     1306      READ_FLAG( uiCode, "poc_lsb_not_present_flag" ); pcVPS->setPocLsbNotPresentFlag( i, uiCode == 1 );
     1307    }
     1308  }
     1309#endif
     1310
     1311#if H_MV_6_HRD_O0217_13
     1312  parseDpbSize( pcVPS );
     1313#endif
     1314
     1315#if !H_MV_6_PS_O0223_29
    11231316  READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPS->setCrossLayerIrapAlignedFlag( uiCode == 1 );
     1317#endif
    11241318  READ_UVLC( uiCode, "direct_dep_type_len_minus2")    ; pcVPS->setDirectDepTypeLenMinus2   ( uiCode );
    11251319
     1320#if H_MV_6_PS_O0096_21
     1321  READ_FLAG( uiCode, "default_direct_dependency_flag" ); pcVPS->setDefaultDirectDependencyFlag( uiCode == 1 );
     1322  if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1323  { 
     1324    READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "default_direct_dependency_type" ); pcVPS->setDefaultDirectDependencyType( uiCode );
     1325  }
     1326
     1327  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1328  {
     1329    for( Int j = 0; j < i; j++ )
     1330    {
     1331      if (pcVPS->getDirectDependencyFlag( i, j) )
     1332      {       
     1333        if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1334        { 
     1335          pcVPS->setDirectDependencyType( i, j , pcVPS->getDefaultDirectDependencyType( ) );
     1336        }
     1337        else
     1338        {
     1339          READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
     1340        }
     1341      }
     1342    }
     1343  } 
     1344#else
    11261345  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    11271346  {
     
    11341353    }
    11351354  }
     1355#endif
    11361356
    11371357  READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" );
     1358#if !H_MV_6_PS_O0109_24
    11381359  READ_FLAG( uiCode, "vps_vui_present_flag" )       ; pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
     1360#endif
    11391361
    11401362  if( pcVPS->getVpsVuiPresentFlag() )
     
    11451367
    11461368  pcVPS->checkVPSExtensionSyntax();
     1369#if !H_MV_6_MISC_O0062_31
    11471370  pcVPS->setRefLayers();
    1148 }
    1149 
     1371#endif
     1372}
     1373
     1374#if H_MV_6_PS_REP_FORM_18_19_20
     1375Void TDecCavlc::parseRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
     1376#else
    11501377Void TDecCavlc::parseRepFormat( TComRepFormat* pcRepFormat )
     1378#endif
    11511379{
    11521380  assert( pcRepFormat );
    11531381
    11541382  UInt uiCode;
     1383
     1384#if H_MV_6_PS_REP_FORM_18_19_20
     1385  READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" );  pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode );
     1386  READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode );
     1387  READ_FLAG( uiCode, "chroma_and_bit_depth_vps_present_flag" ); pcRepFormat->setChromaAndBitDepthVpsPresentFlag( uiCode == 1 );
     1388
     1389  pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i );
     1390
     1391  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
     1392  { 
     1393#endif
    11551394  READ_CODE( 2,  uiCode, "chroma_format_vps_idc" );          pcRepFormat->setChromaFormatVpsIdc       ( uiCode );
    11561395  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     
    11581397    READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 );
    11591398  }
     1399#if !H_MV_6_PS_REP_FORM_18_19_20
    11601400  READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" );  pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode );
    11611401  READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode );
     1402#endif
    11621403  READ_CODE( 4,  uiCode, "bit_depth_vps_luma_minus8" );      pcRepFormat->setBitDepthVpsLumaMinus8    ( uiCode );
    11631404  READ_CODE( 4,  uiCode, "bit_depth_vps_chroma_minus8" );    pcRepFormat->setBitDepthVpsChromaMinus8  ( uiCode );
     1405#if H_MV_6_PS_REP_FORM_18_19_20
     1406  }
     1407  else
     1408  {
     1409    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false );
     1410  }
     1411#endif
    11641412}
    11651413
     
    11741422
    11751423  UInt uiCode;
     1424#if H_MV_6_PS_O0223_29
     1425  READ_FLAG( uiCode, "cross_layer_pic_type_aligned_flag" ); pcVPSVUI->setCrossLayerPicTypeAlignedFlag( uiCode == 1 );
     1426  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     1427  { 
     1428    READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 );
     1429  }
     1430#endif
    11761431  READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 );
    11771432  READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 );
     
    12041459  }
    12051460
     1461#if H_MV_6_O0226_37
     1462  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
     1463  if( !pcVPSVUI->getTilesNotInUseFlag() )
     1464  {     
     1465    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1466    {
     1467      READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 );
     1468      if( pcVPSVUI->getTilesInUseFlag( i ) ) 
     1469      {
     1470        READ_FLAG( uiCode, "loop_filter_not_across_tiles_flag[i]" ); pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, uiCode == 1 );
     1471      }
     1472    } 
     1473
     1474    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1475    {
     1476      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     1477      { 
     1478        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1479        if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
     1480        {
     1481          READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); pcVPSVUI->setTileBoundariesAlignedFlag( i, j, uiCode == 1 );
     1482        }
     1483      } 
     1484    }
     1485  } 
     1486 
     1487  READ_FLAG( uiCode, "wpp_not_in_use_flag" ); pcVPSVUI->setWppNotInUseFlag( uiCode == 1 );
     1488 
     1489  if( !pcVPSVUI->getWppNotInUseFlag( ))
     1490  {
     1491    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1492    {
     1493      READ_FLAG( uiCode, "wpp_in_use_flag[i]" ); pcVPSVUI->setWppInUseFlag( i, uiCode == 1 );
     1494    }
     1495  }
     1496#else
    12061497  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    12071498  {
     
    12111502    }
    12121503  }
     1504#endif
    12131505
    12141506  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     
    12321524    }
    12331525  }
    1234 }
     1526
     1527#if H_MV_6_PS_O0118_33
     1528  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
     1529  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     1530  {
     1531    READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode );
     1532  }
     1533  else
     1534  {
     1535    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1536  }
     1537
     1538  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
     1539  {
     1540    assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL );
     1541    TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo();     
     1542    parseVideoSignalInfo( curVideoSignalInfo );
     1543    pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo );
     1544  }
     1545 
     1546  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
     1547  {
     1548    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1549    {
     1550      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
     1551      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
     1552    }
     1553  }
     1554  else
     1555  {
     1556    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1557    {
     1558      pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i );
     1559    }
     1560  }
     1561#endif
     1562#if H_MV_6_HRD_O0164_15
     1563  READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 );
     1564  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     1565  {
     1566    parseVpsVuiBspHrdParameters( pcVPS );
     1567}
     1568#endif
     1569}
     1570
     1571#if H_MV_6_HRD_O0164_15
     1572Void TDecCavlc::parseVpsVuiBspHrdParameters( TComVPS* pcVPS )
     1573{
     1574  assert( pcVPS );
     1575
     1576  TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     1577
     1578  assert( pcVPSVUI );
     1579
     1580  TComVpsVuiBspHrdParameters*  vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters();
     1581 
     1582  assert ( vpsVuiBspHrdP );
     1583
     1584  UInt uiCode;
     1585  READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vpsVuiBspHrdP->setVpsNumBspHrdParametersMinus1( uiCode );
     1586  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
     1587  { 
     1588    if( i > 0 )
     1589    {
     1590      READ_FLAG( uiCode, "bsp_cprms_present_flag" ); vpsVuiBspHrdP->setBspCprmsPresentFlag( i, uiCode == 1 );
     1591    }
     1592    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i );
     1593    parseHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() );     
     1594  } 
     1595  for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ )
     1596  { 
     1597    READ_UVLC( uiCode, "num_bitstream_partitions" ); vpsVuiBspHrdP->setNumBitstreamPartitions( h, uiCode );
     1598    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
     1599    {
     1600      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
     1601      {
     1602        if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
     1603        {
     1604          READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
     1605        }
     1606        else
     1607        {
     1608          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
     1609        }
     1610      }
     1611    }
     1612    vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h );
     1613   
     1614    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
     1615    { 
     1616      READ_UVLC( uiCode, "num_bsp_sched_combinations" ); vpsVuiBspHrdP->setNumBspSchedCombinations( h, uiCode );
     1617      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1618      {
     1619        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
     1620        { 
     1621          READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
     1622          READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
     1623        } 
     1624      }
     1625    } 
     1626  } 
     1627
     1628#endif
     1629
     1630#if H_MV_6_PS_O0118_33
     1631Void TDecCavlc::parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
     1632{
     1633  UInt uiCode;
     1634  READ_CODE( 3, uiCode, "video_vps_format" );             pcVideoSignalInfo->setVideoVpsFormat( uiCode );
     1635  READ_FLAG( uiCode, "video_full_range_vps_flag" );       pcVideoSignalInfo->setVideoFullRangeVpsFlag( uiCode == 1 );
     1636  READ_CODE( 8, uiCode, "colour_primaries_vps" );         pcVideoSignalInfo->setColourPrimariesVps( uiCode );
     1637  READ_CODE( 8, uiCode, "transfer_characteristics_vps" ); pcVideoSignalInfo->setTransferCharacteristicsVps( uiCode );
     1638  READ_CODE( 8, uiCode, "matrix_coeffs_vps" );            pcVideoSignalInfo->setMatrixCoeffsVps( uiCode );
     1639}
     1640#endif
     1641
     1642#if H_MV_6_HRD_O0217_13
     1643Void TDecCavlc::parseDpbSize( TComVPS* vps )
     1644{
     1645  UInt uiCode;
     1646  TComDpbSize* dpbSize = vps->getDpbSize();
     1647  assert ( dpbSize != 0 );
     1648
     1649  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
     1650  { 
     1651    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
     1652
     1653    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
     1654    { 
     1655      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     1656      {
     1657        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag" ); dpbSize->setSubLayerDpbInfoPresentFlag( i, j, uiCode == 1 );
     1658      }
     1659      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
     1660      { 
     1661        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1662        {
     1663          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     1664        }
     1665        READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
     1666        READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
     1667      }
     1668      else
     1669      {
     1670        if ( j > 0 )
     1671        {
     1672          for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1673          {
     1674            dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     1675          }
     1676          dpbSize->setMaxVpsNumReorderPics      ( i, j, dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
     1677          dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) );
     1678        }
     1679      }
     1680    } 
     1681  } 
     1682}
     1683#endif
    12351684#endif
    12361685
     
    12801729        if (i!=1)
    12811730        {
    1282           READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2);
     1731          READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]");     pcVPS->setSubPULog2Size(i, uiCode+2);
    12831732        }
    12841733#endif
     
    13571806  sps->inferRepFormat  ( vps , rpcSlice->getLayerId() );
    13581807  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
    1359 
     1808#if H_MV_6_PS_O0118_33
     1809  if ( sps->getVuiParametersPresentFlag() )
     1810  {
     1811    sps->getVuiParameters()->inferVideoSignalInfo( vps, rpcSlice->getLayerId() );
     1812  }
     1813#endif
    13601814  rpcSlice->setVPS(vps);     
    13611815  rpcSlice->setViewId   ( vps->getViewId   ( rpcSlice->getLayerId() )      );
     
    14111865#if H_MV   
    14121866    Int esb = 0; //Don't use i, otherwise will shadow something below
     1867#if !H_MV_6_RALS_O0149_11
    14131868    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    14141869    {
     
    14161871      READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 );
    14171872    }
     1873#endif
    14181874
    14191875    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     
    14221878      READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
    14231879    }
     1880
     1881#if H_MV_6_RALS_O0149_11
     1882    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1883    {
     1884      esb++;
     1885      READ_FLAG( uiCode, "cross_layer_bla_flag" ); rpcSlice->setCrossLayerBlaFlag( uiCode == 1 );
     1886    }
     1887    rpcSlice->checkCrossLayerBlaFlag( );
     1888
     1889    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1890    {
     1891      esb++;
     1892      READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 );
     1893    }
     1894#endif
    14241895
    14251896    for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     
    14451916    //   colour_plane_id                                      u(2)
    14461917
     1918
     1919#if H_MV_6_POC_31_35_38
     1920    UInt slicePicOrderCntLsb = 0;
     1921    Int iPOClsb = slicePicOrderCntLsb;  // Needed later
     1922    if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() )
     1923    {
     1924      READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");       
     1925    }   
     1926
     1927    Bool picOrderCntMSBZeroFlag = false;     
     1928
     1929    // as in HM code. However are all cases for IRAP picture with NoRaslOutputFlag equal to 1 covered??
     1930    picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   );
     1931    picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL );
     1932    picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   );
     1933    picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag ||   rpcSlice->getIdrPicFlag();
     1934
     1935    // TBD picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getLayerId() > 0 &&   !rpcSlice->getFirstPicInLayerDecodedFlag() );
     1936
     1937    Int picOrderCntMSB = 0;
     1938
     1939    if ( !picOrderCntMSBZeroFlag )
     1940    {
     1941      Int prevPicOrderCnt    = rpcSlice->getPrevTid0POC();
     1942      Int maxPicOrderCntLsb  = 1 << sps->getBitsForPOC();
     1943      Int prevPicOrderCntLsb = prevPicOrderCnt & (maxPicOrderCntLsb - 1);
     1944      Int prevPicOrderCntMsb = prevPicOrderCnt - prevPicOrderCntLsb;
     1945           
     1946      if( ( slicePicOrderCntLsb  <  prevPicOrderCntLsb ) && ( ( prevPicOrderCntLsb - slicePicOrderCntLsb )  >=  ( maxPicOrderCntLsb / 2 ) ) )
     1947      {
     1948        picOrderCntMSB = prevPicOrderCntMsb + maxPicOrderCntLsb;
     1949      }
     1950      else if( (slicePicOrderCntLsb  >  prevPicOrderCntLsb )  && ( (slicePicOrderCntLsb - prevPicOrderCntLsb )  >  ( maxPicOrderCntLsb / 2 ) ) )
     1951      {
     1952        picOrderCntMSB = prevPicOrderCntMsb - maxPicOrderCntLsb;
     1953      }
     1954      else
     1955      {
     1956        picOrderCntMSB = prevPicOrderCntMsb;
     1957      }   
     1958    }
     1959     
     1960    rpcSlice->setPOC( picOrderCntMSB + slicePicOrderCntLsb );
     1961    if ( rpcSlice->getPocResetFlag() ) 
     1962    {
     1963      rpcSlice->setPocBeforeReset   ( rpcSlice->getPOC() );
     1964      rpcSlice->setPOC              ( 0 );
     1965    }     
     1966#endif
     1967
    14471968    if( rpcSlice->getIdrPicFlag() )
    14481969    {
     1970#if !H_MV_6_POC_31_35_38
    14491971      rpcSlice->setPOC(0);
     1972#endif
    14501973      TComReferencePictureSet* rps = rpcSlice->getLocalRPS();
    14511974      rps->setNumberOfNegativePictures(0);
     
    14601983    else
    14611984    {
     1985#if !H_MV_6_POC_31_35_38
    14621986      READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 
    14631987      Int iPOClsb = uiCode;
     
    14942018
    14952019      }     
     2020#endif
    14962021#endif
    14972022      TComReferencePictureSet* rps;
     
    16282153    }
    16292154#if H_MV
     2155#if H_MV_6_ILDDS_ILREFPICS_27_34
     2156    Bool interLayerPredLayerIdcPresentFlag = false;
     2157#endif
    16302158    Int layerId       = rpcSlice->getLayerId();
    1631     if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )    {   
     2159    if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     2160    {   
    16322161      READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 );
    16332162      if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 )
     
    16392168        if ( rpcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    16402169        {
     2170#if H_MV_6_ILDDS_ILREFPICS_27_34
     2171          interLayerPredLayerIdcPresentFlag = true;
     2172#endif
    16412173          for( Int idx = 0; idx < rpcSlice->getNumActiveRefLayerPics(); idx++ )   
    16422174          {
     
    16462178      } 
    16472179    }
     2180#if H_MV_6_ILDDS_ILREFPICS_27_34
     2181    if ( !interLayerPredLayerIdcPresentFlag )
     2182    {
     2183      for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ )   
     2184      {
     2185        rpcSlice->setInterLayerPredLayerIdc( i, rpcSlice->getRefLayerPicIdc( i ) );
     2186      }
     2187    }
     2188#endif
    16482189#endif
    16492190    if(sps->getUseSAO())
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r655 r738  
    7878#if H_MV
    7979  Void  parseVPSExtension   ( TComVPS* pcVPS );
     80#if H_MV_6_PS_REP_FORM_18_19_20
     81  Void  parseRepFormat      ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
     82#else
    8083  Void  parseRepFormat      ( TComRepFormat* pcRepFormat );
     84#endif
    8185  Void  parseVPSVUI         ( TComVPS* pcVPS );
     86#if H_MV_6_PS_O0118_33
     87  Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo );
     88#endif
     89#if H_MV_6_HRD_O0217_13
     90  Void  parseDpbSize        ( TComVPS* pcVPS );
     91#endif
     92#if H_MV_6_HRD_O0164_15
     93  Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS );
     94#endif
    8295#endif
    8396
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r724 r738  
    635635#if H_MV
    636636  m_apcSlicePilot->setVPS(vps); 
     637#if H_MV_6_PS_0092_17
     638  // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
     639  assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) );   
     640  // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
     641  assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) );
     642#endif
    637643  sps->inferRepFormat  ( vps , m_layerId );
    638644  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
     
    665671
    666672#if H_MV
     673#if H_MV_FIX_SKIP_PICTURES
     674Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag  )
     675#else
    667676Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag )
     677#endif
    668678{
    669679  assert( nalu.m_layerId == m_layerId );
     
    722732#endif
    723733#endif
     734
     735#if H_MV_LAYER_WISE_STARTUP
     736    xCeckNoClrasOutput();
     737#endif
    724738    // Skip pictures due to random access
    725739    if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
     
    727741    m_prevSliceSkipped = true;
    728742    m_skippedPOC = m_apcSlicePilot->getPOC();
     743#if H_MV_FIX_SKIP_PICTURES
     744      sliceSkippedFlag = true;
     745#endif
    729746      return false;
    730747    }
     
    734751    m_prevSliceSkipped = true;
    735752    m_skippedPOC = m_apcSlicePilot->getPOC();
     753#if H_MV_FIX_SKIP_PICTURES
     754      sliceSkippedFlag = true;
     755#endif
    736756      return false;
    737757    }
     
    11711191
    11721192#if H_MV
     1193#if H_MV_FIX_SKIP_PICTURES
     1194Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag )
     1195#else
    11731196Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag)
     1197#endif
    11741198#else
    11751199Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay)
     
    12161240    case NAL_UNIT_CODED_SLICE_RASL_R:
    12171241#if H_MV
     1242#if H_MV_FIX_SKIP_PICTURES
     1243      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
     1244#else
    12181245      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag);
     1246#endif
    12191247#else
    12201248      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
     
    12651293    return true;
    12661294  }
     1295#if H_MV_LAYER_WISE_STARTUP
     1296  else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet.
     1297#else
    12671298  else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet.
     1299#endif
    12681300  {
    12691301    if (   m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA
     
    12721304        || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL )
    12731305    {
     1306
     1307#if H_MV_LAYER_WISE_STARTUP
     1308      if ( xAllRefLayersInitilized() )
     1309      {
     1310        m_layerInitilizedFlag[ m_layerId ] = true;
     1311        m_pocRandomAccess = m_apcSlicePilot->getPOC();
     1312      }
     1313      else
     1314      {
     1315        return true;
     1316      }
     1317#else
    12741318      // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT.
    12751319      m_pocRandomAccess = m_apcSlicePilot->getPOC();
     1320#endif
    12761321    }
    12771322    else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    12781323    {
     1324#if H_MV_LAYER_WISE_STARTUP
     1325      if ( xAllRefLayersInitilized() )
     1326      {
     1327        m_layerInitilizedFlag[ m_layerId ] = true;
    12791328      m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
    12801329    }
    12811330    else
    12821331    {
     1332        return true;
     1333      }
     1334#else
     1335      m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
     1336#endif
     1337    }
     1338    else
     1339    {
     1340#if H_MV_FIX_SKIP_PICTURES
     1341      static Bool warningMessage[MAX_NUM_LAYERS];
     1342      static Bool warningInitFlag = false;
     1343     
     1344      if (!warningInitFlag)
     1345      {
     1346        for ( Int i = 0; i < MAX_NUM_LAYERS; i++)
     1347        {
     1348          warningMessage[i] = true;
     1349        }
     1350        warningInitFlag = true;
     1351      }
     1352
     1353      if ( warningMessage[getLayerId()] )
     1354      {
     1355        printf("\nLayer%3d   No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() );
     1356        warningMessage[m_layerId] = false;
     1357      }
     1358#else
    12831359      static Bool warningMessage = false;
    12841360      if(!warningMessage)
     
    12871363        warningMessage = true;
    12881364      }
     1365#endif
    12891366      return true;
    12901367    }
     
    12961373    return true;
    12971374  }
     1375#if H_MV_LAYER_WISE_STARTUP
     1376  return !m_layerInitilizedFlag[ getLayerId() ];
     1377#else
    12981378  // if we reach here, then the picture is not skipped.
    12991379  return false;
     1380#endif
    13001381}
    13011382
     
    13381419  }
    13391420}
     1421
     1422#if H_MV_LAYER_WISE_STARTUP
     1423Void TDecTop::xCeckNoClrasOutput()
     1424{
     1425  // This part needs further testing!
     1426  if ( getLayerId() == 0 )
     1427  {   
     1428    NalUnitType nut = m_apcSlicePilot->getNalUnitType();
     1429
     1430    Bool isBLA =  ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP  )  || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL );
     1431    Bool isIDR  = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP );
     1432    Bool noClrasOutputFlag  = isBLA || ( isIDR  &&  m_apcSlicePilot->getCrossLayerBlaFlag() );
     1433
     1434    if ( noClrasOutputFlag )
     1435    {
     1436      for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++)
     1437      {
     1438        m_layerInitilizedFlag[i] = false;
     1439      }
     1440    }
     1441  }
     1442}
     1443
     1444Bool TDecTop::xAllRefLayersInitilized()
     1445{
     1446  Bool allRefLayersInitilizedFlag = true;
     1447  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
     1448  for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId()  ); i++ )
     1449  {
     1450    Int refLayerId = vps->getRefLayerId( m_layerId, i );
     1451    allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ];
     1452  }
     1453
     1454  return allRefLayersInitilizedFlag;
     1455}
     1456#endif
    13401457#endif
    13411458//! \}
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r724 r738  
    186186  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    187187#if H_MV
     188#if H_MV_LAYER_WISE_STARTUP
     189  Bool*                    m_layerInitilizedFlag; // initialization Layers
     190#endif
    188191  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    189192#else
     
    243246  Void  init();
    244247#if H_MV 
     248#if H_MV_FIX_SKIP_PICTURES
     249  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag );
     250#else
     251  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
     252#endif
    245253  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
    246254#else 
     
    260268  TComList<TComPic*>*     getListPic            ()               { return &m_cListPic;  } 
    261269  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    262  
     270#if H_MV_LAYER_WISE_STARTUP
     271  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
     272#endif
     273#if H_MV_6_HRD_O0217_13
     274  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
     275#endif
    263276  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
    264277  Void                    setLayerId            ( Int layer)     { m_layerId = layer;   }
     
    281294#if H_MV 
    282295  TComPic*  xGetPic( Int layerId, Int poc );
     296#if H_MV_FIX_SKIP_PICTURES
     297  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 
     298#else
    283299  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 
     300#endif
    284301  Void      xResetPocInPicBuffer();
     302#if H_MV_LAYER_WISE_STARTUP
     303  Void      xCeckNoClrasOutput();
     304
     305  Bool      xAllRefLayersInitilized();
     306#endif
    285307#else
    286308  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.