Changeset 376 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 28 Aug 2013, 23:06:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r370 r376 1806 1806 1807 1807 TimingInfo *timingInfo = vui->getTimingInfo(); 1808 timingInfo->setTimingInfoPresentFlag( true ); 1809 switch( frameRate ) 1810 { 1811 case 24: 1812 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 1813 break; 1814 case 25: 1815 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 1816 break; 1817 case 30: 1818 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 1819 break; 1820 case 50: 1821 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 1822 break; 1823 case 60: 1824 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 1825 break; 1826 default: 1827 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 1828 break; 1829 } 1830 1831 Bool rateCnt = ( bitRate > 0 ); 1832 hrd->setNalHrdParametersPresentFlag( rateCnt ); 1833 hrd->setVclHrdParametersPresentFlag( rateCnt ); 1834 1835 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 1836 1837 if( hrd->getSubPicCpbParamsPresentFlag() ) 1838 { 1839 hrd->setTickDivisorMinus2( 100 - 2 ); // 1840 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 1841 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 1842 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 1808 #if TIMING_INFO_NONZERO_LAYERID_SPS 1809 if( getLayerId() > 0 ) 1810 { 1811 timingInfo->setTimingInfoPresentFlag( false ); 1843 1812 } 1844 1813 else 1845 1814 { 1846 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 1847 } 1848 1849 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 1850 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1851 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1815 #endif 1816 timingInfo->setTimingInfoPresentFlag( true ); 1817 switch( frameRate ) 1818 { 1819 case 24: 1820 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 1821 break; 1822 case 25: 1823 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 1824 break; 1825 case 30: 1826 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 1827 break; 1828 case 50: 1829 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 1830 break; 1831 case 60: 1832 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 1833 break; 1834 default: 1835 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 1836 break; 1837 } 1838 1839 Bool rateCnt = ( bitRate > 0 ); 1840 hrd->setNalHrdParametersPresentFlag( rateCnt ); 1841 hrd->setVclHrdParametersPresentFlag( rateCnt ); 1842 1843 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 1844 1845 if( hrd->getSubPicCpbParamsPresentFlag() ) 1846 { 1847 hrd->setTickDivisorMinus2( 100 - 2 ); // 1848 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 1849 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 1850 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 1851 } 1852 else 1853 { 1854 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 1855 } 1856 1857 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 1858 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1859 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 1852 1860 1853 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 1854 if( randomAccess ) 1855 { 1856 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 1857 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 1858 } 1859 else 1860 { 1861 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 1862 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 1863 } 1864 1865 /* 1866 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 1867 */ 1868 Int i, j; 1869 UInt birateValue, cpbSizeValue; 1870 UInt ducpbSizeValue; 1871 UInt duBitRateValue = 0; 1872 1873 for( i = 0; i < MAX_TLAYER; i ++ ) 1874 { 1875 hrd->setFixedPicRateFlag( i, 1 ); 1876 hrd->setPicDurationInTcMinus1( i, 0 ); 1877 hrd->setLowDelayHrdFlag( i, 0 ); 1878 hrd->setCpbCntMinus1( i, 0 ); 1879 1880 birateValue = bitRate; 1881 cpbSizeValue = bitRate; // 1 second 1882 ducpbSizeValue = bitRate/numDU; 1883 duBitRateValue = bitRate; 1884 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 1885 { 1886 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 1887 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 1888 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 1889 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 1890 1891 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 1892 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 1893 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 1894 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 1895 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 1896 } 1897 } 1861 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 1862 if( randomAccess ) 1863 { 1864 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 1865 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 1866 } 1867 else 1868 { 1869 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 1870 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 1871 } 1872 1873 /* 1874 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 1875 */ 1876 Int i, j; 1877 UInt birateValue, cpbSizeValue; 1878 UInt ducpbSizeValue; 1879 UInt duBitRateValue = 0; 1880 1881 for( i = 0; i < MAX_TLAYER; i ++ ) 1882 { 1883 hrd->setFixedPicRateFlag( i, 1 ); 1884 hrd->setPicDurationInTcMinus1( i, 0 ); 1885 hrd->setLowDelayHrdFlag( i, 0 ); 1886 hrd->setCpbCntMinus1( i, 0 ); 1887 1888 birateValue = bitRate; 1889 cpbSizeValue = bitRate; // 1 second 1890 ducpbSizeValue = bitRate/numDU; 1891 duBitRateValue = bitRate; 1892 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 1893 { 1894 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 1895 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 1896 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 1897 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 1898 1899 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 1900 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 1901 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 1902 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 1903 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 1904 } 1905 } 1906 #if TIMING_INFO_NONZERO_LAYERID_SPS 1907 } 1908 #endif 1898 1909 } 1899 1910 const Int TComSPS::m_winUnitX[]={1,2,2,1};
Note: See TracChangeset for help on using the changeset viewer.