Changeset 498 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0/source
- Timestamp:
- 26 Jun 2013, 23:47:59 (12 years ago)
- Location:
- branches/HTM-DEV-0.3-dev0/source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r495 r498 1088 1088 { 1089 1089 // Layer sets 1090 vps.setVpsNumLayerSetsMinus1 ( m_vpsNumLayerSets );1091 vps.setVpsNumberLayerSetsMinus1( m_vpsNumLayerSets);1090 vps.setVpsNumLayerSetsMinus1 ( m_vpsNumLayerSets - 1 ); 1091 vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() ); 1092 1092 1093 1093 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h
r496 r498 162 162 163 163 #ifndef ENC_DEC_TRACE 164 # define ENC_DEC_TRACE 0164 # define ENC_DEC_TRACE 1 165 165 #endif 166 166 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp
r497 r498 1007 1007 m_enableTMVPFlag = pSrc->m_enableTMVPFlag; 1008 1008 m_maxNumMergeCand = pSrc->m_maxNumMergeCand; 1009 1010 #if H_MV 1011 // Additional slice header syntax elements 1012 m_discardableFlag = pSrc->m_discardableFlag; 1013 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1014 m_numInterLayerRefPicsMinus1 = pSrc->m_numInterLayerRefPicsMinus1; 1015 1016 for (Int layer = 0; layer < MAX_NUM_LAYERS; layer++ ) 1017 { 1018 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 1019 } 1020 1021 m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag; 1022 m_altCollocatedIndicationFlag = pSrc->m_altCollocatedIndicationFlag ; 1023 m_collocatedRefLayerIdx = pSrc->m_collocatedRefLayerIdx ; 1024 m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers; 1025 1026 for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++) 1027 { 1028 m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer]; 1029 } 1030 #endif 1009 1031 } 1010 1032 … … 1577 1599 Bool TComVPS::checkVPSExtensionSyntax() 1578 1600 { 1579 // check splitting flag constraint1580 if ( getSplittingFlag() )1581 {1582 // Derive dimBitOffset[j]1583 Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1];1584 Int numScalabilityTypes = getNumScalabilityTypes();1585 dimBitOffset[0] = 0;1586 1587 for (Int type = 1; type <= numScalabilityTypes; type++ )1588 {1589 dimBitOffset[ type ] = 0;1590 for (Int dimIdx = 0; dimIdx <= type - 1; dimIdx++)1591 dimBitOffset[ type ] += ( getDimensionIdLen( dimIdx ) );1592 }1593 1594 for (Int type = 0; type < getNumScalabilityTypes(); type++ )1595 {1596 for( Int layer = 1; layer < getMaxLayers(); layer++ )1597 {1598 assert( getDimensionId( layer, type ) == ( ( getLayerIdInNuh( layer ) & ( (1 << dimBitOffset[ type + 1 ] ) - 1) ) >> dimBitOffset[ type ] ) );1599 };1600 };1601 }1602 1603 1601 for( Int layer = 1; layer < getMaxLayers(); layer++ ) 1604 1602 { … … 1627 1625 return scalIdx; 1628 1626 } 1629 1630 1631 1627 1632 1628 Void TComVPS::setScalabilityMask( UInt val ) … … 1754 1750 } 1755 1751 1752 1753 Int TComVPS::xGetDimBitOffset( Int j ) 1754 { 1755 Int dimBitOffset = 0; 1756 if ( getSplittingFlag() && j == getNumScalabilityTypes() ) 1757 { 1758 dimBitOffset = 6; 1759 } 1760 else 1761 { 1762 for (Int dimIdx = 0; dimIdx <= j-1; dimIdx++) 1763 { 1764 dimBitOffset += getDimensionIdLen( dimIdx ); 1765 } 1766 } 1767 return dimBitOffset; 1768 } 1769 1770 Int TComVPS::inferDimensionId( Int i, Int j ) 1771 { 1772 return ( ( getLayerIdInNuh( i ) & ( (1 << xGetDimBitOffset( j + 1 ) ) - 1) ) >> xGetDimBitOffset( j ) ); 1773 } 1774 1775 Int TComVPS::inferLastDimsionIdLen() 1776 { 1777 return ( 5 - xGetDimBitOffset( getNumScalabilityTypes() - 1 ) ); 1778 } 1779 1780 Int TComVPS::getNumLayersInIdList( Int lsIdx ) 1781 { 1782 assert( lsIdx >= 0 ); 1783 assert( lsIdx <= getVpsNumLayerSetsMinus1() ); 1784 Int numLayersInIdList = 0; 1785 for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ ) 1786 { 1787 numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) ); 1788 } 1789 return numLayersInIdList; 1790 } 1756 1791 #endif // H_MV 1757 1792 … … 2436 2471 } 2437 2472 2473 Int TComSlice::getNumActiveRefLayerPics() 2474 { 2475 Int numActiveRefLayerPics; 2476 2477 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() ) 2478 { 2479 numActiveRefLayerPics = 0; 2480 } 2481 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 ) 2482 { 2483 numActiveRefLayerPics = 1; 2484 } 2485 else 2486 { 2487 numActiveRefLayerPics = getNumInterLayerRefPicsMinus1() + 1; 2488 } 2489 return numActiveRefLayerPics; 2490 } 2491 2492 Int TComSlice::getRefPicLayerId( Int i ) 2493 { 2494 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 2495 } 2496 2497 Void TComSlice::setActiveMotionPredRefLayers() 2498 { 2499 Int j = 0; 2500 for( Int i = 0; i < getNumActiveRefLayerPics(); i++) 2501 { 2502 if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i )) ) 2503 { 2504 m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 2505 } 2506 } 2507 m_numActiveMotionPredRefLayers = j; 2508 2509 // Consider incorporating bitstream conformance tests on derived variables here. 2510 } 2511 2512 Bool TComSlice::getInterRefEnabledInRPLFlag() 2513 { 2514 Bool interRefEnabledInRPLFlag; 2515 if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 ) 2516 { 2517 interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 2518 } 2519 else 2520 { 2521 interRefEnabledInRPLFlag = 1; 2522 } 2523 return interRefEnabledInRPLFlag; 2524 } 2438 2525 #endif 2439 2526 /** get scaling matrix from RefMatrixID -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h
r497 r498 561 561 #endif 562 562 563 Int xCeilLog2( Int val ); 563 Int xCeilLog2 ( Int val ); 564 Int xGetDimBitOffset( Int j ); 564 565 565 566 … … 730 731 Int scalTypeToScalIdx ( ScalabilityType scalType ); 731 732 732 733 733 Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 734 Int getNumLayersInIdList ( Int lsIdx ) 735 { 736 assert( lsIdx >= 0 ); 737 assert( lsIdx <= getVpsNumLayerSetsMinus1() ); 738 Int numLayersInIdList = 0; 739 for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ ) 740 { 741 numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) ); 742 } 743 return numLayersInIdList; 744 }; 734 Int getNumLayersInIdList ( Int lsIdx );; 735 736 // inference 737 Int inferDimensionId ( Int i, Int j ); 738 Int inferLastDimsionIdLen(); 739 745 740 #if H_3D 746 741 Void initViewIndex(); 747 742 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } 748 743 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 749 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 744 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 750 745 #endif 751 746 #endif … … 1911 1906 1912 1907 // Additional variables derived in slice header semantics 1913 1914 1908 Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } 1915 1909 Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } 1916 1910 1917 Int getNumActiveRefLayerPics( ) 1918 { 1919 Int numActiveRefLayerPics; 1920 1921 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() ) 1922 { 1923 numActiveRefLayerPics = 0; 1924 } 1925 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 ) 1926 { 1927 numActiveRefLayerPics = 1; 1928 } 1929 else 1930 { 1931 numActiveRefLayerPics = getNumInterLayerRefPicsMinus1() + 1; 1932 } 1933 return numActiveRefLayerPics; 1934 } 1935 1936 Int getRefPicLayerId( Int i ) 1937 { 1938 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 1939 } 1940 1941 Void setActiveMotionPredRefLayers( ) 1942 { 1943 Int j = 0; 1944 for( Int i = 0; i < getNumActiveRefLayerPics(); i++) 1945 { 1946 if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i )) ) 1947 { 1948 m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 1949 } 1950 } 1951 m_numActiveMotionPredRefLayers = j; 1952 1953 // Consider incorporating bitstream conformance tests on derived variables here. 1954 } 1955 1956 Int getActiveMotionPredRefLayerId( Int i ) { return m_activeMotionPredRefLayerId[i]; } 1957 Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; } 1958 1959 Bool getInterRefEnabledInRPLFlag( ) 1960 { 1961 Bool interRefEnabledInRPLFlag; 1962 if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 ) 1963 { 1964 interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 1965 } 1966 else 1967 { 1968 interRefEnabledInRPLFlag = 1; 1969 } 1970 return interRefEnabledInRPLFlag; 1971 } 1972 1973 Void setRefPicSetInterLayer( std::vector<TComPic*>* m_refPicSetInterLayer ); 1974 1911 Int getNumActiveRefLayerPics( ); 1912 Int getRefPicLayerId ( Int i ); 1913 1914 Void setActiveMotionPredRefLayers ( ); 1915 1916 Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; } 1917 Int getActiveMotionPredRefLayerId ( Int i ) { return m_activeMotionPredRefLayerId[i]; } 1918 1919 Bool getInterRefEnabledInRPLFlag( ); 1920 1921 Void setRefPicSetInterLayer ( std::vector<TComPic*>* m_refPicSetInterLayer ); 1975 1922 TComPic* getPicFromRefPicSetInterLayer( Int layerId ); 1976 1923 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r495 r498 912 912 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ ) 913 913 { 914 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 ); 915 } 916 914 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 ); 915 } 916 917 if ( pcVPS->getSplittingFlag() ) 918 { 919 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLen() ); 920 } 921 917 922 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false ); 918 923 919 924 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ ) 920 925 { 921 922 926 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) ) 923 927 { … … 928 932 pcVPS->setLayerIdInNuh( i, i );; 929 933 } 930 934 931 935 pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i ); 932 936 933 if ( !pcVPS->getSplittingFlag() )934 { 935 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )936 { 937 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ ) 938 { 939 if ( !pcVPS->getSplittingFlag() ) 940 { 937 941 READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( i, j, uiCode ); 938 942 } 939 } 940 } 943 else 944 { 945 pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j) ); 946 } 947 } 948 } 949 941 950 942 951 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ ) … … 979 988 { 980 989 READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1" ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode ); 981 numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1();990 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1); 982 991 } 983 992 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
r324 r498 123 123 DTRACE_CABAC_T( "\tPOC: " ); 124 124 DTRACE_CABAC_V( rpcPic->getPOC() ); 125 #if H_MV 126 DTRACE_CABAC_T( "\tLayer: " ); 127 DTRACE_CABAC_V( rpcPic->getLayerId() ); 128 #endif 129 125 130 DTRACE_CABAC_T( "\n" ); 126 131 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r495 r498 663 663 // Operation point set 664 664 for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ ) 665 { 665 666 #else 666 667 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); … … 673 674 // Operation point set 674 675 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 675 #endif676 676 { 677 677 // Only applicable for version 1 678 678 pcVPS->setLayerIdIncludedFlag( true, opsIdx, i ); 679 #endif 679 680 WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" ); 680 681 } … … 731 732 WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3, "dimension_id_len_minus1[j]"); 732 733 } 734 735 if ( pcVPS->getSplittingFlag() ) 736 { // Ignore old dimension id length 737 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLen() ); 738 } 739 733 740 734 741 WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0, "vps_nuh_layer_id_present_flag"); … … 746 753 747 754 assert( pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i ); 748 749 if ( !pcVPS->getSplittingFlag())750 { 751 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++)752 { 755 756 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ ) 757 { 758 if ( !pcVPS->getSplittingFlag() ) 759 { 753 760 WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]"); 761 } 762 else 763 { 764 assert( pcVPS->getDimensionId( i, j ) == pcVPS->inferDimensionId( i, j ) ); 754 765 } 755 766 } … … 789 800 { 790 801 WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( ) , 10, "num_add_output_layer_sets_minus1" ); 791 numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1();802 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 ); 792 803 } 793 804 -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCfg.h
r493 r498 409 409 , m_viewIndex(-1) 410 410 , m_isDepth(false) 411 , m_bUseVSO(false) 411 412 #endif 412 413 #endif -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncSlice.cpp
r446 r498 1301 1301 DTRACE_CABAC_T( "\tPOC: " ); 1302 1302 DTRACE_CABAC_V( rpcPic->getPOC() ); 1303 #if H_MV 1304 DTRACE_CABAC_T( "\tLayer: " ); 1305 DTRACE_CABAC_V( rpcPic->getLayerId() ); 1306 #endif 1303 1307 DTRACE_CABAC_T( "\n" ); 1304 1308 #if ENC_DEC_TRACE
Note: See TracChangeset for help on using the changeset viewer.