Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
- Timestamp:
- 7 Apr 2015, 17:05:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 111 111 m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx ); 112 112 } 113 114 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 115 Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 116 { 117 if ( !pcCU->getSlice()->getIsDepth() ) 118 { 119 return; 120 } 121 if( bRD ) 122 { 123 uiAbsPartIdx = 0; 124 } 125 m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx ); 126 } 127 #else 113 128 #if H_3D_SINGLE_DEPTH 114 129 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) … … 125 140 } 126 141 #endif 142 #endif 143 127 144 /** encode merge flag 128 145 * \param pcCU … … 254 271 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 255 272 273 #if !HHI_MOVE_SYN_K0052 256 274 #if H_3D_DBBP 257 275 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) … … 259 277 encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD); 260 278 } 279 #endif 261 280 #endif 262 281 } … … 285 304 } 286 305 306 #if H_3D_DISABLE_CHROMA 307 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd ) 308 #else 287 309 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ) 288 { 310 #endif 311 { 312 313 #if H_MV_ENC_DEC_TRAC 314 #if ENC_DEC_TRACE 315 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 316 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 317 318 DTRACE_TU_S("=========== transform_tree ===========\n") 319 DTRACE_TU("x0", uiLPelX) 320 DTRACE_TU("x1", uiTPelY) 321 DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth) 322 DTRACE_TU("trafoDepth" , uiDepth) 323 #endif 324 #endif 325 289 326 const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth; 290 327 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; … … 292 329 UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 293 330 UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 294 331 #if H_3D_DISABLE_CHROMA 332 if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ) 333 { 334 cbfU = 0; 335 cbfV = 0; 336 } 337 #endif 295 338 if(uiTrIdx==0) 296 339 { … … 309 352 cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 310 353 cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 354 #if H_3D_DISABLE_CHROMA 355 if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ) 356 { 357 cbfU = 0; 358 cbfV = 0; 359 } 360 #endif 311 361 } 312 362 } … … 349 399 if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) 350 400 { 401 #if H_3D_DISABLE_CHROMA 402 if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd) 403 { 404 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ) 405 { 406 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ); 407 } 408 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ) 409 { 410 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ); 411 } 412 } 413 #else 351 414 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ) 352 415 { … … 357 420 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ); 358 421 } 422 #endif 359 423 } 360 424 else if( uiLog2TrafoSize == 2 ) 361 425 { 426 #if H_3D_DISABLE_CHROMA 427 if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) 428 { 362 429 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ); 363 430 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 431 } 432 #else 433 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ); 434 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 435 #endif 364 436 } 365 437 … … 374 446 const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 375 447 448 #if H_3D_DISABLE_CHROMA 449 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 450 451 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 452 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ,rd ); 453 454 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 455 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 456 457 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 458 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 459 #else 376 460 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 377 461 … … 384 468 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 385 469 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 470 #endif 386 471 } 387 472 else … … 400 485 #endif 401 486 487 #if H_3D_DISABLE_CHROMA 488 Bool notcbfUV = !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ? 1 : ( !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) ; 489 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && 490 uiDepth == pcCU->getDepth( uiAbsPartIdx ) && notcbfUV ) 491 #else 402 492 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 493 #endif 403 494 { 404 495 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) ); … … 489 580 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx,true ); 490 581 #if H_3D_DIM_SDC 582 #if H_3D_DISABLE_CHROMA 583 if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || bRD ) ) 584 #else 491 585 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 586 #endif 492 587 #endif 493 588 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); … … 657 752 * \param uiHeight 658 753 */ 754 #if H_3D_DISABLE_CHROMA 755 Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd ) 756 #else 659 757 Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ) 758 #endif 660 759 { 661 760 UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); … … 668 767 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 669 768 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 769 #if H_3D_DISABLE_CHROMA 770 if (!pcCU->getSlice()->getIsDepth() ) 771 { 772 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 773 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 774 } 775 #else 670 776 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 671 777 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 672 } 778 #endif 779 } 780 673 781 674 782 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) … … 723 831 } 724 832 833 #if H_3D_DISABLE_CHROMA 834 xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd); 835 #else 725 836 xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP); 837 #endif 726 838 } 727 839 … … 792 904 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 793 905 { 794 if( bRD ) 795 { 796 uiAbsPartIdx = 0; 797 } 798 m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx ); 906 #if HHI_MOVE_SYN_K0052 907 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && 908 ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || 909 pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && 910 pcCU->getWidth(uiAbsPartIdx) > 8 && 911 pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) 912 { 913 #endif 914 if( bRD ) 915 { 916 uiAbsPartIdx = 0; 917 } 918 m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx ); 919 #if HHI_MOVE_SYN_K0052 920 } 921 #endif 799 922 } 800 923 #endif
Note: See TracChangeset for help on using the changeset viewer.