Changeset 467 in SHVCSoftware for branches


Ignore:
Timestamp:
14 Nov 2013, 00:54:41 (11 years ago)
Author:
seregin
Message:

undelete the code from the previous revision

Location:
branches/SHM-4.0-dev/source
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r466 r467  
    242242        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }       
    243243        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
     244
    244245        m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
    245246
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r466 r467  
    362362  Int*    cfg_IntraPeriod   [MAX_LAYERS];
    363363  Int*    cfg_conformanceMode  [MAX_LAYERS];
     364#if LAYER_CTB
     365  // coding unit (CU) definition
     366  UInt*      cfg_uiMaxCUWidth[MAX_LAYERS];                                   ///< max. CU width in pixel
     367  UInt*      cfg_uiMaxCUHeight[MAX_LAYERS];                                  ///< max. CU height in pixel
     368  UInt*      cfg_uiMaxCUDepth[MAX_LAYERS];                                   ///< max. CU depth
     369 
     370  // transfom unit (TU) definition
     371  UInt*      cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS];
     372  UInt*      cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS];
     373 
     374  UInt*      cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS];
     375  UInt*      cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS];
     376#endif
    364377#if VPS_EXTN_DIRECT_REF_LAYERS
    365378#if M0457_PREDICTION_INDICATIONS
     
    379392  string* cfg_predLayerIdsPtr    [MAX_LAYERS];
    380393#endif
    381 #if SCALED_REF_LAYER_OFFSETS
    382394  string    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
    383395  string    cfg_scaledRefLayerTopOffset [MAX_LAYERS];
     
    390402  string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
    391403  string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
    392 #endif
    393404#if RC_SHVC_HARMONIZATION
    394405  Bool*   cfg_RCEnableRateControl  [MAX_LAYERS];
     
    424435    cfg_IntraPeriod[layer]  = &m_acLayerCfg[layer].m_iIntraPeriod;
    425436    cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode;
     437#if LAYER_CTB
     438    // coding unit (CU) definition
     439    cfg_uiMaxCUWidth[layer]  = &m_acLayerCfg[layer].m_uiMaxCUWidth;
     440    cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight;
     441    cfg_uiMaxCUDepth[layer]  = &m_acLayerCfg[layer].m_uiMaxCUDepth;
     442
     443    // transfom unit (TU) definition.
     444    cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize;
     445    cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize;
     446
     447    cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;
     448    cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;
     449#endif
    426450#if VPS_EXTN_DIRECT_REF_LAYERS
    427451#if M0457_PREDICTION_INDICATIONS
     
    437461    cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
    438462#endif
    439 #if SCALED_REF_LAYER_OFFSETS
    440463    cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets;
    441464    for(Int i = 0; i < MAX_LAYERS; i++)
     
    446469      cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
    447470    }
    448 #endif
    449471#if RC_SHVC_HARMONIZATION
    450472    cfg_RCEnableRateControl[layer]   = &m_acLayerCfg[layer].m_RCEnableRateControl;
     
    477499  string  cfg_tileSets;
    478500#endif
    479 #else
     501#else //SVC_EXTENSION
    480502  string cfg_InputFile;
    481503  string cfg_BitstreamFile;
    482504  string cfg_ReconFile;
    483505  string cfg_dQPFile;
    484 #endif
     506#endif //SVC_EXTENSION
    485507  string cfg_ColumnWidth;
    486508  string cfg_RowHeight;
     
    541563  ("InternalBitDepthC",       m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
    542564#endif
    543 #if SCALED_REF_LAYER_OFFSETS
    544565  ("NumScaledRefLayerOffsets%d",    cfg_numScaledRefLayerOffsets,     0, MAX_LAYERS,  "Number of scaled offset layer sets ")
    545566  ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffsetPtr,  string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
     
    551572  ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
    552573                                                                 " bottom-right luma sample of the EL picture, in units of two luma samples")
    553 #endif
    554574#if O0194_DIFFERENT_BITDEPTH_EL_BL
    555575  ("InputBitDepth%d",       cfg_InputBitDepthY,    8, MAX_LAYERS, "Bit-depth of input file for layer %d")
     
    576596  ("IlSampleOnlyPred%d",       m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")
    577597#endif
    578 #else
     598#else //SVC_EXTENSION
    579599  ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
    580600  ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
     
    597617  ("ConfBottom",            m_confBottom,          0, "Bottom offset for window conformance mode 3")
    598618  ("FrameRate,-fr",         m_iFrameRate,          0, "Frame rate")
    599 #endif
     619#endif //SVC_EXTENSION
    600620
    601621  //Field coding parameters
     
    614634  ("FrameOnly",         m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
    615635
     636#if LAYER_CTB
     637  // Unit definition parameters
     638  ("MaxCUWidth%d",              cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
     639  ("MaxCUHeight%d",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
     640  // todo: remove defaults from MaxCUSize
     641  ("MaxCUSize%d,s%d",           cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
     642  ("MaxCUSize%d,s%d",           cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
     643  ("MaxPartitionDepth%d,h%d",   cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
     644 
     645  ("QuadtreeTULog2MaxSize%d",   cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
     646  ("QuadtreeTULog2MinSize%d",   cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
     647 
     648  ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
     649  ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
     650
     651
     652  // set the same CU realted settings across all the layers if config file parameters are not layer specific
     653  ("MaxCUWidth",              cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
     654  ("MaxCUHeight",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
     655  // todo: remove defaults from MaxCUSize
     656  ("MaxCUSize,s",             cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
     657  ("MaxCUSize,s",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
     658  ("MaxPartitionDepth,h",     cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
     659 
     660  ("QuadtreeTULog2MaxSize",   cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
     661  ("QuadtreeTULog2MinSize",   cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
     662 
     663  ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
     664  ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
     665#else
    616666  // Unit definition parameters
    617667  ("MaxCUWidth",              m_uiMaxCUWidth,             64u)
     
    627677  ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs")
    628678  ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
     679#endif
    629680 
    630681  // Coding structure paramters
     
    9501001  m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str());
    9511002#endif
    952 #else
     1003#else //SVC_EXTENSION
    9531004  m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
    9541005  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    9551006  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    9561007  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    957 #endif
     1008#endif //SVC_EXTENSION
    9581009
    9591010  Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
     
    10141065    m_pRowHeight = NULL;
    10151066  }
    1016 #if SCALED_REF_LAYER_OFFSETS
     1067#if SVC_EXTENSION
    10171068  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    10181069  {
     
    10841135    }
    10851136  }
    1086 #endif
    10871137#if VPS_EXTN_DIRECT_REF_LAYERS
    10881138#if M0457_PREDICTION_INDICATIONS
     
    12141264  }
    12151265#endif
     1266#endif //SVC_EXTENSION
    12161267  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    12171268
     
    14431494 
    14441495  // set global varibles
     1496#if LAYER_CTB
     1497  for(Int layer = 0; layer < MAX_LAYERS; layer++)
     1498  {
     1499    xSetGlobal(layer);
     1500  }
     1501#else
    14451502  xSetGlobal();
     1503#endif
    14461504 
    14471505  // print-out parameters
     
    15101568  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
    15111569  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
     1570#if LAYER_CTB
     1571  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
     1572  {
     1573    xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1,                "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
     1574  }
     1575#else
    15121576  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
     1577#endif
    15131578
    15141579  xConfirmPara( m_cbQpOffset < -12,   "Min. Chroma Cb QP Offset is -12" );
     
    15241589  }
    15251590#endif
     1591#if !LAYER_CTB
    15261592  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
    15271593  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
    15281594  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
    15291595  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
     1596#endif
    15301597#if !SVC_EXTENSION
    15311598  xConfirmPara( (m_iSourceWidth  % (m_uiMaxCUWidth  >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame width must be a multiple of the minimum CU size");
     
    15331600#endif
    15341601 
     1602#if !LAYER_CTB
    15351603  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
    15361604  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
     
    15461614  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
    15471615  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
     1616#endif
    15481617 
    15491618  xConfirmPara(  m_maxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
     
    15931662#endif
    15941663
     1664#if !LAYER_CTB
    15951665  // max CU width and height should be power of 2
    15961666  UInt ui = m_uiMaxCUWidth;
     
    16081678      xConfirmPara( ui != 1 , "Height should be 2^n");
    16091679  }
    1610 
     1680#endif
    16111681
    16121682  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
     
    20052075    Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth;
    20062076    Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight;
     2077#if LAYER_CTB
     2078    Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth;
     2079    Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight;
     2080#endif
    20072081#endif
    20082082  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
     
    22492323/** \todo use of global variables should be removed later
    22502324 */
     2325#if LAYER_CTB
     2326Void TAppEncCfg::xSetGlobal(UInt layerId)
     2327{
     2328  // set max CU width & height
     2329  g_auiLayerMaxCUWidth[layerId]  = m_acLayerCfg[layerId].m_uiMaxCUWidth;
     2330  g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;
     2331 
     2332  // compute actual CU depth with respect to config depth and max transform size
     2333  g_auiLayerAddCUDepth[layerId]  = 0;
     2334  while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] )  ) ) g_auiLayerAddCUDepth[layerId]++;
     2335 
     2336  m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];
     2337  g_auiLayerAddCUDepth[layerId]++;
     2338  g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;
     2339 
     2340#if O0194_DIFFERENT_BITDEPTH_EL_BL
     2341  // set internal bit-depth to constant value to make sure to be updated later
     2342  g_bitDepthY = -1;
     2343  g_bitDepthC = -1;
     2344 
     2345  g_uiPCMBitDepthLuma = -1;
     2346  g_uiPCMBitDepthChroma = -1;
     2347#else
     2348  // set internal bit-depth and constants
     2349  g_bitDepthY = m_internalBitDepthY;
     2350  g_bitDepthC = m_internalBitDepthC;
     2351 
     2352  g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY;
     2353  g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC;
     2354#endif
     2355}
     2356#else
    22512357Void TAppEncCfg::xSetGlobal()
    22522358{
     
    22782384#endif
    22792385}
     2386#endif
    22802387
    22812388Void TAppEncCfg::xPrintParameter()
     
    23312438    printf("Frame index                  : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
    23322439  }
     2440#if !LAYER_CTB
    23332441  printf("CU size / depth              : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
    23342442  printf("RQT trans. size (min / max)  : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
    23352443  printf("Max RQT depth inter          : %d\n", m_uiQuadtreeTUMaxDepthInter);
    23362444  printf("Max RQT depth intra          : %d\n", m_uiQuadtreeTUMaxDepthIntra);
     2445#endif
    23372446  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    23382447  printf("Motion search range          : %d\n", m_iSearchRange );
     
    24222531  printf("CIP:%d ", m_bUseConstrainedIntraPred);
    24232532  printf("SAO:%d ", (m_bUseSAO)?(1):(0));
     2533#if !LAYER_CTB
    24242534  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
     2535#endif
    24252536  printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0));
    24262537
     
    24722583}
    24732584
    2474 #if SCALED_REF_LAYER_OFFSETS
     2585#if SVC_EXTENSION
    24752586Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString)
    24762587{
     
    25052616  }
    25062617}
    2507 #endif
    25082618
    25092619#if FINAL_RPL_CHANGE_N0082
     
    27212831}
    27222832#endif
     2833#endif //SVC_EXTENSION
    27232834//! \}
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h

    r466 r467  
    150150  Int       m_maxTempLayer;                                  ///< Max temporal layer
    151151
     152#if !LAYER_CTB
    152153  // coding unit (CU) definition
    153154  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
     
    161162  UInt      m_uiQuadtreeTUMaxDepthInter;
    162163  UInt      m_uiQuadtreeTUMaxDepthIntra;
     164#endif
    163165 
    164166  // coding tools (bit-depth)
     
    355357#endif
    356358  // internal member functions
     359#if LAYER_CTB
     360  Void  xSetGlobal      (UInt layerId);                       ///< set global variables
     361#else
    357362  Void  xSetGlobal      ();                                   ///< set global variables
     363#endif
    358364  Void  xCheckParameter ();                                   ///< check validity of configuration values
    359365  Void  xPrintParameter ();                                   ///< print configuration values
     
    399405  UInt getInternalBitDepthC()      {return m_internalBitDepthC; }
    400406#endif
     407#if !LAYER_CTB
    401408  UInt getMaxCUWidth()             {return m_uiMaxCUWidth;      }
    402409  UInt getMaxCUHeight()            {return m_uiMaxCUHeight;     }
    403410  UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
     411#endif
    404412  Int  getDecodingRefreshType()    {return m_iDecodingRefreshType; }
    405413  Int  getWaveFrontSynchro()        { return m_iWaveFrontSynchro; }
     
    408416  Char* getBLSyntaxFile()           { return m_BLSyntaxFile;      }
    409417#endif
    410 #if SCALED_REF_LAYER_OFFSETS
    411418  Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
    412 #endif
    413419#if REPN_FORMAT_IN_VPS
    414420  RepFormatCfg* getRepFormatCfg(Int i)  { return &m_repFormatCfg[i]; }
    415421#endif
     422#if LAYER_CTB
     423  Bool getUsePCM()                  { return m_usePCM;               }
     424  UInt getPCMLog2MinSize  ()        { return  m_uiPCMLog2MinSize;    }
     425#endif
    416426#endif
    417427};// END CLASS DEFINITION TAppEncCfg
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r466 r467  
    3838  m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
    3939  m_aiPad[1] = m_aiPad[0] = 0;
    40 #if SCALED_REF_LAYER_OFFSETS
    4140  m_numScaledRefLayerOffsets = 0;
    4241  ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
     
    4443  ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
    4544  ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
    46 #endif
    4745}
    4846
     
    142140  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
    143141  printf("Internal Format               : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
     142#if LAYER_CTB
     143  printf("CU size / depth               : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
     144  printf("RQT trans. size (min / max)   : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
     145  printf("Max RQT depth inter           : %d\n", m_uiQuadtreeTUMaxDepthInter);
     146  printf("Max RQT depth intra           : %d\n", m_uiQuadtreeTUMaxDepthIntra);
     147#endif
    144148  printf("QP                            : %5.2f\n", m_fQP );
    145149  printf("Intra period                  : %d\n", m_iIntraPeriod );
     
    157161#endif
    158162  printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams);
     163#if LAYER_CTB
     164  printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0);
     165#endif
    159166}
    160167
     
    175182    {
    176183      // automatic padding to minimum CU size
     184#if LAYER_CTB
     185      Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);
     186#else
    177187      Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1);
     188#endif
    178189      if (m_iSourceWidth % minCuSize)
    179190      {
     
    240251  }
    241252
     253#if LAYER_CTB
     254  UInt maxCUWidth = m_uiMaxCUWidth;
     255  UInt maxCUHeight = m_uiMaxCUHeight;
     256  UInt maxCUDepth = m_uiMaxCUDepth;
     257#else
    242258  UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth();
    243259  UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight();
    244260  UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth();
     261#endif
    245262  bool check_failed = false; /* abort if there is a fatal configuration problem */
    246263#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
     
    264281
    265282
    266   m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m_cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight() : 1;
     283  m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1;
    267284  xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
    268285  xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" );
     
    279296  xConfirmPara( m_confTop    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
    280297  xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
     298
     299#if LAYER_CTB 
     300  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
     301  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
     302  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
     303  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
     304  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
     305  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
     306  xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth,                                        "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
     307  xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize,                "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
     308  xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
     309  xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
     310  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth  >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." );
     311  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." );
     312  xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1,                                                         "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );
     313  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
     314  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
     315  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
     316
     317  // max CU width and height should be power of 2
     318  UInt ui = m_uiMaxCUWidth;
     319  while(ui)
     320  {
     321    ui >>= 1;
     322    if( (ui & 1) == 1)
     323      xConfirmPara( ui != 1 , "Width should be 2^n");
     324  }
     325  ui = m_uiMaxCUHeight;
     326  while(ui)
     327  {
     328    ui >>= 1;
     329    if( (ui & 1) == 1)
     330      xConfirmPara( ui != 1 , "Height should be 2^n");
     331  }
     332#endif
     333
    281334#undef xConfirmPara
    282335  return check_failed;
    283336}
    284337
    285 #endif
     338#endif //SVC_EXTENSION
    286339
    287340
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r466 r467  
    4343  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
    4444  Double    m_fQP;                                            ///< QP value of key-picture (floating point)
     45#if SVC_EXTENSION
    4546#if VPS_EXTN_DIRECT_REF_LAYERS
    4647#if M0457_PREDICTION_INDICATIONS
     
    5556  Int       *m_predLayerIds;
    5657  Int       m_numActiveRefLayers;
     58#endif
     59
     60#if LAYER_CTB
     61  // coding unit (CU) definition
     62  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
     63  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
     64  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth
     65 
     66  // transfom unit (TU) definition
     67  UInt      m_uiQuadtreeTULog2MaxSize;
     68  UInt      m_uiQuadtreeTULog2MinSize;
     69 
     70  UInt      m_uiQuadtreeTUMaxDepthInter;
     71  UInt      m_uiQuadtreeTUMaxDepthIntra;
    5772#endif
    5873
     
    7085  Int       m_maxTidIlRefPicsPlus1;
    7186#endif
    72 #if SVC_EXTENSION
    7387  Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
    74 #endif
     88#endif //SVC_EXTENSION
    7589
    7690  Int       m_iQP;                                            ///< QP value of key-picture (integer)
     
    7892  Int*      m_aidQP;                                          ///< array of slice QP values
    7993  TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
    80 #if SCALED_REF_LAYER_OFFSETS
     94#if SVC_EXTENSION
    8195  Int       m_numScaledRefLayerOffsets  ;
    8296  Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
     
    8498  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
    8599  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
    86 #endif 
    87100#if FINAL_RPL_CHANGE_N0082
    88101  GOPEntry  m_GOPListLayer[MAX_GOP];                            ///< for layer
     
    99112  Int       m_repFormatIdx;
    100113#endif
     114#endif //SVC_EXTENSION
    101115public:
    102116  TAppEncLayerCfg();
     
    133147  Int     getIntQP()                  {return m_iQP;              }
    134148  Int*    getdQPs()                   {return m_aidQP;            }
     149#if SVC_EXTENSION
    135150#if VPS_EXTN_DIRECT_REF_LAYERS
    136151#if M0457_PREDICTION_INDICATIONS
     
    172187  Int     getMaxTidIlRefPicsPlus1()   { return m_maxTidIlRefPicsPlus1; }
    173188#endif
     189#if LAYER_CTB
     190  UInt getMaxCUWidth()             {return m_uiMaxCUWidth;      }
     191  UInt getMaxCUHeight()            {return m_uiMaxCUHeight;     }
     192  UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
     193#endif
     194#endif //SVC_EXTENSION
    174195}; // END CLASS DEFINITION TAppEncLayerCfg
    175196
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r466 r467  
    375375    m_acTEncTop[layer].setUseRDOQTS                    ( m_useRDOQTS   );
    376376    m_acTEncTop[layer].setRDpenalty                    ( m_rdPenalty );
     377#if LAYER_CTB
     378    m_acTEncTop[layer].setQuadtreeTULog2MaxSize        ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize );
     379    m_acTEncTop[layer].setQuadtreeTULog2MinSize        ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize );
     380    m_acTEncTop[layer].setQuadtreeTUMaxDepthInter      ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter );
     381    m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra      ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra );
     382#else
    377383    m_acTEncTop[layer].setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
    378384    m_acTEncTop[layer].setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
    379385    m_acTEncTop[layer].setQuadtreeTUMaxDepthInter      ( m_uiQuadtreeTUMaxDepthInter );
    380386    m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra      ( m_uiQuadtreeTUMaxDepthIntra );
     387#endif
    381388    m_acTEncTop[layer].setUseFastEnc                   ( m_bUseFastEnc  );
    382389    m_acTEncTop[layer].setUseEarlyCU                   ( m_bUseEarlyCU  );
     
    417424    m_acTEncTop[layer].setSliceSegmentMode        ( m_sliceSegmentMode         );
    418425    m_acTEncTop[layer].setSliceSegmentArgument    ( m_sliceSegmentArgument     );
     426#if LAYER_CTB
     427    Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1);
     428#else
    419429    Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1);
     430#endif
    420431    if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU)
    421432    {
     
    574585    m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
    575586    m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled);
    576 #if SCALED_REF_LAYER_OFFSETS
    577587    if( layer > 0 )
    578588    {
     
    584594      }
    585595    }
    586 #endif
    587596#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    588597    m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange );
     
    590599  }
    591600}
    592 #else
     601#else //SVC_EXTENSION
    593602Void TAppEncTop::xInitLibCfg()
    594603{
     
    864873  m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
    865874}
    866 #endif
     875#endif //SVC_EXTENSION
    867876
    868877Void TAppEncTop::xCreateLib()
     
    875884  for(UInt layer=0; layer<m_numLayers; layer++)
    876885  {
     886#if LAYER_CTB
     887    g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     888    g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
     889    g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
     890    g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
     891#endif
    877892#if O0194_DIFFERENT_BITDEPTH_EL_BL
    878893    //2
     
    901916    m_acTEncTop[layer].create();
    902917  }
    903 #else
     918#else //SVC_EXTENSION
    904919  m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
    905920  m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]);
     
    910925  // Neo Decoder
    911926  m_cTEncTop.create();
    912 #endif
     927#endif //SVC_EXTENSION
    913928}
    914929
     
    922937  for(UInt layer=0; layer<m_numLayers; layer++)
    923938  {
     939#if LAYER_CTB
     940    g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     941    g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
     942    g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
     943    g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
     944#endif
     945
    924946    m_acTVideoIOYuvInputFile[layer].close();
    925947    m_acTVideoIOYuvReconFile[layer].close();
     
    927949    m_acTEncTop[layer].destroy();
    928950  }
    929 #else
     951#else //SVC_EXTENSION
    930952  m_cTVideoIOYuvInputFile.close();
    931953  m_cTVideoIOYuvReconFile.close();
     
    933955  // Neo Decoder
    934956  m_cTEncTop.destroy();
    935 #endif
     957#endif //SVC_EXTENSION
    936958}
    937959
     
    941963  for(UInt layer=0; layer<m_numLayers; layer++)
    942964  {
     965#if LAYER_CTB
     966    g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     967    g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
     968    g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
     969    g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
     970       
     971    memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
     972    memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
     973    memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
     974    memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
     975#endif
    943976#if O0194_DIFFERENT_BITDEPTH_EL_BL
    944977    //3
     
    10581091#endif
    10591092  // Target output layer
    1060 #if VPS_PROFILE_OUTPUT_LAYERS
    10611093  vps->setNumOutputLayerSets(vps->getNumLayerSets());
    10621094  vps->setNumProfileTierLevel(vps->getNumLayerSets());
     
    10671099    vps->setOutputLayerSetIdx(i, i);
    10681100  }
    1069 #else
    1070   vps->setNumOutputLayerSets(1);
    1071   Int lsIdx = 1;
    1072   vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set
    1073 #endif
     1101
    10741102  for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)
    10751103  {
     
    12281256    {
    12291257#if SVC_UPSAMPLING
     1258#if LAYER_CTB
     1259      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );
     1260#else
    12301261      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
     1262#endif
    12311263#else
    12321264      pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     
    12361268    {
    12371269#if SVC_UPSAMPLING
     1270#if LAYER_CTB
     1271      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );
     1272#else
    12381273      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
     1274#endif
    12391275#else
    12401276      pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     
    12711307      for(UInt layer=0; layer<m_numLayers; layer++)
    12721308      {
     1309#if LAYER_CTB
     1310        g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     1311        g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
     1312        g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
     1313        g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
     1314#endif
    12731315#if O0194_DIFFERENT_BITDEPTH_EL_BL
    12741316        //6
     
    13461388      for(UInt layer=0; layer<m_numLayers; layer++)
    13471389      {
     1390#if LAYER_CTB
     1391        g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     1392        g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
     1393        g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
     1394        g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
     1395
     1396        memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
     1397        memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
     1398        memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
     1399        memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
     1400#endif
    13481401#if O0194_DIFFERENT_BITDEPTH_EL_BL
    13491402        //7
     
    16271680
    16281681#if SVC_UPSAMPLING
     1682#if LAYER_CTB
     1683    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );
     1684#else
    16291685    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
     1686#endif
    16301687#else
    16311688    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r466 r467  
    40044004  uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY);
    40054005
     4006#if !LAYER_CTB
    40064007  UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
    4007 
    4008 #if SCALED_REF_LAYER_OFFSETS
     4008#endif
     4009
    40094010  Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
    40104011  Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
    40114012  Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
    40124013  Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    4013 #else
    4014   Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
    4015   Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    4016 #endif
    40174014
    40184015#if N0139_POSITION_ROUNDING_OFFSET
     
    40244021#endif
    40254022
    4026 #if SCALED_REF_LAYER_OFFSETS
    40274023  if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() ||
    40284024       iBX < 0                                        || iBY < 0                                           )
     4025  {
     4026    return NULL;
     4027  }
     4028
     4029#if LAYER_CTB
     4030  UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight();
     4031  UInt baseMaxCUWidth  = cBaseColPic->getPicSym()->getMaxCUWidth();
     4032  UInt baseMinUnitSize = cBaseColPic->getMinCUWidth();
     4033 
     4034  uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth() );
    40294035#else
    4030   if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight())
     4036  uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
    40314037#endif
    4032   {
    4033     return NULL;
    4034   }
    4035 
    4036   uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
    40374038
    40384039  assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());
    40394040
     4041#if LAYER_CTB
     4042  UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;
     4043 
     4044  uiAbsPartIdxBase = g_auiLayerRasterToZscan[cBaseColPic->getLayerId()][uiRasterAddrBase];
     4045#else
    40404046  UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth()
    40414047    + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
    40424048
    40434049  uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase];
     4050#endif
    40444051
    40454052  return cBaseColPic->getCU(uiCUAddrBase);
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicSym.h

    r466 r467  
    126126  TComDataCU*&  getCU( UInt uiCUAddr )  { return m_apcTComDataCU[uiCUAddr];     }
    127127 
     128#if LAYER_CTB
     129  UInt        getMaxCUWidth()           { return m_uiMaxCUWidth;                }
     130  UInt        getMaxCUHeight()          { return m_uiMaxCUHeight;               }
     131#endif
     132
    128133#if AVC_SYNTAX
    129134  UInt        getMaxCUWidth()           { return m_uiMaxCUWidth;                }
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r466 r467  
    9090  Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0);
    9191 
     92#if LAYER_CTB
     93  m_iLumaMarginX    = uiMaxCUWidth  + 16; // for 16-byte alignment
     94  m_iLumaMarginY    = uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
     95#else
    9296  m_iLumaMarginX    = g_uiMaxCUWidth  + 16; // for 16-byte alignment
    9397  m_iLumaMarginY    = g_uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
     98#endif
    9499 
    95100  m_iChromaMarginX  = m_iLumaMarginX>>1;
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.cpp

    r466 r467  
    8686// Data structure related table & variable
    8787// ====================================================================================================================
    88 
     88#if LAYER_CTB
     89UInt g_auiLayerMaxCUWidth[MAX_LAYERS];
     90UInt g_auiLayerMaxCUHeight[MAX_LAYERS];
     91UInt g_auiLayerMaxCUDepth[MAX_LAYERS];
     92UInt g_auiLayerAddCUDepth[MAX_LAYERS];
     93UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     94UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     95UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     96UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     97#endif
    8998UInt g_uiMaxCUWidth  = MAX_CU_SIZE;
    9099UInt g_uiMaxCUHeight = MAX_CU_SIZE;
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.h

    r466 r467  
    8181
    8282// global variable (LCU width/height, max. CU depth)
     83#if LAYER_CTB
     84extern       UInt g_auiLayerMaxCUWidth[MAX_LAYERS];
     85extern       UInt g_auiLayerMaxCUHeight[MAX_LAYERS];
     86extern       UInt g_auiLayerMaxCUDepth[MAX_LAYERS];
     87extern       UInt g_auiLayerAddCUDepth[MAX_LAYERS];
     88extern       UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     89extern       UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     90extern       UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     91extern       UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     92#endif
    8393extern       UInt g_uiMaxCUWidth;
    8494extern       UInt g_uiMaxCUHeight;
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r466 r467  
    109109
    110110  //========== Y component upsampling ===========
    111 #if SCALED_REF_LAYER_OFFSETS
    112111  const Window &scalEL = window;
    113112
     
    119118  Int heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    120119  Int strideEL  = pcUsPic->getStride();
    121 #else
    122   const Window &confBL = pcBasePic->getConformanceWindow();
    123   const Window &confEL = pcUsPic->getConformanceWindow();
    124 
    125   Int widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    126   Int heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    127   Int strideBL  = pcBasePic->getStride();
    128 
    129   Int widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    130   Int heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    131   Int strideEL  = pcUsPic->getStride();
    132 #endif
     120
    133121  Pel* piTempBufY = pcTempPic->getLumaAddr();
    134122  Pel* piSrcBufY  = pcBasePic->getLumaAddr();
     
    243231    widthBL   = pcBasePic->getWidth ();
    244232    heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
    245 #if SCALED_REF_LAYER_OFFSETS
     233
    246234    Int leftStartL = scalEL.getWindowLeftOffset();
    247235    Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
    248236    Int topStartL  = scalEL.getWindowTopOffset();
    249237    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
    250 #if BUGFIX_RESAMPLE
    251238    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    252 #endif
    253 #endif
    254239
    255240#if  N0214_INTERMEDIATE_BUFFER_16BITS
     
    265250    for( i = 0; i < widthEL; i++ )
    266251    {
    267 #if SCALED_REF_LAYER_OFFSETS
    268252      Int x = Clip3( leftStartL, rightEndL - 1, i );
    269253      refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
    270 #else
    271       refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
    272 #endif
    273254      phase    = refPos16 & 15;
    274255      refPos   = refPos16 >> 4;
     
    307288    Int iOffset = 1 << (nShift - 1);
    308289
    309 #if SCALED_REF_LAYER_OFFSETS
    310290    for( j = 0; j < pcTempPic->getHeight(); j++ )
    311 #else
    312     for( j = 0; j < heightEL; j++ )
    313 #endif
    314     {
    315 #if SCALED_REF_LAYER_OFFSETS
     291    {
    316292      Int y = Clip3(topStartL, bottomEndL - 1, j);
    317293      refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
    318 #else
    319       refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
    320 #endif
    321294      phase    = refPos16 & 15;
    322295      refPos   = refPos16 >> 4;
     
    324297
    325298      piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
    326 #if SCALED_REF_LAYER_OFFSETS
    327 #if BUGFIX_RESAMPLE
    328299      Pel* piDstY0 = piDstBufY + j * strideEL;
    329300      piDstY = piDstY0 + leftOffset;
     
    349320        piDstY++;
    350321      }
    351 #else
    352 #if 1 // it should provide identical result
    353       Pel* piDstY0 = piDstBufY + j * strideEL;
    354       piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 );
    355 
    356       for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
    357       {
    358         *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    359         piSrcY++;
    360         piDstY++;
    361       }
    362 
    363       for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
    364       {
    365         *piDstY = piDstY0[rightEndL-1];
    366         piDstY++;
    367       }
    368 
    369       piDstY = piDstY0;
    370       for( i = 0; i < leftStartL; i++ )
    371       {
    372         *piDstY = piDstY0[leftStartL];
    373         piDstY++;
    374       }
    375 #else
    376       piDstY = piDstBufY + j * strideEL;
    377 
    378       for( i = 0; i < pcTempPic->getWidth(); i++ )
    379       {
    380         *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    381 
    382         // Only increase the x position of reference upsample picture when within the window
    383         // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1
    384         if( (i >= leftStartL) && (i <= rightEndL-2) )
    385         {
    386           piSrcY++;
    387         }
    388         piDstY++;
    389       }
    390 #endif
    391 #endif
    392 #else
    393       piDstY = piDstBufY + j * strideEL;
    394 
    395       for( i = 0; i < widthEL; i++ )
    396       {
    397         *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
    398         piSrcY++;
    399         piDstY++;
    400       }
    401 #endif
    402     }
    403 
    404 #if SCALED_REF_LAYER_OFFSETS
     322
     323    }
     324
    405325    widthBL   = pcBasePic->getWidth ();
    406326    heightBL  = pcBasePic->getHeight();
     
    408328    widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    409329    heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    410 #else
    411     widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    412     heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    413 
    414     widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    415     heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    416 #endif
    417330
    418331    //========== UV component upsampling ===========
     
    426339    strideBL  = pcBasePic->getCStride();
    427340    strideEL  = pcUsPic->getCStride();
    428 #if SCALED_REF_LAYER_OFFSETS
     341
    429342    Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
    430343    Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
    431344    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    432345    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
    433 #if BUGFIX_RESAMPLE
    434346    leftOffset = leftStartC > 0 ? leftStartC : 0;
    435 #endif
    436 #endif
    437347
    438348    shiftX = 16;
     
    490400    for( i = 0; i < widthEL; i++ )
    491401    {
    492 #if SCALED_REF_LAYER_OFFSETS
    493402      Int x = Clip3(leftStartC, rightEndC - 1, i);
    494403      refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
    495 #else
    496       refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
    497 #endif
    498404      phase    = refPos16 & 15;
    499405      refPos   = refPos16 >> 4;
     
    537443#endif
    538444
    539 #if SCALED_REF_LAYER_OFFSETS
    540445    for( j = 0; j < pcTempPic->getHeight() >> 1; j++ )
    541 #else
    542     for( j = 0; j < heightEL; j++ )
    543 #endif
    544     {
    545 #if SCALED_REF_LAYER_OFFSETS
     446    {
    546447      Int y = Clip3(topStartC, bottomEndC - 1, j);
    547448      refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
    548 #else
    549       refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
    550 #endif
    551449      phase    = refPos16 & 15;
    552450      refPos   = refPos16 >> 4;
     
    555453      piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    556454      piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    557 #if SCALED_REF_LAYER_OFFSETS
    558 #if BUGFIX_RESAMPLE
     455
    559456      Pel* piDstU0 = piDstBufU + j*strideEL;
    560457      Pel* piDstV0 = piDstBufV + j*strideEL;
     
    568465        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    569466        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    570 
    571467        piSrcU++;
    572468        piSrcV++;
     
    592488        piDstV++;
    593489      }
    594 #else
    595 #if 1 // it should provide identical result
    596       Pel* piDstU0 = piDstBufU + j*strideEL;
    597       Pel* piDstV0 = piDstBufV + j*strideEL;
    598       piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 );
    599       piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 );
    600 
    601       for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
    602       {
    603         *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    604         *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    605         piSrcU++;
    606         piSrcV++;
    607         piDstU++;
    608         piDstV++;
    609       }
    610 
    611       for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ )
    612       {
    613         *piDstU = piDstU0[rightEndC-1];
    614         *piDstV = piDstV0[rightEndC-1];
    615         piDstU++;
    616         piDstV++;
    617       }
    618 
    619       piDstU = piDstU0;
    620       piDstV = piDstV0;
    621       for( i = 0; i < leftStartC; i++ )
    622       {
    623         *piDstU = piDstU0[leftStartC];
    624         *piDstV = piDstV0[leftStartC];
    625         piDstU++;
    626         piDstV++;
    627       }
    628 #else
    629       piDstU = piDstBufU + j*strideEL;
    630       piDstV = piDstBufV + j*strideEL;
    631 
    632       for( i = 0; i < pcTempPic->getWidth() >> 1; i++ )
    633       {
    634         *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    635         *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    636 
    637         // Only increase the x position of reference upsample picture when within the window
    638         // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1
    639         if( (i >= leftStartC) && (i <= rightEndC-2) )
    640         {
    641           piSrcU++;
    642           piSrcV++;
    643         }
    644 
    645         piDstU++;
    646         piDstV++;
    647       }
    648 #endif
    649 #endif
    650 #else
    651       piDstU = piDstBufU + j*strideEL;
    652       piDstV = piDstBufV + j*strideEL;
    653 
    654       for( i = 0; i < widthEL; i++ )
    655       {
    656         *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
    657         *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
    658         piSrcU++;
    659         piSrcV++;
    660         piDstU++;
    661         piDstV++;
    662       }
    663 #endif
     490
    664491    }
    665492  }
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h

    r466 r467  
    6565#endif
    6666#define IL_SL_SIGNALLING_N0371           0      ///< JCTVC-N0371: inter-layer scaling list
    67 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0      ///< JCTVC-M0464: VUI flag to indicate tile boundary alignment
    6867#define M0463_VUI_EXT_ILP_REF            0      ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling
    6968#define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
    70 #define SCALED_REF_LAYER_OFFSETS         1      ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS
    7169#define VERT_MV_CONSTRAINT               1      ///< Vertical MV component constraint flag
    7270#define SCALABILITY_MASK_E0104           1      ///< JCT3V-E0104: scalability mask for depth
     71#define LAYER_CTB                        0      ///< enable layer-specific CTB structure
    7372
    7473#define ILP_SSH_SIG                      1      ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header
     
    8685#define VPS_EXTN_PROFILE_INFO            1      ///< Include profile information for layer sets in VPS extension
    8786#define VPS_EXTN_DIRECT_REF_LAYERS       1      ///< Include indication of direct dependency of layers in VPS extension
    88 #define VPS_OUTPUT_LAYER_SET_IDX         1      ///< JCTVC-M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]
    89 #define VPS_MOVE_DIR_DEPENDENCY_FLAG     1      ///< JCTVC-M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id
    90 #define VPS_PROFILE_OUTPUT_LAYERS        1      ///< JCTVC-M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2
    91 #define SPS_SUB_LAYER_INFO               1      ///< JCTVC-M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0
    92 #define VPS_SPLIT_FLAG                   1      ///< JCTVC-M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1.
    9387#define M0457_PREDICTION_INDICATIONS     1
    9488#define M0040_ADAPTIVE_RESOLUTION_CHANGE 1
     
    9993#define N0160_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
    10094#define VPS_VUI_BITRATE_PICRATE          1      ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI
    101 #else
    102 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0      ///< VUI flag to indicate tile boundary alignment
    10395#endif //VPS_VUI
    10496
     
    108100#define VPS_EXTN_OFFSET_CALC             1      ///< Calculation of VPS extension offset
    109101#define SPS_PTL_FIX                      1      ///< remove profile_tier_level from enhancement layer SPS
    110 #define SH_DISCARDABLE_FLAG              1      ///< JCTVC-M0152: Use one reserved flag in the slice header for discardable flag
    111102
    112103#define DERIVE_LAYER_ID_LIST_VARIABLES   1      ///< Derived variables based on the variables in VPS - for use in syntax table parsing
     
    116107#define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214: support base layer input more than 8 bits
    117108#define ARBITRARY_SPATIAL_RATIO          1      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
    118 #define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
    119109
    120110#define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
     
    137127#define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication
    138128#if JCTVC_M0203_INTERLAYER_PRED_IDC
    139 #define ILR_RESTR                        1      ///< JCTVC-M0209: Inter-layer RPS and RPL
    140 #define ILR_RESTR_FIX                    1      ///< Fix encoder crash when temporal layers are used with scalable coding
    141129#define EARLY_REF_PIC_MARKING            1      ///< Decoded picture marking of sub-layer non-reference pictures
    142130#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r466 r467  
    450450  {
    451451    READ_FLAG(   uiCode, "tiles_fixed_structure_flag");               pcVUI->setTilesFixedStructureFlag(uiCode);
    452 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG
    453     if ( pcSPS->getLayerId() > 0 )
    454     {
    455       READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );
    456     }
    457 #endif
    458452    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    459453    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
     
    542536}
    543537
    544 #if SPS_SUB_LAYER_INFO
     538#if SVC_EXTENSION
    545539Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager)
    546540#else
     
    554548  UInt  uiCode;
    555549  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
    556 #if SPS_SUB_LAYER_INFO
     550#if SVC_EXTENSION
    557551  if(pcSPS->getLayerId() == 0)
    558552  {
     
    562556
    563557    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    564 #if SPS_SUB_LAYER_INFO
     558#if SVC_EXTENSION
    565559  }
    566560  else
     
    569563    pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() );
    570564  }
    571 #endif
    572565#if IL_SL_SIGNALLING_N0371
    573566  pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) );
    574567  pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );
    575568#endif
     569#endif
    576570  if ( pcSPS->getMaxTLayers() == 1 )
    577571  {
    578572    // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
    579 #if SPS_SUB_LAYER_INFO
     573#if SVC_EXTENSION
    580574    assert( pcSPS->getTemporalIdNestingFlag() == true );
    581575#else
     
    841835  assert( uiCode == 0 );
    842836#endif
    843 #if SCALED_REF_LAYER_OFFSETS
    844837  if( pcSPS->getLayerId() > 0 )
    845838  {
     
    855848    }
    856849  }
    857 #endif
    858850#if M0463_VUI_EXT_ILP_REF
    859851  ////   sps_extension_vui_parameters( )
     
    1000992}
    1001993
     994#if SVC_EXTENSION
    1002995#if VPS_EXTNS
    1003996Void TDecCavlc::parseVPSExtension(TComVPS *vps)
     
    10181011  vps->setNumScalabilityTypes(numScalabilityTypes);
    10191012
    1020 #if VPS_SPLIT_FLAG
    10211013  for(j = 0; j < numScalabilityTypes - vps->getSplittingFlag(); j++)
    1022 #else
    1023   for(j = 0; j < numScalabilityTypes; j++)
    1024 #endif
    10251014  {
    10261015    READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1);
    10271016  }
    1028 #if VPS_SPLIT_FLAG
     1017
    10291018  if(vps->getSplittingFlag())
    10301019  {
     
    10381027    numBits = 6;
    10391028  }
    1040 #else
    1041   if(vps->getSplittingFlag())
    1042   {
    1043     UInt numBits = 0;
    1044     for(j = 0; j < numScalabilityTypes; j++)
    1045     {
    1046       numBits += vps->getDimensionIdLen(j);
    1047     }
    1048     assert( numBits <= 6 );
    1049   }
    1050 #endif
    10511029
    10521030  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
     
    10661044    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
    10671045
    1068 #if VPS_SPLIT_FLAG
    1069     if(!vps->getSplittingFlag())
    1070 #endif
     1046    if( !vps->getSplittingFlag() )
     1047    {
    10711048    for(j = 0; j < numScalabilityTypes; j++)
    10721049    {
     
    10741051      assert( uiCode <= vps->getMaxLayerId() );
    10751052    }
     1053  }
    10761054  }
    10771055#endif
     
    10881066  }
    10891067#endif
    1090 #if VPS_MOVE_DIR_DEPENDENCY_FLAG
    10911068#if VPS_EXTN_DIRECT_REF_LAYERS
    10921069  // For layer 0
     
    11081085  }
    11091086#endif
    1110 #endif
    11111087#if JCTVC_M0203_INTERLAYER_PRED_IDC
    11121088#if N0120_MAX_TID_REF_PRESENT_FLAG
     
    11441120#if VPS_EXTN_PROFILE_INFO
    11451121  // Profile-tier-level signalling
    1146 #if VPS_PROFILE_OUTPUT_LAYERS
    11471122  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
    11481123  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
    11491124  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
    11501125  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
    1151 #else
    1152   vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets());
    1153   for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
    1154 #endif
    11551126  {
    11561127    READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false);
    11571128    if( !vps->getProfilePresentFlag(idx) )
    11581129    {
    1159 #if VPS_PROFILE_OUTPUT_LAYERS
    11601130      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
    1161 #else
    1162       READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
    1163 #endif
    11641131      assert( vps->getProfileLayerSetRef(idx) < idx );
     1132
    11651133      // Copy profile information as indicated
    11661134      vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
     
    11701138#endif
    11711139
    1172 #if VPS_PROFILE_OUTPUT_LAYERS
    11731140  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
    11741141  Int numOutputLayerSets = 0;
     
    12311198    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    12321199  }
    1233 #else
    1234 #if VPS_EXTN_OP_LAYER_SETS
    1235   // Target output layer signalling
    1236   READ_UVLC( uiCode,            "vps_num_output_layer_sets"); vps->setNumOutputLayerSets(uiCode);
    1237   for(i = 0; i < vps->getNumOutputLayerSets(); i++)
    1238   {
    1239 #if VPS_OUTPUT_LAYER_SET_IDX
    1240     READ_UVLC( uiCode,           "vps_output_layer_set_idx_minus1[i]"); vps->setOutputLayerSetIdx(i, uiCode + 1);
    1241 #else
    1242     READ_UVLC( uiCode,           "vps_output_layer_set_idx[i]"); vps->setOutputLayerSetIdx(i, uiCode);
    1243 #endif
    1244     Int lsIdx = vps->getOutputLayerSetIdx(i);
    1245     for(j = 0; j <= vps->getMaxLayerId(); j++)
    1246     {
    1247       if(vps->getLayerIdIncludedFlag(lsIdx, j))
    1248       {
    1249         READ_FLAG( uiCode, "vps_output_layer_flag[lsIdx][j]"); vps->setOutputLayerFlag(lsIdx, j, uiCode);
    1250       }
    1251     }
    1252   }
    1253 #endif
    1254 #endif
     1200
    12551201#if REPN_FORMAT_IN_VPS
    12561202  READ_FLAG( uiCode, "rep_format_idx_present_flag");
     
    13141260#endif
    13151261
    1316 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG
    1317 #if VPS_EXTN_DIRECT_REF_LAYERS
    1318   // For layer 0
    1319   vps->setNumDirectRefLayers(0, 0);
    1320   // For other layers
    1321   for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    1322   {
    1323     UInt numDirectRefLayers = 0;
    1324     for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
    1325     {
    1326       READ_FLAG(uiCode, "direct_dependency_flag[i][j]" ); vps->setDirectDependencyFlag(layerCtr, refLayerCtr, uiCode? true : false);
    1327       if(uiCode)
    1328       {
    1329         vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr);
    1330         numDirectRefLayers++;
    1331       }
    1332     }
    1333     vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers);
    1334   }
    1335 #endif
    1336 #endif
    13371262#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    13381263  READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
     
    14831408}
    14841409#endif
     1410#endif //SVC_EXTENSION
     1411
    14851412Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)
    14861413{
     
    15551482  if(!rpcSlice->getDependentSliceSegmentFlag())
    15561483  {
     1484#if SVC_EXTENSION
    15571485#if POC_RESET_FLAG
    15581486    Int iBits = 0;
     
    15721500    }
    15731501#else
    1574 #if SH_DISCARDABLE_FLAG
    15751502    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0)
    15761503    {
     
    15811508      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    15821509    }
    1583 #else
     1510#endif
     1511#else //SVC_EXTENSION
    15841512    for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
    15851513    {
    15861514      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    15871515    }
    1588 #endif
    1589 #endif
     1516#endif //SVC_EXTENSION
    15901517
    15911518    READ_UVLC (    uiCode, "slice_type" );            rpcSlice->setSliceType((SliceType)uiCode);
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r466 r467  
    7272  Void  parseQtRootCbf      ( UInt uiAbsPartIdx, UInt& uiQtRootCbf );
    7373  Void  parseVPS            ( TComVPS* pcVPS );
     74#if SPS_EXTENSION
    7475#if VPS_EXTNS
    7576  Void  parseVPSExtension   ( TComVPS* pcVPS );
     
    8283  Void  parseRepFormat      ( RepFormat *repFormat );
    8384#endif
    84 #if SPS_SUB_LAYER_INFO
    8585  Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
    86 #else
     86  Void  parseSPSExtension    ( TComSPS* pcSPS );
     87#else //SVC_EXTENSION
    8788  Void  parseSPS            ( TComSPS* pcSPS );
    88 #endif
    89 #if SPS_EXTENSION
    90   Void parseSPSExtension    ( TComSPS* pcSPS );
    91 #endif
     89#endif //SVC_EXTENSION
    9290  Void  parsePPS            ( TComPPS* pcPPS);
    9391  Void  parseVUI            ( TComVUI* pcVUI, TComSPS* pcSPS );
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecEntropy.h

    r466 r467  
    6666
    6767  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    68 #if SPS_SUB_LAYER_INFO
     68#if SVC_EXTENSION
    6969  virtual Void  parseSPS                  ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager )           = 0;
    7070#else
     
    134134  Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
    135135  Void    decodeVPS                   ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }
    136 #if SPS_SUB_LAYER_INFO
     136#if SVC_EXTENSION
    137137  Void    decodeSPS                   ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager )    { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager);                    }
    138138#else
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.h

    r466 r467  
    7676  Void  setBitstream              ( TComInputBitstream* p  ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
    7777  Void  parseVPS                  ( TComVPS* /*pcVPS*/ ) {}
    78 #if SPS_SUB_LAYER_INFO
     78#if SVC_EXTENSION
    7979  Void  parseSPS                  ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {}
    8080#else
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r466 r467  
    359359  {
    360360    WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(),             "tiles_fixed_structure_flag");
    361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG
    362     if ( pcSPS->getLayerId() > 0 )
    363     {
    364       WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
    365     }
    366 #endif
    367361    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
    368362    WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(),           "restricted_ref_pic_lists_flag");
     
    454448#endif
    455449  WRITE_CODE( pcSPS->getVPSId (),          4,       "sps_video_parameter_set_id" );
    456 #if SPS_SUB_LAYER_INFO
     450#if SVC_EXTENSION
    457451  if(pcSPS->getLayerId() == 0)
    458452  {
     
    460454    WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
    461455    WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
    462 #if SPS_SUB_LAYER_INFO
     456#if SVC_EXTENSION
    463457  }
    464458#endif
     
    670664  WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
    671665#endif
    672 #if SCALED_REF_LAYER_OFFSETS
    673666  if( pcSPS->getLayerId() > 0 )
    674667  {
     
    683676    }
    684677  }
    685 #endif
    686678#if M0463_VUI_EXT_ILP_REF
    687679  ////   sps_extension_vui_parameters( )
     
    828820}
    829821
     822#if SVC_EXTENSION
    830823#if VPS_EXTNS
    831824Void TEncCavlc::codeVPSExtension (TComVPS *vps)
     
    843836  }
    844837
    845 #if VPS_SPLIT_FLAG
    846838  for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++)
    847 #else
    848   for(j = 0; j < vps->getNumScalabilityTypes(); j++)
    849 #endif
    850839  {
    851840    WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3,      "dimension_id_len_minus1[j]" );
     
    871860      WRITE_CODE( vps->getLayerIdInNuh(i),     6,      "layer_id_in_nuh[i]" );
    872861    }
    873 #if VPS_SPLIT_FLAG
    874     if(!vps->getSplittingFlag())
    875 #endif
     862
     863    if( !vps->getSplittingFlag() )
     864    {
    876865    for(j = 0; j < vps->getNumScalabilityTypes(); j++)
    877866    {
     
    879868      WRITE_CODE( vps->getDimensionId(i, j),   bits,   "dimension_id[i][j]" );
    880869    }
     870  }
    881871  }
    882872#endif
     
    893883  }
    894884#endif
    895 #if VPS_MOVE_DIR_DEPENDENCY_FLAG
    896885#if VPS_EXTN_DIRECT_REF_LAYERS
    897886  for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     
    902891    }
    903892  }
    904 #endif
    905893#endif
    906894#if JCTVC_M0203_INTERLAYER_PRED_IDC
     
    926914#if VPS_EXTN_PROFILE_INFO
    927915  // Profile-tier-level signalling
    928 #if VPS_PROFILE_OUTPUT_LAYERS
    929916  WRITE_CODE( vps->getNumLayerSets() - 1   , 10, "vps_number_layer_sets_minus1" );     
    930917  WRITE_CODE( vps->getNumProfileTierLevel() - 1,  6, "vps_num_profile_tier_level_minus1");
    931918  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
    932 #else
    933   for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
    934 #endif
    935919  {
    936920    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
    937921    if( !vps->getProfilePresentFlag(idx) )
    938922    {
    939 #if VPS_PROFILE_OUTPUT_LAYERS
    940923      WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" );
    941 #else
    942       WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );
    943 #endif
    944924    }
    945925    codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     
    947927#endif
    948928
    949 #if VPS_PROFILE_OUTPUT_LAYERS
    950929  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
    951930  WRITE_FLAG(  (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" );
     
    982961    WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
    983962  }
    984 #else
    985 #if VPS_EXTN_OP_LAYER_SETS
    986   // Target output layer signalling
    987   WRITE_UVLC( vps->getNumOutputLayerSets(),            "vps_num_output_layer_sets");
    988   for(i = 0; i < vps->getNumOutputLayerSets(); i++)
    989   {
    990 #if VPS_OUTPUT_LAYER_SET_IDX
    991     assert(vps->getOutputLayerSetIdx(i) > 0);
    992     WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1,           "vps_output_layer_set_idx_minus1[i]");
    993 #else
    994     WRITE_UVLC( vps->getOutputLayerSetIdx(i),           "vps_output_layer_set_idx[i]");
    995 #endif
    996     Int lsIdx = vps->getOutputLayerSetIdx(i);
    997     for(j = 0; j <= vps->getMaxLayerId(); j++)
    998     {
    999       if(vps->getLayerIdIncludedFlag(lsIdx, j))
    1000       {
    1001         WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]");
    1002       }
    1003     }
    1004   }
    1005 #endif
    1006 #endif
    1007963
    1008964#if REPN_FORMAT_IN_VPS
     
    1040996      WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
    1041997#endif
    1042 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG
    1043 #if VPS_EXTN_DIRECT_REF_LAYERS
    1044   for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    1045   {
    1046     for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
    1047     {
    1048       WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" );
    1049     }
    1050   }
    1051 #endif
    1052 #endif
    1053998#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    1054999  WRITE_UVLC( vps->getDirectDepTypeLen()-2,                           "direct_dep_type_len_minus2");
     
    11841129}
    11851130#endif
     1131#endif //SVC_EXTENSION
    11861132
    11871133Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
     
    12291175  if ( !pcSlice->getDependentSliceSegmentFlag() )
    12301176  {
    1231 
     1177#if SVC_EXTENSION
    12321178#if POC_RESET_FLAG
    12331179    Int iBits = 0;
     
    12491195    }
    12501196#else
    1251 #if SH_DISCARDABLE_FLAG
    12521197    if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0)
    12531198    {
     
    12601205      WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    12611206    }
    1262 #else
     1207#endif
     1208#else //SVC_EXTENSION
    12631209    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
    12641210    {
     
    12661212      WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    12671213    }
    1268 #endif
    1269 #endif
     1214#endif //SVC_EXTENSION
    12701215
    12711216    WRITE_UVLC( pcSlice->getSliceType(),       "slice_type" );
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r466 r467  
    753753    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
    754754#if SVC_EXTENSION
    755 #if ILR_RESTR && ILR_RESTR_FIX
     755    if (m_layerId > 0)
     756    {
    756757    Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];
    757758    Int activeNumILRRefIdxTmp = 0;
    758 #endif
    759     if (m_layerId > 0)
    760     {
     759
    761760      for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    762761      {
     
    769768        pcSlice->setBaseColPic( *cListPic, refLayerIdc );
    770769
    771 #if ILR_RESTR && ILR_RESTR_FIX
    772770        // Apply temporal layer restriction to inter-layer prediction
    773771        Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId());
     
    780778          continue; // ILP is not valid due to temporal layer restriction
    781779        }
    782 #endif
    783 
    784 #if SCALED_REF_LAYER_OFFSETS
     780
    785781        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
    786782
     
    790786        Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    791787        Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    792 #else
    793         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow();
    794         const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
    795 
    796         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    797         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    798 
    799         Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    800         Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    801 #endif
     788
    802789        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    803790        g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
     
    823810      }
    824811
    825 #if ILR_RESTR && ILR_RESTR_FIX
    826812      // Update the list of active inter-layer pictures
    827813      for ( Int i = 0; i < activeNumILRRefIdxTmp; i++)
     
    835821        pcSlice->setInterLayerPredEnabledFlag(false);
    836822      }
    837 #endif
    838823     
    839824      if( pocCurr % m_pcCfg->getIntraPeriod() == 0 )
     
    16161601          pcSlice->setSliceSegmentCurStartCUAddr  ( startCUAddrSlice      );
    16171602          pcSlice->setSliceBits(0);
     1603#if SVC_EXTENSION
     1604          // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture
     1605          memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) );
     1606#endif
    16181607          uiNumSlices ++;
    16191608        }
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r466 r467  
    8888  m_bMFMEnabledFlag = false;
    8989#endif
    90 #if SCALED_REF_LAYER_OFFSETS
    9190  m_numScaledRefLayerOffsets = 0;
    92 #endif
    93 #endif
    9491#if POC_RESET_FLAG
    9592  m_pocAdjustmentValue     = 0;
    9693#endif
     94#endif //SVC_EXTENSION
    9795}
    9896
     
    175173    }
    176174  }
     175
     176#if LAYER_CTB
     177  memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) );
     178  memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) );
     179  memcpy(g_auiLayerRasterToPelX[m_layerId],  g_auiRasterToPelX,  sizeof( g_auiRasterToPelX ) );
     180  memcpy(g_auiLayerRasterToPelY[m_layerId],  g_auiRasterToPelY,  sizeof( g_auiRasterToPelY ) );
     181#endif
    177182}
    178183
     
    871876#if SVC_EXTENSION
    872877  m_cSPS.setLayerId(m_layerId);
    873 #endif
    874878#if REF_IDX_MFM
    875879#if !M0457_COL_PICTURE_SIGNALING
     
    877881#endif
    878882#endif
    879 #if SCALED_REF_LAYER_OFFSETS
    880883  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
    881884  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
     
    883886    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
    884887  }
    885 #endif
     888#endif //SVC_EXTENSION
    886889  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    887890  profileTierLevel.setLevelIdc(m_level);
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h

    r466 r467  
    140140  Int                     m_ilSampleOnlyPred;
    141141#endif
    142 #if SCALED_REF_LAYER_OFFSETS
    143142  UInt                    m_numScaledRefLayerOffsets;
    144143  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
    145 #endif
    146144#if POC_RESET_FLAG
    147145  Int                     m_pocAdjustmentValue;
    148146#endif
    149 #endif
     147#endif //SVC_EXTENSION
    150148protected:
    151149  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     
    209207  Int                     getNumPicRcvd         () { return m_iNumPicRcvd;            }
    210208  Void                    setNumPicRcvd         ( Int num ) { m_iNumPicRcvd = num;      }
    211 #if SCALED_REF_LAYER_OFFSETS
    212209  Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
    213210  UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
    214211  Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
    215 #endif
    216 #endif
     212#endif //SVC_EXTENSION
    217213
    218214  // -------------------------------------------------------------------------------------------------------------------
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r466 r467  
    293293#if O0194_WEIGHTED_PREDICTION_CGS
    294294        // make sure the reference frames other than ILR are not using weighted prediction
    295         if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1))){
     295        if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1)))
     296        {
    296297          continue;
    297298        }
Note: See TracChangeset for help on using the changeset viewer.