Changeset 1062 in 3DVCSoftware


Ignore:
Timestamp:
7 Oct 2014, 20:41:24 (9 years ago)
Author:
tech
Message:

Integrated Fix PTL inference.

Location:
branches/HTM-12.0-dev1/source/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp

    r1060 r1062  
    44394439
    44404440#if H_MV
     4441#if !H_MV_HLS10_PTL_INFER_FIX
    44414442Void TComPTL::copyLevelFrom( TComPTL* source )
    44424443{
     
    44484449  }
    44494450}
     4451#endif
    44504452#endif
    44514453//! \}
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h

    r1060 r1062  
    208208 
    209209#if H_MV_HLS10_PTL
     210#if H_MV
    210211  Bool m_max12bitConstraintFlag;
    211212  Bool m_max10bitConstraintFlag;
     
    219220  Bool m_inbldFlag;
    220221#endif
     222#endif
    221223public:
    222224  ProfileTierLevel();
     
    249251  Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; }
    250252
     253#if H_MV
    251254#if H_MV_HLS10_PTL
    252255  Void setMax12bitConstraintFlag( Bool flag ) { m_max12bitConstraintFlag = flag; }
     
    278281  Void setInbldFlag( Bool flag ) { m_inbldFlag = flag; }
    279282  Bool getInbldFlag(  ) { return m_inbldFlag; }
     283#endif
     284#if H_MV_HLS10_PTL_INFER_FIX
     285
     286  Bool getV2ConstraintsPresentFlag()
     287  {
     288  return (
     289    getProfileIdc( ) ==  4 || getProfileCompatibilityFlag( 4 ) || getProfileIdc( ) ==  5 || getProfileCompatibilityFlag( 5 )  ||
     290    getProfileIdc( ) ==  6 || getProfileCompatibilityFlag( 6 ) || getProfileIdc( ) ==  7 || getProfileCompatibilityFlag( 7 )
     291    );
     292  }
     293 
     294  Bool getInbldPresentFlag()
     295  {
     296    return (
     297      ( getProfileIdc() >= 1 && getProfileIdc() <= 5 )  || getProfileCompatibilityFlag( 1 ) || getProfileCompatibilityFlag( 2 ) ||
     298      getProfileCompatibilityFlag( 3 ) || getProfileCompatibilityFlag( 4 )  ||   getProfileCompatibilityFlag( 5 )
     299      );
     300  }
     301
     302  Void copyV2ConstraintFlags( ProfileTierLevel* ptlRef )
     303  {
     304    setMax12bitConstraintFlag         ( ptlRef->getMax12bitConstraintFlag       ( ) );
     305    setMax10bitConstraintFlag         ( ptlRef->getMax10bitConstraintFlag       ( ) );
     306    setMax8bitConstraintFlag          ( ptlRef->getMax8bitConstraintFlag        ( ) );
     307    setMax422chromaConstraintFlag     ( ptlRef->getMax422chromaConstraintFlag   ( ) );
     308    setMax420chromaConstraintFlag     ( ptlRef->getMax420chromaConstraintFlag   ( ) );
     309    setMaxMonochromeConstraintFlag    ( ptlRef->getMaxMonochromeConstraintFlag  ( ) );
     310    setIntraConstraintFlag            ( ptlRef->getIntraConstraintFlag          ( ) );
     311    setOnePictureOnlyConstraintFlag   ( ptlRef->getOnePictureOnlyConstraintFlag ( ) );
     312    setLowerBitRateConstraintFlag     ( ptlRef->getLowerBitRateConstraintFlag   ( ) );   
     313  }
     314
     315  Void copyProfile( ProfileTierLevel* ptlRef )
     316  {
     317      setProfileSpace            ( ptlRef->getProfileSpace              ( ) );
     318      setTierFlag                ( ptlRef->getTierFlag                  ( ) );
     319      setProfileIdc              ( ptlRef->getProfileIdc                ( ) );
     320      for (Int j = 0; j < 32; j++)
     321      {     
     322        setProfileCompatibilityFlag(j, ptlRef->getProfileCompatibilityFlag  ( j ) );           
     323      }
     324      setProgressiveSourceFlag   ( ptlRef->getProgressiveSourceFlag     ( ) );
     325      setInterlacedSourceFlag    ( ptlRef->getInterlacedSourceFlag      ( ) );
     326      setNonPackedConstraintFlag ( ptlRef->getNonPackedConstraintFlag   ( ) );
     327      setFrameOnlyConstraintFlag ( ptlRef->getFrameOnlyConstraintFlag   ( ) );
     328      copyV2ConstraintFlags      ( ptlRef );
     329  }
     330#endif
    280331#endif
    281332
     
    301352  ProfileTierLevel* getSubLayerPTL(Int i)  { return &m_subLayerPTL[i]; }
    302353#if H_MV
     354#if H_MV_HLS10_PTL_INFER_FIX
     355  Void inferGeneralValues( Bool profilePresentFlag, Int k, TComPTL* refPTL )
     356  {
     357    ProfileTierLevel* refProfileTierLevel = NULL;
     358    if ( k > 0 )
     359    {   
     360      assert( refPTL != NULL);
     361      refProfileTierLevel = refPTL->getGeneralPTL();
     362    }
     363
     364    ProfileTierLevel* curProfileTierLevel = getGeneralPTL( );
     365
     366    if( !profilePresentFlag )
     367    {
     368      assert( k > 0 );
     369      assert( refProfileTierLevel != NULL );
     370      curProfileTierLevel->copyProfile( refProfileTierLevel);
     371    }
     372    else
     373    {
     374      if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() )
     375      {
     376        curProfileTierLevel->setMax12bitConstraintFlag         ( false );
     377        curProfileTierLevel->setMax10bitConstraintFlag         ( false );
     378        curProfileTierLevel->setMax8bitConstraintFlag          ( false );
     379        curProfileTierLevel->setMax422chromaConstraintFlag     ( false );
     380        curProfileTierLevel->setMax420chromaConstraintFlag     ( false );
     381        curProfileTierLevel->setMaxMonochromeConstraintFlag    ( false );
     382        curProfileTierLevel->setIntraConstraintFlag            ( false );
     383        curProfileTierLevel->setOnePictureOnlyConstraintFlag   ( false );
     384        curProfileTierLevel->setLowerBitRateConstraintFlag     ( false );   
     385      }
     386
     387      if ( !curProfileTierLevel->getInbldPresentFlag() )
     388      {
     389        curProfileTierLevel->setInbldFlag( false );
     390      }     
     391    }         
     392  };
     393
     394  Void inferSubLayerValues( Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL )
     395  {
     396    assert( k == 0 || refPTL != NULL );
     397
     398    for (Int i = maxNumSubLayersMinus1; i >= 0; i--)
     399    {
     400      ProfileTierLevel* refProfileTierLevel;
     401      if ( k != 0 )
     402      {
     403        refProfileTierLevel = refPTL->getSubLayerPTL( i );
     404      }
     405      else
     406      {
     407        if ( i == maxNumSubLayersMinus1)     
     408        {
     409          refProfileTierLevel = getGeneralPTL();
     410        }
     411        else
     412        {
     413          refProfileTierLevel = getSubLayerPTL( i + 1 );
     414        }
     415      }   
     416
     417      ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i );
     418      if( !getSubLayerLevelPresentFlag( i ) )
     419      {
     420        curProfileTierLevel->setLevelIdc( refProfileTierLevel->getLevelIdc() );
     421      }
     422
     423      if( !getSubLayerProfilePresentFlag( i ) )
     424      {
     425        curProfileTierLevel->copyProfile( refProfileTierLevel);
     426      }
     427      else
     428      {
     429        if ( !curProfileTierLevel->getV2ConstraintsPresentFlag() )
     430        {
     431          curProfileTierLevel->copyV2ConstraintFlags( refProfileTierLevel );
     432        }
     433
     434        if ( !curProfileTierLevel->getInbldPresentFlag() )
     435        {
     436          curProfileTierLevel->setInbldFlag( refProfileTierLevel->getInbldFlag() );
     437        }     
     438      }     
     439    }
     440  };
     441#else
    303442  Void copyLevelFrom( TComPTL* source );
     443#endif
    304444#endif
    305445};
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h

    r1060 r1062  
    414414#define H_MV_HLS10_MAXNUMPICS                1  // constraint on number of pictures in rps 
    415415#define H_MV_HLS10_PTL                       1  // profile tier level
    416 #define H_MV_HLS10_PTL_FIX                   1  // profile tier level
     416#define H_MV_HLS10_PTL_FIX                   1  // profile tier level fix
     417#define H_MV_HLS10_PTL_INFER_FIX             1  // fix inference ptl
    417418#define H_MV_HLS10_MULTILAYERSPS             1  // multilayer SPS extension
    418419#define H_MV_HLS10_VPS_VUI                   1  // vsp vui
  • branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1060 r1062  
    803803
    804804    parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     805#if H_MV_HLS10_PTL_INFER_FIX
     806    pcSPS->getPTL()->inferGeneralValues ( true, 0, NULL );
     807    pcSPS->getPTL()->inferSubLayerValues( pcSPS->getMaxTLayers() - 1, 0, NULL );
     808#endif
    805809#if H_MV
    806810  }
     
    11461150  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
    11471151  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
     1152#if H_MV_HLS10_PTL_INFER_FIX
     1153#if H_MV
     1154  pcVPS->getPTL()->inferGeneralValues ( true, 0, NULL );
     1155  pcVPS->getPTL()->inferSubLayerValues( pcVPS->getMaxTLayers() - 1, 0, NULL );
     1156#endif
     1157#endif
    11481158  UInt subLayerOrderingInfoPresentFlag;
    11491159  READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
     
    12691279    parsePTL( pcVPS->getPTL( 1 ),0, pcVPS->getMaxSubLayersMinus1()  ); 
    12701280   
     1281#if !H_MV_HLS10_PTL_INFER_FIX
    12711282    // Copy Profile info
    12721283    TComPTL temp = *pcVPS->getPTL( 1 );
    12731284    *pcVPS->getPTL( 1 ) = *pcVPS->getPTL( 0 );
    12741285    pcVPS->getPTL( 1 )->copyLevelFrom( &temp );
     1286#else
     1287    pcVPS->getPTL( 1 )->inferGeneralValues ( false, 1, pcVPS->getPTL( 0 ) );
     1288    pcVPS->getPTL( 1 )->inferSubLayerValues( pcVPS->getMaxSubLayersMinus1(), 1, pcVPS->getPTL( 0 ) );   
     1289#endif
    12751290  }
    12761291#endif
     
    14041419    READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
    14051420    parsePTL ( pcVPS->getPTL( offsetVal ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     1421#if H_MV_HLS10_PTL_INFER_FIX
     1422    pcVPS->getPTL( offsetVal )->inferGeneralValues ( pcVPS->getVpsProfilePresentFlag( i ), offsetVal, pcVPS->getPTL( offsetVal - 1 ) );   
     1423    pcVPS->getPTL( offsetVal )->inferSubLayerValues( pcVPS->getMaxSubLayersMinus1()      , offsetVal, pcVPS->getPTL( offsetVal - 1 ) );   
     1424#else
    14061425    if( !pcVPS->getVpsProfilePresentFlag( i ) )
    14071426    {
     
    14101429      pcVPS->getPTL( offsetVal )->copyLevelFrom( &temp );
    14111430    }
     1431#endif
    14121432    offsetVal++;
    14131433  }
     
    31663186      READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);
    31673187#if H_MV
    3168     rpcPTL->setSubLayerProfilePresentFlag( i, profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) );
     3188#if !H_MV_HLS10_PTL_INFER_FIX
     3189      rpcPTL->setSubLayerProfilePresentFlag( i, profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) );
     3190#else
     3191      // When profilePresentFlag is equal to 0, sub_layer_profile_present_flag[ i ] shall be equal to 0.
     3192      assert( profilePresentFlag || !rpcPTL->getSubLayerProfilePresentFlag(i) );
     3193#endif
    31693194#else
    31703195    }
     
    31843209  for(Int i = 0; i < maxNumSubLayersMinus1; i++)
    31853210  {
    3186     if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )
     3211#if H_MV_HLS10_PTL_INFER_FIX
     3212#if H_MV
     3213    if( rpcPTL->getSubLayerProfilePresentFlag(i) )         
     3214#else
     3215    if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )         
     3216#endif
     3217#else
     3218    if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )   
     3219#endif
    31873220    {
    31883221      parseProfileTier(rpcPTL->getSubLayerPTL(i));
     
    32183251 
    32193252#if H_MV_HLS10_PTL
     3253#if H_MV_HLS10_PTL_INFER_FIX
     3254  if( ptl->getV2ConstraintsPresentFlag() )
     3255#else
    32203256  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
    32213257      ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
    32223258      ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
    32233259      ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) )
    3224   {
    3225     READ_FLAG( uiCode, "max_12bit_constraint_flag" ); ptl->setMax12bitConstraintFlag( uiCode == 1 );
    3226     READ_FLAG( uiCode, "max_10bit_constraint_flag" ); ptl->setMax10bitConstraintFlag( uiCode == 1 );
    3227     READ_FLAG( uiCode, "max_8bit_constraint_flag" ); ptl->setMax8bitConstraintFlag( uiCode == 1 );
    3228     READ_FLAG( uiCode, "max_422chroma_constraint_flag" ); ptl->setMax422chromaConstraintFlag( uiCode == 1 );
    3229     READ_FLAG( uiCode, "max_420chroma_constraint_flag" ); ptl->setMax420chromaConstraintFlag( uiCode == 1 );
    3230     READ_FLAG( uiCode, "max_monochrome_constraint_flag" ); ptl->setMaxMonochromeConstraintFlag( uiCode == 1 );
    3231     READ_FLAG( uiCode, "intra_constraint_flag" ); ptl->setIntraConstraintFlag( uiCode == 1 );
     3260#endif
     3261  {
     3262    READ_FLAG( uiCode, "max_12bit_constraint_flag" );        ptl->setMax12bitConstraintFlag      ( uiCode == 1 );
     3263    READ_FLAG( uiCode, "max_10bit_constraint_flag" );        ptl->setMax10bitConstraintFlag      ( uiCode == 1 );
     3264    READ_FLAG( uiCode, "max_8bit_constraint_flag" );         ptl->setMax8bitConstraintFlag       ( uiCode == 1 );
     3265    READ_FLAG( uiCode, "max_422chroma_constraint_flag" );    ptl->setMax422chromaConstraintFlag  ( uiCode == 1 );
     3266    READ_FLAG( uiCode, "max_420chroma_constraint_flag" );    ptl->setMax420chromaConstraintFlag  ( uiCode == 1 );
     3267    READ_FLAG( uiCode, "max_monochrome_constraint_flag" );   ptl->setMaxMonochromeConstraintFlag ( uiCode == 1 );
     3268    READ_FLAG( uiCode, "intra_constraint_flag" );            ptl->setIntraConstraintFlag         ( uiCode == 1 );
    32323269    READ_FLAG( uiCode, "one_picture_only_constraint_flag" ); ptl->setOnePictureOnlyConstraintFlag( uiCode == 1 );
    3233     READ_FLAG( uiCode, "lower_bit_rate_constraint_flag" ); ptl->setLowerBitRateConstraintFlag( uiCode == 1 );   
     3270    READ_FLAG( uiCode, "lower_bit_rate_constraint_flag" );   ptl->setLowerBitRateConstraintFlag  ( uiCode == 1 );   
    32343271    READ_CODE(16, uiCode, "XXX_reserved_zero_34bits[0..15]");
    32353272    READ_CODE(16, uiCode, "XXX_reserved_zero_34bits[16..31]");
     
    32423279    READ_CODE(11, uiCode, "XXX_reserved_zero_43bits[32..42]");
    32433280  }
     3281#if H_MV_HLS10_PTL_INFER_FIX
     3282  if( ptl->getInbldPresentFlag() )
     3283#else
    32443284  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
    32453285    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
    32463286    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
    32473287    ptl->getProfileCompatibilityFlag( 5 ) )
     3288#endif
    32483289  {
    32493290    READ_FLAG( uiCode, "inbld_flag" ); ptl->setInbldFlag( uiCode == 1 );
  • branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1060 r1062  
    25592559 
    25602560#if H_MV_HLS10_PTL
     2561#if H_MV_HLS10_PTL_INFER_FIX
     2562  if( ptl->getV2ConstraintsPresentFlag() )
     2563#else
    25612564  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
    25622565    ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
    25632566    ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
    25642567    ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) )
     2568#endif
    25652569  {
    25662570    WRITE_FLAG( ptl->getMax12bitConstraintFlag( ) ? 1 : 0 , "max_12bit_constraint_flag" );
     
    25832587    WRITE_CODE( 0, 11, "XXX_reserved_zero_43bits[32..42]");
    25842588  }
     2589#if H_MV_HLS10_PTL_INFER_FIX
     2590    if( ptl->getInbldPresentFlag() )
     2591#else
    25852592  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
    25862593    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
    25872594    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
    25882595    ptl->getProfileCompatibilityFlag( 5 ) )
     2596#endif
    25892597  {
    25902598    WRITE_FLAG( ptl->getInbldFlag( ) ? 1 : 0 , "inbld_flag" );
Note: See TracChangeset for help on using the changeset viewer.