Changeset 823 in SHVCSoftware for branches/SHM-dev


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

update to HM-15.0

Location:
branches/SHM-dev/source
Files:
21 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
  • branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h

    r815 r823  
    5858#if SVC_EXTENSION
    5959#include <vector>
    60 #define NV_VERSION        "6.1 (HM-14.0)"                 ///< Current software version
     60#define NV_VERSION        "6.1 (HM-15.0)"                 ///< Current software version
    6161#else
    62 #define NV_VERSION        "14.0"                ///< Current software version
     62#define NV_VERSION        "15.0"                ///< Current software version
    6363#endif
    6464
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r815 r823  
    199199  UInt m_bpSeqParameterSetId;
    200200  Bool m_rapCpbParamsPresentFlag;
    201   Bool m_cpbDelayOffset;
    202   Bool m_dpbDelayOffset;
     201  UInt m_cpbDelayOffset;
     202  UInt m_dpbDelayOffset;
    203203  UInt m_initialCpbRemovalDelay         [MAX_CPB_CNT][2];
    204204  UInt m_initialCpbRemovalDelayOffset   [MAX_CPB_CNT][2];
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp

    r595 r823  
    3838#include "TComPicSym.h"
    3939#include "TComSampleAdaptiveOffset.h"
     40#include "TComSlice.h"
    4041
    4142//! \ingroup TLibCommon
     
    6364,m_iNumColumnsMinus1 (0)
    6465,m_iNumRowsMinus1(0)
    65 ,m_apcTComTile(NULL)
    6666,m_puiCUOrderMap(0)
    6767,m_puiTileIdxMap(NULL)
     
    101101    delete [] m_apcTComSlice;
    102102  }
    103   m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame*m_uiNumPartitions]; 
     103  m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame];
    104104  m_apcTComSlice[0]   = new TComSlice;
    105105  m_uiNumAllocatedSlice = 1;
     
    152152  delete [] m_apcTComDataCU;
    153153  m_apcTComDataCU = NULL;
    154 
    155 #if SVC_EXTENSION
    156   if( m_apcTComTile )
    157   {
    158 #endif
    159   for(Int i = 0; i < (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
    160   {
    161     delete m_apcTComTile[i];
    162   }
    163   delete [] m_apcTComTile;
    164 #if SVC_EXTENSION
    165   }
    166 #endif
    167 
    168   m_apcTComTile = NULL;
    169154
    170155  delete [] m_puiCUOrderMap;
     
    193178Void TComPicSym::allocateNewSlice()
    194179{
     180  assert ((m_uiNumAllocatedSlice + 1) <= m_uiNumCUsInFrame);
    195181  m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice;
    196182  if (m_uiNumAllocatedSlice>=2)
     
    225211}
    226212
    227 Void TComPicSym::xCreateTComTileArray()
    228 {
    229   m_apcTComTile = new TComTile*[(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)];
    230   for( UInt i=0; i<(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
    231   {
    232     m_apcTComTile[i] = new TComTile;
    233   }
    234 }
    235 
    236 Void TComPicSym::xInitTiles()
    237 {
    238   UInt  uiTileIdx;
    239   UInt  uiColumnIdx = 0;
    240   UInt  uiRowIdx = 0;
    241   UInt  uiRightEdgePosInCU;
    242   UInt  uiBottomEdgePosInCU;
    243   Int   i, j;
     213Void TComPicSym::initTiles(TComPPS *pps)
     214{
     215  //set NumColumnsMinus1 and NumRowsMinus1
     216  setNumColumnsMinus1( pps->getNumTileColumnsMinus1() );
     217  setNumRowsMinus1( pps->getTileNumRowsMinus1() );
     218
     219  const Int numCols = pps->getNumTileColumnsMinus1() + 1;
     220  const Int numRows = pps->getTileNumRowsMinus1() + 1;
     221  const Int numTiles = numRows * numCols;
     222
     223  // allocate memory for tile parameters
     224  m_tileParameters.resize(numTiles);
     225
     226  if( pps->getTileUniformSpacingFlag() )
     227  {
     228    //set width and height for each (uniform) tile
     229    for(Int row=0; row < numRows; row++)
     230  {
     231      for(Int col=0; col < numCols; col++)
     232      {
     233        const Int tileIdx = row * numCols + col;
     234        m_tileParameters[tileIdx].setTileWidth( (col+1)*getFrameWidthInCU()/numCols
     235                                              - (col*getFrameWidthInCU())/numCols );
     236        m_tileParameters[tileIdx].setTileHeight( (row+1)*getFrameHeightInCU()/numRows
     237                                               - (row*getFrameHeightInCU())/numRows );
     238      }
     239    }
     240  }
     241  else
     242  {
     243    //set the width for each tile
     244    for(Int row=0; row < numRows; row++)
     245    {
     246      Int cumulativeTileWidth = 0;
     247      for(Int col=0; col < getNumColumnsMinus1(); col++)
     248      {
     249        m_tileParameters[row * numCols + col].setTileWidth( pps->getTileColumnWidth(col) );
     250        cumulativeTileWidth += pps->getTileColumnWidth(col);
     251      }
     252      m_tileParameters[row * numCols + getNumColumnsMinus1()].setTileWidth( getFrameWidthInCU()-cumulativeTileWidth );
     253  }
     254
     255    //set the height for each tile
     256    for(Int col=0; col < numCols; col++)
     257    {
     258      Int cumulativeTileHeight = 0;
     259      for(Int row=0; row < getNumRowsMinus1(); row++)
     260      {
     261        m_tileParameters[row * numCols + col].setTileHeight( pps->getTileRowHeight(row) );
     262        cumulativeTileHeight += pps->getTileRowHeight(row);
     263      }
     264      m_tileParameters[getNumRowsMinus1() * numCols + col].setTileHeight( getFrameHeightInCU()-cumulativeTileHeight );
     265    }
     266  }
     267
     268#if TILE_SIZE_CHECK
     269  Int minWidth  = 1;
     270  Int minHeight = 1;
     271  const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc();
     272  if (  profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10)
     273  {
     274    if (pps->getTilesEnabledFlag())
     275    {
     276      minHeight = 64  / g_uiMaxCUHeight;
     277      minWidth  = 256 / g_uiMaxCUWidth;
     278    }
     279  }
     280  for(Int row=0; row < numRows; row++)
     281  {
     282    for(Int col=0; col < numCols; col++)
     283    {
     284      const Int tileIdx = row * numCols + col;
     285      assert (m_tileParameters[tileIdx].getTileWidth() >= minWidth);
     286      assert (m_tileParameters[tileIdx].getTileHeight() >= minHeight);
     287    }
     288  }
     289#endif
    244290
    245291  //initialize each tile of the current picture
    246   for( uiRowIdx=0; uiRowIdx < m_iNumRowsMinus1+1; uiRowIdx++ )
    247   {
    248     for( uiColumnIdx=0; uiColumnIdx < m_iNumColumnsMinus1+1; uiColumnIdx++ )
    249     {
    250       uiTileIdx = uiRowIdx * (m_iNumColumnsMinus1+1) + uiColumnIdx;
     292  for( Int row=0; row < numRows; row++ )
     293  {
     294    for( Int col=0; col < numCols; col++ )
     295    {
     296      const Int tileIdx = row * numCols + col;
    251297
    252298      //initialize the RightEdgePosInCU for each tile
    253       uiRightEdgePosInCU = 0;
    254       for( i=0; i <= uiColumnIdx; i++ )
    255       {
    256         uiRightEdgePosInCU += this->getTComTile(uiRowIdx * (m_iNumColumnsMinus1+1) + i)->getTileWidth();
    257       }
    258       this->getTComTile(uiTileIdx)->setRightEdgePosInCU(uiRightEdgePosInCU-1);
     299      Int rightEdgePosInCTU = 0;
     300      for( Int i=0; i <= col; i++ )
     301      {
     302        rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidth();
     303      }
     304      m_tileParameters[tileIdx].setRightEdgePosInCU(rightEdgePosInCTU-1);
    259305
    260306      //initialize the BottomEdgePosInCU for each tile
    261       uiBottomEdgePosInCU = 0;
    262       for( i=0; i <= uiRowIdx; i++ )
    263       {
    264         uiBottomEdgePosInCU += this->getTComTile(i * (m_iNumColumnsMinus1+1) + uiColumnIdx)->getTileHeight();
    265       }
    266       this->getTComTile(uiTileIdx)->setBottomEdgePosInCU(uiBottomEdgePosInCU-1);
     307      Int bottomEdgePosInCTU = 0;
     308      for( Int i=0; i <= row; i++ )
     309      {
     310        bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeight();
     311      }
     312      m_tileParameters[tileIdx].setBottomEdgePosInCU(bottomEdgePosInCTU-1);
    267313
    268314      //initialize the FirstCUAddr for each tile
    269       this->getTComTile(uiTileIdx)->setFirstCUAddr( (this->getTComTile(uiTileIdx)->getBottomEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileHeight() +1)*m_uiWidthInCU +
    270         this->getTComTile(uiTileIdx)->getRightEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileWidth() + 1);
    271     }
    272   }
     315      m_tileParameters[tileIdx].setFirstCUAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCU() - m_tileParameters[tileIdx].getTileHeight() + 1) * getFrameWidthInCU() +
     316                                                 m_tileParameters[tileIdx].getRightEdgePosInCU() - m_tileParameters[tileIdx].getTileWidth() + 1);
     317    }
     318  }
     319
     320  Int  columnIdx = 0;
     321  Int  rowIdx = 0;
    273322
    274323  //initialize the TileIdxMap
    275   for( i=0; i<m_uiNumCUsInFrame; i++)
    276   {
    277     for(j=0; j < m_iNumColumnsMinus1+1; j++)
    278     {
    279       if(i % m_uiWidthInCU <= this->getTComTile(j)->getRightEdgePosInCU())
    280       {
    281         uiColumnIdx = j;
    282         j = m_iNumColumnsMinus1+1;
    283       }
    284     }
    285     for(j=0; j < m_iNumRowsMinus1+1; j++)
    286     {
    287       if(i/m_uiWidthInCU <= this->getTComTile(j*(m_iNumColumnsMinus1 + 1))->getBottomEdgePosInCU())
    288       {
    289         uiRowIdx = j;
    290         j = m_iNumRowsMinus1 + 1;
    291       }
    292     }
    293     m_puiTileIdxMap[i] = uiRowIdx * (m_iNumColumnsMinus1 + 1) + uiColumnIdx;
    294   }
    295 
     324  for( Int i=0; i<m_uiNumCUsInFrame; i++)
     325  {
     326    for( Int col=0; col < numCols; col++)
     327    {
     328      if(i % getFrameWidthInCU() <= m_tileParameters[col].getRightEdgePosInCU())
     329      {
     330        columnIdx = col;
     331        break;
     332      }
     333    }
     334    for(Int row=0; row < numRows; row++)
     335    {
     336      if(i / getFrameWidthInCU() <= m_tileParameters[row*numCols].getBottomEdgePosInCU())
     337      {
     338        rowIdx = row;
     339        break;
     340      }
     341    }
     342    m_puiTileIdxMap[i] = rowIdx * numCols + columnIdx;
     343  }
    296344}
    297345
     
    441489
    442490TComTile::TComTile()
     491: m_uiTileWidth         (0)
     492, m_uiTileHeight        (0)
     493, m_uiRightEdgePosInCU  (0)
     494, m_uiBottomEdgePosInCU (0)
     495, m_uiFirstCUAddr       (0)
     496
    443497{
    444498}
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h

    r820 r823  
    4545#include "TComDataCU.h"
    4646class TComSampleAdaptiveOffset;
     47class TComPPS;
    4748
    4849//! \ingroup TLibCommon
     
    102103  Int           m_iNumColumnsMinus1;
    103104  Int           m_iNumRowsMinus1;
    104   TComTile**    m_apcTComTile;
     105  std::vector<TComTile> m_tileParameters;
    105106  UInt*         m_puiCUOrderMap;       //the map of LCU raster scan address relative to LCU encoding order
    106107  UInt*         m_puiTileIdxMap;       //the map of the tile index relative to LCU raster scan address
     
    142143  Int          getNumRowsMinus1()                                    { return m_iNumRowsMinus1; }
    143144  Int          getNumTiles()                                         { return (m_iNumRowsMinus1+1)*(m_iNumColumnsMinus1+1); }
    144   TComTile*    getTComTile  ( UInt tileIdx )                         { return *(m_apcTComTile + tileIdx); }
     145  TComTile*    getTComTile  ( UInt tileIdx )                         { return &(m_tileParameters[tileIdx]); }
    145146  Void         setCUOrderMap( Int encCUOrder, Int cuAddr )           { *(m_puiCUOrderMap + encCUOrder) = cuAddr; }
    146147  UInt         getCUOrderMap( Int encCUOrder )                       { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); }
     
    150151  UInt         getPicSCUEncOrder( UInt SCUAddr );
    151152  UInt         getPicSCUAddr( UInt SCUEncOrder );
    152   Void         xCreateTComTileArray();
    153   Void         xInitTiles();
     153  Void         initTiles(TComPPS *pps);
    154154  UInt         xCalculateNxtCUAddr( UInt uiCurrCUAddr );
    155155  SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;}
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r821 r823  
    32203220, m_entropyCodingSyncEnabledFlag   (false)
    32213221, m_loopFilterAcrossTilesEnabledFlag  (true)
    3222 , m_uniformSpacingFlag           (0)
    3223 , m_iNumColumnsMinus1            (0)
    3224 , m_puiColumnWidth               (NULL)
    3225 , m_iNumRowsMinus1               (0)
    3226 , m_puiRowHeight                 (NULL)
    3227 , m_iNumSubstreams             (1)
     3222, m_uniformSpacingFlag           (false)
     3223, m_numTileColumnsMinus1         (0)
     3224, m_numTileRowsMinus1            (0)
     3225, m_numSubstreams               (1)
    32283226, m_signHideFlag(0)
    32293227, m_cabacInitPresentFlag        (false)
     
    32553253TComPPS::~TComPPS()
    32563254{
    3257   if( m_iNumColumnsMinus1 > 0 && m_uniformSpacingFlag == 0 )
    3258   {
    3259     if (m_puiColumnWidth) delete [] m_puiColumnWidth;
    3260     m_puiColumnWidth = NULL;
    3261   }
    3262   if( m_iNumRowsMinus1 > 0 && m_uniformSpacingFlag == 0 )
    3263   {
    3264     if (m_puiRowHeight) delete [] m_puiRowHeight;
    3265     m_puiRowHeight = NULL;
    3266   }
    3267 
    32683255#if SCALINGLIST_INFERRING
    32693256  if( !m_inferScalingListFlag )
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r821 r823  
    17611761 
    17621762  Bool     m_loopFilterAcrossTilesEnabledFlag;
    1763   Int      m_uniformSpacingFlag;
    1764   Int      m_iNumColumnsMinus1;
    1765   UInt*    m_puiColumnWidth;
    1766   Int      m_iNumRowsMinus1;
    1767   UInt*    m_puiRowHeight;
    1768 
    1769   Int      m_iNumSubstreams;
     1763  Bool             m_uniformSpacingFlag;
     1764  Int              m_numTileColumnsMinus1;
     1765  Int              m_numTileRowsMinus1;
     1766  std::vector<Int> m_tileColumnWidth;
     1767  std::vector<Int> m_tileRowHeight;
     1768
     1769  Int      m_numSubstreams;
    17701770
    17711771  Int      m_signHideFlag;
     
    18551855  Bool    getDependentSliceSegmentsEnabledFlag() const     { return m_dependentSliceSegmentsEnabledFlag; }
    18561856  Void    setDependentSliceSegmentsEnabledFlag(Bool val)   { m_dependentSliceSegmentsEnabledFlag = val; }
    1857   Bool    getTilesEnabledFlag() const                      { return m_tilesEnabledFlag; }
    1858   Void    setTilesEnabledFlag(Bool val)                    { m_tilesEnabledFlag = val; }
    18591857  Bool    getEntropyCodingSyncEnabledFlag() const          { return m_entropyCodingSyncEnabledFlag; }
    18601858  Void    setEntropyCodingSyncEnabledFlag(Bool val)        { m_entropyCodingSyncEnabledFlag = val; }
    1861   Void     setUniformSpacingFlag            ( Bool b )          { m_uniformSpacingFlag = b; }
    1862   Bool     getUniformSpacingFlag            ()                  { return m_uniformSpacingFlag; }
    1863   Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
    1864   Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
    1865   Void     setColumnWidth ( UInt* columnWidth )
    1866   {
    1867     if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 )
    1868     {
    1869       m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
    1870 
    1871       for(Int i=0; i<m_iNumColumnsMinus1; i++)
    1872       {
    1873         m_puiColumnWidth[i] = columnWidth[i];
    1874       }
    1875     }
    1876   }
    1877   UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
    1878   Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
    1879   Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
    1880   Void     setRowHeight    ( UInt* rowHeight )
    1881   {
    1882     if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 )
    1883     {
    1884       m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
    1885 
    1886       for(Int i=0; i<m_iNumRowsMinus1; i++)
    1887       {
    1888         m_puiRowHeight[i] = rowHeight[i];
    1889       }
    1890     }
    1891   }
    1892   UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
    1893   Void     setNumSubstreams(Int iNumSubstreams)               { m_iNumSubstreams = iNumSubstreams; }
    1894   Int      getNumSubstreams()                                 { return m_iNumSubstreams; }
     1859
     1860  Void     setTilesEnabledFlag       (Bool val)                             { m_tilesEnabledFlag = val; }
     1861  Bool     getTilesEnabledFlag       () const                               { return m_tilesEnabledFlag; }
     1862  Void     setTileUniformSpacingFlag (Bool b)                               { m_uniformSpacingFlag = b; }
     1863  Bool     getTileUniformSpacingFlag () const                               { return m_uniformSpacingFlag; }
     1864  Void     setNumTileColumnsMinus1   (Int i)                                { m_numTileColumnsMinus1 = i; }
     1865  Int      getNumTileColumnsMinus1   () const                               { return m_numTileColumnsMinus1; }
     1866  Void     setTileColumnWidth        (const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
     1867  UInt     getTileColumnWidth        (UInt columnIdx) const                 { return  m_tileColumnWidth[columnIdx]; }
     1868  Void     setNumTileRowsMinus1      (Int i)                                { m_numTileRowsMinus1 = i; }
     1869  Int      getTileNumRowsMinus1      () const                               { return m_numTileRowsMinus1; }
     1870  Void     setTileRowHeight          (const std::vector<Int>& rowHeight)    { m_tileRowHeight = rowHeight;  }
     1871  UInt     getTileRowHeight          (UInt rowIdx) const                    { return m_tileRowHeight[rowIdx]; }
     1872
     1873  Void     setNumSubstreams    (Int numSubstreams)                     { m_numSubstreams = numSubstreams; }
     1874  Int      getNumSubstreams    ()                                      { return m_numSubstreams; }
    18951875
    18961876  Void      setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r820 r823  
    271271
    272272#define SAO_SGN_FUNC 1
     273
     274#define TILE_SIZE_CHECK 1
    273275
    274276#define FIX1172 1 ///< fix ticket #1172
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r815 r823  
    255255  if( pcPPS->getTilesEnabledFlag() )
    256256  {
    257     READ_UVLC ( uiCode, "num_tile_columns_minus1" );                pcPPS->setNumColumnsMinus1( uiCode );
    258     READ_UVLC ( uiCode, "num_tile_rows_minus1" );                   pcPPS->setNumRowsMinus1( uiCode );
    259     READ_FLAG ( uiCode, "uniform_spacing_flag" );                   pcPPS->setUniformSpacingFlag( uiCode );
    260 
    261     if( !pcPPS->getUniformSpacingFlag())
    262     {
    263       UInt* columnWidth = (UInt*)malloc(pcPPS->getNumColumnsMinus1()*sizeof(UInt));
    264       for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++)
     257    READ_UVLC ( uiCode, "num_tile_columns_minus1" );                pcPPS->setNumTileColumnsMinus1( uiCode ); 
     258    READ_UVLC ( uiCode, "num_tile_rows_minus1" );                   pcPPS->setNumTileRowsMinus1( uiCode ); 
     259    READ_FLAG ( uiCode, "uniform_spacing_flag" );                   pcPPS->setTileUniformSpacingFlag( uiCode == 1 );
     260
     261    if( !pcPPS->getTileUniformSpacingFlag())
     262    {
     263      std::vector<Int> columnWidth(pcPPS->getNumTileColumnsMinus1());
     264      for(UInt i=0; i<pcPPS->getNumTileColumnsMinus1(); i++)
    265265      {
    266266        READ_UVLC( uiCode, "column_width_minus1" );
    267267        columnWidth[i] = uiCode+1;
    268268      }
    269       pcPPS->setColumnWidth(columnWidth);
    270       free(columnWidth);
    271 
    272       UInt* rowHeight = (UInt*)malloc(pcPPS->getNumRowsMinus1()*sizeof(UInt));
    273       for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++)
     269      pcPPS->setTileColumnWidth(columnWidth);
     270
     271      std::vector<Int> rowHeight (pcPPS->getTileNumRowsMinus1());
     272      for(UInt i=0; i<pcPPS->getTileNumRowsMinus1(); i++)
    274273      {
    275274        READ_UVLC( uiCode, "row_height_minus1" );
    276275        rowHeight[i] = uiCode + 1;
    277276      }
    278       pcPPS->setRowHeight(rowHeight);
    279       free(rowHeight);
    280     }
    281 
    282     if(pcPPS->getNumColumnsMinus1() !=0 || pcPPS->getNumRowsMinus1() !=0)
     277      pcPPS->setTileRowHeight(rowHeight);
     278    }
     279
     280    if(pcPPS->getNumTileColumnsMinus1() !=0 || pcPPS->getTileNumRowsMinus1() !=0)
    283281    {
    284282      READ_FLAG ( uiCode, "loop_filter_across_tiles_enabled_flag" );   pcPPS->setLoopFilterAcrossTilesEnabledFlag( uiCode ? true : false );
     
    10251023        READ_FLAG( uiCode, "cprms_present_flag[i]" );               pcVPS->setCprmsPresentFlag( uiCode == 1 ? true : false, i );
    10261024      }
     1025      else
     1026      {
     1027        pcVPS->setCprmsPresentFlag( true, i );
     1028      }
     1029
    10271030      parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
    10281031    }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r822 r823  
    854854  pps->setSPS(sps);
    855855#if REPN_FORMAT_IN_VPS
    856   pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1);
    857 #else
    858   pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1);
     856  pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : 1);
     857#else
     858  pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : 1);
    859859#endif
    860860  pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) );
     
    16511651  Bool bNextSlice     = pcSlice->isNextSlice();
    16521652
    1653   UInt uiCummulativeTileWidth;
    1654   UInt uiCummulativeTileHeight;
    1655   UInt i, j, p;
    1656 
    1657   //set NumColumnsMins1 and NumRowsMinus1
    1658   pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() );
    1659   pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() );
    1660 
    1661   //create the TComTileArray
    1662   pcPic->getPicSym()->xCreateTComTileArray();
    1663 
    1664   if( pcSlice->getPPS()->getUniformSpacingFlag() )
    1665   {
    1666     //set the width for each tile
    1667     for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
    1668     {
    1669       for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1()+1; p++)
    1670       {
    1671         pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->
    1672           setTileWidth( (p+1)*pcPic->getPicSym()->getFrameWidthInCU()/(pcPic->getPicSym()->getNumColumnsMinus1()+1)
    1673           - (p*pcPic->getPicSym()->getFrameWidthInCU())/(pcPic->getPicSym()->getNumColumnsMinus1()+1) );
    1674       }
    1675     }
    1676 
    1677     //set the height for each tile
    1678     for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
    1679     {
    1680       for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1()+1; p++)
    1681       {
    1682         pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->
    1683           setTileHeight( (p+1)*pcPic->getPicSym()->getFrameHeightInCU()/(pcPic->getPicSym()->getNumRowsMinus1()+1)
    1684           - (p*pcPic->getPicSym()->getFrameHeightInCU())/(pcPic->getPicSym()->getNumRowsMinus1()+1) );   
    1685       }
    1686     }
    1687   }
    1688   else
    1689   {
    1690     //set the width for each tile
    1691     for(j=0; j < pcSlice->getPPS()->getNumRowsMinus1()+1; j++)
    1692     {
    1693       uiCummulativeTileWidth = 0;
    1694       for(i=0; i < pcSlice->getPPS()->getNumColumnsMinus1(); i++)
    1695       {
    1696         pcPic->getPicSym()->getTComTile(j * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + i)->setTileWidth( pcSlice->getPPS()->getColumnWidth(i) );
    1697         uiCummulativeTileWidth += pcSlice->getPPS()->getColumnWidth(i);
    1698       }
    1699       pcPic->getPicSym()->getTComTile(j * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + i)->setTileWidth( pcPic->getPicSym()->getFrameWidthInCU()-uiCummulativeTileWidth );
    1700     }
    1701 
    1702     //set the height for each tile
    1703     for(j=0; j < pcSlice->getPPS()->getNumColumnsMinus1()+1; j++)
    1704     {
    1705       uiCummulativeTileHeight = 0;
    1706       for(i=0; i < pcSlice->getPPS()->getNumRowsMinus1(); i++)
    1707       {
    1708         pcPic->getPicSym()->getTComTile(i * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcSlice->getPPS()->getRowHeight(i) );
    1709         uiCummulativeTileHeight += pcSlice->getPPS()->getRowHeight(i);
    1710       }
    1711       pcPic->getPicSym()->getTComTile(i * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcPic->getPicSym()->getFrameHeightInCU()-uiCummulativeTileHeight );
    1712     }
    1713   }
    1714 
    1715   pcPic->getPicSym()->xInitTiles();
     1653  UInt i;
     1654  pcPic->getPicSym()->initTiles(pcSlice->getPPS());
    17161655
    17171656  //generate the Coding Order Map and Inverse Coding Order Map
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r815 r823  
    193193  if( pcPPS->getTilesEnabledFlag() )
    194194  {
    195     WRITE_UVLC( pcPPS->getNumColumnsMinus1(),                                    "num_tile_columns_minus1" );
    196     WRITE_UVLC( pcPPS->getNumRowsMinus1(),                                       "num_tile_rows_minus1" );
    197     WRITE_FLAG( pcPPS->getUniformSpacingFlag(),                                  "uniform_spacing_flag" );
    198     if( pcPPS->getUniformSpacingFlag() == 0 )
    199     {
    200       for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++)
    201       {
    202         WRITE_UVLC( pcPPS->getColumnWidth(i)-1,                                  "column_width_minus1" );
    203       }
    204       for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++)
    205       {
    206         WRITE_UVLC( pcPPS->getRowHeight(i)-1,                                    "row_height_minus1" );
    207       }
    208     }
    209     if(pcPPS->getNumColumnsMinus1() !=0 || pcPPS->getNumRowsMinus1() !=0)
     195    WRITE_UVLC( pcPPS->getNumTileColumnsMinus1(),                                    "num_tile_columns_minus1" );
     196    WRITE_UVLC( pcPPS->getTileNumRowsMinus1(),                                       "num_tile_rows_minus1" );
     197    WRITE_FLAG( pcPPS->getTileUniformSpacingFlag(),                                  "uniform_spacing_flag" );
     198    if( !pcPPS->getTileUniformSpacingFlag() )
     199    {
     200      for(UInt i=0; i<pcPPS->getNumTileColumnsMinus1(); i++)
     201      {
     202        WRITE_UVLC( pcPPS->getTileColumnWidth(i)-1,                                  "column_width_minus1" );
     203      }
     204      for(UInt i=0; i<pcPPS->getTileNumRowsMinus1(); i++)
     205      {
     206        WRITE_UVLC( pcPPS->getTileRowHeight(i)-1,                                    "row_height_minus1" );
     207      }
     208    }
     209    if(pcPPS->getNumTileColumnsMinus1() !=0 || pcPPS->getTileNumRowsMinus1() !=0)
    210210    {
    211211      WRITE_FLAG( pcPPS->getLoopFilterAcrossTilesEnabledFlag()?1 : 0,          "loop_filter_across_tiles_enabled_flag");
     
    340340  if( defaultDisplayWindow.getWindowEnabledFlag() )
    341341  {
    342     WRITE_UVLC(defaultDisplayWindow.getWindowLeftOffset(),      "def_disp_win_left_offset");
    343     WRITE_UVLC(defaultDisplayWindow.getWindowRightOffset(),    "def_disp_win_right_offset");
    344     WRITE_UVLC(defaultDisplayWindow.getWindowTopOffset(),      "def_disp_win_top_offset");
    345     WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset(),    "def_disp_win_bottom_offset");
     342    WRITE_UVLC(defaultDisplayWindow.getWindowLeftOffset()  / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_left_offset");
     343    WRITE_UVLC(defaultDisplayWindow.getWindowRightOffset() / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_right_offset");
     344    WRITE_UVLC(defaultDisplayWindow.getWindowTopOffset()   / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_top_offset");
     345    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset");
    346346  }
    347347  TimingInfo *timingInfo = pcVUI->getTimingInfo();
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r815 r823  
    107107  Int       m_iSourceWidth;
    108108  Int       m_iSourceHeight;
    109   Int       m_conformanceMode;
    110109  Window    m_conformanceWindow;
    111110  Int       m_framesToBeEncoded;
     
    208207  Bool      m_bPCMFilterDisableFlag;
    209208  Bool      m_loopFilterAcrossTilesEnabledFlag;
    210   Int       m_iUniformSpacingIdr;
     209  Bool      m_tileUniformSpacingFlag;
    211210  Int       m_iNumColumnsMinus1;
    212   UInt*     m_puiColumnWidth;
    213211  Int       m_iNumRowsMinus1;
    214   UInt*     m_puiRowHeight;
     212  std::vector<Int> m_tileColumnWidth;
     213  std::vector<Int> m_tileRowHeight;
    215214
    216215  Int       m_iWaveFrontSynchro;
     
    248247  Int*      m_codedPivotValue;
    249248  Int*      m_targetPivotValue;
    250 #if P0050_KNEE_FUNCTION_SEI
    251   Bool      m_kneeSEIEnabled;
    252   Int       m_kneeSEIId;
    253   Bool      m_kneeSEICancelFlag;
    254   Bool      m_kneeSEIPersistenceFlag;
    255   Bool      m_kneeSEIMappingFlag;
    256   Int       m_kneeSEIInputDrange;
    257   Int       m_kneeSEIInputDispLuminance;
    258   Int       m_kneeSEIOutputDrange;
    259   Int       m_kneeSEIOutputDispLuminance;
    260   Int       m_kneeSEINumKneePointsMinus1;
    261   Int*      m_kneeSEIInputKneePoint;
    262   Int*      m_kneeSEIOutputKneePoint;
    263 #endif
    264 #if Q0074_SEI_COLOR_MAPPING
    265   Char*     m_seiColorMappingFile;
    266 #endif
    267249  Int       m_framePackingSEIEnabled;
    268250  Int       m_framePackingSEIType;
     
    276258  Int       m_SOPDescriptionSEIEnabled;
    277259  Int       m_scalableNestingSEIEnabled;
    278 #if Q0189_TMVP_CONSTRAINTS
    279   Int       m_TMVPConstraintsSEIEnabled;
    280 #endif
    281260  //====== Weighted Prediction ========
    282261  Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
     
    389368  Int  m_nCGSLUTBit;
    390369#endif
     370#if P0050_KNEE_FUNCTION_SEI
     371  Bool      m_kneeSEIEnabled;
     372  Int       m_kneeSEIId;
     373  Bool      m_kneeSEICancelFlag;
     374  Bool      m_kneeSEIPersistenceFlag;
     375  Bool      m_kneeSEIMappingFlag;
     376  Int       m_kneeSEIInputDrange;
     377  Int       m_kneeSEIInputDispLuminance;
     378  Int       m_kneeSEIOutputDrange;
     379  Int       m_kneeSEIOutputDispLuminance;
     380  Int       m_kneeSEINumKneePointsMinus1;
     381  Int*      m_kneeSEIInputKneePoint;
     382  Int*      m_kneeSEIOutputKneePoint;
     383#endif
     384#if Q0074_SEI_COLOR_MAPPING
     385  Char*     m_seiColorMappingFile;
     386#endif
     387#if Q0189_TMVP_CONSTRAINTS
     388  Int       m_TMVPConstraintsSEIEnabled;
     389#endif
    391390#endif //SVC_EXTENSION
    392391
    393392public:
    394393  TEncCfg()
    395   : m_puiColumnWidth()
    396   , m_puiRowHeight()
     394  : m_tileColumnWidth()
     395  , m_tileRowHeight()
    397396  {}
    398397
    399398  virtual ~TEncCfg()
    400   {
    401     delete[] m_puiColumnWidth;
    402     delete[] m_puiRowHeight;
    403   }
     399  {}
    404400 
    405401  Void setProfile(Profile::Name profile) { m_profile = profile; }
     
    437433  Void      setMaxRefPicNum                 ( Int iMaxRefPicNum )           { m_iMaxRefPicNum = iMaxRefPicNum;  }
    438434
    439   Bool      getMaxTempLayer                 ()                              { return m_maxTempLayer;              }
     435  Int       getMaxTempLayer                 ()                              { return m_maxTempLayer;              }
    440436  Void      setMaxTempLayer                 ( Int maxTempLayer )            { m_maxTempLayer = maxTempLayer;      }
    441437  //======== Transform =============
     
    582578  Void  setLFCrossTileBoundaryFlag               ( Bool   val  )       { m_loopFilterAcrossTilesEnabledFlag = val; }
    583579  Bool  getLFCrossTileBoundaryFlag               ()                    { return m_loopFilterAcrossTilesEnabledFlag;   }
    584   Void  setUniformSpacingIdr           ( Int i )           { m_iUniformSpacingIdr = i; }
    585   Int   getUniformSpacingIdr           ()                  { return m_iUniformSpacingIdr; }
     580  Void  setTileUniformSpacingFlag      ( Bool b )          { m_tileUniformSpacingFlag = b; }
     581  Bool  getTileUniformSpacingFlag      ()                  { return m_tileUniformSpacingFlag; }
    586582  Void  setNumColumnsMinus1            ( Int i )           { m_iNumColumnsMinus1 = i; }
    587583  Int   getNumColumnsMinus1            ()                  { return m_iNumColumnsMinus1; }
    588   Void  setColumnWidth ( UInt* columnWidth )
    589   {
    590     if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
    591     {
    592       Int  m_iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;
    593       m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
    594 
    595       for(Int i=0; i<m_iNumColumnsMinus1; i++)
    596       {
    597         m_puiColumnWidth[i] = columnWidth[i];
    598         printf("col: m_iWidthInCU= %4d i=%4d width= %4d\n",m_iWidthInCU,i,m_puiColumnWidth[i]); //AFU
    599       }
    600     }
    601   }
    602   UInt  getColumnWidth                 ( UInt columnidx )  { return *( m_puiColumnWidth + columnidx ); }
     584  Void  setColumnWidth ( const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
     585  UInt  getColumnWidth                 ( UInt columnIdx )      { return m_tileColumnWidth[columnIdx]; }
    603586  Void  setNumRowsMinus1               ( Int i )           { m_iNumRowsMinus1 = i; }
    604587  Int   getNumRowsMinus1               ()                  { return m_iNumRowsMinus1; }
    605   Void  setRowHeight (UInt* rowHeight)
    606   {
    607     if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
    608     {
    609       Int  m_iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;
    610       m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
    611 
    612       for(Int i=0; i<m_iNumRowsMinus1; i++)
    613       {
    614         m_puiRowHeight[i] = rowHeight[i];
    615         printf("row: m_iHeightInCU=%4d i=%4d height=%4d\n",m_iHeightInCU,i,m_puiRowHeight[i]); //AFU
    616       }
    617     }
    618   }
    619   UInt  getRowHeight                   ( UInt rowIdx )     { return *( m_puiRowHeight + rowIdx ); }
     588  Void  setRowHeight ( const std::vector<Int>& rowHeight)      { m_tileRowHeight = rowHeight; }
     589  UInt  getRowHeight                   ( UInt rowIdx )         { return m_tileRowHeight[rowIdx]; }
    620590  Void  xCheckGSParameters();
    621591  Void  setWaveFrontSynchro(Int iWaveFrontSynchro)       { m_iWaveFrontSynchro = iWaveFrontSynchro; }
     
    865835  UInt      getNumLayer           () { return m_numLayer;             } 
    866836  Void      setNumLayer           (UInt uiNum)   { m_numLayer = uiNum;  }
    867   Void      setConformanceMode    (Int mode)     { m_conformanceMode = mode; }
    868837  Void      setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; }
    869838  Void      setElRapSliceTypeB(Int bEnabled) {m_elRapSliceBEnabled = bEnabled;}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r821 r823  
    13921392      if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag())
    13931393      {
    1394 #if !Q0108_TSA_STSA
     1394#if SVC_EXTENSION && !Q0108_TSA_STSA
    13951395        if( pcSlice->getLayerId() > 0 )
    13961396        {
     
    14911491        if(isSTSA==true)
    14921492        {   
    1493 #if !Q0108_TSA_STSA
     1493#if SVC_EXTENSION && !Q0108_TSA_STSA
    14941494          if( pcSlice->getLayerId() > 0 )
    14951495          {
     
    20542054    UInt uiRealEndAddress = uiExternalAddress*pcPic->getNumPartInCU()+uiInternalAddress;
    20552055
    2056     UInt uiCummulativeTileWidth;
    2057     UInt uiCummulativeTileHeight;
    20582056    Int  p, j;
    20592057    UInt uiEncCUAddr;
    20602058
    2061     //set NumColumnsMinus1 and NumRowsMinus1
    2062     pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() );
    2063     pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() );
    2064 
    2065     //create the TComTileArray
    2066     pcPic->getPicSym()->xCreateTComTileArray();
    2067 
    2068     if( pcSlice->getPPS()->getUniformSpacingFlag() == 1 )
    2069     {
    2070       //set the width for each tile
    2071       for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
    2072       {
    2073         for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1()+1; p++)
    2074         {
    2075           pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->
    2076             setTileWidth( (p+1)*pcPic->getPicSym()->getFrameWidthInCU()/(pcPic->getPicSym()->getNumColumnsMinus1()+1)
    2077             - (p*pcPic->getPicSym()->getFrameWidthInCU())/(pcPic->getPicSym()->getNumColumnsMinus1()+1) );
    2078         }
    2079       }
    2080 
    2081       //set the height for each tile
    2082       for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
    2083       {
    2084         for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1()+1; p++)
    2085         {
    2086           pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->
    2087             setTileHeight( (p+1)*pcPic->getPicSym()->getFrameHeightInCU()/(pcPic->getPicSym()->getNumRowsMinus1()+1)
    2088             - (p*pcPic->getPicSym()->getFrameHeightInCU())/(pcPic->getPicSym()->getNumRowsMinus1()+1) );   
    2089         }
    2090       }
    2091     }
    2092     else
    2093     {
    2094       //set the width for each tile
    2095       for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
    2096       {
    2097         uiCummulativeTileWidth = 0;
    2098         for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1(); p++)
    2099         {
    2100           pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->setTileWidth( pcSlice->getPPS()->getColumnWidth(p) );
    2101           uiCummulativeTileWidth += pcSlice->getPPS()->getColumnWidth(p);
    2102         }
    2103         pcPic->getPicSym()->getTComTile(j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p)->setTileWidth( pcPic->getPicSym()->getFrameWidthInCU()-uiCummulativeTileWidth );
    2104       }
    2105 
    2106       //set the height for each tile
    2107       for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
    2108       {
    2109         uiCummulativeTileHeight = 0;
    2110         for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1(); p++)
    2111         {
    2112           pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->setTileHeight( pcSlice->getPPS()->getRowHeight(p) );
    2113           uiCummulativeTileHeight += pcSlice->getPPS()->getRowHeight(p);
    2114         }
    2115         pcPic->getPicSym()->getTComTile(p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcPic->getPicSym()->getFrameHeightInCU()-uiCummulativeTileHeight );
    2116       }
    2117     }
    2118     //intialize each tile of the current picture
    2119     pcPic->getPicSym()->xInitTiles();
     2059    pcPic->getPicSym()->initTiles(pcSlice->getPPS());
    21202060
    21212061#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     
    27832723
    27842724#if SETTING_NO_OUT_PIC_PRIOR
     2725          pcSlice->setNoRaslOutputFlag(false);
    27852726          if (pcSlice->isIRAP())
    27862727          {
     
    27902731            }
    27912732            //the inference for NoOutputPriorPicsFlag
     2733            // KJS: This cannot happen at the encoder
    27922734            if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag())
    27932735            {
     
    36793621  assert (m_iGopSize > 0);
    36803622 
    3681   return;
    3682 }
    3683 
    3684 Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut )
    3685 {
    3686   assert( iNumPicRcvd > 0 );
    3687   //  Exception for the first frame
    3688   if ( iPOCLast == 0 )
    3689   {
    3690     m_iGopSize    = 1;
    3691   }
    3692   else
    3693     m_iGopSize    = m_pcCfg->getGOPSize();
    3694  
    3695   assert (m_iGopSize > 0);
    3696 
    36973623  return;
    36983624}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h

    r815 r823  
    207207protected:
    208208 
    209   Void xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Bool isField );
    210   Void  xInitGOP          ( Int iPOC, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut );
    211   Void  xGetBuffer        ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, Bool isField );
     209  Void  xInitGOP          ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, bool isField );
     210  Void  xGetBuffer        ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, bool isField );
    212211 
    213212  Void  xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit&, Double dEncTime );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r815 r823  
    48964896    if( bCodeChroma )
    48974897    {
     4898      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
     4899      m_pcEntropyCoder->resetBits();
    48984900      m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrMode );
    48994901      m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrU, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_U );
    4900       uiSingleBitsU = m_pcEntropyCoder->getNumberOfWrittenBits() - uiSingleBitsY;
     4902      uiSingleBitsU = m_pcEntropyCoder->getNumberOfWrittenBits();
    49014903     
     4904      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
     4905      m_pcEntropyCoder->resetBits();
    49024906      m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrMode );
    49034907      m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrV, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_V );
    4904       uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits() - ( uiSingleBitsY + uiSingleBitsU );
     4908      uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits();
    49054909    }
    49064910   
     
    49394943      {
    49404944        const Double singleCostY = m_pcRdCost->calcRdCost( uiSingleBitsY, uiNonzeroDistY );
     4945        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    49414946        m_pcEntropyCoder->resetBits();
    49424947        m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_LUMA,     uiTrMode );
     
    49644969    else if( checkTransformSkipY )
    49654970    {
     4971      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    49664972      m_pcEntropyCoder->resetBits();
    49674973      m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_LUMA, uiTrMode );
     
    50155021        {
    50165022          const Double dSingleCostU = m_pcRdCost->calcRdCost( uiSingleBitsU, uiNonzeroDistU );
     5023          m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    50175024          m_pcEntropyCoder->resetBits();
    50185025          m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_U,     uiTrMode );
     
    50405047      else if( checkTransformSkipUV )
    50415048      {
     5049        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    50425050        m_pcEntropyCoder->resetBits();
    50435051        m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_U, uiTrMode );
     
    50845092        {
    50855093          const Double dSingleCostV = m_pcRdCost->calcRdCost( uiSingleBitsV, uiNonzeroDistV );
     5094          m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    50865095          m_pcEntropyCoder->resetBits();
    50875096          m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_V,     uiTrMode );
     
    51095118      else if( checkTransformSkipUV )
    51105119      {
     5120        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
    51115121        m_pcEntropyCoder->resetBits();
    51125122        m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_V, uiTrMode );
     
    52875297      pcCU->setCbfSubParts( uiAbsSumTransformSkipV ? uiSetCbf : 0, TEXT_CHROMA_V, uiAbsPartIdx, pcCU->getDepth(0)+uiTrModeC );
    52885298
    5289       m_pcEntropyCoder->resetBits();
    52905299      uiSingleBitsU = 0;
    52915300      uiSingleBitsV = 0;
     
    52935302      if( uiAbsSumTransformSkipU )
    52945303      {
     5304        m_pcEntropyCoder->resetBits();
    52955305        m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrMode );
    52965306        m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrU, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_U );
     
    53355345      if( uiAbsSumTransformSkipV )
    53365346      {
     5347        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
     5348        m_pcEntropyCoder->resetBits();
    53375349        m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrMode );
    53385350        m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrV, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_V );
    5339         uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits() - uiSingleBitsU;
     5351        uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits();
    53405352
    53415353        curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r815 r823  
    10411041  {
    10421042    TComVUI* pcVUI = m_cSPS.getVuiParameters();
    1043     pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioIdc() != -1);
     1043    pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioInfoPresentFlag());
    10441044    pcVUI->setAspectRatioIdc(getAspectRatioIdc());
    10451045    pcVUI->setSarWidth(getSarWidth());
     
    14771477Void  TEncTop::xInitPPSforTiles()
    14781478{
    1479   m_cPPS.setUniformSpacingFlag( m_iUniformSpacingIdr );
    1480   m_cPPS.setNumColumnsMinus1( m_iNumColumnsMinus1 );
    1481   m_cPPS.setNumRowsMinus1( m_iNumRowsMinus1 );
    1482   if( m_iUniformSpacingIdr == 0 )
    1483   {
    1484     m_cPPS.setColumnWidth( m_puiColumnWidth );
    1485     m_cPPS.setRowHeight( m_puiRowHeight );
     1479  m_cPPS.setTileUniformSpacingFlag( m_tileUniformSpacingFlag );
     1480  m_cPPS.setNumTileColumnsMinus1( m_iNumColumnsMinus1 );
     1481  m_cPPS.setNumTileRowsMinus1( m_iNumRowsMinus1 );
     1482  if( !m_tileUniformSpacingFlag )
     1483  {
     1484    m_cPPS.setTileColumnWidth( m_tileColumnWidth );
     1485    m_cPPS.setTileRowHeight( m_tileRowHeight );
    14861486  }
    14871487  m_cPPS.setLoopFilterAcrossTilesEnabledFlag( m_loopFilterAcrossTilesEnabledFlag );
    14881488
    14891489  // # substreams is "per tile" when tiles are independent.
    1490   if (m_iWaveFrontSynchro
    1491     )
     1490  if (m_iWaveFrontSynchro )
    14921491  {
    14931492    m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));
     
    15151514  }
    15161515
    1517   if( m_iNumColumnsMinus1 && m_iUniformSpacingIdr==0 )
     1516  if( m_iNumColumnsMinus1 && !m_tileUniformSpacingFlag )
    15181517  {
    15191518    for(Int i=0; i<m_iNumColumnsMinus1; i++)
    15201519    {
    1521       uiCummulativeColumnWidth += m_puiColumnWidth[i];
     1520      uiCummulativeColumnWidth += m_tileColumnWidth[i];
    15221521    }
    15231522
     
    15421541  }
    15431542
    1544   if( m_iNumRowsMinus1 && m_iUniformSpacingIdr==0 )
     1543  if( m_iNumRowsMinus1 && !m_tileUniformSpacingFlag )
    15451544  {
    15461545    for(Int i=0; i<m_iNumRowsMinus1; i++)
    1547     {
    1548       uiCummulativeRowHeight += m_puiRowHeight[i];
    1549     }
     1546      uiCummulativeRowHeight += m_tileRowHeight[i];
    15501547
    15511548    if( uiCummulativeRowHeight >= iHeightInCU )
  • branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp

    r595 r823  
    470470  Bool retval = true;
    471471
     472  if ((width==0)||(height==0))
     473  {
     474    printf ("\nWarning: writing %d x %d luma sample output picture!", width, height);
     475  }
     476
    472477  if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0)
    473478  {
     
    567572 
    568573  Bool retval = true;
     574 
     575  if ((width==0)||(height==0))
     576  {
     577    printf ("\nWarning: writing %d x %d luma sample output picture!", width, height);
     578  }
    569579 
    570580  if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0)
Note: See TracChangeset for help on using the changeset viewer.