Changeset 1290 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 18 Jul 2015, 01:59:29 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
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.