Changeset 1200 in 3DVCSoftware for branches/HTM-14.1-update-dev0/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 4 May 2015, 18:38:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r1196 r1200 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 37 37 38 38 #include "TDecCu.h" 39 #include "TLibCommon/TComTU.h" 40 #include "TLibCommon/TComPrediction.h" 39 41 40 42 //! \ingroup TLibDecoder … … 67 69 68 70 /** 69 \param uiMaxDepth total number of allowable depth 70 \param uiMaxWidth largest CU width 71 \param uiMaxHeight largest CU height 71 \param uiMaxDepth total number of allowable depth 72 \param uiMaxWidth largest CU width 73 \param uiMaxHeight largest CU height 74 \param chromaFormatIDC chroma format 72 75 */ 73 Void TDecCu::create( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight )76 Void TDecCu::create( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC ) 74 77 { 75 78 m_uiMaxDepth = uiMaxDepth+1; 76 79 77 80 m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1]; 78 81 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; … … 81 84 m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1]; 82 85 #endif 83 86 84 87 UInt uiNumPartitions; 85 88 for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) … … 88 91 UInt uiWidth = uiMaxWidth >> ui; 89 92 UInt uiHeight = uiMaxHeight >> ui; 90 91 m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight );92 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight );93 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );93 94 m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 95 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 96 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 94 97 #if H_3D_DBBP 95 98 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight ); 96 99 #endif 97 98 100 } 101 99 102 m_bDecodeDQP = false; 103 m_IsChromaQpAdjCoded = false; 100 104 101 105 // initialize partition order. … … 103 107 initZscanToRaster(m_uiMaxDepth, 1, 0, piTmp); 104 108 initRasterToZscan( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); 105 109 106 110 // initialize conversion matrix from partition index to pel 107 111 initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); … … 119 123 #endif 120 124 } 121 125 122 126 delete [] m_ppcYuvResi; m_ppcYuvResi = NULL; 123 127 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; … … 132 136 // ==================================================================================================================== 133 137 134 /** \param pcCU pointer of CU data 135 \param ruiIsLast last data? 138 /** 139 Parse a CTU. 140 \param pCtu [in/out] pointer to CTU data structure 141 \param isLastCtuOfSliceSegment [out] true, if last CTU of the slice segment 136 142 */ 137 Void TDecCu::decodeC U( TComDataCU* pcCU, UInt& ruiIsLast )138 { 139 if ( p cCU->getSlice()->getPPS()->getUseDQP() )143 Void TDecCu::decodeCtu( TComDataCU* pCtu, Bool& isLastCtuOfSliceSegment ) 144 { 145 if ( pCtu->getSlice()->getPPS()->getUseDQP() ) 140 146 { 141 147 setdQPFlag(true); 142 148 } 143 149 150 if ( pCtu->getSlice()->getUseChromaQpAdj() ) 151 { 152 setIsChromaQpAdjCoded(true); 153 } 154 144 155 // start from the top level CU 145 xDecodeCU( pcCU, 0, 0, ruiIsLast); 146 } 147 148 /** \param pcCU pointer of CU data 156 xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment); 157 } 158 159 /** 160 Decoding process for a CTU. 161 \param pCtu [in/out] pointer to CTU data structure 149 162 */ 150 Void TDecCu::decompressC U( TComDataCU* pcCU)163 Void TDecCu::decompressCtu( TComDataCU* pCtu ) 151 164 { 152 165 #if !H_3D_IV_MERGE 153 xDecompressCU( p cCU, 0, 0 );166 xDecompressCU( pCtu, 0, 0 ); 154 167 #endif 155 168 } … … 159 172 // ==================================================================================================================== 160 173 161 /**decode end-of-slice flag 162 * \param pcCU 163 * \param uiAbsPartIdx 164 * \param uiDepth 165 * \returns Bool 166 */ 167 Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth) 168 { 169 UInt uiIsLast; 170 TComPic* pcPic = pcCU->getPic(); 171 TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); 172 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 173 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 174 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 175 UInt uiGranularityWidth = g_uiMaxCUWidth; 176 UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 177 UInt uiPosY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 178 179 if(((uiPosX+pcCU->getWidth(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosX+pcCU->getWidth(uiAbsPartIdx)==uiWidth)) 180 &&((uiPosY+pcCU->getHeight(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosY+pcCU->getHeight(uiAbsPartIdx)==uiHeight))) 181 { 182 m_pcEntropyDecoder->decodeTerminatingBit( uiIsLast ); 174 //! decode end-of-slice flag 175 Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx ) 176 { 177 UInt uiIsLastCtuOfSliceSegment; 178 179 if (pcCU->isLastSubCUOfCtu(uiAbsPartIdx)) 180 { 181 m_pcEntropyDecoder->decodeTerminatingBit( uiIsLastCtuOfSliceSegment ); 183 182 } 184 183 else 185 184 { 186 uiIsLast=0; 187 } 188 189 if(uiIsLast) 190 { 191 if(pcSlice->isNextSliceSegment()&&!pcSlice->isNextSlice()) 192 { 193 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 194 } 195 else 196 { 197 pcSlice->setSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 198 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 199 } 200 } 201 202 return uiIsLast>0; 203 } 204 205 /** decode CU block recursively 206 * \param pcCU 207 * \param uiAbsPartIdx 208 * \param uiDepth 209 * \returns Void 210 */ 211 212 Void TDecCu::xDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& ruiIsLast) 213 { 214 TComPic* pcPic = pcCU->getPic(); 215 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 185 uiIsLastCtuOfSliceSegment=0; 186 } 187 188 return uiIsLastCtuOfSliceSegment>0; 189 } 190 191 //! decode CU block recursively 192 Void TDecCu::xDecodeCU( TComDataCU*const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment) 193 { 194 TComPic* pcPic = pcCU->getPic(); 195 const TComSPS &sps = pcPic->getPicSym()->getSPS(); 196 const TComPPS &pps = pcPic->getPicSym()->getPPS(); 197 const UInt maxCuWidth = sps.getMaxCUWidth(); 198 const UInt maxCuHeight= sps.getMaxCUHeight(); 199 UInt uiCurNumParts = pcPic->getNumPartitionsInCtu() >> (uiDepth<<1); 216 200 UInt uiQNumParts = uiCurNumParts>>2; 217 201 202 218 203 Bool bBoundary = false; 219 204 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 220 UInt uiRPelX = uiLPelX + ( g_uiMaxCUWidth>>uiDepth) - 1;205 UInt uiRPelX = uiLPelX + (maxCuWidth>>uiDepth) - 1; 221 206 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 222 UInt uiBPelY = uiTPelY + ( g_uiMaxCUHeight>>uiDepth) - 1;207 UInt uiBPelY = uiTPelY + (maxCuHeight>>uiDepth) - 1; 223 208 #if H_MV_ENC_DEC_TRAC 224 209 DTRACE_CU_S("=========== coding_quadtree ===========\n") 225 210 DTRACE_CU("x0", uiLPelX) 226 211 DTRACE_CU("x1", uiTPelY) 227 DTRACE_CU("log2CbSize", g_uiMaxCUWidth>>uiDepth)212 DTRACE_CU("log2CbSize", maxCuWidth>>uiDepth) 228 213 DTRACE_CU("cqtDepth" , uiDepth) 229 214 #endif 230 215 231 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 232 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 233 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 216 if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) 234 217 { 235 218 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 239 222 bBoundary = true; 240 223 } 241 242 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 224 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 243 225 { 244 226 UInt uiIdx = uiAbsPartIdx; 245 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())227 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 246 228 { 247 229 setdQPFlag(true); … … 249 231 } 250 232 233 if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 234 { 235 setIsChromaQpAdjCoded(true); 236 } 237 251 238 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) 252 239 { 253 240 uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; 254 241 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 255 256 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr(); 257 if ( bSubInSlice ) 258 { 259 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 260 { 261 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); 262 } 263 else 264 { 265 pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); 266 } 267 } 268 242 243 if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) 244 { 245 xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment ); 246 } 247 else 248 { 249 pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); 250 } 251 269 252 uiIdx += uiQNumParts; 270 253 } 271 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())254 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 272 255 { 273 256 if ( getdQPFlag() ) 274 257 { 275 UInt uiQPSrcPartIdx; 276 if ( pcPic->getCU( pcCU->getAddr() )->getSliceSegmentStartCU(uiAbsPartIdx) != pcSlice->getSliceSegmentCurStartCUAddr() ) 277 { 278 uiQPSrcPartIdx = pcSlice->getSliceSegmentCurStartCUAddr() % pcPic->getNumPartInCU(); 279 } 280 else 281 { 282 uiQPSrcPartIdx = uiAbsPartIdx; 283 } 258 UInt uiQPSrcPartIdx = uiAbsPartIdx; 284 259 pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP 285 260 } … … 287 262 return; 288 263 } 289 264 290 265 #if H_MV_ENC_DEC_TRAC 291 266 DTRACE_CU_S("=========== coding_unit ===========\n") … … 303 278 #endif 304 279 305 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())280 if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP()) 306 281 { 307 282 setdQPFlag(true); … … 316 291 #endif 317 292 318 319 if(!pcCU->getSlice()->isIntra()) 293 if(!pcCU->getSlice()->isIntra()) 320 294 { 321 295 #if H_3D_ARP && H_3D_IV_MERGE … … 380 354 } 381 355 #endif 382 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 356 357 if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 358 { 359 setIsChromaQpAdjCoded(true); 360 } 361 362 if (pps.getTransquantBypassEnableFlag()) 383 363 { 384 364 m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); 385 365 } 386 366 387 367 // decode CU mode and the partition size 388 368 if( !pcCU->getSlice()->isIntra()) … … 390 370 m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 391 371 } 392 372 373 393 374 if( pcCU->isSkipped(uiAbsPartIdx) ) 394 375 { … … 460 441 TComMv cTmpMv( 0, 0 ); 461 442 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 462 { 443 { 463 444 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 464 445 { … … 524 505 #endif 525 506 526 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );507 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 527 508 #if H_3D_IV_MERGE 528 509 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 529 510 #endif 511 530 512 return; 531 513 } … … 535 517 { 536 518 #endif 519 537 520 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 538 521 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); … … 547 530 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 548 531 #endif 549 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );532 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 550 533 #if H_3D_IV_MERGE 551 534 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); … … 555 538 } 556 539 557 UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx );558 UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx );559 560 540 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 561 541 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); … … 563 543 // Coefficient decoding 564 544 Bool bCodeDQP = getdQPFlag(); 565 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP ); 545 Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded(); 546 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded ); 547 setIsChromaQpAdjCoded( isChromaQpAdjCoded ); 566 548 setdQPFlag( bCodeDQP ); 567 549 #if H_3D 568 550 } 569 551 #endif 570 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );552 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 571 553 #if H_3D_IV_MERGE 572 554 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); … … 574 556 } 575 557 576 Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& ruiIsLast)558 Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &isLastCtuOfSliceSegment) 577 559 { 578 560 if( pcCU->getSlice()->getPPS()->getUseDQP()) … … 581 563 } 582 564 583 ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth); 584 } 585 586 Void TDecCu::xDecompressCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 587 { 588 TComPic* pcPic = pcCU->getPic(); 565 if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded()) 566 { 567 pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP 568 } 569 570 isLastCtuOfSliceSegment = xDecodeSliceEnd( pcCU, uiAbsPartIdx ); 571 } 572 573 Void TDecCu::xDecompressCU( TComDataCU* pCtu, UInt uiAbsPartIdx, UInt uiDepth ) 574 { 575 TComPic* pcPic = pCtu->getPic(); 589 576 #if !H_3D_IV_MERGE 577 TComSlice * pcSlice = pCtu->getSlice(); 578 const TComSPS &sps=*(pcSlice->getSPS()); 579 590 580 Bool bBoundary = false; 591 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 592 UInt uiRPelX = uiLPelX + (g_uiMaxCUWidth>>uiDepth) - 1; 593 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 594 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 595 596 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 597 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 598 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 599 if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 581 UInt uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 582 UInt uiRPelX = uiLPelX + (sps.getMaxCUWidth()>>uiDepth) - 1; 583 UInt uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 584 UInt uiBPelY = uiTPelY + (sps.getMaxCUHeight()>>uiDepth) - 1; 585 586 if( ( uiRPelX >= sps.getPicWidthInLumaSamples() ) || ( uiBPelY >= sps.getPicHeightInLumaSamples() ) ) 600 587 { 601 588 bBoundary = true; 602 589 } 603 590 604 if( ( ( uiDepth < p cCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth) ) || bBoundary )591 if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 605 592 { 606 593 UInt uiNextDepth = uiDepth + 1; 607 UInt uiQNumParts = p cCU->getTotalNumPart() >> (uiNextDepth<<1);594 UInt uiQNumParts = pCtu->getTotalNumPart() >> (uiNextDepth<<1); 608 595 UInt uiIdx = uiAbsPartIdx; 609 596 for ( UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++ ) 610 597 { 611 uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; 612 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 613 614 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 615 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 616 { 617 xDecompressCU(pcCU, uiIdx, uiNextDepth ); 598 uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; 599 uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 600 601 if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) 602 { 603 xDecompressCU(pCtu, uiIdx, uiNextDepth ); 618 604 } 619 605 … … 622 608 return; 623 609 } 624 #endif 610 #endif 625 611 // Residual reconstruction 626 612 m_ppcYuvResi[uiDepth]->clear(); 627 613 628 m_ppcCU[uiDepth]->copySubCU( p cCU, uiAbsPartIdx, uiDepth);614 m_ppcCU[uiDepth]->copySubCU( pCtu, uiAbsPartIdx ); 629 615 630 616 switch( m_ppcCU[uiDepth]->getPredictionMode(0) ) 631 617 { 632 case MODE_INTER:618 case MODE_INTER: 633 619 #if H_3D_DBBP 634 620 if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) … … 647 633 { 648 634 #endif 649 635 xReconInter( m_ppcCU[uiDepth], uiDepth ); 650 636 #if H_3D_INTER_SDC 651 637 } … … 654 640 } 655 641 #endif 656 break;657 case MODE_INTRA:642 break; 643 case MODE_INTRA: 658 644 #if H_3D 659 645 if( m_ppcCU[uiDepth]->getDISFlag(0) ) … … 670 656 #endif 671 657 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 672 break; 673 default: 674 assert(0); 675 break; 676 } 658 break; 659 default: 660 assert(0); 661 break; 662 } 663 664 #if DEBUG_STRING 665 const PredMode predMode=m_ppcCU[uiDepth]->getPredictionMode(0); 666 if (DebugOptionList::DebugString_Structure.getInt()&DebugStringGetPredModeMask(predMode)) 667 { 668 PartSize eSize=m_ppcCU[uiDepth]->getPartitionSize(0); 669 std::ostream &ss(std::cout); 670 671 ss <<"###: " << (predMode==MODE_INTRA?"Intra ":"Inter ") << partSizeToString[eSize] << " CU at " << m_ppcCU[uiDepth]->getCUPelX() << ", " << m_ppcCU[uiDepth]->getCUPelY() << " width=" << UInt(m_ppcCU[uiDepth]->getWidth(0)) << std::endl; 672 } 673 #endif 674 677 675 if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) 678 676 { … … 685 683 Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiDepth ) 686 684 { 687 685 688 686 // inter prediction 689 687 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 690 688 689 #if DEBUG_STRING 690 const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER); 691 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) 692 { 693 printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); 694 } 695 #endif 696 691 697 // inter recon 692 xDecodeInterTexture( pcCU, 0, uiDepth ); 693 698 xDecodeInterTexture( pcCU, uiDepth ); 699 700 #if DEBUG_STRING 701 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) 702 { 703 printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); 704 } 705 #endif 706 694 707 // clip for only non-zero cbp case 695 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V )) )696 { 697 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );708 if ( pcCU->getQtRootCbf( 0) ) 709 { 710 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); 698 711 } 699 712 else … … 701 714 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 702 715 } 716 #if DEBUG_STRING 717 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) 718 { 719 printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); 720 } 721 #endif 722 703 723 } 704 724 … … 924 944 #endif 925 945 946 926 947 Void 927 TDecCu::xIntraRecLumaBlk( TComDataCU* pcCU, 928 UInt uiTrDepth, 929 UInt uiAbsPartIdx, 930 TComYuv* pcRecoYuv, 931 TComYuv* pcPredYuv, 932 TComYuv* pcResiYuv ) 933 { 934 UInt uiWidth = pcCU ->getWidth ( 0 ) >> uiTrDepth; 935 UInt uiHeight = pcCU ->getHeight ( 0 ) >> uiTrDepth; 936 UInt uiStride = pcRecoYuv->getStride (); 937 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 938 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 939 Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 940 941 UInt uiNumCoeffInc = ( pcCU->getSlice()->getSPS()->getMaxCUWidth() * pcCU->getSlice()->getSPS()->getMaxCUHeight() ) >> ( pcCU->getSlice()->getSPS()->getMaxCUDepth() << 1 ); 942 TCoeff* pcCoeff = pcCU->getCoeffY() + ( uiNumCoeffInc * uiAbsPartIdx ); 943 944 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 945 946 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 947 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 948 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 949 Bool useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, TEXT_LUMA); 948 TDecCu::xIntraRecBlk( TComYuv* pcRecoYuv, 949 TComYuv* pcPredYuv, 950 TComYuv* pcResiYuv, 951 const ComponentID compID, 952 TComTU &rTu) 953 { 954 if (!rTu.ProcessComponentSection(compID)) 955 { 956 return; 957 } 958 const Bool bIsLuma = isLuma(compID); 959 960 961 TComDataCU *pcCU = rTu.getCU(); 962 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 963 const UInt uiAbsPartIdx=rTu.GetAbsPartIdxTU(); 964 965 const TComRectangle &tuRect =rTu.getRect(compID); 966 const UInt uiWidth = tuRect.width; 967 const UInt uiHeight = tuRect.height; 968 const UInt uiStride = pcRecoYuv->getStride (compID); 969 Pel* piPred = pcPredYuv->getAddr( compID, uiAbsPartIdx ); 970 const ChromaFormat chFmt = rTu.GetChromaFormat(); 971 972 if (uiWidth != uiHeight) 973 { 974 //------------------------------------------------ 975 976 //split at current level if dividing into square sub-TUs 977 978 TComTURecurse subTURecurse(rTu, false, TComTU::VERTICAL_SPLIT, true, compID); 979 980 //recurse further 981 do 982 { 983 xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse); 984 } while (subTURecurse.nextSection(rTu)); 985 986 //------------------------------------------------ 987 988 return; 989 } 990 991 const UInt uiChPredMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 992 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 993 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 994 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 995 950 996 //===== init availability pattern ===== 951 997 Bool bAboveAvail = false; 952 998 Bool bLeftAvail = false; 953 pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx ); 954 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, 955 m_pcPrediction->getPredicBuf (), 956 m_pcPrediction->getPredicBufWidth (), 957 m_pcPrediction->getPredicBufHeight (), 958 bAboveAvail, bLeftAvail ); 959 999 1000 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 1001 1002 #if DEBUG_STRING 1003 std::ostream &ss(std::cout); 1004 #endif 1005 1006 DEBUG_STRING_NEW(sTemp) 1007 m_pcPrediction->initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); 1008 1009 960 1010 //===== get prediction signal ===== 961 1011 #if H_3D_DIM … … 967 1017 { 968 1018 #endif 969 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1019 1020 m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions ); 970 1021 #if H_3D_DIM 971 1022 } 972 1023 #endif 973 1024 1025 #if DEBUG_STRING 1026 ss << sTemp; 1027 #endif 1028 1029 //===== inverse transform ===== 1030 Pel* piResi = pcResiYuv->getAddr( compID, uiAbsPartIdx ); 1031 TCoeff* pcCoeff = pcCU->getCoeff(compID) + rTu.getCoefficientOffset(compID);//( uiNumCoeffInc * uiAbsPartIdx ); 1032 1033 const QpParam cQP(*pcCU, compID); 1034 1035 1036 DEBUG_STRING_NEW(sDebug); 1037 #if DEBUG_STRING 1038 const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTRA); 1039 std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0; 1040 #endif 974 1041 #if H_3D 975 1042 Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()); … … 977 1044 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag ) 978 1045 #else 979 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) ) 980 #endif 981 { 982 //===== inverse transform ===== 983 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 984 985 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; 986 assert(scalingListType < SCALING_LIST_NUM); 987 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkip ); 988 989 1046 if (pcCU->getCbf(uiAbsPartIdx, compID, rTu.GetTransformDepthRel()) != 0) 1047 #endif 1048 { 1049 m_pcTrQuant->invTransformNxN( rTu, compID, piResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) ); 1050 } 1051 else 1052 { 1053 for (UInt y = 0; y < uiHeight; y++) 1054 { 1055 for (UInt x = 0; x < uiWidth; x++) 1056 { 1057 piResi[(y * uiStride) + x] = 0; 1058 } 1059 } 1060 } 1061 1062 #if DEBUG_STRING 1063 if (psDebug) 1064 { 1065 ss << (*psDebug); 1066 } 1067 #endif 1068 990 1069 //===== reconstruction ===== 991 Pel* pPred = piPred; 992 Pel* pResi = piResi; 993 Pel* pReco = piReco; 994 Pel* pRecIPred = piRecIPred; 1070 const UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride(compID); 1071 1072 const Bool useCrossComponentPrediction = isChroma(compID) && (pcCU->getCrossComponentPredictionAlpha(uiAbsPartIdx, compID) != 0); 1073 const Pel* pResiLuma = pcResiYuv->getAddr( COMPONENT_Y, uiAbsPartIdx ); 1074 const Int strideLuma = pcResiYuv->getStride( COMPONENT_Y ); 1075 1076 Pel* pPred = piPred; 1077 Pel* pResi = piResi; 1078 Pel* pReco = pcRecoYuv->getAddr( compID, uiAbsPartIdx ); 1079 Pel* pRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 1080 1081 1082 #if DEBUG_STRING 1083 const Bool bDebugPred=((DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); 1084 const Bool bDebugResi=((DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); 1085 const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); 1086 if (bDebugPred || bDebugResi || bDebugReco) 1087 { 1088 ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl; 1089 } 1090 #endif 1091 1092 const Int clipbd = sps.getBitDepth(toChannelType(compID)); 1093 #if O0043_BEST_EFFORT_DECODING 1094 const Int bitDepthDelta = sps.getStreamBitDepth(toChannelType(compID)) - clipbd; 1095 #endif 1096 1097 if( useCrossComponentPrediction ) 1098 { 1099 TComTrQuant::crossComponentPrediction( rTu, compID, pResiLuma, piResi, piResi, uiWidth, uiHeight, strideLuma, uiStride, uiStride, true ); 1100 } 1101 995 1102 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 996 1103 { 1104 #if DEBUG_STRING 1105 if (bDebugPred || bDebugResi || bDebugReco) 1106 { 1107 ss << "###: "; 1108 } 1109 1110 if (bDebugPred) 1111 { 1112 ss << " - pred: "; 1113 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1114 { 1115 ss << pPred[ uiX ] << ", "; 1116 } 1117 } 1118 if (bDebugResi) 1119 { 1120 ss << " - resi: "; 1121 } 1122 #endif 1123 997 1124 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 998 1125 { 999 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 1126 #if DEBUG_STRING 1127 if (bDebugResi) 1128 { 1129 ss << pResi[ uiX ] << ", "; 1130 } 1131 #endif 1132 #if O0043_BEST_EFFORT_DECODING 1133 pReco [ uiX ] = ClipBD( rightShiftEvenRounding<Pel>(pPred[ uiX ] + pResi[ uiX ], bitDepthDelta), clipbd ); 1134 #else 1135 pReco [ uiX ] = ClipBD( pPred[ uiX ] + pResi[ uiX ], clipbd ); 1136 #endif 1000 1137 pRecIPred[ uiX ] = pReco[ uiX ]; 1001 1138 } 1139 #if DEBUG_STRING 1140 if (bDebugReco) 1141 { 1142 ss << " - reco: "; 1143 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1144 { 1145 ss << pReco[ uiX ] << ", "; 1146 } 1147 } 1148 1149 if (bDebugPred || bDebugResi || bDebugReco) 1150 { 1151 ss << "\n"; 1152 } 1153 #endif 1002 1154 pPred += uiStride; 1003 1155 pResi += uiStride; … … 1006 1158 } 1007 1159 } 1008 else1009 {1010 //===== reconstruction =====1011 Pel* pPred = piPred;1012 Pel* pReco = piReco;1013 Pel* pRecIPred = piRecIPred;1014 for ( Int y = 0; y < uiHeight; y++ )1015 {1016 for ( Int x = 0; x < uiWidth; x++ )1017 {1018 pReco [ x ] = pPred[ x ];1019 pRecIPred[ x ] = pReco[ x ];1020 }1021 pPred += uiStride;1022 pReco += uiStride;1023 pRecIPred += uiRecIPredStride;1024 }1025 }1026 }1027 1028 1029 Void1030 TDecCu::xIntraRecChromaBlk( TComDataCU* pcCU,1031 UInt uiTrDepth,1032 UInt uiAbsPartIdx,1033 TComYuv* pcRecoYuv,1034 TComYuv* pcPredYuv,1035 TComYuv* pcResiYuv,1036 UInt uiChromaId )1037 {1038 UInt uiFullDepth = pcCU->getDepth( 0 ) + uiTrDepth;1039 UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiFullDepth ] + 2;1040 1041 if( uiLog2TrSize == 2 )1042 {1043 assert( uiTrDepth > 0 );1044 uiTrDepth--;1045 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth( 0 ) + uiTrDepth ) << 1 );1046 Bool bFirstQ = ( ( uiAbsPartIdx % uiQPDiv ) == 0 );1047 if( !bFirstQ )1048 {1049 return;1050 }1051 }1052 1053 TextType eText = ( uiChromaId > 0 ? TEXT_CHROMA_V : TEXT_CHROMA_U );1054 UInt uiWidth = pcCU ->getWidth ( 0 ) >> ( uiTrDepth + 1 );1055 UInt uiHeight = pcCU ->getHeight ( 0 ) >> ( uiTrDepth + 1 );1056 UInt uiStride = pcRecoYuv->getCStride ();1057 Pel* piReco = ( uiChromaId > 0 ? pcRecoYuv->getCrAddr( uiAbsPartIdx ) : pcRecoYuv->getCbAddr( uiAbsPartIdx ) );1058 Pel* piPred = ( uiChromaId > 0 ? pcPredYuv->getCrAddr( uiAbsPartIdx ) : pcPredYuv->getCbAddr( uiAbsPartIdx ) );1059 Pel* piResi = ( uiChromaId > 0 ? pcResiYuv->getCrAddr( uiAbsPartIdx ) : pcResiYuv->getCbAddr( uiAbsPartIdx ) );1060 1061 UInt uiNumCoeffInc = ( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() * pcCU->getSlice()->getSPS()->getMaxCUHeight() ) >> ( pcCU->getSlice()->getSPS()->getMaxCUDepth() << 1 ) ) >> 2;1062 TCoeff* pcCoeff = ( uiChromaId > 0 ? pcCU->getCoeffCr() : pcCU->getCoeffCb() ) + ( uiNumCoeffInc * uiAbsPartIdx );1063 1064 UInt uiChromaPredMode = pcCU->getChromaIntraDir( 0 );1065 1066 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;1067 Pel* piRecIPred = ( uiChromaId > 0 ? pcCU->getPic()->getPicYuvRec()->getCrAddr( pcCU->getAddr(), uiZOrder ) : pcCU->getPic()->getPicYuvRec()->getCbAddr( pcCU->getAddr(), uiZOrder ) );1068 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getCStride();1069 Bool useTransformSkipChroma = pcCU->getTransformSkip(uiAbsPartIdx,eText);1070 //===== init availability pattern =====1071 Bool bAboveAvail = false;1072 Bool bLeftAvail = false;1073 pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx );1074 1075 pcCU->getPattern()->initAdiPatternChroma( pcCU, uiAbsPartIdx, uiTrDepth,1076 m_pcPrediction->getPredicBuf (),1077 m_pcPrediction->getPredicBufWidth (),1078 m_pcPrediction->getPredicBufHeight (),1079 bAboveAvail, bLeftAvail );1080 Int* pPatChroma = ( uiChromaId > 0 ? pcCU->getPattern()->getAdiCrBuf( uiWidth, uiHeight, m_pcPrediction->getPredicBuf() ) : pcCU->getPattern()->getAdiCbBuf( uiWidth, uiHeight, m_pcPrediction->getPredicBuf() ) );1081 1082 //===== get prediction signal =====1083 {1084 if( uiChromaPredMode == DM_CHROMA_IDX )1085 {1086 uiChromaPredMode = pcCU->getLumaIntraDir( 0 );1087 1160 #if H_3D_DIM 1088 1161 mapDepthModeToIntraDir( uiChromaPredMode ); 1089 1162 #endif 1090 }1091 m_pcPrediction->predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );1092 }1093 1094 if ( pcCU->getCbf( uiAbsPartIdx, eText, uiTrDepth ) )1095 {1096 //===== inverse transform =====1097 Int curChromaQpOffset;1098 if(eText == TEXT_CHROMA_U)1099 {1100 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb();1101 }1102 else1103 {1104 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();1105 }1106 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );1107 1108 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText];1109 assert(scalingListType < SCALING_LIST_NUM);1110 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkipChroma );1111 1112 //===== reconstruction =====1113 Pel* pPred = piPred;1114 Pel* pResi = piResi;1115 Pel* pReco = piReco;1116 Pel* pRecIPred = piRecIPred;1117 for( UInt uiY = 0; uiY < uiHeight; uiY++ )1118 {1119 for( UInt uiX = 0; uiX < uiWidth; uiX++ )1120 {1121 pReco [ uiX ] = ClipC( pPred[ uiX ] + pResi[ uiX ] );1122 pRecIPred[ uiX ] = pReco[ uiX ];1123 }1124 pPred += uiStride;1125 pResi += uiStride;1126 pReco += uiStride;1127 pRecIPred += uiRecIPredStride;1128 }1129 }1130 else1131 {1132 //===== reconstruction =====1133 Pel* pPred = piPred;1134 Pel* pReco = piReco;1135 Pel* pRecIPred = piRecIPred;1136 for ( Int y = 0; y < uiHeight; y++ )1137 {1138 for ( Int x = 0; x < uiWidth; x++ )1139 {1140 pReco [ x ] = pPred[ x ];1141 pRecIPred[ x ] = pReco[ x ];1142 }1143 pPred += uiStride;1144 pReco += uiStride;1145 pRecIPred += uiRecIPredStride;1146 }1147 }1148 }1149 1163 1150 1164 … … 1152 1166 TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiDepth ) 1153 1167 { 1154 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 );1155 UInt uiNumPart = pcCU->getNumPartitions();1156 UInt uiNumQParts = pcCU->getTotalNumPart() >> 2;1157 1158 1168 if (pcCU->getIPCMFlag(0)) 1159 1169 { … … 1161 1171 return; 1162 1172 } 1163 1164 for( UInt uiPU = 0; uiPU < uiNumPart; uiPU++ ) 1165 { 1166 xIntraLumaRecQT( pcCU, uiInitTrDepth, uiPU * uiNumQParts, m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth] ); 1167 } 1168 1169 for( UInt uiPU = 0; uiPU < uiNumPart; uiPU++ ) 1170 { 1171 xIntraChromaRecQT( pcCU, uiInitTrDepth, uiPU * uiNumQParts, m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth] ); 1172 } 1173 1173 const UInt numChType = pcCU->getPic()->getChromaFormat()!=CHROMA_400 ? 2 : 1; 1174 for (UInt chType=CHANNEL_TYPE_LUMA; chType<numChType; chType++) 1175 { 1176 const ChannelType chanType=ChannelType(chType); 1177 const Bool NxNPUHas4Parts = ::isChroma(chanType) ? enable4ChromaPUsInIntraNxNCU(pcCU->getPic()->getChromaFormat()) : true; 1178 const UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) != SIZE_2Nx2N && NxNPUHas4Parts ? 1 : 0 ); 1179 1180 TComTURecurse tuRecurseCU(pcCU, 0); 1181 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (uiInitTrDepth==0)?TComTU::DONT_SPLIT : TComTU::QUAD_SPLIT); 1182 1183 do 1184 { 1185 xIntraRecQT( m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], chanType, tuRecurseWithPU ); 1186 } while (tuRecurseWithPU.nextSection(tuRecurseCU)); 1187 } 1174 1188 } 1175 1189 … … 1369 1383 #endif 1370 1384 1371 /** Function for deriving recontructed PU/CU Luma sample with QTree structure 1372 * \param pcCU pointer of current CU 1373 * \param uiTrDepth current tranform split depth 1374 * \param uiAbsPartIdx part index 1385 1386 /** Function for deriving reconstructed PU/CU chroma samples with QTree structure 1375 1387 * \param pcRecoYuv pointer to reconstructed sample arrays 1376 1388 * \param pcPredYuv pointer to prediction sample arrays 1377 1389 * \param pcResiYuv pointer to residue sample arrays 1378 * 1379 \ This function dervies recontructed PU/CU Luma sample with recursive QTree structure 1390 * \param chType texture channel type (luma/chroma) 1391 * \param rTu reference to transform data 1392 * 1393 \ This function derives reconstructed PU/CU chroma samples with QTree recursive structure 1380 1394 */ 1395 1381 1396 Void 1382 TDecCu::xIntraLumaRecQT( TComDataCU* pcCU, 1383 UInt uiTrDepth, 1384 UInt uiAbsPartIdx, 1385 TComYuv* pcRecoYuv, 1386 TComYuv* pcPredYuv, 1387 TComYuv* pcResiYuv ) 1388 { 1389 UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; 1397 TDecCu::xIntraRecQT(TComYuv* pcRecoYuv, 1398 TComYuv* pcPredYuv, 1399 TComYuv* pcResiYuv, 1400 const ChannelType chType, 1401 TComTU &rTu) 1402 { 1403 UInt uiTrDepth = rTu.GetTransformDepthRel(); 1404 TComDataCU *pcCU = rTu.getCU(); 1405 UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); 1390 1406 UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); 1391 1407 if( uiTrMode == uiTrDepth ) 1392 1408 { 1393 xIntraRecLumaBlk ( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv ); 1409 if (isLuma(chType)) 1410 { 1411 xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y, rTu ); 1412 } 1413 else 1414 { 1415 const UInt numValidComp=getNumberValidComponents(rTu.GetChromaFormat()); 1416 for(UInt compID=COMPONENT_Cb; compID<numValidComp; compID++) 1417 { 1418 xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, ComponentID(compID), rTu ); 1419 } 1420 } 1394 1421 } 1395 1422 else 1396 1423 { 1397 UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); 1398 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1399 { 1400 xIntraLumaRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); 1401 } 1402 } 1403 } 1404 1405 /** Function for deriving recontructed PU/CU chroma samples with QTree structure 1406 * \param pcCU pointer of current CU 1407 * \param uiTrDepth current tranform split depth 1408 * \param uiAbsPartIdx part index 1409 * \param pcRecoYuv pointer to reconstructed sample arrays 1410 * \param pcPredYuv pointer to prediction sample arrays 1411 * \param pcResiYuv pointer to residue sample arrays 1412 * 1413 \ This function dervies recontructed PU/CU chroma samples with QTree recursive structure 1414 */ 1415 Void 1416 TDecCu::xIntraChromaRecQT( TComDataCU* pcCU, 1417 UInt uiTrDepth, 1418 UInt uiAbsPartIdx, 1419 TComYuv* pcRecoYuv, 1420 TComYuv* pcPredYuv, 1421 TComYuv* pcResiYuv ) 1422 { 1423 UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; 1424 UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); 1425 if( uiTrMode == uiTrDepth ) 1426 { 1427 xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 0 ); 1428 xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 1 ); 1429 } 1430 else 1431 { 1432 UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); 1433 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1434 { 1435 xIntraChromaRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); 1436 } 1424 TComTURecurse tuRecurseChild(rTu, false); 1425 do 1426 { 1427 xIntraRecQT( pcRecoYuv, pcPredYuv, pcResiYuv, chType, tuRecurseChild ); 1428 } while (tuRecurseChild.nextSection(rTu)); 1437 1429 } 1438 1430 } … … 1440 1432 Void TDecCu::xCopyToPic( TComDataCU* pcCU, TComPic* pcPic, UInt uiZorderIdx, UInt uiDepth ) 1441 1433 { 1442 UInt uiC UAddr = pcCU->getAddr();1443 1444 m_ppcYuvReco[uiDepth]->copyToPicYuv ( pcPic->getPicYuvRec (), uiC UAddr, uiZorderIdx );1445 1434 UInt uiCtuRsAddr = pcCU->getCtuRsAddr(); 1435 1436 m_ppcYuvReco[uiDepth]->copyToPicYuv ( pcPic->getPicYuvRec (), uiCtuRsAddr, uiZorderIdx ); 1437 1446 1438 return; 1447 1439 } 1448 1440 1449 Void TDecCu::xDecodeInterTexture ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1450 { 1451 UInt uiWidth = pcCU->getWidth ( uiAbsPartIdx ); 1452 UInt uiHeight = pcCU->getHeight( uiAbsPartIdx ); 1453 TCoeff* piCoeff; 1454 1455 Pel* pResi; 1456 UInt trMode = pcCU->getTransformIdx( uiAbsPartIdx ); 1457 1458 // Y 1459 piCoeff = pcCU->getCoeffY(); 1460 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 1461 1462 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 1463 1464 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1465 1466 // Cb and Cr 1467 Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 1468 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 1469 1470 uiWidth >>= 1; 1471 uiHeight >>= 1; 1472 piCoeff = pcCU->getCoeffCb(); pResi = m_ppcYuvResi[uiDepth]->getCbAddr(); 1473 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1474 1475 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 1476 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 1477 1478 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); 1479 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1441 Void TDecCu::xDecodeInterTexture ( TComDataCU* pcCU, UInt uiDepth ) 1442 { 1443 1444 TComTURecurse tuRecur(pcCU, 0, uiDepth); 1445 1446 for(UInt ch=0; ch<pcCU->getPic()->getNumberValidComponents(); ch++) 1447 { 1448 const ComponentID compID=ComponentID(ch); 1449 DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[compID]) 1450 1451 m_pcTrQuant->invRecurTransformNxN ( compID, m_ppcYuvResi[uiDepth], tuRecur ); 1452 } 1453 1454 DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[MAX_NUM_COMPONENT]) 1480 1455 } 1481 1456 … … 1488 1463 * \param uiWidth CU width 1489 1464 * \param uiHeight CU height 1490 * \param ttText texture component type1465 * \param compID colour component ID 1491 1466 * \returns Void 1492 1467 */ 1493 Void TDecCu::xDecodePCMTexture( TComDataCU* pcCU, UInt uiPartIdx, Pel *piPCM, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType ttText) 1494 { 1495 UInt uiX, uiY; 1496 Pel* piPicReco; 1497 UInt uiPicStride; 1498 UInt uiPcmLeftShiftBit; 1499 1500 if( ttText == TEXT_LUMA ) 1501 { 1502 uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(); 1503 piPicReco = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 1504 uiPcmLeftShiftBit = g_bitDepthY - pcCU->getSlice()->getSPS()->getPCMBitDepthLuma(); 1505 } 1506 else 1507 { 1508 uiPicStride = pcCU->getPic()->getPicYuvRec()->getCStride(); 1509 1510 if( ttText == TEXT_CHROMA_U ) 1511 { 1512 piPicReco = pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 1513 } 1514 else 1515 { 1516 piPicReco = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 1517 } 1518 uiPcmLeftShiftBit = g_bitDepthC - pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 1519 } 1520 1521 for( uiY = 0; uiY < uiHeight; uiY++ ) 1522 { 1523 for( uiX = 0; uiX < uiWidth; uiX++ ) 1468 Void TDecCu::xDecodePCMTexture( TComDataCU* pcCU, const UInt uiPartIdx, const Pel *piPCM, Pel* piReco, const UInt uiStride, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) 1469 { 1470 Pel* piPicReco = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiPartIdx); 1471 const UInt uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(compID); 1472 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 1473 const UInt uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID)); 1474 1475 for(UInt uiY = 0; uiY < uiHeight; uiY++ ) 1476 { 1477 for(UInt uiX = 0; uiX < uiWidth; uiX++ ) 1524 1478 { 1525 1479 piReco[uiX] = (piPCM[uiX] << uiPcmLeftShiftBit); … … 1539 1493 Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt uiDepth ) 1540 1494 { 1541 // Luma 1542 UInt uiWidth = (g_uiMaxCUWidth >> uiDepth); 1543 UInt uiHeight = (g_uiMaxCUHeight >> uiDepth); 1544 1545 Pel* piPcmY = pcCU->getPCMSampleY(); 1546 Pel* piRecoY = m_ppcYuvReco[uiDepth]->getLumaAddr(0, uiWidth); 1547 1548 UInt uiStride = m_ppcYuvResi[uiDepth]->getStride(); 1549 1550 xDecodePCMTexture( pcCU, 0, piPcmY, piRecoY, uiStride, uiWidth, uiHeight, TEXT_LUMA); 1551 1552 // Cb and Cr 1553 UInt uiCWidth = (uiWidth>>1); 1554 UInt uiCHeight = (uiHeight>>1); 1555 1556 Pel* piPcmCb = pcCU->getPCMSampleCb(); 1557 Pel* piPcmCr = pcCU->getPCMSampleCr(); 1558 Pel* pRecoCb = m_ppcYuvReco[uiDepth]->getCbAddr(); 1559 Pel* pRecoCr = m_ppcYuvReco[uiDepth]->getCrAddr(); 1560 1561 UInt uiCStride = m_ppcYuvReco[uiDepth]->getCStride(); 1562 1563 xDecodePCMTexture( pcCU, 0, piPcmCb, pRecoCb, uiCStride, uiCWidth, uiCHeight, TEXT_CHROMA_U); 1564 xDecodePCMTexture( pcCU, 0, piPcmCr, pRecoCr, uiCStride, uiCWidth, uiCHeight, TEXT_CHROMA_V); 1565 } 1566 1567 /** Function for filling the PCM buffer of a CU using its reconstructed sample array 1568 * \param pcCU pointer to current CU 1569 * \param uiDepth CU Depth 1570 * \returns Void 1495 const UInt maxCuWidth = pcCU->getSlice()->getSPS()->getMaxCUWidth(); 1496 const UInt maxCuHeight = pcCU->getSlice()->getSPS()->getMaxCUHeight(); 1497 for (UInt ch=0; ch < pcCU->getPic()->getNumberValidComponents(); ch++) 1498 { 1499 const ComponentID compID = ComponentID(ch); 1500 const UInt width = (maxCuWidth >>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleX(compID))); 1501 const UInt height = (maxCuHeight>>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleY(compID))); 1502 const UInt stride = m_ppcYuvResi[uiDepth]->getStride(compID); 1503 Pel * pPCMChannel = pcCU->getPCMSample(compID); 1504 Pel * pRecChannel = m_ppcYuvReco[uiDepth]->getAddr(compID); 1505 xDecodePCMTexture( pcCU, 0, pPCMChannel, pRecChannel, stride, width, height, compID ); 1506 } 1507 } 1508 1509 /** Function for filling the PCM buffer of a CU using its reconstructed sample array 1510 * \param pCU pointer to current CU 1511 * \param depth CU Depth 1571 1512 */ 1572 1513 Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt depth) 1573 1514 { 1574 // Luma 1575 UInt width = (g_uiMaxCUWidth >> depth); 1576 UInt height = (g_uiMaxCUHeight >> depth); 1577 1578 Pel* pPcmY = pCU->getPCMSampleY(); 1579 Pel* pRecoY = m_ppcYuvReco[depth]->getLumaAddr(0, width); 1580 1581 UInt stride = m_ppcYuvReco[depth]->getStride(); 1582 1583 for(Int y = 0; y < height; y++ ) 1584 { 1585 for(Int x = 0; x < width; x++ ) 1586 { 1587 pPcmY[x] = pRecoY[x]; 1588 } 1589 pPcmY += width; 1590 pRecoY += stride; 1591 } 1592 1593 // Cb and Cr 1594 UInt widthC = (width>>1); 1595 UInt heightC = (height>>1); 1596 1597 Pel* pPcmCb = pCU->getPCMSampleCb(); 1598 Pel* pPcmCr = pCU->getPCMSampleCr(); 1599 Pel* pRecoCb = m_ppcYuvReco[depth]->getCbAddr(); 1600 Pel* pRecoCr = m_ppcYuvReco[depth]->getCrAddr(); 1601 1602 UInt strideC = m_ppcYuvReco[depth]->getCStride(); 1603 1604 for(Int y = 0; y < heightC; y++ ) 1605 { 1606 for(Int x = 0; x < widthC; x++ ) 1607 { 1608 pPcmCb[x] = pRecoCb[x]; 1609 pPcmCr[x] = pRecoCr[x]; 1610 } 1611 pPcmCr += widthC; 1612 pPcmCb += widthC; 1613 pRecoCb += strideC; 1614 pRecoCr += strideC; 1615 } 1616 1515 const ChromaFormat format = pCU->getPic()->getChromaFormat(); 1516 const UInt numValidComp = getNumberValidComponents(format); 1517 const UInt maxCuWidth = pCU->getSlice()->getSPS()->getMaxCUWidth(); 1518 const UInt maxCuHeight = pCU->getSlice()->getSPS()->getMaxCUHeight(); 1519 1520 for (UInt componentIndex = 0; componentIndex < numValidComp; componentIndex++) 1521 { 1522 const ComponentID component = ComponentID(componentIndex); 1523 1524 const UInt width = maxCuWidth >> (depth + getComponentScaleX(component, format)); 1525 const UInt height = maxCuHeight >> (depth + getComponentScaleY(component, format)); 1526 1527 Pel *source = m_ppcYuvReco[depth]->getAddr(component, 0, width); 1528 Pel *destination = pCU->getPCMSample(component); 1529 1530 const UInt sourceStride = m_ppcYuvReco[depth]->getStride(component); 1531 1532 for (Int line = 0; line < height; line++) 1533 { 1534 for (Int column = 0; column < width; column++) 1535 { 1536 destination[column] = source[column]; 1537 } 1538 1539 source += sourceStride; 1540 destination += width; 1541 } 1542 } 1617 1543 } 1618 1544
Note: See TracChangeset for help on using the changeset viewer.