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


Ignore:
Timestamp:
9 Jul 2014, 03:42:42 (10 years ago)
Author:
seregin
Message:

update to HM-15.0

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

Legend:

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

    r820 r823  
    7070#endif
    7171, m_maxTidRefPresentFlag(1)
    72 , m_pColumnWidth()
    73 , m_pRowHeight()
    7472, m_scalingListFile()
    7573, m_elRapSliceBEnabled(0)
     
    8785, m_pchReconFile()
    8886, m_pchdQPFile()
    89 , m_pColumnWidth()
    90 , m_pRowHeight()
    9187, m_scalingListFile()
    9288{
     
    129125  free(m_pchdQPFile);
    130126#endif
    131   free(m_pColumnWidth);
    132   free(m_pRowHeight);
    133127  free(m_scalingListFile);
    134128}
     
    519513  string cfg_dQPFile;
    520514#endif //SVC_EXTENSION
    521   string cfg_ColumnWidth;
    522   string cfg_RowHeight;
     515  string cfgColumnWidth;
     516  string cfgRowHeight;
    523517  string cfg_ScalingListFile;
    524518  string cfg_startOfCodedInterval;
     
    648642  ("ChromaFormatIDC,-cf",   tmpChromaFormat,                             0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
    649643#endif
    650   ("ConformanceMode",       m_conformanceMode,     0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance")
    651   ("HorizontalPadding,-pdx",m_aiPad[0],            0, "Horizontal source padding for conformance window mode 2")
    652   ("VerticalPadding,-pdy",  m_aiPad[1],            0, "Vertical source padding for conformance window mode 2")
    653   ("ConfLeft",              m_confLeft,            0, "Left offset for window conformance mode 3")
    654   ("ConfRight",             m_confRight,           0, "Right offset for window conformance mode 3")
    655   ("ConfTop",               m_confTop,             0, "Top offset for window conformance mode 3")
    656   ("ConfBottom",            m_confBottom,          0, "Bottom offset for window conformance mode 3")
     644  ("ConformanceMode",       m_conformanceWindowMode,  0, "Deprecated alias of ConformanceWindowMode")
     645  ("ConformanceWindowMode", m_conformanceWindowMode,  0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance")
     646  ("HorizontalPadding,-pdx",m_aiPad[0],               0, "Horizontal source padding for conformance window mode 2")
     647  ("VerticalPadding,-pdy",  m_aiPad[1],               0, "Vertical source padding for conformance window mode 2")
     648  ("ConfLeft",              m_confWinLeft,            0, "Deprecated alias of ConfWinLeft")
     649  ("ConfRight",             m_confWinRight,           0, "Deprecated alias of ConfWinRight")
     650  ("ConfTop",               m_confWinTop,             0, "Deprecated alias of ConfWinTop")
     651  ("ConfBottom",            m_confWinBottom,          0, "Deprecated alias of ConfWinBottom")
     652  ("ConfWinLeft",           m_confWinLeft,            0, "Left offset for window conformance mode 3")
     653  ("ConfWinRight",          m_confWinRight,           0, "Right offset for window conformance mode 3")
     654  ("ConfWinTop",            m_confWinTop,             0, "Top offset for window conformance mode 3")
     655  ("ConfWinBottom",         m_confWinBottom,          0, "Bottom offset for window conformance mode 3")
    657656  ("FrameRate,-fr",         m_iFrameRate,          0, "Frame rate")
    658657#endif //SVC_EXTENSION
     
    815814  ("WeightedPredB,-wpB",          m_useWeightedBiPred,             false,      "Use weighted (bidirectional) prediction in B slices")
    816815  ("Log2ParallelMergeLevel",      m_log2ParallelMergeLevel,     2u,          "Parallel merge estimation region")
    817   ("UniformSpacingIdc",           m_iUniformSpacingIdr,            0,          "Indicates if the column and row boundaries are distributed uniformly")
    818   ("NumTileColumnsMinus1",        m_iNumColumnsMinus1,             0,          "Number of columns in a picture minus 1")
    819   ("ColumnWidthArray",            cfg_ColumnWidth,                 string(""), "Array containing ColumnWidth values in units of LCU")
    820   ("NumTileRowsMinus1",           m_iNumRowsMinus1,                0,          "Number of rows in a picture minus 1")
    821   ("RowHeightArray",              cfg_RowHeight,                   string(""), "Array containing RowHeight values in units of LCU")
     816
     817  //deprecated copies of renamed tile parameters
     818  ("UniformSpacingIdc",           m_tileUniformSpacingFlag,        false,      "deprecated alias of TileUniformSpacing")
     819  ("ColumnWidthArray",            cfgColumnWidth,                  string(""), "deprecated alias of TileColumnWidthArray")
     820  ("RowHeightArray",              cfgRowHeight,                    string(""), "deprecated alias of TileRowHeightArray")
     821
     822  ("TileUniformSpacing",          m_tileUniformSpacingFlag,        false,      "Indicates that tile columns and rows are distributed uniformly")
     823  ("NumTileColumnsMinus1",        m_numTileColumnsMinus1,          0,          "Number of tile columns in a picture minus 1")
     824  ("NumTileRowsMinus1",           m_numTileRowsMinus1,             0,          "Number of rows in a picture minus 1")
     825  ("TileColumnWidthArray",        cfgColumnWidth,                  string(""), "Array containing tile column width values in units of LCU")
     826  ("TileRowHeightArray",          cfgRowHeight,                    string(""), "Array containing tile row height values in units of LCU")
    822827  ("LFCrossTileBoundaryFlag",      m_bLFCrossTileBoundaryFlag,             true,          "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering")
    823828  ("WaveFrontSynchro",            m_iWaveFrontSynchro,             0,          "0: no synchro; 1 synchro with TR; 2 TRR etc")
     
    878883  ("ColourDescriptionPresent",       m_colourDescriptionPresentFlag,       false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present")
    879884  ("ColourPrimaries",                m_colourPrimaries,                        2, "Indicates chromaticity coordinates of the source primaries")
    880   ("TransferCharateristics",         m_transferCharacteristics,                2, "Indicates the opto-electronic transfer characteristics of the source")
     885  ("TransferCharacteristics",        m_transferCharacteristics,                2, "Indicates the opto-electronic transfer characteristics of the source")
    881886  ("MatrixCoefficients",             m_matrixCoefficients,                     2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries")
    882887  ("ChromaLocInfoPresent",           m_chromaLocInfoPresentFlag,           false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present")
     
    10961101#endif //SVC_EXTENSION
    10971102
    1098   Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
    1099   Char* pRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str());
    1100   if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
    1101   {
    1102     char *columnWidth;
     1103  Char* pColumnWidth = cfgColumnWidth.empty() ? NULL: strdup(cfgColumnWidth.c_str());
     1104  Char* pRowHeight = cfgRowHeight.empty() ? NULL : strdup(cfgRowHeight.c_str());
     1105
     1106  if( !m_tileUniformSpacingFlag && m_numTileColumnsMinus1 > 0 )
     1107  {
     1108    char *str;
    11031109    int  i=0;
    1104     m_pColumnWidth = new UInt[m_iNumColumnsMinus1];
    1105     columnWidth = strtok(pColumnWidth, " ,-");
    1106     while(columnWidth!=NULL)
    1107     {
    1108       if( i>=m_iNumColumnsMinus1 )
     1110    m_tileColumnWidth.resize( m_numTileColumnsMinus1 );
     1111    str = strtok(pColumnWidth, " ,-");
     1112    while(str!=NULL)
     1113    {
     1114      if( i >= m_numTileColumnsMinus1 )
    11091115      {
    11101116        printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" );
    11111117        exit( EXIT_FAILURE );
    11121118      }
    1113       *( m_pColumnWidth + i ) = atoi( columnWidth );
    1114       columnWidth = strtok(NULL, " ,-");
     1119      m_tileColumnWidth[i] = atoi( str );
     1120      str = strtok(NULL, " ,-");
    11151121      i++;
    11161122    }
    1117     if( i<m_iNumColumnsMinus1 )
     1123    if( i < m_numTileColumnsMinus1 )
    11181124    {
    11191125      printf( "The width of some columns is not defined.\n" );
     
    11231129  else
    11241130  {
    1125     m_pColumnWidth = NULL;
    1126   }
    1127 
    1128   if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
    1129   {
    1130     char *rowHeight;
     1131    m_tileColumnWidth.clear();
     1132  }
     1133
     1134  if( !m_tileUniformSpacingFlag && m_numTileRowsMinus1 > 0 )
     1135  {
     1136    char *str;
    11311137    int  i=0;
    1132     m_pRowHeight = new UInt[m_iNumRowsMinus1];
    1133     rowHeight = strtok(pRowHeight, " ,-");
    1134     while(rowHeight!=NULL)
    1135     {
    1136       if( i>=m_iNumRowsMinus1 )
     1138    m_tileRowHeight.resize(m_numTileRowsMinus1);
     1139    str = strtok(pRowHeight, " ,-");
     1140    while(str!=NULL)
     1141    {
     1142      if( i>=m_numTileRowsMinus1 )
    11371143      {
    11381144        printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" );
    11391145        exit( EXIT_FAILURE );
    11401146      }
    1141       *( m_pRowHeight + i ) = atoi( rowHeight );
    1142       rowHeight = strtok(NULL, " ,-");
     1147      m_tileRowHeight[i] = atoi( str );
     1148      str = strtok(NULL, " ,-");
    11431149      i++;
    11441150    }
    1145     if( i<m_iNumRowsMinus1 )
     1151    if( i < m_numTileRowsMinus1 )
    11461152    {
    11471153      printf( "The height of some rows is not defined.\n" );
     
    11511157  else
    11521158  {
    1153     m_pRowHeight = NULL;
     1159    m_tileRowHeight.clear();
    11541160  }
    11551161#if SVC_EXTENSION
     
    14331439#if !SVC_EXTENSION
    14341440  // TODO:ChromaFmt assumes 4:2:0 below
    1435   switch (m_conformanceMode)
     1441  switch (m_conformanceWindowMode)
    14361442  {
    14371443  case 0:
    14381444    {
    14391445      // no conformance or padding
    1440       m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
     1446      m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
    14411447      m_aiPad[1] = m_aiPad[0] = 0;
    14421448      break;
     
    14481454      if (m_iSourceWidth % minCuSize)
    14491455      {
    1450         m_aiPad[0] = m_confRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
    1451         m_iSourceWidth  += m_confRight;
     1456        m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
     1457        m_iSourceWidth  += m_confWinRight;
    14521458      }
    14531459      if (m_iSourceHeight % minCuSize)
    14541460      {
    1455         m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
    1456         m_iSourceHeight += m_confBottom;
     1461        m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
     1462        m_iSourceHeight += m_confWinBottom;
    14571463        if ( m_isField )
    14581464        {
    1459           m_iSourceHeightOrg += m_confBottom << 1;
    1460           m_aiPad[1] = m_confBottom << 1;
     1465          m_iSourceHeightOrg += m_confWinBottom << 1;
     1466          m_aiPad[1] = m_confWinBottom << 1;
    14611467        }
    14621468      }
     
    14781484      m_iSourceWidth  += m_aiPad[0];
    14791485      m_iSourceHeight += m_aiPad[1];
    1480       m_confRight  = m_aiPad[0];
    1481       m_confBottom = m_aiPad[1];
     1486      m_confWinRight  = m_aiPad[0];
     1487      m_confWinBottom = m_aiPad[1];
    14821488      break;
    14831489    }
     
    14851491    {
    14861492      // conformance
    1487       if ((m_confLeft == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))
     1493      if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0))
    14881494      {
    14891495        fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n");
     
    16231629  if (m_interLayerConstrainedTileSetsSEIEnabled)
    16241630  {
    1625     if (m_iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0)
     1631    if (m_numTileColumnsMinus1 == 0 && m_numTileRowsMinus1 == 0)
    16261632    {
    16271633      printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" );
     
    18281834  }
    18291835 
    1830   Bool tileFlag = (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 );
     1836  Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
    18311837  xConfirmPara( tileFlag && m_iWaveFrontSynchro,            "Tile and Wavefront can not be applied together");
    18321838
     
    18391845  xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
    18401846
    1841   xConfirmPara( m_confLeft   % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
    1842   xConfirmPara( m_confRight  % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
    1843   xConfirmPara( m_confTop    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
    1844   xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
     1847  xConfirmPara( m_confWinLeft   % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
     1848  xConfirmPara( m_confWinRight  % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
     1849  xConfirmPara( m_confWinTop    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
     1850  xConfirmPara( m_confWinBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
     1851
     1852  xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window");
     1853
     1854  if (m_defaultDisplayWindowFlag)
     1855  {
     1856    xConfirmPara( m_defDispWinLeftOffset   % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left default display window offset must be an integer multiple of the specified chroma subsampling");
     1857    xConfirmPara( m_defDispWinRightOffset  % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right default display window offset must be an integer multiple of the specified chroma subsampling");
     1858    xConfirmPara( m_defDispWinTopOffset    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top default display window offset must be an integer multiple of the specified chroma subsampling");
     1859    xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling");
     1860  }
    18451861#endif
    18461862
     
    25942610      Int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth;
    25952611      Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight;
    2596       if(m_iUniformSpacingIdr)
    2597       {
    2598         maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_iNumColumnsMinus1)/(m_iNumColumnsMinus1+1));
    2599         maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_iNumRowsMinus1)/(m_iNumRowsMinus1+1));
     2612      if(m_tileUniformSpacingFlag)
     2613      {
     2614        maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_numTileColumnsMinus1)/(m_numTileColumnsMinus1+1));
     2615        maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_numTileRowsMinus1)/(m_numTileRowsMinus1+1));
    26002616        // if only the last tile-row is one treeblock higher than the others
    26012617        // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others
    2602         if(!((heightInCU-1)%(m_iNumRowsMinus1+1)))
     2618        if(!((heightInCU-1)%(m_numTileRowsMinus1+1)))
    26032619        {
    26042620          maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight);
     
    26062622        // if only the last tile-column is one treeblock wider than the others
    26072623        // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others   
    2608         if(!((widthInCU-1)%(m_iNumColumnsMinus1+1)))
     2624        if(!((widthInCU-1)%(m_numTileColumnsMinus1+1)))
    26092625        {
    26102626          maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth);
     
    26132629      else // not uniform spacing
    26142630      {
    2615         if(m_iNumColumnsMinus1<1)
     2631        if(m_numTileColumnsMinus1<1)
    26162632        {
    26172633          maxTileWidth = m_iSourceWidth;
     
    26202636        {
    26212637          Int accColumnWidth = 0;
    2622           for(Int col=0; col<(m_iNumColumnsMinus1); col++)
     2638          for(Int col=0; col<(m_numTileColumnsMinus1); col++)
    26232639          {
    2624             maxTileWidth = m_pColumnWidth[col]>maxTileWidth ? m_pColumnWidth[col]:maxTileWidth;
    2625             accColumnWidth += m_pColumnWidth[col];
     2640            maxTileWidth = m_tileColumnWidth[col]>maxTileWidth ? m_tileColumnWidth[col]:maxTileWidth;
     2641            accColumnWidth += m_tileColumnWidth[col];
    26262642          }
    26272643          maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth;
    26282644        }
    2629         if(m_iNumRowsMinus1<1)
     2645        if(m_numTileRowsMinus1<1)
    26302646        {
    26312647          maxTileHeight = m_iSourceHeight;
     
    26342650        {
    26352651          Int accRowHeight = 0;
    2636           for(Int row=0; row<(m_iNumRowsMinus1); row++)
     2652          for(Int row=0; row<(m_numTileRowsMinus1); row++)
    26372653          {
    2638             maxTileHeight = m_pRowHeight[row]>maxTileHeight ? m_pRowHeight[row]:maxTileHeight;
    2639             accRowHeight += m_pRowHeight[row];
     2654            maxTileHeight = m_tileRowHeight[row]>maxTileHeight ? m_tileRowHeight[row]:maxTileHeight;
     2655            accRowHeight += m_tileRowHeight[row];
    26402656          }
    26412657          maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight;
     
    29332949  printf("Bitstream      File          : %s\n", m_pchBitstreamFile      );
    29342950  printf("Reconstruction File          : %s\n", m_pchReconFile          );
    2935   printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
     2951  printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate );
    29362952  printf("Internal Format              : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
    29372953#endif //SVC_EXTENSION
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r820 r823  
    4646#endif
    4747#include <sstream>
     48#include <vector>
    4849//! \ingroup TAppEncoder
    4950//! \{
     
    9394 
    9495 
    95   Int       m_conformanceMode;
    96   Int       m_confLeft;
    97   Int       m_confRight;
    98   Int       m_confTop;
    99   Int       m_confBottom;
     96  Int       m_conformanceWindowMode;
     97  Int       m_confWinLeft;
     98  Int       m_confWinRight;
     99  Int       m_confWinTop;
     100  Int       m_confWinBottom;
    100101  Int       m_framesToBeEncoded;                              ///< number of encoded frames
    101102  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
     
    240241  Bool      m_bLFCrossSliceBoundaryFlag;  ///< 1: filter across slice boundaries 0: do not filter across slice boundaries
    241242  Bool      m_bLFCrossTileBoundaryFlag;   ///< 1: filter across tile boundaries  0: do not filter across tile boundaries
    242   Int       m_iUniformSpacingIdr;
    243   Int       m_iNumColumnsMinus1;
    244   Char*     m_pchColumnWidth;
    245   Int       m_iNumRowsMinus1;
    246   Char*     m_pchRowHeight;
    247   UInt*     m_pColumnWidth;
    248   UInt*     m_pRowHeight;
     243  Bool      m_tileUniformSpacingFlag;
     244  Int       m_numTileColumnsMinus1;
     245  Int       m_numTileRowsMinus1;
     246  std::vector<Int> m_tileColumnWidth;
     247  std::vector<Int> m_tileRowHeight;
    249248  Int       m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current.
    250249#if !SVC_EXTENSION
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r820 r823  
    5050#endif
    5151{
    52   m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
     52  m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
    5353  m_aiPad[1] = m_aiPad[0] = 0;
    5454  m_numScaledRefLayerOffsets = 0;
     
    114114    ("ChromaFormatIDC",       tmpChromaFormat,    420, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
    115115#endif
    116     ("CropLeft",              m_confLeft,      0, "Left cropping/padding for cropping mode 3")
    117     ("CropRight",             m_confRight,     0, "Right cropping/padding for cropping mode 3")
    118     ("CropTop",               m_confTop,       0, "Top cropping/padding for cropping mode 3")
    119     ("CropBottom",            m_confBottom,    0, "Bottom cropping/padding for cropping mode 3")
     116    ("ConfLeft",              m_confWinLeft,            0, "Deprecated alias of ConfWinLeft")
     117    ("ConfRight",             m_confWinRight,           0, "Deprecated alias of ConfWinRight")
     118    ("ConfTop",               m_confWinTop,             0, "Deprecated alias of ConfWinTop")
     119    ("ConfBottom",            m_confWinBottom,          0, "Deprecated alias of ConfWinBottom")
     120    ("ConfWinLeft",           m_confWinLeft,            0, "Left offset for window conformance mode 3")
     121    ("ConfWinRight",          m_confWinRight,           0, "Right offset for window conformance mode 3")
     122    ("ConfWinTop",            m_confWinTop,             0, "Top offset for window conformance mode 3")
     123    ("ConfWinBottom",         m_confWinBottom,          0, "Bottom offset for window conformance mode 3")
    120124    ("HorizontalPadding,-pdx",m_aiPad[0],      0, "horizontal source padding for cropping mode 2")
    121125    ("VerticalPadding,-pdy",  m_aiPad[1],      0, "vertical source padding for cropping mode 2")
     
    162166  printf("Reconstruction File           : %s\n", m_cReconFile.c_str()  );
    163167#if REPN_FORMAT_IN_VPS
    164   printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - ( m_confLeft + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );
     168  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - ( m_confWinLeft + m_confWinRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confWinTop + m_confWinBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );
    165169#else
    166   printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
     170  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate );
    167171#endif
    168172  printf("Internal Format               : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
     
    207211    {
    208212      // no cropping or padding
    209       m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
     213      m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
    210214      m_aiPad[1] = m_aiPad[0] = 0;
    211215      break;
     
    221225      if (m_iSourceWidth % minCuSize)
    222226      {
    223         m_aiPad[0] = m_confRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
    224         m_iSourceWidth  += m_confRight;
    225 #if REPN_FORMAT_IN_VPS
    226         m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
     227        m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
     228        m_iSourceWidth  += m_confWinRight;
     229#if REPN_FORMAT_IN_VPS
     230        m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
    227231#endif
    228232      }
    229233      if (m_iSourceHeight % minCuSize)
    230234      {
    231         m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
    232         m_iSourceHeight += m_confBottom;
     235        m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
     236        m_iSourceHeight += m_confWinBottom;
    233237        if ( isField )
    234238        {
    235           m_iSourceHeightOrg += m_confBottom << 1;
    236           m_aiPad[1] = m_confBottom << 1;
     239          m_iSourceHeightOrg += m_confWinBottom << 1;
     240          m_aiPad[1] = m_confWinBottom << 1;
    237241        }
    238242#if REPN_FORMAT_IN_VPS
    239         m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
     243        m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
    240244#endif
    241245      }
     
    247251      m_iSourceWidth  += m_aiPad[0];
    248252      m_iSourceHeight += m_aiPad[1];
    249       m_confRight  = m_aiPad[0];
    250       m_confBottom = m_aiPad[1];
    251 #if REPN_FORMAT_IN_VPS
    252       m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
    253       m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
     253      m_confWinRight  = m_aiPad[0];
     254      m_confWinBottom = m_aiPad[1];
     255#if REPN_FORMAT_IN_VPS
     256      m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
     257      m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
    254258#endif
    255259      break;
     
    258262    {
    259263      // conformance
    260       if ((m_confLeft == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))
     264      if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0))
    261265      {
    262266        fprintf(stderr, "Warning: Cropping enabled, but all cropping parameters set to zero\n");
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r820 r823  
    3535  Int       m_iSourceHeightOrg;                               ///< original source height in pixel (when interlaced = frame height)
    3636  Int       m_conformanceMode;
    37   Int       m_confLeft;
    38   Int       m_confRight;
    39   Int       m_confTop;
    40   Int       m_confBottom;
     37  Int       m_confWinLeft;
     38  Int       m_confWinRight;
     39  Int       m_confWinTop;
     40  Int       m_confWinBottom;
    4141  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
    4242  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
     
    136136  Int*    getPad()                    {return m_aiPad;            }
    137137  Double  getFloatQP()                {return m_fQP;              }
    138   Int     getConfLeft()               {return m_confLeft;         }
    139   Int     getConfRight()              {return m_confRight;        }
    140   Int     getConfTop()                {return m_confTop;          }
    141   Int     getConfBottom()             {return m_confBottom;       }
     138  Int     getConfWinLeft()            {return m_confWinLeft;         }
     139  Int     getConfWinRight()           {return m_confWinRight;        }
     140  Int     getConfWinTop()             {return m_confWinTop;          }
     141  Int     getConfWinBottom()          {return m_confWinBottom;       }
    142142#if AUXILIARY_PICTURES
    143143  ChromaFormat getInputChromaFormat()   {return m_InputChromaFormat;}
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r820 r823  
    213213    m_acTEncTop[layer].setSourceWidth                  ( m_acLayerCfg[layer].getSourceWidth() );
    214214    m_acTEncTop[layer].setSourceHeight                 ( m_acLayerCfg[layer].getSourceHeight() );
    215     m_acTEncTop[layer].setConformanceMode              ( m_acLayerCfg[layer].getConformanceMode() );
    216     m_acTEncTop[layer].setConformanceWindow            ( m_acLayerCfg[layer].m_confLeft, m_acLayerCfg[layer].m_confRight, m_acLayerCfg[layer].m_confTop, m_acLayerCfg[layer].m_confBottom );
     215    m_acTEncTop[layer].setConformanceWindow            ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom );
    217216    m_acTEncTop[layer].setFramesToBeEncoded            ( m_framesToBeEncoded );
    218217
     
    542541    m_acTEncTop[layer].setIlcIdc( m_ilcIdc );
    543542#endif
    544     m_acTEncTop[layer].setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    545     m_acTEncTop[layer].setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
    546     m_acTEncTop[layer].setNumRowsMinus1              ( m_iNumRowsMinus1 );
    547     if(m_iUniformSpacingIdr==0)
    548     {
    549       m_acTEncTop[layer].setColumnWidth              ( m_pColumnWidth );
    550       m_acTEncTop[layer].setRowHeight                ( m_pRowHeight );
     543    m_acTEncTop[layer].setTileUniformSpacingFlag     ( m_tileUniformSpacingFlag );
     544    m_acTEncTop[layer].setNumColumnsMinus1           ( m_numTileColumnsMinus1 );
     545    m_acTEncTop[layer].setNumRowsMinus1              ( m_numTileRowsMinus1 );
     546    if(!m_tileUniformSpacingFlag)
     547    {
     548      m_acTEncTop[layer].setColumnWidth              ( m_tileColumnWidth );
     549      m_acTEncTop[layer].setRowHeight                ( m_tileRowHeight );
    551550    }
    552551    m_acTEncTop[layer].xCheckGSParameters();
    553     Int uiTilesCount          = (m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);
     552    Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1);
    554553    if(uiTilesCount == 1)
    555554    {
     
    586585    m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled );
    587586    m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag );
     587    m_acTEncTop[layer].setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag);
    588588    m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc );
    589589    m_acTEncTop[layer].setSarWidth( m_sarWidth );
     
    685685  m_cTEncTop.setSourceWidth                  ( m_iSourceWidth );
    686686  m_cTEncTop.setSourceHeight                 ( m_iSourceHeight );
    687   m_cTEncTop.setConformanceWindow            ( m_confLeft, m_confRight, m_confTop, m_confBottom );
     687  m_cTEncTop.setConformanceWindow            ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom );
    688688  m_cTEncTop.setFramesToBeEncoded            ( m_framesToBeEncoded );
    689689
     
    870870  m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
    871871  m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
    872   m_cTEncTop.setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    873   m_cTEncTop.setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
    874   m_cTEncTop.setNumRowsMinus1              ( m_iNumRowsMinus1 );
    875   if(m_iUniformSpacingIdr==0)
    876   {
    877     m_cTEncTop.setColumnWidth              ( m_pColumnWidth );
    878     m_cTEncTop.setRowHeight                ( m_pRowHeight );
     872  m_cTEncTop.setTileUniformSpacingFlag     ( m_tileUniformSpacingFlag );
     873  m_cTEncTop.setNumColumnsMinus1           ( m_numTileColumnsMinus1 );
     874  m_cTEncTop.setNumRowsMinus1              ( m_numTileRowsMinus1 );
     875  if(!m_tileUniformSpacingFlag)
     876  {
     877    m_cTEncTop.setColumnWidth              ( m_tileColumnWidth );
     878    m_cTEncTop.setRowHeight                ( m_tileRowHeight );
    879879  }
    880880  m_cTEncTop.xCheckGSParameters();
    881   Int uiTilesCount          = (m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);
     881  Int uiTilesCount          = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1);
    882882  if(uiTilesCount == 1)
    883883  {
     
    904904  m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled );
    905905  m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag );
     906  m_cTEncTop.setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag);
    906907  m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc );
    907908  m_cTEncTop.setSarWidth( m_sarWidth );
     
    21282129      {
    21292130#if REPN_FORMAT_IN_VPS
    2130         m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,
    2131           m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal, m_isTopFieldFirst );
    2132 #else
    2133         m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst );
     2131        m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,
     2132          m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, m_isTopFieldFirst );
     2133#else
     2134        m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom(), m_isTopFieldFirst );
    21342135#endif
    21352136      }
     
    21572158      {
    21582159#if REPN_FORMAT_IN_VPS
    2159         m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,
    2160           m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal );
    2161 #else
    2162         m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(),
    2163           m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() );
     2160        m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,
     2161          m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal );
     2162#else
     2163        m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(),
     2164          m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom() );
    21642165#endif
    21652166      }
     
    22692270      if (m_pchReconFile)
    22702271      {
    2271         m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst );
     2272        m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_isTopFieldFirst );
    22722273      }
    22732274
     
    22842285  {
    22852286    Int i;
    2286 
    22872287    TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end();
    22882288    list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin();
     
    22982298      if (m_pchReconFile)
    22992299      {
    2300         m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom );
     2300        m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom );
    23012301      }
    23022302
Note: See TracChangeset for help on using the changeset viewer.