Changeset 672 in SHVCSoftware for branches/SHM-6-dev/source/Lib
- Timestamp:
- 12 Apr 2014, 02:51:51 (11 years ago)
- Location:
- branches/SHM-6-dev/source/Lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h
r669 r672 684 684 Bool m_vpsVuiPresentFlag; 685 685 #endif 686 Bool m_vpsExtensionFlag; 686 687 687 688 #if O0164_MULTI_LAYER_HRD … … 1131 1132 1132 1133 #if O0109_MOVE_VPS_VUI_FLAG 1133 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1134 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1135 #endif 1134 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1135 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1136 #endif 1137 Bool getVpsExtensionFlag() { return m_vpsExtensionFlag; } 1138 Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } 1136 1139 1137 1140 #if !P0307_REMOVE_VPS_VUI_OFFSET -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r670 r672 977 977 } 978 978 } 979 READ_FLAG( uiCode, "vps_extension_flag" ); 980 if (uiCode) 979 READ_FLAG( uiCode, "vps_extension_flag" ); pcVPS->setVpsExtensionFlag( uiCode ? true : false ); 980 981 if( pcVPS->getVpsExtensionFlag() ) 981 982 { 982 983 #if VPS_EXTNS … … 1000 1001 } 1001 1002 #endif 1003 } 1004 else 1005 { 1006 // set default parameters when syntax elements are not present 1007 defaultVPSExtension(pcVPS); 1002 1008 } 1003 1009 … … 1501 1507 else 1502 1508 { 1503 // default assignment - each layer assigned each rep_format() structure in the order signaled1509 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min (i, vps_num_rep_formats_minus1) 1504 1510 for(i = 1; i < vps->getMaxLayers(); i++) 1505 1511 { … … 1660 1666 #if P0307_VPS_NON_VUI_EXTENSION 1661 1667 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); 1668 1669 // The value of vps_non_vui_extension_length shall be in the range of 0 to 4096, inclusive. 1670 assert( vps->getVpsNonVuiExtLength() >= 0 && vps->getVpsNonVuiExtLength() <= 4096 ); 1671 1662 1672 #if P0307_VPS_NON_VUI_EXT_UPDATE 1663 1673 Int nonVuiExtByte = uiCode; … … 1702 1712 #endif 1703 1713 } 1704 } 1705 #endif 1714 else 1715 { 1716 // set default values for VPS VUI 1717 defaultVPSVUI( vps ); 1718 } 1719 } 1720 1721 Void TDecCavlc::defaultVPSExtension( TComVPS* vps ) 1722 { 1723 // set default parameters when they are not present 1724 Int i, j; 1725 1726 // When layer_id_in_nuh[ i ] is not present, the value is inferred to be equal to i. 1727 for(i = 0; i < vps->getMaxLayers(); i++) 1728 { 1729 vps->setLayerIdInNuh(i, i); 1730 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 1731 } 1732 1733 // When not present, sub_layers_vps_max_minus1[ i ] is inferred to be equal to vps_max_sub_layers_minus1. 1734 for( i = 0; i < vps->getMaxLayers(); i++) 1735 { 1736 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1737 } 1738 1739 // When not present, max_tid_il_ref_pics_plus1[ i ][ j ] is inferred to be equal to 7. 1740 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1741 { 1742 #if O0225_MAX_TID_FOR_REF_LAYERS 1743 for( j = i + 1; j < vps->getMaxLayers(); j++ ) 1744 { 1745 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1746 } 1747 #else 1748 vps->setMaxTidIlRefPicsPlus1(i, 7); 1749 #endif 1750 } 1751 1752 // When not present, the value of num_add_output_layer_sets is inferred to be equal to 0. 1753 // NumOutputLayerSets = num_add_output_layer_sets + vps_num_layer_sets_minus1 + 1 1754 vps->setNumOutputLayerSets( vps->getNumLayerSets() ); 1755 1756 // For i in the range of 0 to NumOutputLayerSets-1, inclusive, the variable LayerSetIdxForOutputLayerSet[ i ] is derived as specified in the following: 1757 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : output_layer_set_idx_minus1[ i ] + 1 1758 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1759 { 1760 vps->setOutputLayerSetIdx( i, i ); 1761 Int lsIdx = vps->getOutputLayerSetIdx(i); 1762 1763 for( j = 0; j < vps->getNumLayersInIdList(lsIdx); j++ ) 1764 { 1765 vps->setOutputLayerFlag(i, j, 1); 1766 } 1767 } 1768 1769 // The value of sub_layer_dpb_info_present_flag[ i ][ 0 ] for any possible value of i is inferred to be equal to 1 1770 // When not present, the value of sub_layer_dpb_info_present_flag[ i ][ j ] for j greater than 0 and any possible value of i, is inferred to be equal to be equal to 0. 1771 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1772 { 1773 vps->setSubLayerDpbInfoPresentFlag( i, 0, true ); 1774 } 1775 1776 // When not present, the value of vps_num_rep_formats_minus1 is inferred to be equal to MaxLayersMinus1. 1777 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1778 1779 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1780 vps->setRepFormatIdxPresentFlag( false ); 1781 1782 if( !vps->getRepFormatIdxPresentFlag() ) 1783 { 1784 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min(i, vps_num_rep_formats_minus1). 1785 for(i = 1; i < vps->getMaxLayers(); i++) 1786 { 1787 vps->setVpsRepFormatIdx( i, min( (Int)i, vps->getVpsNumRepFormats() - 1 ) ); 1788 } 1789 } 1790 1791 // vps_poc_lsb_aligned_flag 1792 // When not present, vps_poc_lsb_aligned_flag is inferred to be equal to 0. 1793 1794 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1795 // When not present, poc_lsb_not_present_flag[ i ] is inferred to be equal to 0. 1796 for(i = 1; i< vps->getMaxLayers(); i++) 1797 { 1798 vps->setPocLsbNotPresentFlag(i, 0); 1799 } 1800 #endif 1801 1802 // set default values for VPS VUI 1803 defaultVPSVUI( vps ); 1804 } 1805 1806 Void TDecCavlc::defaultVPSVUI( TComVPS* vps ) 1807 { 1808 #if N0147_IRAP_ALIGN_FLAG 1809 // When not present, the value of all_layers_idr_aligned_flag is inferred to be equal to 0. 1810 vps->setCrossLayerIrapAlignFlag( false ); 1811 #endif 1812 1813 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1814 // When single_layer_for_non_irap_flag is not present, it is inferred to be equal to 0. 1815 vps->setSingleLayerForNonIrapFlag( false ); 1816 #endif 1817 1818 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1819 // When higher_layer_irap_skip_flag is not present it is inferred to be equal to 0 1820 vps->setHigherLayerIrapSkipFlag( false ); 1821 #endif 1822 } 1823 #endif 1824 1706 1825 #if REPN_FORMAT_IN_VPS 1707 1826 Void TDecCavlc::parseRepFormat( RepFormat *repFormat, RepFormat *repFormatPrev ) … … 1798 1917 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1799 1918 #if DPB_PARAMS_MAXTLAYERS 1800 1919 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1801 1920 #else 1802 1921 for(Int j = 0; j <= vps->getMaxTLayers(); j++) … … 1918 2037 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 1919 2038 { 1920 READ_FLAG( uiCode, "bit_rate_present_ vps_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false );2039 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 1921 2040 } 1922 2041 else … … 1926 2045 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 1927 2046 { 1928 READ_FLAG( uiCode, "pic_rate_present_ vps_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false );2047 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 1929 2048 } 1930 2049 else … … 1966 2085 vps->setNumVideoSignalInfo(vps->getMaxLayers()); 1967 2086 } 1968 1969 2087 1970 2088 for(i = 0; i < vps->getNumVideoSignalInfo(); i++) … … 2052 2170 #if HIGHER_LAYER_IRAP_SKIP_FLAG 2053 2171 READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false); 2172 2173 // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0 2174 if( !vps->getSingleLayerForNonIrapFlag() ) 2175 { 2176 assert( !vps->getHigherLayerIrapSkipFlag() ); 2177 } 2054 2178 #endif 2055 2179 #endif -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r670 r672 75 75 #if VPS_EXTNS 76 76 Void parseVPSExtension ( TComVPS* pcVPS ); 77 Void defaultVPSExtension ( TComVPS* pcVPS ); 77 78 #endif 78 79 79 80 #if VPS_VUI 80 81 Void parseVPSVUI ( TComVPS* pcVPS ); 82 Void defaultVPSVUI ( TComVPS* pcVPS ); 81 83 #endif 82 84 #if REPN_FORMAT_IN_VPS -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r665 r672 780 780 WRITE_FLAG( 0, "vps_extension_flag" ); 781 781 #else 782 WRITE_FLAG( 1, "vps_extension_flag" ); 783 if(1) // Should be conditioned on the value of vps_extension_flag 782 pcVPS->setVpsExtensionFlag(true); 783 WRITE_FLAG( pcVPS->getVpsExtensionFlag() ? 1 : 0, "vps_extension_flag" ); 784 785 if( pcVPS->getVpsExtensionFlag() ) 784 786 { 785 787 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) … … 1240 1242 1241 1243 #if P0307_VPS_NON_VUI_EXTENSION 1244 // The value of vps_non_vui_extension_length shall be in the range of 0 to 4096, inclusive. 1245 assert( vps->getVpsNonVuiExtLength() >= 0 && vps->getVpsNonVuiExtLength() <= 4096 ); 1246 1242 1247 WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" ); 1243 1248 #if P0307_VPS_NON_VUI_EXT_UPDATE … … 1275 1280 #else 1276 1281 #if P0307_REMOVE_VPS_VUI_OFFSET 1277 WRITE_FLAG( 1, "vps_vui_present_flag" );1278 1282 vps->setVpsVuiPresentFlag(true); 1283 WRITE_FLAG( vps->getVpsVuiPresentFlag() ? 1 : 0, "vps_vui_present_flag" ); 1279 1284 #endif 1280 1285 if(vps->getVpsVuiPresentFlag()) // Should be conditioned on the value of vps_vui_present_flag … … 1432 1437 if( vps->getBitRatePresentVpsFlag() ) 1433 1438 { 1434 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_ vps_flag[i][j]" );1439 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_flag[i][j]" ); 1435 1440 } 1436 1441 if( vps->getPicRatePresentVpsFlag() ) 1437 1442 { 1438 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_ vps_flag[i][j]" );1443 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_flag[i][j]" ); 1439 1444 } 1440 1445 if( vps->getBitRatePresentFlag(i, j) ) … … 1523 1528 #endif 1524 1529 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1530 // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0 1531 if( !vps->getSingleLayerForNonIrapFlag() ) 1532 { 1533 assert( !vps->getHigherLayerIrapSkipFlag() ); 1534 } 1535 1525 1536 WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" ); 1526 1537 #endif
Note: See TracChangeset for help on using the changeset viewer.