Changeset 1544 in SHVCSoftware
- Timestamp:
- 22 Mar 2016, 23:36:21 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1541 r1544 1167 1167 #endif 1168 1168 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") 1169 ("TemporalSubsampleRatio,-ts", m_temporalSubsampleRatio, 1u, "Temporal sub-sample ratio when reading input YUV") 1169 1170 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") 1170 1171 ("ClipInputVideoToRec709Range", m_bClipInputVideoToRec709Range, false, "If true then clip input video to the Rec. 709 Range on loading when InternalBitDepth is less than MSBExtendedBitDepth") … … 1759 1760 */ 1760 1761 1762 m_framesToBeEncoded = ( m_framesToBeEncoded + m_temporalSubsampleRatio - 1 ) / m_temporalSubsampleRatio; 1761 1763 m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values; 1762 1764 if(m_isField) … … 3376 3378 xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT, "InputChromaFormatIDC must be either 400, 420, 422 or 444" ); 3377 3379 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); 3380 xConfirmPara( m_temporalSubsampleRatio < 1, "Temporal subsample rate must be no less than 1" ); 3378 3381 xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" ); 3379 3382 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); … … 4296 4299 4297 4300 printf("Reconstruction File : %s\n", m_reconFileName.c_str() ); 4298 printf("Real Format : %dx%d % dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate);4299 printf("Internal Format : %dx%d % dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate);4301 printf("Real Format : %dx%d %gHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, (Double)m_iFrameRate/m_temporalSubsampleRatio ); 4302 printf("Internal Format : %dx%d %gHz\n", m_iSourceWidth, m_iSourceHeight, (Double)m_iFrameRate/m_temporalSubsampleRatio ); 4300 4303 4301 4304 #if SVC_EXTENSION -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1538 r1544 152 152 Int m_iFrameRate; ///< source frame-rates (Hz) 153 153 #endif 154 UInt m_FrameSkip; ///< number of skipped frames from the beginning 154 UInt m_FrameSkip; ///< number of skipped frames from the beginning 155 UInt m_temporalSubsampleRatio; ///< temporal subsample ratio, 2 means code every two frames 155 156 #if !SVC_EXTENSION 156 157 Int m_iSourceWidth; ///< source width in pixel -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1538 r1544 563 563 m_cTEncTop.setFrameRate ( m_iFrameRate ); 564 564 m_cTEncTop.setFrameSkip ( m_FrameSkip ); 565 m_cTEncTop.setTemporalSubsampleRatio ( m_temporalSubsampleRatio ); 565 566 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 566 567 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); … … 1730 1731 } 1731 1732 m_apcTEncTop[layer]->setNumPicRcvd( 0 ); 1733 1734 // temporally skip frames 1735 if( m_temporalSubsampleRatio > 1 ) 1736 { 1737 m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_temporalSubsampleRatio-1, m_apcTEncTop[layer]->getSourceWidth() - m_apcTEncTop[layer]->getPad(0), m_apcTEncTop[layer]->getSourceHeight() - m_apcTEncTop[layer]->getPad(1), m_apcLayerCfg[layer]->m_InputChromaFormatIDC); 1738 } 1732 1739 } 1733 1740 … … 1971 1978 xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits); 1972 1979 outputAccessUnits.clear(); 1980 } 1981 // temporally skip frames 1982 if( m_temporalSubsampleRatio > 1 ) 1983 { 1984 m_cTVideoIOYuvInputFile.skipFrames(m_temporalSubsampleRatio-1, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 1973 1985 } 1974 1986 } … … 2280 2292 { 2281 2293 #if SVC_EXTENSION 2282 Double time = (Double) m_iFrameRcvd / m_apcLayerCfg[m_numLayers-1]->m_iFrameRate ;2294 Double time = (Double) m_iFrameRcvd / m_apcLayerCfg[m_numLayers-1]->m_iFrameRate * m_temporalSubsampleRatio; 2283 2295 #else 2284 Double time = (Double) m_iFrameRcvd / m_iFrameRate ;2296 Double time = (Double) m_iFrameRcvd / m_iFrameRate * m_temporalSubsampleRatio; 2285 2297 #endif 2286 2298 printf("Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1538 r1544 103 103 Int m_iFrameRate; 104 104 Int m_FrameSkip; 105 UInt m_temporalSubsampleRatio; 105 106 Int m_iSourceWidth; 106 107 Int m_iSourceHeight; … … 509 510 510 511 Void setFrameRate ( Int i ) { m_iFrameRate = i; } 511 Void setFrameSkip ( UInt i ) { m_FrameSkip = i; } 512 Void setFrameSkip ( UInt i ) { m_FrameSkip = i; } 513 Void setTemporalSubsampleRatio ( UInt i ) { m_temporalSubsampleRatio = i; } 512 514 Void setSourceWidth ( Int i ) { m_iSourceWidth = i; } 513 515 Void setSourceHeight ( Int i ) { m_iSourceHeight = i; } … … 610 612 Int getFrameRate () { return m_iFrameRate; } 611 613 UInt getFrameSkip () { return m_FrameSkip; } 614 UInt getTemporalSubsampleRatio () { return m_temporalSubsampleRatio; } 612 615 Int getSourceWidth () { return m_iSourceWidth; } 613 616 Int getSourceHeight () { return m_iSourceHeight; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1542 r1544 2831 2831 //--CFG_KDY 2832 2832 const Int rateMultiplier=(isField?2:1); 2833 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );2834 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );2835 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );2836 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );2833 m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio()); 2834 m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio()); 2835 m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio()); 2836 m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio()); 2837 2837 const ChromaFormat chFmt = m_pcCfg->getChromaFormatIdc(); 2838 2838 … … 2865 2865 { 2866 2866 //-- interlaced summary 2867 m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate() );2867 m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate() / (Double)m_pcCfg->getTemporalSubsampleRatio()); 2868 2868 m_gcAnalyzeAll_in.setBits(m_gcAnalyzeAll.getBits()); 2869 2869 // prior to the above statement, the interlace analyser does not contain the correct total number of bits. -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1534 r1544 135 135 if ( m_RCEnableRateControl ) 136 136 { 137 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,138 m_maxCUWidth, m_maxCUHeight,m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );137 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, (Int)( (Double)m_iFrameRate/m_temporalSubsampleRatio + 0.5), m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 138 m_maxCUWidth, m_maxCUHeight,m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList ); 139 139 } 140 140 … … 1106 1106 } 1107 1107 1108 if (getTemporalSubsampleRatio()>1) 1109 { 1110 UInt temporalSubsampleRatio = getTemporalSubsampleRatio(); 1111 if ( Double(timingInfo->getNumUnitsInTick()) * temporalSubsampleRatio > std::numeric_limits<UInt>::max() ) 1112 { 1113 timingInfo->setTimeScale( timingInfo->getTimeScale() / temporalSubsampleRatio ); 1114 } 1115 else 1116 { 1117 timingInfo->setNumUnitsInTick( timingInfo->getNumUnitsInTick() * temporalSubsampleRatio ); 1118 } 1119 } 1120 1108 1121 Bool rateCnt = ( bitRate > 0 ); 1109 1122 hrd->setNalHrdParametersPresentFlag( rateCnt );
Note: See TracChangeset for help on using the changeset viewer.