Changeset 466 in SHVCSoftware for branches/SHM-4.0-dev/source/App


Ignore:
Timestamp:
13 Nov 2013, 23:25:47 (11 years ago)
Author:
nokia
Message:

Integration of O0194: Support different bit-depth values for different layers, enable weighted prediction for ILR for color gamut scalability.

Location:
branches/SHM-4.0-dev/source/App
Files:
6 edited

Legend:

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

    r442 r466  
    225225    if (bNewPicture || !bitstreamFile)
    226226    {
     227#if O0194_DIFFERENT_BITDEPTH_EL_BL
     228      //Bug fix: The bit depth was not set correctly for each layer when doing DBF
     229      g_bitDepthY = g_bitDepthYLayer[curLayerId];
     230      g_bitDepthC = g_bitDepthCLayer[curLayerId];
     231#endif
    227232      m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic);
    228233#if EARLY_REF_PIC_MARKING
     
    237242        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }       
    238243        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    239 
    240244        m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
    241245
     
    566570
    567571#else
     572#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     573          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     574#else
    568575          m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     576#endif
    569577            conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    570578            conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     
    759767
    760768#else
     769#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     770          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     771#else
    761772          m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     773#endif
    762774            conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    763775            conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r464 r466  
    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
    377364#if VPS_EXTN_DIRECT_REF_LAYERS
    378365#if M0457_PREDICTION_INDICATIONS
     
    392379  string* cfg_predLayerIdsPtr    [MAX_LAYERS];
    393380#endif
     381#if SCALED_REF_LAYER_OFFSETS
    394382  string    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
    395383  string    cfg_scaledRefLayerTopOffset [MAX_LAYERS];
     
    402390  string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
    403391  string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
     392#endif
    404393#if RC_SHVC_HARMONIZATION
    405394  Bool*   cfg_RCEnableRateControl  [MAX_LAYERS];
     
    411400  Bool*   cfg_RCForceIntraQP       [MAX_LAYERS];
    412401#endif
     402#if O0194_DIFFERENT_BITDEPTH_EL_BL
     403  Int*    cfg_InputBitDepthY    [MAX_LAYERS];
     404  Int*    cfg_InternalBitDepthY [MAX_LAYERS];
     405  Int*    cfg_InputBitDepthC    [MAX_LAYERS];
     406  Int*    cfg_InternalBitDepthC [MAX_LAYERS];
     407  Int*    cfg_OutputBitDepthY   [MAX_LAYERS];
     408  Int*    cfg_OutputBitDepthC   [MAX_LAYERS];
     409#endif
    413410#if N0120_MAX_TID_REF_CFG
    414411  Int*    cfg_maxTidIlRefPicsPlus1[MAX_LAYERS];
     
    427424    cfg_IntraPeriod[layer]  = &m_acLayerCfg[layer].m_iIntraPeriod;
    428425    cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode;
    429 #if LAYER_CTB
    430     // coding unit (CU) definition
    431     cfg_uiMaxCUWidth[layer]  = &m_acLayerCfg[layer].m_uiMaxCUWidth;
    432     cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight;
    433     cfg_uiMaxCUDepth[layer]  = &m_acLayerCfg[layer].m_uiMaxCUDepth;
    434 
    435     // transfom unit (TU) definition.
    436     cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize;
    437     cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize;
    438 
    439     cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;
    440     cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;
    441 #endif
    442426#if VPS_EXTN_DIRECT_REF_LAYERS
    443427#if M0457_PREDICTION_INDICATIONS
     
    453437    cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
    454438#endif
     439#if SCALED_REF_LAYER_OFFSETS
    455440    cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets;
    456441    for(Int i = 0; i < MAX_LAYERS; i++)
     
    461446      cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
    462447    }
     448#endif
    463449#if RC_SHVC_HARMONIZATION
    464450    cfg_RCEnableRateControl[layer]   = &m_acLayerCfg[layer].m_RCEnableRateControl;
     
    470456    cfg_RCForceIntraQP[layer]        = &m_acLayerCfg[layer].m_RCForceIntraQP;
    471457#endif
     458#if O0194_DIFFERENT_BITDEPTH_EL_BL
     459  cfg_InputBitDepthY   [layer] = &m_acLayerCfg[layer].m_inputBitDepthY;
     460  cfg_InternalBitDepthY[layer] = &m_acLayerCfg[layer].m_internalBitDepthY;
     461  cfg_InputBitDepthC   [layer] = &m_acLayerCfg[layer].m_inputBitDepthC;
     462  cfg_InternalBitDepthC[layer] = &m_acLayerCfg[layer].m_internalBitDepthC;
     463  cfg_OutputBitDepthY  [layer] = &m_acLayerCfg[layer].m_outputBitDepthY;
     464  cfg_OutputBitDepthC  [layer] = &m_acLayerCfg[layer].m_outputBitDepthC;
     465#endif
    472466#if N0120_MAX_TID_REF_CFG
    473467    cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1;
     
    483477  string  cfg_tileSets;
    484478#endif
    485 #else //SVC_EXTENSION
     479#else
    486480  string cfg_InputFile;
    487481  string cfg_BitstreamFile;
    488482  string cfg_ReconFile;
    489483  string cfg_dQPFile;
    490 #endif //SVC_EXTENSION
     484#endif
    491485  string cfg_ColumnWidth;
    492486  string cfg_RowHeight;
     
    538532#endif
    539533  ("BitstreamFile,b",         cfg_BitstreamFile, string(""), "Bitstream output file name")
     534#if !O0194_DIFFERENT_BITDEPTH_EL_BL
    540535  ("InputBitDepth",           m_inputBitDepthY,    8, "Bit-depth of input file")
    541536  ("OutputBitDepth",          m_outputBitDepthY,   0, "Bit-depth of output file (default:InternalBitDepth)")
     
    545540  ("OutputBitDepthC",         m_outputBitDepthC,   0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
    546541  ("InternalBitDepthC",       m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
     542#endif
     543#if SCALED_REF_LAYER_OFFSETS
    547544  ("NumScaledRefLayerOffsets%d",    cfg_numScaledRefLayerOffsets,     0, MAX_LAYERS,  "Number of scaled offset layer sets ")
    548545  ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffsetPtr,  string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
     
    554551  ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
    555552                                                                 " bottom-right luma sample of the EL picture, in units of two luma samples")
     553#endif
     554#if O0194_DIFFERENT_BITDEPTH_EL_BL
     555  ("InputBitDepth%d",       cfg_InputBitDepthY,    8, MAX_LAYERS, "Bit-depth of input file for layer %d")
     556  ("InternalBitDepth%d",    cfg_InternalBitDepthY, 0, MAX_LAYERS, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d ")
     557//                                                       "If different to InputBitDepth, source data will be converted")
     558  ("InputBitDepthC%d",      cfg_InputBitDepthC,    0, MAX_LAYERS, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d")
     559  ("InternalBitDepthC%d",   cfg_InternalBitDepthC, 0, MAX_LAYERS, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d")
     560  ("OutputBitDepth%d",      cfg_OutputBitDepthY,   0, MAX_LAYERS, "Bit-depth of output file (default:InternalBitDepth)")
     561  ("OutputBitDepthC%d",     cfg_OutputBitDepthC,   0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
     562#endif
    556563#if N0120_MAX_TID_REF_CFG
    557564  ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " )
     
    569576  ("IlSampleOnlyPred%d",       m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")
    570577#endif
    571 #else //SVC_EXTENSION
     578#else
    572579  ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
    573580  ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
     
    590597  ("ConfBottom",            m_confBottom,          0, "Bottom offset for window conformance mode 3")
    591598  ("FrameRate,-fr",         m_iFrameRate,          0, "Frame rate")
    592 #endif //SVC_EXTENSION
     599#endif
    593600
    594601  //Field coding parameters
     
    607614  ("FrameOnly",         m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
    608615
    609 #if LAYER_CTB
    610   // Unit definition parameters
    611   ("MaxCUWidth%d",              cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
    612   ("MaxCUHeight%d",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
    613   // todo: remove defaults from MaxCUSize
    614   ("MaxCUSize%d,s%d",           cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
    615   ("MaxCUSize%d,s%d",           cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
    616   ("MaxPartitionDepth%d,h%d",   cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
    617  
    618   ("QuadtreeTULog2MaxSize%d",   cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
    619   ("QuadtreeTULog2MinSize%d",   cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
    620  
    621   ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
    622   ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
    623 
    624 
    625   // set the same CU realted settings across all the layers if config file parameters are not layer specific
    626   ("MaxCUWidth",              cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
    627   ("MaxCUHeight",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
    628   // todo: remove defaults from MaxCUSize
    629   ("MaxCUSize,s",             cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
    630   ("MaxCUSize,s",             cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
    631   ("MaxPartitionDepth,h",     cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
    632  
    633   ("QuadtreeTULog2MaxSize",   cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
    634   ("QuadtreeTULog2MinSize",   cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
    635  
    636   ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
    637   ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
    638 #else
    639616  // Unit definition parameters
    640617  ("MaxCUWidth",              m_uiMaxCUWidth,             64u)
     
    650627  ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs")
    651628  ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
    652 #endif
    653629 
    654630  // Coding structure paramters
     
    974950  m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str());
    975951#endif
    976 #else //SVC_EXTENSION
     952#else
    977953  m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
    978954  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    979955  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    980956  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    981 #endif //SVC_EXTENSION
     957#endif
    982958
    983959  Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
     
    10381014    m_pRowHeight = NULL;
    10391015  }
    1040 #if SVC_EXTENSION
     1016#if SCALED_REF_LAYER_OFFSETS
    10411017  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    10421018  {
     
    11081084    }
    11091085  }
     1086#endif
    11101087#if VPS_EXTN_DIRECT_REF_LAYERS
    11111088#if M0457_PREDICTION_INDICATIONS
     
    12371214  }
    12381215#endif
    1239 #endif //SVC_EXTENSION
    12401216  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    12411217
    12421218  /* rules for input, output and internal bitdepths as per help text */
     1219#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1220  for(Int layer = 0; layer < MAX_LAYERS; layer++){
     1221    if (!m_acLayerCfg[layer].m_internalBitDepthY) { m_acLayerCfg[layer].m_internalBitDepthY = m_acLayerCfg[layer].m_inputBitDepthY; }
     1222    if (!m_acLayerCfg[layer].m_internalBitDepthC) { m_acLayerCfg[layer].m_internalBitDepthC = m_acLayerCfg[layer].m_internalBitDepthY; }
     1223    if (!m_acLayerCfg[layer].m_inputBitDepthC) { m_acLayerCfg[layer].m_inputBitDepthC = m_acLayerCfg[layer].m_inputBitDepthY; }
     1224    if (!m_acLayerCfg[layer].m_outputBitDepthY) { m_acLayerCfg[layer].m_outputBitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; }
     1225    if (!m_acLayerCfg[layer].m_outputBitDepthC) { m_acLayerCfg[layer].m_outputBitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; }
     1226  }
     1227#else
    12431228  if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; }
    12441229  if (!m_internalBitDepthC) { m_internalBitDepthC = m_internalBitDepthY; }
     
    12461231  if (!m_outputBitDepthY) { m_outputBitDepthY = m_internalBitDepthY; }
    12471232  if (!m_outputBitDepthC) { m_outputBitDepthC = m_internalBitDepthC; }
     1233#endif
    12481234
    12491235#if !SVC_EXTENSION
     
    14571443 
    14581444  // set global varibles
    1459 #if LAYER_CTB
    1460   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    1461   {
    1462     xSetGlobal(layer);
    1463   }
    1464 #else
    14651445  xSetGlobal();
    1466 #endif
    14671446 
    14681447  // print-out parameters
     
    15031482#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
    15041483  // check range of parameters
     1484#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1485  for(UInt layer=0; layer<m_numLayers; layer++){
     1486    xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthY < 8,                                                     "InputBitDepth must be at least 8" );
     1487    xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthC < 8,                                                     "InputBitDepthC must be at least 8" );
     1488  }
     1489#else
    15051490  xConfirmPara( m_inputBitDepthY < 8,                                                     "InputBitDepth must be at least 8" );
    15061491  xConfirmPara( m_inputBitDepthC < 8,                                                     "InputBitDepthC must be at least 8" );
     1492#endif
    15071493#if !SVC_EXTENSION 
    15081494  xConfirmPara( m_iFrameRate <= 0,                                                          "Frame rate must be more than 1" );
     
    15241510  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
    15251511  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
    1526 #if LAYER_CTB
    1527   for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    1528   {
    1529     xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1,                "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
    1530   }
    1531 #else
    15321512  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
    1533 #endif
    15341513
    15351514  xConfirmPara( m_cbQpOffset < -12,   "Min. Chroma Cb QP Offset is -12" );
     
    15451524  }
    15461525#endif
    1547 #if !LAYER_CTB
    15481526  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
    15491527  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
    15501528  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
    15511529  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
    1552 #endif
    15531530#if !SVC_EXTENSION
    15541531  xConfirmPara( (m_iSourceWidth  % (m_uiMaxCUWidth  >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame width must be a multiple of the minimum CU size");
     
    15561533#endif
    15571534 
    1558 #if !LAYER_CTB
    15591535  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
    15601536  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
     
    15701546  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
    15711547  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" );
    1572 #endif
    15731548 
    15741549  xConfirmPara(  m_maxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
     
    16181593#endif
    16191594
    1620 #if !LAYER_CTB
    16211595  // max CU width and height should be power of 2
    16221596  UInt ui = m_uiMaxCUWidth;
     
    16341608      xConfirmPara( ui != 1 , "Height should be 2^n");
    16351609  }
    1636 #endif
     1610
    16371611
    16381612  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
     
    20312005    Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth;
    20322006    Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight;
    2033 #if LAYER_CTB
    2034     Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth;
    2035     Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight;
    2036 #endif
    20372007#endif
    20382008  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
     
    22792249/** \todo use of global variables should be removed later
    22802250 */
    2281 #if LAYER_CTB
    2282 Void TAppEncCfg::xSetGlobal(UInt layerId)
    2283 {
    2284   // set max CU width & height
    2285   g_auiLayerMaxCUWidth[layerId]  = m_acLayerCfg[layerId].m_uiMaxCUWidth;
    2286   g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;
    2287  
    2288   // compute actual CU depth with respect to config depth and max transform size
    2289   g_auiLayerAddCUDepth[layerId]  = 0;
    2290   while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] )  ) ) g_auiLayerAddCUDepth[layerId]++;
    2291  
    2292   m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];
    2293   g_auiLayerAddCUDepth[layerId]++;
    2294   g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;
    2295  
    2296   // set internal bit-depth and constants
    2297   g_bitDepthY = m_internalBitDepthY;
    2298   g_bitDepthC = m_internalBitDepthC;
    2299  
    2300   g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY;
    2301   g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC;
    2302 }
    2303 #else
    23042251Void TAppEncCfg::xSetGlobal()
    23052252{
     
    23162263  g_uiMaxCUDepth = m_uiMaxCUDepth;
    23172264 
    2318   // set internal bit-depth and constants
     2265#if O0194_DIFFERENT_BITDEPTH_EL_BL
     2266  // set internal bit-depth to constant value to make sure to be updated later
     2267  g_bitDepthY = -1;
     2268  g_bitDepthC = -1;
     2269 
     2270  g_uiPCMBitDepthLuma = -1;
     2271  g_uiPCMBitDepthChroma = -1;
     2272#else
    23192273  g_bitDepthY = m_internalBitDepthY;
    23202274  g_bitDepthC = m_internalBitDepthC;
     
    23222276  g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY;
    23232277  g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC;
     2278#endif
    23242279}
    2325 #endif
    23262280
    23272281Void TAppEncCfg::xPrintParameter()
     
    23772331    printf("Frame index                  : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
    23782332  }
    2379 #if !LAYER_CTB
    23802333  printf("CU size / depth              : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
    23812334  printf("RQT trans. size (min / max)  : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
    23822335  printf("Max RQT depth inter          : %d\n", m_uiQuadtreeTUMaxDepthInter);
    23832336  printf("Max RQT depth intra          : %d\n", m_uiQuadtreeTUMaxDepthIntra);
    2384 #endif
    23852337  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    23862338  printf("Motion search range          : %d\n", m_iSearchRange );
     
    23992351  printf("QP adaptation                : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
    24002352  printf("GOP size                     : %d\n", m_iGOPSize );
     2353#if O0194_DIFFERENT_BITDEPTH_EL_BL
     2354  printf("Internal bit depth Layer0    : (Y:%d, C:%d)\n", m_acLayerCfg[0].m_internalBitDepthY, m_acLayerCfg[0].m_internalBitDepthC );
     2355  printf("Internal bit depth Layer1    : (Y:%d, C:%d)\n", m_acLayerCfg[1].m_internalBitDepthY, m_acLayerCfg[1].m_internalBitDepthC );
     2356#else
    24012357  printf("Internal bit depth           : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC );
     2358#endif
    24022359  printf("PCM sample bit depth         : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma );
    24032360#if O0215_PHASE_ALIGNMENT
     
    24292386 
    24302387  printf("TOOL CFG: ");
     2388#if O0194_DIFFERENT_BITDEPTH_EL_BL
     2389  printf("IBD0:%d ", g_bitDepthY > m_acLayerCfg[0].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[0].m_inputBitDepthC);
     2390  printf("IBD1:%d ", g_bitDepthY > m_acLayerCfg[1].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[1].m_inputBitDepthC);
     2391#else
    24312392  printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC);
     2393#endif
    24322394  printf("HAD:%d ", m_bUseHADME           );
    24332395  printf("SRD:%d ", m_bUseSBACRD          );
     
    24602422  printf("CIP:%d ", m_bUseConstrainedIntraPred);
    24612423  printf("SAO:%d ", (m_bUseSAO)?(1):(0));
    2462 #if !LAYER_CTB
    24632424  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    2464 #endif
    24652425  printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0));
    24662426
     
    24942454  printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
    24952455#endif
     2456  printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL);
     2457  printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT);
     2458  printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS);
     2459  printf("O0194_REPN_FORMAT_IN_VPS_BUGFIX: %d ",O0194_REPN_FORMAT_IN_VPS_BUGFIX);
    24962460  printf("\n\n");
    24972461 
     
    25082472}
    25092473
    2510 #if SVC_EXTENSION
     2474#if SCALED_REF_LAYER_OFFSETS
    25112475Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString)
    25122476{
     
    25412505  }
    25422506}
     2507#endif
    25432508
    25442509#if FINAL_RPL_CHANGE_N0082
     
    27562721}
    27572722#endif
    2758 #endif //SVC_EXTENSION
    27592723//! \}
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h

    r464 r466  
    150150  Int       m_maxTempLayer;                                  ///< Max temporal layer
    151151
    152 #if !LAYER_CTB
    153152  // coding unit (CU) definition
    154153  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
     
    162161  UInt      m_uiQuadtreeTUMaxDepthInter;
    163162  UInt      m_uiQuadtreeTUMaxDepthIntra;
    164 #endif
    165163 
    166164  // coding tools (bit-depth)
     165#if !O0194_DIFFERENT_BITDEPTH_EL_BL
    167166  Int       m_inputBitDepthY;                               ///< bit-depth of input file (luma component)
    168167  Int       m_inputBitDepthC;                               ///< bit-depth of input file (chroma component)
     
    171170  Int       m_internalBitDepthY;                            ///< bit-depth codec operates at in luma (input/output files will be converted)
    172171  Int       m_internalBitDepthC;                            ///< bit-depth codec operates at in chroma (input/output files will be converted)
    173 
     172#endif
    174173  // coding tools (PCM bit-depth)
    175174  Bool      m_bPCMInputBitDepthFlag;                          ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
     
    356355#endif
    357356  // internal member functions
    358 #if LAYER_CTB
    359   Void  xSetGlobal      (UInt layerId);                       ///< set global variables
    360 #else
    361357  Void  xSetGlobal      ();                                   ///< set global variables
    362 #endif
    363358  Void  xCheckParameter ();                                   ///< check validity of configuration values
    364359  Void  xPrintParameter ();                                   ///< print configuration values
     
    397392  Int  getNumLayer()               {return m_numLayers;        }
    398393  Int  getGOPSize()                {return m_iGOPSize;          }
     394#if O0194_DIFFERENT_BITDEPTH_EL_BL
     395  UInt getInternalBitDepthY(Int iLayer)      {return m_acLayerCfg[iLayer].m_internalBitDepthY; }
     396  UInt getInternalBitDepthC(Int iLayer)      {return m_acLayerCfg[iLayer].m_internalBitDepthC; }
     397#else
    399398  UInt getInternalBitDepthY()      {return m_internalBitDepthY; }
    400399  UInt getInternalBitDepthC()      {return m_internalBitDepthC; }
    401 #if !LAYER_CTB
     400#endif
    402401  UInt getMaxCUWidth()             {return m_uiMaxCUWidth;      }
    403402  UInt getMaxCUHeight()            {return m_uiMaxCUHeight;     }
    404403  UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
    405 #endif
    406404  Int  getDecodingRefreshType()    {return m_iDecodingRefreshType; }
    407405  Int  getWaveFrontSynchro()        { return m_iWaveFrontSynchro; }
     
    410408  Char* getBLSyntaxFile()           { return m_BLSyntaxFile;      }
    411409#endif
     410#if SCALED_REF_LAYER_OFFSETS
    412411  Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
     412#endif
    413413#if REPN_FORMAT_IN_VPS
    414414  RepFormatCfg* getRepFormatCfg(Int i)  { return &m_repFormatCfg[i]; }
    415415#endif
    416 #if LAYER_CTB
    417   Bool getUsePCM()                  { return m_usePCM;               }
    418   UInt getPCMLog2MinSize  ()        { return  m_uiPCMLog2MinSize;    }
    419 #endif
    420416#endif
    421417};// END CLASS DEFINITION TAppEncCfg
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r448 r466  
    3838  m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
    3939  m_aiPad[1] = m_aiPad[0] = 0;
     40#if SCALED_REF_LAYER_OFFSETS
    4041  m_numScaledRefLayerOffsets = 0;
    4142  ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
     
    4344  ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
    4445  ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
     46#endif
    4547}
    4648
     
    140142  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
    141143  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
    148144  printf("QP                            : %5.2f\n", m_fQP );
    149145  printf("Intra period                  : %d\n", m_iIntraPeriod );
     
    161157#endif
    162158  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
    166159}
    167160
     
    182175    {
    183176      // automatic padding to minimum CU size
    184 #if LAYER_CTB
    185       Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);
    186 #else
    187177      Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1);
    188 #endif
    189178      if (m_iSourceWidth % minCuSize)
    190179      {
     
    251240  }
    252241
    253 #if LAYER_CTB
    254   UInt maxCUWidth = m_uiMaxCUWidth;
    255   UInt maxCUHeight = m_uiMaxCUHeight;
    256   UInt maxCUDepth = m_uiMaxCUDepth;
    257 #else
    258242  UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth();
    259243  UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight();
    260244  UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth();
    261 #endif
    262245  bool check_failed = false; /* abort if there is a fatal configuration problem */
    263246#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
     
    272255  }
    273256
     257#if O0194_DIFFERENT_BITDEPTH_EL_BL
     258  for(UInt layer = 0; layer < MAX_LAYERS; layer++){
     259    xConfirmPara( m_iQP <  -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY(layer) - 8) || m_iQP > 51,                "QP exceeds supported range (-QpBDOffsety to 51)" );
     260  }
     261#else
    274262  xConfirmPara( m_iQP <  -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY() - 8) || m_iQP > 51,                "QP exceeds supported range (-QpBDOffsety to 51)" );
    275 
    276 
    277   m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1;
     263#endif
     264
     265
     266  m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m_cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight() : 1;
    278267  xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
    279268  xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" );
     
    290279  xConfirmPara( m_confTop    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
    291280  xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
    292 
    293 #if LAYER_CTB 
    294   xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
    295   xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
    296   xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
    297   xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
    298   xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
    299   xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
    300   xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth,                                        "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
    301   xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize,                "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
    302   xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
    303   xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
    304   xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth  >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." );
    305   xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." );
    306   xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1,                                                         "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );
    307   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" );
    308   xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
    309   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" );
    310 
    311   // max CU width and height should be power of 2
    312   UInt ui = m_uiMaxCUWidth;
    313   while(ui)
    314   {
    315     ui >>= 1;
    316     if( (ui & 1) == 1)
    317       xConfirmPara( ui != 1 , "Width should be 2^n");
    318   }
    319   ui = m_uiMaxCUHeight;
    320   while(ui)
    321   {
    322     ui >>= 1;
    323     if( (ui & 1) == 1)
    324       xConfirmPara( ui != 1 , "Height should be 2^n");
    325   }
    326 #endif
    327 
    328281#undef xConfirmPara
    329282  return check_failed;
    330283}
    331284
    332 #endif //SVC_EXTENSION
     285#endif
    333286
    334287
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r448 r466  
    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
    4645#if VPS_EXTN_DIRECT_REF_LAYERS
    4746#if M0457_PREDICTION_INDICATIONS
     
    5655  Int       *m_predLayerIds;
    5756  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;
    7257#endif
    7358
     
    8570  Int       m_maxTidIlRefPicsPlus1;
    8671#endif
     72#if SVC_EXTENSION
    8773  Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
    88 #endif //SVC_EXTENSION
     74#endif
    8975
    9076  Int       m_iQP;                                            ///< QP value of key-picture (integer)
     
    9278  Int*      m_aidQP;                                          ///< array of slice QP values
    9379  TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
    94 #if SVC_EXTENSION
     80#if SCALED_REF_LAYER_OFFSETS
    9581  Int       m_numScaledRefLayerOffsets  ;
    9682  Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
     
    9884  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
    9985  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
     86#endif 
    10087#if FINAL_RPL_CHANGE_N0082
    10188  GOPEntry  m_GOPListLayer[MAX_GOP];                            ///< for layer
     89#endif
     90#if O0194_DIFFERENT_BITDEPTH_EL_BL
     91  Int       m_inputBitDepthY;                               ///< bit-depth of input file (luma component)
     92  Int       m_inputBitDepthC;                               ///< bit-depth of input file (chroma component)
     93  Int       m_internalBitDepthY;                            ///< bit-depth codec operates at in luma (input/output files will be converted)
     94  Int       m_internalBitDepthC;                            ///< bit-depth codec operates at in chroma (input/output files will be converted)
     95  Int       m_outputBitDepthY;                              ///< bit-depth of output file (luma component)
     96  Int       m_outputBitDepthC;                              ///< bit-depth of output file (chroma component)
    10297#endif
    10398#if REPN_FORMAT_IN_VPS
    10499  Int       m_repFormatIdx;
    105100#endif
    106 #endif //SVC_EXTENSION
    107101public:
    108102  TAppEncLayerCfg();
     
    139133  Int     getIntQP()                  {return m_iQP;              }
    140134  Int*    getdQPs()                   {return m_aidQP;            }
    141 #if SVC_EXTENSION
    142135#if VPS_EXTN_DIRECT_REF_LAYERS
    143136#if M0457_PREDICTION_INDICATIONS
     
    178171#if N0120_MAX_TID_REF_CFG
    179172  Int     getMaxTidIlRefPicsPlus1()   { return m_maxTidIlRefPicsPlus1; }
    180 #endif
    181 #if LAYER_CTB
    182   UInt getMaxCUWidth()             {return m_uiMaxCUWidth;      }
    183   UInt getMaxCUHeight()            {return m_uiMaxCUHeight;     }
    184   UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
    185 #endif
    186 #endif //SVC_EXTENSION
     173#endif
    187174}; // END CLASS DEFINITION TAppEncLayerCfg
    188175
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r464 r466  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2013, ITU/ISO/IEC
     
    117117    }
    118118
    119     assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" );   
     119    assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" );
    120120    vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() );
    121121    maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx );
     
    141141  for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++)
    142142  {
    143     RepFormat *repFormat = vps->getVpsRepFormat( idx );   
     143    RepFormat *repFormat = vps->getVpsRepFormat( idx );
    144144    repFormat->setPicWidthVpsInLumaSamples  ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth()   );
    145145    repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight()  );
    146146    repFormat->setChromaFormatVpsIdc        ( 1                                             );  // Need modification to change for each layer - corresponds to 420
    147147    repFormat->setSeparateColourPlaneVpsFlag( 0                                             );  // Need modification to change for each layer
     148#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     149    repFormat->setBitDepthVpsLuma           ( getInternalBitDepthY(mapIdxToLayer[idx])      );  // Need modification to change for each layer
     150    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC(mapIdxToLayer[idx])      );  // Need modification to change for each layer
     151#else
    148152    repFormat->setBitDepthVpsLuma           ( getInternalBitDepthY()                        );  // Need modification to change for each layer
    149153    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC()                        );  // Need modification to change for each layer
     154#endif
    150155  }
    151156  delete [] mapIdxToLayer;
     
    153158  for(UInt layer=0; layer<m_numLayers; layer++)
    154159  {
     160#if O0194_DIFFERENT_BITDEPTH_EL_BL
     161    //1
     162    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     163    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     164
     165    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     166    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     167
     168    // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic"
     169    g_bitDepthYLayer[layer] = g_bitDepthY;
     170    g_bitDepthCLayer[layer] = g_bitDepthC;
     171#endif
    155172    //m_acTEncTop[layer].setVPS(&vps);
    156173    m_acTEncTop[layer].setFrameRate                    ( m_acLayerCfg[layer].getFrameRate() );
     
    187204#endif
    188205#endif
    189     // set layer ID 
    190     m_acTEncTop[layer].setLayerId ( layer ); 
     206    // set layer ID
     207    m_acTEncTop[layer].setLayerId ( layer );
    191208    m_acTEncTop[layer].setNumLayer ( m_numLayers );
    192209    m_acTEncTop[layer].setLayerEnc(m_apcTEncTop);
     
    220237    if (layer<m_numLayers-1)
    221238    {
    222        m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 
    223     }
    224 #endif 
     239       m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1());
     240    }
     241#endif
    225242#if VPS_EXTN_DIRECT_REF_LAYERS
    226243    if(layer)
     
    241258      else
    242259      {
    243         m_acTEncTop[layer].setNumSamplePredRefLayers   ( m_acLayerCfg[layer].getNumSamplePredRefLayers() );     
     260        m_acTEncTop[layer].setNumSamplePredRefLayers   ( m_acLayerCfg[layer].getNumSamplePredRefLayers() );
    244261        for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++)
    245262        {
    246263          m_acTEncTop[layer].setSamplePredRefLayerId   ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i));
    247264          m_acTEncTop[layer].setSamplePredEnabledFlag  (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true);
    248         }       
     265        }
    249266      }
    250267      if(m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1)
     
    257274      else
    258275      {
    259         m_acTEncTop[layer].setNumMotionPredRefLayers   ( m_acLayerCfg[layer].getNumMotionPredRefLayers() );     
     276        m_acTEncTop[layer].setNumMotionPredRefLayers   ( m_acLayerCfg[layer].getNumMotionPredRefLayers() );
    260277        for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++)
    261278        {
    262279          m_acTEncTop[layer].setMotionPredRefLayerId   ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i));
    263280          m_acTEncTop[layer].setMotionPredEnabledFlag  (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true);
    264         }       
     281        }
    265282      }
    266283      Int numDirectRefLayers = 0;
     
    283300      else
    284301      {
    285         m_acTEncTop[layer].setNumDirectRefLayers       ( m_acLayerCfg[layer].getNumDirectRefLayers() );     
     302        m_acTEncTop[layer].setNumDirectRefLayers       ( m_acLayerCfg[layer].getNumDirectRefLayers() );
    286303        for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++)
    287304        {
     
    304321      else
    305322      {
    306         m_acTEncTop[layer].setNumActiveRefLayers       ( m_acLayerCfg[layer].getNumActiveRefLayers() );     
     323        m_acTEncTop[layer].setNumActiveRefLayers       ( m_acLayerCfg[layer].getNumActiveRefLayers() );
    307324        for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++)
    308325        {
     
    358375    m_acTEncTop[layer].setUseRDOQTS                    ( m_useRDOQTS   );
    359376    m_acTEncTop[layer].setRDpenalty                    ( m_rdPenalty );
    360 #if LAYER_CTB
    361     m_acTEncTop[layer].setQuadtreeTULog2MaxSize        ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize );
    362     m_acTEncTop[layer].setQuadtreeTULog2MinSize        ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize );
    363     m_acTEncTop[layer].setQuadtreeTUMaxDepthInter      ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter );
    364     m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra      ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra );
    365 #else
    366377    m_acTEncTop[layer].setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
    367378    m_acTEncTop[layer].setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
    368379    m_acTEncTop[layer].setQuadtreeTUMaxDepthInter      ( m_uiQuadtreeTUMaxDepthInter );
    369380    m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra      ( m_uiQuadtreeTUMaxDepthIntra );
    370 #endif
    371381    m_acTEncTop[layer].setUseFastEnc                   ( m_bUseFastEnc  );
    372     m_acTEncTop[layer].setUseEarlyCU                   ( m_bUseEarlyCU  ); 
     382    m_acTEncTop[layer].setUseEarlyCU                   ( m_bUseEarlyCU  );
    373383    m_acTEncTop[layer].setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
    374384    m_acTEncTop[layer].setUseCbfFastMode               ( m_bUseCbfFastMode  );
     
    390400    m_acTEncTop[layer].setUseWP                   ( m_useWeightedPred      );
    391401    m_acTEncTop[layer].setWPBiPred                ( m_useWeightedBiPred   );
     402#if O0194_WEIGHTED_PREDICTION_CGS
     403    if (layer!=0){
     404      // Enable weighted prediction for enhancement layer
     405      m_acTEncTop[layer].setUseWP                 ( true   );
     406      m_acTEncTop[layer].setWPBiPred              ( true   );
     407    }
     408#endif
    392409    //====== Parallel Merge Estimation ========
    393410    m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 );
     
    400417    m_acTEncTop[layer].setSliceSegmentMode        ( m_sliceSegmentMode         );
    401418    m_acTEncTop[layer].setSliceSegmentArgument    ( m_sliceSegmentArgument     );
    402 #if LAYER_CTB
    403     Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1);
    404 #else
    405419    Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1);
    406 #endif
    407420    if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU)
    408421    {
     
    428441    m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary);
    429442    m_acTEncTop[layer].setSaoLcuBasedOptimization (m_saoLcuBasedOptimization);
    430     m_acTEncTop[layer].setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag); 
    431     m_acTEncTop[layer].setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag); 
     443    m_acTEncTop[layer].setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
     444    m_acTEncTop[layer].setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
    432445
    433446    m_acTEncTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
     
    494507    if(uiTilesCount == 1)
    495508    {
    496       m_bLFCrossTileBoundaryFlag = true; 
     509      m_bLFCrossTileBoundaryFlag = true;
    497510    }
    498511    m_acTEncTop[layer].setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag );
     
    530543    m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda );
    531544    m_acTEncTop[layer].setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
    532     m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 
     545    m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled );
    533546    m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag );
    534547    m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc );
     
    561574    m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
    562575    m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled);
     576#if SCALED_REF_LAYER_OFFSETS
    563577    if( layer > 0 )
    564578    {
     
    567581      {
    568582        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    569                                                   2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 
    570       }
    571     }
     583                                                  2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
     584      }
     585    }
     586#endif
    572587#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    573588    m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange );
     
    575590  }
    576591}
    577 #else //SVC_EXTENSION
     592#else
    578593Void TAppEncTop::xInitLibCfg()
    579594{
     
    680695  m_cTEncTop.setQuadtreeTUMaxDepthIntra      ( m_uiQuadtreeTUMaxDepthIntra );
    681696  m_cTEncTop.setUseFastEnc                   ( m_bUseFastEnc  );
    682   m_cTEncTop.setUseEarlyCU                   ( m_bUseEarlyCU  ); 
     697  m_cTEncTop.setUseEarlyCU                   ( m_bUseEarlyCU  );
    683698  m_cTEncTop.setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
    684699  m_cTEncTop.setUseCbfFastMode            ( m_bUseCbfFastMode  );
     
    734749  m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary);
    735750  m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization);
    736   m_cTEncTop.setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag); 
    737   m_cTEncTop.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag); 
     751  m_cTEncTop.setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
     752  m_cTEncTop.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
    738753
    739754  m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
     
    792807  if(uiTilesCount == 1)
    793808  {
    794     m_bLFCrossTileBoundaryFlag = true; 
     809    m_bLFCrossTileBoundaryFlag = true;
    795810  }
    796811  m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag );
     
    818833  m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda );
    819834  m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
    820   m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 
     835  m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled );
    821836  m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag );
    822837  m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc );
     
    849864  m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
    850865}
    851 #endif //SVC_EXTENSION
     866#endif
    852867
    853868Void TAppEncTop::xCreateLib()
     
    860875  for(UInt layer=0; layer<m_numLayers; layer++)
    861876  {
    862 #if LAYER_CTB
    863     g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    864     g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    865     g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    866     g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    867 #endif
     877#if O0194_DIFFERENT_BITDEPTH_EL_BL
     878    //2
     879    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     880    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     881
     882    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     883    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     884#endif
     885#if O0194_DIFFERENT_BITDEPTH_EL_BL
     886    m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(),  false, m_acLayerCfg[layer].m_inputBitDepthY, m_acLayerCfg[layer].m_inputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC );  // read  mode
     887#else
    868888    m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(),  false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
     889#endif
    869890    m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1]);
    870891
    871892    if (!m_acLayerCfg[layer].getReconFile().empty())
    872893    {
     894#if O0194_DIFFERENT_BITDEPTH_EL_BL
     895      m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepthY, m_acLayerCfg[layer].m_outputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC );  // write mode
     896#else
    873897      m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // write mode
     898#endif
    874899    }
    875900
    876901    m_acTEncTop[layer].create();
    877902  }
    878 #else //SVC_EXTENSION
     903#else
    879904  m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
    880905  m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]);
     
    885910  // Neo Decoder
    886911  m_cTEncTop.create();
    887 #endif //SVC_EXTENSION
     912#endif
    888913}
    889914
     
    897922  for(UInt layer=0; layer<m_numLayers; layer++)
    898923  {
    899 #if LAYER_CTB
    900     g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    901     g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    902     g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    903     g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    904 #endif
    905 
    906924    m_acTVideoIOYuvInputFile[layer].close();
    907925    m_acTVideoIOYuvReconFile[layer].close();
     
    909927    m_acTEncTop[layer].destroy();
    910928  }
    911 #else //SVC_EXTENSION
     929#else
    912930  m_cTVideoIOYuvInputFile.close();
    913931  m_cTVideoIOYuvReconFile.close();
     
    915933  // Neo Decoder
    916934  m_cTEncTop.destroy();
    917 #endif //SVC_EXTENSION
     935#endif
    918936}
    919937
     
    923941  for(UInt layer=0; layer<m_numLayers; layer++)
    924942  {
    925 #if LAYER_CTB
    926     g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    927     g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    928     g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    929     g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    930        
    931     memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
    932     memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
    933     memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
    934     memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
     943#if O0194_DIFFERENT_BITDEPTH_EL_BL
     944    //3
     945    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     946    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     947
     948    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     949    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    935950#endif
    936951    m_acTEncTop[layer].init(isFieldCoding);
     
    948963    for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)
    949964    {
     965#if O0194_DIFFERENT_BITDEPTH_EL_BL
     966      //4
     967      g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY;
     968      g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC;
     969
     970      g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;
     971      g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;
     972#endif
    950973      vps->setLayerIdIncludedFlag(true, setId, layerId);
    951974    }
     
    963986    vps->setScalabilityMask(i, false);
    964987  }
    965   if(m_numLayers > 1) 
     988  if(m_numLayers > 1)
    966989  {
    967990    Int scalabilityTypes = 0;
     
    9961019#if N0120_MAX_TID_REF_CFG
    9971020  vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag);
    998 #else 
     1021#else
    9991022  vps->setMaxTidRefPresentFlag(true);
    1000 #endif 
     1023#endif
    10011024  if (vps->getMaxTidRefPresentFlag())
    10021025  {
     
    10041027    {
    10051028#if N0120_MAX_TID_REF_CFG
    1006       vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 
    1007 #else 
     1029      vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1());
     1030#else
    10081031      vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1);
    1009 #endif 
     1032#endif
    10101033    }
    10111034  }
     
    10171040    }
    10181041  }
    1019 #endif 
     1042#endif
    10201043#if ILP_SSH_SIG
    10211044#if ILP_SSH_SIG_FIX
     
    10351058#endif
    10361059  // Target output layer
    1037   vps->setNumOutputLayerSets(vps->getNumLayerSets());   
    1038   vps->setNumProfileTierLevel(vps->getNumLayerSets());   
     1060#if VPS_PROFILE_OUTPUT_LAYERS
     1061  vps->setNumOutputLayerSets(vps->getNumLayerSets());
     1062  vps->setNumProfileTierLevel(vps->getNumLayerSets());
    10391063  vps->setDefaultOneTargetOutputLayerFlag(true);
    10401064  for(i = 1; i < vps->getNumLayerSets(); i++)
    10411065  {
    10421066    vps->setProfileLevelTierIdx(i, i);
    1043     vps->setOutputLayerSetIdx(i, i);
    1044   }
    1045 
     1067    vps->setOutputLayerSetIdx(i, i);
     1068  }
     1069#else
     1070  vps->setNumOutputLayerSets(1);
     1071  Int lsIdx = 1;
     1072  vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set
     1073#endif
    10461074  for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)
    10471075  {
    1048     // Include the highest layer as output layer 
     1076    // Include the highest layer as output layer
    10491077    for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++)
    10501078    {
     
    11051133#endif
    11061134#endif
    1107 #if JCTVC_M0458_INTERLAYER_RPS_SIG       
    1108     vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 
    1109 #endif 
    1110 #if N0147_IRAP_ALIGN_FLAG   
    1111     vps->setCrossLayerIrapAlignFlag(true); 
     1135#if JCTVC_M0458_INTERLAYER_RPS_SIG
     1136    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
     1137#endif
     1138#if N0147_IRAP_ALIGN_FLAG
     1139    vps->setCrossLayerIrapAlignFlag(true);
    11121140    for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    11131141    {
     
    11151143      {
    11161144        if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr))
    1117         {         
     1145        {
    11181146          if(m_acTEncTop[layerCtr].getIntraPeriod() !=  m_acTEncTop[refLayerCtr].getIntraPeriod())
    11191147          {
     
    11291157      vps->setCrossLayerIrapAlignFlag(false);
    11301158    }
    1131 #endif 
     1159#endif
    11321160#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    11331161  vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false);
     
    11871215  for(UInt layer=0; layer<m_numLayers; layer++)
    11881216  {
     1217#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1218    //5
     1219    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1220    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1221
     1222    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1223    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     1224#endif
    11891225    // allocate original YUV buffer
    11901226    pcPicYuvOrg[layer] = new TComPicYuv;
     
    11921228    {
    11931229#if SVC_UPSAMPLING
    1194 #if LAYER_CTB
    1195       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 );
    1196 #else
    11971230      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
    1198 #endif
    11991231#else
    12001232      pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     
    12041236    {
    12051237#if SVC_UPSAMPLING
    1206 #if LAYER_CTB
    1207       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 );
    1208 #else
    12091238      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
    1210 #endif
    12111239#else
    12121240      pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     
    12371265  while ( !bEos )
    12381266  {
    1239     // Read enough frames 
     1267    // Read enough frames
    12401268    Bool bFramesReadyToCode = false;
    12411269    while(!bFramesReadyToCode)
     
    12431271      for(UInt layer=0; layer<m_numLayers; layer++)
    12441272      {
    1245 #if LAYER_CTB
    1246         g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    1247         g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    1248         g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    1249         g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    1250 #endif
    1251 
     1273#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1274        //6
     1275        g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1276        g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1277
     1278        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1279        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     1280#endif
    12521281        // get buffers
    12531282        xGetBuffer(pcPicYuvRec, layer);
     
    13111340#endif
    13121341
    1313     // loop through frames in one GOP 
     1342    // loop through frames in one GOP
    13141343    for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ )
    13151344    {
     
    13171346      for(UInt layer=0; layer<m_numLayers; layer++)
    13181347      {
    1319 #if LAYER_CTB
    1320         g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    1321         g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    1322         g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    1323         g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    1324 
    1325         memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
    1326         memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
    1327         memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
    1328         memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
     1348#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1349        //7
     1350        g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1351        g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1352
     1353        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1354        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    13291355#endif
    13301356        // call encoding function for one frame
     
    13531379    for(UInt layer=0; layer<m_numLayers; layer++)
    13541380    {
     1381#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1382      //8
     1383      g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1384      g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1385
     1386      g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1387      g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     1388#endif
    13551389      // write bistream to file if necessary
    13561390      iNumEncoded = m_acTEncTop[layer].getNumPicRcvd();
     
    15931627
    15941628#if SVC_UPSAMPLING
    1595 #if LAYER_CTB
    1596     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 );
    1597 #else
    15981629    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );
    1599 #endif
    16001630#else
    16011631    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     
    16201650      delete pcPicYuvRec; pcPicYuvRec = NULL;
    16211651    }
    1622   } 
     1652  }
    16231653}
    16241654
     
    16711701#endif
    16721702      {
    1673         m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 
     1703        m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(),
    16741704          m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() );
    16751705      }
     
    16911721    for ( i = 0; i < iNumEncoded/2; i++ )
    16921722#endif
    1693     {     
     1723    {
    16941724      const AccessUnit& auTop = *(iterBitstream++);
    16951725      const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop);
Note: See TracChangeset for help on using the changeset viewer.