Changeset 1544 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder


Ignore:
Timestamp:
22 Mar 2016, 23:36:21 (9 years ago)
Author:
seregin
Message:

port rev 4718 and remove TEMPORAL_SUBSAMPLE macro

Location:
branches/SHM-dev/source/App/TAppEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1541 r1544  
    11671167#endif
    11681168  ("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")
    11691170  ("FramesToBeEncoded,f",                             m_framesToBeEncoded,                                  0, "Number of frames to be encoded (default=all)")
    11701171  ("ClipInputVideoToRec709Range",                     m_bClipInputVideoToRec709Range,                   false, "If true then clip input video to the Rec. 709 Range on loading when InternalBitDepth is less than MSBExtendedBitDepth")
     
    17591760   */
    17601761
     1762  m_framesToBeEncoded = ( m_framesToBeEncoded + m_temporalSubsampleRatio - 1 ) / m_temporalSubsampleRatio;
    17611763  m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
    17621764  if(m_isField)
     
    33763378  xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT,                                "InputChromaFormatIDC must be either 400, 420, 422 or 444" );
    33773379  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" );
    33783381  xConfirmPara( m_framesToBeEncoded <= 0,                                                   "Total Number Of Frames encoded must be more than 0" );
    33793382  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
     
    42964299 
    42974300  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 );
    43004303
    43014304#if SVC_EXTENSION
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1538 r1544  
    152152  Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
    153153#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
    155156#if !SVC_EXTENSION
    156157  Int       m_iSourceWidth;                                   ///< source width in pixel
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1538 r1544  
    563563  m_cTEncTop.setFrameRate                                         ( m_iFrameRate );
    564564  m_cTEncTop.setFrameSkip                                         ( m_FrameSkip );
     565  m_cTEncTop.setTemporalSubsampleRatio                            ( m_temporalSubsampleRatio );
    565566  m_cTEncTop.setSourceWidth                                       ( m_iSourceWidth );
    566567  m_cTEncTop.setSourceHeight                                      ( m_iSourceHeight );
     
    17301731      }
    17311732      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      }
    17321739    }
    17331740
     
    19711978      xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits);
    19721979      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);
    19731985    }
    19741986  }
     
    22802292{
    22812293#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;
    22832295#else
    2284   Double time = (Double) m_iFrameRcvd / m_iFrameRate;
     2296  Double time = (Double) m_iFrameRcvd / m_iFrameRate * m_temporalSubsampleRatio;
    22852297#endif
    22862298  printf("Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time);
Note: See TracChangeset for help on using the changeset viewer.