Changeset 1290 in SHVCSoftware
- Timestamp:
- 18 Jul 2015, 01:59:29 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1289 r1290 1935 1935 #if SVC_EXTENSION 1936 1936 #if AUXILIARY_PICTURES 1937 picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );1938 #else 1939 picColourRemapped.create( pic.getWidth(), pic.getHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );1940 #endif 1941 #else 1942 picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true );1937 picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL ); 1938 #else 1939 picColourRemapped.create( pic.getWidth(), pic.getHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL ); 1940 #endif 1941 #else 1942 picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true ); 1943 1943 #endif 1944 1944 YUVOut[0] = picColourRemapped.getAddr(COMPONENT_Y); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1289 r1290 2852 2852 #endif 2853 2853 2854 // set global varibles2854 // compute actual CU depth with respect to config depth and max transform size 2855 2855 #if SVC_EXTENSION 2856 for(Int layer = 0; layer < m_numLayers; layer++) 2857 { 2858 xSetGlobal(layer); 2859 } 2860 #else 2861 xSetGlobal(); 2856 for(Int layerIdx = 0; layerIdx < m_numLayers; layerIdx++) 2857 { 2858 UInt uiAddCUDepth = 0; 2859 while( (m_acLayerCfg[layerIdx].m_uiMaxCUWidth>>m_acLayerCfg[layerIdx].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize + uiAddCUDepth ) ) ) 2860 { 2861 uiAddCUDepth++; 2862 } 2863 2864 m_acLayerCfg[layerIdx].m_uiMaxTotalCUDepth = m_acLayerCfg[layerIdx].m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_acLayerCfg[layerIdx].m_chromaFormatIDC, m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2865 uiAddCUDepth++; 2866 m_acLayerCfg[layerIdx].m_uiLog2DiffMaxMinCodingBlockSize = m_acLayerCfg[layerIdx].m_uiMaxCUDepth - 1; 2867 } 2868 #else 2869 UInt uiAddCUDepth = 0; 2870 while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + uiAddCUDepth ) ) ) 2871 { 2872 uiAddCUDepth++; 2873 } 2874 2875 m_uiMaxTotalCUDepth = m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2876 uiAddCUDepth++; 2877 m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1; 2862 2878 #endif 2863 2879 … … 4234 4250 } 4235 4251 4236 /** \todo use of global variables should be removed later4237 */4238 #if LAYER_CTB4239 Void TAppEncCfg::xSetGlobal(UInt layerId)4240 {4241 // set max CU width & height4242 g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth;4243 g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;4244 4245 // compute actual CU depth with respect to config depth and max transform size4246 g_auiLayerAddCUDepth[layerId] = 0;4247 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++;4248 4249 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];4250 g_auiLayerAddCUDepth[layerId]++;4251 g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;4252 4253 // set internal bit-depth to constant value to make sure to be updated later4254 g_bitDepthY = -1;4255 g_bitDepthC = -1;4256 4257 g_uiPCMBitDepthLuma = -1;4258 g_uiPCMBitDepthChroma = -1;4259 }4260 #else4261 #if SVC_EXTENSION4262 Void TAppEncCfg::xSetGlobal(UInt layerId)4263 #else4264 Void TAppEncCfg::xSetGlobal()4265 #endif4266 {4267 #if SVC_EXTENSION4268 // Check for layerIdx equal to 0, it has to pe extended to other layers.4269 UInt layerIdx = 0;4270 ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerIdx].m_chromaFormatIDC;4271 #endif4272 4273 // set max CU width & height4274 #if SVC_EXTENSION4275 // compute actual CU depth with respect to config depth and max transform size4276 g_uiAddCUDepth = 0;4277 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth ) ) )4278 {4279 g_uiAddCUDepth++;4280 }4281 4282 g_uiAddCUDepth+=getMaxCUDepthOffset(m_chromaFormatIDC, m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.4283 4284 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_uiAddCUDepth;4285 g_uiAddCUDepth++;4286 g_uiMaxCUDepth = m_acLayerCfg[layerId].m_uiMaxCUDepth;4287 #else4288 // compute actual CU depth with respect to config depth and max transform size4289 g_uiAddCUDepth = 0;4290 while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth ) ) )4291 {4292 g_uiAddCUDepth++;4293 }4294 4295 g_uiAddCUDepth+=getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.4296 4297 m_uiMaxCUDepth += g_uiAddCUDepth;4298 g_uiAddCUDepth++;4299 g_uiMaxCUDepth = m_uiMaxCUDepth;4300 #endif4301 }4302 #endif4303 4304 4252 const Char *profileToString(const Profile::Name profile) 4305 4253 { … … 4395 4343 printf("Profile : %s\n", profileToString(m_profile) ); 4396 4344 } 4397 4398 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 4345 printf("CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth ); 4399 4346 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 4400 4347 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1259 r1290 216 216 UInt m_uiMaxCUWidth; ///< max. CU width in pixel 217 217 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 218 UInt m_uiMaxCUDepth; ///< max. CU depth 218 UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) 219 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 220 UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth 219 221 220 222 // transfom unit (TU) definition -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r1235 r1290 247 247 } 248 248 printf("\n"); 249 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );249 printf("CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth ); 250 250 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 251 251 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1284 r1290 65 65 UInt m_uiMaxCUWidth; ///< max. CU width in pixel 66 66 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 67 UInt m_uiMaxCUDepth; ///< max. CU depth 67 UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) 68 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 69 UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth 68 70 69 71 // transfom unit (TU) definition -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1289 r1290 438 438 m_acTEncTop[layer].setMaxCUWidth ( m_acLayerCfg[layer].m_uiMaxCUWidth ); 439 439 m_acTEncTop[layer].setMaxCUHeight ( m_acLayerCfg[layer].m_uiMaxCUHeight ); 440 m_acTEncTop[layer].setMaxTotalCUDepth ( m_acLayerCfg[layer].m_uiMaxTotalCUDepth ); 441 m_acTEncTop[layer].setLog2DiffMaxMinCodingBlockSize ( m_acLayerCfg[layer].m_uiLog2DiffMaxMinCodingBlockSize ); 440 442 441 443 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); … … 868 870 m_cTEncTop.setMaxCUWidth ( m_uiMaxCUWidth ); 869 871 m_cTEncTop.setMaxCUHeight ( m_uiMaxCUHeight ); 872 m_cTEncTop.setMaxTotalCUDepth ( m_uiMaxTotalCUDepth ); 873 m_cTEncTop.setLog2DiffMaxMinCodingBlockSize ( m_uiLog2DiffMaxMinCodingBlockSize ); 870 874 m_cTEncTop.setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 871 875 m_cTEncTop.setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); … … 1684 1688 if( m_isField ) 1685 1689 { 1686 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMax CUDepth, true, NULL );1687 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMax CUDepth, true, NULL );1690 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL ); 1691 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL ); 1688 1692 } 1689 1693 else 1690 1694 { 1691 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMax CUDepth, true, NULL );1692 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMax CUDepth, true, NULL );1695 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL ); 1696 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL ); 1693 1697 } 1694 1698 } … … 2034 2038 if( m_isField ) 2035 2039 { 2036 pcPicYuvOrg->create ( m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );2037 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true);2040 pcPicYuvOrg->create ( m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true ); 2041 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true); 2038 2042 } 2039 2043 else 2040 2044 { 2041 pcPicYuvOrg->create ( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );2042 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );2045 pcPicYuvOrg->create ( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true ); 2046 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true ); 2043 2047 } 2044 2048 … … 2129 2133 rpcPicYuvRec = new TComPicYuv; 2130 2134 2131 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMax CUDepth, true, NULL );2135 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL ); 2132 2136 } 2133 2137 m_acListPicYuvRec[layer].pushBack( rpcPicYuvRec ); … … 2259 2263 rpcPicYuvRec = new TComPicYuv; 2260 2264 2261 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMax CUDepth, true );2265 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true ); 2262 2266 2263 2267 } -
branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h
r1287 r1290 127 127 //returns the part index of the luma region that is co-located with the specified chroma region 128 128 129 static inline UInt getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, const ChromaFormat chFmt) 130 { 131 return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~((1<<(2*g_uiAddCUDepth))-1)); //(lumaZOrderIdxInCtu/numParts)*numParts; 129 static inline UInt 130 getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, 131 const ChromaFormat chFmt, 132 const Int partsPerMinCU // 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())) 133 ) 134 { 135 return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~(partsPerMinCU-1)); 132 136 } 133 137 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1289 r1290 1392 1392 { 1393 1393 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1394 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth -getSlice()->getPPS()->getMaxCuDQPDepth())<<1); 1394 const UInt maxCUDepth = getSlice()->getSPS()->getMaxTotalCUDepth(); 1395 const UInt maxCuDQPDepth = getSlice()->getPPS()->getMaxCuDQPDepth(); 1396 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 1397 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference; 1395 1398 UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx]; 1396 1399 … … 1416 1419 { 1417 1420 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1418 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1); 1421 const UInt maxCUDepth = getSlice()->getSPS()->getMaxTotalCUDepth(); 1422 const UInt maxCuDQPDepth = getSlice()->getPPS()->getMaxCuDQPDepth(); 1423 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 1424 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference; 1419 1425 UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx]; 1420 1426 … … 1461 1467 Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx ) 1462 1468 { 1463 UInt uiQUPartIdxMask = ~((1<<((g _uiMaxCUDepth- getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);1469 UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1); 1464 1470 Int iLastValidPartIdx = getLastValidPartIdx( uiAbsPartIdx&uiQUPartIdxMask ); // A idx will be invalid if it is off the right or bottom edge of the picture. 1465 1471 // If this CU is in the first CTU of the slice and there is no valid part before this one, use slice QP … … 1545 1551 UInt AbovePartIdx = MAX_UINT; 1546 1552 Int iLeftIntraDir, iAboveIntraDir; 1553 const TComSPS *sps=getSlice()->getSPS(); 1554 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1547 1555 1548 1556 const ChannelType chType = toChannelType(compID); … … 1553 1561 if (isChroma(compID)) 1554 1562 { 1555 LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm );1563 LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm, partsPerMinCU); 1556 1564 } 1557 1565 iLeftIntraDir = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX; … … 1562 1570 if (isChroma(compID)) 1563 1571 { 1564 AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm );1572 AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm, partsPerMinCU); 1565 1573 } 1566 1574 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX; … … 3406 3414 if (uiDirMode==DM_CHROMA_IDX) 3407 3415 { 3408 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat())); 3416 const TComSPS *sps=getSlice()->getSPS(); 3417 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 3418 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU)); 3409 3419 } 3410 3420 -
branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r1289 r1290 202 202 xSetEdgefilterPU ( pcCU, uiAbsZorderIdx ); 203 203 204 const UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;204 const UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 205 205 206 206 for( UInt uiPartIdx = uiAbsZorderIdx; uiPartIdx < uiAbsZorderIdx + uiCurNumParts; uiPartIdx++ ) … … 294 294 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 295 295 296 const UInt uiWidthInBaseUnits = rect.width / (sps.getMaxCUWidth() >> g_uiMaxCUDepth);297 const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> g_uiMaxCUDepth);296 const UInt uiWidthInBaseUnits = rect.width / (sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth()); 297 const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> sps.getMaxTotalCUDepth()); 298 298 299 299 xSetEdgefilterMultiple( pcCU, rTu.GetAbsPartIdxCU(), uiTransDepthTotal, EDGE_VER, 0, m_stLFCUParam.bInternalEdge, uiWidthInBaseUnits, uiHeightInBaseUnits, &rect ); … … 584 584 UInt uiNumParts = pcCU->getPic()->getNumPartInCtuWidth()>>uiDepth; 585 585 586 UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;586 UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 587 587 UInt uiBsAbsIdx = 0, uiBs = 0; 588 588 Int iOffset, iSrcStep; … … 693 693 Pel *piSrcCb = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 694 694 Pel *piSrcCr = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 695 696 695 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 697 696 #if SVC_EXTENSION … … 701 700 #endif 702 701 703 const UInt uiPelsInPartChromaH = sps.getMaxCUWidth() >> ( g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));704 const UInt uiPelsInPartChromaV = sps.getMaxCUHeight() >> ( g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));702 const UInt uiPelsInPartChromaH = sps.getMaxCUWidth() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb)); 703 const UInt uiPelsInPartChromaV = sps.getMaxCUHeight() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb)); 705 704 706 705 Int iQP = 0; -
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
r1289 r1290 117 117 const UInt uiTuHeight2 = uiTuHeight << 1; 118 118 119 const Int iBaseUnitSize = sps.getMaxCUWidth() >> g_uiMaxCUDepth;119 const Int iBaseUnitSize = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 120 120 const Int iUnitWidth = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID); 121 121 const Int iUnitHeight = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1289 r1290 75 75 } 76 76 #if SVC_EXTENSION 77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual, const UInt layerId )77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId ) 78 78 { 79 79 const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId); 80 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 81 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 82 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 83 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 80 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 81 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 82 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 83 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 84 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 84 85 85 86 const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId ); … … 110 111 } 111 112 #else 112 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual) 113 { 114 const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc(); 115 const Int iWidth = sps.getPicWidthInLumaSamples(); 116 const Int iHeight = sps.getPicHeightInLumaSamples(); 117 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 118 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 113 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) 114 { 115 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 116 const Int iWidth = sps.getPicWidthInLumaSamples(); 117 const Int iHeight = sps.getPicHeightInLumaSamples(); 118 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 119 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 120 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 119 121 120 122 m_picSym.create( sps, pps, uiMaxDepth ); … … 262 264 Void TComPic::copyUpsampledMvField(UInt refLayerIdc) 263 265 { 264 UInt numPartitions = 1<<(g_uiMaxCUDepth<<1); 265 UInt widthMinPU = getSlice(0)->getSPS()->getMaxCUWidth() / (1<<g_uiMaxCUDepth); 266 UInt heightMinPU = getSlice(0)->getSPS()->getMaxCUHeight() / (1<<g_uiMaxCUDepth); 267 Int unitNum = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 266 const TComSPS *sps = getSlice(0)->getSPS(); 267 const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); 268 const UInt numPartitions = 1<<(uiMaxDepth<<1); 269 const UInt widthMinPU = sps->getMaxCUWidth() / (1<<uiMaxDepth); 270 const UInt heightMinPU = sps->getMaxCUHeight() / (1<<uiMaxDepth); 271 const Int unitNum = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 268 272 269 273 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU … … 314 318 Void TComPic::initUpsampledMvField() 315 319 { 316 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 320 const TComSPS *sps = getSlice(0)->getSPS(); 321 const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); 322 const UInt uiNumPartitions = 1<<(uiMaxDepth<<1); 317 323 318 324 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1289 r1290 99 99 100 100 #if SVC_EXTENSION 101 Void create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual /*= false*/, const UInt layerId );101 Void create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/, const UInt layerId ); 102 102 #else 103 Void create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual /*= false*/ );103 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ ); 104 104 #endif 105 105 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1289 r1290 249 249 // ==================================================================================================================== 250 250 251 UInt g_uiMaxCUDepth = MAX_CU_DEPTH;252 UInt g_uiAddCUDepth = 0;253 251 UInt g_auiZscanToRaster [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, }; 254 252 UInt g_auiRasterToZscan [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, }; -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1289 r1290 85 85 Void initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth ); 86 86 87 // global variable (CTU width/height, max. CU depth)88 extern UInt g_uiMaxCUDepth;89 extern UInt g_uiAddCUDepth;90 91 87 extern UInt g_auiPUOffset[NUMBER_OF_PART_SIZES]; 92 88 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1289 r1290 2057 2057 , m_uiMaxCUWidth ( 32) 2058 2058 , m_uiMaxCUHeight ( 32) 2059 , m_uiMax CUDepth( 3)2059 , m_uiMaxTotalCUDepth ( 3) 2060 2060 , m_bLongTermRefsPresent (false) 2061 2061 , m_uiQuadtreeTULog2MaxSize ( 0) -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1287 r1290 1323 1323 UInt m_uiMaxCUWidth; 1324 1324 UInt m_uiMaxCUHeight; 1325 UInt m_uiMax CUDepth;1325 UInt m_uiMaxTotalCUDepth; ///< Total CU depth, relative to the smallest possible transform block size. 1326 1326 1327 1327 Window m_conformanceWindow; … … 1445 1445 Void setMaxCUHeight( UInt u ) { m_uiMaxCUHeight = u; } 1446 1446 UInt getMaxCUHeight() const { return m_uiMaxCUHeight; } 1447 Void setMax CUDepth( UInt u ) { m_uiMaxCUDepth = u;}1448 UInt getMax CUDepth() const { return m_uiMaxCUDepth;}1447 Void setMaxTotalCUDepth( UInt u ) { m_uiMaxTotalCUDepth = u; } 1448 UInt getMaxTotalCUDepth() const { return m_uiMaxTotalCUDepth; } 1449 1449 Void setUsePCM( Bool b ) { m_usePCM = b; } 1450 1450 Bool getUsePCM() const { return m_usePCM; } -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1288 r1290 1760 1760 const ChannelType chType = toChannelType(compID); 1761 1761 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1762 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 1762 const TComSPS *sps=pcCU->getSlice()->getSPS(); 1763 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1764 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 1763 1765 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1764 1766 … … 1830 1832 const ChannelType chType = toChannelType(compID); 1831 1833 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1832 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 1834 const TComSPS *sps=pcCU->getSlice()->getSPS(); 1835 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1836 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 1833 1837 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1834 1838 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1287 r1290 868 868 869 869 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 870 pcSPS->setMax CUDepth( maxCUDepthDelta + addCuDepth + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) );870 pcSPS->setMaxTotalCUDepth( maxCUDepthDelta + addCuDepth + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) ); 871 871 872 872 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); … … 2347 2347 Void TDecCavlc::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2348 2348 { 2349 Int qp;2350 2349 Int iDQp; 2351 2350 … … 2361 2360 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA); 2362 2361 #endif 2363 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2364 2365 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1) ; 2366 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 2362 const Int qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2363 2364 const UInt maxCUDepth = pcCU->getSlice()->getSPS()->getMaxTotalCUDepth(); 2365 const UInt maxCuDQPDepth = pcCU->getSlice()->getPPS()->getMaxCuDQPDepth(); 2366 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 2367 const UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>doubleDepthDifference)<<doubleDepthDifference ; 2368 const UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 2367 2369 2368 2370 pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth ); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1289 r1290 235 235 bBoundary = true; 236 236 } 237 238 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 237 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 239 238 { 240 239 UInt uiIdx = uiAbsPartIdx; 241 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression240 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 242 241 { 243 242 setdQPFlag(true); … … 245 244 } 246 245 247 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression246 if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 248 247 { 249 248 setIsChromaQpAdjCoded(true); … … 270 269 uiIdx += uiQNumParts; 271 270 } 272 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression271 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 273 272 { 274 273 if ( getdQPFlag() ) … … 281 280 } 282 281 283 if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression282 if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP()) 284 283 { 285 284 setdQPFlag(true); … … 287 286 } 288 287 289 if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression288 if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 290 289 { 291 290 setIsChromaQpAdjCoded(true); … … 416 415 } 417 416 418 if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth) ) || bBoundary )417 if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 419 418 { 420 419 UInt uiNextDepth = uiDepth + 1; … … 569 568 570 569 const UInt uiChPredMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 571 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 570 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 571 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 572 572 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 573 573 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r1286 r1290 184 184 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 185 185 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 186 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMax CUDepth() - uiDepth ) << 1 ) ) >> 4;186 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 187 187 188 188 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1289 r1290 510 510 Void TDecSbac::parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 511 511 { 512 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)512 if( uiDepth == pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() ) 513 513 { 514 514 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); … … 540 540 const UChar cuWidth =UChar(pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth); 541 541 const UChar cuHeight=UChar(pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth); 542 const Int log2DiffMaxMinCodingBlockSize = pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize(); 542 543 543 544 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 545 546 #endif 546 547 548 assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize); 547 549 if ( pcCU->isIntra( uiAbsPartIdx ) ) 548 550 { 549 551 uiSymbol = 1; 550 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)552 if( uiDepth == log2DiffMaxMinCodingBlockSize ) 551 553 { 552 554 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); … … 570 572 UInt uiMaxNumBits = 2; 571 573 572 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth&& !( cuWidth == 8 && cuHeight == 8 ) )574 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) ) 573 575 { 574 576 uiMaxNumBits ++; … … 585 587 } 586 588 eMode = (PartSize) uiMode; 587 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth)589 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 588 590 { 589 591 if (eMode == SIZE_2NxN) … … 1233 1235 const UInt uiHeight=rRect.height; 1234 1236 TCoeff* pcCoef=(pcCU->getCoeff(compID)+rTu.getCoefficientOffset(compID)); 1237 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 1235 1238 1236 1239 DTRACE_CABAC_VL( g_nSymbolCounter++ ) … … 1265 1268 //-------------------------------------------------------------------------------------------------- 1266 1269 1267 if( uiWidth > pcCU->getSlice()->getSPS()->getMaxTrSize() )1270 if( uiWidth > sps.getMaxTrSize() ) 1268 1271 { 1269 1272 std::cerr << "ERROR: parseCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl; … … 1283 1286 1284 1287 const ChannelType channelType = toChannelType(compID); 1285 const Bool extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();1286 1287 const Bool alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();1288 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);1288 const Bool extendedPrecision = sps.getUseExtendedPrecision(); 1289 1290 const Bool alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass(); 1291 const Int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(channelType); 1289 1292 1290 1293 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 1333 1336 if ( isIntra && pcCU->isRDPCMEnabled(uiAbsPartIdx) ) 1334 1337 { 1338 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 1335 1339 uiIntraMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 1336 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat() )) : uiIntraMode;1340 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat(), partsPerMinCU)) : uiIntraMode; 1337 1341 uiIntraMode = ((rTu.GetChromaFormat() == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiIntraMode] : uiIntraMode; 1338 1342 … … 1347 1351 //-------------------------------------------------------------------------------------------------- 1348 1352 1349 const Bool bUseGolombRiceParameterAdaptation = pcCU->getSlice()->getSPS()->getUseGolombRiceParameterAdaptation();1353 const Bool bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation(); 1350 1354 UInt ¤tGolombRiceStatistic = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)]; 1351 1355 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1289 r1290 254 254 } 255 255 256 rpcPic->create( vps, sps, pps, g_uiMaxCUDepth,true, m_layerId);256 rpcPic->create( vps, sps, pps, true, m_layerId); 257 257 #else //SVC_EXTENSION 258 rpcPic->create ( sps, pps, g_uiMaxCUDepth,true);258 rpcPic->create ( sps, pps, true); 259 259 #endif //SVC_EXTENSION 260 260 … … 303 303 } 304 304 305 rpcPic->create( vps, sps, pps, g_uiMaxCUDepth,true, m_layerId);305 rpcPic->create( vps, sps, pps, true, m_layerId); 306 306 #else //SVC_EXTENSION 307 rpcPic->create ( sps, pps, g_uiMaxCUDepth,true);307 rpcPic->create ( sps, pps, true); 308 308 #endif //SVC_EXTENSION 309 309 } … … 493 493 UInt refLayerId = 0; 494 494 495 pBLPic->create( *vps, *sps, *pps, sps->getMaxCUDepth(),true, refLayerId);495 pBLPic->create( *vps, *sps, *pps, true, refLayerId); 496 496 497 497 // it is needed where the VPS is accessed through the slice … … 571 571 #endif //SVC_EXTENSION 572 572 573 // TODO: remove the use of the following globals: 574 g_uiMaxCUDepth = sps->getMaxCUDepth(); 575 #if SVC_EXTENSION 576 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize())); 577 #else 578 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 579 #endif 573 // NOTE: globals were set up here originally. You can now use: 574 // g_uiMaxCUDepth = sps->getMaxTotalCUDepth(); 575 // g_uiAddCUDepth = sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize() 580 576 581 577 // Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use. … … 605 601 // Initialise the various objects for the new set of settings 606 602 #if SVC_EXTENSION 607 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMax CUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );603 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 608 604 #else 609 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMax CUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );610 #endif 611 m_cLoopFilter.create( sps->getMax CUDepth() );605 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 606 #endif 607 m_cLoopFilter.create( sps->getMaxTotalCUDepth() ); 612 608 m_cPrediction.initTempBuff(sps->getChromaFormatIdc()); 613 609 … … 666 662 // Recursive structure 667 663 #if SVC_EXTENSION 668 m_cCuDecoder.create ( sps->getMax CUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );664 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() ); 669 665 m_cCuDecoder.init ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId ); 670 666 #else 671 m_cCuDecoder.create ( sps->getMax CUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );667 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 672 668 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 673 669 #endif … … 2198 2194 if( m_layerId > 0 ) 2199 2195 { 2200 g_uiMaxCUDepth = sps->getMaxCUDepth();2201 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() );2202 2203 2196 if (m_cIlpPic[0] == NULL) 2204 2197 { … … 2207 2200 m_cIlpPic[j] = new TComPic; 2208 2201 2209 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUDepth,true, m_layerId);2202 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), true, m_layerId); 2210 2203 2211 2204 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) … … 2379 2372 Void TDecTop::initAsymLut(TComSlice *pcSlice) 2380 2373 { 2381 if(m_layerId>0) 2382 { 2383 if(!m_pColorMappedPic) 2384 { 2385 Int picWidth = pcSlice->getPicWidthInLumaSamples(); 2386 Int picHeight = pcSlice->getPicHeightInLumaSamples(); 2374 if( m_layerId > 0 ) 2375 { 2376 if( !m_pColorMappedPic ) 2377 { 2387 2378 m_pColorMappedPic = new TComPicYuv; 2388 m_pColorMappedPic->create( p icWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );2379 m_pColorMappedPic->create( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL ); 2389 2380 } 2390 2381 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1287 r1290 642 642 #endif 643 643 assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() ); 644 645 644 WRITE_UVLC( pcSPS->getLog2MinCodingBlockSize() - 3, "log2_min_luma_coding_block_size_minus3" ); 646 645 WRITE_UVLC( pcSPS->getLog2DiffMaxMinCodingBlockSize(), "log2_diff_max_min_luma_coding_block_size" ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1289 r1290 148 148 UInt m_maxCUWidth; 149 149 UInt m_maxCUHeight; 150 UInt m_maxTotalCUDepth; 151 UInt m_log2DiffMaxMinCodingBlockSize; 152 150 153 //======= Transform ============= 151 154 UInt m_uiQuadtreeTULog2MaxSize; … … 515 518 Void setMaxCUWidth ( UInt u ) { m_maxCUWidth = u; } 516 519 Void setMaxCUHeight ( UInt u ) { m_maxCUHeight = u; } 520 Void setMaxTotalCUDepth ( UInt u ) { m_maxTotalCUDepth = u; } 521 Void setLog2DiffMaxMinCodingBlockSize( UInt u ) { m_log2DiffMaxMinCodingBlockSize = u; } 517 522 518 523 //======== Transform ============= -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1289 r1290 374 374 const TComPPS &pps=*(rpcTempCU->getSlice()->getPPS()); 375 375 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 376 const UInt maxCUWidth = sps.getMaxCUWidth();377 376 378 377 // get Original YUV data from picture … … 399 398 const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents(); 400 399 401 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression400 if( uiDepth <= pps.getMaxCuDQPDepth() ) 402 401 { 403 402 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 565 564 { 566 565 // 2Nx2N, NxN 566 567 567 if(!( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) )) 568 568 { 569 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth&& doNotBlockPu)569 if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() && doNotBlockPu) 570 570 { 571 571 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug) ); … … 594 594 595 595 //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N) 596 if(sps.getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth)596 if(sps.getUseAMP() && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) 597 597 { 598 598 #if AMP_ENC_SPEEDUP … … 721 721 xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) ); 722 722 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 723 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)723 if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() ) 724 724 { 725 725 if( rpcTempCU->getWidth(0) > ( 1 << sps.getQuadtreeTULog2MinSize() ) ) … … 802 802 } 803 803 804 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression804 if( uiDepth == pps.getMaxCuDQPDepth() ) 805 805 { 806 806 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 813 813 #endif 814 814 } 815 else if( (maxCUWidth>>uiDepth) > (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression815 else if( uiDepth < pps.getMaxCuDQPDepth() ) 816 816 { 817 817 iMinQP = iBaseQP; … … 843 843 844 844 // further split 845 if( bSubBranch && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth)845 if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) 846 846 { 847 847 UChar uhNextDepth = uiDepth+1; … … 906 906 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 907 907 908 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression908 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 909 909 { 910 910 Bool hasResidual = false; … … 1082 1082 } 1083 1083 1084 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary )1084 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 1085 1085 { 1086 1086 UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2; 1087 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression1087 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 1088 1088 { 1089 1089 setdQPFlag(true); 1090 1090 } 1091 1091 1092 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression1092 if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcSlice->getUseChromaQpAdj()) 1093 1093 { 1094 1094 setCodeChromaQpAdjFlag(true); … … 1112 1112 } 1113 1113 1114 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression1114 if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP()) 1115 1115 { 1116 1116 setdQPFlag(true); 1117 1117 } 1118 1118 1119 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression1119 if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcSlice->getUseChromaQpAdj()) 1120 1120 { 1121 1121 setCodeChromaQpAdjFlag(true); … … 1648 1648 1649 1649 const TComPPS &pps = *(pcCU->getSlice()->getPPS()); 1650 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 1651 if ( pps.getUseDQP() && (sps.getMaxCUWidth()>>uiDepth) >= (sps.getMaxCUWidth() >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression 1650 if ( pps.getUseDQP() && uiDepth <= pps.getMaxCuDQPDepth() ) 1652 1651 { 1653 1652 if ( pcCU->getQtRootCbf( 0) ) … … 1767 1766 const TComSPS &sps = *(pCtu->getSlice()->getSPS()); 1768 1767 1769 const UInt uiMinCUWidth = sps.getMaxCUWidth() >> g_uiMaxCUDepth;1770 UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth;1768 const UInt uiMinCUWidth = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); // NOTE: ed - this is not the minimum CU width. It is the square-root of the number of coefficients per part. 1769 const UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth; // NOTE: ed - what is this? 1771 1770 1772 1771 memset( cSum, 0, sizeof( Double )*(LEVEL_RANGE+1) ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r1286 r1290 473 473 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 474 474 UInt uiDepth = pcCU->getDepth( uiAbsPartIdx ); 475 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMax CUDepth() - uiDepth ) << 1 ) ) >> 4;475 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 476 476 477 477 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1289 r1290 202 202 203 203 const TComVPS *vps = pcTEncTop->getVPS(); 204 205 const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, pcTEncTop->getSPS(), pcTEncTop->getLayerId()); 206 const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, pcTEncTop->getSPS(), pcTEncTop->getLayerId()); 204 const TComSPS *sps = pcTEncTop->getSPS(); 205 206 const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, sps, pcTEncTop->getLayerId()); 207 const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, sps, pcTEncTop->getLayerId()); 207 208 const Int prevBitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId); 208 209 const Int prevBitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId); … … 214 215 { 215 216 m_pColorMappedPic = new TComPicYuv; 216 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), pcTEncTop->getSPS()->getMaxCUWidth(), pcTEncTop->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );217 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL ); 217 218 } 218 219 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp
r1289 r1290 119 119 * \param sps reference to used SPS 120 120 * \param pps reference to used PPS 121 * \param uiMaxWidth Maximum CU width 122 * \param uiMaxHeight Maximum CU height 123 * \param uiMaxDepth Maximum CU depth 124 * \param uiMaxAQDepth Maximum depth of unit block for assigning QP adaptive to local image characteristics 121 * \param uiMaxAdaptiveQPDepth Maximum depth of unit block for assigning QP adaptive to local image characteristics 125 122 * \param bIsVirtual 126 123 */ … … 128 125 #if SVC_EXTENSION 129 126 // * \param vps reference to used VPS 130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMax Depth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )127 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual, const UInt layerId ) 131 128 { 132 TComPic::create( vps, sps, pps, uiMaxDepth,bIsVirtual, layerId );129 TComPic::create( vps, sps, pps, bIsVirtual, layerId ); 133 130 134 131 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 135 132 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 136 133 #else 137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMax Depth, UInt uiMaxAQDepth, Bool bIsVirtual )134 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual ) 138 135 { 139 TComPic::create( sps, pps, uiMaxDepth,bIsVirtual );136 TComPic::create( sps, pps, bIsVirtual ); 140 137 const Int iWidth = sps.getPicWidthInLumaSamples(); 141 138 const Int iHeight = sps.getPicHeightInLumaSamples(); … … 144 141 const UInt uiMaxWidth = sps.getMaxCUWidth(); 145 142 const UInt uiMaxHeight = sps.getMaxCUHeight(); 146 m_uiMaxAQDepth = uiMaxA QDepth;147 if ( uiMaxA QDepth > 0 )143 m_uiMaxAQDepth = uiMaxAdaptiveQPDepth; 144 if ( uiMaxAdaptiveQPDepth > 0 ) 148 145 { 149 146 m_acAQLayer = new TEncPicQPAdaptationLayer[ m_uiMaxAQDepth ]; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h
r1289 r1290 106 106 107 107 #if SVC_EXTENSION 108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMax Depth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId );108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual /* = false*/, const UInt layerId ); 109 109 #else //SVC_EXTENSION 110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMax Depth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ );110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual /* = false*/ ); 111 111 #endif //SVC_EXTENSION 112 112 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1287 r1290 441 441 { 442 442 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 443 const UInt log2DiffMaxMinCodingBlockSize = pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize(); 443 444 444 445 if ( pcCU->isIntra( uiAbsPartIdx ) ) 445 446 { 446 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)447 if( uiDepth == log2DiffMaxMinCodingBlockSize ) 447 448 { 448 449 m_pcBinIf->encodeBin( eSize == SIZE_2Nx2N? 1 : 0, m_cCUPartSizeSCModel.get( 0, 0, 0 ) ); … … 464 465 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 465 466 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 466 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth)467 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 467 468 { 468 469 if (eSize == SIZE_2NxN) … … 485 486 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 486 487 487 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth&& !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )488 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 488 489 { 489 490 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 490 491 } 491 492 492 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth)493 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 493 494 { 494 495 if (eSize == SIZE_Nx2N) … … 506 507 case SIZE_NxN: 507 508 { 508 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth&& !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )509 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 509 510 { 510 511 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); … … 617 618 Void TEncSbac::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 618 619 { 619 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)620 if( uiDepth == pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() ) 620 621 { 621 622 return; … … 1194 1195 const UInt uiWidth=tuRect.width; 1195 1196 const UInt uiHeight=tuRect.height; 1197 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 1196 1198 1197 1199 DTRACE_CABAC_VL( g_nSymbolCounter++ ) … … 1225 1227 //-------------------------------------------------------------------------------------------------- 1226 1228 1227 if( uiWidth > m_pcSlice->getSPS()->getMaxTrSize() )1229 if( uiWidth > sps.getMaxTrSize() ) 1228 1230 { 1229 1231 std::cerr << "ERROR: codeCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl; … … 1251 1253 1252 1254 const ChannelType channelType = toChannelType(compID); 1253 const Bool extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();1254 1255 const Bool alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();1256 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);1255 const Bool extendedPrecision = sps.getUseExtendedPrecision(); 1256 1257 const Bool alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass(); 1258 const Int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(channelType); 1257 1259 1258 1260 Bool beValid; … … 1266 1268 uiIntraMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 1267 1269 1268 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat())) : uiIntraMode; 1270 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 1271 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat(), partsPerMinCU)) : uiIntraMode; 1269 1272 uiIntraMode = ((rTu.GetChromaFormat() == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiIntraMode] : uiIntraMode; 1270 1273 } … … 1307 1310 //-------------------------------------------------------------------------------------------------- 1308 1311 1309 const Bool bUseGolombRiceParameterAdaptation = pcCU->getSlice()->getSPS()->getUseGolombRiceParameterAdaptation();1312 const Bool bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation(); 1310 1313 UInt ¤tGolombRiceStatistic = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)]; 1311 1314 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1289 r1290 206 206 const UInt maxCUWidth, 207 207 const UInt maxCUHeight, 208 const UInt maxTotalCUDepth, 208 209 TEncEntropy* pcEntropyCoder, 209 210 TComRdCost* pcRdCost, … … 255 256 256 257 const UInt uiNumLayersToAllocate = pcEncCfg->getQuadtreeTULog2MaxSize()-pcEncCfg->getQuadtreeTULog2MinSize()+1; 257 const UInt uiNumPartitions = 1<<( g_uiMaxCUDepth<<1);258 const UInt uiNumPartitions = 1<<(maxTotalCUDepth<<1); 258 259 for (UInt ch=0; ch<MAX_NUM_COMPONENT; ch++) 259 260 { … … 1107 1108 return; 1108 1109 } 1109 const Bool bIsLuma = isLuma(compID); 1110 const TComRectangle &rect= rTu.getRect(compID); 1111 TComDataCU *pcCU=rTu.getCU(); 1112 const UInt uiAbsPartIdx=rTu.GetAbsPartIdxTU(); 1113 1114 const UInt uiTrDepth=rTu.GetTransformDepthRelAdj(compID); 1115 const UInt uiFullDepth = rTu.GetTransformDepthTotal(); 1116 const UInt uiLog2TrSize = rTu.GetLog2LumaTrSize(); 1117 const ChromaFormat chFmt = pcOrgYuv->getChromaFormat(); 1118 const ChannelType chType = toChannelType(compID); 1110 const Bool bIsLuma = isLuma(compID); 1111 const TComRectangle &rect = rTu.getRect(compID); 1112 TComDataCU *pcCU = rTu.getCU(); 1113 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); 1114 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 1115 1116 const UInt uiTrDepth = rTu.GetTransformDepthRelAdj(compID); 1117 const UInt uiFullDepth = rTu.GetTransformDepthTotal(); 1118 const UInt uiLog2TrSize = rTu.GetLog2LumaTrSize(); 1119 const ChromaFormat chFmt = pcOrgYuv->getChromaFormat(); 1120 const ChannelType chType = toChannelType(compID); 1119 1121 #if SVC_EXTENSION 1120 const Int bitDepth= pcCU->getSlice()->getBitDepth(chType);1122 const Int bitDepth = pcCU->getSlice()->getBitDepth(chType); 1121 1123 #else 1122 const Int bitDepth = pcCU->getSlice()->getSPS()->getBitDepth(chType);1123 #endif 1124 1125 const UInt uiWidth= rect.width;1126 const UInt uiHeight= rect.height;1127 const UInt uiStride= pcOrgYuv ->getStride (compID);1128 Pel * piOrg= pcOrgYuv ->getAddr( compID, uiAbsPartIdx );1129 Pel * piPred= pcPredYuv->getAddr( compID, uiAbsPartIdx );1130 Pel * piResi= pcResiYuv->getAddr( compID, uiAbsPartIdx );1131 Pel * piReco= pcPredYuv->getAddr( compID, uiAbsPartIdx );1132 const UInt uiQTLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;1133 Pel * piRecQt= m_pcQTTempTComYuv[ uiQTLayer ].getAddr( compID, uiAbsPartIdx );1134 const UInt uiRecQtStride= m_pcQTTempTComYuv[ uiQTLayer ].getStride(compID);1135 const UInt uiZOrder= pcCU->getZorderIdxInCtu() + uiAbsPartIdx;1136 Pel * piRecIPred= pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), uiZOrder );1137 UInt uiRecIPredStride= pcCU->getPic()->getPicYuvRec()->getStride ( compID );1138 TCoeff * pcCoeff= m_ppcQTTempCoeff[compID][uiQTLayer] + rTu.getCoefficientOffset(compID);1139 Bool useTransformSkip= pcCU->getTransformSkip(uiAbsPartIdx, compID);1124 const Int bitDepth = sps.getBitDepth(chType); 1125 #endif 1126 1127 const UInt uiWidth = rect.width; 1128 const UInt uiHeight = rect.height; 1129 const UInt uiStride = pcOrgYuv ->getStride (compID); 1130 Pel *piOrg = pcOrgYuv ->getAddr( compID, uiAbsPartIdx ); 1131 Pel *piPred = pcPredYuv->getAddr( compID, uiAbsPartIdx ); 1132 Pel *piResi = pcResiYuv->getAddr( compID, uiAbsPartIdx ); 1133 Pel *piReco = pcPredYuv->getAddr( compID, uiAbsPartIdx ); 1134 const UInt uiQTLayer = sps.getQuadtreeTULog2MaxSize() - uiLog2TrSize; 1135 Pel *piRecQt = m_pcQTTempTComYuv[ uiQTLayer ].getAddr( compID, uiAbsPartIdx ); 1136 const UInt uiRecQtStride = m_pcQTTempTComYuv[ uiQTLayer ].getStride(compID); 1137 const UInt uiZOrder = pcCU->getZorderIdxInCtu() + uiAbsPartIdx; 1138 Pel *piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), uiZOrder ); 1139 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride ( compID ); 1140 TCoeff *pcCoeff = m_ppcQTTempCoeff[compID][uiQTLayer] + rTu.getCoefficientOffset(compID); 1141 Bool useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, compID); 1140 1142 1141 1143 #if ADAPTIVE_QP_SELECTION 1142 TCoeff* pcArlCoeff = m_ppcQTTempArlCoeff[compID][ uiQTLayer ] + rTu.getCoefficientOffset(compID); 1143 #endif 1144 1145 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1146 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 1147 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1148 1149 const Int blkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1150 const Int blkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1151 const Int bufferOffset = blkX + (blkY * MAX_CU_SIZE); 1152 Pel *const encoderLumaResidual = resiLuma[RESIDUAL_ENCODER_SIDE ] + bufferOffset; 1153 Pel *const reconstructedLumaResidual = resiLuma[RESIDUAL_RECONSTRUCTED] + bufferOffset; 1154 const Bool bUseCrossCPrediction = isChroma(compID) && (uiChPredMode == DM_CHROMA_IDX) && checkCrossCPrediction; 1155 const Bool bUseReconstructedResidualForEstimate = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate(); 1156 Pel *const lumaResidualForEstimate = bUseReconstructedResidualForEstimate ? reconstructedLumaResidual : encoderLumaResidual; 1144 TCoeff *pcArlCoeff = m_ppcQTTempArlCoeff[compID][ uiQTLayer ] + rTu.getCoefficientOffset(compID); 1145 #endif 1146 1147 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1148 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 1149 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 1150 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1151 1152 const Int blkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1153 const Int blkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1154 const Int bufferOffset = blkX + (blkY * MAX_CU_SIZE); 1155 Pel *const encoderLumaResidual = resiLuma[RESIDUAL_ENCODER_SIDE ] + bufferOffset; 1156 Pel *const reconstructedLumaResidual = resiLuma[RESIDUAL_RECONSTRUCTED] + bufferOffset; 1157 const Bool bUseCrossCPrediction = isChroma(compID) && (uiChPredMode == DM_CHROMA_IDX) && checkCrossCPrediction; 1158 const Bool bUseReconstructedResidualForEstimate = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate(); 1159 Pel *const lumaResidualForEstimate = bUseReconstructedResidualForEstimate ? reconstructedLumaResidual : encoderLumaResidual; 1157 1160 1158 1161 #ifdef DEBUG_STRING -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h
r1289 r1290 140 140 const UInt maxCUWidth, 141 141 const UInt maxCUHeight, 142 const UInt maxTotalCUDepth, 142 143 TEncEntropy* pcEntropyCoder, 143 144 TComRdCost* pcRdCost, -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1289 r1290 117 117 m_cGOPEncoder. create( ); 118 118 #endif 119 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth );120 m_cCuEncoder. create( g_uiMaxCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC );119 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth ); 120 m_cCuEncoder. create( m_maxTotalCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC ); 121 121 if (m_bUseSAO) 122 122 { 123 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );123 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] ); 124 124 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 125 125 m_cEncSAO.createEncData(getSaoCtuBoundary()); … … 135 135 #endif 136 136 137 m_cLoopFilter.create( g_uiMaxCUDepth );137 m_cLoopFilter.create( m_maxTotalCUDepth ); 138 138 139 139 if ( m_RCEnableRateControl ) … … 143 143 } 144 144 145 m_pppcRDSbacCoder = new TEncSbac** [ g_uiMaxCUDepth+1];145 m_pppcRDSbacCoder = new TEncSbac** [m_maxTotalCUDepth+1]; 146 146 #if FAST_BIT_EST 147 m_pppcBinCoderCABAC = new TEncBinCABACCounter** [ g_uiMaxCUDepth+1];147 m_pppcBinCoderCABAC = new TEncBinCABACCounter** [m_maxTotalCUDepth+1]; 148 148 #else 149 m_pppcBinCoderCABAC = new TEncBinCABAC** [ g_uiMaxCUDepth+1];150 #endif 151 152 for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )149 m_pppcBinCoderCABAC = new TEncBinCABAC** [m_maxTotalCUDepth+1]; 150 #endif 151 152 for ( Int iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ ) 153 153 { 154 154 m_pppcRDSbacCoder[iDepth] = new TEncSbac* [CI_NUM]; … … 190 190 m_cRateCtrl. destroy(); 191 191 Int iDepth; 192 for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )192 for ( iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ ) 193 193 { 194 194 for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ ) … … 199 199 } 200 200 201 for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )201 for ( iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ ) 202 202 { 203 203 delete [] m_pppcRDSbacCoder[iDepth]; … … 258 258 259 259 // initialize encoder search class 260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() ); 261 261 262 262 m_iMaxRefPicNum = 0; … … 579 579 { 580 580 rpcPicYuvRec = new TComPicYuv; 581 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);581 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, true); 582 582 } 583 583 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 620 620 { 621 621 rpcPicYuvRec = new TComPicYuv; 622 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);622 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, true); 623 623 } 624 624 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 750 750 } 751 751 752 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth,m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);752 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId); 753 753 #else //SVC_EXTENSION 754 pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth,m_cPPS.getMaxCuDQPDepth()+1, false);754 pcEPic->create( m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false); 755 755 #endif //SVC_EXTENSION 756 756 rpcPic = pcEPic; … … 800 800 } 801 801 802 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth,false, m_layerId );802 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, false, m_layerId ); 803 803 #else //SVC_EXTENSION 804 rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth,false );804 rpcPic->create( m_cSPS, m_cPPS, false ); 805 805 #endif //SVC_EXTENSION 806 806 } … … 884 884 * that chooses the actual compatibility based upon options */ 885 885 886 m_cSPS.setPicWidthInLumaSamples 887 m_cSPS.setPicHeightInLumaSamples 888 m_cSPS.setConformanceWindow 889 m_cSPS.setMaxCUWidth ( m_maxCUWidth);890 m_cSPS.setMaxCUHeight ( m_maxCUHeight);891 m_cSPS.setMax CUDepth ( g_uiMaxCUDepth);886 m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); 887 m_cSPS.setPicHeightInLumaSamples ( m_iSourceHeight ); 888 m_cSPS.setConformanceWindow ( m_conformanceWindow ); 889 m_cSPS.setMaxCUWidth ( m_maxCUWidth ); 890 m_cSPS.setMaxCUHeight ( m_maxCUHeight ); 891 m_cSPS.setMaxTotalCUDepth ( m_maxTotalCUDepth ); 892 892 m_cSPS.setChromaFormatIdc( m_chromaFormatIDC); 893 894 Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth ); 893 m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_log2DiffMaxMinCodingBlockSize); 894 895 Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getLog2DiffMaxMinCodingBlockSize() ); 895 896 Int log2MinCUSize = 0; 896 897 while(minCUSize > 1) … … 901 902 902 903 m_cSPS.setLog2MinCodingBlockSize(log2MinCUSize); 903 m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_cSPS.getMaxCUDepth()-g_uiAddCUDepth-getMaxCUDepthOffset(m_cSPS.getChromaFormatIdc(), m_cSPS.getQuadtreeTULog2MinSize()));904 904 905 #if SVC_EXTENSION 905 906 m_cSPS.setSPSId ( m_iSPSIdCnt ); … … 924 925 { 925 926 #if SVC_EXTENSION 926 m_cSPS.setBitDepth (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) ); 927 m_cSPS.setBitDepth (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) ); 928 #if O0043_BEST_EFFORT_DECODING 929 m_cSPS.setStreamBitDepth(ChannelType(channelType), m_bitDepth[channelType] ); 930 #endif 927 931 m_cSPS.setQpBDOffset (ChannelType(channelType), (6 * (m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) - 8))); 928 #if O0043_BEST_EFFORT_DECODING929 m_cSPS.setStreamBitDepth(ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) );930 #endif931 932 #else 933 m_cSPS.setBitDepth (ChannelType(channelType), m_bitDepth[channelType] ); 932 934 #if O0043_BEST_EFFORT_DECODING 933 935 m_cSPS.setStreamBitDepth(ChannelType(channelType), m_bitDepth[channelType] ); … … 1505 1507 if( m_layerId > 0 ) 1506 1508 { 1507 g_uiMaxCUDepth = m_cSPS.getMaxCUDepth(); 1508 g_uiAddCUDepth = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() ); 1509 1510 if (m_cIlpPic[0] == NULL) 1509 if( m_cIlpPic[0] == NULL ) 1511 1510 { 1512 1511 for (Int j=0; j < m_numDirectRefLayers; j++) 1513 1512 { 1514 1513 m_cIlpPic[j] = new TComPic; 1515 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth,true, m_layerId);1514 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, true, m_layerId); 1516 1515 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 1517 1516 {
Note: See TracChangeset for help on using the changeset viewer.