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

undelete the code from the previous revision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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//! \}
Note: See TracChangeset for help on using the changeset viewer.